-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.ts
21 lines (13 loc) · 3.74 KB
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { readClientboundPacket, writeServerboundPacket } from './mod'
const notInPartyPacket = Buffer.from('01010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'hex')
const inPartyPacket = Buffer.from('01010175150d1c99b743dc9f2ea05d58e687f80282a7f70ec44a4cdbba496a827cbc57d675150d1c99b743dc9f2ea05d58e687f8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'hex')
const pingPacket = Buffer.from('010104706f6e67000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'hex')
const lobbyLocationPacket = Buffer.from('0101000f6368692d68702d62756e67656538350f64796e616d69636c6f626279313644010742454457415253010d626564776172736c6f626279320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'hex')
const bedwarsLocationPacket = Buffer.from('0101000f6368692d68702d62756e6765653835086d696e6937394347010742454457415253000111424544574152535f45494748545f54574f01054e65627563000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'hex')
const playerInfoPacket = Buffer.from('01010102010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'hex')
console.log(readClientboundPacket('party_info', notInPartyPacket))
console.log(readClientboundPacket('party_info', inPartyPacket))
console.log(readClientboundPacket('ping', pingPacket))
console.log(readClientboundPacket('location', lobbyLocationPacket))
console.log(readClientboundPacket('location', bedwarsLocationPacket))
console.log(readClientboundPacket('player_info', playerInfoPacket))