diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 11f7a43d4828b4213f04c77d7791974c51057501..d8b5cf5124e6179e61355285244905e70caf6bfc 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -4571,7 +4571,9 @@ void node_thread(void* arg) SAFEPRINTF(str, "%sclient.ini", sbbs->cfg.node_dir); FILE* fp = fopen(str, "at"); if(fp != NULL) { - fprintf(fp, "hangup=%lu", (ulong)time(NULL)); + fprintf(fp, "user=%u\n", sbbs->useron.number); + fprintf(fp, "name=%s\n", sbbs->useron.alias); + fprintf(fp, "done=%lu\n", (ulong)time(NULL)); fclose(fp); } diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c index 10a72c7c6978e6f2780721f92fb1dc971750c377..855d05724ac410df25afd4931042a55ff4d2b861 100644 --- a/src/sbbs3/userdat.c +++ b/src/sbbs3/userdat.c @@ -1539,7 +1539,7 @@ int putnmsg(scfg_t* cfg, int num, char *strin) } /* Return node's client's socket descriptor or negative on error */ -int getnodeclient(scfg_t* cfg, uint number, client_t* client, time_t* hangup) +int getnodeclient(scfg_t* cfg, uint number, client_t* client, time_t* done) { SOCKET sock = INVALID_SOCKET; char path[MAX_PATH + 1]; @@ -1551,8 +1551,10 @@ int getnodeclient(scfg_t* cfg, uint number, client_t* client, time_t* hangup) || client == NULL || number < 1 || number > cfg->sys_nodes) return -1; - if(client->size == sizeof(client)) + if(client->size == sizeof(client)) { free((char*)client->protocol); + free((char*)client->user); + } memset(client, 0, sizeof(*client)); client->size = sizeof(client); SAFEPRINTF(path, "%sclient.ini", cfg->node_path[number - 1]); @@ -1562,11 +1564,14 @@ int getnodeclient(scfg_t* cfg, uint number, client_t* client, time_t* hangup) sock = iniReadShortInt(fp, ROOT_SECTION, "sock", 0); client->port = iniReadShortInt(fp, ROOT_SECTION, "port", 0); client->time = iniReadInteger(fp, ROOT_SECTION, "time", 0); + client->usernum = iniReadInteger(fp, ROOT_SECTION, "user", 0); SAFECOPY(client->addr, iniReadString(fp, ROOT_SECTION, "addr", "<none>", value)); SAFECOPY(client->host, iniReadString(fp, ROOT_SECTION, "host", "<none>", value)); if((p = iniReadString(fp, ROOT_SECTION, "prot", NULL, value)) != NULL) client->protocol = strdup(p); - *hangup = iniReadInteger(fp, ROOT_SECTION, "hangup", client->time); + if((p = iniReadString(fp, ROOT_SECTION, "name", NULL, value)) != NULL) + client->user = strdup(p); + *done = iniReadInteger(fp, ROOT_SECTION, "done", client->time); fclose(fp); return sock; }