Esempio n. 1
0
        // -------------------------------------------------------------------------------
        // RequestPlayerDelete
        // @Client
        // -------------------------------------------------------------------------------
        protected override bool RequestPlayerDelete(NetworkConnection conn, string playerName, string userName, int action = 1)
        {
            if (!base.RequestPlayerDelete(conn, playerName, userName))
            {
                return(false);
            }

            ClientMessageRequestPlayerDelete message = new ClientMessageRequestPlayerDelete
            {
                playername = playerName,
                username   = userName
            };

            conn.Send(message);

            return(true);
        }
Esempio n. 2
0
        // -------------------------------------------------------------------------------
        // OnClientMessageRequestPlayerDelete
        // @Client -> @Server
        // -------------------------------------------------------------------------------
        void OnClientMessageRequestPlayerDelete(NetworkConnection conn, ClientMessageRequestPlayerDelete msg)
        {
            ServerMessageResponsePlayerDelete message = new ServerMessageResponsePlayerDelete
            {
                success          = true,
                text             = "",
                causesDisconnect = false
            };

            if (DatabaseManager.singleton.TryPlayerDeleteSoft(msg.playername, msg.username))
            {
                message.text = systemText.playerDeleteSuccess;
            }
            else
            {
                message.text    = systemText.playerDeleteFailure;
                message.success = false;
            }

            conn.Send(message);
        }