X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/9bafc40df91539963591e7f114012c2f5635e7e3..f71a53ab6e251712c26a11c0b373d41014f775d5:/gameserv/flags.h diff --git a/gameserv/flags.h b/gameserv/flags.h index 7c895c7..64a5730 100644 --- a/gameserv/flags.h +++ b/gameserv/flags.h @@ -1,6 +1,8 @@ #ifndef FLAGS_H #define FLAGS_H +#include "extern.h" + /* This file contains all the flags used in the aClient and Player classes. * More flags can be added simply by going up in multiples of 2. * ie. 0001 0002 0004 0008 0010 0020 0040 0080 0100 0200 0400 0800 1000 2000 4000 @@ -27,27 +29,59 @@ */ // aClient FLAGS ONLY -#define FLAG_ADMIN 0x0001 -#define FLAG_IGNORE 0x0002 -#define FLAG_PLAYING 0x0004 +#define FLAG_ADMIN 0x00000001 +#define FLAG_IGNORE 0x00000002 +#define FLAG_PLAYING 0x00000004 // PLAYER FLAGS ONLY -#define FLAG_MASTER 0x0001 -#define FLAG_ALIVE 0x0002 -#define FLAG_YOURTURN 0x0004 -#define FLAG_WONGAME 0x0008 +#define FLAG_MASTER 0x00000001 +#define FLAG_ALIVE 0x00000002 +#define FLAG_YOURTURN 0x00000004 +#define FLAG_WONGAME 0x00000008 +#define FLAG_DRAGONFIGHT 0x00000010 +#define FLAG_TIMEDOUT 0x00000020 // Config File flags -#define CFLAG_LISTENONCF 0x0001 -#define CFLAG_USEPRIVMSG 0x0002 - -#define setListenOnCF(x) (x |= CFLAG_LISTENONCF) -#define clearListenOnCF(x) (x &= ~CFLAG_LISTENONCF) -#define isListenonCF(x) (x & CFLAG_LISTENONCF) - -#define setUsePrivmsg(x) (x |= CFLAG_USEPRIVMSG) -#define clearUsePrivmsg(x) (x &= ~CFLAG_USEPRIVMSG) -#define isUsePrivmsg(x) (x & CFLAG_USEPRIVMSG) +#define CFLAG_LISTENONCF 0x00000001 +#define CFLAG_USEPRIVMSG 0x00000002 +#define CFLAG_BOPER 0x00000004 +#define CFLAG_WELCOME 0x00000008 +#define CFLAG_SAVEDNOTICE 0x00000010 +#define CFLAG_USENICKSERV 0x00000020 +#define CFLAG_ROLLOVERFORESTFIGHTS 0x00000040 +#define CFLAG_FAIRFIGHTS 0x00000080 + +#define setFairFights() (configflags |= CFLAG_FAIRFIGHTS) +#define clearFairFights() (configflags &= ~CFLAG_FAIRFIGHTS) +#define isFairFights() (configflags & CFLAG_FAIRFIGHTS) + +#define setRolloverForestFights() (configflags |= CFLAG_ROLLOVERFORESTFIGHTS) +#define clearRolloverForestFights() (configflags &= ~CFLAG_ROLLOVERFORESTFIGHTS) +#define isRolloverForestFights() (configflags & CFLAG_ROLLOVERFORESTFIGHTS) + +#define setUseNickServ() (configflags |= CFLAG_USENICKSERV) +#define clearUseNickServ() (configflags &= ~CFLAG_USENICKSERV) +#define isUseNickServ() (configflags & CFLAG_USENICKSERV) + +#define setSavedNotice() (configflags |= CFLAG_SAVEDNOTICE) +#define clearSavedNotice() (configflags &= ~CFLAG_SAVEDNOTICE) +#define isSavedNotice() (configflags & CFLAG_SAVEDNOTICE) + +#define setWelcome() (configflags |= CFLAG_WELCOME) +#define clearWelcome() (configflags &= ~CFLAG_WELCOME) +#define isWelcome() (configflags & CFLAG_WELCOME) + +#define setListenOnCF() (configflags |= CFLAG_LISTENONCF) +#define clearListenOnCF() (configflags &= ~CFLAG_LISTENONCF) +#define isListenOnCF() (configflags & CFLAG_LISTENONCF) + +#define setUsePrivmsg() (configflags |= CFLAG_USEPRIVMSG) +#define clearUsePrivmsg() (configflags &= ~CFLAG_USEPRIVMSG) +#define isUsePrivmsg() (configflags & CFLAG_USEPRIVMSG) + +#define setBOper() (configflags |= CFLAG_BOPER) +#define clearBOPer() (configflags &= ~CFLAG_BOPER) +#define isBOper() (configflags & CFLAG_BOPER) // aClient flags // #define ADMIN_FLAGS(FLAG_ONE | FLAG_TWO | FLAG_ETC) @@ -68,6 +102,10 @@ #define FL_is_playing(x) ((x)->getFlags() & FLAG_PLAYING) // Player Flags +#define PF_timedout(x) ((x)->getFlags() & FLAG_TIMEDOUT) +#define PF_settimedout(x) ((x)->addFlag(FLAG_TIMEDOUT)) +#define PF_cleartimedout(x) ((x)->remFlag(FLAG_TIMEDOUT)) + #define seenMaster(x) ((x)->getFlags() & FLAG_MASTER) #define setMaster(x) ((x)->addFlag(FLAG_MASTER)) #define clearMaster(x) ((x)->remFlag(FLAG_MASTER)) @@ -84,4 +122,8 @@ #define setWonGame(x) ((x)->addFlag(FLAG_WONGAME)) #define clearWonGame(x) ((x)->remFlag(FLAG_WONGAME)) +#define isDragonFight(x) ((x)->getFlags() & FLAG_DRAGONFIGHT) +#define setDragonFight(x) ((x)->addFlag(FLAG_DRAGONFIGHT)) +#define clearDragonFight(x) ((x)->remFlag(FLAG_DRAGONFIGHT)) + #endif