- Code: Select all
public override bool AllowUserJoin(MyPlayer player) {
int maxplayers; //Default
//Parse roomdata
if (!int.TryParse(RoomData["maxplayers"], out maxplayers)) {
maxplayers = 4; //Default
}
//Check if there's room for this player.
if (Players.Count < maxplayers - 1) {
return true;
}
return false;
}
and i get a KeyNotFoundException Error for maxplayers with the following message:
The given key was not present in the dictionary.
PlayerIO Version is 2.2.2 and am connecting to the server using the NewGame file. Please Advise.