private List<HoldingKey> IReadKeyring(hsStream s, plLocation loc) { List<HoldingKey> keyring = new List<HoldingKey>(); int types = s.ReadInt(); for (int i = 0; i < types; i++) { plCreatableID type = plManagedType.Read(s); if (s.Version >= plVersion.MystOnline) { s.ReadInt(); // Size until the next type s.ReadByte(); // Flags??? } int count = s.ReadInt(); // Some optimizations keyring.Capacity += count; fKeyCollector.Reserve(loc, type, count); for (int j = 0; j < count; j++) { HoldingKey key = new HoldingKey(); key.fKey = ReadUoid(s); key.fOffset = s.ReadInt(); key.fSize = s.ReadInt(); key.fStream = s; keyring.Add(key); } } plDebugLog.GetLog("ResManager").Debug(String.Format("\t* Keyring: {0} Keys", keyring.Count)); return keyring; }
/// <summary> /// Creates a FAKE plKey based on the information given. /// </summary> /// <remarks> /// This key will NOT be added to (or checked by) the internal KeyCollector; therefore, you should /// ONLY use this method if you know what you're doing! Othwerise, you will create duplicate keys /// and completely screw the garbage collection. /// </remarks> /// <param name="loc">Key's Location</param> /// <param name="type">Managed Type ID</param> /// <param name="name">Object Name</param> /// <param name="id">Object ID</param> /// <returns>Fabricated key</returns> public static plKey Fabricate(plLocation loc, plCreatableID type, string name, uint id) { plUoid uoid = new plUoid(type, name); uoid.fLocation = loc; uoid.fObjectID = id; return new plKey(uoid); }
public IList<plCreatableID> GetTypes(plLocation loc) { return fKeyCollector.GetTypes(loc); }
public IList<plKey> GetKeys(plLocation loc, plCreatableID type) { return fKeyCollector.GetKeys(loc, type); }
public IList<plKey> GetKeys(plLocation loc) { return fKeyCollector.GetKeys(loc); }
public plKey FindKey(plLocation loc, plCreatableID type, string name) { return fKeyCollector.FindKey(loc, type, name); }
public void Read(hsStream s) { fLocation = new plLocation(); fLocation.Read(s); fFlags = (NetGroupConstants)s.ReadByte(); }