Exemplo n.º 1
0
        public override LogParseResult Parse()
        {
            LinkedList <LogParseResultEntry> result = new LinkedList <LogParseResultEntry>();

            int count = 0;
            BlissHiveLogContainer blissHiveLogContainer = (BlissHiveLogContainer)this.container;

            // proc_updateObjectInventory(56849,
            // '[[["glock17_EP1","ItemToolbox","ItemHatchet","LeeEnfield"],[1,1,1,1]],[["ItemPainkiller","ItemSodaCoke","ItemEpinephrine","20Rnd_762x51_DMR","15Rnd_9x19_M9SD","15Rnd_9x19_M9","FoodCanFrankBeans","17Rnd_9x19_glock17","SmokeShellGreen","ItemBandage","ItemMorphine","ItemJerrycanEmpty","ItemJerrycan","PartEngine"],[3,3,1,2,1,1,1,2,1,1,1,2,1,1]],[[],[]]]
            foreach (BlissHiveLogEntry entry in container.logs)
            {
                if (entry.functionName == "proc_updateObjectInventory")
                {
                    BlissHiveLogObject logObject = GetObjectByUpdateID(entry.parameters[0]);
                    String[]           split     = entry.parameters[1].Split(new String[1] {
                        "],["
                    }, StringSplitOptions.None);

                    BlissHiveLogInventory inventory = new BlissHiveLogInventory(entry);
                    for (int i = 0; i < split.Length; i += 2)
                    {
                        String[] items = split[i].Replace("\"", "")
                                         .Replace("[", "")
                                         .Replace("]", "")
                                         .Split(',');
                        String[] quantities = split[i + 1].Replace("\"", "")
                                              .Replace("[", "")
                                              .Replace("]", "")
                                              .Split(',');

                        for (int j = 0; j < items.Length; j++)
                        {
                            if (items[j] == "")
                            {
                                continue;
                            }
                            BlissHiveLogItem logItem = new BlissHiveLogItem(items[j], BlissHiveLogItem.Location.Inventory);
                            logItem.quantity = Int32.Parse(quantities[j]);


                            // Weapons
                            if (i == 0)
                            {
                                logItem.itemType = BlissHiveLogItemType.Weapon;
                            }
                            // Items
                            else if (i == 2)
                            {
                                logItem.itemType = BlissHiveLogItemType.Item;
                            }
                            // Backpacks
                            else if (i == 4)
                            {
                                logItem.itemType = BlissHiveLogItemType.Backpack;
                            }

                            inventory.items.AddLast(logItem);
                        }
                    }

                    if (inventory.items.Count > 0)
                    {
                        logObject.inventories.AddLast(inventory);
                    }
                }

                this.onParseProgressListeners(count, this.container.logs.Length);
                count++;
            }

            this.onParseProgressListeners = null;
            return(new LogParseResult(result));
        }
 public BlissHiveLogObjectActivityItem(BlissHiveLogObject survivor,
     int quantity, BlissHiveLogItem item, String timestamp)
     : base(quantity, item, timestamp)
 {
     this.logObject = survivor;
 }
 public BlissHiveLogObjectActivityItem(BlissHiveLogObject survivor,
                                       int quantity, BlissHiveLogItem item, String timestamp)
     : base(quantity, item, timestamp)
 {
     this.logObject = survivor;
 }
 public BlissHiveLogSurvivorActivityItem(BlissHiveLogSurvivor survivor,
                                         int quantity, BlissHiveLogItem item, String timestamp)
     : base(quantity, item, timestamp)
 {
     this.survivor = survivor;
 }
 public BlissHiveLogActivityItem(int quantity, BlissHiveLogItem item, String timestamp)
 {
     this.quantity = quantity;
     this.item = item;
     this.timestamp = timestamp;
 }
 public BlissHiveLogSurvivorActivityItem(BlissHiveLogSurvivor survivor,
     int quantity, BlissHiveLogItem item, String timestamp)
     : base(quantity, item, timestamp)
 {
     this.survivor = survivor;
 }