added other dsconnect settings
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user