Forum Multiplayer AllowUserJoin permits joining when it shouldn't

Discussion and help relating to the Player.IO Multiplayer API

AllowUserJoin permits joining when it shouldn't

Postby trueicecold » December 14th, 2011, 11:56 pm

I have this server code:

Code: Select all
        public override bool AllowUserJoin(Player player) {
            if (PlayerCount+1 > 2) {
                player.Send(Message.Create("SearchRoomFull"));
                return false;
            }
            return true;
        }


I try this with one client (same user joining over and over at a click of a button).
When I click on this button very very fast, I sometimes get a room with 3 users, although this shouldn't happen...

Adding a:
Code: Select all
       Console.WriteLine("PlayerCount: " + PlayerCount);

reveals I get "PlayerCount: 0" multiple times.

Has anyone encountered this issue?

Thanks!
trueicecold
 
Posts: 11
Joined: October 10th, 2011, 1:53 pm

Re: AllowUserJoin permits joining when it shouldn't

Postby Oliver » December 16th, 2011, 1:07 pm

Hello,

Are you doing this on the development server or the live server?

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1136
Joined: January 12th, 2010, 8:29 am

Re: AllowUserJoin permits joining when it shouldn't

Postby trueicecold » December 16th, 2011, 2:30 pm

Hey Oliver,

I encountered this issue on both.
trueicecold
 
Posts: 11
Joined: October 10th, 2011, 1:53 pm


Return to Multiplayer