Демка с чатом работает
This commit is contained in:
1 parent
22cf8ede0a
commit
6d9607081c
11 files changed
+112
-15
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using Example.Events.Shared;
|
||||
using mROA.Implementation.Attributes;
|
||||
|
||||
namespace Example.Events.Backend;
|
||||
|
||||
[SharedObjectSingleton]
|
||||
public class ChatFactory : IChatFactory
|
||||
{
|
||||
private static readonly Dictionary<Guid, IChat> Chats = new();
|
||||
|
||||
public IChat GetChat(Guid id)
|
||||
{
|
||||
if (Chats.TryGetValue(id, out var chat))
|
||||
{
|
||||
return chat;
|
||||
}
|
||||
|
||||
var created = new Chat();
|
||||
Chats.Add(id, created);
|
||||
return created;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user