mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
switch WebRTC to BigEndian.
This commit is contained in:
parent
ed9f0276c7
commit
061fbe60cf
@ -47,7 +47,7 @@ func (manager *WebRTCManagerCtx) handle(msg webrtc.DataChannelMessage) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := binary.Read(bytes.NewBuffer(hbytes), binary.LittleEndian, header); err != nil {
|
if err := binary.Read(bytes.NewBuffer(hbytes), binary.BigEndian, header); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,14 +56,14 @@ func (manager *WebRTCManagerCtx) handle(msg webrtc.DataChannelMessage) error {
|
|||||||
switch header.Event {
|
switch header.Event {
|
||||||
case OP_MOVE:
|
case OP_MOVE:
|
||||||
payload := &PayloadMove{}
|
payload := &PayloadMove{}
|
||||||
if err := binary.Read(buffer, binary.LittleEndian, payload); err != nil {
|
if err := binary.Read(buffer, binary.BigEndian, payload); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.desktop.Move(int(payload.X), int(payload.Y))
|
manager.desktop.Move(int(payload.X), int(payload.Y))
|
||||||
case OP_SCROLL:
|
case OP_SCROLL:
|
||||||
payload := &PayloadScroll{}
|
payload := &PayloadScroll{}
|
||||||
if err := binary.Read(buffer, binary.LittleEndian, payload); err != nil {
|
if err := binary.Read(buffer, binary.BigEndian, payload); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ func (manager *WebRTCManagerCtx) handle(msg webrtc.DataChannelMessage) error {
|
|||||||
manager.desktop.Scroll(int(payload.X), int(payload.Y))
|
manager.desktop.Scroll(int(payload.X), int(payload.Y))
|
||||||
case OP_KEY_DOWN:
|
case OP_KEY_DOWN:
|
||||||
payload := &PayloadKey{}
|
payload := &PayloadKey{}
|
||||||
if err := binary.Read(buffer, binary.LittleEndian, payload); err != nil {
|
if err := binary.Read(buffer, binary.BigEndian, payload); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ func (manager *WebRTCManagerCtx) handle(msg webrtc.DataChannelMessage) error {
|
|||||||
}
|
}
|
||||||
case OP_KEY_UP:
|
case OP_KEY_UP:
|
||||||
payload := &PayloadKey{}
|
payload := &PayloadKey{}
|
||||||
err := binary.Read(buffer, binary.LittleEndian, payload)
|
err := binary.Read(buffer, binary.BigEndian, payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ func (webrtc_peer *WebRTCPeerCtx) SendCursorPosition(x, y int) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buffer := &bytes.Buffer{}
|
buffer := &bytes.Buffer{}
|
||||||
if err := binary.Write(buffer, binary.LittleEndian, data); err != nil {
|
if err := binary.Write(buffer, binary.BigEndian, data); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,11 +73,11 @@ func (webrtc_peer *WebRTCPeerCtx) SendCursorImage(cur *types.CursorImage) error
|
|||||||
|
|
||||||
buffer := &bytes.Buffer{}
|
buffer := &bytes.Buffer{}
|
||||||
|
|
||||||
if err := binary.Write(buffer, binary.LittleEndian, data); err != nil {
|
if err := binary.Write(buffer, binary.BigEndian, data); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := binary.Write(buffer, binary.LittleEndian, img); err != nil {
|
if err := binary.Write(buffer, binary.BigEndian, img); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user