--- a/gameServer2/src/server/actions.rs Wed Jan 25 23:48:23 2017 +0300
+++ b/gameServer2/src/server/actions.rs Thu Jan 26 14:45:44 2017 +0300
@@ -12,6 +12,8 @@
RemoveClient,
ByeClient(String),
ReactProtocolMessage(HWProtocolMessage),
+ CheckRegistered,
+ JoinLobby,
}
use self::Action::*;
@@ -32,6 +34,18 @@
},
ReactProtocolMessage(msg) =>
handlers::handle(server, token, poll, msg),
+ CheckRegistered =>
+ if server.clients[token].protocolNumber > 0 && server.clients[token].nick != "" {
+ server.react(token, poll, vec![
+ JoinLobby,
+ ]);
+ },
+ JoinLobby => {
+ let msg_string = LobbyJoined(&[&server.clients[token].nick]).to_raw_protocol();
+ server.react(token, poll, vec![
+ SendMe(msg_string),
+ ]);
+ },
//_ => unimplemented!(),
}
}