コード例 #1
0
        // -------------------------------------------------------------------------------
        // 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);
        }
コード例 #2
0
 // -------------------------------------------------------------------------------
 void OnServerMessageResponsePlayerRegister(NetworkConnection conn, ServerMessageResponsePlayerRegister msg)
 {
     OnServerMessageResponse(conn, msg);
 }