перенос файлов сервера из папки White в _White
This commit is contained in:
35
Content.Server/_White/Commands/AntispamCommand.cs
Normal file
35
Content.Server/_White/Commands/AntispamCommand.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.White;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server._White.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public sealed class AntispamCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "setantispam";
|
||||
public string Description => "Переключает антиспам систему.";
|
||||
public string Help => "setantispam <bool>";
|
||||
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1 || !bool.TryParse(args[0], out var value))
|
||||
{
|
||||
shell.WriteError($"{args[0]} is not a valid boolean.");
|
||||
return;
|
||||
}
|
||||
|
||||
_cfg.SetCVar(WhiteCVars.ChatAntispam, value);
|
||||
|
||||
var toggle = value ? "включил" : "выключил";
|
||||
var announce = $"{shell.Player?.Name} {toggle} антиспам систему";
|
||||
|
||||
IoCManager.Resolve<IChatManager>().DispatchServerAnnouncement(announce, Color.Red);
|
||||
}
|
||||
}
|
||||
33
Content.Server/_White/Commands/InvisibilityCommand.cs
Normal file
33
Content.Server/_White/Commands/InvisibilityCommand.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server._White.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.White.Administration;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server._White.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public sealed class InvisibilityCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "invisibility";
|
||||
public string Description => "Переключает режим невидимости.";
|
||||
public string Help => "invisibility";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (shell.Player == null)
|
||||
shell.WriteLine("You can only toggle invisibility on a client.");
|
||||
|
||||
var entityManager = IoCManager.Resolve<EntityManager>();
|
||||
var uid = shell.Player?.AttachedEntity;
|
||||
if (uid == null
|
||||
|| !entityManager.TryGetComponent<InvisibilityComponent>(uid, out var invisibilityComponent))
|
||||
return;
|
||||
|
||||
entityManager.System<InvisibilitySystem>().ToggleInvisibility(uid.Value, invisibilityComponent);
|
||||
|
||||
shell.WriteLine(invisibilityComponent.Invisible
|
||||
? "Теперь вы в режиме невидимости"
|
||||
: "Теперь вы не в режиме невидимости");
|
||||
}
|
||||
}
|
||||
43
Content.Server/_White/Commands/NoticeCommand.cs
Normal file
43
Content.Server/_White/Commands/NoticeCommand.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Chat;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Enums;
|
||||
|
||||
namespace Content.Server._White.Commands;
|
||||
|
||||
[AnyCommand]
|
||||
internal sealed class NoticeCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "notice";
|
||||
public string Description => "Send a chat message to self.";
|
||||
public string Help => "notice <text>";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (shell.Player is not { } player)
|
||||
{
|
||||
shell.WriteError("This command cannot be run from the server.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.Status != SessionStatus.InGame)
|
||||
return;
|
||||
|
||||
if (player.AttachedEntity is not { } playerEntity)
|
||||
{
|
||||
//shell.WriteError("You don't have an entity!"); By HitPanda: Breaks test
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length < 1)
|
||||
return;
|
||||
|
||||
var message = string.Join(" ", args).Trim();
|
||||
if (string.IsNullOrEmpty(message))
|
||||
return;
|
||||
|
||||
IoCManager.Resolve<IChatManager>().ChatMessageToOne(ChatChannel.Emotes, message, message, EntityUid.Invalid, false, player.ConnectedClient, recordReplay: false);
|
||||
}
|
||||
}
|
||||
49
Content.Server/_White/Commands/PoshelnahuiCommand.cs
Normal file
49
Content.Server/_White/Commands/PoshelnahuiCommand.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server._White.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public sealed class PoshelnahuiCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "poshelnahui";
|
||||
public string Description => "Close client game lol";
|
||||
public string Help => "poshelnahui <ckey>";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1 || string.IsNullOrEmpty(args[0]))
|
||||
{
|
||||
shell.WriteLine("Wrong number of arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
var playerManager = IoCManager.Resolve<IPlayerManager>();
|
||||
var players = playerManager.Sessions.ToList();
|
||||
|
||||
var player = players.Find(x => x.Name == args[0]);
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
shell.WriteLine("Player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var consoleHost = IoCManager.Resolve<IConsoleHost>();
|
||||
consoleHost.RemoteExecuteCommand(player, "hardquit");
|
||||
shell.WriteLine("Message sent");
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args) {
|
||||
if (args.Length == 1)
|
||||
{
|
||||
var playerMgr = IoCManager.Resolve<IPlayerManager>();
|
||||
var options = playerMgr.Sessions.Select(c => c.Name).OrderBy(c => c).ToArray();
|
||||
return CompletionResult.FromHintOptions(options, "ckey");
|
||||
}
|
||||
|
||||
return CompletionResult.Empty;
|
||||
}
|
||||
}
|
||||
23
Content.Server/_White/Commands/SetRandomMapCommand.cs
Normal file
23
Content.Server/_White/Commands/SetRandomMapCommand.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server._White.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Round)]
|
||||
sealed class SetRanomMapCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
|
||||
public string Command => "setrandommap";
|
||||
public string Description => "Устанавливает случайную карту из пула и включает ротацию карт";
|
||||
public string Help => "setrandommap";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
_configurationManager.SetCVar(CCVars.GameMap, string.Empty);
|
||||
shell.WriteLine("Включена ротация карт.");
|
||||
}
|
||||
}
|
||||
35
Content.Server/_White/Commands/StealthCommand.cs
Normal file
35
Content.Server/_White/Commands/StealthCommand.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server._White.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
public sealed class StealthCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "stealth";
|
||||
public string Description => "Переключает стелс режим.";
|
||||
public string Help => "stealth";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (shell.Player is not {} player)
|
||||
{
|
||||
shell.WriteLine("You cannot use this command from the server console.");
|
||||
return;
|
||||
}
|
||||
|
||||
var mgr = IoCManager.Resolve<IAdminManager>();
|
||||
var data = mgr.GetAdminData(player)!;
|
||||
DebugTools.AssertNotNull(data);
|
||||
|
||||
data.Stealth = !data.Stealth;
|
||||
|
||||
shell.WriteLine(data.Stealth
|
||||
? "Теперь вы в режиме стелс"
|
||||
: "Теперь вы не в режиме стелс");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user