Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 53c4d3fa authored by Rob Swindell's avatar Rob Swindell 💬

Store the time the client disconnects (hangs-up) in node#/client.ini

parent 12a11b6b
Pipeline #1022 failed with stage
in 17 minutes and 1 second
......@@ -4467,7 +4467,7 @@ void sbbs_t::logoffstats()
void node_thread(void* arg)
{
char str[128];
char str[MAX_PATH + 1];
int file;
uint curshell=0;
node_t node;
......@@ -4568,6 +4568,13 @@ void node_thread(void* arg)
sbbs->logout();
sbbs->logoffstats(); /* Updates both system and node dsts.dab files */
SAFEPRINTF(str, "%sclient.ini", sbbs->cfg.node_dir);
FILE* fp = fopen(str, "at");
if(fp != NULL) {
fprintf(fp, "hangup=%lu", (ulong)time(NULL));
fclose(fp);
}
if(sbbs->sys_status&SS_DAILY) { // New day, run daily events/maintenance
sbbs->daily_maint();
}
......
......@@ -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)
int getnodeclient(scfg_t* cfg, uint number, client_t* client, time_t* hangup)
{
SOCKET sock = INVALID_SOCKET;
char path[MAX_PATH + 1];
......@@ -1566,6 +1566,7 @@ int getnodeclient(scfg_t* cfg, uint number, client_t* client)
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);
fclose(fp);
return sock;
}
......
......@@ -76,7 +76,7 @@ DLLEXPORT char* getsmsg(scfg_t*, int usernumber);
DLLEXPORT int putsmsg(scfg_t*, int usernumber, char *strin);
DLLEXPORT char* getnmsg(scfg_t*, int node_num);
DLLEXPORT int putnmsg(scfg_t*, int num, char *strin);
DLLEXPORT int getnodeclient(scfg_t*, uint number, client_t*);
DLLEXPORT int getnodeclient(scfg_t*, uint number, client_t*, time_t*);
DLLEXPORT uint userdatdupe(scfg_t*, uint usernumber, uint offset, uint datlen, char *dat
,BOOL del, BOOL next, void (*progress)(void*, int, int), void* cbdata);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment