Page 1 of 1

More trouble

Posted: 03 Mar 2006, 03:07
by goodguy20k
As hinted at in my title, I don't know exactly what's wrong. Here's the problem, as far as I can tell:

Right now, I'm doing a custom login extension. (This happens on the example for custom logins.)
I successfully "login" but the _global.myName is not set. That worries me.

Then I call (clientside) smartfox.getRoomList(). I wait for the onRoomListUpdate to fire and the perform this.autoJoin(). (Yes, there is a room defined in the Config.xml for AutoJoin.) But when I go to check all the settings, I get a lot of undefined.... Not good.


Ok... Scratch most of that... Just figured out I wasn't waiting for the onJoinRoom event.... Uh... DUH!!! I feel dumb...

But I still wonder about the _global.myName being undefined... It's straight from your example, Lapo, so don't blame my code! ;-) Just kidding. It's probably my server settings. ;-)

Posted: 03 Mar 2006, 03:16
by goodguy20k
Ok, well, I'm tring to just view some things like smartFox.myUserName, smartFox.myUserId, and smartFox.playerId. But smartfox.amIModerator returns currect. Go figure...

Posted: 03 Mar 2006, 06:42
by Lapo
I successfully "login" but the _global.myName is not set. That worries me.


Since it's a custom login you will have complete freedom on what data you pass back to the client if the login is successfull.
You will need to pass the userID and userName by yourself, if you need them.

We discussed something similar here > viewtopic.php?t=225&highlight=myname

:)

Posted: 03 Mar 2006, 15:03
by goodguy20k
Oh, you mean... Use the search feature on this forum?! :shock: But! But! Then I wouldn't get to talk with you, Master Lapo! 8) Oh well... I guess I could learn from some past posts... Once in a while... :roll:

Posted: 03 Mar 2006, 15:15
by Lapo
I mean that the same problem has already been discussed in that topic.

You can notice at the very beginning of it that code explains it all (I believe)

var user=_server.instance.getUersByChannel(chan);
response._cmd="logOK";
response.name=user.getName();
response.uId=user.getUserId();


Not only you send the "logOK", but also the id and name of the client

Makes sense?

Posted: 03 Mar 2006, 20:18
by goodguy20k
I understood, just had to show my humiliation and thanks for your tip.

Posted: 03 Mar 2006, 22:29
by Lapo
humiliation?? :?: :shock: