// ------------------------------------------------------------------------------- // 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 }); }
// ------------------------------------------------------------------------------- // 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); }
// ------------------------------------------------------------------------------- // OnReqCodeConfirm // ------------------------------------------------------------------------------- public void OnReqCodeConfirm(NetworkMessage networkMessage) { MsgReqCodeConfirm message = networkMessage.ReadMessage <MsgReqCodeConfirm>(); networkMessage.conn.Send(MsgAckCodeConfirm.nId, accountManager.ReqCodeConfirm(message, networkMessage.conn)); }