Fixed user data request/response definitions
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
be9b84de81
commit
0b19b83271
|
@ -57,6 +57,7 @@ export function unpackUserDataRequestMessage (data: Uint8Array): UserDataRequest
|
||||||
|
|
||||||
const usernameLength = packedData.readUInt16()
|
const usernameLength = packedData.readUInt16()
|
||||||
const username = packedData.readBytes(usernameLength)
|
const username = packedData.readBytes(usernameLength)
|
||||||
|
packedData.cursor = 34
|
||||||
const colour = packedData.readBytes(3)
|
const colour = packedData.readBytes(3)
|
||||||
const clientIdLength = packedData.readUInt16()
|
const clientIdLength = packedData.readUInt16()
|
||||||
const clientId = packedData.readBytes(clientIdLength)
|
const clientId = packedData.readBytes(clientIdLength)
|
||||||
|
|
|
@ -56,6 +56,7 @@ export function unpackUserDataResponseMessage (data: Uint8Array): UserDataRespon
|
||||||
|
|
||||||
const usernameLength = packedData.readUInt16()
|
const usernameLength = packedData.readUInt16()
|
||||||
const username = packedData.readBytes(usernameLength)
|
const username = packedData.readBytes(usernameLength)
|
||||||
|
packedData.cursor = 34
|
||||||
const colour = packedData.readBytes(3)
|
const colour = packedData.readBytes(3)
|
||||||
const clientIdLength = packedData.readUInt16()
|
const clientIdLength = packedData.readUInt16()
|
||||||
const clientId = packedData.readBytes(clientIdLength)
|
const clientId = packedData.readBytes(clientIdLength)
|
||||||
|
|
|
@ -31,7 +31,13 @@ test('Create a user data request (0x0002) packet.', () => {
|
||||||
|
|
||||||
test('Parse a user data request (0x0002).', () => {
|
test('Parse a user data request (0x0002).', () => {
|
||||||
// Given
|
// Given
|
||||||
const data = new Uint8Array([0, 12, 66, 117, 116, 108, 101, 114, 115, 97, 117, 114, 117, 115, 255, 64, 0, 0, 7, 77, 101, 114, 99, 117, 114, 121])
|
const data = new Uint8Array([
|
||||||
|
0, 12,
|
||||||
|
66, 117, 116, 108, 101, 114, 115, 97, 117, 114, 117, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
255, 64, 0,
|
||||||
|
0, 7,
|
||||||
|
77, 101, 114, 99, 117, 114, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
])
|
||||||
const username = 'Butlersaurus'
|
const username = 'Butlersaurus'
|
||||||
const colour = Color('#FF4000')
|
const colour = Color('#FF4000')
|
||||||
const clientId = 'Mercury'
|
const clientId = 'Mercury'
|
||||||
|
|
|
@ -31,7 +31,13 @@ test('Create a user data response (0x0003) packet.', () => {
|
||||||
|
|
||||||
test('Parse a user data response (0x0003).', () => {
|
test('Parse a user data response (0x0003).', () => {
|
||||||
// Given
|
// Given
|
||||||
const data = new Uint8Array([0, 12, 66, 117, 116, 108, 101, 114, 115, 97, 117, 114, 117, 115, 255, 64, 0, 0, 7, 77, 101, 114, 99, 117, 114, 121])
|
const data = new Uint8Array([
|
||||||
|
0, 12,
|
||||||
|
66, 117, 116, 108, 101, 114, 115, 97, 117, 114, 117, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
255, 64, 0,
|
||||||
|
0, 7,
|
||||||
|
77, 101, 114, 99, 117, 114, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
])
|
||||||
const username = 'Butlersaurus'
|
const username = 'Butlersaurus'
|
||||||
const colour = Color('#FF4000')
|
const colour = Color('#FF4000')
|
||||||
const clientId = 'Mercury'
|
const clientId = 'Mercury'
|
||||||
|
|
Loading…
Reference in New Issue