private IEnumerable <string> TraversePath() { COceanNode node = this; while (node != null && node.ClassName != null && !string.IsNullOrEmpty(node.Name)) { yield return(node.Name); node = node.Parent as COceanNode; } }
public CObject ReadObject(COceanNode node) { var obj = CreateObject(node.Name); PopulateLoadArray(); m_input.Position = ((long)node.Offset << m_shift); int f1 = ReadByte() & 3; int f2 = ReadByte(); int f3 = ReadByte(); int f4 = 0; switch (f2 >> 6) { case 0: f4 = f3 >> 6; break; case 1: f4 = f3 >> 2; break; case 2: f4 = (f3 & 0xFE) << 1 | (ReadByte() & 0xC0) << 1; break; case 3: f4 = (f3 & 0xFE) << 1 | (ReadByte() & 0xFE) << 6; break; } obj.Flags = node.Flags; MapObjectEntry(obj); if (2 == f1) { int flags = ReadUInt16(); m_field_4C = (m_field_4C & 0xFFFF) | flags << 16; } else if (3 == f1) { int schema = ReadUInt16(); int flags = ReadUInt16(); m_field_4C = (m_field_4C & 0xFFFF) | flags << 16; } obj.Deserialize(this); return(obj); }
void DeserializeNode(COceanNode node, bool store_to_map = true) { int flags = ReadUInt16(); // this.field_1E string class_ref; switch (flags & 7) { case 0: if (0 != (flags & 0x8000)) { ReadByte(); } else { ReadUInt16(); } class_ref = ReadClass(); break; case 1: ReadInt32(); class_ref = ReadCType(); break; default: throw new InvalidFormatException(); } node.ClassName = class_ref; if (node != null) { if (store_to_map) { node.Flags = flags; } if (0 != (flags & 8)) { if (!store_to_map) { node.Flags |= 8; } int id1 = ReadInt32(); // this.field_20 int id2 = ReadInt32(); // this.field_24 if (IsEncrypted && store_to_map) { node.Flags |= 0x100; if (!m_OceanMap.ContainsKey(id1)) { m_OceanMap[id1] = node; } } if (node != null) { node.Offset = (uint)id1; node.Size = (uint)id2; } } } else { if (0 == (flags & 8)) { throw new InvalidFormatException(); } int id = ReadInt32(); ReadInt32(); if (!m_OceanMap.TryGetValue(id, out node)) { throw new InvalidFormatException(); } } DeserializeClassList(node); }
public CObject ReadObject(COceanNode node) { return(m_arc.ReadObject(node)); }