actually requesting account instances when game end

This commit is contained in:
Mashy 2019-09-12 15:32:57 +10:00
parent c82fb404d1
commit 58fa6a5734
3 changed files with 7 additions and 5 deletions

View File

@ -182,7 +182,7 @@ function registerEvents(store) {
} }
if (v.phase === 'Finished') { if (v.phase === 'Finished') {
setGame(null); setGame(null);
ws.sendAccountState(); ws.sendAccountInstances();
} }
return store.dispatch(actions.setInstance(v)); return store.dispatch(actions.setInstance(v));

View File

@ -43,8 +43,8 @@ function createSocket(events) {
send(['AccountConstructs', {}]); send(['AccountConstructs', {}]);
} }
function sendAccountState() { function sendAccountInstances() {
send(['AccountState', {}]); send(['AccountInstances', {}]);
} }
function sendAccountSetTeam(ids) { function sendAccountSetTeam(ids) {
@ -323,7 +323,7 @@ function createSocket(events) {
return { return {
sendAccountConstructs, sendAccountConstructs,
sendAccountState, sendAccountInstances,
sendAccountSetTeam, sendAccountSetTeam,

View File

@ -83,6 +83,7 @@ enum RpcRequest {
AccountState {}, AccountState {},
AccountShop {}, AccountShop {},
AccountInstances {},
AccountConstructs {}, AccountConstructs {},
AccountSetTeam { ids: Vec<Uuid> }, AccountSetTeam { ids: Vec<Uuid> },
@ -154,7 +155,8 @@ impl Connection {
Ok(RpcMessage::AccountState(account.clone())), Ok(RpcMessage::AccountState(account.clone())),
RpcRequest::AccountConstructs {} => RpcRequest::AccountConstructs {} =>
Ok(RpcMessage::AccountConstructs(account::constructs(&mut tx, &account)?)), Ok(RpcMessage::AccountConstructs(account::constructs(&mut tx, &account)?)),
RpcRequest::AccountInstances {} =>
Ok(RpcMessage::AccountInstances(account::account_instances(&mut tx, account)?)),
RpcRequest::AccountSetTeam { ids } => RpcRequest::AccountSetTeam { ids } =>
Ok(RpcMessage::AccountTeam(account::set_team(&mut tx, &account, ids)?)), Ok(RpcMessage::AccountTeam(account::set_team(&mut tx, &account, ids)?)),