Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: Jezithyr <jmaster9999@gmail.com> Co-authored-by: Jezithyr <Jezithyr@gmail.com> Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> Co-authored-by: wrexbe <wrexbe@protonmail.com> Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
#nullable enable
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Administration
|
|
{
|
|
public abstract class SharedBwoinkSystem : EntitySystem
|
|
{
|
|
// System users
|
|
public static NetUserId SystemUserId { get; } = new NetUserId(Guid.Empty);
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeNetworkEvent<BwoinkTextMessage>(OnBwoinkTextMessage);
|
|
}
|
|
|
|
protected virtual void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySessionEventArgs eventArgs)
|
|
{
|
|
// Specific side code in target.
|
|
}
|
|
|
|
protected void LogBwoink(BwoinkTextMessage message)
|
|
{
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class BwoinkTextMessage : EntityEventArgs
|
|
{
|
|
public DateTime SentAt { get; }
|
|
public NetUserId UserId { get; }
|
|
// This is ignored from the client.
|
|
// It's checked by the client when receiving a message from the server for bwoink noises.
|
|
// This could be a boolean "Incoming", but that would require making a second instance.
|
|
public NetUserId TrueSender { get; }
|
|
public string Text { get; }
|
|
|
|
public BwoinkTextMessage(NetUserId userId, NetUserId trueSender, string text, DateTime? sentAt = default)
|
|
{
|
|
SentAt = sentAt ?? DateTime.Now;
|
|
UserId = userId;
|
|
TrueSender = trueSender;
|
|
Text = text;
|
|
}
|
|
}
|
|
}
|
|
}
|