Ejemplo n.º 1
0
		public static LevelInfo getLevel(string path, bool usePath)
		{
			if (ReadWrite.fileExists(path + "/Level.dat", false, usePath))
			{
				Block block = ReadWrite.readBlock(path + "/Level.dat", false, usePath, 0);
				byte b = block.readByte();
				bool newEditable = block.readSteamID() == Provider.client || ReadWrite.fileExists(path + "/.unlocker", false, usePath);
				ELevelSize newSize = (ELevelSize)block.readByte();
				ELevelType newType = ELevelType.SURVIVAL;
				if (b > 1)
				{
					newType = (ELevelType)block.readByte();
				}
				LevelInfoConfigData levelInfoConfigData;
				if (ReadWrite.fileExists(path + "/Config.json", false, usePath))
				{
					try
					{
						levelInfoConfigData = ReadWrite.deserializeJSON<LevelInfoConfigData>(path + "/Config.json", false, usePath);
					}
					catch
					{
						levelInfoConfigData = null;
					}
					if (levelInfoConfigData == null)
					{
						levelInfoConfigData = new LevelInfoConfigData();
					}
				}
				else
				{
					levelInfoConfigData = new LevelInfoConfigData();
				}
				return new LevelInfo((!usePath) ? path : (ReadWrite.PATH + path), ReadWrite.folderName(path), newSize, newType, newEditable, levelInfoConfigData);
			}
			return null;
		}
Ejemplo n.º 2
0
 // Token: 0x060024D0 RID: 9424 RVA: 0x000D2EE1 File Offset: 0x000D12E1
 public LevelInfo(string newPath, string newName, ELevelSize newSize, ELevelType newType, bool newEditable, LevelInfoConfigData newConfigData)
 {
     this._path       = newPath;
     this._name       = newName;
     this._size       = newSize;
     this._type       = newType;
     this._isEditable = newEditable;
     this.configData  = newConfigData;
 }