private Delegate0 method_0(int int_0, BigEndianReader dofusReader_0) { switch (int_0) { case -1: return new Delegate0(this.method_9); case -2: return new Delegate0(this.method_10); case -3: return new Delegate0(this.method_5); case -4: return new Delegate0(this.method_11); case -5: return new Delegate0(this.method_12); case -6: return new Delegate0(this.method_13); case -99: string str = dofusReader_0.ReadUTF(); this.class17_0 = new Class17(str, dofusReader_0); return new Delegate0(this.method_1); } if ((int_0 > 0)) { return new Delegate0(this.method_2); } return null; }
public void Open(string filePath) { FileInfo fileInfo = new FileInfo(filePath); if (m_Indexes == null) m_Indexes = new Dictionary<int, int>(); m_UnDiacriticalIndex = new Dictionary<int, int>(); m_TextIndexes = new Dictionary<string, int>(); m_TextIndexesOverride = new Dictionary<string, string>(); m_TextSortIndex = new Dictionary<int, int>(); byte[] fileContent = new byte[fileInfo.Length]; FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read); fileStream.Read(fileContent, 0, fileContent.Length); fileStream.Dispose(); m_Stream = new BigEndianReader(fileContent); int position = m_Stream.ReadInt(); m_Stream.Seek(position, SeekOrigin.Begin); int indexCount = m_Stream.ReadInt(); for (int index = 0; index < indexCount; index += 9) { int key = m_Stream.ReadInt(); bool diacriticalText = m_Stream.ReadBoolean(); int pointeur = m_Stream.ReadInt(); m_Indexes.Add(key, pointeur); if (diacriticalText) { index += 4; m_UnDiacriticalIndex.Add(key, m_Stream.ReadInt()); } else m_UnDiacriticalIndex.Add(key, pointeur); } int textIndexesCount = m_Stream.ReadInt(); while (textIndexesCount > 0) { position = (int)m_Stream.Position; m_TextIndexes.Add(m_Stream.ReadUTF(), m_Stream.ReadInt()); textIndexesCount -= (int)(m_Stream.Position - position); } textIndexesCount = m_Stream.ReadInt(); int i = 0; while (textIndexesCount > 0) { position = (int)m_Stream.Position; m_TextSortIndex.Add(m_Stream.ReadInt(), ++i); textIndexesCount -= (int)(m_Stream.Position - position); } }
public override void Deserialize(BigEndianReader reader) { int num = reader.ReadInt(); Files = new string[num]; for (int i = 0; i < num; i++) { Files[i] = reader.ReadUTF(); } }
internal DataClass method_0(string string_1, BigEndianReader dofusReader_0) { DataClass class2 = new DataClass { Name = this.string_0 }; //Class17 class3 = default(Class17); foreach (Class17 class3 in this.list_0) { class2.Fields.Add(class3.string_0, RuntimeHelpers.GetObjectValue(class3.delegate0_0.Invoke(string_1, dofusReader_0))); } return class2; }
public static void HandleRawDataMessage(RawDataMessage message, DofusClient client) { BigEndianReader reader = new BigEndianReader(message._content); short rawMessageId = reader.ReadShort(); var handler = Handlers.FirstOrDefault(x => x.Key == rawMessageId); var rawMessage = RawReceiver.BuildMessage(rawMessageId, reader); if (handler.Value != null) { handler.Value.DynamicInvoke(null, client, rawMessage); } }
private ArrayList method_1(string string_1, BigEndianReader dofusReader_0) { ArrayList list = new ArrayList(); int num = dofusReader_0.ReadInt(); int i = 1; while ((i <= num)) { list.Add(RuntimeHelpers.GetObjectValue(this.class17_0.delegate0_0.Invoke(string_1, dofusReader_0))); i += 1; } return list; }
internal D2oData(string D2oFile) { this.D2oFileStream = new FileStream(D2oFile, FileMode.Open, FileAccess.Read); this.dictionary_1 = new Dictionary<int, int>(); this.dictionary_0 = new Dictionary<int, Class16>(); this.Reader = new BigEndianReader(this.D2oFileStream); Encoding.Default.GetString(this.Reader.ReadBytes(3)); this.D2oFileStream.Position = this.Reader.ReadInt(); int num = this.Reader.ReadInt(); int i = 1; while ((i <= num)) { this.dictionary_1.Add(this.Reader.ReadInt(), this.Reader.ReadInt()); this.int_0 += 1; i = (i + 8); } int num3 = this.Reader.ReadInt(); int j = 1; while ((j <= num3)) { this.method_2(this.Reader.ReadInt()); j += 1; } }
private object ReadList(string fieldName, BigEndianReader reader, int dimension = 0) { int listCount = reader.ReadInt(); List<object> result = new List<object>(); for (int index = 0; index < listCount; index++) result.Add(m_ListReadMethods[dimension](fieldName, reader, dimension + 1)); return result; }
private Func<string, BigEndianReader, int, object> GetReadMethod(int methodID, BigEndianReader reader) { switch (methodID) { case -1: return ReadInteger; case -2: return ReadBoolean; case -3: return ReadString; case -4: return ReadNumber; case -5: return ReadI18N; case -6: return ReadUnsignedInteger; case -99: if (m_ListReadMethods == null) { m_ListReadMethods = new List<Func<string, BigEndianReader, int, object>>(); m_ListType = new List<string>(); } m_ListType.Add(reader.ReadUTF()); m_ListReadMethods.Add(GetReadMethod(reader.ReadInt(), reader)); return ReadList; default: if (methodID > 0) return ReadObject; throw new Exception("Unknown type \'" + methodID + "\'."); } }
// Methods internal Class17(string string_1, BigEndianReader dofusReader_0) { this.string_0 = string_1; int num = dofusReader_0.ReadInt(); this.delegate0_0 = this.method_0(num, dofusReader_0); }
public object method_10(string string_1, BigEndianReader dofusReader_0) { return this.method_4(string_1, dofusReader_0); }
private int method_7(string string_1, BigEndianReader dofusReader_0) { return dofusReader_0.ReadInt(); }
private UInt32 method_8(string string_1, BigEndianReader dofusReader_0) { return dofusReader_0.ReadUInt(); }
private object ReadObject(string fieldName, BigEndianReader reader, int dimension = 0) { int typeID = reader.ReadInt(); if (typeID == m_NullIdentifier) return null; Dictionary<int, GameDataClassDefinition> className = m_Classes[fieldName]; return className[typeID].Read(fieldName, reader); }
private static object ReadNumber(string fieldName, BigEndianReader reader, int dimension = 0) { return reader.ReadDouble(); }
internal void method_1(string string_1, BigEndianReader dofusReader_0) { Class17 item = new Class17(string_1, dofusReader_0); this.list_0.Add(item); }
public void Read(string fieldName, BigEndianReader reader, int size = 0) { m_Value = m_ReadData(fieldName, reader, size); }
public void ReadType(BigEndianReader reader) { m_ReadData = GetReadMethod(reader.ReadInt(), reader); }
private static object ReadUnsignedInteger(string fieldName, BigEndianReader reader, int dimension = 0) { return reader.ReadUInt(); }
private static object ReadString(string fieldName, BigEndianReader reader, int dimension = 0) { string result = reader.ReadUTF(); if (result == "null") return null; return result; }
private object method_12(string string_1, BigEndianReader dofusReader_0) { return this.method_7(string_1, dofusReader_0); }
private double method_6(string string_1, BigEndianReader dofusReader_0) { return dofusReader_0.ReadDouble(); }
private object method_2(string string_1, BigEndianReader dofusReader_0) { int num = dofusReader_0.ReadInt(); if (GameData.FileName_Data[string_1].dictionary_0.ContainsKey(num)) return GameData.FileName_Data[string_1].dictionary_0[num].method_0(string_1, dofusReader_0); else return new GameData(); }
private static object ReadI18N(string fieldName, BigEndianReader reader, int dimension = 0) { return reader.ReadInt(); }
public override void Deserialize(BigEndianReader reader) { this.OS = reader.ReadUTF(); this.Username = reader.ReadUTF(); }
private bool method_4(string string_1, BigEndianReader dofusReader_0) { return dofusReader_0.ReadBoolean(); }
public abstract void Deserialize(BigEndianReader reader);
private string method_5(string string_1, BigEndianReader dofusReader_0) { return dofusReader_0.ReadUTF(); }