using System;
using System.IO;
using System.Linq;
using Cpp2IlInjected;
using MarsSDK;
using Newtonsoft.Json;
using Steamworks;
using UnityEngine;

// Token: 0x02000152 RID: 338
[Token(Token = "0x2000152")]
public class SteamPlatform : IGamePlatform
{
	// Token: 0x17000090 RID: 144
	// (get) Token: 0x06001147 RID: 4423 RVA: 0x00027CB0 File Offset: 0x00025EB0
	[Token(Token = "0x17000090")]
	public SystemLanguage DefaultLanguage
	{
		[Token(Token = "0x6001147")]
		[Address(RVA = "0xAB8580", Offset = "0xAB7380", VA = "0x180AB8580")]
		get
		{
			return Application.systemLanguage;
		}
	}

	// Token: 0x17000091 RID: 145
	// (get) Token: 0x06001148 RID: 4424 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x17000091")]
	public ControllerDevice DefaultController
	{
		[Token(Token = "0x6001148")]
		[Address(RVA = "0x2B4CB0", Offset = "0x2B3AB0", VA = "0x1802B4CB0", Slot = "4")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x17000092 RID: 146
	// (get) Token: 0x06001149 RID: 4425 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x17000092")]
	public IFileSystem FileSystem
	{
		[Token(Token = "0x6001149")]
		[Address(RVA = "0x2B4010", Offset = "0x2B2E10", VA = "0x1802B4010", Slot = "5")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x17000093 RID: 147
	// (get) Token: 0x0600114A RID: 4426 RVA: 0x00027CC4 File Offset: 0x00025EC4
	[Token(Token = "0x17000093")]
	public string AppVersion
	{
		[Token(Token = "0x600114A")]
		[Address(RVA = "0x943900", Offset = "0x942700", VA = "0x180943900", Slot = "6")]
		get
		{
			return Application.version;
		}
	}

	// Token: 0x17000094 RID: 148
	// (get) Token: 0x0600114B RID: 4427 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x17000094")]
	public bool IsConsolePlatform
	{
		[Token(Token = "0x600114B")]
		[Address(RVA = "0x290BB0", Offset = "0x28F9B0", VA = "0x180290BB0", Slot = "7")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x17000095 RID: 149
	// (get) Token: 0x0600114C RID: 4428 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x17000095")]
	public bool UseAsiaController
	{
		[Token(Token = "0x600114C")]
		[Address(RVA = "0x290BB0", Offset = "0x28F9B0", VA = "0x180290BB0", Slot = "8")]
		get
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x17000096 RID: 150
	// (get) Token: 0x0600114D RID: 4429 RVA: 0x00027CD8 File Offset: 0x00025ED8
	[Token(Token = "0x17000096")]
	public bool UseAchievement
	{
		[Token(Token = "0x600114D")]
		[Address(RVA = "0x454840", Offset = "0x453640", VA = "0x180454840", Slot = "9")]
		get
		{
			return true;
		}
	}

	// Token: 0x17000097 RID: 151
	// (get) Token: 0x0600114E RID: 4430 RVA: 0x00027CE8 File Offset: 0x00025EE8
	[Token(Token = "0x17000097")]
	public bool ShowQuitButton
	{
		[Token(Token = "0x600114E")]
		[Address(RVA = "0x454840", Offset = "0x453640", VA = "0x180454840", Slot = "10")]
		get
		{
			return true;
		}
	}

	// Token: 0x17000098 RID: 152
	// (get) Token: 0x0600114F RID: 4431 RVA: 0x00027CF8 File Offset: 0x00025EF8
	[Token(Token = "0x17000098")]
	public bool ShowDepthOfFieldSetting
	{
		[Token(Token = "0x600114F")]
		[Address(RVA = "0x454840", Offset = "0x453640", VA = "0x180454840", Slot = "11")]
		get
		{
			return true;
		}
	}

	// Token: 0x17000099 RID: 153
	// (get) Token: 0x06001150 RID: 4432 RVA: 0x00027D08 File Offset: 0x00025F08
	[Token(Token = "0x17000099")]
	public bool IncludeChineseVideos
	{
		[Token(Token = "0x6001150")]
		[Address(RVA = "0x454840", Offset = "0x453640", VA = "0x180454840", Slot = "12")]
		get
		{
			return true;
		}
	}

	// Token: 0x1700009A RID: 154
	// (get) Token: 0x06001151 RID: 4433 RVA: 0x00027D18 File Offset: 0x00025F18
	// (set) Token: 0x06001152 RID: 4434 RVA: 0x00027D2C File Offset: 0x00025F2C
	[Token(Token = "0x1700009A")]
	public bool EnableBearSkin
	{
		[Token(Token = "0x6001151")]
		[Address(RVA = "0x5D3320", Offset = "0x5D2120", VA = "0x1805D3320", Slot = "13")]
		get;
		[Token(Token = "0x6001152")]
		[Address(RVA = "0x5FD540", Offset = "0x5FC340", VA = "0x1805FD540")]
		private set;
	}

	// Token: 0x1700009B RID: 155
	// (get) Token: 0x06001153 RID: 4435 RVA: 0x00027D40 File Offset: 0x00025F40
	// (set) Token: 0x06001154 RID: 4436 RVA: 0x00027D54 File Offset: 0x00025F54
	[Token(Token = "0x1700009B")]
	public bool EnableBunnySkin
	{
		[Token(Token = "0x6001153")]
		[Address(RVA = "0x696920", Offset = "0x695720", VA = "0x180696920", Slot = "14")]
		get;
		[Token(Token = "0x6001154")]
		[Address(RVA = "0x50C1F0", Offset = "0x50AFF0", VA = "0x18050C1F0")]
		private set;
	}

	// Token: 0x1700009C RID: 156
	// (get) Token: 0x06001155 RID: 4437 RVA: 0x00027D68 File Offset: 0x00025F68
	// (set) Token: 0x06001156 RID: 4438 RVA: 0x00027D7C File Offset: 0x00025F7C
	[Token(Token = "0x1700009C")]
	public bool EnablePajamasSkin
	{
		[Token(Token = "0x6001155")]
		[Address(RVA = "0x50C180", Offset = "0x50AF80", VA = "0x18050C180", Slot = "15")]
		get;
		[Token(Token = "0x6001156")]
		[Address(RVA = "0x50C1C0", Offset = "0x50AFC0", VA = "0x18050C1C0")]
		private set;
	}

	// Token: 0x06001157 RID: 4439 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001157")]
	[Address(RVA = "0xAB6CE0", Offset = "0xAB5AE0", VA = "0x180AB6CE0")]
	public SteamPlatform()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001158 RID: 4440 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001158")]
	[Address(RVA = "0xAB6440", Offset = "0xAB5240", VA = "0x180AB6440", Slot = "16")]
	public void Setup(Action nextAction)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001159 RID: 4441 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001159")]
	[Address(RVA = "0xAB5FF0", Offset = "0xAB4DF0", VA = "0x180AB5FF0", Slot = "17")]
	public GameConfig GetConfig()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600115A RID: 4442 RVA: 0x00027D90 File Offset: 0x00025F90
	[Token(Token = "0x600115A")]
	[Address(RVA = "0xAB63D0", Offset = "0xAB51D0", VA = "0x180AB63D0", Slot = "18")]
	public void SaveConfig(GameConfig config)
	{
		string text = JsonConvert.SerializeObject(config);
		PlayerPrefs.SetString("Config", text);
	}

	// Token: 0x0600115B RID: 4443 RVA: 0x00027DB0 File Offset: 0x00025FB0
	[Token(Token = "0x600115B")]
	[Address(RVA = "0xAB5F30", Offset = "0xAB4D30", VA = "0x180AB5F30")]
	private GameConfig CreateConfig()
	{
		GameConfig gameConfig = new GameConfig();
		gameConfig.configVersion = (int)((ulong)21L);
		string text = JsonConvert.SerializeObject(gameConfig);
		PlayerPrefs.SetString("Config", text);
		return gameConfig;
	}

	// Token: 0x0600115C RID: 4444 RVA: 0x00027DE8 File Offset: 0x00025FE8
	[Token(Token = "0x600115C")]
	[Address(RVA = "0xAB6500", Offset = "0xAB5300", VA = "0x180AB6500", Slot = "19")]
	public void ShowNoSpaceDialogue(Action nextAction)
	{
		/*
An exception occurred when decompiling this method (0600115C)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void SteamPlatform::ShowNoSpaceDialogue(System.Action)

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stloc:Exception(var_0_0A, newobj:Exception(Exception::.ctor, ldstr:string("This is ps4 only feature, if see the log, check save file flow."))); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
	}

	// Token: 0x0600115D RID: 4445 RVA: 0x00027E00 File Offset: 0x00026000
	[Token(Token = "0x600115D")]
	[Address(RVA = "0xAB6110", Offset = "0xAB4F10", VA = "0x180AB6110", Slot = "20")]
	public GameSkin[] GetPlatformSkins()
	{
		GameSkin[] array = EnumUtils.AllValues<GameSkin>();
		GameSkin[] array2 = new GameSkin[2];
		int length = array2.Length;
		array2[0] = (GameSkin)((ulong)1L);
		array2[0] = (GameSkin)((ulong)2L);
		return Enumerable.ToArray<GameSkin>(Enumerable.Except<GameSkin>(array, array2));
	}

	// Token: 0x0600115E RID: 4446 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600115E")]
	[Address(RVA = "0xAB61F0", Offset = "0xAB4FF0", VA = "0x180AB61F0", Slot = "21")]
	public bool HasAchievementUnlocked(int index)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600115F RID: 4447 RVA: 0x00027E48 File Offset: 0x00026048
	[Token(Token = "0x600115F")]
	[Address(RVA = "0xAB6550", Offset = "0xAB5350", VA = "0x180AB6550", Slot = "22")]
	public void UnlockAchievement(int index)
	{
		bool flag = SteamUserStats.SetAchievement(this.achievementSystem.achievementKeys[index]);
		bool flag2 = SteamUserStats.StoreStats();
	}

	// Token: 0x06001160 RID: 4448 RVA: 0x00027E7C File Offset: 0x0002607C
	[Token(Token = "0x6001160")]
	[Address(RVA = "0xAB6250", Offset = "0xAB5050", VA = "0x180AB6250", Slot = "23")]
	public void ResetAllAchievements(Action onCompleted)
	{
		SteamAchievementSystem steamAchievementSystem = this.achievementSystem;
		string[] achievementKeys = steamAchievementSystem.achievementKeys;
		int num = 0;
		if (num < achievementKeys.Length)
		{
			string text = steamAchievementSystem.achievementKeys[num];
			if (!SteamUserStats.ClearAchievement(text))
			{
				Debug.LogError("Clear steam achievement failed: " + text);
			}
			string[] achievementKeys2 = steamAchievementSystem.achievementKeys;
			num++;
		}
		if (!SteamUserStats.StoreStats())
		{
			Debug.LogError("Store all steam achievements failed.");
		}
		if (onCompleted != 0)
		{
			onCompleted();
		}
	}

	// Token: 0x06001161 RID: 4449 RVA: 0x00027EFC File Offset: 0x000260FC
	[Token(Token = "0x6001161")]
	[Address(RVA = "0xAB65A0", Offset = "0xAB53A0", VA = "0x180AB65A0", Slot = "24")]
	public void UpdateStatsData(GameCollection collectionData)
	{
		string[] array = this.statsKeys;
		int speedSpellcasting = collectionData.speedSpellcasting;
		bool flag = SteamUserStats.SetStat(array[0], speedSpellcasting);
		string[] array2 = this.statsKeys;
		int meleeSpellcasting = collectionData.meleeSpellcasting;
		bool flag2 = SteamUserStats.SetStat(array2[1], meleeSpellcasting);
		string[] array3 = this.statsKeys;
		int manaAbsorbed = collectionData.manaAbsorbed;
		bool flag3 = SteamUserStats.SetStat(array3[2], manaAbsorbed);
		string[] array4 = this.statsKeys;
		int soulAcquired = collectionData.soulAcquired;
		bool flag4 = SteamUserStats.SetStat(array4[3], soulAcquired);
		string[] array5 = this.statsKeys;
		int enemiesDefeated = collectionData.enemiesDefeated;
		bool flag5 = SteamUserStats.SetStat(array5[4], enemiesDefeated);
		if (!SteamUserStats.StoreStats())
		{
			Debug.LogError("Update steam stats failed.");
		}
	}

	// Token: 0x06001162 RID: 4450 RVA: 0x00027FC4 File Offset: 0x000261C4
	[Token(Token = "0x6001162")]
	[Address(RVA = "0x943680", Offset = "0x942480", VA = "0x180943680", Slot = "25")]
	public void Quit()
	{
		Application.Quit();
	}

	// Token: 0x06001163 RID: 4451 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001163")]
	[Address(RVA = "0xAB6980", Offset = "0xAB5780", VA = "0x180AB6980")]
	private void VerifyCollectionData(string statsKey, ref int data, ref bool flag)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001164 RID: 4452 RVA: 0x00027FD8 File Offset: 0x000261D8
	[Token(Token = "0x6001164")]
	[Address(RVA = "0xAB6730", Offset = "0xAB5530", VA = "0x180AB6730")]
	private void UpdateStatsData(string statsKey, int value)
	{
		bool flag = SteamUserStats.SetStat(statsKey, value);
	}

	// Token: 0x06001165 RID: 4453 RVA: 0x00027FF0 File Offset: 0x000261F0
	[Token(Token = "0x6001165")]
	[Address(RVA = "0xAB6740", Offset = "0xAB5540", VA = "0x180AB6740")]
	private void UpgradeOldGameSaveFiles()
	{
		FileInfo[] files = new DirectoryInfo(Path.Combine(Application.dataPath, "Save")).GetFiles();
		int num = 0;
		int length = files.Length;
		if (num < length)
		{
			FileInfo fileInfo = files[num];
			string name = fileInfo.Name;
			if (name.StartsWith("Save") && string.Equals(Path.GetExtension(name), ".dat"))
			{
				GameSaveLegacy gameSaveLegacy = new GameSaveLegacy();
				string fullName = fileInfo.FullName;
				WriteFileResult writeFileResult = Game.WriteGameSave(gameSaveLegacy.Convert(fullName));
				fileInfo.Delete();
			}
			num++;
		}
	}

	// Token: 0x06001166 RID: 4454 RVA: 0x0002808C File Offset: 0x0002628C
	[Token(Token = "0x6001166")]
	[Address(RVA = "0xAB69C0", Offset = "0xAB57C0", VA = "0x180AB69C0")]
	private void VerifyCollectionData()
	{
		string text = this.statsKeys[0];
		GameCollection collection = Game.Collection;
		int num = 0;
		bool stat = SteamUserStats.GetStat(text, num);
		if (collection.speedSpellcasting < num)
		{
			collection.speedSpellcasting = num;
		}
		string text2 = this.statsKeys[1];
		GameCollection collection2 = Game.Collection;
		bool stat2 = SteamUserStats.GetStat(text2, num);
		if (collection2.meleeSpellcasting < num)
		{
			collection2.meleeSpellcasting = num;
		}
		string text3 = this.statsKeys[2];
		GameCollection collection3 = Game.Collection;
		bool stat3 = SteamUserStats.GetStat(text3, num);
		if (collection3.manaAbsorbed < num)
		{
			collection3.manaAbsorbed = num;
		}
		string text4 = this.statsKeys[3];
		GameCollection collection4 = Game.Collection;
		bool stat4 = SteamUserStats.GetStat(text4, num);
		if (collection4.soulAcquired < num)
		{
			collection4.soulAcquired = num;
		}
		string text5 = this.statsKeys[4];
		GameCollection collection5 = Game.Collection;
		bool stat5 = SteamUserStats.GetStat(text5, num);
		if (collection5.enemiesDefeated < num)
		{
			collection5.enemiesDefeated = num;
		}
		if ((ulong)1L != 0UL)
		{
			WriteFileResult writeFileResult = Game.WriteSystemData();
		}
	}

	// Token: 0x06001167 RID: 4455 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001167")]
	[Address(RVA = "0xAB6C50", Offset = "0xAB5A50", VA = "0x180AB6C50")]
	private void VerifyDlcPurchasing()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x04001B48 RID: 6984
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x4001B48")]
	private StandaloneFileSystem fileSystem;

	// Token: 0x04001B49 RID: 6985
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4001B49")]
	private SteamAchievementSystem achievementSystem;

	// Token: 0x04001B4A RID: 6986
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001B4A")]
	private string[] statsKeys;
}
