can't get this method to work...
i read on docs:
getVariable(name) Return the room variable with the requested name
i got a variable in a room and i try to trace it with:
trace(room.getVariable("variable"))
and i get:
it.gotoandplay.smartfoxserver.data.RoomVariable@afae4a
any ideas?
getVariable(name)
As Lapo says it better
I've encountered this problem here > viewtopic.php?t=279&highlight=room+variable+getvalue
when using getVariables().
I would have expected that getVariable('name') would return the actual value. But since it seems that returns a java object use the getValue() to obtain it's value.
Since the Room object is a native java object it [the getVariables() method] will return another native java object, specifically an HashMap
I've encountered this problem here > viewtopic.php?t=279&highlight=room+variable+getvalue
when using getVariables().
I would have expected that getVariable('name') would return the actual value. But since it seems that returns a java object use the getValue() to obtain it's value.
Code: Select all
trace(room.getVariable("variable").getValue()) ;
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 41 guests