예제 #1
0
        public void LoadPlayerTable()
        {
            _filmPlayers = new List <PlayerChunk>();

            _filmStream.SeekTo(_filmPlayerTableData.PlayerTableStartPosition);
            bool contReadingTable = true;
            int  playerIndex      = 0;

            while (contReadingTable)
            {
                long currentEntryOffset = 0xE8F1 + (_filmPlayerTableData.PlayerTableEntryLength * playerIndex);

                _filmStream.SeekTo(currentEntryOffset + 0xF);
                string tmpGamertag = _filmStream.ReadUTF16(0x5);

                if (string.IsNullOrWhiteSpace(tmpGamertag))
                {
                    contReadingTable = false;
                }
                else
                {
                    PlayerChunk player = new PlayerChunk();
                    player.PlayerVisuals = new Visuals();

                    player.EntryIndex         = playerIndex;
                    player.EntryStartLocation = currentEntryOffset;

                    _filmStream.SeekTo(currentEntryOffset + 0xF);
                    player.Gamertag = _filmStream.ReadUTF16();

                    _filmStream.SeekTo(currentEntryOffset + 0x45);
                    player.ServiceTag = _filmStream.ReadUTF16();

                    _filmStream.SeekTo(currentEntryOffset + 0x40);
                    player.Character = (Character)_filmStream.ReadByte();
                    player.HelmetOn  = (HelmetToggle)_filmStream.ReadByte();

                    _filmStream.SeekTo(currentEntryOffset + 0x30);
                    player.PlayerVisuals.ArmourPrimary = (Colours)_filmStream.ReadByte();
                    player.PlayerVisuals.ArmourDetail  = (Colours)_filmStream.ReadByte();
                    _filmStream.Skip(0x03);
                    player.PlayerVisuals.EmblemForeground       = (EmblemForeground)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemBackground       = (EmblemBackground)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemForegroundToggle = (EmblemForegroundToggle)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemForegroundColour = (Colours)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemSecondaryColour  = (Colours)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemBackgroundColour = (Colours)_filmStream.ReadByte();

                    _filmPlayers.Add(player);
                }

                playerIndex++;
            }
        }
예제 #2
0
        public void LoadPlayerTable()
        {
            _filmPlayers = new List<PlayerChunk>();

            _filmStream.SeekTo(_filmPlayerTableData.PlayerTableStartPosition);
            bool contReadingTable = true;
            int playerIndex = 0;
            while (contReadingTable)
            {
                long currentEntryOffset = 0xE8F1 + (_filmPlayerTableData.PlayerTableEntryLength * playerIndex);

                _filmStream.SeekTo(currentEntryOffset + 0xF);
                string tmpGamertag = _filmStream.ReadUTF16(0x5);

                if (string.IsNullOrWhiteSpace(tmpGamertag))
                    contReadingTable = false;
                else
                {
                    PlayerChunk player = new PlayerChunk();
                    player.PlayerVisuals = new Visuals();

                    player.EntryIndex = playerIndex;
                    player.EntryStartLocation = currentEntryOffset;

                    _filmStream.SeekTo(currentEntryOffset + 0xF);
                    player.Gamertag = _filmStream.ReadUTF16();

                    _filmStream.SeekTo(currentEntryOffset + 0x45);
                    player.ServiceTag = _filmStream.ReadUTF16();

                    _filmStream.SeekTo(currentEntryOffset + 0x40);
                    player.Character = (Character)_filmStream.ReadByte();
                    player.HelmetOn = (HelmetToggle)_filmStream.ReadByte();

                    _filmStream.SeekTo(currentEntryOffset + 0x30);
                    player.PlayerVisuals.ArmourPrimary = (Colours)_filmStream.ReadByte();
                    player.PlayerVisuals.ArmourDetail = (Colours)_filmStream.ReadByte();
                    _filmStream.Skip(0x03);
                    player.PlayerVisuals.EmblemForeground = (EmblemForeground)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemBackground = (EmblemBackground)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemForegroundToggle = (EmblemForegroundToggle)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemForegroundColour = (Colours)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemSecondaryColour = (Colours)_filmStream.ReadByte();
                    player.PlayerVisuals.EmblemBackgroundColour = (Colours)_filmStream.ReadByte();

                    _filmPlayers.Add(player);
                }

                playerIndex++;
            }
        }