No no..
you need to send the user id and name inside your response package, like this:
var u = _server.instance.getUserByChannel(chan);
response.userId = u.getUserId();
Then on client side, you need to set myUserId and myUserName using the data u just sent from serverside.
i.e.
smartFox.myUserId = ...;
smartFox.myUserName =...;
Avatar Chat Errors
-
- Posts: 148
- Joined: 03 Aug 2010, 16:08
- Contact:
-
- Posts: 148
- Joined: 03 Aug 2010, 16:08
- Contact:
Ok, so I know that smartfox.myUserName would be valued as userName (since that would be the username), but I'm clueless about the myUserId. Here is my extension:
http://pastebin.com/K9nQWixB
http://pastebin.com/K9nQWixB
-
- Posts: 148
- Joined: 03 Aug 2010, 16:08
- Contact:
-
- Posts: 148
- Joined: 03 Aug 2010, 16:08
- Contact:
Note that you need to manually set the myUserId and myUserName in order for setUserVariables to work with custom login. This is because the client API needs to know the smartfoxserver user id for that user, otherwise it will not work. If you didn't set myUserId, then the client API will basically tell the server: 'Please update user variables for this user by id: -1'
There are a number of different chapters that covers userVariables. Simply search for 'setUserVariables' via doc search tool.
There are a number of different chapters that covers userVariables. Simply search for 'setUserVariables' via doc search tool.
Smartfox's forum is my daily newspaper.
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 41 guests