Files
NobetaSource/Cpp2IL/Assembly-CSharp/SteamPlatform.cs
2023-09-06 22:09:22 +02:00

447 lines
16 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using Cpp2IlInjected;
using MarsSDK;
using Newtonsoft.Json;
using Steamworks;
using UnityEngine;
// Token: 0x02000158 RID: 344
[Token(Token = "0x2000158")]
public class SteamPlatform : IGamePlatform
{
// Token: 0x1700008E RID: 142
// (get) Token: 0x0600115F RID: 4447 RVA: 0x00028124 File Offset: 0x00026324
[Token(Token = "0x1700008E")]
public SystemLanguage DefaultLanguage
{
[Token(Token = "0x600115F")]
[Address(RVA = "0xB1CC70", Offset = "0xB1B470", VA = "0x180B1CC70")]
get
{
return Application.systemLanguage;
}
}
// Token: 0x1700008F RID: 143
// (get) Token: 0x06001160 RID: 4448 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x1700008F")]
public ControllerDevice DefaultController
{
[Token(Token = "0x6001160")]
[Address(RVA = "0x2E8FA0", Offset = "0x2E77A0", VA = "0x1802E8FA0", Slot = "4")]
get
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x17000090 RID: 144
// (get) Token: 0x06001161 RID: 4449 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x17000090")]
public IFileSystem FileSystem
{
[Token(Token = "0x6001161")]
[Address(RVA = "0x345100", Offset = "0x343900", VA = "0x180345100", Slot = "5")]
get
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x17000091 RID: 145
// (get) Token: 0x06001162 RID: 4450 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x17000091")]
public bool IsConsolePlatform
{
[Token(Token = "0x6001162")]
[Address(RVA = "0x29A960", Offset = "0x299160", VA = "0x18029A960", Slot = "6")]
get
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x17000092 RID: 146
// (get) Token: 0x06001163 RID: 4451 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x17000092")]
public bool UseAsiaController
{
[Token(Token = "0x6001163")]
[Address(RVA = "0x29A960", Offset = "0x299160", VA = "0x18029A960", Slot = "7")]
get
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x17000093 RID: 147
// (get) Token: 0x06001164 RID: 4452 RVA: 0x00028138 File Offset: 0x00026338
[Token(Token = "0x17000093")]
public bool UseAchievement
{
[Token(Token = "0x6001164")]
[Address(RVA = "0x497D00", Offset = "0x496500", VA = "0x180497D00", Slot = "8")]
get
{
return true;
}
}
// Token: 0x17000094 RID: 148
// (get) Token: 0x06001165 RID: 4453 RVA: 0x00028148 File Offset: 0x00026348
[Token(Token = "0x17000094")]
public bool ShowQuitButton
{
[Token(Token = "0x6001165")]
[Address(RVA = "0x497D00", Offset = "0x496500", VA = "0x180497D00", Slot = "9")]
get
{
return true;
}
}
// Token: 0x17000095 RID: 149
// (get) Token: 0x06001166 RID: 4454 RVA: 0x00028158 File Offset: 0x00026358
[Token(Token = "0x17000095")]
public bool ShowDepthOfFieldSetting
{
[Token(Token = "0x6001166")]
[Address(RVA = "0x497D00", Offset = "0x496500", VA = "0x180497D00", Slot = "10")]
get
{
return true;
}
}
// Token: 0x17000096 RID: 150
// (get) Token: 0x06001167 RID: 4455 RVA: 0x00028168 File Offset: 0x00026368
[Token(Token = "0x17000096")]
public bool IncludeChineseVideos
{
[Token(Token = "0x6001167")]
[Address(RVA = "0x497D00", Offset = "0x496500", VA = "0x180497D00", Slot = "11")]
get
{
return true;
}
}
// Token: 0x06001168 RID: 4456 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6001168")]
[Address(RVA = "0xB1B3D0", Offset = "0xB19BD0", VA = "0x180B1B3D0")]
public SteamPlatform()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06001169 RID: 4457 RVA: 0x00028178 File Offset: 0x00026378
[Token(Token = "0x6001169")]
[Address(RVA = "0xB1AC40", Offset = "0xB19440", VA = "0x180B1AC40", Slot = "12")]
public void Setup(Action nextAction)
{
this.UpgradeOldGameSaveFiles();
this.VerifyCollectionData();
if (nextAction != 0)
{
nextAction();
}
}
// Token: 0x0600116A RID: 4458 RVA: 0x0002819C File Offset: 0x0002639C
[Token(Token = "0x600116A")]
[Address(RVA = "0xB1A8F0", Offset = "0xB190F0", VA = "0x180B1A8F0", Slot = "13")]
public void InitDlc()
{
int num = 0;
int dlccount = SteamApps.GetDLCCount();
List<GameDlc> list = new List();
if (dlccount > 0)
{
ulong num2;
if (SteamApps.BGetDLCDataByIndex(num, num, num, num, (int)num2) && (num != 2152390 || SteamApps.BIsSubscribedApp(num)) && num == 2242530 && SteamApps.BIsSubscribedApp(num))
{
list.Add((uint)1002);
}
num++;
}
Game.DLC.SetupDlc(list);
}
// Token: 0x0600116B RID: 4459 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600116B")]
[Address(RVA = "0xB1A690", Offset = "0xB18E90", VA = "0x180B1A690", Slot = "14")]
public GameConfig GetConfig()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600116C RID: 4460 RVA: 0x00028214 File Offset: 0x00026414
[Token(Token = "0x600116C")]
[Address(RVA = "0xB1ABD0", Offset = "0xB193D0", VA = "0x180B1ABD0", Slot = "15")]
public void SaveConfig(GameConfig config)
{
string text = JsonConvert.SerializeObject(config);
PlayerPrefs.SetString("Config", text);
}
// Token: 0x0600116D RID: 4461 RVA: 0x00028234 File Offset: 0x00026434
[Token(Token = "0x600116D")]
[Address(RVA = "0xB1A5D0", Offset = "0xB18DD0", VA = "0x180B1A5D0")]
private GameConfig CreateConfig()
{
GameConfig gameConfig = new GameConfig();
gameConfig.configVersion = (int)((ulong)21L);
string text = JsonConvert.SerializeObject(gameConfig);
PlayerPrefs.SetString("Config", text);
return gameConfig;
}
// Token: 0x0600116E RID: 4462 RVA: 0x0002826C File Offset: 0x0002646C
[Token(Token = "0x600116E")]
[Address(RVA = "0xB1AC80", Offset = "0xB19480", VA = "0x180B1AC80", Slot = "16")]
public void ShowNoSpaceDialogue(Action nextAction)
{
/*
An exception occurred when decompiling this method (0600116E)
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: 0x0600116F RID: 4463 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600116F")]
[Address(RVA = "0xB1A7B0", Offset = "0xB18FB0", VA = "0x180B1A7B0", Slot = "17")]
public GameSkin[] GetPlatformSkins()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06001170 RID: 4464 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6001170")]
[Address(RVA = "0xB1A890", Offset = "0xB19090", VA = "0x180B1A890", Slot = "18")]
public bool HasAchievementUnlocked(int index)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06001171 RID: 4465 RVA: 0x00028284 File Offset: 0x00026484
[Token(Token = "0x6001171")]
[Address(RVA = "0xB1ACD0", Offset = "0xB194D0", VA = "0x180B1ACD0", Slot = "19")]
public void UnlockAchievement(int index)
{
bool flag = SteamUserStats.SetAchievement(this.achievementSystem.achievementKeys[index]);
bool flag2 = SteamUserStats.StoreStats();
}
// Token: 0x06001172 RID: 4466 RVA: 0x000282B8 File Offset: 0x000264B8
[Token(Token = "0x6001172")]
[Address(RVA = "0xB1AA50", Offset = "0xB19250", VA = "0x180B1AA50", Slot = "20")]
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: 0x06001173 RID: 4467 RVA: 0x00028338 File Offset: 0x00026538
[Token(Token = "0x6001173")]
[Address(RVA = "0xB1AD20", Offset = "0xB19520", VA = "0x180B1AD20", Slot = "21")]
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: 0x06001174 RID: 4468 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6001174")]
[Address(RVA = "0x29E8B0", Offset = "0x29D0B0", VA = "0x18029E8B0", Slot = "23")]
public void MountDLCPoint(GameSkin skin)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06001175 RID: 4469 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6001175")]
[Address(RVA = "0x29E8B0", Offset = "0x29D0B0", VA = "0x18029E8B0", Slot = "24")]
public void UnmountDLCPoints()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06001176 RID: 4470 RVA: 0x00028400 File Offset: 0x00026600
[Token(Token = "0x6001176")]
[Address(RVA = "0x9516A0", Offset = "0x94FEA0", VA = "0x1809516A0", Slot = "22")]
public void Quit()
{
Application.Quit();
}
// Token: 0x06001177 RID: 4471 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6001177")]
[Address(RVA = "0xB1B100", Offset = "0xB19900", VA = "0x180B1B100")]
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: 0x06001178 RID: 4472 RVA: 0x00028414 File Offset: 0x00026614
[Token(Token = "0x6001178")]
[Address(RVA = "0xB1AEB0", Offset = "0xB196B0", VA = "0x180B1AEB0")]
private void UpdateStatsData(string statsKey, int value)
{
bool flag = SteamUserStats.SetStat(statsKey, value);
}
// Token: 0x06001179 RID: 4473 RVA: 0x0002842C File Offset: 0x0002662C
[Token(Token = "0x6001179")]
[Address(RVA = "0xB1AEC0", Offset = "0xB196C0", VA = "0x180B1AEC0")]
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: 0x0600117A RID: 4474 RVA: 0x000284C8 File Offset: 0x000266C8
[Token(Token = "0x600117A")]
[Address(RVA = "0xB1B140", Offset = "0xB19940", VA = "0x180B1B140")]
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: 0x0600117B RID: 4475 RVA: 0x000285EC File Offset: 0x000267EC
[Token(Token = "0x600117B")]
[Address(RVA = "0xB1A8F0", Offset = "0xB190F0", VA = "0x180B1A8F0")]
private void UpdateDlcData()
{
int num = 0;
int dlccount = SteamApps.GetDLCCount();
List<GameDlc> list = new List();
if (dlccount > 0)
{
ulong num2;
if (SteamApps.BGetDLCDataByIndex(num, num, num, num, (int)num2) && (num != 2152390 || SteamApps.BIsSubscribedApp(num)) && num == 2242530 && SteamApps.BIsSubscribedApp(num))
{
list.Add((uint)1002);
}
num++;
}
Game.DLC.SetupDlc(list);
}
// Token: 0x04001B79 RID: 7033
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4001B79")]
private StandaloneFileSystem fileSystem;
// Token: 0x04001B7A RID: 7034
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4001B7A")]
private SteamAchievementSystem achievementSystem;
// Token: 0x04001B7B RID: 7035
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4001B7B")]
private string[] statsKeys;
}