AJAX API: user/room variables?

Post here all your questions related with beta SmartFoxServer API, such as Shockwave, Ajax ...

Moderators: Lapo, Bax

Imek
Posts: 2
Joined: 13 May 2010, 10:47
Location: England

AJAX API: user/room variables?

Postby Imek » 09 Aug 2010, 13:56

Hi,

We started off making a chat client in Flash to prototype, but now we want to use AJAX instead.

I've based the chat client on the example, and so far it has worked pretty well. But when I tried to use user variables I came across an error. In my Python extension I'm doing this at the end of our custom user login function:

Code: Select all

_server.setUserVariables( user, { 'ACRID' : int(userACRID) } )


With "userACRID" being a user ID retrieved via SQL from our game database, which we want to store accessible from both sides.

However this line of code alone is causing an JavaScript error when the user tries to log in - I'm not even trying to access the value yet. The error is:

Code: Select all

Uncaught TypeError: Cannot read property 'jsObject' of null


The error occurs in $populateUserVariables, on the line:

Code: Select all

vValue = $getNamedItem($NamedNodeMapImpl(new NamedNodeMapImpl, child.jsObject.attributes), 'v').jsObject.nodeValue;


Not sure if that's much help. I'm using SFS version 1.6.6, though no problems on the server side.

I remember getting a similar error when trying to use a room variable. Is there something I'm doing wrong? Or are user/room variables not even working with the AJAX API?

Return to “Other Client API”

Who is online

Users browsing this forum: No registered users and 3 guests