Clean up command perms (#28451)
* Change BanExemption command to AdminFlags.Ban permissions * Change LOOC to check for Moderator permission * Change ListVerbs from Admin to Debug AdminFlags * Change RunVerbAs from Admin to Fun AdminFlags * More permission changes * Change GhostKick to Moderator perm * Clean up command perms * fuck --------- Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,7 @@ using Robust.Shared.Utility;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands;
|
namespace Content.Server.Administration.Commands;
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.AdminWho)]
|
||||||
public sealed class AdminWhoCommand : IConsoleCommand
|
public sealed class AdminWhoCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "adminwho";
|
public string Command => "adminwho";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands
|
namespace Content.Server.Administration.Commands
|
||||||
{
|
{
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class AnnounceUiCommand : IConsoleCommand
|
public sealed class AnnounceUiCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "announceui";
|
public string Command => "announceui";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands;
|
namespace Content.Server.Administration.Commands;
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Ban)]
|
||||||
public sealed class BanExemptionUpdateCommand : LocalizedCommands
|
public sealed class BanExemptionUpdateCommand : LocalizedCommands
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerDbManager _dbManager = default!;
|
[Dependency] private readonly IServerDbManager _dbManager = default!;
|
||||||
@@ -61,7 +61,7 @@ public sealed class BanExemptionUpdateCommand : LocalizedCommands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Ban)]
|
||||||
public sealed class BanExemptionGetCommand : LocalizedCommands
|
public sealed class BanExemptionGetCommand : LocalizedCommands
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IServerDbManager _dbManager = default!;
|
[Dependency] private readonly IServerDbManager _dbManager = default!;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands
|
namespace Content.Server.Administration.Commands
|
||||||
{
|
{
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
sealed class DSay : IConsoleCommand
|
sealed class DSay : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _e = default!;
|
[Dependency] private readonly IEntityManager _e = default!;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands;
|
namespace Content.Server.Administration.Commands;
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Fun)]
|
||||||
public sealed class FaxUiCommand : IConsoleCommand
|
public sealed class FaxUiCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "faxui";
|
public string Command => "faxui";
|
||||||
@@ -27,4 +27,3 @@ public sealed class FaxUiCommand : IConsoleCommand
|
|||||||
eui.OpenEui(ui, player);
|
eui.OpenEui(ui, player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands;
|
namespace Content.Server.Administration.Commands;
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Fun)]
|
||||||
public sealed class LinkBluespaceLocker : IConsoleCommand
|
public sealed class LinkBluespaceLocker : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands;
|
namespace Content.Server.Administration.Commands;
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class PlayTimeAddOverallCommand : IConsoleCommand
|
public sealed class PlayTimeAddOverallCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
@@ -58,7 +58,7 @@ public sealed class PlayTimeAddOverallCommand : IConsoleCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class PlayTimeAddRoleCommand : IConsoleCommand
|
public sealed class PlayTimeAddRoleCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
@@ -123,7 +123,7 @@ public sealed class PlayTimeAddRoleCommand : IConsoleCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class PlayTimeGetOverallCommand : IConsoleCommand
|
public sealed class PlayTimeGetOverallCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
@@ -168,7 +168,7 @@ public sealed class PlayTimeGetOverallCommand : IConsoleCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class PlayTimeGetRoleCommand : IConsoleCommand
|
public sealed class PlayTimeGetRoleCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
@@ -247,7 +247,7 @@ public sealed class PlayTimeGetRoleCommand : IConsoleCommand
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the timers for a particular player immediately
|
/// Saves the timers for a particular player immediately
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class PlayTimeSaveCommand : IConsoleCommand
|
public sealed class PlayTimeSaveCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Administration.Commands
|
namespace Content.Server.Administration.Commands
|
||||||
{
|
{
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.NameColor)]
|
||||||
internal sealed class SetAdminOOC : IConsoleCommand
|
internal sealed class SetAdminOOC : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "setadminooc";
|
public string Command => "setadminooc";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Robust.Shared.Console;
|
|||||||
namespace Content.Server.AlertLevel.Commands
|
namespace Content.Server.AlertLevel.Commands
|
||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Fun)]
|
||||||
public sealed class SetAlertLevelCommand : LocalizedCommands
|
public sealed class SetAlertLevelCommand : LocalizedCommands
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Announcements
|
namespace Content.Server.Announcements
|
||||||
{
|
{
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class AnnounceCommand : IConsoleCommand
|
public sealed class AnnounceCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "announce";
|
public string Command => "announce";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Chat.Commands;
|
namespace Content.Server.Chat.Commands;
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Server)]
|
[AdminCommand(AdminFlags.Admin)]
|
||||||
public sealed class SetOOCCommand : IConsoleCommand
|
public sealed class SetOOCCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "setooc";
|
public string Command => "setooc";
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Content.Server.Speech.EntitySystems;
|
|||||||
using Content.Server.Station.Components;
|
using Content.Server.Station.Components;
|
||||||
using Content.Server.Station.Systems;
|
using Content.Server.Station.Systems;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.Chat;
|
using Content.Shared.Chat;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
@@ -277,9 +278,13 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
message = SanitizeInGameOOCMessage(message);
|
message = SanitizeInGameOOCMessage(message);
|
||||||
|
|
||||||
var sendType = type;
|
var sendType = type;
|
||||||
// If dead player LOOC is disabled, unless you are an aghost, send dead messages to dead chat
|
// If dead player LOOC is disabled, unless you are an admin with Moderator perms, send dead messages to dead chat
|
||||||
if (!_adminManager.IsAdmin(player) && !_deadLoocEnabled &&
|
if ((_adminManager.IsAdmin(player) && _adminManager.HasAdminFlag(player, AdminFlags.Moderator)) // Override if admin
|
||||||
(HasComp<GhostComponent>(source) || _mobStateSystem.IsDead(source)))
|
|| _deadLoocEnabled
|
||||||
|
|| (!HasComp<GhostComponent>(source) && !_mobStateSystem.IsDead(source))) // Check that player is not dead
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
sendType = InGameOOCChatType.Dead;
|
sendType = InGameOOCChatType.Dead;
|
||||||
|
|
||||||
// If crit player LOOC is disabled, don't send the message at all.
|
// If crit player LOOC is disabled, don't send the message at all.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Server.Damage.Commands
|
namespace Content.Server.Damage.Commands
|
||||||
{
|
{
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Fun)]
|
||||||
public sealed class GodModeCommand : IConsoleCommand
|
public sealed class GodModeCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public sealed class GhostKickManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class GhostKickCommand : IConsoleCommand
|
public sealed class GhostKickCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
public string Command => "ghostkick";
|
public string Command => "ghostkick";
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Content.Server.Motd;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A console command usable by any user which prints or sets the Message of the Day.
|
/// A console command usable by any user which prints or sets the Message of the Day.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class SetMotdCommand : LocalizedCommands
|
public sealed class SetMotdCommand : LocalizedCommands
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IAdminLogManager _adminLogManager = default!;
|
[Dependency] private readonly IAdminLogManager _adminLogManager = default!;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Robust.Shared.Toolshed.TypeParsers;
|
|||||||
|
|
||||||
namespace Content.Server.Toolshed.Commands.Verbs;
|
namespace Content.Server.Toolshed.Commands.Verbs;
|
||||||
|
|
||||||
[ToolshedCommand, AdminCommand(AdminFlags.Admin)]
|
[ToolshedCommand, AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class RunVerbAsCommand : ToolshedCommand
|
public sealed class RunVerbAsCommand : ToolshedCommand
|
||||||
{
|
{
|
||||||
private SharedVerbSystem? _verb;
|
private SharedVerbSystem? _verb;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
using Content.Server.Administration;
|
using Content.Server.Administration;
|
||||||
|
using Content.Server.Database;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
|
|
||||||
namespace Content.Server.Verbs.Commands
|
namespace Content.Server.Verbs.Commands
|
||||||
{
|
{
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class ListVerbsCommand : IConsoleCommand
|
public sealed class ListVerbsCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ namespace Content.Server.Voting.Managers
|
|||||||
timeSpan = default;
|
timeSpan = default;
|
||||||
|
|
||||||
// Admins can always call votes.
|
// Admins can always call votes.
|
||||||
if (_adminMgr.HasAdminFlag(initiator, AdminFlags.Admin))
|
if (_adminMgr.HasAdminFlag(initiator, AdminFlags.Moderator))
|
||||||
{
|
{
|
||||||
isAdmin = true;
|
isAdmin = true;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Content.Server.Voting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class CreateCustomCommand : IConsoleCommand
|
public sealed class CreateCustomCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||||
@@ -308,7 +308,7 @@ namespace Content.Server.Voting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Moderator)]
|
||||||
public sealed class CancelVoteCommand : IConsoleCommand
|
public sealed class CancelVoteCommand : IConsoleCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||||
|
|||||||
@@ -109,6 +109,21 @@
|
|||||||
///</summary>
|
///</summary>
|
||||||
Pii = 1 << 18,
|
Pii = 1 << 18,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lets you take moderator actions on the game server.
|
||||||
|
/// </summary>
|
||||||
|
Moderator = 1 << 19,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lets you check currently online admins.
|
||||||
|
/// </summary>
|
||||||
|
AdminWho = 1 << 20,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lets you set the color of your OOC name.
|
||||||
|
/// </summary>
|
||||||
|
NameColor = 1 << 21,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dangerous host permissions like scsi.
|
/// Dangerous host permissions like scsi.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -90,12 +90,12 @@
|
|||||||
|
|
||||||
- Flags: ADMIN
|
- Flags: ADMIN
|
||||||
Commands:
|
Commands:
|
||||||
- delete
|
|
||||||
- kick
|
|
||||||
- listplayers
|
- listplayers
|
||||||
- tp
|
- tp
|
||||||
- tpto
|
- tpto
|
||||||
- respawn
|
|
||||||
|
- Flags: FUN
|
||||||
|
Commands:
|
||||||
- tippy
|
- tippy
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
@@ -111,6 +111,12 @@
|
|||||||
Commands:
|
Commands:
|
||||||
- spawn
|
- spawn
|
||||||
- cspawn
|
- cspawn
|
||||||
|
- delete
|
||||||
|
|
||||||
|
- Flags: MODERATOR
|
||||||
|
Commands:
|
||||||
|
- kick
|
||||||
|
- respawn
|
||||||
|
|
||||||
- Flags: HOST
|
- Flags: HOST
|
||||||
Commands:
|
Commands:
|
||||||
|
|||||||
Reference in New Issue
Block a user