Changing the name displayed in the chat room list...

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

Moderators: Lapo, Bax

JCZorch
Posts: 7
Joined: 07 Nov 2007, 23:32

Changing the name displayed in the chat room list...

Postby JCZorch » 15 Nov 2007, 05:43

Currently I am using the maze example. How can I make it so if a user logins with "jimbo" and is taken to the chatroom. How can I make his name display "Jim" instead of "jimbo"?
User avatar
alcho
Posts: 84
Joined: 02 Dec 2006, 19:37
Location: UK
Contact:

Postby alcho » 15 Nov 2007, 09:12

I dont really see the need for doing this, the problem being that others identify the user with there login name. I guess if you wanted you could add a user variable after login with the users "preffered" name. And this is what is displayed instead of the users login name.

Check http://www.smartfoxserver.com/docs/ > avatar chat example for help with user variables.
Its all about the SmartFox!
JCZorch
Posts: 7
Joined: 07 Nov 2007, 23:32

Postby JCZorch » 15 Nov 2007, 09:30

I want to be able to have duplicate names in the player list. So if ted01 logs in with that username and then ted2007 logs in. I want to be able to see Ted K. and Ted R. instead of their username to login with.

Lets assume both Teds have a last name that starts with R. Will I be able to send them a PM if they have the same name in the list?
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Postby Menser » 15 Nov 2007, 09:38

Hey JC-

Ok, if i understand what your saying.

You want two people to log in with the same name, well call it Bob.

So user 1 logs in as Bob
and user2 logs in as Bob.

That what you want so far? If so, im not sure if SmartFox will let you do that or not, havent test it. BUT if it does, then YES you can send Private messages to both User1Bob and User2Bob since you are refercing the user by their ID and not their name. Course you would need to give your PM system some way to differentiate the two or you users may get confused.

_-Menser-_
User avatar
alcho
Posts: 84
Joined: 02 Dec 2006, 19:37
Location: UK
Contact:

Postby alcho » 15 Nov 2007, 10:31

By default no two users can have the same login name. (Not sure if you can turn this off)

Just make a user variable for each user as they log in. Name it something like "listname". The list should be populated with the listname instead of login name. When you try to pm a user, it takes the listname, finds the actual login name, and sends the pm to that user.

Of course if two users do have the same listname, what if in the userlist there are two people called Bob. How would a user know who the Bob is they want to pm. I dont see why you would want two people to have the same name.
Its all about the SmartFox!
JCZorch
Posts: 7
Joined: 07 Nov 2007, 23:32

Postby JCZorch » 16 Nov 2007, 01:06

Alright thanks for those suggestions. If I am using the default login is there a way I can modify the default login actionscript? If so where is that file?
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 16 Nov 2007, 06:28

I dont see why you would want two people to have the same name.

Yeah... unless there's a good reason for this, I don't see it too

SmartFoxServer does not allow two users with the same name in the same Zone... and this is obviously quite common... does a forum allow two users with the same name? Does Gmail allow two equal accounts?

Also this would break the buddy list which is based on the user name, which is unique.
You can however add a "secondary" nickname, using the User Variables as suggested. In that case you will have to use a server side custom login.

You can find more details about it in the documentation. There's a specific example.
Lapo
--
gotoAndPlay()
...addicted to flash games
JCZorch
Posts: 7
Joined: 07 Nov 2007, 23:32

Postby JCZorch » 17 Nov 2007, 12:21

does a forum allow two users with the same name? Does Gmail allow two equal accounts?


Correct me if I am wrong but you cant make this comparison... A forum is a great comparison because your 'login name' is whats being displayed as your 'name' With gmail your 'login name' is not your 'name' When I log into gmail it doesn't say Hello Jonathan@gmail.com it says Hello Jonathan. gmail is what I want. A unique 'login name' but people can have the same 'name'.
patso
Posts: 380
Joined: 13 Nov 2006, 13:44
Location: Sofia, Bulgaria

Postby patso » 17 Nov 2007, 19:43

You can set the display name as user variable.
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC
Contact:

How about....

Postby Carl Lydon » 19 Nov 2007, 03:33

This could work:

1. User inputs prefered name (lname)
2. Flash does lname=lname+"###"+random(100000)
3. Login with lName
4. Client removes the random number when displaying name

That way, you can have everyone logged in with a (very likely) unique name, but may display same name within chat.

But a user probably would be the best way.

-Carl

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 115 guests