mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 21:52:17 -04:00
Don't output huge packets
This commit is contained in:
parent
9349774592
commit
25f2658895
@ -47,7 +47,7 @@ srv.on('login', function (client) {
|
|||||||
endedClient = true;
|
endedClient = true;
|
||||||
console.log('Connection error by client', '('+addr+')');
|
console.log('Connection error by client', '('+addr+')');
|
||||||
if (!endedTargetClient)
|
if (!endedTargetClient)
|
||||||
targetClient.end("Error");
|
targetClient.end("Error");
|
||||||
});
|
});
|
||||||
var targetClient = mc.createClient({
|
var targetClient = mc.createClient({
|
||||||
host: host,
|
host: host,
|
||||||
@ -64,7 +64,7 @@ srv.on('login', function (client) {
|
|||||||
});
|
});
|
||||||
targetClient.on('packet', function(packet) {
|
targetClient.on('packet', function(packet) {
|
||||||
if (packet.state == states.PLAY && client.state == states.PLAY) {
|
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)
|
if (!endedClient)
|
||||||
client.write(packet.id, packet);
|
client.write(packet.id, packet);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user