Commit 2ad46e3a authored by rswindell's avatar rswindell
Browse files

Added new ARS keywords:

* ULS - uploaded files
* ULB - uploaded bytes
* DLS - downloaded files
* DLB - downloaded bytes

... so now Phil can have a "true" 1:4 upload/download file ratio requirement by
using an ARS of "DLS NOT 4 OR UDFR 25"
parent ad72a123
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -233,6 +233,18 @@ uchar* arstr(ushort* count, char* str, scfg_t* cfg)
else if(!strnicmp(str+i,"UDR",3)) {
artype=AR_UDR;
i+=2; }
else if(!strnicmp(str+i,"ULS",3)) {
artype=AR_ULS;
i+=2; }
else if(!strnicmp(str+i,"ULB",3)) {
artype=AR_ULB;
i+=2; }
else if(!strnicmp(str+i,"DLS",3)) {
artype=AR_DLS;
i+=2; }
else if(!strnicmp(str+i,"DLB",3)) {
artype=AR_DLB;
i+=2; }
else if(!strnicmp(str+i,"DAY",3)) {
artype=AR_DAY;
i+=2; }
......@@ -502,6 +514,10 @@ uchar* arstr(ushort* count, char* str, scfg_t* cfg)
case AR_RANDOM:
case AR_LASTON:
case AR_LOGONS:
case AR_ULS:
case AR_ULB:
case AR_DLS:
case AR_DLB:
*((short *)(ar+j))=n;
j+=2;
break;
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -114,6 +114,10 @@ enum { /* Access requirement binaries */
,AR_ACTIVE
,AR_INACTIVE
,AR_DELETED
,AR_ULS
,AR_ULB
,AR_DLS
,AR_DLB
};
#endif /* Don't add anything after this line */
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -449,6 +449,34 @@ bool sbbs_t::ar_exp(uchar **ptrptr, user_t* user)
noaccess_str=text[NoAccessUDFR];
noaccess_val=n; }
break;
case AR_ULS:
if((equal && user->uls!=i) || (!equal && user->uls<i))
result=_not;
else
result=!_not;
(*ptrptr)++;
break;
case AR_ULB:
if((equal && user->ulb!=i) || (!equal && user->ulb<i))
result=_not;
else
result=!_not;
(*ptrptr)++;
break;
case AR_DLS:
if((equal && user->dls!=i) || (!equal && user->dls<i))
result=_not;
else
result=!_not;
(*ptrptr)++;
break;
case AR_DLB:
if((equal && user->dlb!=i) || (!equal && user->dlb<i))
result=_not;
else
result=!_not;
(*ptrptr)++;
break;
case AR_FLAG1:
if((!equal && !(user->flags1&FLAG(n)))
|| (equal && user->flags1!=FLAG(n)))
......
......@@ -1672,6 +1672,34 @@ static BOOL ar_exp(scfg_t* cfg, uchar **ptrptr, user_t* user)
result=!not;
}
break;
case AR_ULS:
if((equal && user->uls!=i) || (!equal && user->uls<i))
result=not;
else
result=!not;
(*ptrptr)++;
break;
case AR_ULB:
if((equal && user->ulb!=i) || (!equal && user->ulb<i))
result=not;
else
result=!not;
(*ptrptr)++;
break;
case AR_DLS:
if((equal && user->dls!=i) || (!equal && user->dls<i))
result=not;
else
result=!not;
(*ptrptr)++;
break;
case AR_DLB:
if((equal && user->dlb!=i) || (!equal && user->dlb<i))
result=not;
else
result=!not;
(*ptrptr)++;
break;
case AR_FLAG1:
if(user==NULL
|| (!equal && !(user->flags1&FLAG(n)))
......
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