Hello everyone, we are facing a problem in our game, the SetUserVariables method is being called before AddUser in the client SDK
Here is the full story:
we are using Smartfox 2.13.4 with the latest SDK for C# unity, we are facing a problem where most user variables are null when the user reaches the lobby, but it's ONLY on our WebGL build and it's NOT consistent, so I thought it's a race condition or something, today I decompiled the client SDK and put traces every where to help me hunt the issue
I found that the method called FnSetUserVariables in SystemController class is being called before the SFSUserManager.AddUser method, which will cause the following message to be debugged as warning in the browser's console:
UserVariablesUpdate: unknown user id = xxxxx
We are doing custom login, reading some values from the DB and then we set them in the session object
later on JoinZoneEventHandler we add all values to a variables list and send use the API object to set the user vars
the last thing we do in this event handler is join the user to the lobby or the main room
we have no issues at all on mobiles phones which what got me confused and looking in the wrong direction for so long, is this a correct order to do things?
Notes:
1- if I try to debug the user variables later (after the user has settled in the lobby, after 30 seconds for example), the user is there and it has only part of the variables
2- some times there is no issue at all and it just works!
3- the user has all his variables assigned correctly in the admin tool in all scenarios
almost all web users can't play due to this issue, if you can help we will appreciate it
my thanks
SetUserVariables is Called before AddUser
-
- Posts: 41
- Joined: 06 Jul 2017, 04:35
Re: SetUserVariables is Called before AddUser
Thank you for reporting.
We will investigate the issue during the next days and let you know.
We will investigate the issue during the next days and let you know.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
-
- Posts: 41
- Joined: 06 Jul 2017, 04:35
Re: SetUserVariables is Called before AddUser
thanks Bax, let me know if there is any info you need to help
by the way the problem is WAY LESS frequent on firefox, but it still happens sometimes
by the way the problem is WAY LESS frequent on firefox, but it still happens sometimes
Re: SetUserVariables is Called before AddUser
Hassan Khallouf wrote:thanks Bax, let me know if there is any info you need to help
by the way the problem is WAY LESS frequent on firefox, but it still happens sometimes
Ouch. This might make the investigation more difficult. Which browsers did you use for testing? And which one seems to be affected the most?
Thanks
-
- Posts: 41
- Joined: 06 Jul 2017, 04:35
Re: SetUserVariables is Called before AddUser
Chrome and firefox,
it happens on chrome most of the times, so our game is kinda completely broken if you use chrome
it happens on chrome most of the times, so our game is kinda completely broken if you use chrome
-
- Posts: 41
- Joined: 06 Jul 2017, 04:35
Re: SetUserVariables is Called before AddUser
Any clues so far?
Re: SetUserVariables is Called before AddUser
We yet can't reproduce the issue.
Can you please show how you execute the steps you described earlier?
Can you please show how you execute the steps you described earlier?
- We are doing custom login, reading some values from the DB and then we set them in the session object
- later on JoinZoneEventHandler we add all values to a variables list and send use the API object to set the user vars
- the last thing we do in this event handler is join the user to the lobby or the main room
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Who is online
Users browsing this forum: No registered users and 100 guests