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
fbec6cee63
commit
3423cbc3b2
@ -168,33 +168,33 @@ export class NekoWebRTC extends EventEmitter<NekoWebRTCEvents> {
|
|||||||
buffer = new ArrayBuffer(7)
|
buffer = new ArrayBuffer(7)
|
||||||
payload = new DataView(buffer)
|
payload = new DataView(buffer)
|
||||||
payload.setUint8(0, OPCODE.MOVE)
|
payload.setUint8(0, OPCODE.MOVE)
|
||||||
payload.setUint16(1, 4, true)
|
payload.setUint16(1, 4)
|
||||||
payload.setUint16(3, data.x, true)
|
payload.setUint16(3, data.x)
|
||||||
payload.setUint16(5, data.y, true)
|
payload.setUint16(5, data.y)
|
||||||
break
|
break
|
||||||
case 'wheel':
|
case 'wheel':
|
||||||
buffer = new ArrayBuffer(7)
|
buffer = new ArrayBuffer(7)
|
||||||
payload = new DataView(buffer)
|
payload = new DataView(buffer)
|
||||||
payload.setUint8(0, OPCODE.SCROLL)
|
payload.setUint8(0, OPCODE.SCROLL)
|
||||||
payload.setUint16(1, 4, true)
|
payload.setUint16(1, 4)
|
||||||
payload.setInt16(3, data.x, true)
|
payload.setInt16(3, data.x)
|
||||||
payload.setInt16(5, data.y, true)
|
payload.setInt16(5, data.y)
|
||||||
break
|
break
|
||||||
case 'keydown':
|
case 'keydown':
|
||||||
case 'mousedown':
|
case 'mousedown':
|
||||||
buffer = new ArrayBuffer(11)
|
buffer = new ArrayBuffer(11)
|
||||||
payload = new DataView(buffer)
|
payload = new DataView(buffer)
|
||||||
payload.setUint8(0, OPCODE.KEY_DOWN)
|
payload.setUint8(0, OPCODE.KEY_DOWN)
|
||||||
payload.setUint16(1, 8, true)
|
payload.setUint16(1, 8)
|
||||||
payload.setBigUint64(3, BigInt(data.key), true)
|
payload.setBigUint64(3, BigInt(data.key))
|
||||||
break
|
break
|
||||||
case 'keyup':
|
case 'keyup':
|
||||||
case 'mouseup':
|
case 'mouseup':
|
||||||
buffer = new ArrayBuffer(11)
|
buffer = new ArrayBuffer(11)
|
||||||
payload = new DataView(buffer)
|
payload = new DataView(buffer)
|
||||||
payload.setUint8(0, OPCODE.KEY_UP)
|
payload.setUint8(0, OPCODE.KEY_UP)
|
||||||
payload.setUint16(1, 8, true)
|
payload.setUint16(1, 8)
|
||||||
payload.setBigUint64(3, BigInt(data.key), true)
|
payload.setBigUint64(3, BigInt(data.key))
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this._log.warn(`unknown data event: ${event}`)
|
this._log.warn(`unknown data event: ${event}`)
|
||||||
|
Loading…
Reference in New Issue
Block a user