pvp queue join messages

This commit is contained in:
ntr 2019-09-03 16:15:40 +10:00
parent e4a952ecbb
commit c83172ca3d
3 changed files with 10 additions and 3 deletions

View File

@ -24,6 +24,7 @@ ssh -q "$TARGET" ls -lah "$SERVER_BIN_DIR"
echo "syncing client $VERSION"
rsync -a --delete --delete-excluded "$MNML_PATH/client/dist/" "$TARGET:$CLIENT_DIST_DIR/$VERSION/"
ssh -q "$TARGET" ln -nfs "$CLIENT_DIST_DIR/$VERSION" "$CLIENT_PUBLIC_DIR"
ssh -q "$TARGET" ls -lah "$CLIENT_DIST_DIR"
echo "restarting mnml service"
ssh -q -t "$TARGET" sudo service mnml restart && sleep 1 && systemctl --no-pager status mnml

View File

@ -223,8 +223,8 @@ function createSocket(events) {
ItemInfo: onItemInfo,
Pong: onPong,
QueueRequested: () => console.log('pvp queue request received'),
QueueJoined: () => console.log('you have joined the pvp queue'),
QueueRequested: () => events.notify('pvp queue request received'),
QueueJoined: () => events.notify('you have joined the pvp queue'),
Error: errHandler,
};

View File

@ -192,8 +192,14 @@ impl Events {
},
None => {
info!("joined game queue id={:?} account={:?}", req.id, req.account);
match self.clients.get(&req.id) {
Some(ref c) => {
c.tx.send(RpcMessage::QueueJoined(()))?;
Some(req)
},
None => return Err(format_err!("missing client client={:?}", req.id)),
}
},
};
Ok(())