Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: index out of range (Please answer me fast thanks :) #87

Closed
DarkSaTla opened this issue Feb 12, 2016 · 4 comments
Closed

RangeError: index out of range (Please answer me fast thanks :) #87

DarkSaTla opened this issue Feb 12, 2016 · 4 comments

Comments

@DarkSaTla
Copy link

hey when i started my bots in 10 - 20 min i get crashed...
C:\Users\agario\node_modules\agario-client\agario-client.js:166
throw err;
^
RangeError: index out of range
at checkOffset (buffer.js:506:11)
at Buffer.readUInt8 (buffer.js:544:5)
at Object.Packet.readUInt8 (C:\Users\agario\node_modules\agario-client\packe
t.js:25:29)
at Client.processors.16 (C:\Users\agario\node_modules\agario-client\agario-c
lient.js:256:38)
at Object.Client.onMessage (C:\Users\agario\node_modules\agario-client\agari
o-client.js:148:13)
at WebSocket.onMessage (C:\Users\agario\node_modules\agario-client\node_modu
les\ws\lib\WebSocket.js:418:14)
at WebSocket.emit (events.js:110:17)
at Receiver.onbinary (C:\Users\agario\node_modules\agario-client\node_module
s\ws\lib\WebSocket.js:823:10)
at C:\Users\agario\node_modules\agario-client\node_modules\ws\lib\Receiver.j
s:537:18
at Receiver.applyExtensions (C:\Users\agario\node_modules\agario-client\node
_modules\ws\lib\Receiver.js:364:5)

how i can fix it please answer me..

@pulviscriptor
Copy link
Owner

Check #46 (comment)

@davidmann4
Copy link

@davidmann4
Copy link

ahh I've to add

bot.on('packetError', function(packet, err, preventCrash) {
   bot.log('Packet error detected for packet: ' + packet.toString());
   bot.log('Crash will be prevented, bot will be disconnected');
   preventCrash();
   bot.disconnect();
});`

@davidmann4
Copy link

works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants