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

            ClientMessageRequestUserDelete message = new ClientMessageRequestUserDelete
            {
                username = name,
                password = GenerateHash(name, password)
            };

            conn.Send(message);

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

            if (DatabaseManager.singleton.TryUserDelete(msg.username, msg.password))
            {
                message.text = systemText.userDeleteSuccess;
            }
            else
            {
                message.text    = systemText.userDeleteFailure;
                message.success = false;
            }

            conn.Send(message);
        }