mirror of
https://github.com/imezx/Warp.git
synced 2026-03-18 00:44:16 +00:00
chore(buffer): update buffer to u16 for id
This commit is contained in:
parent
5f5bb7938c
commit
4af26f4d41
1 changed files with 3 additions and 3 deletions
|
|
@ -1510,7 +1510,7 @@ local function writeEvents(w: Writer, events: { { any } }, schemas: { [number]:
|
||||||
for _, event in events do
|
for _, event in events do
|
||||||
local id = event[1]
|
local id = event[1]
|
||||||
local args = event[2]
|
local args = event[2]
|
||||||
wByte(w, id)
|
wU16(w, id)
|
||||||
local schema = schemas[id]
|
local schema = schemas[id]
|
||||||
if schema then
|
if schema then
|
||||||
packStrict(w, schema, args[1])
|
packStrict(w, schema, args[1])
|
||||||
|
|
@ -1525,8 +1525,8 @@ local function readEvents(buf: buffer, refs: { any }?, schemas: { [number]: Sche
|
||||||
count, pos = readVarUInt(buf, pos)
|
count, pos = readVarUInt(buf, pos)
|
||||||
local events = table.create(count)
|
local events = table.create(count)
|
||||||
for i = 1, count do
|
for i = 1, count do
|
||||||
local id: number = buffer.readu8(buf, pos)
|
local id: number = buffer.readu16(buf, pos)
|
||||||
pos += 1
|
pos += 2
|
||||||
local args: any
|
local args: any
|
||||||
local schema = schemas[id]
|
local schema = schemas[id]
|
||||||
if schema then
|
if schema then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue