Files
2026-10-16 23:33:13 -07:00

38 lines
1.1 KiB
C#

using System.Reflection;
namespace RadicadeServer.Utils
{
public static class BuildInfo
{
public const string Tag = "notify-ids-numeric-string";
public const string NotifyIdFormat = "numeric-string";
public static readonly DateTime StartedUtc = DateTime.UtcNow;
public static DateTime? AssemblyBuiltUtc
{
get
{
try
{
var location = Assembly.GetEntryAssembly()?.Location;
return string.IsNullOrEmpty(location) || !File.Exists(location)
? null
: File.GetLastWriteTimeUtc(location);
}
catch
{
return null;
}
}
}
public static string Describe()
=> $"{Tag}: notify ids are sent as the client enum's NUMBER in a JSON string (MessageReceived=\"2\", ModerationKick=\"22\", RefreshLogin=\"5\") - " +
"never a bare number (the client cannot parse it) and never a name (it parses and matches no handler). " +
$"Started {StartedUtc:u} from an assembly published {AssemblyBuiltUtc?.ToString("u") ?? "unknown"}. " +
"If this line is missing, or the publish time is older than your deploy, the running server is not the build you just made.";
}
}