instance list
This commit is contained in:
parent
47b216cb11
commit
dd4431aaa3
@ -10,8 +10,8 @@
|
||||
<meta name="author" content="ntr@smokestack.io">
|
||||
<link rel="manifest" href="manifest.webmanifest">
|
||||
<link rel="stylesheet" href="./node_modules/izitoast/dist/css/iziToast.min.css"></script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Jura" rel="stylesheet">
|
||||
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<!-- <link href="https://fonts.googleapis.com/css?family=Jura" rel="stylesheet"> -->
|
||||
<!-- <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> -->
|
||||
<link rel="stylesheet" href="assets/styles/normalize.css">
|
||||
<link rel="stylesheet" href="assets/styles/skeleton.css">
|
||||
</head>
|
||||
|
||||
@ -7,6 +7,7 @@ export const setInstances = value => ({ type: 'SET_INSTANCES', value });
|
||||
export const setNav = value => ({ type: 'SET_NAV', value });
|
||||
export const setShowNav = value => ({ type: 'SET_SHOW_NAV', value });
|
||||
export const setInstance = value => ({ type: 'SET_INSTANCE', value });
|
||||
export const setInstanceList = value => ({ type: 'SET_INSTANCE_LIST', value });
|
||||
export const setPing = value => ({ type: 'SET_PING', value });
|
||||
export const setPlayer = value => ({ type: 'SET_PLAYER', value });
|
||||
export const setGame = value => ({ type: 'SET_GAME', value });
|
||||
|
||||
@ -9,7 +9,7 @@ const idSort = stringSort('id');
|
||||
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const { ws, constructs, team, instances, account } = state;
|
||||
const { ws, constructs, team, instanceList, account } = state;
|
||||
|
||||
function sendInstanceJoin(instance) {
|
||||
if (team.length) {
|
||||
@ -33,7 +33,7 @@ const addState = connect(
|
||||
sendInstanceJoin,
|
||||
sendInstanceState,
|
||||
sendInstanceList,
|
||||
instances,
|
||||
instanceList,
|
||||
};
|
||||
},
|
||||
|
||||
@ -55,14 +55,14 @@ function List(args) {
|
||||
sendInstanceState,
|
||||
sendInstanceJoin,
|
||||
sendInstanceList,
|
||||
instances,
|
||||
instanceList,
|
||||
navToTeam,
|
||||
} = args;
|
||||
|
||||
function instanceList() {
|
||||
if (!instances) return <div>...</div>;
|
||||
function listElements() {
|
||||
if (!instanceList) return <div>...</div>;
|
||||
|
||||
const instancePanels = instances.map(instance => {
|
||||
const instancePanels = instanceList.map(instance => {
|
||||
const player = instance.players.find(p => p.id === account.id);
|
||||
const scoreText = player
|
||||
? `${player.score.wins} : ${player.score.losses}`
|
||||
@ -110,11 +110,7 @@ function List(args) {
|
||||
const constructPanels = constructs
|
||||
.filter(c => team.includes(c.id))
|
||||
.sort(idSort)
|
||||
.map(construct => {
|
||||
const colour = team.indexOf(construct.id);
|
||||
const selected = colour > -1;
|
||||
|
||||
return (
|
||||
.map(construct =>
|
||||
<div
|
||||
key={construct.id}
|
||||
className="menu-construct" >
|
||||
@ -122,7 +118,6 @@ function List(args) {
|
||||
<h2>{construct.name}</h2>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
const header = (
|
||||
<div className="top">
|
||||
@ -141,7 +136,7 @@ function List(args) {
|
||||
<div className="construct-list">
|
||||
{constructPanels}
|
||||
</div>
|
||||
{instanceList()}
|
||||
{listElements()}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ const addState = connect(
|
||||
account,
|
||||
instances,
|
||||
team,
|
||||
constructs,
|
||||
// constructs,
|
||||
game,
|
||||
} = state;
|
||||
|
||||
@ -25,14 +25,18 @@ const addState = connect(
|
||||
return ws.sendAccountInstances();
|
||||
}
|
||||
|
||||
function sendInstanceList() {
|
||||
return ws.sendInstanceList();
|
||||
}
|
||||
|
||||
return {
|
||||
account,
|
||||
instances,
|
||||
team,
|
||||
constructs,
|
||||
game,
|
||||
sendInstanceState,
|
||||
sendAccountInstances,
|
||||
sendInstanceList,
|
||||
};
|
||||
},
|
||||
function receiveDispatch(dispatch) {
|
||||
@ -77,9 +81,9 @@ function Nav(args) {
|
||||
account,
|
||||
sendInstanceState,
|
||||
sendAccountInstances,
|
||||
sendInstanceList,
|
||||
|
||||
team,
|
||||
constructs,
|
||||
instances,
|
||||
game,
|
||||
|
||||
@ -90,7 +94,10 @@ function Nav(args) {
|
||||
} = args;
|
||||
|
||||
function navTo(p) {
|
||||
if (p === 'list') sendAccountInstances();
|
||||
if (p === 'list') {
|
||||
sendInstanceList();
|
||||
sendAccountInstances();
|
||||
}
|
||||
return setNav(p);
|
||||
}
|
||||
|
||||
@ -104,14 +111,6 @@ function Nav(args) {
|
||||
<button key={i.id} onClick={() => joinInstance(i)} >{i.name}</button>
|
||||
));
|
||||
|
||||
const teamElements = team.map((c, i) => {
|
||||
if (c) {
|
||||
const construct = constructs.find(f => f.id === c);
|
||||
return <button key={c} onClick={() => navTo('team')}>{construct.name}</button>;
|
||||
}
|
||||
return <button key={i} onClick={() => navTo('team')}>+</button>;
|
||||
});
|
||||
|
||||
const haxSection = process.env.NODE_ENV === 'development'
|
||||
? (
|
||||
<Fragment>
|
||||
@ -121,13 +120,12 @@ function Nav(args) {
|
||||
</Fragment>)
|
||||
: null;
|
||||
|
||||
const canJoin = team.some(c => !c);
|
||||
|
||||
return (
|
||||
<nav onClick={hideNav} >
|
||||
<h2>Team</h2>
|
||||
{teamElements}
|
||||
<h2>Instances</h2>
|
||||
<button onClick={() => navTo('team')}>1. Select Team</button>
|
||||
<button onClick={() => navTo('list')}>2. Join</button>
|
||||
<button disabled={canJoin} onClick={() => navTo('list')}>2. Join</button>
|
||||
<hr />
|
||||
{joined}
|
||||
{haxSection}
|
||||
|
||||
@ -27,6 +27,10 @@ function registerEvents(store) {
|
||||
store.dispatch(actions.setConstructs(constructs));
|
||||
}
|
||||
|
||||
function setInstanceList(list) {
|
||||
store.dispatch(actions.setInstanceList(list));
|
||||
}
|
||||
|
||||
function setWs(ws) {
|
||||
store.dispatch(actions.setWs(ws));
|
||||
}
|
||||
@ -111,7 +115,7 @@ function registerEvents(store) {
|
||||
console.log('EVENT ->', 'scores', scores);
|
||||
}
|
||||
|
||||
function setInstanceList(v) {
|
||||
function setAccountInstances(v) {
|
||||
return store.dispatch(actions.setInstances(v));
|
||||
}
|
||||
|
||||
@ -200,6 +204,7 @@ function registerEvents(store) {
|
||||
setMenu,
|
||||
setInstance,
|
||||
setInstanceList,
|
||||
setAccountInstances,
|
||||
setVbox,
|
||||
setWs,
|
||||
setGameList,
|
||||
|
||||
@ -21,6 +21,7 @@ module.exports = {
|
||||
info: createReducer(null, 'SET_INFO'),
|
||||
instance: createReducer(null, 'SET_INSTANCE'),
|
||||
instances: createReducer([], 'SET_INSTANCES'),
|
||||
instanceList: createReducer([], 'SET_INSTANCE_LIST'),
|
||||
itemEquip: createReducer(null, 'SET_ITEM_EQUIP'),
|
||||
itemInfo: createReducer({ combos: [], items: [] }, 'SET_ITEM_INFO'),
|
||||
itemUnequip: createReducer(null, 'SET_ITEM_UNEQUIP'),
|
||||
|
||||
@ -55,10 +55,6 @@ function createSocket(events) {
|
||||
send({ method: 'account_instances', params: {} });
|
||||
}
|
||||
|
||||
function sendAccountZone() {
|
||||
send({ method: 'account_zone', params: {} });
|
||||
}
|
||||
|
||||
function sendConstructSpawn(name) {
|
||||
send({ method: 'construct_spawn', params: { name } });
|
||||
}
|
||||
@ -71,43 +67,39 @@ function createSocket(events) {
|
||||
send({ method: 'game_ready', params: { id } });
|
||||
}
|
||||
|
||||
function sendSpecForget(id, spec) {
|
||||
send({ method: 'construct_unspec', params: { id, spec } });
|
||||
}
|
||||
|
||||
function sendPlayerMmConstructsSet(constructIds) {
|
||||
send({ method: 'player_mm_constructs_set', params: { construct_ids: constructIds } });
|
||||
}
|
||||
|
||||
function sendInstanceState(instanceId) {
|
||||
send({ method: 'instance_state', params: { instance_id: instanceId } });
|
||||
}
|
||||
|
||||
function sendInstanceList() {
|
||||
send({ method: 'instance_list', params: {} });
|
||||
}
|
||||
|
||||
function sendVboxAccept(instanceId, group, index) {
|
||||
send({ method: 'player_vbox_accept', params: { instance_id: instanceId, group, index } });
|
||||
send({ method: 'vbox_accept', params: { instance_id: instanceId, group, index } });
|
||||
}
|
||||
|
||||
function sendVboxApply(instanceId, constructId, index) {
|
||||
send({ method: 'player_vbox_apply', params: { instance_id: instanceId, construct_id: constructId, index } });
|
||||
send({ method: 'vbox_apply', params: { instance_id: instanceId, construct_id: constructId, index } });
|
||||
events.setActiveItem(null);
|
||||
}
|
||||
|
||||
function sendVboxUnequip(instanceId, constructId, target) {
|
||||
send({ method: 'player_vbox_unequip', params: { instance_id: instanceId, construct_id: constructId, target } });
|
||||
send({ method: 'vbox_unequip', params: { instance_id: instanceId, construct_id: constructId, target } });
|
||||
events.clearInfo();
|
||||
}
|
||||
|
||||
function sendVboxDiscard(instanceId) {
|
||||
send({ method: 'player_vbox_discard', params: { instance_id: instanceId } });
|
||||
send({ method: 'vbox_discard', params: { instance_id: instanceId } });
|
||||
}
|
||||
|
||||
function sendVboxCombine(instanceId, indices) {
|
||||
send({ method: 'player_vbox_combine', params: { instance_id: instanceId, indices } });
|
||||
send({ method: 'vbox_combine', params: { instance_id: instanceId, indices } });
|
||||
events.clearCombiner();
|
||||
}
|
||||
|
||||
function sendVboxReclaim(instanceId, index) {
|
||||
send({ method: 'player_vbox_reclaim', params: { instance_id: instanceId, index } });
|
||||
send({ method: 'vbox_reclaim', params: { instance_id: instanceId, index } });
|
||||
}
|
||||
|
||||
function sendItemInfo() {
|
||||
@ -129,18 +121,6 @@ function createSocket(events) {
|
||||
events.setActiveSkill(null);
|
||||
}
|
||||
|
||||
function sendZoneCreate() {
|
||||
send({ method: 'zone_create', params: {} });
|
||||
}
|
||||
|
||||
function sendZoneJoin(zoneId, nodeId, constructIds) {
|
||||
send({ method: 'zone_join', params: { zone_id: zoneId, node_id: nodeId, construct_ids: constructIds } });
|
||||
}
|
||||
|
||||
function sendZoneClose(zoneId) {
|
||||
send({ method: 'zone_close', params: { zone_id: zoneId } });
|
||||
}
|
||||
|
||||
function sendInstanceJoin(instanceId, constructs) {
|
||||
send({ method: 'instance_join', params: { instance_id: instanceId, construct_ids: constructs } });
|
||||
}
|
||||
@ -153,11 +133,6 @@ function createSocket(events) {
|
||||
send({ method: 'instance_ready', params: { instance_id: instanceId } });
|
||||
}
|
||||
|
||||
function sendInstanceScores(instanceId) {
|
||||
send({ method: 'instance_scores', params: { instance_id: instanceId } });
|
||||
}
|
||||
|
||||
|
||||
// -------------
|
||||
// Incoming
|
||||
// -------------
|
||||
@ -173,7 +148,7 @@ function createSocket(events) {
|
||||
|
||||
function accountInstanceList(res) {
|
||||
const [struct, playerList] = res;
|
||||
events.setInstanceList(playerList);
|
||||
events.setAccountInstances(playerList);
|
||||
}
|
||||
|
||||
function accountConstructs(response) {
|
||||
@ -219,6 +194,11 @@ function createSocket(events) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function instanceList([, list]) {
|
||||
events.setInstanceList(list);
|
||||
return true;
|
||||
}
|
||||
|
||||
function clearInstanceStateTimeout() {
|
||||
clearTimeout(instanceStateTimeout);
|
||||
}
|
||||
@ -246,9 +226,7 @@ function createSocket(events) {
|
||||
account_create: accountLogin,
|
||||
account_constructs: accountConstructs,
|
||||
account_instances: accountInstanceList,
|
||||
zone_create: res => console.log(res),
|
||||
zone_state: zoneState,
|
||||
zone_close: res => console.log(res),
|
||||
instance_list: instanceList,
|
||||
instance_state: instanceState,
|
||||
item_info: itemInfo,
|
||||
pong,
|
||||
@ -340,21 +318,15 @@ function createSocket(events) {
|
||||
sendAccountCreate,
|
||||
sendAccountConstructs,
|
||||
sendAccountInstances,
|
||||
sendAccountZone,
|
||||
sendGameState,
|
||||
sendGameReady,
|
||||
sendGameSkill,
|
||||
sendGameTarget,
|
||||
sendConstructSpawn,
|
||||
sendSpecForget,
|
||||
sendZoneCreate,
|
||||
sendZoneJoin,
|
||||
sendZoneClose,
|
||||
sendInstanceJoin,
|
||||
sendInstanceList,
|
||||
sendInstanceReady,
|
||||
sendInstanceNew,
|
||||
sendInstanceScores,
|
||||
sendPlayerMmConstructsSet,
|
||||
sendInstanceState,
|
||||
sendVboxAccept,
|
||||
sendVboxApply,
|
||||
|
||||
@ -33,7 +33,6 @@ exports.up = async knex => {
|
||||
await knex.schema.createTable('players', table => {
|
||||
table.uuid('id').primary();
|
||||
table.index('id');
|
||||
table.binary('data').notNullable();
|
||||
table.timestamps(true, true);
|
||||
|
||||
// the instance
|
||||
|
||||
@ -190,8 +190,8 @@ pub fn account_instances(tx: &mut Transaction, account: &Account) -> Result<Vec<
|
||||
let query = "
|
||||
SELECT data, id
|
||||
FROM instances
|
||||
WHERE open = true
|
||||
OR id IN (
|
||||
WHERE finished = false
|
||||
AND id IN (
|
||||
SELECT instance
|
||||
FROM players
|
||||
WHERE account = $1
|
||||
|
||||
@ -585,6 +585,8 @@ impl Game {
|
||||
if player.warnings >= 3 {
|
||||
player.forfeit();
|
||||
info!("upkeep: {:} forfeited", player.name);
|
||||
//todo
|
||||
// self.resolved.push(forfeit)
|
||||
// self.log.push(format!("{:} forfeited.", player.name));
|
||||
}
|
||||
}
|
||||
|
||||
@ -595,9 +595,9 @@ pub fn instance_delete(tx: &mut Transaction, id: Uuid) -> Result<(), Error> {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
pub fn instance_get_open(tx: &mut Transaction) -> Result<Instance, Error> {
|
||||
pub fn instance_list(tx: &mut Transaction) -> Result<Vec<Instance>, Error> {
|
||||
let query = "
|
||||
SELECT *
|
||||
SELECT data, id
|
||||
FROM instances
|
||||
WHERE open = true;
|
||||
";
|
||||
@ -605,15 +605,21 @@ pub fn instance_get_open(tx: &mut Transaction) -> Result<Instance, Error> {
|
||||
let result = tx
|
||||
.query(query, &[])?;
|
||||
|
||||
let returned = match result.iter().next() {
|
||||
Some(row) => row,
|
||||
None => return Err(err_msg("instance not found")),
|
||||
};
|
||||
let mut list = vec![];
|
||||
|
||||
let instance_bytes: Vec<u8> = returned.get("data");
|
||||
let instance = from_slice::<Instance>(&instance_bytes)?;
|
||||
for row in result.into_iter() {
|
||||
let bytes: Vec<u8> = row.get(0);
|
||||
let id = row.get(1);
|
||||
|
||||
return Ok(instance);
|
||||
match from_slice::<Instance>(&bytes) {
|
||||
Ok(i) => list.push(i),
|
||||
Err(_e) => {
|
||||
instance_delete(tx, id)?;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return Ok(list);
|
||||
}
|
||||
|
||||
pub fn instances_need_upkeep(tx: &mut Transaction) -> Result<Vec<Instance>, Error> {
|
||||
|
||||
@ -49,7 +49,7 @@ fn setup_logger() -> Result<(), fern::InitError> {
|
||||
})
|
||||
.level_for("postgres", log::LevelFilter::Info)
|
||||
.level_for("tungstenite", log::LevelFilter::Info)
|
||||
.level(log::LevelFilter::Debug)
|
||||
.level(log::LevelFilter::Info)
|
||||
.chain(std::io::stdout())
|
||||
.chain(fern::log_file("log/mnml.log")?)
|
||||
.apply()?;
|
||||
|
||||
@ -118,7 +118,7 @@ pub fn start() {
|
||||
},
|
||||
// connection is closed
|
||||
Err(e) => {
|
||||
info!("{:?}", e);
|
||||
debug!("{:?}", e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
@ -18,7 +18,7 @@ use account::{Account, account_create, account_login, account_from_token, accoun
|
||||
use skill::{Skill};
|
||||
use spec::{Spec};
|
||||
use player::{Score};
|
||||
use instance::{Instance, instance_state, instance_new, instance_ready, instance_join};
|
||||
use instance::{Instance, instance_state, instance_list, instance_new, instance_ready, instance_join};
|
||||
use vbox::{vbox_accept, vbox_apply, vbox_discard, vbox_combine, vbox_reclaim, vbox_unequip};
|
||||
use item::{Item, ItemInfoCtr, item_info};
|
||||
|
||||
@ -78,18 +78,18 @@ impl Rpc {
|
||||
"game_skill" => Rpc::game_skill(data, &mut tx, account.unwrap(), client),
|
||||
"game_ready" => Rpc::game_ready(data, &mut tx, account.unwrap(), client),
|
||||
|
||||
"instance_list" => Rpc::instance_list(data, &mut tx, account.unwrap(), client),
|
||||
"instance_join" => Rpc::instance_join(data, &mut tx, account.unwrap(), client),
|
||||
"instance_ready" => Rpc::instance_ready(data, &mut tx, account.unwrap(), client),
|
||||
"instance_new" => Rpc::instance_new(data, &mut tx, account.unwrap(), client),
|
||||
"instance_state" => Rpc::instance_state(data, &mut tx, account.unwrap(), client),
|
||||
|
||||
"player_vbox_accept" => Rpc::player_vbox_accept(data, &mut tx, account.unwrap(), client),
|
||||
"player_vbox_apply" => Rpc::player_vbox_apply(data, &mut tx, account.unwrap(), client),
|
||||
"player_vbox_combine" => Rpc::player_vbox_combine(data, &mut tx, account.unwrap(), client),
|
||||
"player_vbox_discard" => Rpc::player_vbox_discard(data, &mut tx, account.unwrap(), client),
|
||||
"player_vbox_reclaim" => Rpc::player_vbox_reclaim(data, &mut tx, account.unwrap(), client),
|
||||
"player_vbox_unequip" => Rpc::player_vbox_unequip(data, &mut tx, account.unwrap(), client),
|
||||
|
||||
"vbox_accept" => Rpc::vbox_accept(data, &mut tx, account.unwrap(), client),
|
||||
"vbox_apply" => Rpc::vbox_apply(data, &mut tx, account.unwrap(), client),
|
||||
"vbox_combine" => Rpc::vbox_combine(data, &mut tx, account.unwrap(), client),
|
||||
"vbox_discard" => Rpc::vbox_discard(data, &mut tx, account.unwrap(), client),
|
||||
"vbox_reclaim" => Rpc::vbox_reclaim(data, &mut tx, account.unwrap(), client),
|
||||
"vbox_unequip" => Rpc::vbox_unequip(data, &mut tx, account.unwrap(), client),
|
||||
|
||||
_ => Err(format_err!("unknown method - {:?}", v.method)),
|
||||
};
|
||||
@ -269,6 +269,16 @@ impl Rpc {
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
fn instance_list(_data: Vec<u8>, tx: &mut Transaction, _account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
let response = RpcResponse {
|
||||
method: "instance_list".to_string(),
|
||||
params: RpcResult::InstanceList(instance_list(tx)?)
|
||||
};
|
||||
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
|
||||
// fn instance_ready(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
// let msg = from_slice::<InstanceReadyMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||
|
||||
@ -295,7 +305,7 @@ impl Rpc {
|
||||
}
|
||||
}
|
||||
|
||||
fn player_vbox_accept(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
fn vbox_accept(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
let msg = from_slice::<VboxAcceptMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||
|
||||
let response = RpcResponse {
|
||||
@ -306,7 +316,7 @@ impl Rpc {
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
fn player_vbox_discard(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
fn vbox_discard(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
let msg = from_slice::<VboxDiscardMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||
|
||||
let response = RpcResponse {
|
||||
@ -318,7 +328,7 @@ impl Rpc {
|
||||
}
|
||||
|
||||
|
||||
fn player_vbox_combine(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
fn vbox_combine(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
let msg = from_slice::<VboxCombineMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||
|
||||
let response = RpcResponse {
|
||||
@ -329,7 +339,7 @@ impl Rpc {
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
fn player_vbox_apply(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
fn vbox_apply(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
let msg = from_slice::<VboxApplyMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||
|
||||
let response = RpcResponse {
|
||||
@ -340,7 +350,7 @@ impl Rpc {
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
fn player_vbox_reclaim(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
fn vbox_reclaim(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
let msg = from_slice::<VboxReclaimMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||
|
||||
let response = RpcResponse {
|
||||
@ -351,7 +361,7 @@ impl Rpc {
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
fn player_vbox_unequip(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
fn vbox_unequip(data: Vec<u8>, tx: &mut Transaction, account: Account, _client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
let msg = from_slice::<VboxUnequipMsg>(&data).or(Err(err_msg("invalid params")))?;
|
||||
|
||||
let response = RpcResponse {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user