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

TypeError: value is out of bounds #180

Open
mbm3 opened this issue May 1, 2016 · 3 comments
Open

TypeError: value is out of bounds #180

mbm3 opened this issue May 1, 2016 · 3 comments

Comments

@mbm3
Copy link

mbm3 commented May 1, 2016

Keep getting this error only on OVH vps, when I run the SAME script on my pc it doesnt show this error.

buffer.js:705
throw TypeError('value is out of bounds');
^
TypeError: value is out of bounds
at TypeError (<anonymous>)
at checkInt (buffer.js:705:11)
at Buffer.writeInt32LE (buffer.js:782:5)
at Object.Client.moveTo (/root/Bot/node_modules/agario-client/agario-client.js:621:13)
at Object.kosBot.recalculateTarget (/root/Bot/server.js:211:25)
at null.<anonymous> (/root/Bot/server.js:118:25)
at wrapper [as _onTimeout] (timers.js:261:14)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

@pulviscriptor
Copy link
Owner

By looking at line 621 https://github.com/pulviscriptor/agario-client/blob/master/agario-client.js#L621
I can say that you do something like client.moveTo(999999999999999999999999,1)
There is chance that agar changed coordinates from UInt32 to something other, but i can't look up ATM.
Anybody else getting this crash in line 621?

@mbm3
Copy link
Author

mbm3 commented May 4, 2016

https://gyazo.com/ae1ff35d95aba01c0c4cf2195e754799
another friend of mine getting the same issue.

@pulviscriptor
Copy link
Owner

I tested my theory, i replaced line 119 https://github.com/pulviscriptor/agario-client/blob/master/examples/basic.js#L119 with

client.moveTo(9999999999999999, candidate_ball.y); 

And i got exact same crash in line 621.
You need to make sure that you calling client.moveTo() with coordinates higher or equal to 0 and lower than 2,147,483,647
Add check to your script like if(x < 0 || x > 2147483647 || y < 0 || y > 2147483647).
To make this protection inside agario-client i need multiple reports that this is common mistake for peoples.
Your report and your friend (who using your same script?) is first and only one.

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

2 participants