Пример #1
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));
                     }
                 }
             }
         }
     }
 }
Пример #2
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));
                         }
                     }
                 }
             }
         }
     }
 }
Пример #3
0
        // Token: 0x06002894 RID: 10388 RVA: 0x000F6F1C File Offset: 0x000F531C
        public static void save()
        {
            River river = LevelSavedata.openRiver("/Events.dat", false);

            river.writeByte(LevelManager.SAVEDATA_VERSION);
            river.writeUInt32(LevelManager.airdropFrequency);
            river.writeBoolean(LevelManager.hasAirdrop);
        }
Пример #4
0
        // Token: 0x060028EB RID: 10475 RVA: 0x000F995C File Offset: 0x000F7D5C
        public static void save()
        {
            River river = LevelSavedata.openRiver("/Objects.dat", false);

            river.writeByte(ObjectManager.SAVEDATA_VERSION);
            for (byte b = 0; b < Regions.WORLD_SIZE; b += 1)
            {
                for (byte b2 = 0; b2 < Regions.WORLD_SIZE; b2 += 1)
                {
                    ObjectManager.saveRegion(river, LevelObjects.objects[(int)b, (int)b2]);
                }
            }
            river.closeRiver();
        }
Пример #5
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;
 }
Пример #6
0
 // 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]);
             }
         }
     }
 }
Пример #7
0
        public static void save()
        {
            River river = LevelSavedata.openRiver("/Groups.dat", false);

            river.writeByte(GroupManager.SAVEDATA_VERSION);
            river.writeSteamID(GroupManager.availableGroupID);
            Dictionary <CSteamID, GroupInfo> .ValueCollection values = GroupManager.knownGroups.Values;
            river.writeInt32(values.Count);
            foreach (GroupInfo groupInfo in values)
            {
                river.writeSteamID(groupInfo.groupID);
                river.writeString(groupInfo.name);
                river.writeUInt32(groupInfo.members);
            }
        }
        // Token: 0x060028C1 RID: 10433 RVA: 0x000F7C24 File Offset: 0x000F6024
        public static void save()
        {
            River river = LevelSavedata.openRiver("/Lighting.dat", false);

            river.writeByte(LightingManager.SAVEDATA_VERSION);
            river.writeUInt32(LightingManager.cycle);
            river.writeUInt32(LightingManager.time);
            river.writeUInt32(LightingManager.rainFrequency);
            river.writeUInt32(LightingManager.rainDuration);
            river.writeBoolean(LightingManager.hasRain);
            river.writeByte((byte)LevelLighting.rainyness);
            river.writeUInt32(LightingManager.snowFrequency);
            river.writeUInt32(LightingManager.snowDuration);
            river.writeBoolean(LightingManager.hasSnow);
            river.writeByte((byte)LevelLighting.snowyness);
        }
Пример #9
0
        public static void save()
        {
            River river = LevelSavedata.openRiver("/Structures.dat", false);

            river.writeByte(StructureManager.SAVEDATA_VERSION);
            river.writeUInt32(Provider.time);
            for (byte b = 0; b < Regions.WORLD_SIZE; b += 1)
            {
                for (byte b2 = 0; b2 < Regions.WORLD_SIZE; b2 += 1)
                {
                    StructureRegion region = StructureManager.regions[(int)b, (int)b2];
                    StructureManager.saveRegion(river, region);
                }
            }
            river.closeRiver();
        }
 // 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;
 }
Пример #11
0
        // Token: 0x06002825 RID: 10277 RVA: 0x000F3410 File Offset: 0x000F1810
        public static void save()
        {
            River river = LevelSavedata.openRiver("/Groups.dat", false);

            river.writeByte(GroupManager.SAVEDATA_VERSION);
            river.writeSteamID(GroupManager.availableGroupID);
            Dictionary <CSteamID, GroupInfo> .ValueCollection values = GroupManager.knownGroups.Values;
            List <GroupInfo> list = new List <GroupInfo>();

            foreach (GroupInfo groupInfo in values)
            {
                if (groupInfo.members >= 1u && !string.IsNullOrEmpty(groupInfo.name))
                {
                    list.Add(groupInfo);
                }
            }
            river.writeInt32(list.Count);
            foreach (GroupInfo groupInfo2 in list)
            {
                river.writeSteamID(groupInfo2.groupID);
                river.writeString(groupInfo2.name);
                river.writeUInt32(groupInfo2.members);
            }
        }
Пример #12
0
        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;
        }