Exemplo n.º 1
0
    private void OnPlayersChanged(BnetPlayerChangelist changelist, object userData)
    {
        BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer();

        if (changelist.FindChange(myPlayer) != null)
        {
            BnetGameAccount hearthstoneGameAccount = myPlayer.GetHearthstoneGameAccount();
            if (((hearthstoneGameAccount != null) && !this.m_myPlayerReady) && (hearthstoneGameAccount.HasGameField(20) && hearthstoneGameAccount.HasGameField(0x13)))
            {
                this.m_myPlayerReady = true;
                this.UpdateMyAvailability();
            }
            if (!this.AmIAvailable() && this.m_challengerPending)
            {
                Network.DeclineFriendChallenge(this.m_partyId);
                this.CleanUpChallengeData(true);
            }
        }
        if (this.m_challengerPending)
        {
            BnetPlayerChange change = changelist.FindChange(this.m_challengerId);
            if (change != null)
            {
                BnetPlayer player = change.GetPlayer();
                if (player.IsDisplayable())
                {
                    this.m_challenger        = player;
                    this.m_challengerPending = false;
                    this.FireChangedEvent(FriendChallengeEvent.I_RECEIVED_CHALLENGE, this.m_challenger);
                }
            }
        }
    }
Exemplo n.º 2
0
    public bool IsDisplayable()
    {
        if (this.m_gameAccountId == null)
        {
            return(false);
        }
        if (!this.IsBnetPlayer())
        {
            if (this.ShouldUseHeroName() && (this.GetHeroEntityDef() == null))
            {
                return(false);
            }
            return(true);
        }
        BnetPlayer player = BnetPresenceMgr.Get().GetPlayer(this.m_gameAccountId);

        if (player == null)
        {
            return(false);
        }
        if (!player.IsDisplayable())
        {
            return(false);
        }
        if (GameUtils.ShouldShowRankedMedals())
        {
            BnetGameAccount hearthstoneGameAccount = player.GetHearthstoneGameAccount();
            if (hearthstoneGameAccount == null)
            {
                return(false);
            }
            if (!hearthstoneGameAccount.HasGameField(0x12))
            {
                return(false);
            }
        }
        return(true);
    }