using System; using System.Collections.Generic; using SUISS.Storage; using UnityEngine; public class InstallVersion { public static void Initialise(bool isnewinstall) { if (InstallVersion._initialised) { UnityEngine.Debug.LogWarning("Already initialised"); return; } InstallVersion._initialised = true; Dictionary dictionary = Storage.Get(StorageLifecycle.Forever).GetDictionary("InstallVersion"); if (isnewinstall) { UnityEngine.Debug.Log("Install version: 3.0.6 (" + 26088 + ")"); dictionary["InstallBuild"] = 26088; dictionary["InstallVersionName"] = "3.0.6"; } else if (!dictionary.ContainsKey("InstallBuild") || !dictionary.ContainsKey("InstallVersionName")) { UnityEngine.Debug.Log("Unknown install version"); dictionary["InstallBuild"] = -1; dictionary["InstallVersionName"] = "?"; } } public static int InstallBuild { get { Dictionary dictionary = Storage.Get(StorageLifecycle.Forever).GetDictionary("InstallVersion"); if (!dictionary.ContainsKey("InstallBuild")) { return -1; } return (int)dictionary["InstallBuild"]; } } public static string InstallVersionName { get { Dictionary dictionary = Storage.Get(StorageLifecycle.Forever).GetDictionary("InstallVersion"); if (!dictionary.ContainsKey("InstallVersionName")) { return "?"; } return (string)dictionary["InstallVersionName"]; } } public const int InstallBuildRemoveErrorLog = 111; public const string StorageKey = "InstallVersion"; public const string InstallBuildKey = "InstallBuild"; public const string InstallVersionNameKey = "InstallVersionName"; public const int UNKNOWN_BUILD_NO = -1; public const string UNKNOWN_VERSION_NAME = "?"; private static bool _initialised; }