mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +00:00
fix: send touchpanel key to client when client joins direct server
This commit is contained in:
@@ -723,7 +723,7 @@ namespace PepperDash.Essentials.WebSocketServer
|
||||
|
||||
private UiClient BuildUiClient(string roomKey, JoinToken token, string key)
|
||||
{
|
||||
var c = new UiClient($"uiclient-{key}-{roomKey}-{token.Id}", token.Id, token.Token);
|
||||
var c = new UiClient($"uiclient-{key}-{roomKey}-{token.Id}", token.Id, token.Token, token.TouchpanelKey);
|
||||
this.LogInformation("Constructing UiClient with key {key} and ID {id}", key, token.Id);
|
||||
c.Controller = _parent;
|
||||
c.RoomKey = roomKey;
|
||||
|
||||
@@ -31,6 +31,11 @@ namespace PepperDash.Essentials.WebSocketServer
|
||||
/// </summary>
|
||||
public string Token { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Touchpanel Key associated with this client
|
||||
/// </summary>
|
||||
public string TouchpanelKey { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mobile control system controller that handles this client's messages
|
||||
/// </summary>
|
||||
@@ -75,11 +80,13 @@ namespace PepperDash.Essentials.WebSocketServer
|
||||
/// <param name="key">The unique key to identify this client</param>
|
||||
/// <param name="id">The client ID used by the client for this connection</param>
|
||||
/// <param name="token">The token associated with this client</param>
|
||||
public UiClient(string key, string id, string token)
|
||||
/// <param name="touchpanelKey">The touchpanel key associated with this client</param>
|
||||
public UiClient(string key, string id, string token, string touchpanelKey = "")
|
||||
{
|
||||
Key = key;
|
||||
Id = id;
|
||||
Token = token;
|
||||
TouchpanelKey = touchpanelKey;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -105,6 +112,7 @@ namespace PepperDash.Essentials.WebSocketServer
|
||||
{
|
||||
clientId = Id,
|
||||
roomKey = RoomKey,
|
||||
touchpanelKey = string.IsNullOrEmpty(TouchpanelKey) ? TouchpanelKey : string.Empty,
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user