I login in server-side extension and join in client using
"smartfox.joinRoom()".
On onJoinRoom event,I can get my name by "user.getName()".
,but I don't pass my name to smartfox.
Following is what I passed ( server side code if loing is ok):
var user=_server.instance.getUersByChannel(chan);
response._cmd="logOK";
resopnse.name=user.getName();
resopnse.uId=user.getUserId();
I pass these two var to my client and store them in _global vars.
My question is why can smartfox know myName when I
join a room?
How does smarfox to know that?
Thank You for replying.
where does smartfox know myname?
Hello Lapo,
I mean I use a server side extension to login.
In that case , will smartfoxclient have my data?
In that case , will smartfoxclient have my data?
your data?!
I am sorry I still don't get it
You posted this code:
(ATTENTION: you declared a var called "response" and the you mis-typed it "resopnse")
By using the above code you're sending back to the client the two most important informations that the client should know: the user id and the nickname
What other data do you need?
I am sorry I still don't get it
You posted this code:
Code: Select all
var user=_server.instance.getUersByChannel(chan);
response._cmd="logOK";
resopnse.name=user.getName();
resopnse.uId=user.getUserId();
(ATTENTION: you declared a var called "response" and the you mis-typed it "resopnse")
By using the above code you're sending back to the client the two most important informations that the client should know: the user id and the nickname
What other data do you need?
alvin3343 wrote:Hello Lapo,
I understand.
Thank you.
Because I login in server side ,so smartfoxclient doesn't have myId and myName .
But it still has other properties like playerId,activeRoomId..
so I confused.
Yes, that's correct. You don't have them automatically but you can send them from the server side to the client.
Hope I made myself clear
- goodguy20k
- Posts: 71
- Joined: 10 Jan 2006, 23:58
- Location: Texas, USA
- Contact:
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 74 guests