added other dsconnect settings

This commit is contained in:
2026-02-19 11:13:14 +01:00
parent 019c60689e
commit 09af99946e
13 changed files with 204 additions and 35 deletions
+13
View File
@@ -31,6 +31,7 @@ type Client struct {
OnClientLeft func(msg *protocol.ClientLeft)
OnRequestDevice func(targetClient, fromClient, busID, requestID string)
OnReleaseDevice func(busID, fromClient string)
OnForceRelease func(targetClient, fromClient, busID string)
OnTunnelData func(tunnelID string, data []byte)
ctx context.Context
@@ -255,6 +256,18 @@ func (c *Client) handleTextMessage(data []byte) {
}
}
case protocol.MsgForceRelease:
if c.OnForceRelease != nil {
var msg struct {
TargetClient string `json:"target_client"`
FromClient string `json:"from_client"`
BusID string `json:"bus_id"`
}
if json.Unmarshal(data, &msg) == nil {
c.OnForceRelease(msg.TargetClient, msg.FromClient, msg.BusID)
}
}
case protocol.MsgReleaseDevice:
if c.OnReleaseDevice != nil {
var msg struct {