Multi Client Support - Needs Update Post Socket to support Multiple "Clients" not in a single Bus.
This commit is contained in:
25
RelayClient/ChatSimulator.cs
Normal file
25
RelayClient/ChatSimulator.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace RelayClient;
|
||||
|
||||
public static class ChatSimulator
|
||||
{
|
||||
public static event Action<ChatMessage>? MessageSent;
|
||||
|
||||
public static void Send(string senderUsername, string text)
|
||||
{
|
||||
var message = new ChatMessage
|
||||
{
|
||||
SenderUsername = senderUsername,
|
||||
Text = text,
|
||||
Timestamp = DateTime.Now
|
||||
};
|
||||
|
||||
MessageSent?.Invoke(message);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ChatMessage
|
||||
{
|
||||
public required string SenderUsername { get; set; }
|
||||
public required string Text { get; set; }
|
||||
public required DateTime Timestamp { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user