I'm trying to use the setUserVariables, and receiving the following exception:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at it.gotoandplay.smartfoxserver::SmartFoxClient/setUserVariables()
at mainGame_sfs_fla::MainTimeline/setPlayerVariables()
at mainGame_sfs_fla::MainTimeline/frame70()
The game uses a custom join, and I'm trying to send the variables after I'm logged into a game room. After reading some posts about this issue, I added the following lines after the player joins the room:
Code: Select all
trace("My user ID is: " + smartFox.myUserId);
trace("I logged in as: " + smartFox.myUserName);
This is what I get in the output window:
My user ID is: -1
I logged in as:
I tried getting the room list again, which didn't help.
Whenever a player logs into the game, he first logs into the lobby so that several functions can be executed, and then he is transferred to another room. I added the lines to show the userId and name after joining the lobby, too, with the same results. It feels like the client loses track of which user it is handling...