From 33aaf3198c106c4daac77d6ab0776ff11832b310 Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Mon, 21 Oct 2024 17:42:34 -0400 Subject: [PATCH] Panic bunker print strings (#2300) --- Content.Server/Connection/ConnectionManager.cs | 16 ++++++++++++++-- .../Locale/en-US/_NF/connection-messages.ftl | 10 ++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Resources/Locale/en-US/_NF/connection-messages.ftl diff --git a/Content.Server/Connection/ConnectionManager.cs b/Content.Server/Connection/ConnectionManager.cs index 8585b6925d8..3dd2d2ae5ec 100644 --- a/Content.Server/Connection/ConnectionManager.cs +++ b/Content.Server/Connection/ConnectionManager.cs @@ -249,9 +249,21 @@ session.Status is SessionStatus.Connected or SessionStatus.InGame if (showReason && !haveMinOverallTime && !bypassAllowed) { + // Frontier: panic bunker message, print minutes/hours depending on how much time left. + double minutesNeeded = minOverallMinutes - (overallTime?.TimeSpent.TotalMinutes ?? 0.0); + string reason; + if (minutesNeeded > 60) + { + reason = Loc.GetString("panic-bunker-account-reason-nf-overall-hours", ("hours", $"{minOverallMinutes / 60.0:F1}"), ("timeLeft", $"{minutesNeeded / 60.0:F1}")); + } + else + { + reason = Loc.GetString("panic-bunker-account-reason-nf-overall-minutes", ("hours", $"{minOverallMinutes / 60.0:F1}"), ("timeLeft", $"{minutesNeeded:F0}")); + } return (ConnectionDenyReason.Panic, - Loc.GetString("panic-bunker-account-denied-reason", - ("reason", Loc.GetString("panic-bunker-account-reason-overall", ("minutes", minOverallMinutes)))), null); + Loc.GetString("panic-bunker-account-denied-reason-nf", + ("reason", reason)), null); + // End Frontier } if (!validAccountAge || !haveMinOverallTime && !bypassAllowed) diff --git a/Resources/Locale/en-US/_NF/connection-messages.ftl b/Resources/Locale/en-US/_NF/connection-messages.ftl new file mode 100644 index 00000000000..cb27946ff4a --- /dev/null +++ b/Resources/Locale/en-US/_NF/connection-messages.ftl @@ -0,0 +1,10 @@ +panic-bunker-account-denied-reason-nf = + 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-nf-overall-hours = + Your overall playtime on the server must be greater than {$hours} hours. + You need {$timeLeft} more hours to meet this requirement. +panic-bunker-account-reason-nf-overall-minutes = + Your overall playtime on the server must be greater than {$hours} hours. + You need {$timeLeft} more minutes to meet this requirement.