Question regarding to onJoinRoom-eventhandler
Posted: 08 Jul 2008, 20:17
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!
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!