Ejemplo n.º 1
0
            public uint Compare(ref LobbyDisplayInfo other, bool includeFeatures = true)
            {
                uint num = Flags ^ other.Flags;

                if (includeFeatures)
                {
                    num |= (FeaturesMask ^ other.FeaturesMask);
                }
                if (NumPlayersForDisplay != other.NumPlayersForDisplay)
                {
                    num = (uint)((int)num | int.MinValue);
                }
                if (MaxPlayers != other.MaxPlayers)
                {
                    num |= 0x40000000;
                }
                if (LevelID != other.LevelID)
                {
                    num |= 0x20000000;
                }
                if (LevelType != other.LevelType)
                {
                    num |= 0x10000000;
                }
                if (!LobbyTitle.Equals(other.LobbyTitle))
                {
                    num |= 0x8000000;
                }
                return(num);
            }
            public void setDisplayInfo(ref LobbyDisplayInfo info)
            {
                uint num  = info.NumPlayersForDisplay - 1;
                uint num2 = info.FeaturesMask & 0x1F;

                flags = ((flags & ~num2) | (info.Flags & num2));
                if (((int)info.FeaturesMask & int.MinValue) != 0)
                {
                    playersCurrent = num;
                }
                if ((info.FeaturesMask & 0x40000000) != 0)
                {
                    playersMax = info.MaxPlayers;
                }
                if ((info.FeaturesMask & 0x20000000) != 0)
                {
                    levelID = info.LevelID;
                }
                if ((info.FeaturesMask & 0x10000000) != 0)
                {
                    levelType = info.LevelType;
                }
                if ((info.FeaturesMask & 0x8000000) != 0)
                {
                    lobbyTitle = info.LobbyTitle;
                }
            }
 public bool getDisplayInfo(out LobbyDisplayInfo info)
 {
     info = default(LobbyDisplayInfo);
     info.FeaturesMask         = 4160749599u;
     info.Flags                = (flags & 0x1F);
     info.NumPlayersForDisplay = playersCurrent + 1;
     info.MaxPlayers           = playersMax;
     info.LevelID              = levelID;
     info.LevelType            = levelType;
     info.LobbyTitle           = ((lobbyTitle == null) ? string.Empty : lobbyTitle);
     return(true);
 }