Yet-another Multiplayer Demo

Show us your completed creations made in Construct 2

Post » Tue Dec 11, 2012 4:02 pm

Ok, i'll take a look at the bottleneck_lobby plugin.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Wed Dec 12, 2012 11:36 am

One more question about "lobby" plugin:

there's a condition "forEachAvailableGameRoom", which cycles through all opened rooms. Is there any way to cycle through all the rooms, even those which are not available?

Something like "forEachGameRoom" and then a condition if "GameRoom" available -> do something, else do something else.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Wed Dec 12, 2012 11:55 am

@xoros

You could store "previous" available room, then compare to "current" available to get the unavailable room. Official dictionary object might be suitable in this case.


I thought designer only want to display available room in most of case, sorry for the inconvenience.


Edit:
I might add this feature in my TODO list.rexrainbow2012-12-12 12:01:09
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Wed Dec 12, 2012 12:47 pm

No problem, man - the plugin is still very cool.

In my project the "room joining" process should happen automatically. The user just inputs his name and presses start button. Than he is automatically trasfered to the next available room. If room member limit is reached (in my case it's 2-4 players), the room is automatically closed and the game starts.

But I think I've found the way how to do this without storing anything in hash-tables, just by combing "Lobby" plug for iterating through available rooms with "Bottleneck" for joining the available room.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Fri Dec 14, 2012 11:07 am

So I managed to implement rooms auto-joining without storing any data. But one thing is not clear to me - it is onUserLeft event:

I'm testing with several browsers opened, so if I close a window in one browser there's certain delay (ca. 1-2 Minutes) until onUserLeft in the BottleNeck plugin fires. Is it possible to change this delay to zero or some very small value? or is it "socket.io" specific value? Or may be this delay is due to all the users comming from the same IP?

The same thing is with KickUser: when this method is called onUserLeft does not respond.

xoros2012-12-14 11:31:51
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Fri Dec 14, 2012 2:18 pm

@xoros

Uh, yes. My server has "left delay" problem indeed. (But only on my server. The demo of socket.io is no delay when user left.)
I had checked this problem before, but fail. I'm not sure why, sorry. I might check it again later.
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Fri Dec 14, 2012 2:29 pm

OK, I'will look into the problem.

Found this:
http://stackoverflow.com/questions/6280569/socket-io-xhr-polling-delay-on-disconnectionxoros2012-12-14 14:31:42
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Fri Dec 14, 2012 2:40 pm

@xoros

Thanks a lot.
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Fri Dec 14, 2012 2:44 pm

i got this error:"Unable to load
B
3
S
1
Posts: 24
Reputation: 1,232

Post » Fri Dec 14, 2012 2:51 pm

I changed this in you server.js file:

io.set("transports", ["flashsocket"])

and there's no delay, but it works only in firefox :(
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 4 guests