Hi!
I am trying to set some user variables.
Naturally I tried first to set these variables when not in a room, but the system crashed because it tried to use the current room (which was null) to query User object for the local user. Okay, I joined a room and tried again but it crashed again.
It turned out that if I call SmartFoxClient.setUserVariables in that handler, the user isn't actually in that room (even locally) in case of a Limbo room. Now I changed the room not to be limbo, problem solved.
However, a question raises: Is there a point for requiring user to be in a gameroom before user variables can be set? If I understood correctly, those variables are permanent anyway in a sense that I don't need to set them everytime I join a game room?
Basically I have two choices now:
a) Forget the limbo room feature
b) Handle user variable setting separately after joining a game room, which is pain in the ass because I need to keep track somehow if the variables are set for all users before transactions related to those variables can be done between clients.
I think that the system would also need a bit error handling, it is not very convenient to have the SmartFoxClient crash everytime I do something I am supposed not to. Simple error code or string would be a lot of help for both me and you.
Cheers!
Question regarding to onJoinRoom-eventhandler
It shouldn'tOkay, I joined a room and tried again but it crashed again.
Which handler sorry?It turned out that if I call SmartFoxClient.setUserVariables in that handler
The limbo room simply does not support any broadcast-type message, so public message, user and room variables etc...the user isn't actually in that room (even locally) in case of a Limbo room. Now I changed the room not to be limbo, problem solved.
It can be in any room (besides Limbo)However, a question raises: Is there a point for requiring user to be in a gameroom before user variables can be set?
The user must join at least one room before interacting with the server. This allows the server to protect himself from a lot of very basic and very annoying security issues.
The steps should be:
1- connect
2- login
3- request room list
4- join a room
... proceed as you prefer ...
We're going to enhance error reporting quite a lot in the next releases, including support for multiple languagesI think that the system would also need a bit error handling, it is not very convenient to have the SmartFoxClient crash everytime I do something I am supposed not to. Simple error code or string would be a lot of help for both me and you.
Btw, this document goes into all these details and more --> http://www.smartfoxserver.com/docs/docP ... ecture.htm