Avatar Chat Errors

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 02 Oct 2011, 21:59

No no.. :roll:

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 =...;
Smartfox's forum is my daily newspaper.
Guy71173cp
Posts: 148
Joined: 03 Aug 2010, 16:08
Contact:

Postby Guy71173cp » 03 Oct 2011, 19:28

Sorry, this is the most PATHETIC question, but...

What would I put as the value in the userName and userID properties? Sorry, I knew so much about SFS until I just stopped working on the computer for a while.

smartFox.myUserId = ...;
smartFox.myUserName =...;

So like, in the dots, what would I put?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 03 Oct 2011, 19:48

smartFox.myUserId = {the SFS user id you sent along with the logOK reponse};
smartFox.myUserID = {the user name used for login};
Smartfox's forum is my daily newspaper.
Guy71173cp
Posts: 148
Joined: 03 Aug 2010, 16:08
Contact:

Postby Guy71173cp » 03 Oct 2011, 20:35

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
Guy71173cp
Posts: 148
Joined: 03 Aug 2010, 16:08
Contact:

Postby Guy71173cp » 06 Oct 2011, 19:36

Anyone have an answer?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 06 Oct 2011, 22:32

Don't you know what SFS user Id is?

smartfox.myUserId = {the smartfox user id that you'll need to fetch from the server for that particular user upon successful login}
Smartfox's forum is my daily newspaper.
Guy71173cp
Posts: 148
Joined: 03 Aug 2010, 16:08
Contact:

Postby Guy71173cp » 07 Oct 2011, 15:53

Hey.

I've been studying SmartFoxServer for over a year. Can you direct me to a good place to learn the user variables? I know the docs, but what chapter? Avatar chat? I am an expert at AS2, but I am not too good at SFS. Could you point me where to start? Like which chapter?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 11 Oct 2011, 04:50

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.
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 20 guests