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;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.AdminWho)]
|
||||
public sealed class AdminWhoCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "adminwho";
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class AnnounceUiCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "announceui";
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Ban)]
|
||||
public sealed class BanExemptionUpdateCommand : LocalizedCommands
|
||||
{
|
||||
[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
|
||||
{
|
||||
[Dependency] private readonly IServerDbManager _dbManager = default!;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
sealed class DSay : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _e = default!;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public sealed class FaxUiCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "faxui";
|
||||
@@ -27,4 +27,3 @@ public sealed class FaxUiCommand : IConsoleCommand
|
||||
eui.OpenEui(ui, player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public sealed class LinkBluespaceLocker : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class PlayTimeAddOverallCommand : IConsoleCommand
|
||||
{
|
||||
[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
|
||||
{
|
||||
[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
|
||||
{
|
||||
[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
|
||||
{
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
@@ -247,7 +247,7 @@ public sealed class PlayTimeGetRoleCommand : IConsoleCommand
|
||||
/// <summary>
|
||||
/// Saves the timers for a particular player immediately
|
||||
/// </summary>
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class PlayTimeSaveCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Administration.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.NameColor)]
|
||||
internal sealed class SetAdminOOC : IConsoleCommand
|
||||
{
|
||||
public string Command => "setadminooc";
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.Console;
|
||||
namespace Content.Server.AlertLevel.Commands
|
||||
{
|
||||
[UsedImplicitly]
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public sealed class SetAlertLevelCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystems = default!;
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Announcements
|
||||
{
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class AnnounceCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "announce";
|
||||
|
||||
@@ -6,7 +6,7 @@ using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Chat.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public sealed class SetOOCCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "setooc";
|
||||
|
||||
@@ -10,6 +10,7 @@ using Content.Server.Speech.EntitySystems;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Database;
|
||||
@@ -277,9 +278,13 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
message = SanitizeInGameOOCMessage(message);
|
||||
|
||||
var sendType = type;
|
||||
// If dead player LOOC is disabled, unless you are an aghost, send dead messages to dead chat
|
||||
if (!_adminManager.IsAdmin(player) && !_deadLoocEnabled &&
|
||||
(HasComp<GhostComponent>(source) || _mobStateSystem.IsDead(source)))
|
||||
// If dead player LOOC is disabled, unless you are an admin with Moderator perms, send dead messages to dead chat
|
||||
if ((_adminManager.IsAdmin(player) && _adminManager.HasAdminFlag(player, AdminFlags.Moderator)) // Override if admin
|
||||
|| _deadLoocEnabled
|
||||
|| (!HasComp<GhostComponent>(source) && !_mobStateSystem.IsDead(source))) // Check that player is not dead
|
||||
{
|
||||
}
|
||||
else
|
||||
sendType = InGameOOCChatType.Dead;
|
||||
|
||||
// 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
|
||||
{
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Fun)]
|
||||
public sealed class GodModeCommand : IConsoleCommand
|
||||
{
|
||||
[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 string Command => "ghostkick";
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.Motd;
|
||||
/// <summary>
|
||||
/// A console command usable by any user which prints or sets the Message of the Day.
|
||||
/// </summary>
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class SetMotdCommand : LocalizedCommands
|
||||
{
|
||||
[Dependency] private readonly IAdminLogManager _adminLogManager = default!;
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.Toolshed.TypeParsers;
|
||||
|
||||
namespace Content.Server.Toolshed.Commands.Verbs;
|
||||
|
||||
[ToolshedCommand, AdminCommand(AdminFlags.Admin)]
|
||||
[ToolshedCommand, AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class RunVerbAsCommand : ToolshedCommand
|
||||
{
|
||||
private SharedVerbSystem? _verb;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Database;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Verbs.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class ListVerbsCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
@@ -316,7 +316,7 @@ namespace Content.Server.Voting.Managers
|
||||
timeSpan = default;
|
||||
|
||||
// Admins can always call votes.
|
||||
if (_adminMgr.HasAdminFlag(initiator, AdminFlags.Admin))
|
||||
if (_adminMgr.HasAdminFlag(initiator, AdminFlags.Moderator))
|
||||
{
|
||||
isAdmin = true;
|
||||
return true;
|
||||
@@ -370,7 +370,7 @@ namespace Content.Server.Voting.Managers
|
||||
.Select(e => e.Data)
|
||||
.ToImmutableArray();
|
||||
// Store all votes in order for webhooks
|
||||
var voteTally = new List<int>();
|
||||
var voteTally = new List<int>();
|
||||
foreach(var entry in v.Entries)
|
||||
{
|
||||
voteTally.Add(entry.Votes);
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Content.Server.Voting
|
||||
}
|
||||
}
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
[AdminCommand(AdminFlags.Moderator)]
|
||||
public sealed class CreateCustomCommand : IConsoleCommand
|
||||
{
|
||||
[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
|
||||
{
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
|
||||
@@ -109,6 +109,21 @@
|
||||
///</summary>
|
||||
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>
|
||||
/// Dangerous host permissions like scsi.
|
||||
/// </summary>
|
||||
|
||||
@@ -90,12 +90,12 @@
|
||||
|
||||
- Flags: ADMIN
|
||||
Commands:
|
||||
- delete
|
||||
- kick
|
||||
- listplayers
|
||||
- tp
|
||||
- tpto
|
||||
- respawn
|
||||
|
||||
- Flags: FUN
|
||||
Commands:
|
||||
- tippy
|
||||
- tip
|
||||
|
||||
@@ -111,6 +111,12 @@
|
||||
Commands:
|
||||
- spawn
|
||||
- cspawn
|
||||
- delete
|
||||
|
||||
- Flags: MODERATOR
|
||||
Commands:
|
||||
- kick
|
||||
- respawn
|
||||
|
||||
- Flags: HOST
|
||||
Commands:
|
||||
|
||||
Reference in New Issue
Block a user