Change the thread name in play_cmd() to show country number

This makes the journal easier to read.  We can't use the country
number earlier, because it is not unique then.
This commit is contained in:
Ron Koenderink 2008-09-11 14:50:08 -06:00
parent effc1b187a
commit 5edaccafa4

View file

@ -307,6 +307,7 @@ play_cmd(void)
natid cnum; natid cnum;
struct natstr *natp; struct natstr *natp;
char **ap; char **ap;
char buf[128];
ap = player->argp; ap = player->argp;
if (*++ap) { if (*++ap) {
@ -342,6 +343,8 @@ play_cmd(void)
} }
return RET_FAIL; return RET_FAIL;
} }
snprintf(buf, sizeof(buf), "Play#%d", player->cnum);
empth_set_name(buf);
logerror("%s logged in as country #%d", praddr(player), player->cnum); logerror("%s logged in as country #%d", praddr(player), player->cnum);
pr_id(player, C_INIT, "%d\n", CLIENTPROTO); pr_id(player, C_INIT, "%d\n", CLIENTPROTO);
player_main(player); player_main(player);