Skip to content

Commit

Permalink
add rsg build:ui script
Browse files Browse the repository at this point in the history
  • Loading branch information
asiaziola committed Sep 17, 2024
1 parent 4b709c1 commit 6bcdc06
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"serve:prod": "vite --config vite/config.prod.mjs",
"serve:prod:rsg": "VITE_GAME_MODE=rsg vite --config vite/config.prod.mjs",
"build:ui": "vite build --config vite/config.build.mjs",
"build:ui:rsg": "VITE_GAME_MODE=rsg vite build --config vite/config.build.mjs",
"deploy-session:local": "yarn build && node tools/deploy-spawn-session.js --env local --limit 20 --time $1",
"deploy-session:local:rsg": "yarn build && node tools/deploy-spawn-session.js --env local --limit 20 --gameMode rsg --time $1",
"deploy-session-game:local": "yarn build && node tools/deploy-spawn-session-game.js --env local --limit 20 --time $1",
Expand Down
2 changes: 1 addition & 1 deletion src/game/config/warp-ao.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getUrlParam } from '../utils/utils.js';
import Const from '../common/const.mjs';

const env = getUrlParam('env') || 'prod';
const mode = getUrlParam('mode') || 'ao';
const mode = getUrlParam('mode') || import.meta.env.VITE_GAME_MODE || 'ao';

console.log(`running in ${env} mode`);

Expand Down
2 changes: 1 addition & 1 deletion src/game/process/cmd/queue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Const from '../../common/const.mjs';

export function checkWhitelist(state, walletAddress) {
const { walletsWhitelist } = state;
if (walletsWhitelist.length && !walletsWhitelist.includes(walletAddress)) {
if (walletsWhitelist.length && !walletsWhitelist.find((w) => w.toLowerCase() == walletAddress.toLowerCase())) {
const error = `Developers' Internal testing session - ${walletAddress} wallet is not on the whitelist.`;
console.log(error);
return { player: { walletAddress, error } };
Expand Down
8 changes: 4 additions & 4 deletions src/game/process/game.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function handle(state, message) {
ao.result({
cmd: Const.Command.stats,
...gameInfo(state, action.walletAddress, message.Timestamp),
...checkWhitelist(state, action.walletAddress),
...checkWhitelist(state, action.mainWalletAddress || action.walletAddress),
...gameStats(state),
});
break;
Expand Down Expand Up @@ -185,12 +185,12 @@ export function handle(state, message) {
});
break;
case Const.Command.join:
if (action.balance) {
state.players[action.walletAddress].stats.coins.balance = action.balance;
}
if (action.generatedWalletAddress) {
state.generatedWalletsMapping[action.generatedWalletAddress] = action.mainWalletAddress;
}
if (action.balance) {
state.players[action.mainWalletAddress].stats.coins.balance = action.balance;
}
ao.result({
cmd: Const.Command.registered,
players: state.players,
Expand Down
7 changes: 4 additions & 3 deletions tools/deploy-spawn-session-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const walletsWhitelist = [
'qCtnbl5rsbF-1qRhawIQArCbO4_2TUOtnFv5oEun9gM',
'wF_7BbSj8Yzlt7T44nMGXwJHmqn8t2Sv45LfxILNu_o',
'8ByvIowIXWOvEaOhpTeFUQQ_ArTiXAYzxwUSHr_R7P8', // ppe's generated wallet for the fucking Opera, fuck
'0x50Ff383E6b308069fD525B0ABa1474d9fe086743',
];

export const TOKEN_CONTRACT_MOCK = {
Expand Down Expand Up @@ -51,7 +52,7 @@ export const TOKEN_CONTRACT = {
[GameTreasure.cbcoin.type]: {
id: 'rH_-7vT_IgfFWiDsrcTghIhb9aRclz7lXcK7RCOV2h8',
transfer: 'Transfer',
amount: 50,
amount: 0,
},
[GameTreasure.trunk.type]: {
id: 'OT9qTE2467gcozb2g8R6D6N3nQS94ENcaAIJfUzHCww',
Expand All @@ -66,12 +67,12 @@ export const TOKEN_CONTRACT = {
[GameTreasure.war.type]: {
id: 'xU9zFkq3X2ZQ6olwNVvr1vUWIjc3kXTWr7xKQD6dh10',
transfer: 'Transfer',
amount: 20,
amount: 0,
},
[GameTreasure.rsg.type]: {
id: 'p5OI99-BaY4QbZts266T7EDwofZqs-wVuYJmMCS0SUU',
transfer: 'Transfer',
amount: 0,
amount: 50,
},
};

Expand Down

0 comments on commit 6bcdc06

Please sign in to comment.