ProjectLighthouse/ProjectLighthouse/Configuration/ServerStatics.cs
jvyden ee541dbfae
Allow instance owners to provide custom name, Include server version in LbpEnvVer
This is the first step towards instance customization. Just a name for now ;)
2022-06-01 00:34:38 -04:00

41 lines
No EOL
1.1 KiB
C#

#nullable enable
using System;
using System.Linq;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Types;
namespace LBPUnion.ProjectLighthouse.Configuration;
public static class ServerStatics
{
public const int PageSize = 20;
public static bool DbConnected {
get {
try
{
return new Database().Database.CanConnect();
}
catch(Exception e)
{
Logger.Error(e.ToString(), LogArea.Database);
return false;
}
}
}
// FIXME: This needs to go at some point.
public static bool IsUnitTesting => AppDomain.CurrentDomain.GetAssemblies().Any(assembly => assembly.FullName!.StartsWith("xunit"));
#if DEBUG
public static readonly bool IsDebug = true;
#else
public static readonly bool IsDebug = false;
#endif
/// <summary>
/// The servertype, determined on startup. Shouldn't be null unless very very early in startup.
/// </summary>
// The way of doing this is kinda weird, but it works.
public static ServerType ServerType;
}