Forum C# AllowUserJoin

AllowUserJoin

Postby Deathline » March 29th, 2017, 8:53 pm

Hey PIO Devs and Com,

I've an Question. When i use the override function AllowUserJoin().
If i return it with false did the Player get an Disconnect or so.?

I have tested it today and then if i return it with false i dont get any question and any disconnect, error etc.

Would be nice if anyone can help me.
Thanks in advance.
Deathline
 
Posts: 14
Joined: August 14th, 2011, 11:27 am

Re: AllowUserJoin

Postby Henrik » March 30th, 2017, 11:24 am

If you signal false in AllowUserJoin for a player, the following should happen in his client:

1) CreateJoinRoom succeeds, and you will get a valid connection.
2) Any messages you send to the player inside AllowUserJoin will be received on the connection.
2) The connection will receive a message of type "groupdisallowedjoin".
3) The connection will be closed, and the Disconnect event handler fires.

However, I realize now that this suffers from the same timing issues you pointed out before about not receiving messages sent in Userjoined.

In our testing, if you setup your message handlers and disconnect handlers as the very first thing in the success callback to CreateJoinRoom, it always works, but it might be possible to make this more robust so that you won't miss any messages as long as you setup handlers inside the CreateJoinRoom success callback, regardless of how long it takes you to execute that method.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to C#



cron