[NeoStats-Devel] [Commits] r2524 - in trunk: include src src/protocol

[email protected]
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Mark
Date: Mon Apr 18 05:51:47 2005
New Revision: 2524

Modified:
   trunk/include/ircd.h
   trunk/src/ircd.c
   trunk/src/protocol/bahamut14.c
   trunk/src/protocol/bahamut18.c
   trunk/src/protocol/client.c
   trunk/src/protocol/hybrid7.c
   trunk/src/protocol/plexus.c
   trunk/src/protocol/protocol.txt
   trunk/src/protocol/ultimate2.c
   trunk/src/protocol/ultimate3.c
   trunk/src/protocol/unreal31.c
   trunk/src/protocol/unreal32.c
Log:
more protocol updates

Modified: trunk/include/ircd.h
==============================================================================
--- trunk/include/ircd.h	(original)
+++ trunk/include/ircd.h	Mon Apr 18 05:51:47 2005
@@ -89,6 +89,10 @@
 MODULEVAR extern const char TOK_WALLOPS[];
 MODULEVAR extern const char MSG_GLOBOPS[];
 MODULEVAR extern const char TOK_GLOBOPS[];
+MODULEVAR extern const char MSG_NICK[];
+MODULEVAR extern const char TOK_NICK[];
+MODULEVAR extern const char MSG_MODE[];
+MODULEVAR extern const char TOK_MODE[];
 MODULEVAR extern const char MSG_QUIT[];
 MODULEVAR extern const char TOK_QUIT[];
 MODULEVAR extern const char MSG_JOIN[];
@@ -103,8 +107,12 @@
 MODULEVAR extern const char TOK_PING[];
 MODULEVAR extern const char MSG_PONG[];
 MODULEVAR extern const char TOK_PONG[];
+MODULEVAR extern const char MSG_SERVER[];
+MODULEVAR extern const char TOK_SERVER[];
 MODULEVAR extern const char MSG_SQUIT[];
 MODULEVAR extern const char TOK_SQUIT[];
+MODULEVAR extern const char MSG_SVINFO[];
+MODULEVAR extern const char TOK_SVINFO[];
 MODULEVAR extern const char MSG_KILL[];
 MODULEVAR extern const char TOK_KILL[];
 MODULEVAR extern const char MSG_SETNAME[];
@@ -239,7 +247,7 @@
 MODULEFUNC void send_sjoin( const char *source, const char *who, const char *chan, const unsigned long ts );
 MODULEFUNC void send_part( const char *source, const char *chan, const char *reason );
 MODULEFUNC void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts );
-MODULEFUNC void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts );
+MODULEFUNC void send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts );
 MODULEFUNC void send_quit( const char *source, const char *quitmsg );
 MODULEFUNC void send_kill( const char *source, const char *target, const char *reason );
 MODULEFUNC void send_kick( const char *source, const char *chan, const char *target, const char *reason );

Modified: trunk/src/ircd.c
==============================================================================
--- trunk/src/ircd.c	(original)
+++ trunk/src/ircd.c	Mon Apr 18 05:51:47 2005
@@ -91,6 +91,9 @@
 static void _send_notice( const char *source, const char *target, const char *buf );
 static void _send_wallops( const char *source, const char *buf );
 static void _send_globops( const char *source, const char *buf );
+static void _send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts );
+static void _send_umode( const char *source, const char *target, const char *mode );
+static void _send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts );
 static void _send_join( const char *source, const char *chan, const char *key, const unsigned long ts );
 static void _send_part( const char *source, const char *chan, const char *reason );
 static void _send_kick( const char *source, const char *chan, const char *target, const char *reason );
@@ -98,7 +101,9 @@
 static void _send_quit( const char *source, const char *quitmsg );
 static void _send_ping( const char *source, const char *reply, const char *target );
 static void _send_pong( const char *reply );
+static void _send_server( const char *source, const char *name, const int numeric, const char *infoline );
 static void _send_squit( const char *server, const char *quitmsg );
+static void _send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow );
 static void _send_kill( const char *source, const char *target, const char *reason );
 static void _send_setname( const char *nick, const char *realname );
 static void _send_sethost( const char *nick, const char *host );
@@ -114,13 +119,13 @@
 static void( *irc_send_globops )( const char *source, const char *buf );
 static void( *irc_send_wallops )( const char *source, const char *buf );
 static void( *irc_send_numeric )( const char *source, const int numeric, const char *target, const char *buf );
+static void( *irc_send_quit )( const char *source, const char *quitmsg );
 static void( *irc_send_umode )( const char *source, const char *target, const char *mode );
 static void( *irc_send_join )( const char *source, const char *chan, const char *key, const unsigned long ts );
 static void( *irc_send_sjoin )( const char *source, const char *who, const char *chan, const unsigned long ts );
 static void( *irc_send_part )( const char *source, const char *chan, const char *reason );
 static void( *irc_send_nickchange )( const char *oldnick, const char *newnick, const unsigned long ts );
-static void( *irc_send_cmode )( const char *source, const char *who, const char *chan, const char *mode, const char *args, unsigned long ts );
-static void( *irc_send_quit )( const char *source, const char *quitmsg );
+static void( *irc_send_cmode )( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, unsigned long ts );
 static void( *irc_send_kill )( const char *source, const char *target, const char *reason );
 static void( *irc_send_kick )( const char *source, const char *chan, const char *target, const char *reason );
 static void( *irc_send_invite )( const char *source, const char *to, const char *chan );
@@ -167,6 +172,10 @@
 static char *TOK_WALLOPS;
 static char *MSG_GLOBOPS;
 static char *TOK_GLOBOPS;
+static char *MSG_NICK;
+static char *TOK_NICK;
+static char *MSG_MODE;
+static char *TOK_MODE;
 static char *MSG_QUIT;
 static char *TOK_QUIT;
 static char *MSG_JOIN;
@@ -181,8 +190,12 @@
 static char *TOK_PING;
 static char *MSG_PONG;
 static char *TOK_PONG;
+static char *MSG_SERVER;
+static char *TOK_SERVER;
 static char *MSG_SQUIT;
 static char *TOK_SQUIT;
+static char *MSG_SVINFO;
+static char *TOK_SVINFO;
 static char *MSG_KILL;
 static char *TOK_KILL;
 static char *MSG_SETNAME;
@@ -208,14 +221,19 @@
 	{( void * )&irc_send_notice, &MSG_NOTICE, "MSG_NOTICE", &TOK_NOTICE, "TOK_NOTICE", _send_notice, 0 },
 	{( void * )&irc_send_wallops, &MSG_WALLOPS, "MSG_WALLOPS", &TOK_WALLOPS, "TOK_WALLOPS", _send_wallops, 0 },
 	{( void * )&irc_send_globops, &MSG_GLOBOPS, "MSG_GLOBOPS", &TOK_GLOBOPS, "TOK_GLOBOPS", _send_globops, 0 },
+	{( void * )&irc_send_nickchange, &MSG_NICK, "MSG_NICK", &TOK_NICK, "TOK_NICK", _send_nickchange, 0 },
+	{( void * )&irc_send_umode, &MSG_MODE, "MSG_MODE", &TOK_MODE, "TOK_MODE", _send_umode, 0 },
+	{( void * )&irc_send_cmode, &MSG_MODE, "MSG_MODE", &TOK_MODE, "TOK_MODE", _send_cmode, 0 },
+	{( void * )&irc_send_quit, &MSG_QUIT, "MSG_QUIT", &TOK_QUIT, "TOK_QUIT", _send_quit, 0 },
 	{( void * )&irc_send_join, &MSG_JOIN, "MSG_JOIN", &TOK_JOIN, "TOK_JOIN", _send_join, 0 },
 	{( void * )&irc_send_part, &MSG_PART, "MSG_PART", &TOK_PART, "TOK_PART", _send_part, 0 },
 	{( void * )&irc_send_kick, &MSG_KICK, "MSG_KICK", &TOK_KICK, "TOK_KICK", _send_kick, 0 },
 	{( void * )&irc_send_invite, &MSG_INVITE, "MSG_INVITE", &TOK_INVITE, "TOK_INVITE", _send_invite, 0 },
-	{( void * )&irc_send_quit, &MSG_QUIT, "MSG_QUIT", &TOK_QUIT, "TOK_QUIT", _send_quit, 0 },
 	{( void * )&irc_send_ping, &MSG_PING, "MSG_PING", &TOK_PING, "TOK_PING", _send_ping, 0 },
 	{( void * )&irc_send_pong, &MSG_PONG, "MSG_PONG", &TOK_PONG, "TOK_PONG", _send_pong, 0 },
+	{( void * )&irc_send_server, &MSG_SERVER, "MSG_SERVER", &TOK_SERVER, "TOK_SERVER", _send_server, 0 },
 	{( void * )&irc_send_squit, &MSG_SQUIT, "MSG_SQUIT", &TOK_SQUIT, "TOK_SQUIT", _send_squit, 0 },
+	{( void * )&irc_send_svinfo, &MSG_SVINFO, "MSG_SVINFO", &TOK_SVINFO, "TOK_SVINFO", _send_svinfo, 0 },
 	{( void * )&irc_send_kill, &MSG_KILL, "MSG_KILL", &TOK_KILL, "TOK_KILL", _send_kill, 0 },
 	{( void * )&irc_send_setname, &MSG_SETNAME, "MSG_SETNAME", &TOK_SETNAME, "TOK_SETNAME", _send_setname, 0 },
 	{( void * )&irc_send_sethost, &MSG_SETHOST, "MSG_SETHOST", &TOK_SETHOST, "TOK_SETHOST", _send_sethost, 0 },
@@ -3096,6 +3114,21 @@
 	send_cmd( ":%s %s %s %s", source, MSGTOK( INVITE ), target, chan );
 }
 
+static void _send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
+{
+	send_cmd( ":%s %s %s %lu", oldnick, MSG_NICK, newnick, ts );
+}
+
+static void _send_umode( const char *source, const char *target, const char *mode )
+{
+	send_cmd( ":%s %s %s :%s", source, MSGTOK( MODE ), target, mode );
+}
+
+static void _send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts )
+{
+	send_cmd( ":%s %s %s %s %s %lu", sourceserver, MSGTOK( MODE ), chan, mode, args, ts );
+}
+
 static void _send_quit( const char *source, const char *quitmsg )
 {
 	send_cmd( ":%s %s :%s", source, MSGTOK( QUIT ), quitmsg );
@@ -3111,11 +3144,21 @@
 	send_cmd( "%s %s", MSGTOK( PONG ), reply );
 }
 
+static void _send_server( const char *source, const char *name, const int numeric, const char *infoline )
+{
+	send_cmd( ":%s %s %s %d :%s", source, MSGTOK( SERVER ), name, numeric, infoline );
+}
+
 static void _send_squit( const char *server, const char *quitmsg )
 {
 	send_cmd( "%s %s :%s", MSGTOK( SQUIT ), server, quitmsg );
 }
 
+static void _send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow )
+{
+	send_cmd( "%s %d %d 0 :%lu", MSGTOK( SVINFO ), tscurrent, tsmin, tsnow );
+}
+
 static void _send_kill( const char *source, const char *target, const char *reason )
 {
 	send_cmd( ":%s %s %s :%s", source, MSGTOK(KILL), target, reason );

Modified: trunk/src/protocol/bahamut14.c
==============================================================================
--- trunk/src/protocol/bahamut14.c	(original)
+++ trunk/src/protocol/bahamut14.c	Mon Apr 18 05:51:47 2005
@@ -136,11 +136,6 @@
 	{0, 0},
 };
 
-void send_server( const char* source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSG_SERVER, name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 	send_cmd( "%s %s :TS", MSG_PASS, pass );
@@ -153,26 +148,11 @@
 	send_cmd( ":%s %s %lu %s + :%s", source, MSG_SJOIN, ts, chan, target );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %s %s %lu", source, MSG_MODE, chan, mode, args, ts );
-}
-
 void send_nick( const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname )
 {
 	send_cmd( "%s %s 1 %lu %s %s %s %s 0 %lu :%s", MSG_NICK, nick, ts, newmode, ident, host, server, ts, realname );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSG_MODE, target, mode );
-}
-
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSG_NICK, newnick, ts );
-}
-
 void send_akill( const char *source, const char *host, const char *ident, const char *setby, const unsigned long length, const char *reason, const unsigned long ts )
 {
 	send_cmd( ":%s %s %s %s %lu %s %lu :%s", source, MSG_AKILL, host, ident, length, setby, ts, reason );
@@ -183,11 +163,6 @@
 	send_cmd( ":%s %s %s %s", source, MSG_RAKILL, host, ident );
 }
 
-void send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow )
-{
-	send_cmd( "%s %d %d 0 :%lu", MSG_SVINFO, tscurrent, tsmin, tsnow );
-}
-
 void send_burst( int b )
 {
 	if( b == 0 )

Modified: trunk/src/protocol/bahamut18.c
==============================================================================
--- trunk/src/protocol/bahamut18.c	(original)
+++ trunk/src/protocol/bahamut18.c	Mon Apr 18 05:51:47 2005
@@ -134,11 +134,6 @@
 	{0, 0},
 };
 
-void send_server( const char* source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSG_SERVER, name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 	send_cmd( "%s %s :TS", MSG_PASS, pass );
@@ -151,26 +146,11 @@
 	send_cmd( ":%s %s %lu %s + :%s", source, MSG_SJOIN, ts, chan, target );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %s %s %lu", source, MSG_MODE, chan, mode, args, ts );
-}
-
 void send_nick( const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname )
 {
 	send_cmd( "%s %s 1 %lu %s %s %s %s 0 %lu :%s", MSG_NICK, nick, ts, newmode, ident, host, server, ts, realname );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSG_MODE, target, mode );
-}
-
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSG_NICK, newnick, ts );
-}
-
 void send_akill( const char *source, const char *host, const char *ident, const char *setby, const unsigned long length, const char *reason, const unsigned long ts )
 {
 	send_cmd( ":%s %s %s %s %lu %s %lu :%s", source, MSG_AKILL, host, ident, length, setby, ts, reason );
@@ -181,11 +161,6 @@
 	send_cmd( ":%s %s %s %s", source, MSG_RAKILL, host, ident );
 }
 
-void send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow )
-{
-	send_cmd( "%s %d %d 0 :%lu", MSG_SVINFO, tscurrent, tsmin, tsnow );
-}
-
 void send_burst( int b )
 {
 	if( b == 0 ) {

Modified: trunk/src/protocol/client.c
==============================================================================
--- trunk/src/protocol/client.c	(original)
+++ trunk/src/protocol/client.c	Mon Apr 18 05:51:47 2005
@@ -151,9 +151,9 @@
 	send_cmd( "%s %s %d %d :%s", MSG_USER, "user",( int ) me.now,( int ) me.now, "real name" );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
+void send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts )
 {
-	send_cmd( ":%s %s %s %s %s %lu", who, MSG_MODE, chan, mode, args, ts );
+	send_cmd( ":%s %s %s %s %s %lu", sourceuser, MSG_MODE, chan, mode, args, ts );
 }
 
 void send_nick( const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname )
@@ -161,16 +161,6 @@
 	send_cmd( "%s %s", MSG_NICK, nick );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSG_MODE, target, mode );
-}
-
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s", oldnick, MSG_NICK, newnick );
-}
-
 void send_swhois( const char *source, const char *target, const char *swhois )
 {
 	send_cmd( "%s %s :%s", MSG_SWHOIS, target, swhois );

Modified: trunk/src/protocol/hybrid7.c
==============================================================================
--- trunk/src/protocol/hybrid7.c	(original)
+++ trunk/src/protocol/hybrid7.c	Mon Apr 18 05:51:47 2005
@@ -128,11 +128,6 @@
 	send_cmd( ":%s %s", server, MSG_EOB );
 }
 
-void send_server( const char *source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSG_SERVER, name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 	send_cmd( "%s %s :TS", MSG_PASS, pass );
@@ -149,9 +144,9 @@
 	send_cmd( ":%s %s %lu %s + :%s", source, MSG_SJOIN, ts, chan, target );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
+void send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts )
 {
-	send_cmd( ":%s %s %s %s %s %lu", who, MSG_MODE, chan, mode, args, ts );
+	send_cmd( ":%s %s %s %s %s %lu", sourceuser, MSG_MODE, chan, mode, args, ts );
 }
 
 void send_nick( const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname )
@@ -159,11 +154,6 @@
 	send_cmd( "%s %s 1 %lu %s %s %s %s :%s", MSG_NICK, nick, ts, newmode, ident, host, server, realname );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSG_MODE, target, mode );
-}
-
 void send_snetinfo( const char* source, const int prot, const char* cloak, const char* netname, const unsigned long ts )
 {
 	send_cmd( ":%s %s 0 %lu %d %s 0 0 0 :%s", source, MSG_SNETINFO, ts, prot, cloak, netname );
@@ -174,16 +164,6 @@
 	send_cmd( ":%s %s 0 %lu %d %s 0 0 0 :%s", source, MSG_NETINFO, ts, prot, cloak, netname );
 }
 
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSG_NICK, newnick, ts );
-}
-
-void send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow )
-{
-	send_cmd( "%s %d %d 0 :%lu", MSG_SVINFO, tscurrent, tsmin, tsnow );
-}
-
 /* there isn't an akill on Hybrid, so we send a kline to all servers! */
 void send_akill( const char *source, const char *host, const char *ident, const char *setby, const unsigned long length, const char *reason, const unsigned long ts )
 {

Modified: trunk/src/protocol/plexus.c
==============================================================================
--- trunk/src/protocol/plexus.c	(original)
+++ trunk/src/protocol/plexus.c	Mon Apr 18 05:51:47 2005
@@ -128,11 +128,6 @@
 	send_cmd( ":%s %s", server, MSG_EOB );
 }
 
-void send_server( const char *source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSG_SERVER, name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 	send_cmd( "%s %s :TS", MSG_PASS, pass );
@@ -149,9 +144,9 @@
 	send_cmd( ":%s %s %lu %s + :%s", source, MSG_SJOIN, ts, chan, target );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
+void send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts )
 {
-	send_cmd( ":%s %s %s %s %s %lu", who, MSG_MODE, chan, mode, args, ts );
+	send_cmd( ":%s %s %s %s %s %lu", sourceuser, MSG_MODE, chan, mode, args, ts );
 }
 
 void send_nick( const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname )
@@ -159,11 +154,6 @@
 	send_cmd( "%s %s 1 %lu %s %s %s %s :%s", MSG_NICK, nick, ts, newmode, ident, host, server, realname );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSG_MODE, target, mode );
-}
-
 void send_snetinfo( const char* source, const int prot, const char* cloak, const char* netname, const unsigned long ts )
 {
 	send_cmd( ":%s %s 0 %lu %d %s 0 0 0 :%s", source, MSG_SNETINFO, ts, prot, cloak, netname );
@@ -174,16 +164,6 @@
 	send_cmd( ":%s %s 0 %lu %d %s 0 0 0 :%s", source, MSG_NETINFO, ts, prot, cloak, netname );
 }
 
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSG_NICK, newnick, ts );
-}
-
-void send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow )
-{
-	send_cmd( "%s %d %d 0 :%lu", MSG_SVINFO, tscurrent, tsmin, tsnow );
-}
-
 /* there isn't an akill on Hybrid, so we send a kline to all servers! */
 void send_akill( const char *source, const char *host, const char *ident, const char *setby, const unsigned long length, const char *reason, const unsigned long ts )
 {

Modified: trunk/src/protocol/protocol.txt
==============================================================================
--- trunk/src/protocol/protocol.txt	(original)
+++ trunk/src/protocol/protocol.txt	Mon Apr 18 05:51:47 2005
@@ -31,24 +31,36 @@
 -----------------------------------<>-----------------------------------
 Messages and Tokens
 
-IRC messages are specifically formatted with the command embedded in the
-string in the form of a specific message or token. Many of these are 
-specific to a particular IRCd so must be provided by the module. You can
-usually find the messages in the IRCd source code in the file msg.h or 
-similar.
+IRC messages are formatted with the command embedded in the string in 
+the form of a specific message or token. Many of these are specific to a
+particular IRCd so must be provided by the module. You can usually find 
+the messages in the IRCd source code in the file msg.h or similar.
 
 An example is:
-#define MSG_PRIVATE	"PRIVMSG"	/* PRIV */
-#define TOK_PRIVATE	"!"	/* 33 */
+#define MSG_PRIVATE	"PRIVMSG"
+#define TOK_PRIVATE	"!"
 
-These are usually placed in a protocol specific header file.
+For NeoStats use you can cut and paste these defines into your protocol
+source file but you should format them as:
+
+const char MSG_PRIVATE[] = "PRIVMSG";
+const char TOK_PRIVATE[] = "!";
+
+This allows NeoStats to access the messages and tokens used when your
+module loads and allows NeoStats to provide default handlers for many
+common commands.
 
 -----------------------------------<>-----------------------------------
 Modes
 
 NeoStats provides a set of defines for common user and channel modes 
 supported by NeoStats. Those not supported must be provided by the 
-module. 
+module. You should create these for all modes not supported by NeoStats 
+that are supported by your IRCd. The defines must follow a bit mask.
+
+NeoStats reserves user mode bitmasks up to 0x01000000 and channel mode
+bitmasks up to 0x00040000 so you must start custom masks at 0x02000000
+and 0x00080000 respectively.
 
 An example user mode is:
 #define UMODE_FAILOP		0x00200000
@@ -56,8 +68,6 @@
 An example channel mode is:
 #define CMODE_NOCTCP		0x10000000
 
-These are usually placed in a protocol specific header file.
-
 -----------------------------------<>-----------------------------------
 ProtocolInfo definition
 
@@ -65,20 +75,22 @@
 protocol module. An example follows:
 
 ProtocolInfo protocol_info = {
-	/* Protocol options required by this IRCd */
+	/* Required protocol options */
 	PROTOCOL_SJOIN,
-	/* Protocol options negotiated at link by this IRCd */
+	/* Protocol options negotiated at link */
 	PROTOCOL_TOKEN,
-	/* Features supported by this IRCd */
+	/* Features supported */
 	FEATURE_UMODECLOAK,
+	/* Default operator modes for NeoStats service bots */
 	"+oSq",
+	/* Default channel mode for NeoStats service bots */
 	"+o",
 };
 
 -----------------------------------<>-----------------------------------
 Command list
 
-This is parsed by NeoStats when we receive a message from an IRCd server
+This is parsed by NeoStats when we receive a message from an IRC server
 in order to handle the message and is formatted as follows.
 
 ircd_cmd cmd_list[] = {
@@ -87,6 +99,12 @@
 	{0, 0, 0, 0},
 };
 
+NeoStats provides some basic handlers for IRCds which follow common
+formats for commands and you can direct many of these messages to these
+basic handlers. If your IRCd uses a different format, you must provide
+your own function to parse the message and then pass to NeoStats. This
+is discussed later in this file.
+
 -----------------------------------<>-----------------------------------
 Mode tables
 
@@ -121,6 +139,10 @@
 	{0, 0, 0},
 };
 
+NeoStats provides default mode tables for modes supported by all ircds
+e.g. channel operators and user invisible mode so you need only list
+the modes that are not in the default list.
+
 -----------------------------------<>-----------------------------------
 Command processing functions
 
@@ -137,9 +159,9 @@
 
 An example follows.
 
-static void m_sethost (char *origin, char **argv, int argc, int srv)
+static void m_sethost( char *origin, char **argv, int argc, int srv )
 {
-	do_sethost(origin, argv[0]);
+	do_sethost( origin, argv[0] );
 }
 
 -----------------------------------<>-----------------------------------
@@ -153,8 +175,7 @@
 
 An example follows:
 
-void 
-send_part (const char *source, const char *chan)
+void send_part (const char *source, const char *chan)
 {
 	send_cmd (":%s %s %s", source, MSG_PART, chan);
 }
@@ -162,14 +183,18 @@
 If your IRCd supports tokens, we provide a helper macro to choose
 the message or token when appropriate which is used as follows:
 
-void 
-send_part (const char *source, const char *chan)
+void send_part (const char *source, const char *chan)
 {
 	send_cmd (":%s %s %s", source, MSGTOK(PART), chan);
 }
 
+NeoStats provides some common handlers for basic functions that are
+similar across all ircds. If your ircd uses a different format for a
+command, you must provide this handler or NeoStats will try to use it's
+internal handler which may cause problems on the network. 
+
 -----------------------------------<>-----------------------------------
 
 ************************************************************************
-** This document was last updated on August 27th, 2004 by M           **
+** This document was last updated on April 17th, 2005 by M            **
 ************************************************************************

Modified: trunk/src/protocol/ultimate2.c
==============================================================================
--- trunk/src/protocol/ultimate2.c	(original)
+++ trunk/src/protocol/ultimate2.c	Mon Apr 18 05:51:47 2005
@@ -146,11 +146,6 @@
 	{0, 0},
 };
 
-void send_server( const char *source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSG_SERVER, name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 	send_cmd( "%s %s", MSG_PASS, pass );
@@ -158,20 +153,15 @@
 	send_cmd( "%s TOKEN CLIENT", MSG_PROTOCTL );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
+void send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts )
 {
-	send_cmd( ":%s %s %s %s %s %lu", who, MSGTOK( MODE ), chan, mode, args, ts );
+	send_cmd( ":%s %s %s %s %s %lu", sourceuser, MSGTOK( MODE ), chan, mode, args, ts );
 }
 
 void send_nick( const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname )
 {
 	send_cmd( "%s %s 1 %lu %s %s %s 0 :%s", MSGTOK( NICK ), nick, ts, ident, host, server, realname );
-	send_umode( nick, nick, newmode );
-}
-
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSGTOK( MODE ), target, mode );
+	send_cmd( ":%s %s %s :%s", nick, MSGTOK( MODE ), nick, newmode );
 }
 
 void send_snetinfo( const char* source, const int prot, const char* cloak, const char* netname, const unsigned long ts )
@@ -189,11 +179,6 @@
 	send_cmd( "%s %d %d %d %d 0 0 0 0 0 0 0 0 0 0 :%s", MSG_VCTRL, uprot, nicklen, modex, gc, netname );
 }
 
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSGTOK( NICK ), newnick, ts );
-}
-
 void send_svshost( const char *source, const char *target, const char *vhost )
 {
 	send_cmd( ":%s %s %s %s", source, MSG_CHGHOST, target, vhost );
@@ -210,11 +195,6 @@
 	send_cmd( ":%s %s :%s@%s", ns_botptr->name, MSG_REMGLINE, host, ident );
 }
 
-void send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow )
-{
-	send_cmd( "%s %d %d 0 :%lu", MSG_SVINFO, tscurrent, tsmin, tsnow );
-}
-
 void send_burst( int b )
 {
 	if( b == 0 ) {

Modified: trunk/src/protocol/ultimate3.c
==============================================================================
--- trunk/src/protocol/ultimate3.c	(original)
+++ trunk/src/protocol/ultimate3.c	Mon Apr 18 05:51:47 2005
@@ -172,11 +172,6 @@
 	{0, 0},
 };
 
-void send_server( const char *source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSG_SERVER, name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 	send_cmd( "%s %s :TS", MSG_PASS, pass );
@@ -189,9 +184,9 @@
 	send_cmd( ":%s %s %lu %s + :%s", source, MSG_SJOIN, ts, chan, target );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
+void send_cmode( const char *sourceserver, const char *sourceuser, const char *chan, const char *mode, const char *args, const unsigned long ts )
 {
-	send_cmd( ":%s %s %s %s %s %lu", who, MSG_MODE, chan, mode, args, ts );
+	send_cmd( ":%s %s %s %s %s %lu", sourceuser, MSG_MODE, chan, mode, args, ts );
 }
 
 void send_nick( const char *nick, const unsigned long ts, const char* newmode, const char *ident, const char *host, const char* server, const char *realname )
@@ -199,11 +194,6 @@
 	send_cmd( "%s %s 1 %lu %s %s %s %s 0 %lu :%s", MSG_NICK, nick, ts, newmode, ident, host, server, ts, realname );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSG_MODE, target, mode );
-}
-
 void send_netinfo( const char* source, const int prot, const char* cloak, const char* netname, const unsigned long ts )
 {
 	send_cmd( ":%s %s 0 %lu %d %s 0 0 0 :%s", source, MSG_NETINFO, ts, prot, cloak, netname );
@@ -214,11 +204,6 @@
 	send_cmd( "%s %d %d %d %d 0 0 0 0 0 0 0 0 0 0 :%s", MSG_VCTRL, uprot, nicklen, modex, gc, netname );
 }
 
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSG_NICK, newnick, ts );
-}
-
 void send_svshost( const char *source, const char *target, const char *vhost )
 {
 	send_cmd( ":%s %s %s %s", source, MSG_SETHOST, target, vhost );
@@ -234,11 +219,6 @@
 	send_cmd( ":%s %s %s %s", source, MSG_RAKILL, host, ident );
 }
 
-void send_svinfo( const int tscurrent, const int tsmin, const unsigned long tsnow )
-{
-	send_cmd( "%s %d %d 0 :%lu", MSG_SVINFO, tscurrent, tsmin, tsnow );
-}
-
 void send_burst( int b )
 {
 	if( b == 0 ) {

Modified: trunk/src/protocol/unreal31.c
==============================================================================
--- trunk/src/protocol/unreal31.c	(original)
+++ trunk/src/protocol/unreal31.c	Mon Apr 18 05:51:47 2005
@@ -171,11 +171,6 @@
 	{0, 0},
 };
 
-void send_server( const char *source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSGTOK( SERVER ), name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 /* PROTOCTL NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 VL SJ3 NS SJB64 */
@@ -189,11 +184,6 @@
 	send_cmd( ":%s %s %lu %s + :%s", source, MSGTOK( SJOIN ), ts, chan, target );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %s %s %lu", source, MSGTOK( MODE ), chan, mode, args, ts );
-}
-
 /* m_nick
  *  argv[0] = nickname
  * if from new client
@@ -218,11 +208,6 @@
 	send_cmd( "%s %s 1 %lu %s %s %s 0 %s * :%s", MSGTOK( NICK ), nick, ts, ident, host, server, newmode, realname );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSGTOK( MODE ), target, mode );
-}
-
 void send_netinfo( const char* source, const int prot, const char* cloak, const char* netname, const unsigned long ts )
 {
 	send_cmd( ":%s %s 0 %lu %d %s 0 0 0 :%s", source, MSGTOK( NETINFO ), ts, prot, cloak, netname );
@@ -233,11 +218,6 @@
 	send_cmd( ":%s %s %s :%s", source, MSGTOK( SMO ), umodetarget, msg );
 }
 
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSGTOK( NICK ), newnick, ts );
-}
-
 void send_swhois( const char *source, const char *target, const char *swhois )
 {
 	send_cmd( "%s %s :%s", MSGTOK( SWHOIS ), target, swhois );

Modified: trunk/src/protocol/unreal32.c
==============================================================================
--- trunk/src/protocol/unreal32.c	(original)
+++ trunk/src/protocol/unreal32.c	Mon Apr 18 05:51:47 2005
@@ -294,11 +294,6 @@
 	return( tarindex );
 }
 
-void send_server( const char *source, const char *name, const int numeric, const char *infoline )
-{
-	send_cmd( ":%s %s %s %d :%s", source, MSGTOK( SERVER ), name, numeric, infoline );
-}
-
 void send_server_connect( const char *name, const int numeric, const char *infoline, const char *pass, const unsigned long tsboot, const unsigned long tslink )
 {
 /* PROTOCTL NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 VL SJ3 NS SJB64 TKLEXT NICKIP CHANMODES=be,kfL,l,psmntirRcOAQKVGCuzNSMT */
@@ -312,11 +307,6 @@
 	send_cmd( ":%s %s %lu %s + :%s", source, MSGTOK( SJOIN ), ts, chan, target );
 }
 
-void send_cmode( const char *source, const char *who, const char *chan, const char *mode, const char *args, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %s %s %lu", source, MSGTOK( MODE ), chan, mode, args, ts );
-}
-
 /* m_nick
  *  argv[0] = nickname
  * if from new client
@@ -348,11 +338,6 @@
 	send_cmd( "%s %s 1 %lu %s %s %s 0 %s * :%s", MSGTOK( NICK ), nick, ts, ident, host, server, newmode, realname );
 }
 
-void send_umode( const char *source, const char *target, const char *mode )
-{
-	send_cmd( ":%s %s %s :%s", source, MSGTOK( MODE ), target, mode );
-}
-
 void send_netinfo( const char* source, const int prot, const char* cloak, const char* netname, const unsigned long ts )
 {
 	send_cmd( ":%s %s 0 %lu %d %s 0 0 0 :%s", source, MSGTOK( NETINFO ), ts, prot, cloak, netname );
@@ -363,11 +348,6 @@
 	send_cmd( ":%s %s %s :%s", source, MSGTOK( SMO ), umodetarget, msg );
 }
 
-void send_nickchange( const char *oldnick, const char *newnick, const unsigned long ts )
-{
-	send_cmd( ":%s %s %s %lu", oldnick, MSGTOK( NICK ), newnick, ts );
-}
-
 void send_swhois( const char *source, const char *target, const char *swhois )
 {
 	send_cmd( "%s %s :%s", MSGTOK( SWHOIS ), target, swhois );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.