| using System; |
| using System; |
| using UnityEngine; |
| using UnityEngine; |
| |
| |
| internal class Version |
| internal class Version |
| { |
| { |
| . | public static GameVersion CurrentVersion { get; } = new GameVersion(0, 217, 46); |
| public static GameVersion CurrentVersion { get; } = new GameVersion(0, 218, 15); |
| |
| |
| public static string GetVersionString(bool includeMercurialHash = false) |
| public static string GetVersionString(bool includeMercurialHash = false) |
| { |
| { |
| string text = global::Version.CurrentVersion.ToString(); |
| string text = global::Version.CurrentVersion.ToString(); |
| string platformPrefix = global::Version.GetPlatformPrefix(""); |
| string platformPrefix = global::Version.GetPlatformPrefix(""); |
| if (platformPrefix.Length > 0) |
| if (platformPrefix.Length > 0) |
| { |
| { |
| text = string.Format("{0}-{1}", platformPrefix, global::Version.CurrentVersion); |
| text = string.Format("{0}-{1}", platformPrefix, global::Version.CurrentVersion); |
| } |
| } |
| if (includeMercurialHash) |
| if (includeMercurialHash) |
| { |
| { |
| TextAsset textAsset = Resources.Load<TextAsset>("clientVersion"); |
| TextAsset textAsset = Resources.Load<TextAsset>("clientVersion"); |
| if (textAsset != null) |
| if (textAsset != null) |
| { |
| { |
| text = text + "\n" + textAsset.text; |
| text = text + "\n" + textAsset.text; |
| } |
| } |
| } |
| } |
| return text; |
| return text; |
| } |
| } |
| |
| |
| public static bool IsWorldVersionCompatible(int version) |
| public static bool IsWorldVersionCompatible(int version) |
| { |
| { |
| . | return version <= 33 && version >= 9; |
| return version <= 34 && version >= 9; |
| } |
| } |
| |
| |
| public static bool IsPlayerVersionCompatible(int version) |
| public static bool IsPlayerVersionCompatible(int version) |
| { |
| { |
| . | return version <= 38 && version >= 27; |
| return version <= 39 && version >= 27; |
| } |
| } |
| |
| |
| public static Platforms GetPlatform() |
| public static Platforms GetPlatform() |
| { |
| { |
| if (Settings.IsSteamRunningOnSteamDeck()) |
| if (Settings.IsSteamRunningOnSteamDeck()) |
| { |
| { |
| return Platforms.SteamDeckProton; |
| return Platforms.SteamDeckProton; |
| } |
| } |
| return Platforms.SteamWindows; |
| return Platforms.SteamWindows; |
| } |
| } |
| |
| |
| public static string GetPlatformPrefix(string Default = "") |
| public static string GetPlatformPrefix(string Default = "") |
| { |
| { |
| Platforms platform = global::Version.GetPlatform(); |
| Platforms platform = global::Version.GetPlatform(); |
| switch (platform) |
| switch (platform) |
| { |
| { |
| case Platforms.SteamWindows: |
| case Platforms.SteamWindows: |
| case Platforms.SteamWindows | Platforms.SteamLinux: |
| case Platforms.SteamWindows | Platforms.SteamLinux: |
| break; |
| break; |
| case Platforms.SteamLinux: |
| case Platforms.SteamLinux: |
| return "l"; |
| return "l"; |
| case Platforms.SteamDeckProton: |
| case Platforms.SteamDeckProton: |
| return "dw"; |
| return "dw"; |
| default: |
| default: |
| if (platform == Platforms.SteamDeckNative) |
| if (platform == Platforms.SteamDeckNative) |
| { |
| { |
| return "dl"; |
| return "dl"; |
| } |
| } |
| if (platform == Platforms.MicrosoftStore) |
| if (platform == Platforms.MicrosoftStore) |
| { |
| { |
| return "ms"; |
| return "ms"; |
| } |
| } |
| break; |
| break; |
| } |
| } |
| return Default; |
| return Default; |
| } |
| } |
| |
| |
| . | public const uint m_networkVersion = 23U; |
| public const uint m_networkVersion = 27U; |
| |
| |
| . | public const int m_playerVersion = 38; |
| public const int m_playerVersion = 39; |
| |
| |
| public const int m_oldestForwardCompatiblePlayerVersion = 27; |
| public const int m_oldestForwardCompatiblePlayerVersion = 27; |
| |
| |
| . | public const int m_worldVersion = 33; |
| public const int m_worldVersion = 34; |
| |
| |
| public const int m_oldestForwardCompatibleWorldVersion = 9; |
| public const int m_oldestForwardCompatibleWorldVersion = 9; |
| |
| |
| public const int c_WorldVersionNewSaveFormat = 31; |
| public const int c_WorldVersionNewSaveFormat = 31; |
| |
| |
| public const int c_WorldVersionGlobalKeys = 32; |
| public const int c_WorldVersionGlobalKeys = 32; |
| |
| |
| public const int c_WorldVersionNumItems = 33; |
| public const int c_WorldVersionNumItems = 33; |
| |
| |
| public const int m_worldGenVersion = 2; |
| public const int m_worldGenVersion = 2; |
| |
| |
| public const int m_itemDataVersion = 106; |
| public const int m_itemDataVersion = 106; |
| |
| |
| . | public const int m_playerDataVersion = 26; |
| public const int m_playerDataVersion = 27; |
| |
| |
| public static readonly GameVersion FirstVersionWithNetworkVersion = new GameVersion(0, 214, 301); |
| public static readonly GameVersion FirstVersionWithNetworkVersion = new GameVersion(0, 214, 301); |
| |
| |
| public static readonly GameVersion FirstVersionWithPlatformRestriction = new GameVersion(0, 213, 3); |
| public static readonly GameVersion FirstVersionWithPlatformRestriction = new GameVersion(0, 213, 3); |
| |
| |
| public static readonly GameVersion FirstVersionWithModifiers = new GameVersion(0, 217, 8); |
| public static readonly GameVersion FirstVersionWithModifiers = new GameVersion(0, 217, 8); |
| } |
| } |
| |
| |