* 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
57 lines
1.6 KiB
C#
57 lines
1.6 KiB
C#
#nullable enable
|
|
using System;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.GameObjects.Components.Command
|
|
{
|
|
public class SharedCommunicationsConsoleComponent : Component
|
|
{
|
|
public override string Name => "CommunicationsConsole";
|
|
}
|
|
|
|
[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 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
|
|
{
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public class CommunicationsConsoleRecallEmergencyShuttleMessage : BoundUserInterfaceMessage
|
|
{
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum CommunicationsConsoleUiKey
|
|
{
|
|
Key
|
|
}
|
|
}
|