Example #1
0
 public RoomInfo(NetIncomingMessage msg)
 {
     roomId              = msg.ReadUInt32();
     name                = msg.ReadString();
     usePassword         = msg.ReadBoolean();
     perPlayerDifficulty = msg.ReadBoolean();
     songSelected        = msg.ReadBoolean();
     msg.SkipPadBits();
     roomState         = (RoomState)msg.ReadByte();
     songSelectionType = (SongSelectionType)msg.ReadByte();
     roomHost          = new PlayerInfo(msg);
     players           = msg.ReadInt32();
     maxPlayers        = msg.ReadInt32();
     try
     {
         if (songSelected)
         {
             startLevelInfo = new StartLevelInfo(msg);
             selectedSong   = new SongInfo(msg);
         }
         else
         {
             startLevelInfo = null;
             selectedSong   = null;
         }
     }
     catch
     {
     }
 }
        public ChannelInfo(NetIncomingMessage msg)
        {
            channelId = msg.ReadInt32();
            name      = msg.ReadString();
            iconUrl   = msg.ReadString();
            state     = (ChannelState)msg.ReadByte();

            if (state != ChannelState.Voting)
            {
                currentSong         = new SongInfo(msg);
                currentLevelOptions = new StartLevelInfo(msg);

                if (currentSong.songName == "Selecting song..." && currentSong.levelId == "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")
                {
                    currentSong         = null;
                    currentLevelOptions = null;
                }
            }
            playerCount = msg.ReadInt32();
        }