Live data from Hacker News

Agar.io

agar.io

61–70 of 238 posts

Re: Agar.io

#61

XMLHttpRequest cannot load http://m.agar.io/?_=1430388662333 . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://agar.io' is therefore not allowed access. The response had HTTP status code 520.

Yep, I'm getting that too. I think it got a bit too popular and the servers caught on fire.

Confirmed. Got same issues.

Re: Agar.io

#62

While having a quick look at the sources, I learned about the quadtree: http://de.wikipedia.org/wiki/Quadtree . agar.io is using this implementation: https://github.com/silflow/quadtree-javascript to optimize collision detection performance.

Good find. Another nifty JS implementation of collision detection is https://jriecken.github.io/sat-js/ - I have used that one for tricky gaming and drag&drop behaviours.

Re: Agar.io

#64
post #60

XMLHttpRequest cannot load http://m.agar.io/?_=1430388662333 . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://agar.io' is therefore not allowed access. The response had HTTP status code 520.

I'm getting tons of these: WebSocket connection to 'ws://85.159.215.123:443/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET main_out.js:3 socket error

Latest stable chrome on ubuntu 14.04 and I am getting same error.

Re: Agar.io

#65
post #2

And we wonder why we don't have more women, girls and queer folk in technology. Just plain offensive. - edit To be clear, the ridiculous names people are using are offensive. Game was fun until the children showed up.

Did Tumblr leak on HN?

Re: Agar.io

#69
While looking at the js source code and modifying it a bit I was able to program keys W A S D to move my cell around. But it doesn't work after a bit. The protocol is send the position of the mouse (which corresponds to the cell) to the server and then it calculates change over time to get a velocity. So if I move too much it starts going forever in one direction. Although this is using a quad tree implementation for collision detection the actual detection seems to be done on the server side and not the client. There is no websocket message to tell the server if you collided with another cell or if you "ate" some of the material that makes the cell grow. This is actually my goal in "hacking" the game was to pop to different locations to get as big as possible.

Also like everyone else I get connection errors. It's actually quite interesting. It appears this game is load balanced between three or four servers. The script makes a request to " rel="nofollow">http://m.agar.io/?_= which returns the IP of a server used to initiate a websocket. It changes each time you refresh it.

Re: Agar.io

#70

XMLHttpRequest cannot load http://m.agar.io/?_=1430388662333 . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' http://agar.io' is therefore not allowed access. The response had HTTP status code 520.

This is a nasty thing that's mostly the applications fault but I feel the browser could be a little more smart about it too. The issue is that CORS headers are usually set at the application level, and applications often forget to set them when catching an error.

So if for instance your page makes a CORS request and the MySql server is away. Your app framework catches the error and renders the 500 message, but it doesn't automatically set the CORS.

Now your page receives a response that just gets flat out rejected, you can't even inspect it in the network tab.

The easiest solution is probably to set the CORS headers in NGINX.

Post reply on HN