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 b8cc0c0e authored by Rob Swindell's avatar Rob Swindell 💬

New @-codes UDR (upload/download byte-ratio) and UDFR (file ratio)

Expands to a percentage, similar to PCR (not capped at 100).

Remove the failed-attempt to cap the percentage at 100 for the PCR atcode.
parent 7183406f
Pipeline #2404 passed with stage
in 9 minutes and 28 seconds
......@@ -1184,7 +1184,23 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode, bool
float f = 0;
if(useron.posts)
f = (float)useron.logons / useron.posts;
safe_snprintf(str, maxlen, "%u", f ? (uint)(100 / f) : useron.posts > useron.logons ? 100 : 0);
safe_snprintf(str, maxlen, "%u", f ? (uint)(100 / f) : 0);
return str;
}
if(strcmp(sp, "UDR") == 0) {
float f = 0;
if(useron.ulb)
f = (float)useron.dlb / useron.ulb;
safe_snprintf(str, maxlen, "%u", f ? (uint)(100 / f) : 0);
return str;
}
if(strcmp(sp, "UDFR") == 0) {
float f = 0;
if(useron.uls)
f = (float)useron.dls / useron.uls;
safe_snprintf(str, maxlen, "%u", f ? (uint)(100 / f) : 0);
return str;
}
......
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