Beispiel #1
0
 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;
 }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 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();
     }
 }
 public override void Deserialize(BigEndianReader reader)
 {
     this.OS = reader.ReadUTF();
     this.Username = reader.ReadUTF();
 }
Beispiel #5
0
 private string method_5(string string_1, BigEndianReader dofusReader_0)
 {
     return dofusReader_0.ReadUTF();
 }
Beispiel #6
0
        private static object ReadString(string fieldName, BigEndianReader reader, int dimension = 0)
        {
            string result = reader.ReadUTF();

            if (result == "null")
                return null;

            return result;
        }
Beispiel #7
0
        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 + "\'.");
            }
        }