Ejemplo n.º 1
0
        public void AddToMessage(NetOutgoingMessage msg)
        {
            msg.Write(channelId);
            msg.Write(name);
            msg.Write(iconUrl);
            msg.Write((byte)state);

            if (state != ChannelState.Voting)
            {
                if (currentSong != null)
                {
                    currentSong.AddToMessage(msg);
                    currentLevelOptions.AddToMessage(msg);
                }
                else
                {
                    new SongInfo()
                    {
                        songName = "Selecting song...", levelId = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
                    }.AddToMessage(msg);
                    new LevelOptionsInfo(BeatmapDifficulty.Hard, new GameplayModifiers(), "Standard").AddToMessage(msg);
                }
            }

            msg.Write(playerCount);
        }
Ejemplo n.º 2
0
        public void AddToMessage(NetOutgoingMessage msg)
        {
            msg.Write(playerNameColor.r);
            msg.Write(playerNameColor.g);
            msg.Write(playerNameColor.b);

            msg.Write((byte)playerState);

            msg.Write(fullBodyTracking ? (byte)1 : (byte)0);
            msg.WriteVariableUInt32(playerScore);
            msg.WriteVariableUInt32(playerCutBlocks);
            msg.WriteVariableUInt32(playerComboBlocks);
            msg.WriteVariableUInt32(playerTotalBlocks);
            msg.Write(playerEnergy);
            msg.Write(playerProgress);

            if (playerLevelOptions == default)
            {
                new LevelOptionsInfo(BeatmapDifficulty.Hard, new GameplayModifiers(), "Standard").AddToMessage(msg);
            }
            else
            {
                playerLevelOptions.AddToMessage(msg);
            }

            if ((avatarData.Length == 168 && fullBodyTracking) || (avatarData.Length == 84 && !fullBodyTracking))
            {
                msg.Write(avatarData);
            }
            else
            {
                avatarData = new byte[fullBodyTracking ? 168 : 84];
                msg.Write(avatarData);
            }
        }
Ejemplo n.º 3
0
        public void AddToMessage(NetOutgoingMessage msg)
        {
            songSelected = selectedSong != null && roomState != RoomState.SelectingSong;

            msg.Write(roomId);
            msg.Write(name);
            msg.Write(usePassword);
            msg.Write(perPlayerDifficulty);
            msg.Write(songSelected);
            msg.Write(noHost);
            msg.WritePadBits();
            msg.Write((byte)roomState);
            msg.Write((byte)songSelectionType);

            if (!noHost)
            {
                roomHost.AddToMessage(msg);
            }

            msg.Write(players);
            msg.Write(maxPlayers);

            if (startLevelInfo == null)
            {
                startLevelInfo = new LevelOptionsInfo(BeatmapDifficulty.Hard, new GameplayModifiers(), "Standard");
            }

            startLevelInfo.AddToMessage(msg);

            if (songSelected)
            {
                selectedSong.AddToMessage(msg);
            }
        }
Ejemplo n.º 4
0
        public void AddToMessage(NetOutgoingMessage msg)
        {
            msg.Write(playerName);
            msg.Write(playerId);

            msg.Write(playerNameColor.r);
            msg.Write(playerNameColor.g);
            msg.Write(playerNameColor.b);

            msg.Write((byte)playerState);

            msg.Write(fullBodyTracking);
            msg.WriteVariableUInt32(playerScore);
            msg.WriteVariableUInt32(playerCutBlocks);
            msg.WriteVariableUInt32(playerComboBlocks);
            msg.WriteVariableUInt32(playerTotalBlocks);
            msg.WritePadBits();
            msg.Write(playerEnergy);
            msg.Write(playerProgress);

            if (playerLevelOptions == null)
            {
                new LevelOptionsInfo(BeatmapDifficulty.Hard, new GameplayModifiers(), "Standard").AddToMessage(msg);
            }
            else
            {
                playerLevelOptions.AddToMessage(msg);
            }

            msg.Write(avatarData ?? new byte[84 * (fullBodyTracking ? 2 : 1) + 16]);

            if (hitsLastUpdate != null)
            {
                msg.Write((byte)(hitsLastUpdate.Length / 5));

                msg.Write(hitsLastUpdate);
            }
            else
            {
                msg.Write((byte)0);
            }
        }