Zaxx wrote:Try to close your session and open a new session
Yes, creating new user profile and logging with it does change the username in Mangband, but I want to keep my current user profile.
Thorbear wrote:'User name' is the name you log into windows with
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.
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;
Then, in
/server/netserver.c
Code: Select all
case SPECIAL_FILE_PLAYER:
do_cmd_check_players(player, line);
This function is declared in
/server/cmd4.c
Code: Select all
void do_cmd_check_players(int Ind, int line)
...
fprintf(fff, " %s@%s\n", q_ptr->realname, q_ptr->hostname);
I found the 'player_type' structure declaration being stored in
/common/types.h
Code: Select all
struct player_type
{
char basename[MAX_CHARS];
char realname[MAX_CHARS]; /* Userid */
char hostname[MAX_CHARS]; /* His hostname */
And this array is filled in
/server/netserver.c
Code: Select all
strcpy(p_ptr->realname, connp->real);
strcpy(p_ptr->hostname, connp->host);
...
connp->real = strdup(real);
And this is where I got stuck. Search for 'real', 'host', 'connp' or 'connection_t' gets me nowhere.