Exemplo n.º 1
0
 protected virtual void Awake()
 {
     BnetPresenceMgr.Get().AddPlayersChangedListener(new BnetPresenceMgr.PlayersChangedCallback(this.OnPlayersChanged));
     BnetWhisperMgr.Get().AddWhisperListener(new BnetWhisperMgr.WhisperCallback(this.OnWhisper));
     ChatMgr.Get().AddPlayerChatInfoChangedListener(new ChatMgr.PlayerChatInfoChangedCallback(this.OnPlayerChatInfoChanged));
     RecruitListMgr.Get().AddRecruitsChangedListener(new RecruitListMgr.RecruitsChangedCallback(this.OnRecruitsChanged));
     this.m_RecruitUI = UnityEngine.Object.Instantiate <FriendListRecruitUI>(this.m_Prefabs.recruitUI);
     this.m_RecruitUI.transform.parent = base.gameObject.transform;
     this.m_RecruitUI.gameObject.SetActive(false);
     if (this.m_rankMedalSpawner == null)
     {
         this.m_rankMedal = UnityEngine.Object.Instantiate <TournamentMedal>(this.m_rankMedalPrefab);
         this.m_rankMedal.transform.parent        = base.transform;
         this.m_rankMedal.transform.localScale    = new Vector3(20f, 1f, 20f);
         this.m_rankMedal.transform.localRotation = Quaternion.Euler(new Vector3(-90f, 0f, 0f));
     }
     else
     {
         this.m_rankMedal = this.m_rankMedalSpawner.Spawn <TournamentMedal>();
     }
     this.m_rankMedal.RemoveEventListener(UIEventType.ROLLOVER, new UIEvent.Handler(this.m_rankMedal.MedalOver));
     this.m_rankMedal.AddEventListener(UIEventType.ROLLOVER, new UIEvent.Handler(this.RankMedalOver));
     if (UniversalInputManager.UsePhoneUI != null)
     {
         this.m_rankMedal.GetComponent <Collider>().enabled = false;
     }
     this.m_rankMedal.gameObject.SetActive(false);
     SceneUtils.SetLayer(this.m_rankMedal, GameLayer.BattleNetFriendList);
 }
Exemplo n.º 2
0
 private void OnInputComplete(string input)
 {
     if (!string.IsNullOrEmpty(input))
     {
         if (this.m_receiver.IsOnline())
         {
             BnetWhisperMgr.Get().SendWhisper(this.m_receiver, input);
             ChatMgr.Get().AddRecentWhisperPlayerToTop(this.m_receiver);
         }
         else if (ChatMgr.Get().IsChatLogFrameShown())
         {
             if (!BnetWhisperMgr.Get().SendWhisper(this.m_receiver, input))
             {
                 this.m_chatLogFrame.m_chatLog.OnWhisperFailed();
             }
             ChatMgr.Get().AddRecentWhisperPlayerToTop(this.m_receiver);
         }
         else
         {
             object[] args    = new object[] { this.m_receiver.GetBestName() };
             string   message = GameStrings.Format("GLOBAL_CHAT_RECEIVER_OFFLINE", args);
             UIStatus.Get().AddError(message);
         }
     }
     if (ChatMgr.Get().IsChatLogFrameShown())
     {
         this.ShowInput(false);
     }
     else
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
 public static BnetWhisperMgr Get()
 {
     if (s_instance == null)
     {
         s_instance = new BnetWhisperMgr();
         if (< > f__am$cache5 == null)
         {
 public void UpdateIcon()
 {
     if (this.m_player == null)
     {
         base.gameObject.SetActive(false);
     }
     else
     {
         List <BnetWhisper> whispersWithPlayer = BnetWhisperMgr.Get().GetWhispersWithPlayer(this.m_player);
         if (whispersWithPlayer == null)
         {
             base.gameObject.SetActive(false);
         }
         else if (whispersWithPlayer[whispersWithPlayer.Count - 1].IsSpeaker(BnetPresenceMgr.Get().GetMyPlayer()))
         {
             base.gameObject.SetActive(false);
         }
         else
         {
             PlayerChatInfo playerChatInfo = ChatMgr.Get().GetPlayerChatInfo(this.m_player);
             if ((playerChatInfo != null) && (Enumerable.LastOrDefault <BnetWhisper>(whispersWithPlayer, (Func <BnetWhisper, bool>)(whisper => whisper.IsSpeaker(this.m_player))) == playerChatInfo.GetLastSeenWhisper()))
             {
                 base.gameObject.SetActive(false);
             }
             else
             {
                 base.gameObject.SetActive(true);
             }
         }
     }
 }
 private void OnDestroy()
 {
     BnetPresenceMgr.Get().RemovePlayersChangedListener(new BnetPresenceMgr.PlayersChangedCallback(this.OnPlayersChanged));
     BnetWhisperMgr.Get().RemoveWhisperListener(new BnetWhisperMgr.WhisperCallback(this.OnWhisper));
     if (this.notifications != null)
     {
         this.notifications.Notified -= new MobileChatNotification.NotifiedEvent(this.OnNotified);
     }
 }
Exemplo n.º 6
0
 private void OnDestroy()
 {
     BnetWhisperMgr.Get().RemoveWhisperListener(new BnetWhisperMgr.WhisperCallback(this.OnWhisper));
     BnetPresenceMgr.Get().RemovePlayersChangedListener(new BnetPresenceMgr.PlayersChangedCallback(this.OnPlayersChanged));
     if (UniversalInputManager.Get() != null)
     {
         UniversalInputManager.Get().CancelTextInput(base.gameObject, false);
     }
 }
 private void Awake()
 {
     this.CreateMessagesCamera();
     if (this.notifications != null)
     {
         this.notifications.Notified += new MobileChatNotification.NotifiedEvent(this.OnNotified);
     }
     BnetWhisperMgr.Get().AddWhisperListener(new BnetWhisperMgr.WhisperCallback(this.OnWhisper));
     BnetPresenceMgr.Get().AddPlayersChangedListener(new BnetPresenceMgr.PlayersChangedCallback(this.OnPlayersChanged));
 }
Exemplo n.º 8
0
 protected virtual void OnDestroy()
 {
     BnetPresenceMgr.Get().RemovePlayersChangedListener(new BnetPresenceMgr.PlayersChangedCallback(this.OnPlayersChanged));
     BnetWhisperMgr.Get().RemoveWhisperListener(new BnetWhisperMgr.WhisperCallback(this.OnWhisper));
     RecruitListMgr.Get().RemoveRecruitsChangedListener(new RecruitListMgr.RecruitsChangedCallback(this.OnRecruitsChanged));
     if (ChatMgr.Get() != null)
     {
         ChatMgr.Get().RemovePlayerChatInfoChangedListener(new ChatMgr.PlayerChatInfoChangedCallback(this.OnPlayerChatInfoChanged));
     }
 }
 private void OnInputComplete(string input)
 {
     if (!string.IsNullOrEmpty(input))
     {
         if (!BnetWhisperMgr.Get().SendWhisper(this.receiver, input))
         {
             this.chatLog.OnWhisperFailed();
         }
         ChatMgr.Get().AddRecentWhisperPlayerToTop(this.receiver);
     }
 }
Exemplo n.º 10
0
    private BnetWhisper FindLastWhisperFromReceiver()
    {
        List <BnetWhisper> whispersWithPlayer = BnetWhisperMgr.Get().GetWhispersWithPlayer(this.m_receiver);

        if (whispersWithPlayer != null)
        {
            for (int i = whispersWithPlayer.Count - 1; i >= 0; i--)
            {
                BnetWhisper whisper = whispersWithPlayer[i];
                if (whisper.IsSpeaker(this.m_receiver))
                {
                    return(whisper);
                }
            }
        }
        return(null);
    }
Exemplo n.º 11
0
 private void Awake()
 {
     this.InitRecentPlayers();
     if (!this.InitReceiver())
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
     else
     {
         BnetWhisperMgr.Get().AddWhisperListener(new BnetWhisperMgr.WhisperCallback(this.OnWhisper));
         BnetPresenceMgr.Get().AddPlayersChangedListener(new BnetPresenceMgr.PlayersChangedCallback(this.OnPlayersChanged));
         this.InitTransform();
         this.InitInputBlocker();
         this.InitLastMessage();
         this.InitChatLogFrame();
         this.InitInput();
         this.ShowInput(true);
     }
 }
Exemplo n.º 12
0
 private void AssetsVersionCheckCompleted()
 {
     if (!string.IsNullOrEmpty(UpdateManager.Get().GetError()) && UpdateManager.Get().UpdateIsRequired())
     {
         Error.AddFatalLoc("GLUE_PATCHING_ERROR", new object[0]);
     }
     else
     {
         if (Network.ShouldBeConnectedToAurora())
         {
             BnetPresenceMgr.Get().Initialize();
             BnetFriendMgr.Get().Initialize();
             BnetChallengeMgr.Get().Initialize();
             BnetWhisperMgr.Get().Initialize();
             BnetNearbyPlayerMgr.Get().Initialize();
             FriendChallengeMgr.Get().OnLoggedIn();
             SpectatorManager.Get().Initialize();
             if (!Options.Get().GetBool(Option.CONNECT_TO_AURORA))
             {
                 Options.Get().SetBool(Option.CONNECT_TO_AURORA, true);
             }
             TutorialProgress progress = Options.Get().GetEnum <TutorialProgress>(Option.LOCAL_TUTORIAL_PROGRESS);
             if (progress > TutorialProgress.NOTHING_COMPLETE)
             {
                 this.m_waitingForSetProgress = true;
                 ConnectAPI.SetProgress((long)progress);
             }
             if (WebAuth.GetIsNewCreatedAccount())
             {
                 AdTrackingManager.Get().TrackAccountCreated();
                 WebAuth.SetIsNewCreatedAccount(false);
             }
         }
         ConnectAPI.RequestAccountLicenses();
         ConnectAPI.RequestGameLicenses();
         Box.Get().OnLoggedIn();
         BaseUI.Get().OnLoggedIn();
         InactivePlayerKicker.Get().OnLoggedIn();
         HealthyGamingMgr.Get().OnLoggedIn();
         DefLoader.Get().Initialize();
         CollectionManager.Init();
         AdventureProgressMgr.Init();
         Tournament.Init();
         GameMgr.Get().OnLoggedIn();
         if (Network.ShouldBeConnectedToAurora())
         {
             StoreManager.Get().Init();
         }
         Network.TrackClient(Network.TrackLevel.LEVEL_INFO, Network.TrackWhat.TRACK_LOGIN_FINISHED);
         Network.ResetConnectionFailureCount();
         if (Network.ShouldBeConnectedToAurora())
         {
             ConnectAPI.DoLoginUpdate();
         }
         else
         {
             this.m_waitingForUpdateLoginComplete = false;
         }
         Enum[] args = new Enum[] { PresenceStatus.LOGIN };
         PresenceMgr.Get().SetStatus(args);
         if (SplashScreen.Get() != null)
         {
             SplashScreen.Get().StopPatching();
             SplashScreen.Get().ShowRatings();
         }
         this.PreloadActors();
         if (!Network.ShouldBeConnectedToAurora())
         {
             base.StartCoroutine(this.RegisterScreenWhenReady());
         }
         SceneMgr.Get().LoadShaderPreCompiler();
     }
 }