public DeserializeClass(PackedStream2 stream, int valueState)
     : base(stream, HeroTypes.Class)
 {
     m_28 = 0UL;
     m_30 = m_34 = 0;
     m_38 = null;
     if (stream.Flags[4])
     {
         if (valueState == 0)
         {
             return;
         }
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         if (Next != null)
         {
             throw new NotImplementedException();
         }
         ulong num;
         Stream.Read(out num);
         throw new NotImplementedException();
     }
     else
     {
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         stream.Read(out m_0C, out Count);
     }
 }
Beispiel #2
0
 public DeserializeLookupList(PackedStream2 stream, int valueState, HeroType defaultIndexerType)
     : base(stream, HeroTypes.LookupList)
 {
     valueType = defaultIndexerType;
     m_30      = false;
     if (stream.Flags[4])
     {
         if (Next == null)
         {
             throw new InvalidDataException("Only a HeroClass can be the root container type");
         }
         else
         {
             throw new NotImplementedException();
         }
     }
     else
     {
         if (valueState != 1)
         {
             throw new InvalidDataException("Invalid value state");
         }
         if (stream.Flags[0])
         {
             ulong num;
             stream.Read(out num);
             if ((long)num != 0L)
             {
                 indexerType = new HeroType((HeroTypes)num);
             }
         }
         if (!GetValueType(ref valueType))
         {
             throw new InvalidDataException("Error getting type");
         }
         stream.Read(out m_0C, out Count);
         if (stream.Style != 8 && stream.Style != 10)
         {
             return;
         }
         m_30 = ((int)Count & 1) == 1;
         DeserializeLookupList deserializeLookupList = this;
         var num1 = (int)(deserializeLookupList.Count >> 1);
         deserializeLookupList.Count = (uint)num1;
     }
 }
Beispiel #3
0
        public void LoadPrototypes(Stream stream)
        {
            var packedStream2 = new PackedStream2(1, stream);

            packedStream2.CheckResourceHeader(1179535696U, 1, 1);
            ulong num1;

            packedStream2.Read(out num1);
            for (ulong index = 0UL; index < num1; ++index)
            {
                ulong id;
                packedStream2.Read(out id);
                ulong num2;
                packedStream2.Read(out num2);
                LoadPrototype(id);
            }
            packedStream2.CheckEnd();
        }
        public int ReadVariableId()
        {
            if (!Stream.Flags[1] || Stream.TransportVersion >= 5)
            {
                return(0);
            }

            UInt64 num;

            Stream.Read(out num);
            return((Int32)num);
        }
Beispiel #5
0
        public DeserializeList(PackedStream2 stream, int valueState)
            : base(stream, HeroTypes.List)
        {
            Index = 0U;
            M30   = false;
            if (stream.Flags[4])
            {
                if (Next == null)
                {
                    throw new InvalidDataException("Only a HeroClass can be the root container type");
                }
            }
            else
            {
                if (valueState != 1)
                {
                    throw new InvalidDataException("Invalid value state");
                }

                if (stream.Flags[0])
                {
                    UInt64 num;
                    stream.Read(out num);
                    ListType = (HeroTypes)num;
                }
            }

            stream.Read(out m_0C, out Count);
            if (stream.Style != 8 && stream.Style != 10)
            {
                return;
            }

            M30     = (Count & 1) == 1;
            Count >>= 1;
        }