From eb96b59ca2e4b40ac5182e6be4d0725345257a67 Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 15 Oct 2018 16:18:50 +1100 Subject: [PATCH] standardise signatures --- server/src/rpc.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/src/rpc.rs b/server/src/rpc.rs index 223bb0d3..9d45998e 100755 --- a/server/src/rpc.rs +++ b/server/src/rpc.rs @@ -38,13 +38,13 @@ impl Rpc { // now we have the method name // match on that to determine what fn to call let response = match v.method.as_ref() { - "cryp_spawn" => Rpc::cryp_spawn(data, &mut tx, account), + "cryp_spawn" => Rpc::cryp_spawn(data, &mut tx, account, client), "combat_pve" => Rpc::combat_pve(data, &mut tx, account, client), - "account_create" => Rpc::account_create(data, &mut tx), - "account_login" => Rpc::account_login(data, &mut tx), - "account_cryps" => Rpc::account_cryps(&mut tx, account), - "item_list" => Rpc::item_list(&mut tx, account), - "item_use" => Rpc::item_use(data, &mut tx, account), + "account_create" => Rpc::account_create(data, &mut tx, account, client), + "account_login" => Rpc::account_login(data, &mut tx, account, client), + "account_cryps" => Rpc::account_cryps(data, &mut tx, account, client), + "item_list" => Rpc::item_list(data, &mut tx, account, client), + "item_use" => Rpc::item_use(data, &mut tx, account, client), _ => Err(err_msg("unknown method")), }; @@ -86,7 +86,7 @@ impl Rpc { return Ok(battle_response); } - fn cryp_spawn(data: Vec, tx: &mut Transaction, account: Option) -> Result { + fn cryp_spawn(data: Vec, tx: &mut Transaction, account: Option, client: &mut WebSocket) -> Result { match from_slice::(&data) { Ok(v) => { match account { @@ -101,7 +101,7 @@ impl Rpc { } } - fn account_create(data: Vec, tx: &mut Transaction) -> Result { + fn account_create(data: Vec, tx: &mut Transaction, account: Option, client: &mut WebSocket) -> Result { match from_slice::(&data) { Ok(v) => Ok(RpcResponse { method: v.method, @@ -111,7 +111,7 @@ impl Rpc { } } - fn account_login(data: Vec, tx: &mut Transaction) -> Result { + fn account_login(data: Vec, tx: &mut Transaction, _account: Option, _client: &mut WebSocket) -> Result { match from_slice::(&data) { Ok(v) => Ok(RpcResponse { method: v.method, @@ -121,7 +121,7 @@ impl Rpc { } } - fn account_cryps(tx: &mut Transaction, account: Option) -> Result { + fn account_cryps(_data: Vec, tx: &mut Transaction, account: Option, _client: &mut WebSocket) -> Result { match account { Some(a) => Ok(RpcResponse { method: "account_cryps".to_string(), @@ -131,7 +131,7 @@ impl Rpc { } } - fn item_list(tx: &mut Transaction, account: Option) -> Result { + fn item_list(_data: Vec, tx: &mut Transaction, account: Option, _client: &mut WebSocket) -> Result { match account { Some(a) => Ok(RpcResponse { method: "item_list".to_string(), @@ -141,7 +141,7 @@ impl Rpc { } } - fn item_use(data: Vec, tx: &mut Transaction, account: Option) -> Result { + fn item_use(data: Vec, tx: &mut Transaction, account: Option, _client: &mut WebSocket) -> Result { match from_slice::(&data) { Ok(v) => { match account {