News for hackers. Stuff that matters.
Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @11:44AM (#1764406)
Here's source http://github.com/jimmyrcom/websockets-RPG-map-thing

Gotta fix the flooding issues, there's still something that can make it crash too.

Re:Old school RPG style map in HTML5 canvas using websockets. by dan11 on Wednesday October 06, 2010 @11:51AM (#1764434)
Yeah, that's me.

var a = 1; function d() { $('#say').val(a); say(); a++; } setInterval("d();", 100);

Not exactly hard.

Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @11:55AM (#1764454)
It does have a flood filter, your thing just spams so it gets in the post every chance. I can only make the flood count longer. That's the problem with javascript, kinda hard to prevent people from screwing around and editing it in-place.
Re:Old school RPG style map in HTML5 canvas using websockets. by dan11 on Wednesday October 06, 2010 @11:59AM (#1764474)
I'm not 100% sure how WebSockets work, but I assume it's going through your server and then sent to everyone else? Could you not do a rate limit of 5 per 30 seconds, or require at least one comment in between yours? Not sure what the best approach would be best.
Re:Old school RPG style map in HTML5 canvas using websockets. by user24 on Friday October 08, 2010 @05:54AM (#1771115)
> That's the problem with javascript, kinda hard to prevent people from screwing around and editing it in-place.

Not if you use a module pattern with private methods.

But the real problem you should be addressing, and one which applies to any internet app, is people directly sending data to the server. Whether it's initiated by JS or flash or anything is not relevant - sure it's sometimes easier to hack about with JS apps, but if you fix people being about to open telnet and spoof the raw data, then you fix all those holes at the server, and that leaves you free to entirely change the way your code works in the future, instead of having to re-code misguided security fixes.

Re:Old school RPG style map in HTML5 canvas using websockets. by daralthus on Wednesday October 06, 2010 @01:42PM (#1764935)
Just kick of the flooders. Btw you could try node.js, then run the same game code on the server too, so there will be no cheating in the game when finished.
Re:Old school RPG style map in HTML5 canvas using websockets. by user24 on Friday October 08, 2010 @05:57AM (#1771121)
better:

javascript:var a=prompt('message to spam');setInterval(function(){$('#say').val(a); say();},100);

Re:Old school RPG style map in HTML5 canvas using websockets. by revoltingx on Wednesday October 06, 2010 @05:00PM (#1765830)
Should be fairly straightforward. Simply 'save' the last time this user has posted a message. Then the next time they attempt to post a message check if the alloted time has passed and process accordingly.

I see you are using dict, so just add a record with that info and you should be set.

Re:Old school RPG style map in HTML5 canvas using websockets. by JimmyRuska on Wednesday October 06, 2010 @07:24PM (#1766264)
I do do that. "LastMessage" var of the tuple in the dict. It's not enough if they make multiple windows all spamming in a loop. Some of the messages get through
Re:Old school RPG style map in HTML5 canvas using websockets. by revoltingx on Thursday October 07, 2010 @02:14AM (#1767007)
Ah ok, perhaps if you add microsecond information?