begin depreciation of __module_functions via warning comments and add some new events to events.h to be implemented for 2.5.15 release
This commit is contained in:
parent
470bfc7efc
commit
c7b692cfa7
15 changed files with 62 additions and 37 deletions
|
@ -57,7 +57,7 @@ const char services_bot_modes[]= "+oS";
|
|||
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, m_stats, 0},
|
||||
{MSG_VERSION, m_version, 0},
|
||||
|
|
4
Ircu.c
4
Ircu.c
|
@ -56,8 +56,8 @@ const char services_bot_modes[]= "+oS";
|
|||
/* this is the command list and associated functions to run */
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_privmsg, 0},
|
||||
{MSG_CPRIVMSG, TOK_CPRIVMSG, m_privmsg, 0},
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_private, 0},
|
||||
{MSG_CPRIVMSG, TOK_CPRIVMSG, m_private, 0},
|
||||
{MSG_NOTICE, TOK_NOTICE, m_notice, 0},
|
||||
{MSG_CNOTICE, TOK_CNOTICE, m_notice, 0},
|
||||
{MSG_STATS, TOK_STATS, m_stats, 0},
|
||||
|
|
|
@ -63,7 +63,7 @@ const char services_bot_modes[]= "+oS";
|
|||
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, TOK_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, TOK_STATS, m_stats, 0},
|
||||
{MSG_SETHOST, TOK_SETHOST, m_vhost, 0},
|
||||
|
|
|
@ -77,7 +77,7 @@ const char services_bot_modes[]= "+oS";
|
|||
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Token Function srvmsg */
|
||||
{MSG_PRIVATE, /*TOK_PRIVATE, */m_privmsg, 0},
|
||||
{MSG_PRIVATE, /*TOK_PRIVATE, */m_private, 0},
|
||||
{MSG_NOTICE, /*TOK_NOTICE, */m_notice, 0},
|
||||
{MSG_STATS, /*TOK_STATS, */m_stats, 0},
|
||||
{MSG_SETHOST, /*TOK_SETHOST, */m_vhost, 0},
|
||||
|
|
2
Unreal.c
2
Unreal.c
|
@ -71,7 +71,7 @@ const char services_bot_modes[]= "+oSq";
|
|||
|
||||
ircd_cmd cmd_list[] = {
|
||||
/*Message Token Function usage */
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, TOK_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, TOK_STATS, m_stats, 0},
|
||||
{MSG_SETHOST, TOK_SETHOST, m_vhost, 0},
|
||||
|
|
2
Viagra.c
2
Viagra.c
|
@ -63,7 +63,7 @@ const char services_bot_modes[]= "+oS";
|
|||
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, m_stats, 0},
|
||||
{MSG_VERSION, m_version, 0},
|
||||
|
|
|
@ -90,7 +90,15 @@ to check that they are compatible.
|
|||
|
||||
We also need to export a list of any responses to IRCd commands sent by
|
||||
users to our modules that we wish to support e.g. /VERSION mymodule. This
|
||||
is optional.
|
||||
is optional.
|
||||
|
||||
******************************** WARNING ********************************
|
||||
This table is optional but depreciated. You should respond to module
|
||||
events to be portable across all ircds and only use this table as a
|
||||
last resort if a module event is not available. This table will be
|
||||
removed from operation in a future release. If you need to use this
|
||||
table for anything, tell us so we can add an appropiate event handler.
|
||||
******************************** WARNING ********************************
|
||||
|
||||
NeoStats, and many IRCD's use tokens now, and the strings differ between
|
||||
IRCds so a hard coded string such as "VERSION" might not always work.
|
||||
|
|
|
@ -40,35 +40,24 @@ char s_module_bot_name[MAXNICK];
|
|||
* This structure is required for your module to load and run on NeoStats
|
||||
*/
|
||||
ModuleInfo __module_info = {
|
||||
"example",
|
||||
"example Module Description",
|
||||
"version 1.0",
|
||||
"Template",
|
||||
"Template Module Description",
|
||||
"Version 1.0",
|
||||
__DATE__,
|
||||
__TIME__
|
||||
};
|
||||
|
||||
/** printf version information
|
||||
* respond to the /VERSION command on IRC with this text
|
||||
* This is recommended for your module to load and run on NeoStats
|
||||
*/
|
||||
int new_m_version(char *origin, char **av, int ac)
|
||||
{
|
||||
numeric(351, origin, "Module Template Loaded, Version: %s %s %s",
|
||||
__module_info.module_version, __module_info.module_build_date,
|
||||
__module_info.module_build_time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Module function list
|
||||
* A list of IRCd (server) commands that we will respond to
|
||||
* e.g. VERSION
|
||||
* This table is optional
|
||||
******************************** WARNING ********************************
|
||||
This table is optional but depreciated. You should respond to module
|
||||
events to be portable across all ircds and only use this table as a
|
||||
last resort if a module event is not available. This table will be
|
||||
removed from operation in a future release. If you need to use this
|
||||
table for anything, tell us so we can add an appropiate event handler.
|
||||
******************************** WARNING ********************************
|
||||
*/
|
||||
Functions __module_functions[] = {
|
||||
{MSG_VERSION, new_m_version, 1},
|
||||
#ifdef GOTTOKENSUPPORT
|
||||
{TOK_VERSION, new_m_version, 1},
|
||||
#endif
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
|
@ -127,7 +116,7 @@ static int Online(char **av, int ac)
|
|||
/** Module event list
|
||||
* What events we will act on
|
||||
* This is required if you want your module to respond to events on IRC
|
||||
* see modules.txt for a list of all events available
|
||||
* see events.h for a list of all events available
|
||||
*/
|
||||
EventFnList __module_events[] = {
|
||||
{EVENT_ONLINE, Online},
|
||||
|
|
30
events.h
30
events.h
|
@ -185,9 +185,37 @@
|
|||
*/
|
||||
#define EVENT_CLIENTVERSION "CLIENTVERSION"
|
||||
|
||||
|
||||
/* CHANMODE params are:
|
||||
* channel name
|
||||
* mode string
|
||||
*/
|
||||
#define EVENT_CHANMODE "CHANMODE"
|
||||
|
||||
/* PRIVATE params are:
|
||||
* from nick
|
||||
* to nick
|
||||
* message
|
||||
*/
|
||||
#define EVENT_PRIVATE "PRIVATE"
|
||||
|
||||
/* NOTICE params are:
|
||||
* from nick
|
||||
* to nick
|
||||
* message
|
||||
*/
|
||||
#define EVENT_NOTICE "NOTICE"
|
||||
|
||||
/* CPRIVATE params are:
|
||||
* from nick
|
||||
* to channel
|
||||
* message
|
||||
*/
|
||||
#define EVENT_CPRIVATE "CPRIVATE"
|
||||
|
||||
/* CNOTICE params are:
|
||||
* from nick
|
||||
* to channel
|
||||
* message
|
||||
*/
|
||||
#define EVENT_CNOTICE "CNOTICE"
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ const char services_bot_modes[]= "+o";
|
|||
/* this is the command list and associated functions to run */
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, m_stats, 0},
|
||||
{MSG_VERSION, m_version, 0},
|
||||
|
|
2
ircd.c
2
ircd.c
|
@ -539,7 +539,7 @@ m_notice (char* origin, char **av, int ac, int cmdptr)
|
|||
* @return none
|
||||
*/
|
||||
void
|
||||
m_privmsg (char* origin, char **av, int ac, int cmdptr)
|
||||
m_private (char* origin, char **av, int ac, int cmdptr)
|
||||
{
|
||||
#ifndef IRCU
|
||||
int argc;
|
||||
|
|
2
ircd.h
2
ircd.h
|
@ -80,7 +80,7 @@ long UmodeStringToMask(const char* UmodeString, long Umode);
|
|||
char* SmodeMaskToString(const long Umode);
|
||||
long SmodeStringToMask(const char* UmodeString, long Smode);
|
||||
int init_services_bot (void);
|
||||
void m_privmsg (char* origin, char **av, int ac, int cmdptr);
|
||||
void m_private (char* origin, char **av, int ac, int cmdptr);
|
||||
void m_notice (char* origin, char **av, int ac, int cmdptr);
|
||||
void do_motd (const char* nick, const char *remoteserver);
|
||||
void do_admin (const char* nick, const char *remoteserver);
|
||||
|
|
|
@ -59,7 +59,7 @@ const char services_bot_modes[]= "+oS";
|
|||
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, m_stats, 0},
|
||||
{MSG_SETHOST, m_vhost, 0},
|
||||
|
|
2
mystic.c
2
mystic.c
|
@ -59,7 +59,7 @@ const char services_bot_modes[]= "+oS";
|
|||
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, TOK_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, TOK_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, TOK_STATS, m_stats, 0},
|
||||
{MSG_SETHOST, TOK_SETHOST, m_vhost, 0},
|
||||
|
|
|
@ -56,7 +56,7 @@ const char services_bot_modes[]= "+oS";
|
|||
/* this is the command list and associated functions to run */
|
||||
ircd_cmd cmd_list[] = {
|
||||
/* Command Function srvmsg */
|
||||
{MSG_PRIVATE, m_privmsg, 0},
|
||||
{MSG_PRIVATE, m_private, 0},
|
||||
{MSG_NOTICE, m_notice, 0},
|
||||
{MSG_STATS, m_stats, 0},
|
||||
{MSG_VERSION, m_version, 0},
|
||||
|
|
Reference in a new issue