Joining new multiplayer room returns blank name?

Discussion and feedback on Construct 2

Post » Sat Jul 05, 2014 2:46 pm

Does @Ashley or anonye else know why joining a room after "on room left" is not working? Do I need to wait longer? Or something else I am missing?
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Sun Jul 06, 2014 1:02 pm

Why would you want to do that anyway? Presumably the room was left for a reason, such as the player deliberately quit, the server kicked you off, or the connection dropped. For any of those reasons you wouldn't want to re-join immediately, and you could risk setting up a wasteful infinite loop of join-leave-join-leave...
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

Post » Sun Jul 06, 2014 2:18 pm

Thank you for visiting my topic @Ashley :)
I used the "Leave Room" action in a single triggered MouseClick event so it should not create a loop?

What happens:
First all Players are joining a "lobby" (will be used to find players later and to see how many players are online). But when someone wants to host or join a multiplayer game he clicks on Multiplayer and selects a level. Then the lobby should be left and a new game room joined. So all game data is only synced between the two players in the game room and not between all players in the lobby.

Is there something wrong with my code (example above) or are there some restirctions on how to leave/join rooms I don't know about?
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Mon Jul 07, 2014 2:44 am

You need to try to look at my tutorial. It takes some work to get this to work properly - that's why I keep pushing you that way. There is no good reason those plugins shouldn't work. Also, the C2 install option is perfectly viable.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Mon Jul 07, 2014 11:23 am

I tried some other plugins and they are working fine. Are your plugins from part1 too old for r174 and not compatible anymore??
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Mon Jul 07, 2014 2:04 pm

Those aren't my plugins, they are rexrainbow's. The links are current. Did you copy the whole directory over to the right place?
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Mon Jul 07, 2014 2:37 pm

I put both folders into Exporters > HTML 5 > Plugins where the others are. Don't know why these two are not working and show an error message on startup. :(
clay.io plugin and rex_date are working fine and I assume its from the same rexrainbow.
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Mon Jul 07, 2014 3:22 pm

Here's the Client with the plugins removed. The game obviously won't work, but the lobby stuff is all there.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Mon Jul 07, 2014 4:13 pm

Thank you very much!
I looked through your code and some parts were confusing for me (leaving room after a left room triggers) but I will try to figure it out and read all of it again.

After seeing your code with the groups I was curious and just tried to add a System>Wait action and it seems this fixes the whole thing, too! :shock:
In the "On signalling left room" part I just added System>Wait 2 Sek (seems 1 works too) and then I execute the new Join Room command and it finally worked. So it seems you just need a small extra pause after the "Left room" trigger before you can join a new room. But this almost seems like a bug for me since the trigger should only run when you completely left the room, right @Ashley? :roll:
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Mon Jul 07, 2014 4:23 pm

I reviewed the code, and it looked like you could not in fact join another room in 'On signalling left room'. I've fixed that for the next build. The workaround should be simple, just wait for a brief moment (0.1 seconds should do it).
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests