mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
Pushing for review
This commit is contained in:
@ -39,10 +39,6 @@ type PayloadKey struct {
|
||||
}
|
||||
|
||||
func (manager *WebRTCManager) handle(id string, msg webrtc.DataChannelMessage) error {
|
||||
if (!manager.config.ImplicitControl && !manager.sessions.IsHost(id)) || (manager.config.ImplicitControl && !manager.sessions.CanControl(id)) {
|
||||
return nil
|
||||
}
|
||||
|
||||
buffer := bytes.NewBuffer(msg.Data)
|
||||
header := &PayloadHeader{}
|
||||
hbytes := make([]byte, 3)
|
||||
@ -55,6 +51,12 @@ func (manager *WebRTCManager) handle(id string, msg webrtc.DataChannelMessage) e
|
||||
return err
|
||||
}
|
||||
|
||||
isClickEvent = header.Event == OP_KEY_CLK
|
||||
// Confirm we can can continue
|
||||
if (!manager.sessions.CanControl(id, isClickEvent)) {
|
||||
return nil
|
||||
}
|
||||
|
||||
buffer = bytes.NewBuffer(msg.Data)
|
||||
|
||||
switch header.Event {
|
||||
|
Reference in New Issue
Block a user