Question about username
Question about username
Greetings.
How to change username, which shows in the game under the "Players" menu ("@") in the "user name@computer name" form (I guess it's like that)?
I tried different ways, but was able to change only the computer name part.
How to change username, which shows in the game under the "Players" menu ("@") in the "user name@computer name" form (I guess it's like that)?
I tried different ways, but was able to change only the computer name part.
Re: Question about username
The name is taken directly from your session user name. If you're under Windows (family edition), you're probably using the default session. Try to close your session and open a new session with a real user name.
Re: Question about username
In windows, I'd assume the most simple explanation is:
"user name@computer name"
'User name' is the name you log into windows with
'Computer name' is the name you give your computer in the network settings.
"user name@computer name"
'User name' is the name you log into windows with
'Computer name' is the name you give your computer in the network settings.
I am Thorbear...
Re: Question about username
Yes, creating new user profile and logging with it does change the username in Mangband, but I want to keep my current user profile.Zaxx wrote:Try to close your session and open a new session
I tried changing my username in Windows (it doesn't, however, changed the name of the x:\Documents And Settings\username folder, so probably I did something wrong) changing owner' name in registry, but Mangband still take my "old" username out of somewhere.Thorbear wrote:'User name' is the name you log into windows with
I tried to search in source code to determine what it does to get username, but got stuck.
I found what function get called if "@" is pressed, in /client/c-cmd.c
Code: Select all
case '@':
{
cmd_players();
break;
}
...
void cmd_players(void)
{
/* Set the hook */
special_line_type = SPECIAL_FILE_PLAYER;
Code: Select all
case SPECIAL_FILE_PLAYER:
do_cmd_check_players(player, line);
Code: Select all
void do_cmd_check_players(int Ind, int line)
...
fprintf(fff, " %s@%s\n", q_ptr->realname, q_ptr->hostname);
Code: Select all
struct player_type
{
char basename[MAX_CHARS];
char realname[MAX_CHARS]; /* Userid */
char hostname[MAX_CHARS]; /* His hostname */
Code: Select all
strcpy(p_ptr->realname, connp->real);
strcpy(p_ptr->hostname, connp->host);
...
connp->real = strdup(real);
Re: Question about username
The code is in the client (c-init.c):
If you want to hack your client to display anything instead of the default user name, simply change that part of code.
Code: Select all
/*
* Initialize everything, contact the server, and start the loop.
*/
void client_init(char *argv1)
{
...
/* Get user name */
if (GetUserName(buffer, &nSize))
{
buffer[16] = '\0';
my_strcpy(real_name, buffer, sizeof(real_name));
}
}
Re: Question about username
Changing the name of your user folder in windows will not change your username (however it might cause quite a few shortcuts in windows to fail).Question wrote:I tried changing my username in Windows (it doesn't, however, changed the name of the x:\Documents And Settings\username folder, so probably I did something wrong) changing owner' name in registry, but Mangband still take my "old" username out of somewhere.
If you wish to change your windows user account name, you do so through "User Accounts" in the Control Panel.
But if you want to keep your user account name, you'll just have to accept that it's showed in the game.
(Or change the source, but I don't see how this is a "problem" that is so important that changing the source is useful).
I am Thorbear...
Re: Question about username
Thank you very much! It works!Zaxx wrote:The code is in the client (c-init.c):
If you want to hack your client to display anything instead of the default user name, simply change that part of code.
One more question: can I play on the main server with this modified version of client? I can't find anything related to this not in rules or on forum.
Sorry, I didn't make myself clear enough. I did change the username through the control panel, but even after reboot, my folder in the "Documents and Settings" remained unchanged and new one (with new name) wasn't created. It's not a problem, just a small nuisance, which I thought would be quick to correct.Thorbear wrote:If you wish to change your windows user account name, you do so through "User Accounts" in the Control Panel.
Re: Question about username
Actually for the sake of privacy this should not be shown.... also imagine if some people have offensive accountnames.
Not happened yet, but it might be good to show the hostname only to administrators or not at all.
Not happened yet, but it might be good to show the hostname only to administrators or not at all.
Re: Question about username
Anyone?Question wrote:One more question: can I play on the main server with this modified version of client? I can't find anything related to this not in rules or on forum.
Re: Question about username
I'd say yes...
Re: Question about username
Ok, thanks.