I added gameType as a variable in the createroom function and also added it on the admin panel under "Search Settings"
The problem is, if gameType is a number, it's returned as null in the listRooms function. For example:
- Code: Select all
_client.multiplayer.createJoinRoom(
null,
_serverType,
true,
{name:name, gameType:1},
{},
handleJoin,
_handleJoinError
)
If you later want a list of all existing games with gameType 1, you would use:
- Code: Select all
_client.multiplayer.listRooms(_serverType, {gameType:1}, 50, 0, function(rooms:Array){
trace("roomslist:"+rooms);
}, function(e:PlayerIOError){
trace("Unable to list rooms", e)
})
But it will return an empty list, because gameType was stored as null instead of 1. I know this because it says it's null when I ask for the complete list (so without stating a search variable).
However, if you use gameType:"1" (so a string) in both functions, it all works fine. So in other words, numbers don't work.