mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 14:13:45 -04:00
improve error in sizeOf of serializer.js, fix remaining numerical id in createClient
This commit is contained in:
parent
3b272159fd
commit
188848b364
@ -92,7 +92,7 @@ function createClient(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onKeepAlive(packet) {
|
function onKeepAlive(packet) {
|
||||||
client.write(0x00, {
|
client.write('keep_alive', {
|
||||||
keepAliveId: packet.keepAliveId
|
keepAliveId: packet.keepAliveId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,9 @@ function createPacketBuffer(packetId, state, params, isServer) {
|
|||||||
length += proto.sizeOf(params[fieldInfo.name], fieldInfo.type, params);
|
length += proto.sizeOf(params[fieldInfo.name], fieldInfo.type, params);
|
||||||
}, (e) => {
|
}, (e) => {
|
||||||
addErrorField(e, fieldInfo.name);
|
addErrorField(e, fieldInfo.name);
|
||||||
e.message = "sizeOf error for " + packetName + "." + e.field + " : " + e.message;
|
e.message = "sizeOf error for "+[state,direction,packetName,e.field].join(".")+"\n"+
|
||||||
|
" in packet 0x" + packetId.toString(16)+" "+JSON.stringify(params)+"\n"
|
||||||
|
+ e.message;
|
||||||
throw e;
|
throw e;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user