Comms Console Announcements (#3629)

* Communications console announcements

* title case for jobs

* Helper

* Prevent abuse

* Cap message length

* more abuse prevention

* Validate clientside too to reduce bandwidth from unmodified clients
This commit is contained in:
ike709
2021-03-13 23:21:57 -06:00
committed by GitHub
parent 31d74d5909
commit 899a5cfa80
4 changed files with 87 additions and 3 deletions

View File

@@ -13,18 +13,31 @@ namespace Content.Shared.GameObjects.Components.Command
[Serializable, NetSerializable]
public class CommunicationsConsoleInterfaceState : BoundUserInterfaceState
{
public readonly bool CanAnnounce;
public readonly bool CanCall;
public readonly TimeSpan? ExpectedCountdownEnd;
public readonly bool CountdownStarted;
public CommunicationsConsoleInterfaceState(bool canCall, TimeSpan? expectedCountdownEnd = null)
public CommunicationsConsoleInterfaceState(bool canAnnounce, bool canCall, TimeSpan? expectedCountdownEnd = null)
{
CanAnnounce = canAnnounce;
CanCall = canCall;
ExpectedCountdownEnd = expectedCountdownEnd;
CountdownStarted = expectedCountdownEnd != null;
}
}
[Serializable, NetSerializable]
public class CommunicationsConsoleAnnounceMessage : BoundUserInterfaceMessage
{
public readonly string Message;
public CommunicationsConsoleAnnounceMessage(string message)
{
Message = message;
}
}
[Serializable, NetSerializable]
public class CommunicationsConsoleCallEmergencyShuttleMessage : BoundUserInterfaceMessage
{