Page 1 of 1

Protecting against packet spamming

Posted: 26 Dec 2013, 12:57
by AlexLangan
Hello, i'm really new to this and i have been stumbling on this huge problem. I have a simple multiplayer game running on a java extension with a AS client. Some people are spamming random packets with WPE Pro. I've managed to catch some of them and they look like this

"<msg t='sys'><body action='setUvars' r='38129'><user id='859215' /><vars><var n='temporaryCostume' t='s'><![CDATA[{"tags":"","startItem":0,"categoryId":"2045","rental":0,"itemId":"27198","playerItemId":0,"swf":"","is_buyable":0,"version":2,"category":"Lacra v1","trade_limit":"1","price":0,"playerId":156569745,"description":"","parentCategoryId":"2","name":"Pink RetrosTOAH","customData":{},"filename":"PinkShades","is_rentable":0,"can_consume":"0","metaData":""}]]></var></vars></body></msg>"

I've looked around google and i saw that this kind of method was used to crash the facebook game Yoville. I was wondering, is there a way to stop this kinds of spams or hacks or what ever they are called?

Re: Protecting against packet spamming

Posted: 27 Dec 2013, 10:58
by Lapo
There are several ways. The most important one is server-side validation. You can add in your code checks that will make sure that data is valid and consistent and also see if the frequency of messages is too high.

In the SmartFoxServer 2X documentation section we have a detailed article on security. Even though it talks about specific features of SFS2X there are many useful tips that can be used on SFS PRO too. I'd recommend taking a look here: http://docs2x.smartfoxserver.com/Overview/white-papers
(see the third whitepaper)

Cheers