CVar to promotehost automatically. (#17643)
This commit is contained in:
committed by
GitHub
parent
1005c02ab2
commit
4c8965ac32
@@ -292,7 +292,11 @@ namespace Content.Server.Administration.Managers
|
||||
|
||||
private async Task<(AdminData dat, int? rankId, bool specialLogin)?> LoadAdminData(IPlayerSession session)
|
||||
{
|
||||
if (IsLocal(session) && _cfg.GetCVar(CCVars.ConsoleLoginLocal) || _promotedPlayers.Contains(session.UserId))
|
||||
var promoteHost = IsLocal(session) && _cfg.GetCVar(CCVars.ConsoleLoginLocal)
|
||||
|| _promotedPlayers.Contains(session.UserId)
|
||||
|| session.Name == _cfg.GetCVar(CCVars.ConsoleLoginHostUser);
|
||||
|
||||
if (promoteHost)
|
||||
{
|
||||
var data = new AdminData
|
||||
{
|
||||
|
||||
@@ -430,6 +430,12 @@ namespace Content.Shared.CCVar
|
||||
public static readonly CVarDef<bool>
|
||||
ConsoleLoginLocal = CVarDef.Create("console.loginlocal", true, CVar.ARCHIVE | CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// Automatically log in the given user as host, equivalent to the <c>promotehost</c> command.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<string> ConsoleLoginHostUser =
|
||||
CVarDef.Create("console.login_host_user", "", CVar.ARCHIVE | CVar.SERVERONLY);
|
||||
|
||||
|
||||
/*
|
||||
* Database stuff
|
||||
|
||||
Reference in New Issue
Block a user