From 152f95bc96138dc43fae1bb541302f12aee2a129 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Fri, 29 Dec 2006 09:00:59 +0000 Subject: [PATCH] New ARS keywords: DELETED, INACTIVE, and ACTIVE. --- src/sbbs3/ars.c | 23 ++++++++++++++++++++++- src/sbbs3/ars_defs.h | 5 ++++- src/sbbs3/chk_ar.cpp | 17 ++++++++++++++++- src/sbbs3/userdat.c | 15 +++++++++++++++ 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/sbbs3/ars.c b/src/sbbs3/ars.c index ac518cdaa7..bc54044b10 100644 --- a/src/sbbs3/ars.c +++ b/src/sbbs3/ars.c @@ -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 2005 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2006 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 * @@ -357,6 +357,27 @@ uchar* arstr(ushort* count, char* str, scfg_t* cfg) else if(!strnicmp(str+i,"EXPIRE",6)) { artype=AR_EXPIRE; i+=5; } + else if(!strnicmp(str+i,"ACTIVE",6)) { + artype=AR_ACTIVE; + if(not) + ar[j++]=AR_NOT; + not=0; + ar[j++]=artype; + i+=5; } + else if(!strnicmp(str+i,"INACTIVE",8)) { + artype=AR_INACTIVE; + if(not) + ar[j++]=AR_NOT; + not=0; + ar[j++]=artype; + i+=7; } + else if(!strnicmp(str+i,"DELETED",7)) { + artype=AR_DELETED; + if(not) + ar[j++]=AR_NOT; + not=0; + ar[j++]=artype; + i+=6; } else if(!strnicmp(str+i,"EXPERT",6)) { artype=AR_EXPERT; if(not) diff --git a/src/sbbs3/ars_defs.h b/src/sbbs3/ars_defs.h index 57250e99a5..3301c341e0 100644 --- a/src/sbbs3/ars_defs.h +++ b/src/sbbs3/ars_defs.h @@ -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 2005 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2006 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 * @@ -111,6 +111,9 @@ enum { /* Access requirement binaries */ ,AR_PROT ,AR_GUEST ,AR_QNODE + ,AR_ACTIVE + ,AR_INACTIVE + ,AR_DELETED }; #endif /* Don't add anything after this line */ diff --git a/src/sbbs3/chk_ar.cpp b/src/sbbs3/chk_ar.cpp index 2467abd08f..b079e82225 100644 --- a/src/sbbs3/chk_ar.cpp +++ b/src/sbbs3/chk_ar.cpp @@ -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 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2006 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 * @@ -179,6 +179,21 @@ bool sbbs_t::ar_exp(uchar **ptrptr, user_t* user) result=!_not; #endif break; + case AR_ACTIVE: + if(user->misc&(DELETED|INACTIVE)) + result=_not; + else result=!_not; + break; + case AR_INACTIVE: + if(!(user->misc&INACTIVE)) + result=_not; + else result=!_not; + break; + case AR_DELETED: + if(!(user->misc&DELETED)) + result=_not; + else result=!_not; + break; case AR_EXPERT: if(!(user->misc&EXPERT)) result=_not; diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c index bf14b8f3dd..02afc8f595 100644 --- a/src/sbbs3/userdat.c +++ b/src/sbbs3/userdat.c @@ -1425,6 +1425,21 @@ static BOOL ar_exp(scfg_t* cfg, uchar **ptrptr, user_t* user) result=!not; #endif break; + case AR_ACTIVE: + if(user==NULL || user->misc&(DELETED|INACTIVE)) + result=not; + else result=!not; + break; + case AR_INACTIVE: + if(user==NULL || !(user->misc&INACTIVE)) + result=not; + else result=!not; + break; + case AR_DELETED: + if(user==NULL || !(user->misc&DELETED)) + result=not; + else result=!not; + break; case AR_EXPERT: if(user==NULL || !(user->misc&EXPERT)) result=not; -- GitLab