Hi,
We are facing a random problem where the user object is coming null while we are capturing the onUserVariablesUpdate event.
i) The version used is 1.6.6.
ii) The error comes at random times but the occurence is always when I come out of a game room to the lobby which is a non-game room.
iii) The code flow is :-
a) On clicking exit game, sfs.getRoomList() is called.
b) When the room list arrives, joinRoom("lobby") is called.
iv) While checking the debug output what I found that :-
a) I receive the room list correctly.
b) A uVarsUpdate message is received for the game room just after the joinRoom(lobby) message is sent.
c) The error occurs after the uVarsUpdate message is received. I tried tracing the user but the user is coming null.
d) onJoinroom message comes after the error. That means the user is still in the game room when the uVarsUpdate message came. And hence it should be captured correctly.
v) I tried going through the SmartFoxClient and SysHandler code but could not get much insight. Please provide some pointers to crack the problem.
Thanks,
User coming null in onUserVariablesUpdate event
-
Rohit Sharma
- Posts: 31
- Joined: 05 Nov 2008, 05:27
- Location: Delhi,India
- Contact:
I would recommend updating to the latest 1.6.7
It is very likely that the problem is related with calling the getRoomList() multiple times. We have addressed this particular issue in the latest API psupplied with the SmartFoxServer 1.6.7
You can download the patch from here:
http://forums.smartfoxserver.com/viewtopic.php?t=6006
It is very likely that the problem is related with calling the getRoomList() multiple times. We have addressed this particular issue in the latest API psupplied with the SmartFoxServer 1.6.7
You can download the patch from here:
http://forums.smartfoxserver.com/viewtopic.php?t=6006
-
Rohit Sharma
- Posts: 31
- Joined: 05 Nov 2008, 05:27
- Location: Delhi,India
- Contact:
Hi Lapo,
The problem still persists despite switching to SFS version 1.6.7.
I guess the problem is due to the following reason :-
i) At every onroomlistupdate we first clear the earlier room list.
ii) Then the roomlist array is populated with data for each room.
iii) Now if a user variable update comes after I have called getRoomList(), the call to room.getUser() will result in null since my room variable now refers to a different memory location which does not have any user information.
Therefore I am getting this error.
Correct me if I am wrong.
Thanks,
Rohit
The problem still persists despite switching to SFS version 1.6.7.
I guess the problem is due to the following reason :-
i) At every onroomlistupdate we first clear the earlier room list.
ii) Then the roomlist array is populated with data for each room.
iii) Now if a user variable update comes after I have called getRoomList(), the call to room.getUser() will result in null since my room variable now refers to a different memory location which does not have any user information.
Therefore I am getting this error.
Correct me if I am wrong.
Thanks,
Rohit
-
Rohit Sharma
- Posts: 31
- Joined: 05 Nov 2008, 05:27
- Location: Delhi,India
- Contact:
Hi,
thanks for the clarification.
It looks like there is an API mismatch.
Please download the latest API from here
Then point your classpath to the new API and recompile your application.
Make sure that the getVersion() method returns 1.6.1
This should solve the issue.
Let us know.
thanks for the clarification.
It looks like there is an API mismatch.
Please download the latest API from here
Then point your classpath to the new API and recompile your application.
Make sure that the getVersion() method returns 1.6.1
This should solve the issue.
Let us know.
-
Rohit Sharma
- Posts: 31
- Joined: 05 Nov 2008, 05:27
- Location: Delhi,India
- Contact:
Hi Lapo,
Thanks for the clarification.
The link that you mentioned above for SFS patch 1.6.7 contains the older client side API's which gives SFS version 1.5.9 and not the one which you
provided in your last reply. Probably, that was the reason the problem did
not resolve.
I have integrated the new API's and have not received any error till now but the error comes at random, so cannot be 100 % sure.
But after going through the API's it seems, this will solve the problems related to user coming null when onUserLeaveRoom or onUserVariablesUpdate comes after getRoomList() is called.
I will monitor the swf and see if the problem persists.
Thanks,
Rohit
Thanks for the clarification.
The link that you mentioned above for SFS patch 1.6.7 contains the older client side API's which gives SFS version 1.5.9 and not the one which you
provided in your last reply. Probably, that was the reason the problem did
not resolve.
I have integrated the new API's and have not received any error till now but the error comes at random, so cannot be 100 % sure.
But after going through the API's it seems, this will solve the problems related to user coming null when onUserLeaveRoom or onUserVariablesUpdate comes after getRoomList() is called.
I will monitor the swf and see if the problem persists.
Thanks,
Rohit