This commit is contained in:
Mashy 2019-07-26 21:30:20 +10:00
parent abd35b8bef
commit f295235b52
3 changed files with 7 additions and 8 deletions

View File

@ -15,7 +15,7 @@ const addState = connect(
const { ws, constructs, team } = state;
function sendConstructSpawn(name) {
return ws.sendConstructSpawn(name);
return ws.sendMtxConstructBuy(name);
}
return {

View File

@ -46,10 +46,6 @@ function createSocket(events) {
send(['AccountInstances', {}]);
}
function sendConstructSpawn() {
send(['MtxConstructBuy', {}]);
}
function sendGameState(id) {
send(['GameState', { id }]);
}
@ -135,6 +131,9 @@ function createSocket(events) {
send(['MtxBuy', { mtx }]);
}
function sendMtxConstructBuy() {
send(['MtxConstructBuy', {}]);
}
// -------------
// Incoming
// -------------
@ -281,7 +280,6 @@ function createSocket(events) {
return {
sendAccountConstructs,
sendAccountInstances,
sendConstructSpawn,
sendGameState,
sendGameReady,
sendGameSkill,
@ -300,6 +298,7 @@ function createSocket(events) {
sendItemInfo,
sendMtxApply,
sendMtxBuy,
sendMtxConstructBuy,
connect,
};
}

View File

@ -27,10 +27,10 @@ pub enum RpcMessage {
AccountConstructs(Vec<Construct>),
AccountInstances(Vec<Instance>),
AccountShop(mtx::Shop),
ConstructSpawn(Construct),
GameState(Game),
ItemInfo(ItemInfoCtr),
ConstructSpawn(Construct),
OpenInstances(Vec<Instance>),
InstanceState(Instance),
@ -153,7 +153,7 @@ pub fn receive(data: Vec<u8>, db: &Db, begin: Instant, account: &Option<Account>
RpcRequest::VboxUnequip { instance_id, construct_id, target } =>
Ok(RpcMessage::InstanceState(vbox_unequip(&mut tx, account, instance_id, construct_id, target)?)),
RpcRequest::MtxConstructBuy { } =>
RpcRequest::MtxConstructBuy {} =>
Ok(RpcMessage::ConstructSpawn(construct_spawn(&mut tx, account.id, generate_name())?)),
RpcRequest::MtxConstructApply { mtx, construct_id, name } =>