RHINO USAGE WARNING on setRoomVariables

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

anasmatic
Posts: 30
Joined: 15 Mar 2010, 07:27
Contact:

RHINO USAGE WARNING on setRoomVariables

Postby anasmatic » 23 Sep 2014, 09:43

Hi, I got this Warning all over my log files !
I don't know if this serious but it look bad.

I'm using AS for server side development

Code: Select all

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object it.gotoandplay.smartfoxserver.data.User@154dc9 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.


I debugged and find out it happens when I call setRoomVariables

Code: Select all

_server.setRoomVariables(room, user, rvPl, false);


Code: Select all

rvPl
is an array of objects

I check the documentation and this is the params are in the proper sorting

please advice.
thanks
to pee or not to pee
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: RHINO USAGE WARNING on setRoomVariables

Postby Lapo » 01 Oct 2014, 08:09

It seems to be complaining about the User object not the variables array, although it's not clear why it is expecting a JS type.
Any more details you can share?
Lapo
--
gotoAndPlay()
...addicted to flash games
anasmatic
Posts: 30
Joined: 15 Mar 2010, 07:27
Contact:

Re: RHINO USAGE WARNING on setRoomVariables

Postby anasmatic » 19 Oct 2014, 10:58

I could not provide more details.
but I found a workaround :idea:

I did this

Code: Select all

var toUser = _server.getUserById(user.getUserId())
_server.setRoomVariables(room, toUser, rvPl, false);


instead of just

Code: Select all

 _server.setRoomVariables(room, user, rvPl, false);


that was inside

Code: Select all

function handleRequest(cmd, params, user, fromRoom)


I don't think why the handleRequest function is passing a wrecked User object because I'm extracting some values from it before the setRoomVariables line.
..
I don't know what is the problem .
to pee or not to pee

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 23 guests