Multiplayer "Flood Limit Exceeded"

Discussion and feedback on Construct 2

Post » Mon May 12, 2014 5:57 pm

Hey, hows it going!
So I was curious about how this works, it's affected me in two areas. Once in-game with another player, this isn't a problem at all :P but when it comes to retrieving data about other games, I will eventually come to a "Flood Limit Exceeded" error, which (I think) disconnects from the signalling server and prevents me from reconnecting to it unless I refresh the game. Now, I'm totally understanding if I was sending constant requests every tick to the signalling server, but I'm not doing that, I space out the requests (Maybe I don't space them enough?) I also don't expect to be using all the resources on the signalling server, I do understand that it's shared and primarily used to route people to eachother, but is there a way I can solve these situations I am facing?

- I make a request to the signalling server every 5 seconds to get the Game instances, so that I can tally up how many players are online. after a certain amount of time, maybe in a few minutes, I get a "flood limit exceeded"

- I make a requests to detect the next empty room every 3 seconds when connecting to a game. Say there's Room1, Room2, Room3, and you attempt to connect, you will become host of Room4, and then if Room1/2/3 become empty, then you will end up stuck in Room4 until a bunch of players take up the previous rooms. So every 3 seconds, it will detect what room is the next empty one, so if you were in room 4, you will go to room 1 if it is empty.

Thank you! :)
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Mon May 12, 2014 7:30 pm

I would bet the flood limit is how scirra protects its server from tons of requests (or when someone rights faulty code) so they don't crash the server. I handle all my rooms by having the game send an ajax request to my server to get a room thats available. a few mysql tables handle this easily.

If the player is the first to connect the server doesnt send him the room name yet.. the server just sees that hes ready to join a room when another player connects so he is queued as next in line... all he sees a waiting for player message... once another player has opened the game the server sees it has two players waiting and sends them both room name.

If you have access to a server and understand ajax this would be the cleanest way to do it
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Mon May 12, 2014 8:26 pm

@troublesum
I could totally handle it that way, but I don't have access to a server :(
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Mon May 12, 2014 10:31 pm

Why do you need every 5 seconds. Calls like what your using should be made either on required or spaced out to a minute or more. Signalling servers and such aren't really built to be queried every few seconds.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Mon May 12, 2014 10:41 pm

Well, every 5 seconds to update the counter, and every 3 seconds to recheck for empty rooms. The 5 seconds could be increased for sure, but the empty room checking is a bit more complicated. If a player was in Room10 and had to wait 1 minute til it checks if Room1 is now avaliable, then that player would prob get frustrated at waiting.
I guess I'm just wondering what the limitations are, because it works fine, but only to a degree.
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Tue May 13, 2014 12:19 pm

There is a flood limit on the server to prevent malicious or accidental denial of service for other users caused by consuming disproportionate amounts of bandwidth or CPU on the server by flooding it with requests. To trigger the flood limit you have to make in the order of hundreds of requests within seconds, so it seems most likely that in fact there is a mistake in your events. The flood limit is deliberately designed to catch and prevent that. It is impossible to comment further without seeing your events.
Scirra Founder
B
403
S
238
G
89
Posts: 24,654
Reputation: 196,155

Post » Tue May 13, 2014 3:46 pm

@Ashley
Ah that's useful information, thank you! I think my events regarding the signalling server were tidy, but admittedly the events for peer/host were a bit demanding. I'll check out my events. :)
B
51
S
20
G
10
Posts: 571
Reputation: 9,819


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests