// ========================== MESSAGE HANDLERS - USER ============================ // ------------------------------------------------------------------------------- // OnUserLoginRequestMessage // @Client -> @Server // ------------------------------------------------------------------------------- void OnUserLoginRequestMessage(NetworkConnection conn, UserLoginRequestMessage msg) { ServerPlayerListMessage message = new ServerPlayerListMessage { code = successCode, text = "", causesDisconnect = false }; if (DatabaseManager.singleton.TryUserLogin(msg.username, msg.password)) { NetworkManager.singleton.LoginUser(conn, msg.username); /* * TODO: * message.players * message.maxPlayer */ eventListener.onUserLogin.Invoke(conn); message.text = systemText.userLoginSuccess; } else { message.text = systemText.userLoginFailure; message.code = errorCode; } conn.Send(message); }
// ------------------------------------------------------------------------------- // OnServerPlayerListMessage // @Server -> @Client // ------------------------------------------------------------------------------- void OnServerPlayerListMessage(NetworkConnection conn, ServerPlayerListMessage msg) { }