on client i call this:
- Code: Select all
multiplayer.joinRoom() // player tries to join a room
// which has this callback function upon success
handleJoin(c:Connection)
on server
- Code: Select all
public override bool AllowUserJoin(Player player)
{
if (PlayerCount +1 > 2) //can only have a maximum of 2 players, after that they are denied to join
{
Console.WriteLine("AllowUserJoin returned false ->room is full");
return false;
}
return true;
}
I try to join the room with 3 clients, this is the trace I get from the dev server:
- Code: Select all
=====[ Room Started: ]===========
>User Guest-3509 (1): Joined game
>User Guest-877 (2): Joined game
>User Guest-674 (3): Joined game
AllowUserJoin returned false ->room is full
>User Guest-674 (3): Left game
- In my understanding I should not get "User Guest-674 (3): Joined game" as he didn't join, but was denied?
This also results in the bigger problem of handleJoin being called? So the client thinks he has joined the room, and produces dialogs etc, where as in the server he was actually denied..