problem on "onMapLoaded" extension

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

alfaodin
Posts: 11
Joined: 09 Aug 2010, 13:57

problem on "onMapLoaded" extension

Postby alfaodin » 05 Sep 2011, 13:11

Hi, well thi is my problem, we made an extension to create rooms dinamically, I need to receive the name of the map when the "onMapLoaded" event is launched, but the params of this event are null. I made a test and printed in a console the room params, there is data in the server, but when it returns to the client, the params are all null. Please help me, how can I get the room name in the client?
Regards.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 06 Sep 2011, 06:30

As you are creating a room, you should listen to the related event (see the SFS API doc). The event tells you the room name and, through the room variables, the map name too.
Paolo Bax
The SmartFoxServer Team
alfaodin
Posts: 11
Joined: 09 Aug 2010, 13:57

EVENT MAP_UPDATED

Postby alfaodin » 21 Sep 2011, 15:42

Hi, Sorry for replying so late, but the real problem is that the event: public static MAP_UPDATED:String = "mapUpdated"
(read) has two params : the password and room . :(*) the room name or id passed to the IOpenSpaceAPI.loadMap method when the current map was loaded.
When this event is dropped, the room value is equal to undefined, why is it null? What do I have to do in order to get the name of the room? Thank you.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 22 Sep 2011, 17:22

Not sure what you are doing wrong, but we just tested it and it works as expected. Are you sure you wrote the variables names correctly?

Code: Select all

private function onMapUpdated(evt:OpenSpaceEvent):void
{
   trace("OpenSpace.MAP_UPDATED event received")
   trace(evt.params.room)
   trace(evt.params.password)
}
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 25 guests