private bool AddValueUnknown(string key, StringValues value)
 {
     ValidateHeaderNameCharacters(key);
     Unknown.Add(GetInternedHeaderName(key), value);
     // Return true, above will throw and exit for false
     return(true);
 }
        public FNTUnknown(BinaryReader reader)
        {
            uint Size = reader.ReadUInt32();

            for (int i = 0; i < Size; i++)
            {
                Unknown.Add(reader.ReadByte());
            }
        }
Exemple #3
0
        public void Add(Item item)
        {
            // Dupe-check list

            bool stacked = item.StackCount > 1 ||
                           _cache.StackableRecords.Contains(item.BaseRecord) ||
                           _cache.SpecialRecords.Contains(item.BaseRecord); // Special "single seed" items.

            if (stacked)
            {
                Stacked.Add(item);
                All.Add(item);
                return;
            }

            // TODO: Detect slith rings etc


            // We don't have this record at all, unknown to IA. Probably need to parse DB.
            bool unknownItem = !_cache.AllRecords.Contains(item.BaseRecord);

            if (unknownItem)
            {
                if (item.BaseRecord.StartsWith("records/storyelements/rewards/"))
                {
                    Quest.Add(item);
                }
                else
                {
                    Unknown.Add(item);
                }

                All.Add(item);
                return;
            }

            // We already have this item..
            if (All.Any(m => m.Equals(item)))
            {
                Duplicates.Add(item);
                All.Add(item);
                return;
            }

            // We already have this item..
            if (_playerItemDao.Exists(TransferStashService.Map(item, null, false)))
            {
                Duplicates.Add(item);
                All.Add(item);
                return;
            }

            Remaining.Add(item);
            All.Add(item);
        }
Exemple #4
0
 private bool AddValueUnknown(string key, StringValues value)
 {
     Unknown.Add(key, value);
     // Return true, above will throw and exit for false
     return(true);
 }
Exemple #5
0
        public void AddNewSoft(Software software, string networkName)
        {
            if (string.IsNullOrEmpty(software.SoftwareType))
            {
                software.SoftwareType = "";
            }


            if (string.IsNullOrEmpty(software.CodeStr))
            {
                software.CodeStr = "";
            }


            if (software.Code == 0)
            {
                software.Code = long.Parse(software.CodeStr);
            }

            if (software.Code != 0)
            {
                software.CodeStr = software.Code.ToString();
            }

            if (string.IsNullOrEmpty(software.Effect))
            {
                software.Effect = "";
            }


            if (string.IsNullOrEmpty(software.InevitableEffect))
            {
                software.InevitableEffect = "";
            }

            if (string.IsNullOrEmpty(software.NodeTypesString))
            {
                software.NodeTypesString = "";
            }

            if (string.IsNullOrEmpty(software.seenInNet))
            {
                software.seenInNet = "";
            }

            if (!string.IsNullOrEmpty(networkName))
            {
                if (!software.seenInNet.Contains(networkName))
                {
                    software.seenInNet += $",{networkName}";
                }
            }

            if (software.SoftwareType.Equals("exploit"))
            {
                if (Exloits.ContainsKey(software.Code))
                {
                    throw new ArgumentException($"Expolit #{software.Code} is duplicated in library.");
                }

                Software.Add(software);
                Exloits.Add(software.Code, software);
            }
            else if (software.SoftwareType.Equals("defence"))
            {
                if (Defences.ContainsKey(software.Code))
                {
                    throw new ArgumentException($"Defence #{software.Code} is duplicated in library.");
                }

                Defences.Add(software.Code, software);
                Software.Add(software);
            }
            else
            {
                if (Unknown.ContainsKey(software.Code))
                {
                    throw new ArgumentException($"Unknown soft #{software.Code} is duplicated in library.");
                }

                Unknown.Add(software.Code, software);
                Software.Add(software);
            }

            if (All.ContainsKey(software.Code))
            {
                throw new ArgumentException($"Software  #{software.Code} is duplicated in library.");
            }

            All.Add(software.Code, software);
        }