Associate static map to Dynamic Room

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

Moderators: Lapo, Bax

giri_darius
Posts: 13
Joined: 15 Jun 2011, 11:41
Location: Mumbai, India

Associate static map to Dynamic Room

Postby giri_darius » 18 Jul 2011, 06:33

hi
I have following room in my config.xml

<Room name="Race1" maxUsers="2" isGame ="false" isPrivate="false" isTemp="false" uCountUpdate="false">
<Vars>
<Var name="_os_mapId" type="s" private="false">maps/AllRaceGround#Race1</Var>
</Vars>
</Room>

After maxUsers limit reached i'm creating Dynamic room (Race1_1,Race1_2,3,4 and so on) at server side
I want to apply same map of room Race1(maps/AllRaceGround#Race1) to the Race1_1(dynamic room).

Right Now I'm getting an Error
[ERROR] OpenSpace Extension is unable to load the map: No map associated with Room 'Race1_1' [31] (0090)
OpenSpace.MAP_ERROR event received:

How I'm supposed to do that.

Im using Openspace 2.0 and smartFox server 1.6.9
Girish Patil
Flash Developer
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 18 Jul 2011, 07:56

You have to create the _os_mapId Room Variable, which associates the map with the Room.
Paolo Bax
The SmartFoxServer Team
giri_darius
Posts: 13
Joined: 15 Jun 2011, 11:41
Location: Mumbai, India

Postby giri_darius » 18 Jul 2011, 09:35

Hi bax,

Thanks for the reply..
I have added the room Variable. and it worked for dynamic room
But still one issue..

Code: Select all

function makeNewRoom(rName, maxU, owner)
{
   var rObj    = {}
   rObj.name = rName
   rObj.pwd    = ""
   rObj.maxU   = maxU
   rObj.maxS    = 0
   rObj.isGame   = false   
   var varObj = []   
   varObj.push({name:"_os_mapId",val:"maps/AllRaceGround#Race1",priv:false,type:"s"})
   
   var r = _server.createRoom(rObj, owner, true)
   _server.setRoomVariables(r,owner,varObj)
   return r;
}

Is this a rightway to do?
B'cuz Im getting Following Error !!
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object it.gotoandplay.smartfoxserver.data.User@14c97d4 of
class it.gotoandplay.smartfoxserver.data.User where it expected String, Number,
Boolean or Scriptable instance. Please check your code for missing Context.java
ToJS() call.

and then
15:22:46.477 - [ WARNING ] > [OpenSpace] openSpace\data\{_os_mapId=Var value: ma
ps\RaceLibrary.lib (The filename, directory name, or volume label syntax is incor
rect)

And this doesnt happen every time.. Upto 2 dynamic rooms everything works fine.. After that it starts giving those error
Let me know if the syntax is right or my logic went wrong :cry:
Girish Patil

Flash Developer
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 19 Jul 2011, 09:52

You are setting the Room Variables in the wrong way. You can't add them to the rObj directly. Please check the server-side createRoom method documentation.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 36 guests