Commit 6c08c18c authored by rswindell's avatar rswindell
Browse files

Added 2 new @-codes for the Millionaire:

- FILES:<code>

I couldn't get out of him whether he wanted the total number of files in the
*current* directory or a sysop-specified directory, so I just added both.
I don't have an easy way to calculate the total bytes used for all files
in a directory, so punt on that feature request for now.
parent e9195eb9
......@@ -438,6 +438,21 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode)
if(strncmp(sp, "FILES:", 6) == 0) { // Number of files in specified directory
for(i = 0; i < cfg.total_dirs; i++) {
if(stricmp(cfg.dir[i]->code, sp + 6) == 0) {
safe_snprintf(str, maxlen, "%lu", (ulong)getfiles(&cfg, i));
return str;
return nulstr;
if(strcmp(sp, "FILES") == 0) { // Number of files in current directory
safe_snprintf(str, maxlen, "%lu", (ulong)getfiles(&cfg, usrdir[curlib][curdir[curlib]]));
return str;
if(!strcmp(sp,"TCALLS") || !strcmp(sp,"NUMCALLS")) {
safe_snprintf(str,maxlen,"%lu", (ulong)stats.logons);
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