mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-26 15:39:01 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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.";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user