Example #1
0
 public void Read(FastStreamReader reader, IPersistReader persistReader)
 {
     int position = reader.Position;
     reader.ReadUInt32();
     uint num2 = reader.ReadUInt32();
     uint num3 = reader.ReadUInt32();
     uint num4 = reader.ReadUInt32();
     uint num5 = reader.ReadUInt32();
     int[] numArray = new int[num2];
     reader.Seek(position + ((int)num3), SeekOrigin.Begin);
     for (uint i = 0x0; i < num2; i++)
     {
         numArray[i] = reader.ReadInt32();
     }
     reader.Seek(position + ((int)num5), SeekOrigin.Begin);
     mMethodList.Capacity = (int)num4;
     mMethodList.Clear();
     for (uint j = 0x0; j < num4; j++)
     {
         MethodEntry entry;
         MethodInfo methodInfo = (MethodInfo)persistReader.ReadReferenceForceLive();
         if (ScriptCore.ExceptionTrap.GetOption("ResetTaskStates") == 1)
         {
             entry.checksum = 0;
         }
         else
         {
             entry.checksum = reader.ReadUInt32();
         }
         if (methodInfo != null)
         {
             uint num8;
             entry.handle = methodInfo.MethodHandle;
             if (!ScriptCore.TaskControl.GetMethodChecksum(entry.handle, out num8))
             {
                 entry.handle = new RuntimeMethodHandle();
             }
             else if (num8 != entry.checksum)
             {
                 entry.handle = new RuntimeMethodHandle();
             }
             else if (!this.IsMethodSaveSafe(methodInfo))
             {
             }
         }
         else
         {
             entry.handle = new RuntimeMethodHandle();
         }
         this.mMethodList.Add(entry);
     }
     this.mSavedTaskContexts = new ScriptCore.SavedTaskContext[num2];
     for (uint k = 0x0; k < num2; k++)
     {
         int num10 = numArray[k];
         if (num10 == 0x0)
         {
             this.mSavedTaskContexts[k] = InvalidSavedTaskContext;
         }
         else if (num10 >= 0x0)
         {
             reader.Seek(position + num10, SeekOrigin.Begin);
             ScriptCore.SavedTaskContext invalidSavedTaskContext = ReadTask(reader, persistReader);
             if (invalidSavedTaskContext == null)
             {
                 invalidSavedTaskContext = InvalidSavedTaskContext;
             }
             this.mSavedTaskContexts[k] = invalidSavedTaskContext;
         }
     }
 }
Example #2
0
        public void Read(FastStreamReader reader, IPersistReader persistReader)
        {
            int position = reader.Position;

            reader.ReadUInt32();
            uint num2 = reader.ReadUInt32();
            uint num3 = reader.ReadUInt32();
            uint num4 = reader.ReadUInt32();
            uint num5 = reader.ReadUInt32();

            int[] numArray = new int[num2];
            reader.Seek(position + ((int)num3), SeekOrigin.Begin);
            for (uint i = 0x0; i < num2; i++)
            {
                numArray[i] = reader.ReadInt32();
            }
            reader.Seek(position + ((int)num5), SeekOrigin.Begin);
            mMethodList.Capacity = (int)num4;
            mMethodList.Clear();
            for (uint j = 0x0; j < num4; j++)
            {
                MethodEntry entry;
                MethodInfo  methodInfo = (MethodInfo)persistReader.ReadReferenceForceLive();
                if (ScriptCore.ExceptionTrap.GetOption("ResetTaskStates") == 1)
                {
                    entry.checksum = 0;
                }
                else
                {
                    entry.checksum = reader.ReadUInt32();
                }
                if (methodInfo != null)
                {
                    uint num8;
                    entry.handle = methodInfo.MethodHandle;
                    if (!ScriptCore.TaskControl.GetMethodChecksum(entry.handle, out num8))
                    {
                        entry.handle = new RuntimeMethodHandle();
                    }
                    else if (num8 != entry.checksum)
                    {
                        entry.handle = new RuntimeMethodHandle();
                    }
                    else if (!this.IsMethodSaveSafe(methodInfo))
                    {
                    }
                }
                else
                {
                    entry.handle = new RuntimeMethodHandle();
                }
                this.mMethodList.Add(entry);
            }
            this.mSavedTaskContexts = new ScriptCore.SavedTaskContext[num2];
            for (uint k = 0x0; k < num2; k++)
            {
                int num10 = numArray[k];
                if (num10 == 0x0)
                {
                    this.mSavedTaskContexts[k] = InvalidSavedTaskContext;
                }
                else if (num10 >= 0x0)
                {
                    reader.Seek(position + num10, SeekOrigin.Begin);
                    ScriptCore.SavedTaskContext invalidSavedTaskContext = ReadTask(reader, persistReader);
                    if (invalidSavedTaskContext == null)
                    {
                        invalidSavedTaskContext = InvalidSavedTaskContext;
                    }
                    this.mSavedTaskContexts[k] = invalidSavedTaskContext;
                }
            }
        }