mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
Admin log now shows who called or recalled evac (#41557)
* admin log now shows who called or recalled evac * ops * named parameters * show in player search * ops, forgot 2 * when did this happen?
This commit is contained in:
@@ -16,13 +16,13 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
// ReSharper disable once ConvertIfStatementToSwitchStatement
|
||||
if (args.Length == 1 && TimeSpan.TryParseExact(args[0], ContentLocalizationManager.TimeSpanMinutesFormats, LocalizationManager.DefaultCulture, out var timeSpan))
|
||||
_roundEndSystem.RequestRoundEnd(timeSpan, shell.Player?.AttachedEntity, false);
|
||||
_roundEndSystem.RequestRoundEnd(timeSpan, shell.Player?.AttachedEntity, checkCooldown: false);
|
||||
|
||||
else if (args.Length == 1)
|
||||
shell.WriteLine(Loc.GetString("shell-timespan-minutes-must-be-correct"));
|
||||
|
||||
else
|
||||
_roundEndSystem.RequestRoundEnd(shell.Player?.AttachedEntity, false);
|
||||
_roundEndSystem.RequestRoundEnd(shell.Player?.AttachedEntity, checkCooldown: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ namespace Content.Server.Communications
|
||||
return;
|
||||
}
|
||||
|
||||
_roundEndSystem.RequestRoundEnd(uid);
|
||||
_roundEndSystem.RequestRoundEnd(mob, uid);
|
||||
_adminLogger.Add(LogType.Action, LogImpact.High, $"{ToPrettyString(mob):player} has called the shuttle.");
|
||||
}
|
||||
|
||||
@@ -321,13 +321,15 @@ namespace Content.Server.Communications
|
||||
if (!CanCallOrRecall(comp))
|
||||
return;
|
||||
|
||||
if (!CanUse(message.Actor, uid))
|
||||
var mob = message.Actor;
|
||||
|
||||
if (!CanUse(mob, uid))
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Actor);
|
||||
return;
|
||||
}
|
||||
|
||||
_roundEndSystem.CancelRoundEndCountdown(uid);
|
||||
_roundEndSystem.CancelRoundEndCountdown(mob, uid);
|
||||
_adminLogger.Add(LogType.Action, LogImpact.High, $"{ToPrettyString(message.Actor):player} has recalled the shuttle.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public sealed class XenoborgsRuleSystem : GameRuleSystem<XenoborgsRuleComponent>
|
||||
{
|
||||
_chatSystem.DispatchStationAnnouncement(station, Loc.GetString("xenoborg-shuttle-call"), colorOverride: Color.BlueViolet);
|
||||
}
|
||||
_roundEnd.RequestRoundEnd(null, false, cantRecall: true);
|
||||
_roundEnd.RequestRoundEnd(null, null, false, cantRecall: true);
|
||||
xenoborgsRuleComponent.XenoborgShuttleCalled = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
|
||||
{
|
||||
_chat.DispatchStationAnnouncement(station, Loc.GetString("zombie-shuttle-call"), colorOverride: Color.Crimson);
|
||||
}
|
||||
_roundEnd.RequestRoundEnd(null, false);
|
||||
_roundEnd.RequestRoundEnd(checkCooldown: false);
|
||||
}
|
||||
|
||||
// we include dead for this count because we don't want to end the round
|
||||
|
||||
@@ -134,12 +134,13 @@ namespace Content.Server.RoundEnd
|
||||
/// <summary>
|
||||
/// Starts the process of ending the round by calling evac
|
||||
/// </summary>
|
||||
/// <param name="requester"></param>
|
||||
/// <param name="requester">who called evac</param>
|
||||
/// <param name="machine">machine used to call evac</param>
|
||||
/// <param name="checkCooldown"></param>
|
||||
/// <param name="text">text in the announcement of shuttle calling</param>
|
||||
/// <param name="name">name in the announcement of shuttle calling</param>
|
||||
/// <param name="cantRecall">if the station shouldn't be able to recall the shuttle</param>
|
||||
public void RequestRoundEnd(EntityUid? requester = null, bool checkCooldown = true, string text = "round-end-system-shuttle-called-announcement", string name = "round-end-system-shuttle-sender-announcement", bool cantRecall = false)
|
||||
public void RequestRoundEnd(EntityUid? requester = null, EntityUid? machine = null, bool checkCooldown = true, string text = "round-end-system-shuttle-called-announcement", string name = "round-end-system-shuttle-sender-announcement", bool cantRecall = false)
|
||||
{
|
||||
var duration = DefaultCountdownDuration;
|
||||
|
||||
@@ -154,19 +155,20 @@ namespace Content.Server.RoundEnd
|
||||
}
|
||||
}
|
||||
|
||||
RequestRoundEnd(duration, requester, checkCooldown, text, name, cantRecall);
|
||||
RequestRoundEnd(duration, requester, machine, checkCooldown, text, name, cantRecall);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the process of ending the round by calling evac
|
||||
/// </summary>
|
||||
/// <param name="countdownTime">time for evac to arrive</param>
|
||||
/// <param name="requester"></param>
|
||||
/// <param name="requester">who called evac</param>
|
||||
/// <param name="machine">machine used to call evac</param>
|
||||
/// <param name="checkCooldown"></param>
|
||||
/// <param name="text">text in the announcement of shuttle calling</param>
|
||||
/// <param name="name">name in the announcement of shuttle calling</param>
|
||||
/// <param name="cantRecall">if the station shouldn't be able to recall the shuttle</param>
|
||||
public void RequestRoundEnd(TimeSpan countdownTime, EntityUid? requester = null, bool checkCooldown = true, string text = "round-end-system-shuttle-called-announcement", string name = "round-end-system-shuttle-sender-announcement", bool cantRecall = false)
|
||||
public void RequestRoundEnd(TimeSpan countdownTime, EntityUid? requester = null, EntityUid? machine = null, bool checkCooldown = true, string text = "round-end-system-shuttle-called-announcement", string name = "round-end-system-shuttle-sender-announcement", bool cantRecall = false)
|
||||
{
|
||||
if (_gameTicker.RunLevel != GameRunLevel.InRound)
|
||||
return;
|
||||
@@ -180,14 +182,11 @@ namespace Content.Server.RoundEnd
|
||||
_countdownTokenSource = new();
|
||||
CantRecall = cantRecall;
|
||||
|
||||
var what = machine != null ? $" with {ToPrettyString(machine.Value):entity} " : "";
|
||||
if (requester != null)
|
||||
{
|
||||
_adminLogger.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called by {ToPrettyString(requester.Value):user}");
|
||||
}
|
||||
_adminLogger.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called by {ToPrettyString(requester.Value):player}{what}");
|
||||
else
|
||||
{
|
||||
_adminLogger.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called");
|
||||
}
|
||||
_adminLogger.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called{what}");
|
||||
|
||||
// I originally had these set up here but somehow time gets passed as 0 to Loc so IDEK.
|
||||
int time;
|
||||
@@ -239,7 +238,7 @@ namespace Content.Server.RoundEnd
|
||||
}
|
||||
}
|
||||
|
||||
public void CancelRoundEndCountdown(EntityUid? requester = null, bool forceRecall = false)
|
||||
public void CancelRoundEndCountdown(EntityUid? requester = null, EntityUid? machine = null, bool forceRecall = false)
|
||||
{
|
||||
if (_gameTicker.RunLevel != GameRunLevel.InRound)
|
||||
return;
|
||||
@@ -253,14 +252,11 @@ namespace Content.Server.RoundEnd
|
||||
_countdownTokenSource.Cancel();
|
||||
_countdownTokenSource = null;
|
||||
|
||||
var what = machine != null ? $" with {ToPrettyString(machine.Value):entity} " : "";
|
||||
if (requester != null)
|
||||
{
|
||||
_adminLogger.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled by {ToPrettyString(requester.Value):user}");
|
||||
}
|
||||
_adminLogger.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled by {ToPrettyString(requester.Value):player}{what}");
|
||||
else
|
||||
{
|
||||
_adminLogger.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled");
|
||||
}
|
||||
_adminLogger.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled{what}");
|
||||
|
||||
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString("round-end-system-shuttle-recalled-announcement"),
|
||||
Loc.GetString("round-end-system-shuttle-sender-announcement"), false, colorOverride: Color.Gold);
|
||||
@@ -350,8 +346,8 @@ namespace Content.Server.RoundEnd
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestRoundEnd(time, null, false, textCall,
|
||||
Loc.GetString(sender));
|
||||
RequestRoundEnd(time, checkCooldown: false, text: textCall,
|
||||
name: Loc.GetString(sender));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -387,7 +383,7 @@ namespace Content.Server.RoundEnd
|
||||
{
|
||||
if (!_shuttle.EmergencyShuttleArrived && ExpectedCountdownEnd is null)
|
||||
{
|
||||
RequestRoundEnd(null, false, "round-end-system-shuttle-auto-called-announcement");
|
||||
RequestRoundEnd(checkCooldown: false, text: "round-end-system-shuttle-auto-called-announcement");
|
||||
_autoCalledBefore = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user