You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get packet error messages while the packets are processed perfectly correct. But the try catch block will also try and catch user-defined event listeners exceptions.
How to reproduce this?
Here is some code:
varAgarioClient=require('agario-client');//Use next line in your scriptsvarclient=newAgarioClient('worker');//create new client and call it "worker" (not nickname)client.on('connected',function(){client.spawn("test")});client.on("ballAction",function(){this.does.not.exist;//!!!});client.on("packetError",function(a,b,preventCrash){console.log("packet error");preventCrash();})AgarioClient.servers.getFFAServer({region: "EU-London"},function(srv){client.connect('ws://'+srv.server,srv.key);//do not forget to add ws://});
The user-defined event listener functions gets executed when u .emit() an event, maybe do a try catch on that!? Or something else.
(spend hours debugging why my code wouldnt work and why it isnt showing errors XD)
The text was updated successfully, but these errors were encountered:
It is an issue, all packet processors have emitters in them and if emitter crashes then processor gets this error.
Correct way to fix it is to make processors process packets without emitting events, but this needs major changes in client's architecture.
I think moving emitters inside process.nextTick will work.
Anybody have better ideas?
@issy123
To make that as i said i need to re-write processors to process only binary data and return processed packet. And if processor crashes while processing, then detect error. But its slow, hard, and i don't have free time, so i can't do that.
I need some easy solution like process.nextTick.
I get packet error messages while the packets are processed perfectly correct. But the try catch block will also try and catch user-defined event listeners exceptions.
How to reproduce this?
Here is some code:
The user-defined event listener functions gets executed when u .emit() an event, maybe do a try catch on that!? Or something else.
(spend hours debugging why my code wouldnt work and why it isnt showing errors XD)
The text was updated successfully, but these errors were encountered: