Back on the UnrealIRCd forums, after a decade in hiatus
(I made some posts in 2005)
I'm making a module, where I'm trying to parse the numeric UMODE values received by HOOKTYPE_UMODE_CHANGE to a string, like "+iw-s". (112 to 101)
I have no trouble using the built-in UMODE constants, like UMODE_INVISIBLE, UMODE_OPER, etc.
The problem occurs, when I want to use the UMODE constants added by modules in modules/usermodes/, like UMODE_PRIVACY, UMODE_SHOWWHOIS, etc.
I've siphoned the source for all the addon UMODE constants, and none of them, seem to be used anywhere outside the modules in which they are defined, so I'm thinking there may be a better way to do this, than having to hardcode all these constants and string values anyway.
Right now, I'm just trying to get a complete list of UMODE numeric values for debugging purposes.
These work fine:
Code: Select all
sendnotice(sptr, "i %d", UMODE_INVISIBLE);
sendnotice(sptr, "o %d", UMODE_OPER);
sendnotice(sptr, "w %d", UMODE_WALLOP);
sendnotice(sptr, "r %d", UMODE_REGNICK);
sendnotice(sptr, "s %d", UMODE_SERVNOTICE);
sendnotice(sptr, "x %d", UMODE_HIDE);
sendnotice(sptr, "z %d", UMODE_SECURE);
sendnotice(sptr, "d %d", UMODE_DEAF);
sendnotice(sptr, "H %d", UMODE_HIDEOPER);
sendnotice(sptr, "t %d", UMODE_SETHOST);
sendnotice(sptr, "I %d", UMODE_HIDLE);
Code: Select all
i 1
o 2
w 4
r 8
s 16
x 32
z 64
d 128
H 256
t 512
I 1024
Code: Select all
sendnotice(sptr, "p %d", UMODE_PRIVACY);
sendnotice(sptr, "S %d", UMODE_SERVICEBOT);
sendnotice(sptr, "W %d", UMODE_SHOWWHOIS);
sendnotice(sptr, "T %d", UMODE_NOCTCP);
sendnotice(sptr, "G %d", UMODE_CENSOR);
sendnotice(sptr, "B %d", UMODE_BOT);
sendnotice(sptr, "R %d", UMODE_REGONLYMSG);
sendnotice(sptr, "q %d", UMODE_NOKICK);
Code: Select all
testmodule.c: In function ‘user_mode’:
testmodule.c:351:28: error: ‘UMODE_PRIVACY’ undeclared (first use in this function)
sendnotice(sptr, "p %d", UMODE_PRIVACY);
^
testmodule.c:351:28: note: each undeclared identifier is reported only once for each function it appears in
testmodule.c:352:28: error: ‘UMODE_SERVICEBOT’ undeclared (first use in this function)
sendnotice(sptr, "S %d", UMODE_SERVICEBOT);
^
testmodule.c:353:28: error: ‘UMODE_SHOWWHOIS’ undeclared (first use in this function)
sendnotice(sptr, "W %d", UMODE_SHOWWHOIS);
^
testmodule.c:354:28: error: ‘UMODE_NOCTCP’ undeclared (first use in this function)
sendnotice(sptr, "T %d", UMODE_NOCTCP);
^
testmodule.c:355:28: error: ‘UMODE_CENSOR’ undeclared (first use in this function)
sendnotice(sptr, "G %d", UMODE_CENSOR);
^
testmodule.c:356:28: error: ‘UMODE_BOT’ undeclared (first use in this function)
sendnotice(sptr, "B %d", UMODE_BOT);
^
testmodule.c:357:28: error: ‘UMODE_REGONLYMSG’ undeclared (first use in this function)
sendnotice(sptr, "R %d", UMODE_REGONLYMSG);
^
testmodule.c:358:28: error: ‘UMODE_NOKICK’ undeclared (first use in this function)
sendnotice(sptr, "q %d", UMODE_NOKICK);
^
Best regards
-John