This commit is contained in:
Drechsler, Meik
2025-08-14 16:20:42 +02:00
parent fb150ac204
commit 3a001d0e55
33 changed files with 2405 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
using System;
using System.Threading.Tasks;
using System.Collections.Concurrent;
namespace C4IT.API
{
/*
public delegate void ClientConnectionEventHandler(string clientId);
public delegate void ClientNameChangedEventHandler(string clientId, string newName);
public delegate void ClientGroupEventHandler(string clientId, string groupName);
public delegate void MessageReceivedEventHandler(string senderClientId, string message);
class CustomerPanelHub : Hub
{
static ConcurrentDictionary<string, string> _users = new ConcurrentDictionary<string, string>();
public static event ClientConnectionEventHandler ClientConnected;
public static event ClientConnectionEventHandler ClientDisconnected;
public static event ClientNameChangedEventHandler ClientNameChanged;
public static event ClientGroupEventHandler ClientJoinedToGroup;
public static event ClientGroupEventHandler ClientLeftGroup;
public static event MessageReceivedEventHandler MessageReceived;
public static void ClearState()
{
_users.Clear();
}
//Called when a client is connected
public override Task OnConnected()
{
_users.TryAdd(Context.ConnectionId, Context.ConnectionId);
ClientConnected?.Invoke(Context.ConnectionId);
return base.OnConnected();
}
//Called when a client is disconnected
public override Task OnDisconnected(bool stopCalled)
{
string userName;
_users.TryRemove(Context.ConnectionId, out userName);
ClientDisconnected?.Invoke(Context.ConnectionId);
return base.OnDisconnected(stopCalled);
}
}
*/
class CustomerPanelHub
{
}
}