示例#1
0
        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));
            }
        }
示例#2
0
 public SM_PLAY_OK(SessionKey key, byte serverId)
 {
     _key      = key;
     _serverId = serverId;
 }
示例#3
0
 public object CheckSessionKey(SessionKey key)
 {
     return(_playerOk1 == key.PlayerOk1 && _playerOk2 == key.PlayerOk2 && _loginOk == key.LoginOk && _accountId == key.AccountId);
 }
示例#4
0
 public SM_LOGIN_OK(SessionKey key)
 {
     _key = key;
 }