Read the forum and tried everything. Find same problem and solutions here
http://www.smartfoxserver.com/forums/viewtopic.php?t=4838&highlight=setroomvariables
But its not working for me. Tried everything.
ERROR
Code: Select all
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object it.gotoandplay.smartfoxserver.data.User@7b40aa23 of class it.gotoandplay.smartfoxserver.data.User where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.
My Code
Code: Select all
function handleRequest(cmd, params, user, fromRoom)
{
if (cmd == "setVar")
handleSetVar(user, fromRoom)
}
function handleSetVar(user, fromRoom)
{
var theRoom = _server.getCurrentZone().getRoom(fromRoom)
var rVars = []
rVars.push( {name:"highscore", val:12000, priv:true} )
_server.setRoomVariables(theRoom, user, rVars)
//_server.setRoomVariables(theRoom, user, rVars, true, true);
}
The problem is with user object. if I put null than there is no exception.
Please help anyone.