From f295235b52cb037f06c55947017f0b5f6a6f4f8a Mon Sep 17 00:00:00 2001 From: Mashy Date: Fri, 26 Jul 2019 21:30:20 +1000 Subject: [PATCH] fn names --- client/src/components/team.jsx | 2 +- client/src/socket.jsx | 9 ++++----- server/src/rpc.rs | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/src/components/team.jsx b/client/src/components/team.jsx index 056a18dc..dd832c4b 100644 --- a/client/src/components/team.jsx +++ b/client/src/components/team.jsx @@ -15,7 +15,7 @@ const addState = connect( const { ws, constructs, team } = state; function sendConstructSpawn(name) { - return ws.sendConstructSpawn(name); + return ws.sendMtxConstructBuy(name); } return { diff --git a/client/src/socket.jsx b/client/src/socket.jsx index 7c62dc12..8d29f79c 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -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, }; } diff --git a/server/src/rpc.rs b/server/src/rpc.rs index 8022e24f..b58e7888 100644 --- a/server/src/rpc.rs +++ b/server/src/rpc.rs @@ -27,10 +27,10 @@ pub enum RpcMessage { AccountConstructs(Vec), AccountInstances(Vec), AccountShop(mtx::Shop), + ConstructSpawn(Construct), GameState(Game), ItemInfo(ItemInfoCtr), - ConstructSpawn(Construct), OpenInstances(Vec), InstanceState(Instance), @@ -153,7 +153,7 @@ pub fn receive(data: Vec, db: &Db, begin: Instant, account: &Option 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 } =>