// =============================================================================== // ACCOUNT METHODS // =============================================================================== // ------------------------------------------------------------------------------- // ReqCheckVersion // ------------------------------------------------------------------------------- public void ReqCheckVersion(string[] fields, Action <string[]> callbackFunction) { DictionaryAddAction(callbackFunction); MsgReqCheckVersion message = new MsgReqCheckVersion { sDeviceId = fields[0], sVersion = fields[1] }; networkManager.client.Send(MsgReqCheckVersion.nId, message); }
// =============================================================================== // NETWORK MESSAGE RELATED // =============================================================================== // ------------------------------------------------------------------------------- // ReqCheckVersion // Valide Client connect and version and return reply // ------------------------------------------------------------------------------- public MsgAckCheckVersion ReqCheckVersion(MsgReqCheckVersion message, NetworkConnection connection = null) { bool _bSuccess = (message.sVersion == Tools.GetVersion) ? true : false; int _nAccountsRemaining = ClientAccountsRemaining(message.sDeviceId); return(new MsgAckCheckVersion { bSuccess = _bSuccess, nAccountsRemaining = _nAccountsRemaining, bConfirmAccountCreate = confirmAccountCreate, bConfirmAccountDelete = confirmAccountDelete, bConfirmAccountChangeName = confirmAccountChangeName, bConfirmAccountChangePassword = confirmAccountChangePassword, bConfirmAccountChangeMail = confirmAccountChangeMail, bConfirmAccountForgotPassword = confirmAccountForgotPassword }); }
// =============================================================================== // ACCOUNT RELATED MESSAGE HANDLERS // =============================================================================== // ------------------------------------------------------------------------------- // OnReqCheckVersion // ------------------------------------------------------------------------------- public void OnReqCheckVersion(NetworkMessage networkMessage) { MsgReqCheckVersion message = networkMessage.ReadMessage <MsgReqCheckVersion>(); networkMessage.conn.Send(MsgAckCheckVersion.nId, accountManager.ReqCheckVersion(message, networkMessage.conn)); }