Class Constants
public static class Constants
- Inheritance
-
Constants
- Inherited Members
Fields
SharedStaticLabel
Label used for shared static GameObjects that persist across scenes.
public const string SharedStaticLabel = "Shared_Static_Permanent"
Field Value
Methods
GetPatchFileName(string, string)
Builds the patch archive file name for an upgrade from
fromVersion to toVersion.
public static string GetPatchFileName(string fromVersion, string toVersion)
Parameters
Returns
- string
The archive file name, or
nullwhen either version is missing or contains anything that is not a version character. Callers MUST null-check.
Remarks
This naming scheme is a three-way contract between the patch generator, the patcher web server's index regex, and the Updater's lookup. Changing it requires changing all three.
Security: toVersion comes from the update server, and the
result is fed straight to Path.Combine by the launcher's download path. A bare
interpolation therefore made the server the author of a filesystem path — a version
carrying ../ put the downloaded archive wherever the server liked, and since
the same response supplies the expected SHA-256, the integrity check passed and the
file was kept.
Parse(string) now rejects those version strings at the grammar level, which is the first line of defence. This is the second, and it is here rather than only there because the two are separated by several call frames and a serialized field: this function's contract is "produce a file name", and a file name containing a separator is not one. It returns null rather than throwing so the caller can report a normal update failure; a null is a programming-visible refusal, not a crash in front of the player.
GetPatchesDirectory()
Returns the directory that patch archives are downloaded into by the launcher and read from by the standalone Updater executable.
public static string GetPatchesDirectory()
Returns
Remarks
The Updater resolves the same location from its own base directory. Both processes run from the client install root, so the two agree. See PatchesDirectoryName.
GetTemporaryPath()
Returns the path to the temporary directory used for transient files.
public static string GetTemporaryPath()
Returns
Remarks
This is a directory, not a file path. Patch downloads must not be written here — the Updater only reads from GetPatchesDirectory().
GetWorkingDirectory()
Returns the working directory for the application.
In the Unity Editor, this is the project root.
In standalone builds, this is the base directory of the executable.
On WebGL (non-Editor), returns UnityEngine.Application.persistentDataPath
since AppDomain.CurrentDomain.BaseDirectory is not available at runtime.
public static string GetWorkingDirectory()