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

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
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2404 passed
......@@ -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;
}
......
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