2021-10-06 16:25:27 +01:00
|
|
|
|
#nullable enable
|
|
|
|
|
|
using Content.Shared.Administration;
|
|
|
|
|
|
using JetBrains.Annotations;
|
2021-12-22 13:34:09 +01:00
|
|
|
|
using Robust.Shared.Network;
|
2021-10-06 16:25:27 +01:00
|
|
|
|
|
2022-07-21 17:30:00 -05:00
|
|
|
|
namespace Content.Client.Administration.Systems
|
2021-10-06 16:25:27 +01:00
|
|
|
|
{
|
|
|
|
|
|
[UsedImplicitly]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class BwoinkSystem : SharedBwoinkSystem
|
2021-10-06 16:25:27 +01:00
|
|
|
|
{
|
2022-10-12 01:16:23 -07:00
|
|
|
|
public event EventHandler<BwoinkTextMessage>? OnBwoinkTextMessageRecieved;
|
2022-09-14 20:42:35 -07:00
|
|
|
|
|
2021-10-06 16:25:27 +01:00
|
|
|
|
protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySessionEventArgs eventArgs)
|
|
|
|
|
|
{
|
2022-10-12 01:16:23 -07:00
|
|
|
|
OnBwoinkTextMessageRecieved?.Invoke(this, message);
|
2021-10-06 16:25:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Send(NetUserId channelId, string text)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Reuse the channel ID as the 'true sender'.
|
|
|
|
|
|
// Server will ignore this and if someone makes it not ignore this (which is bad, allows impersonation!!!), that will help.
|
|
|
|
|
|
RaiseNetworkEvent(new BwoinkTextMessage(channelId, channelId, text));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|