/// <summary>
        /// Parses agent related data
        /// </summary>
        private void parseAgentData(Stream stream)
        {
            using (var reader = CreateReader(stream))
            {
                // 4 bytes: player count
                int player_count = reader.ReadInt32();

                // 96 bytes: each player
                for (int i = 0; i < player_count; i++)
                {
                    // 8 bytes: agent
                    ulong agent = reader.ReadUInt64();

                    // 4 bytes: profession
                    uint prof = reader.ReadUInt32();

                    // 4 bytes: is_elite
                    uint is_elite = reader.ReadUInt32();

                    // 2 bytes: toughness
                    int toughness = reader.ReadInt16();
                    // skip concentration
                    ParseHelper.safeSkip(stream, 2);
                    // 2 bytes: healing
                    int healing = reader.ReadInt16();
                    ParseHelper.safeSkip(stream, 2);
                    // 2 bytes: condition
                    int condition = reader.ReadInt16();
                    ParseHelper.safeSkip(stream, 2);
                    // 68 bytes: name
                    String name = ParseHelper.getString(stream, 68, false);
                    //Save
                    Agent a          = new Agent(agent, name, prof, is_elite);
                    var   agent_prof = a.getProf(this.log_data.getBuildVersion(), APIController);
                    switch (agent_prof)
                    {
                    case "NPC":
                        // NPC
                        agent_data.addItem(new AgentItem(agent, name, a.getName() + ":" + prof.ToString().PadLeft(5, '0')), agent_prof);
                        break;

                    // Gadget
                    case "GDG":
                        agent_data.addItem(new AgentItem(agent, name, a.getName() + ":" + (prof & 0x0000ffff).ToString().PadLeft(5, '0')), agent_prof);
                        break;

                    default:
                        // Player
                        agent_data.addItem(new AgentItem(agent, name, agent_prof, toughness, healing, condition), agent_prof);
                        break;
                    }
                }
            }
        }
        //sub Parse methods
        /// <summary>
        /// Parses boss related data
        /// </summary>
        private void parseBossData(Stream stream)
        {
            using (var reader = CreateReader(stream))
            {
                // 12 bytes: arc build version
                var build_version = ParseHelper.getString(stream, 12);
                this.log_data = new LogData(build_version);

                // 1 byte: skip
                ParseHelper.safeSkip(stream, 1);

                // 2 bytes: boss instance ID
                ushort id = reader.ReadUInt16();

                // 1 byte: position
                ParseHelper.safeSkip(stream, 1);

                //Save
                // TempData["Debug"] = build_version +" "+ instid.ToString() ;
                this.boss_data = new BossData(id);
            }
        }
        private static CombatItem ReadCombatItem(BinaryReader reader)
        {
            // 8 bytes: time
            long time = reader.ReadInt64();

            // 8 bytes: src_agent
            ulong src_agent = reader.ReadUInt64();

            // 8 bytes: dst_agent
            ulong dst_agent = reader.ReadUInt64();

            // 4 bytes: value
            int value = reader.ReadInt32();

            // 4 bytes: buff_dmg
            int buff_dmg = reader.ReadInt32();

            // 2 bytes: overstack_value
            ushort overstack_value = reader.ReadUInt16();

            // 2 bytes: skill_id
            ushort skill_id = reader.ReadUInt16();

            // 2 bytes: src_instid
            ushort src_instid = reader.ReadUInt16();

            // 2 bytes: dst_instid
            ushort dst_instid = reader.ReadUInt16();

            // 2 bytes: src_master_instid
            ushort src_master_instid = reader.ReadUInt16();

            // 9 bytes: garbage
            ParseHelper.safeSkip(reader.BaseStream, 9);

            // 1 byte: iff
            ParseEnum.IFF iff = ParseEnum.getIFF(reader.ReadByte());

            // 1 byte: buff
            ushort buff = (ushort)reader.ReadByte();

            // 1 byte: result
            ParseEnum.Result result = ParseEnum.getResult(reader.ReadByte());

            // 1 byte: is_activation
            ParseEnum.Activation is_activation = ParseEnum.getActivation(reader.ReadByte());

            // 1 byte: is_buffremove
            ParseEnum.BuffRemove is_buffremoved = ParseEnum.getBuffRemove(reader.ReadByte());

            // 1 byte: is_ninety
            ushort is_ninety = (ushort)reader.ReadByte();

            // 1 byte: is_fifty
            ushort is_fifty = (ushort)reader.ReadByte();

            // 1 byte: is_moving
            ushort is_moving = (ushort)reader.ReadByte();

            // 1 byte: is_statechange
            ParseEnum.StateChange is_statechange = ParseEnum.getStateChange(reader.ReadByte());

            // 1 byte: is_flanking
            ushort is_flanking = (ushort)reader.ReadByte();

            // 1 byte: is_flanking
            ushort is_shields = (ushort)reader.ReadByte();

            // 2 bytes: garbage
            ParseHelper.safeSkip(reader.BaseStream, 2);

            //save
            // Add combat
            return(new CombatItem(time, src_agent, dst_agent, value, buff_dmg, overstack_value, skill_id,
                                  src_instid, dst_instid, src_master_instid, iff, buff, result, is_activation, is_buffremoved,
                                  is_ninety, is_fifty, is_moving, is_statechange, is_flanking, is_shields));
        }