xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.Administration.UI.Tabs.BabyJailTab"
Title="{Loc admin-ui-baby-jail-window-title}">
- <Label Name="MessageLabel" Access="Public" Text="{Loc admin-ui-baby-jail-is-enabled}" />
+ <RichTextLabel Name="MessageLabel" Access="Public" />
</controls:BabyJailStatusWindow>
-using Robust.Client.AutoGenerated;
+using Content.Client.Message;
+using Content.Client.UserInterface.Controls;
+using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
*/
[GenerateTypedNameReferences]
-public sealed partial class BabyJailStatusWindow : DefaultWindow
+public sealed partial class BabyJailStatusWindow : FancyWindow
{
public BabyJailStatusWindow()
{
RobustXamlLoader.Load(this);
+ MessageLabel.SetMarkup(Loc.GetString("admin-ui-baby-jail-is-enabled"));
}
}
<BoxContainer Orientation="Horizontal" Margin="2">
<Label Text="{Loc admin-ui-panic-bunker-min-account-age}" MinWidth="175" />
<LineEdit Name="MinAccountAge" MinWidth="50" Margin="0 0 5 0" />
- <Label Text="{Loc generic-hours}" />
+ <Label Text="{Loc generic-minutes}" />
</BoxContainer>
<BoxContainer Orientation="Horizontal" Margin="2">
- <Label Text="{Loc admin-ui-panic-bunker-min-overall-hours}" MinWidth="175" />
- <LineEdit Name="MinOverallHours" MinWidth="50" Margin="0 0 5 0" />
- <Label Text="{Loc generic-hours}" />
+ <Label Text="{Loc admin-ui-panic-bunker-min-overall-minutes}" MinWidth="175" />
+ <LineEdit Name="MinOverallMinutes" MinWidth="50" Margin="0 0 5 0" />
+ <Label Text="{Loc generic-minutes}" />
</BoxContainer>
</BoxContainer>
</BoxContainer>
[Dependency] private readonly IConsoleHost _console = default!;
private string _minAccountAge;
- private string _minOverallHours;
+ private string _minOverallMinutes;
public PanicBunkerTab()
{
MinAccountAge.OnFocusExit += args => SendMinAccountAge(args.Text);
_minAccountAge = MinAccountAge.Text;
- MinOverallHours.OnTextEntered += args => SendMinOverallHours(args.Text);
- MinOverallHours.OnFocusExit += args => SendMinOverallHours(args.Text);
- _minOverallHours = MinOverallHours.Text;
+ MinOverallMinutes.OnTextEntered += args => SendMinOverallMinutes(args.Text);
+ MinOverallMinutes.OnFocusExit += args => SendMinOverallMinutes(args.Text);
+ _minOverallMinutes = MinOverallMinutes.Text;
}
private void SendMinAccountAge(string text)
_console.ExecuteCommand($"panicbunker_min_account_age {minutes}");
}
- private void SendMinOverallHours(string text)
+ private void SendMinOverallMinutes(string text)
{
if (string.IsNullOrWhiteSpace(text) ||
- text == _minOverallHours ||
- !int.TryParse(text, out var hours))
+ text == _minOverallMinutes ||
+ !int.TryParse(text, out var minutes))
{
return;
}
- _console.ExecuteCommand($"panicbunker_min_overall_hours {hours}");
+ _console.ExecuteCommand($"panicbunker_min_overall_minutes {minutes}");
}
public void UpdateStatus(PanicBunkerStatus status)
CountDeadminnedButton.Pressed = status.CountDeadminnedAdmins;
ShowReasonButton.Pressed = status.ShowReason;
- MinAccountAge.Text = status.MinAccountAgeHours.ToString();
+ MinAccountAge.Text = status.MinAccountAgeMinutes.ToString();
_minAccountAge = MinAccountAge.Text;
- MinOverallHours.Text = status.MinOverallHours.ToString();
- _minOverallHours = MinOverallHours.Text;
+ MinOverallMinutes.Text = status.MinOverallMinutes.ToString();
+ _minOverallMinutes = MinOverallMinutes.Text;
}
}
if (args.Length == 0)
{
var current = _cfg.GetCVar(CCVars.PanicBunkerMinAccountAge);
- shell.WriteLine(Loc.GetString("panicbunker-command-min-account-age-is", ("hours", current / 60)));
+ shell.WriteLine(Loc.GetString("panicbunker-command-min-account-age-is", ("minutes", current)));
}
if (args.Length > 1)
return;
}
- if (!int.TryParse(args[0], out var hours))
+ if (!int.TryParse(args[0], out var minutes))
{
shell.WriteError(Loc.GetString("shell-argument-must-be-number"));
return;
}
- _cfg.SetCVar(CCVars.PanicBunkerMinAccountAge, hours * 60);
- shell.WriteLine(Loc.GetString("panicbunker-command-min-account-age-set", ("hours", hours)));
+ _cfg.SetCVar(CCVars.PanicBunkerMinAccountAge, minutes);
+ shell.WriteLine(Loc.GetString("panicbunker-command-min-account-age-set", ("minutes", minutes)));
}
}
[AdminCommand(AdminFlags.Server)]
-public sealed class PanicBunkerMinOverallHoursCommand : LocalizedCommands
+public sealed class PanicBunkerMinOverallMinutesCommand : LocalizedCommands
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
- public override string Command => "panicbunker_min_overall_hours";
+ public override string Command => "panicbunker_min_overall_minutes";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length == 0)
{
- var current = _cfg.GetCVar(CCVars.PanicBunkerMinOverallHours);
- shell.WriteLine(Loc.GetString("panicbunker-command-min-overall-hours-is", ("minutes", current)));
+ var current = _cfg.GetCVar(CCVars.PanicBunkerMinOverallMinutes);
+ shell.WriteLine(Loc.GetString("panicbunker-command-min-overall-minutes-is", ("minutes", current)));
}
if (args.Length > 1)
return;
}
- if (!int.TryParse(args[0], out var hours))
+ if (!int.TryParse(args[0], out var minutes))
{
shell.WriteError(Loc.GetString("shell-argument-must-be-number"));
return;
}
- _cfg.SetCVar(CCVars.PanicBunkerMinOverallHours, hours);
- shell.WriteLine(Loc.GetString("panicbunker-command-overall-hours-age-set", ("hours", hours)));
+ _cfg.SetCVar(CCVars.PanicBunkerMinOverallMinutes, minutes);
+ shell.WriteLine(Loc.GetString("panicbunker-command-overall-minutes-age-set", ("minutes", minutes)));
}
}
CCVars.PanicBunkerCountDeadminnedAdmins.Name,
CCVars.PanicBunkerShowReason.Name,
CCVars.PanicBunkerMinAccountAge.Name,
- CCVars.PanicBunkerMinOverallHours.Name,
+ CCVars.PanicBunkerMinOverallMinutes.Name,
CCVars.PanicBunkerCustomReason.Name,
];
Subs.CVar(_config, CCVars.PanicBunkerCountDeadminnedAdmins, OnPanicBunkerCountDeadminnedAdminsChanged, true);
Subs.CVar(_config, CCVars.PanicBunkerShowReason, OnPanicBunkerShowReasonChanged, true);
Subs.CVar(_config, CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true);
- Subs.CVar(_config, CCVars.PanicBunkerMinOverallHours, OnPanicBunkerMinOverallHoursChanged, true);
+ Subs.CVar(_config, CCVars.PanicBunkerMinOverallMinutes, OnPanicBunkerMinOverallMinutesChanged, true);
/*
* TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
private void OnPanicBunkerMinAccountAgeChanged(int minutes)
{
- PanicBunker.MinAccountAgeHours = minutes / 60;
+ PanicBunker.MinAccountAgeMinutes = minutes;
SendPanicBunkerStatusAll();
}
SendBabyJailStatusAll();
}
- private void OnPanicBunkerMinOverallHoursChanged(int hours)
+ private void OnPanicBunkerMinOverallMinutesChanged(int minutes)
{
- PanicBunker.MinOverallHours = hours;
+ PanicBunker.MinOverallMinutes = minutes;
SendPanicBunkerStatusAll();
}
("reason", Loc.GetString("panic-bunker-account-reason-account", ("minutes", minMinutesAge)))), null);
}
- var minOverallHours = _cfg.GetCVar(CCVars.PanicBunkerMinOverallHours);
+ var minOverallMinutes = _cfg.GetCVar(CCVars.PanicBunkerMinOverallMinutes);
var overallTime = ( await _db.GetPlayTimes(e.UserId)).Find(p => p.Tracker == PlayTimeTrackingShared.TrackerOverall);
- var haveMinOverallTime = overallTime != null && overallTime.TimeSpent.TotalHours > minOverallHours;
+ var haveMinOverallTime = overallTime != null && overallTime.TimeSpent.TotalMinutes > minOverallMinutes;
// Use the custom reason if it exists & they don't have the minimum time
if (customReason != string.Empty && !haveMinOverallTime && !bypassAllowed)
{
return (ConnectionDenyReason.Panic,
Loc.GetString("panic-bunker-account-denied-reason",
- ("reason", Loc.GetString("panic-bunker-account-reason-overall", ("hours", minOverallHours)))), null);
+ ("reason", Loc.GetString("panic-bunker-account-reason-overall", ("minutes", minOverallMinutes)))), null);
}
if (!validAccountAge || !haveMinOverallTime && !bypassAllowed)
public bool EnableWithoutAdmins;
public bool CountDeadminnedAdmins;
public bool ShowReason;
- public int MinAccountAgeHours;
- public int MinOverallHours;
+ public int MinAccountAgeMinutes;
+ public int MinOverallMinutes;
}
[Serializable, NetSerializable]
/// <summary>
/// Minimal overall played time.
/// </summary>
- public static readonly CVarDef<int> PanicBunkerMinOverallHours =
- CVarDef.Create("game.panic_bunker.min_overall_hours", 10, CVar.SERVERONLY);
+ public static readonly CVarDef<int> PanicBunkerMinOverallMinutes =
+ CVarDef.Create("game.panic_bunker.min_overall_minutes", 600, CVar.SERVERONLY);
/// <summary>
/// A custom message that will be used for connections denied to the panic bunker
panicbunker-command-show-reason-enabled = The panic bunker will now show a reason to users it blocks from connecting.
panicbunker-command-show-reason-disabled = The panic bunker will no longer show a reason to users it blocks from connecting.
-cmd-panicbunker_min_account_age-desc = Gets or sets the minimum account age in hours that an account must have to be allowed to connect with the panic bunker enabled.
-cmd-panicbunker_min_account_age-help = Usage: panicbunker_min_account_age <hours>
-panicbunker-command-min-account-age-is = The minimum account age for the panic bunker is {$hours} hours.
-panicbunker-command-min-account-age-set = Set the minimum account age for the panic bunker to {$hours} hours.
+cmd-panicbunker_min_account_age-desc = Gets or sets the minimum account age in minutes that an account must have to be allowed to connect with the panic bunker enabled.
+cmd-panicbunker_min_account_age-help = Usage: panicbunker_min_account_age <minutes>
+panicbunker-command-min-account-age-is = The minimum account age for the panic bunker is {$minutes} minutes.
+panicbunker-command-min-account-age-set = Set the minimum account age for the panic bunker to {$minutes} minutes.
-cmd-panicbunker_min_overall_hours-desc = Gets or sets the minimum overall playtime in hours that an account must have to be allowed to connect with the panic bunker enabled.
-cmd-panicbunker_min_overall_hours-help = Usage: panicbunker_min_overall_hours <hours>
-panicbunker-command-min-overall-hours-is = The minimum overall playtime for the panic bunker is {$hours} hours.
-panicbunker-command-min-overall-hours-set = Set the minimum overall playtime for the panic bunker to {$hours} hours.
+cmd-panicbunker_min_overall_minutes-desc = Gets or sets the minimum overall playtime in minutes that an account must have to be allowed to connect with the panic bunker enabled.
+cmd-panicbunker_min_overall_minutes-help = Usage: panicbunker_min_overall_minutes <minutes>
+panicbunker-command-min-overall-minutes-is = The minimum overall playtime for the panic bunker is {$minutes} minutes.
+panicbunker-command-min-overall-minutes-set = Set the minimum overall playtime for the panic bunker to {$minutes} minutes.
admin-ui-baby-jail-max-account-age = Max. Account Age
admin-ui-baby-jail-max-overall-minutes = Max. Overall Playtime
-admin-ui-baby-jail-is-enabled = The baby jail is currently enabled.
+admin-ui-baby-jail-is-enabled = [font size=20][bold]The baby jail is currently enabled.[/bold][/font]
admin-ui-baby-jail-enabled-admin-alert = The baby jail has been enabled.
admin-ui-baby-jail-disabled-admin-alert = The baby jail has been disabled.
admin-ui-panic-bunker-show-reason-tooltip = Show the user why they were blocked from connecting by the panic bunker.
admin-ui-panic-bunker-min-account-age = Min. Account Age
-admin-ui-panic-bunker-min-overall-hours = Min. Overall Playtime
+admin-ui-panic-bunker-min-overall-minutes = Min. Overall Playtime
admin-ui-panic-bunker-is-enabled = The panic bunker is currently enabled.
panic-bunker-account-denied = This server is in panic bunker mode, often enabled as a precaution against raids. New connections by accounts not meeting certain requirements are temporarily not accepted. Try again later
panic-bunker-account-denied-reason = This server is in panic bunker mode, often enabled as a precaution against raids. New connections by accounts not meeting certain requirements are temporarily not accepted. Try again later. Reason: "{$reason}"
panic-bunker-account-reason-account = Your Space Station 14 account is too new. It must be older than {$minutes} minutes
-panic-bunker-account-reason-overall = Your overall playtime on the server must be greater than {$hours} hours
+panic-bunker-account-reason-overall = Your overall playtime on the server must be greater than {$minutes} $minutes
baby-jail-account-denied = This server is a newbie server, intended for new players and those who want to help them. New connections by accounts that are too old or are not on a whitelist are not accepted. Check out some other servers and see everything Space Station 14 has to offer. Have fun!
baby-jail-account-denied-reason = This server is a newbie server, intended for new players and those who want to help them. New connections by accounts that are too old or are not on a whitelist are not accepted. Check out some other servers and see everything Space Station 14 has to offer. Have fun! Reason: "{$reason}"
baby-jail-account-reason-account = Your Space Station 14 account is too old. It must be younger than {$minutes} minutes
-baby-jail-account-reason-overall = Your overall playtime on the server must be younger than {$hours} hours
+baby-jail-account-reason-overall = Your overall playtime on the server must be younger than {$minutes} $minutes