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?