Пример #1
0
        // -------------------------------------------------------------------------------
        // ReqRegisterAccount
        // -------------------------------------------------------------------------------
        public void ReqRegisterAccount(string[] fields, Action <string[]> callbackFunction)
        {
            DictionaryAddAction(callbackFunction);

            MsgReqAccountRegister message = new MsgReqAccountRegister {
                sName     = fields[0],
                sPassword = Tools.HashPassword(fields[1]),
                sMail     = fields[2],
                sDeviceId = fields[3]
            };

            networkManager.client.Send(MsgReqAccountRegister.nId, message);
        }
Пример #2
0
        // -------------------------------------------------------------------------------
        // ReqAccountRegister
        // -------------------------------------------------------------------------------
        public MsgAckAccountRegister ReqAccountRegister(MsgReqAccountRegister message, NetworkConnection connection = null)
        {
            int _nResult = confirmAccountCreate ? Constants.INT_CONFIRM : Constants.INT_SUCCESS;

            CAccount cAccount = null;

            cAccount = TryAccountCreate(message.sName, message.sPassword, message.sMail, message.sDeviceId);

            _nResult = (cAccount != null) ? _nResult : Constants.INT_FAILURE;

            return(new MsgAckAccountRegister {
                nResult = _nResult
            });
        }
Пример #3
0
        // -------------------------------------------------------------------------------
        // OnReqAccountRegister
        // -------------------------------------------------------------------------------
        public void OnReqAccountRegister(NetworkMessage networkMessage)
        {
            MsgReqAccountRegister message = networkMessage.ReadMessage <MsgReqAccountRegister>();

            networkMessage.conn.Send(MsgAckAccountRegister.nId, accountManager.ReqAccountRegister(message, networkMessage.conn));
        }