diff --git a/README b/README index d4460d67..b3bf184f 100644 --- a/README +++ b/README @@ -393,6 +393,14 @@ SERVER_INFOLINE [REQUIRED] SERVER_INFOLINE Network Auxiliary Services +SERVER_NUMERIC [RECOMMENDED] + Specify the numeric of the server to send on connect. + This must be a value between 1 and 254, and must not be in use by + any other IRC server on the network. + Currently only Unreal IRCd uses this option. + + SERVER_NUMERIC 1 + STATSERV_NETNAME [REQUIRED] Your network name, if unknown refer to your network file. Does not apply to all IRCDs e.g. diff --git a/conf.c b/conf.c index c51d052f..816a947d 100644 --- a/conf.c +++ b/conf.c @@ -58,7 +58,8 @@ static config_option options[] = { {"ONLY_OPERS", ARG_STR, cb_Server, 11}, {"NO_LOAD", ARG_STR, cb_Server, 12}, {"BINDTO", ARG_STR, cb_Server, 13}, - {"LOGFILENAMEFORMAT", ARG_STR, cb_Server, 14} + {"LOGFILENAMEFORMAT", ARG_STR, cb_Server, 14}, + {"SERVER_NUMERIC", ARG_STR, cb_Server, 15}, }; @@ -240,6 +241,13 @@ cb_Server (char *arg, int configtype) memcpy (me.local, arg, sizeof (me.local)); } else if (configtype == 14) { strncpy(LogFileNameFormat,arg,MAX_LOGFILENAME); + } else if (configtype == 15) { + me.numeric = atoi (arg); + /* limit value - really need to print error and quit */ + if(me.numeric<=0) + me.numeric=1; + if(me.numeric>254) + me.numeric=254; } } diff --git a/main.c b/main.c index cebc4cc5..2001e1ca 100644 --- a/main.c +++ b/main.c @@ -131,6 +131,7 @@ main (int argc, char *argv[]) me.coder_debug = 0; me.noticelag = 0; me.r_time = 10; + me.numeric = 1; me.lastmsg = time (NULL); me.SendM = me.SendBytes = me.RcveM = me.RcveBytes = 0; me.synced = 0; @@ -529,7 +530,7 @@ static void login (void) { SET_SEGV_LOCATION(); - slogin_cmd (me.name, 1, me.infoline, me.pass); + slogin_cmd (me.name, me.numeric, me.infoline, me.pass); sprotocol_cmd ("TOKEN CLIENT"); } diff --git a/makeconf b/makeconf index 181b6a0d..61e7a42a 100755 --- a/makeconf +++ b/makeconf @@ -5,6 +5,7 @@ TIME=`date +"%H:%M:%S %Z"` DATE=`date +"%a, %b %e %Y"` STATSCONF="neostats.cfg" SERVNAME="stats.somenet.net" +SERVNUMERIC="1" COMMENT="NeoStats 2.5 IRC Statistical Server!" LINKPORT="6667" LINKSERVER="127.0.0.1" @@ -303,6 +304,16 @@ CONNECT_PASS $LINKPASS SERVER_INFOLINE "$COMMENT" +# SERVER_NUMERIC [RECOMMENDED] +# Specify the numeric of the server to send on connect. +# This must be a value between 1 and 254, and must not be in use by +# any other IRC server on the network. +# Currently only Unreal IRCd uses this option. +# +# SERVER_NUMERIC 1 + +SERVER_NUMERIC "$SERVNUMERIC" + # STATSERV_NETNAME [REQUIRED] # Your network name, if unknown refer to your network file. Does not # apply to all IRCDs e.g. diff --git a/stats.h b/stats.h index a4fb7646..1b733655 100644 --- a/stats.h +++ b/stats.h @@ -182,6 +182,7 @@ struct me { int port; int r_time; int lag_time; + int numeric; /* For Unreal and any other server that needs a numeric */ char uplink[MAXHOST]; char pass[MAXPASS]; char services_name[MAXHOST];