This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
forked from new-frontiers-14/frontier-station-14
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a78497
commit ac96d07
Showing
12 changed files
with
172 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Content.Server/Corvax/Administration/Commands/PanicBunkerCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Content.Server.Administration; | ||
using Content.Shared.Administration; | ||
using Content.Shared.Corvax.CCCVars; | ||
using Robust.Shared.Configuration; | ||
using Robust.Shared.Console; | ||
|
||
namespace Content.Server.Corvax.Administration.Commands; | ||
|
||
[AdminCommand(AdminFlags.Server)] | ||
public sealed class PanicBunkerDenyVpnCommand : LocalizedCommands | ||
{ | ||
[Dependency] private readonly IConfigurationManager _cfg = default!; | ||
|
||
public override string Command => "panicbunker_deny_vpn"; | ||
|
||
public override void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
if (args.Length != 1) | ||
{ | ||
shell.WriteError(Loc.GetString("shell-need-exactly-one-argument")); | ||
return; | ||
} | ||
|
||
if (!bool.TryParse(args[0], out var deny)) | ||
{ | ||
shell.WriteError(Loc.GetString("shell-argument-must-be-boolean")); | ||
return; | ||
} | ||
|
||
_cfg.SetCVar(CCCVars.PanicBunkerDenyVPN, deny); | ||
shell.WriteLine(Loc.GetString(deny ? "panicbunker-command-deny-vpn-enabled" : "panicbunker-command-deny-vpn-disabled")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Robust.Shared.Configuration; | ||
|
||
namespace Content.Shared.Corvax.CCCVars; | ||
|
||
/// <summary> | ||
/// Corvax modules console variables | ||
/// </summary> | ||
[CVarDefs] | ||
// ReSharper disable once InconsistentNaming | ||
public sealed class CCCVars | ||
{ | ||
/// <summary> | ||
/// Deny any VPN connections. | ||
/// </summary> | ||
public static readonly CVarDef<bool> PanicBunkerDenyVPN = | ||
CVarDef.Create("game.panic_bunker.deny_vpn", false, CVar.SERVERONLY); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
Resources/Locale/ru-RU/corvax/administration/commands/panicbunker.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
cmd-panicbunker_deny_vpn-desc = Включает или отключает запрет доступа через VPN-соединения. | ||
cmd-panicbunker_deny_vpn-help = Использование: panicbunker_min_overall_hours <bool> | ||
panicbunker-command-deny-vpn-enabled = Бункер теперь будет блокировать подключения через VPN. | ||
panicbunker-command-deny-vpn-disabled = Бункер больше не будет блокировать подключения через VPN. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters