Exemple #1
0
 // Token: 0x06002824 RID: 10276 RVA: 0x000F3350 File Offset: 0x000F1750
 public static void load()
 {
     if (LevelSavedata.fileExists("/Groups.dat"))
     {
         River river = LevelSavedata.openRiver("/Groups.dat", true);
         byte  b     = river.readByte();
         if (b > 0)
         {
             GroupManager.availableGroupID = river.readSteamID();
             if (b > 1)
             {
                 int num = river.readInt32();
                 for (int i = 0; i < num; i++)
                 {
                     CSteamID csteamID = river.readSteamID();
                     string   text     = river.readString();
                     uint     num2     = river.readUInt32();
                     if (num2 >= 1u && !string.IsNullOrEmpty(text))
                     {
                         if (!GroupManager.knownGroups.ContainsKey(csteamID))
                         {
                             GroupManager.knownGroups.Add(csteamID, new GroupInfo(csteamID, text, num2));
                         }
                     }
                 }
             }
         }
     }
 }
Exemple #2
0
 public static void load()
 {
     if (LevelSavedata.fileExists("/Groups.dat"))
     {
         River river = LevelSavedata.openRiver("/Groups.dat", true);
         byte  b     = river.readByte();
         if (b > 0)
         {
             GroupManager.availableGroupID = river.readSteamID();
             if (b > 1)
             {
                 int num = river.readInt32();
                 for (int i = 0; i < num; i++)
                 {
                     CSteamID csteamID = river.readSteamID();
                     string   newName  = river.readString();
                     uint     num2     = river.readUInt32();
                     if (num2 > 0u)
                     {
                         GroupManager.knownGroups.Add(csteamID, new GroupInfo(csteamID, newName, num2));
                     }
                 }
             }
         }
     }
 }
Exemple #3
0
 // Token: 0x06002893 RID: 10387 RVA: 0x000F6EC8 File Offset: 0x000F52C8
 public static void load()
 {
     if (LevelSavedata.fileExists("/Events.dat"))
     {
         River river = LevelSavedata.openRiver("/Events.dat", true);
         byte  b     = river.readByte();
         if (b > 0)
         {
             LevelManager.airdropFrequency = river.readUInt32();
             LevelManager._hasAirdrop      = river.readBoolean();
             return;
         }
     }
     LevelManager._hasAirdrop = false;
 }
 // Token: 0x060028EA RID: 10474 RVA: 0x000F98DC File Offset: 0x000F7CDC
 public static void load()
 {
     if (LevelSavedata.fileExists("/Objects.dat") && Level.info.type == ELevelType.SURVIVAL)
     {
         River river = LevelSavedata.openRiver("/Objects.dat", true);
         river.readByte();
         for (byte b = 0; b < Regions.WORLD_SIZE; b += 1)
         {
             for (byte b2 = 0; b2 < Regions.WORLD_SIZE; b2 += 1)
             {
                 ObjectManager.loadRegion(river, LevelObjects.objects[(int)b, (int)b2]);
             }
         }
     }
 }
 // Token: 0x060028C0 RID: 10432 RVA: 0x000F7B04 File Offset: 0x000F5F04
 public static void load()
 {
     if (LevelSavedata.fileExists("/Lighting.dat"))
     {
         River river = LevelSavedata.openRiver("/Lighting.dat", true);
         byte  b     = river.readByte();
         if (b > 0)
         {
             LightingManager._cycle = river.readUInt32();
             LightingManager._time  = river.readUInt32();
             if (b > 1)
             {
                 LightingManager.rainFrequency = river.readUInt32();
                 LightingManager.rainDuration  = river.readUInt32();
                 LightingManager._hasRain      = river.readBoolean();
                 LevelLighting.rainyness       = (ELightingRain)river.readByte();
             }
             else
             {
                 LightingManager._hasRain = false;
                 LevelLighting.rainyness  = ELightingRain.NONE;
             }
             if (b > 2)
             {
                 LightingManager.snowFrequency = river.readUInt32();
                 LightingManager.snowDuration  = river.readUInt32();
                 LightingManager._hasSnow      = river.readBoolean();
                 LevelLighting.snowyness       = (ELightingSnow)river.readByte();
             }
             else
             {
                 LightingManager._hasSnow = false;
                 LevelLighting.snowyness  = ELightingSnow.NONE;
             }
             LightingManager._offset = Provider.time - LightingManager.time;
             return;
         }
     }
     LightingManager._time    = (uint)(LightingManager.cycle * LevelLighting.transition);
     LightingManager._offset  = Provider.time - LightingManager.time;
     LightingManager._hasRain = false;
     LevelLighting.rainyness  = ELightingRain.NONE;
     LightingManager._hasSnow = false;
     LevelLighting.snowyness  = ELightingSnow.NONE;
 }
        public static void load()
        {
            bool flag = false;

            if (LevelSavedata.fileExists("/Structures.dat") && Level.info.type == ELevelType.SURVIVAL)
            {
                River river = LevelSavedata.openRiver("/Structures.dat", true);
                byte  b     = river.readByte();
                if (b > 3)
                {
                    StructureManager.serverActiveDate = river.readUInt32();
                }
                else
                {
                    StructureManager.serverActiveDate = Provider.time;
                }
                if (b > 1)
                {
                    for (byte b2 = 0; b2 < Regions.WORLD_SIZE; b2 += 1)
                    {
                        for (byte b3 = 0; b3 < Regions.WORLD_SIZE; b3 += 1)
                        {
                            StructureRegion region = StructureManager.regions[(int)b2, (int)b3];
                            StructureManager.loadRegion(b, river, region);
                        }
                    }
                }
                if (b < 6)
                {
                    flag = true;
                }
            }
            else
            {
                flag = true;
            }
            if (flag && LevelObjects.buildables != null)
            {
                for (byte b4 = 0; b4 < Regions.WORLD_SIZE; b4 += 1)
                {
                    for (byte b5 = 0; b5 < Regions.WORLD_SIZE; b5 += 1)
                    {
                        List <LevelBuildableObject> list = LevelObjects.buildables[(int)b4, (int)b5];
                        if (list != null && list.Count != 0)
                        {
                            StructureRegion structureRegion = StructureManager.regions[(int)b4, (int)b5];
                            for (int i = 0; i < list.Count; i++)
                            {
                                LevelBuildableObject levelBuildableObject = list[i];
                                if (levelBuildableObject != null)
                                {
                                    ItemStructureAsset itemStructureAsset = levelBuildableObject.asset as ItemStructureAsset;
                                    if (itemStructureAsset != null)
                                    {
                                        Vector3       eulerAngles   = levelBuildableObject.rotation.eulerAngles;
                                        byte          newAngle_X    = MeasurementTool.angleToByte((float)(Mathf.RoundToInt(eulerAngles.x / 2f) * 2));
                                        byte          newAngle_Y    = MeasurementTool.angleToByte((float)(Mathf.RoundToInt(eulerAngles.y / 2f) * 2));
                                        byte          newAngle_Z    = MeasurementTool.angleToByte((float)(Mathf.RoundToInt(eulerAngles.z / 2f) * 2));
                                        Structure     structure     = new Structure(itemStructureAsset.id, itemStructureAsset.health, itemStructureAsset);
                                        StructureData structureData = new StructureData(structure, levelBuildableObject.point, newAngle_X, newAngle_Y, newAngle_Z, 0UL, 0UL, uint.MaxValue);
                                        structureRegion.structures.Add(structureData);
                                        StructureManager.manager.spawnStructure(structureRegion, structure.id, structureData.point, structureData.angle_x, structureData.angle_y, structureData.angle_z, (byte)Mathf.RoundToInt((float)structure.health / (float)itemStructureAsset.health * 100f), 0UL, 0UL, StructureManager.instanceCount += 1u);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            Level.isLoadingStructures = false;
        }