Skip to content
Snippets Groups Projects
Commit 141112e1 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Lower level of new "Logoff time <= logon time" log message

... from ERROR to WARNING, but log the human-readable logon time too.

This condition can easily happen if the system clock is corrected (e.g. a few seconds via NTP adjustment) during a quick connect/disconnect.

Don't call logoffstats() unless a user actually successfully logged-in. I don't think sysops actually want all the time bots sit at the logon prompt counted as "time online" in their stats anyway.
parent 065e6db8
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2958 failed
......@@ -4239,7 +4239,9 @@ void sbbs_t::logoffstats()
now = time(NULL);
if(now <= logontime) {
lprintf(LOG_ERR, "Logoff time (%lu) <= logon time (%lu)", (ulong)now, (ulong)logontime);
char tmp[128];
lprintf(LOG_WARNING, "Logoff time (%lu) <= logon time (%lu): %s"
,(ulong)now, (ulong)logontime, ctime_r(&logontime, tmp));
return;
}
ulong minutes_used = (ulong)(now-logontime)/60;
......@@ -4367,7 +4369,8 @@ void node_thread(void* arg)
node_socket[sbbs->cfg.node_num-1]=INVALID_SOCKET;
sbbs->logout();
sbbs->logoffstats(); /* Updates both system and node dsts.ini (daily statistics) files */
if(login_success)
sbbs->logoffstats(); /* Updates both system and node dsts.ini (daily statistics) files */
SAFEPRINTF(str, "%sclient.ini", sbbs->cfg.node_dir);
FILE* fp = fopen(str, "at");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment