Exemple #1
0
 protected void UpdateOnlineStatus()
 {
     if (this.m_player.IsAway())
     {
         this.m_StatusText.Text = FriendUtils.GetAwayTimeString(this.m_player.GetBestAwayTimeMicrosec());
     }
     else if (this.m_player.IsBusy())
     {
         this.m_StatusText.Text = GameStrings.Get("GLOBAL_FRIENDLIST_BUSYSTATUS");
     }
     else
     {
         string statusText = PresenceMgr.Get().GetStatusText(this.m_player);
         if (statusText != null)
         {
             this.m_StatusText.Text = statusText;
         }
         else
         {
             BnetProgramId bestProgramId = this.m_player.GetBestProgramId();
             if (bestProgramId != null)
             {
                 this.m_StatusText.Text = BnetProgramId.GetName(bestProgramId);
             }
             else
             {
                 this.m_StatusText.Text = string.Empty;
             }
         }
     }
 }
 public void SetProgramId(BnetProgramId programId)
 {
     if (this.m_programId != programId)
     {
         this.m_programId = programId;
         this.UpdateIcon();
     }
 }
 public bool SetProgramId(BnetProgramId programId)
 {
     if (this.m_programId == programId)
     {
         return(false);
     }
     this.m_programId = programId;
     this.UpdateIcon();
     return(true);
 }
    public static string GetTextureName(BnetProgramId programId)
    {
        if (programId == null)
        {
            return(null);
        }
        string str = null;

        s_textureNameMap.TryGetValue(programId, out str);
        return(str);
    }
    public static string GetNameTag(BnetProgramId programId)
    {
        if (programId == null)
        {
            return(null);
        }
        string str = null;

        s_nameStringTagMap.TryGetValue(programId, out str);
        return(str);
    }
 public static string GetName(BnetProgramId programId)
 {
     if (programId != null)
     {
         string str = null;
         if (s_nameStringTagMap.TryGetValue(programId, out str))
         {
             return(GameStrings.Get(str));
         }
     }
     return(null);
 }
Exemple #7
0
 public void UpdateIcon()
 {
     if (this.m_player.IsOnline() && (this.m_player.GetBestProgramId() != BnetProgramId.PHOENIX))
     {
         if (!this.m_hidden)
         {
             base.gameObject.SetActive(true);
         }
         BnetProgramId bestProgramId = this.m_player.GetBestProgramId();
         this.m_OnlinePortrait.SetProgramId(bestProgramId);
     }
     else
     {
         base.gameObject.SetActive(false);
     }
 }
    private void UpdateIcon()
    {
        string str = (this.m_programId != null) ? BnetProgramId.GetTextureName(this.m_programId) : null;

        if (str == null)
        {
            this.m_currentIcon = null;
            this.m_loadingIcon = null;
            this.m_Icon.GetComponent <Renderer>().material.mainTexture = null;
        }
        else if ((this.m_currentIcon != str) && (this.m_loadingIcon != str))
        {
            this.m_loadingIcon = str;
            AssetLoader.Get().LoadTexture(this.m_loadingIcon, new AssetLoader.ObjectCallback(this.OnIconLoaded), null, false);
        }
    }
    private void CacheSpecialGameAccounts()
    {
        this.m_hsGameAccount   = null;
        this.m_bestGameAccount = null;
        ulong lastOnlineMicrosec = 0L;

        foreach (BnetGameAccount account in this.m_gameAccounts.Values)
        {
            BnetProgramId programId = account.GetProgramId();
            if (programId != null)
            {
                if (programId == BnetProgramId.HEARTHSTONE)
                {
                    this.m_hsGameAccount = account;
                    if (account.IsOnline() || !BnetFriendMgr.Get().IsFriend(account.GetId()))
                    {
                        this.m_bestGameAccount = account;
                    }
                    break;
                }
                if (this.m_bestGameAccount == null)
                {
                    this.m_bestGameAccount = account;
                    lastOnlineMicrosec     = this.m_bestGameAccount.GetLastOnlineMicrosec();
                }
                else
                {
                    BnetProgramId id2 = this.m_bestGameAccount.GetProgramId();
                    if (programId.IsGame() && !id2.IsGame())
                    {
                        this.m_bestGameAccount = account;
                        lastOnlineMicrosec     = this.m_bestGameAccount.GetLastOnlineMicrosec();
                    }
                    else if ((account.IsOnline() && programId.IsGame()) && id2.IsGame())
                    {
                        ulong num2 = account.GetLastOnlineMicrosec();
                        if (num2 > lastOnlineMicrosec)
                        {
                            this.m_bestGameAccount = account;
                            lastOnlineMicrosec     = num2;
                        }
                    }
                }
            }
        }
    }
 private void UpdateIcon()
 {
     if (this.m_programId == null)
     {
         this.m_currentTextureName = null;
         this.m_loadingTextureName = null;
         base.GetComponent <Renderer>().material.mainTexture = null;
     }
     else
     {
         string textureName = BnetProgramId.GetTextureName(this.m_programId);
         if ((this.m_currentTextureName != textureName) && (this.m_loadingTextureName != textureName))
         {
             this.m_loadingTextureName = textureName;
             AssetLoader.Get().LoadTexture(this.m_loadingTextureName, new AssetLoader.ObjectCallback(this.OnTextureLoaded), null, false);
         }
     }
 }
    public static int FriendSortCompare(BnetPlayer friend1, BnetPlayer friend2)
    {
        int result = 0;

        if ((friend1 == null) || (friend2 == null))
        {
            return((friend1 != friend2) ? ((friend1 != null) ? -1 : 1) : 0);
        }
        if (friend1.IsOnline() || friend2.IsOnline())
        {
            if (friend1.IsOnline() && !friend2.IsOnline())
            {
                return(-1);
            }
            if (!friend1.IsOnline() && friend2.IsOnline())
            {
                return(1);
            }
            BnetProgramId bestProgramId = friend1.GetBestProgramId();
            BnetProgramId id2           = friend2.GetBestProgramId();
            if (FriendSortFlagCompare(friend1, friend2, bestProgramId == BnetProgramId.HEARTHSTONE, id2 == BnetProgramId.HEARTHSTONE, out result))
            {
                return(result);
            }
            bool lhsflag = (bestProgramId != null) ? bestProgramId.IsGame() : false;
            bool rhsflag = (id2 != null) ? id2.IsGame() : false;
            if (FriendSortFlagCompare(friend1, friend2, lhsflag, rhsflag, out result))
            {
                return(result);
            }
            bool flag3 = (bestProgramId != null) ? bestProgramId.IsPhoenix() : false;
            bool flag4 = (id2 != null) ? id2.IsPhoenix() : false;
            if (FriendSortFlagCompare(friend1, friend2, flag3, flag4, out result))
            {
                return(result);
            }
        }
        return(FriendNameSortCompare(friend1, friend2));
    }
Exemple #12
0
 public void SetProgramId(BnetProgramId programId)
 {
     this.m_programId = programId;
 }