mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-12 19:24:53 +00:00
fix: direct server clients now have unique client IDs
Using the generated security token as an ID was presenting problems with duplicate connections using the same ID and trying to figure out where to send the messages. Now, the clients have a unique ID that's an increasing integer that restarts at 1 when the program restarts.
This commit is contained in:
@@ -93,7 +93,7 @@ namespace PepperDash.Essentials.WebApiHandlers
|
||||
|
||||
|
||||
|
||||
if (!server.UiClients.TryGetValue(request.Token, out UiClientContext clientContext))
|
||||
if (!server.UiClientContexts.TryGetValue(request.Token, out UiClientContext clientContext))
|
||||
{
|
||||
var response = new ClientResponse
|
||||
{
|
||||
@@ -134,7 +134,7 @@ namespace PepperDash.Essentials.WebApiHandlers
|
||||
return;
|
||||
}
|
||||
|
||||
server.UiClients.Remove(request.Token);
|
||||
server.UiClientContexts.Remove(request.Token);
|
||||
|
||||
server.UpdateSecret();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user