コード例 #1
0
ファイル: AccountManager.cs プロジェクト: wovencode/OldMMO
        // -------------------------------------------------------------------------------
        // ReqCodeConfirm
        // -------------------------------------------------------------------------------
        public MsgAckCodeConfirm ReqCodeConfirm(MsgReqCodeConfirm message, NetworkConnection connection = null)
        {
            bool     _bSuccess = false;
            CAccount cAccount  = AccountLoad(message.sName);

            if (cAccount != null &&
                !cAccount.IsEmpty &&
                cAccount.Action != Constants.AccountActionType.None)
            {
                if (cAccount.ValidateAll((Constants.AccountActionType)message.nAction, message.nCode))
                {
                    cAccount.ConfirmCode();

                    if (dictLobby.ContainsKey(connection))
                    {
                        dictLobby[connection] = cAccount;
                    }

                    _bSuccess = databaseManager.AccountSave(cAccount);
                }
            }

            return(new MsgAckCodeConfirm {
                bSuccess = _bSuccess
            });
        }
コード例 #2
0
ファイル: ClientManager.cs プロジェクト: wovencode/OldMMO
        // -------------------------------------------------------------------------------
        // ReqCodeConfirm
        // -------------------------------------------------------------------------------
        public void ReqCodeConfirm(string[] fields, Action <string[]> callbackFunction)
        {
            DictionaryAddAction(callbackFunction);

            MsgReqCodeConfirm message = new MsgReqCodeConfirm {
                sName   = fields[0],
                nCode   = Int32.Parse(fields[1]),
                nAction = Int32.Parse(fields[2])
            };

            networkManager.client.Send(MsgReqCodeConfirm.nId, message);
        }
コード例 #3
0
        // -------------------------------------------------------------------------------
        // OnReqCodeConfirm
        // -------------------------------------------------------------------------------
        public void OnReqCodeConfirm(NetworkMessage networkMessage)
        {
            MsgReqCodeConfirm message = networkMessage.ReadMessage <MsgReqCodeConfirm>();

            networkMessage.conn.Send(MsgAckCodeConfirm.nId, accountManager.ReqCodeConfirm(message, networkMessage.conn));
        }