]> git.pond.sub.org Git - empserver/commitdiff
Change the thread name in play_cmd() to show country number
authorRon Koenderink <rkoenderink@yahoo.ca>
Thu, 11 Sep 2008 20:50:08 +0000 (14:50 -0600)
committerRon Koenderink <rkoenderink@yahoo.ca>
Thu, 11 Sep 2008 20:50:08 +0000 (14:50 -0600)
This makes the journal easier to read.  We can't use the country
number earlier, because it is not unique then.

src/lib/player/login.c

index 947fdef76c29ff722ffd4d6ed105435b62a06032..3b0148a8d28bde9cd47b2334c1837d14a78edb8a 100644 (file)
@@ -307,6 +307,7 @@ play_cmd(void)
     natid cnum;
     struct natstr *natp;
     char **ap;
+    char buf[128];
 
     ap = player->argp;
     if (*++ap) {
@@ -342,6 +343,8 @@ play_cmd(void)
        }
        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);
     pr_id(player, C_INIT, "%d\n", CLIENTPROTO);
     player_main(player);