Forum Multiplayer Numbers in RoomData

Discussion and help relating to the PlayerIO Multiplayer API.

Numbers in RoomData

Postby Fravic » July 20th, 2010, 4:15 pm

Hello! It seems that when I try to pass variables from AS3 as roomData using createJoinRoom(), all variables of type int or Number turn up as "null" server-side. The keys for number-type variables are present in the RoomData dictionary, but their values aren't. Only String-type variables transfer correctly. Is this a known issue, or am I doing something incorrectly?

Code: Select all
_activeClient.multiplayer.createJoinRoom(
                "testRoom123",
                "ServerType",
                true,
                {string:"This string is accessible server-side", number:5},   //'5' is not passed
                joinData,
                handleRoomJoin,
                handleRoomJoinError
            );


Code: Select all
Console.WriteLine("This is a string: " + RoomData["string"]);
Console.WriteLine("This is 'null': " + RoomData["number"]);
Fravic
 
Posts: 6
Joined: April 13th, 2010, 4:37 am

Re: Numbers in RoomData

Postby Benjaminsen » July 29th, 2010, 5:14 pm

RoomData only support strings. It should auto serialize numbers for you, but apparently it does not. I will look into this.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Numbers in RoomData

Postby Benjaminsen » July 30th, 2010, 11:37 am

This bug is now fixed, pending release. It will likely get released today or tomorrow.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Numbers in RoomData

Postby Fravic » July 30th, 2010, 8:48 pm

Great - thanks for your support and for a great API!
Fravic
 
Posts: 6
Joined: April 13th, 2010, 4:37 am


Return to Multiplayer