internal static void CheckAuth(SessionKey key, GameConnection client) { AionConnection value = null; if (Conversions.ToBoolean(accountOnLS.TryGetValue(key.AccountId, out value) && Conversions.ToBoolean(value.SessionKey.CheckSessionKey(key)))) { accountOnLS.Remove(key.AccountId); GameInfo gameInfo = GameService.GameServerIndoForId(client.GameServerId); Account account = value.Account; gameInfo.AddAccount(account); account.LastServer = checked ((byte)gameInfo.ServerId); LunaInfo lunaInfo = DAOManager.LunaDAO.LoadLuna(key.AccountId); if (Information.IsNothing(lunaInfo)) { DateTime time = new DateTime(DateAndTime.Now.Year, DateAndTime.Now.Month, DateAndTime.Now.Day, 9, 0, 0); lunaInfo = new LunaInfo(key.AccountId, 0L, 0, 0, 0, time); DAOManager.LunaDAO.Store(lunaInfo); } account.LunaInfo = lunaInfo; client.SendPacket(new SM_GS_ACCOUNT_AUTH_RESPONSE(key.AccountId, ok: true, account)); DAOManager.AccountDAO.UpdateLastIpAndServer(account); if (ExpirationConfig.EXPIRATION_ENABLE) { ExpirationService.GetInstance().Add(account); } } else { client.SendPacket(new SM_GS_ACCOUNT_AUTH_RESPONSE(key.AccountId, ok: false, null)); } }
public SM_PLAY_OK(SessionKey key, byte serverId) { _key = key; _serverId = serverId; }
public object CheckSessionKey(SessionKey key) { return(_playerOk1 == key.PlayerOk1 && _playerOk2 == key.PlayerOk2 && _loginOk == key.LoginOk && _accountId == key.AccountId); }
public SM_LOGIN_OK(SessionKey key) { _key = key; }