Forum Multiplayer multiplayer.createRoom

Discussion and help relating to the PlayerIO Multiplayer API.

multiplayer.createRoom

Postby Fravic » April 15th, 2010, 5:17 am

Hello!

I'm having some trouble using multiplayer.createRoom. The documentation notes the "callback" argument as follows:
callback:Function (Default = null)
Method executed when the createRoom call executed successfully: function(connection:Connection):void{...}

However, it seems that my callback function is receiving the room ID instead of a connection reference. I then have no way to access the connection.

Here is my code:
Code: Select all
client.multiplayer.createRoom(
            "test",
            "bounce",
            true,
            {numUsers:numUsers},
            handleRoomCreate,
            handleRoomCreateError               
         );

...

//Throws a type error - cannot convert "test" to playerio.Connection.
protected function handleRoomCreate(connection:Connection):void   

Thanks for your help!
Fravic
 
Posts: 6
Joined: April 13th, 2010, 4:37 am

Re: multiplayer.createRoom

Postby Benjaminsen » April 16th, 2010, 8:56 am

Hi Fravic

It's a bug in the documentation, createRoom creates a room but never actually joins it. You are looking for createJoinRoom which does both.

I have updated the documentation so it is fixed in the next client release.

/Chris
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to Multiplayer