ready rpc
This commit is contained in:
@@ -19,6 +19,7 @@ function GamePanel(props) {
|
||||
setActiveCryp,
|
||||
selectSkillTarget,
|
||||
sendInstanceState,
|
||||
sendGameReady,
|
||||
activeCryp,
|
||||
account,
|
||||
showLog,
|
||||
@@ -69,6 +70,11 @@ function GamePanel(props) {
|
||||
onClick={() => toggleLog(!showLog)}>
|
||||
Log
|
||||
</button>
|
||||
<button
|
||||
className="game-back-btn instance-btn instance-ui-btn right"
|
||||
onClick={() => sendGameReady()}>
|
||||
Ready
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@ const addState = connect(
|
||||
return false;
|
||||
}
|
||||
|
||||
function sendGameReady() {
|
||||
ws.sendGameReady(game.id);
|
||||
}
|
||||
|
||||
function sendInstanceState(instanceId) {
|
||||
if (!instanceId) return false;
|
||||
return ws.sendInstanceState(instanceId);
|
||||
@@ -42,6 +46,7 @@ const addState = connect(
|
||||
activeCryp,
|
||||
selectSkillTarget,
|
||||
sendInstanceState,
|
||||
sendGameReady,
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ function createSocket(events) {
|
||||
send({ method: 'game_state', params: { id } });
|
||||
}
|
||||
|
||||
function sendGameJoin(gameId, crypIds) {
|
||||
send({ method: 'game_join', params: { game_id: gameId, cryp_ids: crypIds } });
|
||||
function sendGameReady(id) {
|
||||
send({ method: 'game_ready', params: { id } });
|
||||
}
|
||||
|
||||
function sendSpecForget(id, spec) {
|
||||
@@ -331,7 +331,7 @@ function createSocket(events) {
|
||||
sendAccountInstances,
|
||||
sendAccountZone,
|
||||
sendGameState,
|
||||
sendGameJoin,
|
||||
sendGameReady,
|
||||
sendGameSkill,
|
||||
sendGameTarget,
|
||||
sendCrypSpawn,
|
||||
|
||||
Reference in New Issue
Block a user