public void OnLoggedIn() { Network.Get().SetPartyHandler(new Network.PartyHandler(this.OnPartyUpdate)); NetCache.Get().RegisterFriendChallenge(new NetCache.NetCacheCallback(this.OnNetCacheReady)); SceneMgr.Get().RegisterSceneUnloadedEvent(new SceneMgr.SceneUnloadedCallback(this.OnSceneUnloaded)); SceneMgr.Get().RegisterSceneLoadedEvent(new SceneMgr.SceneLoadedCallback(this.OnSceneLoaded)); BnetPresenceMgr.Get().AddPlayersChangedListener(new BnetPresenceMgr.PlayersChangedCallback(this.OnPlayersChanged)); BnetFriendMgr.Get().AddChangeListener(new BnetFriendMgr.ChangeCallback(this.OnFriendsChanged)); BnetNearbyPlayerMgr.Get().AddChangeListener(new BnetNearbyPlayerMgr.ChangeCallback(this.OnNearbyPlayersChanged)); BnetEventMgr.Get().AddChangeListener(new BnetEventMgr.ChangeCallback(this.OnBnetEventOccurred)); GameMgr.Get().RegisterFindGameEvent(new GameMgr.FindGameCallback(this.OnFindGameEvent)); BnetParty.OnJoined += new BnetParty.JoinedHandler(this.BnetParty_OnJoined); BnetParty.RegisterAttributeChangedHandler("WTCG.Friendly.DeclineReason", new BnetParty.PartyAttributeChangedHandler(this.BnetParty_OnPartyAttributeChanged_DeclineReason)); BnetParty.RegisterAttributeChangedHandler("error", new BnetParty.PartyAttributeChangedHandler(this.BnetParty_OnPartyAttributeChanged_Error)); this.AddChangedListener(new ChangedCallback(this.OnChallengeChanged)); BnetPresenceMgr.Get().SetGameField(0x13, BattleNet.GetVersion()); BnetPresenceMgr.Get().SetGameField(20, BattleNet.GetEnvironment()); }
private void CacheMyAccountInfo() { if (this.m_idString == null) { BnetGameAccountId myGameAccountId = BnetPresenceMgr.Get().GetMyGameAccountId(); if (myGameAccountId != null) { BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer(); if (myPlayer != null) { BnetAccountId accountId = myPlayer.GetAccountId(); if (accountId != null) { BnetBattleTag battleTag = myPlayer.GetBattleTag(); if (battleTag != null) { this.m_myGameAccountLo = myGameAccountId.GetLo(); StringBuilder builder = new StringBuilder(); builder.Append(accountId.GetHi()); builder.Append(','); builder.Append(accountId.GetLo()); builder.Append(','); builder.Append(myGameAccountId.GetHi()); builder.Append(','); builder.Append(myGameAccountId.GetLo()); builder.Append(','); builder.Append(battleTag.GetName()); builder.Append(','); builder.Append(battleTag.GetNumber()); builder.Append(','); builder.Append(BattleNet.GetVersion()); builder.Append(','); builder.Append(BattleNet.GetEnvironment()); this.m_idString = builder.ToString(); } } } } } }