fix player bug
This commit is contained in:
parent
1571a39c24
commit
d6a3ca2eb4
@ -10,7 +10,6 @@ const addState = connect(
|
|||||||
function receiveState(state) {
|
function receiveState(state) {
|
||||||
const {
|
const {
|
||||||
ws,
|
ws,
|
||||||
account,
|
|
||||||
instance,
|
instance,
|
||||||
player,
|
player,
|
||||||
combiner,
|
combiner,
|
||||||
|
|||||||
@ -120,10 +120,11 @@ function registerEvents(store) {
|
|||||||
if (v) {
|
if (v) {
|
||||||
ws.startInstanceStateTimeout(v.id);
|
ws.startInstanceStateTimeout(v.id);
|
||||||
|
|
||||||
|
const player = v.players.find(p => p.id === account.id);
|
||||||
|
store.dispatch(actions.setPlayer(player));
|
||||||
|
|
||||||
if (!instance || v.id !== instance.id) {
|
if (!instance || v.id !== instance.id) {
|
||||||
store.dispatch(actions.setNav('vbox'));
|
store.dispatch(actions.setNav('vbox'));
|
||||||
const player = v.players.find(p => p.id === account.id);
|
|
||||||
store.dispatch(actions.setPlayer(player));
|
|
||||||
const first = player.constructs[0];
|
const first = player.constructs[0];
|
||||||
store.dispatch(actions.setActiveConstruct(first));
|
store.dispatch(actions.setActiveConstruct(first));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,11 +4,7 @@ use tungstenite::Message::Binary;
|
|||||||
use postgres::transaction::Transaction;
|
use postgres::transaction::Transaction;
|
||||||
use std::net::{TcpStream};
|
use std::net::{TcpStream};
|
||||||
|
|
||||||
// demo
|
|
||||||
use std::iter;
|
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use rand::{thread_rng, Rng};
|
|
||||||
use rand::distributions::{Alphanumeric};
|
|
||||||
|
|
||||||
use serde_cbor::{from_slice, to_vec};
|
use serde_cbor::{from_slice, to_vec};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
@ -353,11 +349,6 @@ impl Rpc {
|
|||||||
params: RpcResult::InstanceState(vbox_apply(msg.params, tx, &account)?)
|
params: RpcResult::InstanceState(vbox_apply(msg.params, tx, &account)?)
|
||||||
};
|
};
|
||||||
|
|
||||||
Rpc::send_msg(client, RpcResponse {
|
|
||||||
method: "account_constructs".to_string(),
|
|
||||||
params: RpcResult::ConstructList(account_constructs(tx, &account)?)
|
|
||||||
})?;
|
|
||||||
|
|
||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,11 +371,6 @@ impl Rpc {
|
|||||||
params: RpcResult::InstanceState(vbox_unequip(msg.params, tx, &account)?)
|
params: RpcResult::InstanceState(vbox_unequip(msg.params, tx, &account)?)
|
||||||
};
|
};
|
||||||
|
|
||||||
Rpc::send_msg(client, RpcResponse {
|
|
||||||
method: "account_constructs".to_string(),
|
|
||||||
params: RpcResult::ConstructList(account_constructs(tx, &account)?)
|
|
||||||
})?;
|
|
||||||
|
|
||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user