// ------------------------------------------------------------------------------- // OnClientMessageRequestPlayerRegister // @Client -> @Server // ------------------------------------------------------------------------------- void OnClientMessageRequestPlayerRegister(NetworkConnection conn, ClientMessageRequestPlayerRegister msg) { ServerMessageResponsePlayerRegister message = new ServerMessageResponsePlayerRegister { success = true, text = "", causesDisconnect = false }; if (DatabaseManager.singleton.TryPlayerRegister(msg.playername, msg.username, msg.prefabname)) { RegisterPlayer(msg.username, msg.playername, msg.prefabname); message.text = systemText.playerRegisterSuccess; } else { message.text = systemText.playerRegisterFailure; message.success = false; } conn.Send(message); }
// ------------------------------------------------------------------------------- void OnServerMessageResponsePlayerRegister(NetworkConnection conn, ServerMessageResponsePlayerRegister msg) { OnServerMessageResponse(conn, msg); }