public WorldSession(uint id, string name, uint battlenetAccountId, WorldSocket sock, AccountTypes sec, Expansion expansion, long mute_time, string os, Locale locale, uint recruiter, bool isARecruiter) { m_muteTime = mute_time; AntiDOS = new DosProtection(this); m_Socket[(int)ConnectionType.Realm] = sock; _security = sec; _accountId = id; _accountName = name; _battlenetAccountId = battlenetAccountId; m_accountExpansion = expansion; m_expansion = (Expansion)Math.Min((byte)expansion, WorldConfig.GetIntValue(WorldCfg.Expansion)); _os = os; m_sessionDbcLocale = Global.WorldMgr.GetAvailableDbcLocale(locale); m_sessionDbLocaleIndex = locale; recruiterId = recruiter; isRecruiter = isARecruiter; expireTime = 60000; // 1 min after socket loss, session is deleted m_currentBankerGUID = ObjectGuid.Empty; _battlePetMgr = new BattlePetMgr(this); _collectionMgr = new CollectionMgr(this); m_Address = sock.GetRemoteIpAddress().Address.ToString(); ResetTimeOutTime(false); DB.Login.Execute("UPDATE account SET online = 1 WHERE id = {0};", GetAccountId()); // One-time query }
public void AddInstanceConnection(WorldSocket sock) { m_Socket[(int)ConnectionType.Instance] = sock; }