Don't output huge packets

This commit is contained in:
roblabla 2015-02-24 23:44:59 +00:00
parent 9349774592
commit 25f2658895

View File

@ -64,7 +64,7 @@ srv.on('login', function (client) {
});
targetClient.on('packet', function(packet) {
if (packet.state == states.PLAY && client.state == states.PLAY) {
console.log(`client<-server: ${targetClient.state}.${packet.id} : ${JSON.stringify(packet)}`);
console.log(`client<-server: ${targetClient.state}.${packet.id} : ${packet.id != 38 ? JSON.stringify(packet) : "Packet too big"}`);
if (!endedClient)
client.write(packet.id, packet);
}