From 2ba89de64d3b755f731f202dd97c48d256db8031 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 24 Apr 2010 16:30:49 -0400 Subject: Tell users when their nicks expire in /ns glist and /ns info --- docs/Changes | 1 + lang/cat.l | 6 +++--- lang/de.l | 6 +++--- lang/en_us.l | 6 +++--- lang/es.l | 6 +++--- lang/fr.l | 6 +++--- lang/gr.l | 6 +++--- lang/hun.l | 6 +++--- lang/it.l | 6 +++--- lang/nl.l | 6 +++--- lang/pl.l | 6 +++--- lang/pt.l | 6 +++--- lang/ru.l | 6 +++--- lang/tr.l | 6 +++--- src/core/ns_group.c | 14 ++++++-------- src/core/ns_info.c | 11 ++++------- 16 files changed, 50 insertions(+), 54 deletions(-) diff --git a/docs/Changes b/docs/Changes index 0e9cca93d..7f9d83ea6 100644 --- a/docs/Changes +++ b/docs/Changes @@ -1,5 +1,6 @@ Anope Version 1.9.3 -------------------- +A Tell users when their nicks expire in /ns glist and /ns info Anope Version 1.9.2 -------------------- diff --git a/lang/cat.l b/lang/cat.l index 6f2c72183..4e090e340 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -807,9 +807,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d nicknames en el grup. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expires in %s) + %s (expires in %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/de.l b/lang/de.l index 4062e0069..1117a23e7 100644 --- a/lang/de.l +++ b/lang/de.l @@ -825,9 +825,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d Nicknamen in der Gruppe. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (wird in %s auslaufen) + %s (wird in %s auslaufen) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/en_us.l b/lang/en_us.l index 56fbb8d08..ae526f50a 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -790,9 +790,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d nicknames in the group. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expires in %s) + %s (expires in %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/es.l b/lang/es.l index f5e0d874f..d9b7aa96d 100644 --- a/lang/es.l +++ b/lang/es.l @@ -810,9 +810,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d nicknames en el grupo. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expires in %s) + %s (expires in %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/fr.l b/lang/fr.l index 2fe9bbf4f..135def102 100644 --- a/lang/fr.l +++ b/lang/fr.l @@ -817,9 +817,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d pseudos dans le groupe. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expire le %s) + %s (expire le %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/gr.l b/lang/gr.l index f262b7618..f2d53f83a 100644 --- a/lang/gr.l +++ b/lang/gr.l @@ -805,9 +805,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d øåõäþíõìá ìÝóá óôçí ïìÜäá. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expires in %s) + %s (expires in %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/hun.l b/lang/hun.l index 2a2bf0ea8..70b8cc831 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -802,9 +802,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d nicknév van a csoportban. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expires in %s) + %s (expires in %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER válaszok NICK_RECOVER_SYNTAX diff --git a/lang/it.l b/lang/it.l index f2d7335d1..38bb5edb0 100644 --- a/lang/it.l +++ b/lang/it.l @@ -792,9 +792,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d nick nel gruppo. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (scade tra %s) + %s (scade tra %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/nl.l b/lang/nl.l index 38b42ffaa..f0824c95c 100644 --- a/lang/nl.l +++ b/lang/nl.l @@ -809,9 +809,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d nicks in de groep. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expires in %s) + %s (expires in %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/pl.l b/lang/pl.l index 341f57a63..e14b387fd 100644 --- a/lang/pl.l +++ b/lang/pl.l @@ -1019,10 +1019,10 @@ NICK_GLIST_FOOTER %d nicków w grupie. NICK_GLIST_REPLY - %c%s + %s (wygasa za %s) -NICK_GLIST_REPLY_ADMIN - %c%s (wygasa za %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/pt.l b/lang/pt.l index 2142db2f6..44231b0c6 100644 --- a/lang/pt.l +++ b/lang/pt.l @@ -811,9 +811,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER %d nicks no grupo. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expira em %s) + %s (expira em %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/ru.l b/lang/ru.l index d469b112b..186970c09 100644 --- a/lang/ru.l +++ b/lang/ru.l @@ -792,9 +792,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER Êîëè÷åñòâî íèêîâ â ãðóïïå: %d NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (èñòåêàåò %s) + %s (èñòåêàåò %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/lang/tr.l b/lang/tr.l index d73525d08..f9bf95066 100644 --- a/lang/tr.l +++ b/lang/tr.l @@ -812,9 +812,9 @@ NICK_GLIST_HEADER_X NICK_GLIST_FOOTER Grupta %d nick var. NICK_GLIST_REPLY - %c%s -NICK_GLIST_REPLY_ADMIN - %c%s (expires in %s) + %s (expires in %s) +NICK_GLIST_REPLY_NOEXPIRE + %s (does not expire) # RECOVER responses NICK_RECOVER_SYNTAX diff --git a/src/core/ns_group.c b/src/core/ns_group.c index 2aa47ac1f..dab27af27 100644 --- a/src/core/ns_group.c +++ b/src/core/ns_group.c @@ -182,16 +182,14 @@ class CommandNSGList : public Command for (i = 0; i < nc->aliases.count; ++i) { NickAlias *na2 = static_cast(nc->aliases.list[i]); - if (na2->nc == nc) + + if (!(wont_expire = na2->HasFlag(NS_NO_EXPIRE))) { - if (!(wont_expire = na2->HasFlag(NS_NO_EXPIRE))) - { - expt = na2->last_seen + Config.NSExpire; - tm = localtime(&expt); - strftime_lang(buf, sizeof(buf), finduser(na2->nick), STRFTIME_DATE_TIME_FORMAT, tm); - } - notice_lang(Config.s_NickServ, u, u->Account()->IsServicesOper() && !wont_expire ? NICK_GLIST_REPLY_ADMIN : NICK_GLIST_REPLY, wont_expire ? '!' : ' ', na2->nick, buf); + expt = na2->last_seen + Config.NSExpire; + tm = localtime(&expt); + strftime_lang(buf, sizeof(buf), finduser(na2->nick), STRFTIME_DATE_TIME_FORMAT, tm); } + notice_lang(Config.s_NickServ, u, wont_expire ? NICK_GLIST_REPLY_NOEXPIRE : NICK_GLIST_REPLY, na2->nick, buf); } notice_lang(Config.s_NickServ, u, NICK_GLIST_FOOTER, nc->aliases.count); } diff --git a/src/core/ns_info.c b/src/core/ns_info.c index 0635e52df..421d33f97 100644 --- a/src/core/ns_info.c +++ b/src/core/ns_info.c @@ -171,13 +171,10 @@ class CommandNSInfo : public Command notice_lang(Config.s_NickServ, u, NICK_INFO_NO_EXPIRE); else { - if (u->Account()->IsServicesOper()) - { - expt = na->last_seen + Config.NSExpire; - tm = localtime(&expt); - strftime_lang(buf, sizeof(buf), finduser(na->nick), STRFTIME_DATE_TIME_FORMAT, tm); - notice_lang(Config.s_NickServ, u, NICK_INFO_EXPIRE, buf); - } + expt = na->last_seen + Config.NSExpire; + tm = localtime(&expt); + strftime_lang(buf, sizeof(buf), finduser(na->nick), STRFTIME_DATE_TIME_FORMAT, tm); + notice_lang(Config.s_NickServ, u, NICK_INFO_EXPIRE, buf); } } -- cgit From fa82890696c498f38643df7df6891434c91c9269 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 24 Apr 2010 17:18:25 -0400 Subject: Moved Commands stuff to its own file and changed Command::name to be ci::string - Will be used after hashing system is rewritten --- include/commands.h | 113 +++++++++++++++++++++++++++++++++++++++++++++++++---- include/modules.h | 92 +------------------------------------------ include/pseudo.h | 2 +- src/bots.cpp | 1 + src/command.cpp | 2 +- src/commands.c | 26 +++++++++++- src/modules.c | 24 ------------ 7 files changed, 135 insertions(+), 125 deletions(-) diff --git a/include/commands.h b/include/commands.h index d139fa01a..5d43f556b 100644 --- a/include/commands.h +++ b/include/commands.h @@ -11,17 +11,116 @@ * */ - #include "modules.h" +#ifndef COMMAND_H_ +#define COMMAND_H_ -/*************************************************************************/ +#define MAX_CMD_HASH 1024 +#define CMD_HASH(x) (((x)[0]&31)<<5 | ((x)[1]&31)) /* Will gen a hash from a string :) */ -/* Routines for looking up commands. Command lists are arrays that must be - * terminated with a NULL name. - */ +#define HOSTSERV HS_cmdTable /* using HOSTSERV etc. looks nicer than HS_cmdTable for modules */ +#define BOTSERV BS_cmdTable +#define MEMOSERV MS_cmdTable +#define NICKSERV NS_cmdTable +#define CHANSERV CS_cmdTable +#define OPERSERV OS_cmdTable + +#ifndef _WIN32 +#define MDE +#else +#ifndef MODULE_COMPILE +#define MDE __declspec(dllexport) +#else +#define MDE __declspec(dllimport) +#endif +#endif + +/** The return value from commands. + * */ +enum CommandReturn +{ + MOD_CONT, + MOD_STOP +}; + +class Command; extern MDE Command *lookup_cmd(Command *list, char *name); extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[], const char *cmd); extern MDE void mod_run_cmd(const std::string &service, User *u, CommandHash *cmdTable[], const char *cmd); -//extern MDE void do_help_limited(char *service, User * u, Command * c); -/*************************************************************************/ +struct CommandHash { + char *name; /* Name of the command */ + Command *c; /* Actual command */ + CommandHash *next; /* Next command */ +}; + +extern MDE CommandHash *HOSTSERV[MAX_CMD_HASH]; +extern MDE CommandHash *BOTSERV[MAX_CMD_HASH]; +extern MDE CommandHash *MEMOSERV[MAX_CMD_HASH]; +extern MDE CommandHash *NICKSERV[MAX_CMD_HASH]; +extern MDE CommandHash *CHANSERV[MAX_CMD_HASH]; +extern MDE CommandHash *OPERSERV[MAX_CMD_HASH]; + +enum CommandFlag +{ + CFLAG_ALLOW_UNREGISTERED, + CFLAG_ALLOW_FORBIDDEN, + CFLAG_ALLOW_SUSPENDED, + CFLAG_ALLOW_UNREGISTEREDCHANNEL, + CFLAG_STRIP_CHANNEL, + CFLAG_DISABLE_FANTASY +}; + +/** Every services command is a class, inheriting from Command. + */ +class CoreExport Command : public Flags +{ + public: + size_t MaxParams; + size_t MinParams; + ci::string name; + std::string permission; + + /** Create a new command. + * @param sname The command name + * @param min_params The minimum number of parameters the parser will require to execute this command + * @param max_params The maximum number of parameters the parser will create, after max_params, all will be combined into the last argument. + * NOTE: If max_params is not set (default), there is no limit to the max number of params. + */ + Command(const ci::string &sname, size_t min_params, size_t max_params = 0, const std::string &spermission = ""); + + virtual ~Command(); + + /** Execute this command. + * @param u The user executing the command. + */ + virtual CommandReturn Execute(User *u, const std::vector &); + + /** Requested when the user is requesting help on this command. Help on this command should be sent to the user. + * @param u The user requesting help + * @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of +"FOO BAR LOL") + * @return true if help was provided to the user, false otherwise. + */ + virtual bool OnHelp(User *u, const ci::string &subcommand); + + /** Requested when the user provides bad syntax to this command (not enough params, etc). + * @param u The user executing the command. + * @param subcommand The subcommand the user tried to use + */ + virtual void OnSyntaxError(User *u, const ci::string &subcommand); + + /** Set which command permission (e.g. chanserv/forbid) is required for this command. + * @param reststr The permission required to successfully execute this command + */ + void SetPermission(const std::string &reststr); + + /* Module related stuff */ + int core; /* Can this command be deleted? */ + char *mod_name; /* Name of the module who owns us, NULL for core's */ + char *service; /* Service we provide this command for */ + Command *next; +}; + +#endif + diff --git a/include/modules.h b/include/modules.h index bd553c2cc..dcaac342c 100644 --- a/include/modules.h +++ b/include/modules.h @@ -19,6 +19,7 @@ #include "timers.h" #include "hashcomp.h" #include "version.h" +#include "commands.h" /* Cross OS compatibility macros */ #ifdef _WIN32 @@ -113,23 +114,7 @@ enum Priority { PRIORITY_FIRST, PRIORITY_DONTCARE, PRIORITY_LAST, PRIORITY_BEFOR /*************************************************************************/ -#define CMD_HASH(x) (((x)[0]&31)<<5 | ((x)[1]&31)) /* Will gen a hash from a string :) */ -#define MAX_CMD_HASH 1024 -/** The return value from commands. - */ -enum CommandReturn -{ - MOD_CONT, - MOD_STOP -}; - -#define HOSTSERV HS_cmdTable /* using HOSTSERV etc. looks nicer than HS_cmdTable for modules */ -#define BOTSERV BS_cmdTable -#define MEMOSERV MS_cmdTable -#define NICKSERV NS_cmdTable -#define CHANSERV CS_cmdTable -#define OPERSERV OS_cmdTable #define IRCD IRCD_cmdTable #define MODULE_HASH Module_table #define EVENT EVENT_cmdTable @@ -191,7 +176,6 @@ typedef enum { MOD_OP_LOAD, MOD_OP_UNLOAD } ModuleOperation; /*************************************************************************/ /* Structure for information about a *Serv command. */ -struct CommandHash; typedef struct ModuleLang_ ModuleLang; typedef struct ModuleHash_ ModuleHash; typedef struct Message_ Message; @@ -199,15 +183,6 @@ typedef struct MessageHash_ MessageHash; /*************************************************************************/ - - - -extern MDE CommandHash *HOSTSERV[MAX_CMD_HASH]; -extern MDE CommandHash *BOTSERV[MAX_CMD_HASH]; -extern MDE CommandHash *MEMOSERV[MAX_CMD_HASH]; -extern MDE CommandHash *NICKSERV[MAX_CMD_HASH]; -extern MDE CommandHash *CHANSERV[MAX_CMD_HASH]; -extern MDE CommandHash *OPERSERV[MAX_CMD_HASH]; extern MDE MessageHash *IRCD[MAX_CMD_HASH]; extern MDE ModuleHash *MODULE_HASH[MAX_CMD_HASH]; @@ -216,65 +191,6 @@ struct ModuleLang_ { char **argv; }; -enum CommandFlag -{ - CFLAG_ALLOW_UNREGISTERED, - CFLAG_ALLOW_FORBIDDEN, - CFLAG_ALLOW_SUSPENDED, - CFLAG_ALLOW_UNREGISTEREDCHANNEL, - CFLAG_STRIP_CHANNEL, - CFLAG_DISABLE_FANTASY -}; - -/** Every services command is a class, inheriting from Command. - */ -class CoreExport Command : public Flags -{ - public: - size_t MaxParams; - size_t MinParams; - std::string name; - std::string permission; - - /** Create a new command. - * @param min_params The minimum number of parameters the parser will require to execute this command - * @param max_params The maximum number of parameters the parser will create, after max_params, all will be combined into the last argument. - * NOTE: If max_params is not set (default), there is no limit to the max number of params. - */ - Command(const std::string &sname, size_t min_params, size_t max_params = 0, const std::string &spermission = ""); - - virtual ~Command(); - - /** Execute this command. - * @param u The user executing the command. - */ - virtual CommandReturn Execute(User *u, const std::vector &); - - /** Requested when the user is requesting help on this command. Help on this command should be sent to the user. - * @param u The user requesting help - * @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of "FOO BAR LOL") - * @return true if help was provided to the user, false otherwise. - */ - virtual bool OnHelp(User *u, const ci::string &subcommand); - - /** Requested when the user provides bad syntax to this command (not enough params, etc). - * @param u The user executing the command. - * @param subcommand The subcommand the user tried to use - */ - virtual void OnSyntaxError(User *u, const ci::string &subcommand); - - /** Set which command permission (e.g. chanserv/forbid) is required for this command. - * @param reststr The permission required to successfully execute this command - */ - void SetPermission(const std::string &reststr); - - /* Module related stuff */ - int core; /* Can this command be deleted? */ - char *mod_name; /* Name of the module who owns us, NULL for core's */ - char *service; /* Service we provide this command for */ - Command *next; -}; - class Version { private: @@ -1324,12 +1240,6 @@ struct ModuleHash_ { ModuleHash *next; }; -struct CommandHash { - char *name; /* Name of the command */ - Command *c; /* Actual command */ - CommandHash *next; /* Next command */ -}; - struct Message_ { char *name; int (*func)(const char *source, int ac, const char **av); diff --git a/include/pseudo.h b/include/pseudo.h index d24c43963..3ad6b518a 100644 --- a/include/pseudo.h +++ b/include/pseudo.h @@ -11,7 +11,7 @@ * */ -#include "commands.h" +#include "modules.h" #include "language.h" #include "timers.h" #include "slist.h" diff --git a/src/bots.cpp b/src/bots.cpp index 37cd553d1..e663d9225 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -10,6 +10,7 @@ #include "services.h" #include "modules.h" +#include "commands.h" BotInfo::BotInfo(const std::string &nnick, const std::string &nuser, const std::string &nhost, const std::string &nreal) { diff --git a/src/command.cpp b/src/command.cpp index ea66a7261..fc745fe46 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -10,7 +10,7 @@ #include "services.h" #include "modules.h" -Command::Command(const std::string &sname, size_t min_params, size_t max_params, const std::string &spermission) : MaxParams(max_params), MinParams(min_params), name(sname), permission(spermission) +Command::Command(const ci::string &sname, size_t min_params, size_t max_params, const std::string &spermission) : MaxParams(max_params), MinParams(min_params), name(sname), permission(spermission) { this->core = 0; this->mod_name = NULL; diff --git a/src/commands.c b/src/commands.c index 19d668137..40363a7d1 100644 --- a/src/commands.c +++ b/src/commands.c @@ -12,12 +12,36 @@ */ #include "services.h" -#include "commands.h" +#include "modules.h" #include "language.h" #include "hashcomp.h" /*************************************************************************/ +/** + * Search the command table gieven for a command. + * @param cmdTable the name of the command table to search + * @param name the name of the command to look for + * @return returns a pointer to the found command struct, or NULL + */ +Command *findCommand(CommandHash * cmdTable[], const char *name) +{ + int idx; + CommandHash *current = NULL; + if (!cmdTable || !name) { + return NULL; + } + + idx = CMD_HASH(name); + + for (current = cmdTable[idx]; current; current = current->next) { + if (stricmp(name, current->name) == 0) { + return current->c; + } + } + return NULL; +} + /** * Return the Command corresponding to the given name, or NULL if no such * command exists. diff --git a/src/modules.c b/src/modules.c index 40c10144f..af3aa2f4d 100644 --- a/src/modules.c +++ b/src/modules.c @@ -362,30 +362,6 @@ int Module::DelCommand(CommandHash * cmdTable[], const char *dname) return status; } -/** - * Search the command table gieven for a command. - * @param cmdTable the name of the command table to search - * @param name the name of the command to look for - * @return returns a pointer to the found command struct, or NULL - */ -Command *findCommand(CommandHash * cmdTable[], const char *name) -{ - int idx; - CommandHash *current = NULL; - if (!cmdTable || !name) { - return NULL; - } - - idx = CMD_HASH(name); - - for (current = cmdTable[idx]; current; current = current->next) { - if (stricmp(name, current->name) == 0) { - return current->c; - } - } - return NULL; -} - /******************************************************************************* * Message Functions *******************************************************************************/ -- cgit From 73e93305c10f349742fad3b2197c6c5dd3aea34e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 24 Apr 2010 19:38:17 -0400 Subject: Added nickserv/auspex permission and fixed core modules so they build --- data/example.conf | 1 + docs/Changes.conf | 7 ++++++- docs/Changes.lang | 10 +++++++++- lang/cat.l | 4 ++-- lang/de.l | 4 ++-- lang/en_us.l | 3 ++- lang/es.l | 4 ++-- lang/fr.l | 4 ++-- lang/gr.l | 6 +++--- lang/hun.l | 5 +++-- lang/it.l | 3 ++- lang/nl.l | 3 ++- lang/pl.l | 4 ++-- lang/pt.l | 3 ++- lang/ru.l | 4 ++-- lang/tr.l | 4 ++-- src/core/cs_ban.c | 2 +- src/core/cs_info.c | 4 ++-- src/core/cs_kick.c | 2 +- src/core/cs_xop.c | 2 +- src/core/ns_identify.c | 2 +- src/core/ns_info.c | 18 +++++++++--------- src/core/ns_register.c | 2 +- src/core/os_news.c | 2 +- src/modules/hs_request.c | 2 +- 25 files changed, 62 insertions(+), 43 deletions(-) diff --git a/data/example.conf b/data/example.conf index b9ee1fd1b..a87478017 100644 --- a/data/example.conf +++ b/data/example.conf @@ -576,6 +576,7 @@ options * chanserv/set - Can modify the settings of any channel (incl. changing of the owner and password!) * memoserv/info - Can see any information with /memoserv info * memoserv/set-limit - Can set the limit of max stored memos on any user and channel + * nickserv/auspex - Can see any information with /nickserv info * nickserv/confirm - Can confirm other users nicknames * nickserv/drop - Can drop other users nicks * diff --git a/docs/Changes.conf b/docs/Changes.conf index 5420f66fd..c07f2a5d1 100644 --- a/docs/Changes.conf +++ b/docs/Changes.conf @@ -1,6 +1,11 @@ Anope Version 1.9.3 -------------------- +------------------ +** ADDED CONFIGURATION DIRECTIVES ** +nickserv/auspex privilege added +** MODIFIED CONFIGURATION DIRECTIVES ** + +** DELETED CONFIGURATION DIRECTIVES ** Anope Version 1.9.2 -------------------- diff --git a/docs/Changes.lang b/docs/Changes.lang index ea711a609..51c418cdf 100644 --- a/docs/Changes.lang +++ b/docs/Changes.lang @@ -1,6 +1,14 @@ Anope Version 1.9.3 -------------------- +-------------------- +*** New Strings: + NICK_GLIST_REPLY_NOEXPIRE + NICK_SERVADMIN_HELP_INFO +*** Mod Strings: + NICK_GLIST_REPLY + +*** Del Strings: + NICK_GLIST_REPLY_ADMIN Anope Version 1.9.2 -------------------- diff --git a/lang/cat.l b/lang/cat.l index 4e090e340..f44bb1e9b 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -4084,8 +4084,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Administradors de serveis poden utilitzar el parametre - ALL amb qualsevol nick. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Sintaxis: LIST patró [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/de.l b/lang/de.l index 1117a23e7..264af8778 100644 --- a/lang/de.l +++ b/lang/de.l @@ -4123,8 +4123,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Services Administratoren können den ALL Parameter für - jeden beliebigen Nickname benutzen. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Syntax: LIST Muster [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/en_us.l b/lang/en_us.l index ae526f50a..581f53e7d 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -3947,7 +3947,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Services Operators may use the ALL parameter with any nick. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Syntax: LIST pattern [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/es.l b/lang/es.l index d9b7aa96d..0ae91a5db 100644 --- a/lang/es.l +++ b/lang/es.l @@ -4056,8 +4056,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Administradores de Servicios pueden usar el parametro - ALL con cualquier nick. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Sintaxis: LIST patron [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/fr.l b/lang/fr.l index 135def102..83fdf3eb4 100644 --- a/lang/fr.l +++ b/lang/fr.l @@ -4118,8 +4118,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Les services operators peuvent utiliser le paramètre ALL - avec n'importe quel pseudo. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Syntaxe: LIST modèle [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/gr.l b/lang/gr.l index f2d53f83a..344866240 100644 --- a/lang/gr.l +++ b/lang/gr.l @@ -4082,11 +4082,11 @@ NICK_SERVADMIN_HELP_DROP Ìðïñåß íá óâÞóåéò êÜðïéï øåõäþíõìï ðïõ ìðïñåß íá åßíáé óôçí ïìÜäá óïõ ÷ùñßò íá Ý÷åéò îå÷ùñéóôÜ äéêáéþìáôá. Ôï óâÞóéìï ôïõ øåõäþíõìïõ Ý÷ïõí ôï äéêáßùìá íá ôï êÜíïõí ïé (åðéêåöáëåßò) Services Operators. - + NICK_SERVADMIN_HELP_INFO - Ïé Services Operators ìðïñïýí íá ÷ñçóéìïðïéïýí ôçí ALL ðáñÜìåôñï ãéá - êÜèå øåõäþíõìï. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Óýíôáîç: LIST pattern [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/hun.l b/lang/hun.l index 70b8cc831..88db8b0f0 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -3993,10 +3993,11 @@ NICK_SERVADMIN_HELP_DROP különleges kiváltsága. Használat korlátozva Szervíz adminoknak. - + NICK_SERVADMIN_HELP_INFO - Szervíz adminok használhatják az ALL paramétert. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Syntax: LIST pattern [FORBIDDEN] [SUSPENDED] [NOEXPIRE] diff --git a/lang/it.l b/lang/it.l index 38bb5edb0..746d88bd7 100644 --- a/lang/it.l +++ b/lang/it.l @@ -3964,7 +3964,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - I Services Operator possono usare il parametro ALL con tutti i nick. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Sintassi: LIST pattern [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/nl.l b/lang/nl.l index f0824c95c..95236d0f8 100644 --- a/lang/nl.l +++ b/lang/nl.l @@ -4030,7 +4030,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Services Operators mogen het ALL parameter met elke nick gebruiken. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Gebruik: trefbeeld [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/pl.l b/lang/pl.l index e14b387fd..e58eafa82 100644 --- a/lang/pl.l +++ b/lang/pl.l @@ -5029,8 +5029,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Administratorzy serwisów mog± u¿ywaæ parametru - ALL dla ka¿dego nicka. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Sk³adnia: LIST wzorzec [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/pt.l b/lang/pt.l index 44231b0c6..d220c2ce7 100644 --- a/lang/pt.l +++ b/lang/pt.l @@ -3975,7 +3975,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Administradores de Services podem usar o parâmetro ALL com qualquer nick. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Sintaxe: LIST padrão [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/ru.l b/lang/ru.l index 186970c09..b41b19906 100644 --- a/lang/ru.l +++ b/lang/ru.l @@ -4022,8 +4022,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Àäìèíèñòðàòîðû ñåðâèñîâ ìîãó èñïîëüçîâàòü ïàðàìåòð ALL äëÿ ëþáîãî - íèêà. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Ñèíòàêñèñ: LIST ìàñêà [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/lang/tr.l b/lang/tr.l index f9bf95066..a88738740 100644 --- a/lang/tr.l +++ b/lang/tr.l @@ -4072,8 +4072,8 @@ NICK_SERVADMIN_HELP_DROP NICK_SERVADMIN_HELP_INFO - Servis adminleri ALL parametresini herhangi bir nick için - kullanabilirler. + Services Operators with the nickserv/auspex privilege may + use the ALL parameter with any nick. NICK_SERVADMIN_HELP_LIST Kullanýmý: LIST model [FORBIDDEN] [SUSPENDED] [NOEXPIRE] [UNCONFIRMED] diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c index d0bbbfbb4..bacc8dff8 100644 --- a/src/core/cs_ban.c +++ b/src/core/cs_ban.c @@ -17,7 +17,7 @@ class CommandCSBan : public Command { public: - CommandCSBan(const std::string &cname) : Command(cname, 2, 3) + CommandCSBan(const ci::string &cname) : Command(cname, 2, 3) { } diff --git a/src/core/cs_info.c b/src/core/cs_info.c index 60e8ebf50..9131d1a3a 100644 --- a/src/core/cs_info.c +++ b/src/core/cs_info.c @@ -43,7 +43,7 @@ class CommandCSInfo : public Command ChannelInfo *ci; char buf[BUFSIZE]; struct tm *tm; - bool has_auspex = u->Account() && u->Account()->HasPriv("chanserv/auspex"); + bool has_auspex = u->IsIdentified() && u->Account()->HasPriv("chanserv/auspex"); int show_all = 0; time_t expt; @@ -146,7 +146,7 @@ class CommandCSInfo : public Command bool OnHelp(User *u, const ci::string &subcommand) { notice_lang(Config.s_ChanServ, u, CHAN_HELP_INFO); - if (u->Account() && u->Account()->HasPriv("chanserv/auspex")) + if (u->IsIdentified() && u->Account()->HasPriv("chanserv/auspex")) notice_lang(Config.s_ChanServ, u, CHAN_SERVADMIN_HELP_INFO); return true; diff --git a/src/core/cs_kick.c b/src/core/cs_kick.c index bce32d401..9614c8cc3 100644 --- a/src/core/cs_kick.c +++ b/src/core/cs_kick.c @@ -17,7 +17,7 @@ class CommandCSKick : public Command { public: - CommandCSKick(const std::string& cname) : Command(cname, 2, 3) + CommandCSKick(const ci::string &cname) : Command(cname, 2, 3) { } diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index 702919d8e..a6f980ad0 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -396,7 +396,7 @@ class XOPBase : public Command return MOD_CONT; } public: - XOPBase(const std::string &command) : Command(command, 2, 3) + XOPBase(const ci::string &command) : Command(command, 2, 3) { } diff --git a/src/core/ns_identify.c b/src/core/ns_identify.c index 866497fc0..b574c1207 100644 --- a/src/core/ns_identify.c +++ b/src/core/ns_identify.c @@ -17,7 +17,7 @@ class CommandNSIdentify : public Command { public: - CommandNSIdentify(const std::string &cname) : Command(cname, 1, 1) + CommandNSIdentify(const ci::string &cname) : Command(cname, 1, 1) { this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } diff --git a/src/core/ns_info.c b/src/core/ns_info.c index 421d33f97..020745008 100644 --- a/src/core/ns_info.c +++ b/src/core/ns_info.c @@ -79,19 +79,19 @@ class CommandNSInfo : public Command { struct tm *tm; char buf[BUFSIZE]; - int nick_online = 0; - int show_hidden = 0; + bool nick_online = false, show_hidden = false; time_t expt; + bool has_auspex = u->IsIdentified() && u->Account()->HasPriv("nickserv/auspex"); /* Is the real owner of the nick we're looking up online? -TheShadow */ User *u2 = finduser(na->nick); if (u2 && u2->Account() == na->nc) - nick_online = 1; + nick_online = true; /* Only show hidden fields to owner and sadmins and only when the ALL * parameter is used. -TheShadow */ - if (!param.empty() && param == "ALL" && u->Account() && (na->nc == u->Account() || u->Account()->IsServicesOper())) - show_hidden = 1; + if (!param.empty() && param == "ALL" && u->Account() && (na->nc == u->Account() || has_auspex)) + show_hidden = true; notice_lang(Config.s_NickServ, u, NICK_INFO_REALNAME, na->nick, na->last_realname); @@ -100,7 +100,6 @@ class CommandNSInfo : public Command if (show_hidden || (!(na->nc->HasFlag(NI_HIDE_STATUS)))) { notice_lang(Config.s_NickServ, u, NICK_INFO_SERVICES_OPERTYPE, na->nick, na->nc->ot->GetName().c_str()); - } } @@ -111,7 +110,8 @@ class CommandNSInfo : public Command else notice_lang(Config.s_NickServ, u, NICK_INFO_ADDRESS_ONLINE_NOHOST, na->nick); } - else { + else + { if (show_hidden || !(na->nc->HasFlag(NI_HIDE_MASK))) notice_lang(Config.s_NickServ, u, NICK_INFO_ADDRESS, na->last_usermask); } @@ -178,7 +178,7 @@ class CommandNSInfo : public Command } } - if (!show_hidden && u->Account() && (na->nc == u->Account() || u->Account()->IsServicesOper())) + if (!show_hidden && u->Account() && (na->nc == u->Account() || has_auspex)) notice_lang(Config.s_NickServ, u, NICK_INFO_FOR_MORE, Config.s_NickServ, na->nick); } return MOD_CONT; @@ -187,7 +187,7 @@ class CommandNSInfo : public Command bool OnHelp(User *u, const ci::string &subcommand) { notice_help(Config.s_NickServ, u, NICK_HELP_INFO); - if (u->Account() && u->Account()->IsServicesOper()) + if (u->IsIdentified() && u->Account()->HasPriv("nickserv/auspex")) notice_help(Config.s_NickServ, u, NICK_SERVADMIN_HELP_INFO); return true; diff --git a/src/core/ns_register.c b/src/core/ns_register.c index 4a9bfb6fe..9074f109f 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -143,7 +143,7 @@ class CommandNSConfirm : public Command } public: - CommandNSConfirm(const std::string &cmdn, int min, int max) : Command(cmdn, min, max) + CommandNSConfirm(const ci::string &cmdn, int min, int max) : Command(cmdn, min, max) { this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } diff --git a/src/core/os_news.c b/src/core/os_news.c index 9daf1b443..e39db8011 100644 --- a/src/core/os_news.c +++ b/src/core/os_news.c @@ -300,7 +300,7 @@ class NewsBase : public Command return MOD_CONT; } public: - NewsBase(const std::string &newstype) : Command(newstype, 1, 2, "operserv/news") + NewsBase(const ci::string &newstype) : Command(newstype, 1, 2, "operserv/news") { } diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index ebc46dfe8..0113817b7 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -339,7 +339,7 @@ class HSListBase : public Command return MOD_CONT; } public: - HSListBase(const std::string &cmd, int min, int max) : Command(cmd, min, max, "hostserv/set") + HSListBase(const ci::string &cmd, int min, int max) : Command(cmd, min, max, "hostserv/set") { } -- cgit From c1d161dec451ea790ff87078b5d80b1f71a3e9f0 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 29 Apr 2010 17:31:34 -0400 Subject: Rewrote all of the server handling code --- include/extern.h | 36 +-- include/modules.h | 9 +- include/servers.h | 179 +++++++++++ include/services.h | 93 +----- src/Makefile | 26 +- src/bots.cpp | 3 +- src/botserv.c | 2 +- src/channels.c | 12 +- src/core/cs_modes.c | 2 +- src/core/cs_xop.c | 2 +- src/core/os_defcon.c | 6 +- src/core/os_jupe.c | 12 +- src/core/os_noop.c | 2 +- src/core/os_stats.c | 21 +- src/main.c | 2 - src/modules.c | 4 - src/operserv.c | 47 ++- src/protocol.cpp | 4 +- src/protocol/bahamut.c | 23 +- src/protocol/inspircd11.c | 13 +- src/protocol/inspircd12.cpp | 29 +- src/protocol/ratbox.c | 26 +- src/protocol/unreal32.c | 23 +- src/regchannel.cpp | 2 +- src/servers.c | 702 -------------------------------------------- src/servers.cpp | 576 ++++++++++++++++++++++++++++++++++++ src/users.c | 21 +- 27 files changed, 890 insertions(+), 987 deletions(-) create mode 100644 include/servers.h delete mode 100644 src/servers.c create mode 100644 src/servers.cpp diff --git a/include/extern.h b/include/extern.h index 5ede04dc8..79f1702f9 100644 --- a/include/extern.h +++ b/include/extern.h @@ -23,8 +23,6 @@ E void ModuleRunTimeDirCleanUp(); -E char *uplink; - /* IRC Variables */ E IRCDVar *ircd; @@ -423,7 +421,7 @@ E int add_szline(User * u, const char *mask, const char *by, E void expire_szlines(); E int check_szline(const char *nick, char *ip); -E Server *server_global(Server * s, char *msg); +E void server_global(Server *s, const std::string &message); E std::vector News; @@ -459,37 +457,6 @@ E void notice_lang(const std::string &source, User *dest, int message, ...); // E void notice_help(const char *source, User *dest, int message, ...); // MARK_DEPRECATED; -/**** servers.c ****/ - -E Server *servlist; -E Server *me_server; -E Server *serv_uplink; -E Flags Capab; -E CapabInfo Capab_Info[]; - -E Server *first_server(ServerFlag flag); -E Server *next_server(ServerFlag flag); - -E void CapabParse(int ac, const char **av); -E int is_ulined(const char *server); -E int is_sync(Server *server); - -E Server *new_server(Server * uplink, const char *name, const char *desc, ServerFlag flag, const std::string &suid); - -E Server *findserver(Server *s, const char *name); - -E void do_server(const char *source, const char *servername, const char *hops, const char *descript, const std::string &numeric); -E void do_squit(const char *source, int ac, const char **av); -E int anope_check_sync(const char *name); - -E void finish_sync(Server *serv, int sync_links); - -E void ts6_uid_init(); -E void ts6_uid_increment(unsigned int slot); -E const char *ts6_uid_retrieve(); - -E const char *ts6_sid_retrieve(); - /**** sessions.c ****/ E Exception *exceptions; @@ -550,7 +517,6 @@ E User *first_uid(); E User *next_uid(); E Server *findserver_uid(Server * s, const char *name); E char *TS6SID; -E char *TS6UPLINK; E User *do_nick(const char *source, const char *nick, const char *username, const char *host, const char *server, const char *realname, time_t ts, uint32 ip, const char *vhost, const char *uid); diff --git a/include/modules.h b/include/modules.h index dcaac342c..afc6806d1 100644 --- a/include/modules.h +++ b/include/modules.h @@ -585,9 +585,9 @@ class CoreExport Module */ virtual void OnServerConnect() { } - /** Called when we are done synching with the uplink, just before we send the EOB + /** Called when we are almost done synching with the uplink, just before we send the EOB */ - virtual void OnFinishSync(Server *serv) { } + virtual void OnPreUplinkSync(Server *serv) { } /** Called when Anope disconnects from its uplink, before it tries to reconnect */ @@ -1060,8 +1060,9 @@ class CoreExport Module virtual void OnServerSync(Server *s) { } /** Called when we sync with our uplink + * @param s Our uplink */ - virtual void OnUplinkSync() { } + virtual void OnUplinkSync(Server *s) { } }; @@ -1109,7 +1110,7 @@ enum Implementation I_OnModuleLoad, I_OnModuleUnload, /* Other */ - I_OnReload, I_OnPreServerConnect, I_OnNewServer, I_OnServerConnect, I_OnFinishSync, I_OnServerDisconnect, I_OnPreCommandRun, + I_OnReload, I_OnPreServerConnect, I_OnNewServer, I_OnServerConnect, I_OnPreUplinkSync, I_OnServerDisconnect, I_OnPreCommandRun, I_OnPreCommand, I_OnPostCommand, I_OnPreDatabaseExpire, I_OnPreRestart, I_OnRestart, I_OnPreShutdown, I_OnShutdown, I_OnSignal, I_OnServerQuit, I_OnTopicUpdated, I_OnEncrypt, I_OnEncryptInPlace, I_OnEncryptCheckLen, I_OnDecrypt, I_OnCheckPassword, diff --git a/include/servers.h b/include/servers.h new file mode 100644 index 000000000..f6a5933ed --- /dev/null +++ b/include/servers.h @@ -0,0 +1,179 @@ +/* Anope */ +extern CoreExport Server *Me; + +extern CoreExport void CapabParse(int ac, const char **av); + +extern CoreExport void do_server(const std::string &source, const std::string &servername, unsigned int hops, const std::string &descript, const std::string &numeric); +extern CoreExport void do_squit(const char *source, int ac, const char **av); + +extern CoreExport const char *ts6_uid_retrieve(); +extern CoreExport const char *ts6_sid_retrieve(); + +/* Types of capab + */ +enum CapabType +{ + CAPAB_BEGIN, + + CAPAB_NOQUIT, + CAPAB_TSMODE, + CAPAB_UNCONNECT, + CAPAB_NICKIP, + CAPAB_NSJOIN, + CAPAB_ZIP, + CAPAB_BURST, + CAPAB_TS3, + CAPAB_TS5, + CAPAB_DKEY, + CAPAB_DOZIP, + CAPAB_DODKEY, + CAPAB_QS, + CAPAB_SCS, + CAPAB_PT4, + CAPAB_UID, + CAPAB_KNOCK, + CAPAB_CLIENT, + CAPAB_IPV6, + CAPAB_SSJ5, + CAPAB_SN2, + CAPAB_VHOST, + CAPAB_TOKEN, + CAPAB_SSJ3, + CAPAB_NICK2, + CAPAB_VL, + CAPAB_TLKEXT, + CAPAB_CHANMODE, + CAPAB_SJB64, + CAPAB_NICKCHARS, + + CAPAB_END +}; + +/* CAPAB stuffs */ +struct CapabInfo +{ + std::string Token; + CapabType Flag; +}; + +extern CoreExport Flags Capab; +extern CoreExport CapabInfo Capab_Info[]; + +/** Flags set on servers + */ +enum ServerFlag +{ + /* Server is syncing */ + SERVER_SYNCING, + /* This server was juped */ + SERVER_JUPED +}; + +/** Class representing a server + */ +class Server : public Flags +{ + private: + /* Server name */ + std::string Name; + /* Hops between services and server */ + unsigned int Hops; + /* Server description */ + std::string Description; + /* Server ID */ + std::string SID; + /* Links for this server */ + std::list* Links; + /* Uplink for this server */ + Server *UplinkServer; + + /* Reason this server was quit */ + std::string QReason; + + public: + /** Constructor + * @param uplink The uplink this server is from, is only NULL when creating Me + * @param name The server name + * @param hops Hops from services server + * @param description Server rdescription + * @param sid Server sid/numeric + */ + Server(Server *uplink, const std::string &name, unsigned int hops, const std::string &description, const std::string &sid); + + /** Destructor + */ + ~Server(); + + /** Delete this server with a reason + * @param reason The reason + */ + void Delete(const std::string &reason); + + /** Get the name for this server + * @return The name + */ + const std::string& GetName() const; + + /** Get the number of hops this server is from services + * @return Number of hops + */ + unsigned int GetHops() const; + + /** Set the server description + * @param desc The new description + */ + void SetDescription(const std::string& desc); + + /** Get the server description + * @return The server description + */ + const std::string& GetDescription() const; + + /** Get the server numeric/SID + * @return The numeric/SID + */ + const std::string& GetSID() const; + + /** Get the list of links this server has, or NULL if it has none + * @return A list of servers + */ + const std::list* GetLinks() const; + + /** Get the uplink server for this server, if this is our uplink will be Me + * @return The servers uplink + */ + Server* GetUplink() const; + + /** Adds a link to this server + * @param s The linking server + */ + void AddLink(Server *s); + + /** Delinks a server from this server + * @param s The server + */ + void DelLink(Server *s); + + /** Finish syncing this server and optionally all links to it + * @param SyncLinks True to sync the links for this server too (if any) + */ + void Sync(bool SyncLinks); + + /** Check if this server is synced + * @return true or false + */ + bool IsSynced() const; + + /** Check if this server is ULined + * @return true or false + */ + bool IsULined() const; + + /** Find a server + * @param name The name or SID/numeric + * @param s The server list to search for this server on, defaults to our Uplink + * @return The server + */ + static Server* Find(const std::string &name, Server *s = NULL); +}; + diff --git a/include/services.h b/include/services.h index 2741e0178..4dd35a751 100644 --- a/include/services.h +++ b/include/services.h @@ -348,6 +348,7 @@ template class Flags class User; class ChannelInfo; class Channel; +class Server; struct EList; typedef struct bandata_ BanData; @@ -675,50 +676,9 @@ typedef struct { } LevelInfo; -/*************************************************************************/ - -/* Server data */ - -typedef enum { - SSYNC_IN_PROGRESS = 0, /* Sync is currently in progress */ - SSYNC_DONE = 1 /* We're in sync */ -} SyncState; - -/** Flags set on servers - */ -enum ServerFlag -{ - SERVER_START, - - /* This server is me */ - SERVER_ISME, - /* This server was juped */ - SERVER_JUPED, - /* This server is the current uplink */ - SERVER_ISUPLINK, - - SERVER_END -}; - -class Server : public Flags -{ - public: - Server *next, *prev; - - char *name; /* Server name */ - uint16 hops; /* Hops between services and server */ - char *desc; /* Server description */ - char *suid; /* Server Univeral ID */ - SyncState sync; /* Server sync state (see above) */ - - Server *links; /* Linked list head for linked servers */ - Server *uplink; /* Server which pretends to be the uplink */ -}; - /*************************************************************************/ #include "users.h" - /* This structure stocks ban data since it must not be removed when * user is kicked. */ @@ -920,55 +880,6 @@ enum DefconLevel /*************************************************************************/ -/* Types of capab - */ -enum CapabType -{ - CAPAB_BEGIN, - - CAPAB_NOQUIT, - CAPAB_TSMODE, - CAPAB_UNCONNECT, - CAPAB_NICKIP, - CAPAB_NSJOIN, - CAPAB_ZIP, - CAPAB_BURST, - CAPAB_TS3, - CAPAB_TS5, - CAPAB_DKEY, - CAPAB_DOZIP, - CAPAB_DODKEY, - CAPAB_QS, - CAPAB_SCS, - CAPAB_PT4, - CAPAB_UID, - CAPAB_KNOCK, - CAPAB_CLIENT, - CAPAB_IPV6, - CAPAB_SSJ5, - CAPAB_SN2, - CAPAB_VHOST, - CAPAB_TOKEN, - CAPAB_SSJ3, - CAPAB_NICK2, - CAPAB_VL, - CAPAB_TLKEXT, - CAPAB_CHANMODE, - CAPAB_SJB64, - CAPAB_NICKCHARS, - - CAPAB_END -}; - -/* CAPAB stuffs */ -struct CapabInfo -{ - std::string Token; - CapabType Flag; -}; - -/*************************************************************************/ - /** * RFC: defination of a valid nick * nickname = ( letter / special ) *8( letter / digit / special / "-" ) @@ -986,7 +897,9 @@ struct CapabInfo class IRCDProto; struct Uplink; class ServerConfig; + #include "extern.h" +#include "servers.h" #include "configreader.h" class CoreExport IRCDProto diff --git a/src/Makefile b/src/Makefile index 949e7e8ec..be4004ec9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,8 @@ OBJS = actions.o base64.o bots.o botserv.o channels.o chanserv.o command.o commands.o compat.o \ - config.o encrypt.o hashcomp.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \ - memory.o memoserv.o messages.o misc.o modules.o nickserv.o operserv.o \ - process.o protocol.o send.o servers.o sessions.o slist.o sockets.o opertype.o users.o module.o modulemanager.o configreader.o \ - wildcard.o nickcore.o nickalias.o timers.o modes.o regchannel.o + config.o configreader.o encrypt.o hashcomp.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \ + memory.o memoserv.o messages.o misc.o modes.o modules.o module.o modulemanager.o nickalias.o \ + nickcore.o nickserv.o operserv.o process.o protocol.o regchannel.o send.o servers.o sessions.o slist.o \ + sockets.o timers.o opertype.o users.o wildcard.o INCLUDES = ../include/commands.h ../include/defs.h ../include/language.h \ ../include/pseudo.h ../include/sysconf.h ../include/config.h \ @@ -33,20 +33,17 @@ services: $(OBJS) $(MAKEBIN) $(CC) $(CFLAGS) $(OBJS) $(ANOPELIBS) $(MLIBS) -o $@ $(LDFLAGS) $(OBJS): Makefile -modes.o: modes.cpp $(INCLUDES) -timers.o: timers.cpp $(INCLUDES) -nickcore.o: nickcore.cpp $(INCLUDES) -nickalias.o: nickalias.cpp $(INCLUDES) actions.o: actions.c $(INCLUDES) base64.o: base64.c $(INCLUDES) bots.o: bots.cpp $(INCLUDES) botserv.o: botserv.c $(INCLUDES) channels.o: channels.c $(INCLUDES) chanserv.o: chanserv.c $(INCLUDES) -command.o: command.cpp $(INCLUDES) +command.o: command.cpp $(INCLUDES) commands.o: commands.c $(INCLUDES) compat.o: compat.c $(INCLUDES) config.o: config.c $(INCLUDES) +configreader.o: configreader.cpp $(INCLUDES) encrypt.o: encrypt.c $(INCLUDES) init.o: init.c $(INCLUDES) ircd.o: ircd.c $(INCLUDES) @@ -58,23 +55,26 @@ main.o: main.c $(INCLUDES) memory.o: memory.c $(INCLUDES) memoserv.o: memoserv.c $(INCLUDES) messages.o: messages.c $(INCLUDES) +modes.o: modes.cpp $(INCLUDES) modules.o: modules.c $(INCLUDES) module.o: module.cpp $(INCLUDES) modulemanager.o: modulemanager.cpp $(INCLUDES) misc.o: misc.c $(INCLUDES) +nickalias.o: nickalias.cpp $(INCLUDES) +nickcore.o: nickcore.cpp $(INCLUDES) nickserv.o: nickserv.c $(INCLUDES) operserv.o: operserv.c $(INCLUDES) +opertype.o: opertype.cpp $(INCLUDES) process.o: process.c $(INCLUDES) protocol.o: protocol.cpp $(INCLUDES) regchannel.o: regchannel.cpp $(INCLUDES) send.o: send.c $(INCLUDES) -servers.o: servers.c $(INCLUDES) +servers.o: servers.cpp $(INCLUDES) sessions.o: sessions.c $(INCLUDES) slist.o: slist.c $(INCLUDES) -sockets.o: sockets.cpp $(INCLUDES) -opertype.o: opertype.cpp $(INCLUDES) +sockets.o: sockets.cpp $(INCLUDES) +timers.o: timers.cpp $(INCLUDES) users.o: users.c $(INCLUDES) -vsnprintf.o: vsnprintf.c $(INCLUDES) wildcard.o: wildcard.cpp $(INCLUDES) modules: DUMMY diff --git a/src/bots.cpp b/src/bots.cpp index e663d9225..f65f2a35e 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -63,8 +63,7 @@ BotInfo::BotInfo(const std::string &nnick, const std::string &nuser, const std:: insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL. // If we're synchronised with the uplink already, call introduce_user() for this bot. - if (serv_uplink && serv_uplink->sync == SSYNC_DONE) - { + if (Me && Me->GetUplink()->IsSynced()) ircdproto->SendClientIntroduction(this->nick, this->user, this->host, this->real, ircd->pseudoclient_mode, this->uid); ircdproto->SendSQLine(this->nick, "Reserved for services"); } diff --git a/src/botserv.c b/src/botserv.c index 54b968dec..05c8ea2bd 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -665,7 +665,7 @@ static void check_ban(ChannelInfo *ci, User *u, int ttbtype) return; /* Don't ban ulines */ - if (is_ulined(u->server->name)) + if (u->server->IsULined()) return; bd->ttb[ttbtype]++; diff --git a/src/channels.c b/src/channels.c index b98a2f579..557894eff 100644 --- a/src/channels.c +++ b/src/channels.c @@ -118,7 +118,7 @@ void Channel::Sync() stick_all(this->ci); } - if (serv_uplink && is_sync(serv_uplink) && !this->topic_sync) + if (Me && Me->IsSynced() && !this->topic_sync) restore_topic(name.c_str()); } @@ -146,7 +146,7 @@ void Channel::JoinUser(User *user) } /* Added channelname to entrymsg - 30.03.2004, Certus */ /* Also, don't send the entrymsg when bursting -GD */ - if (this->ci && this->ci->entry_message && is_sync(user->server)) + if (this->ci && this->ci->entry_message && user->server->IsSynced()) user->SendMessage(whosends(this->ci)->nick, "[%s] %s", this->name.c_str(), this->ci->entry_message); } @@ -158,7 +158,7 @@ void Channel::JoinUser(User *user) * But don't join the bot if the channel is persistant - Adam * But join persistant channels when syncing with our uplink- DP **/ - if (Config.s_BotServ && this->ci && this->ci->bi && ((serv_uplink->sync == SSYNC_IN_PROGRESS) || !this->ci->HasFlag(CI_PERSIST))) + if (Config.s_BotServ && this->ci && this->ci->bi && (!Me->IsSynced() || !this->ci->HasFlag(CI_PERSIST))) { if (this->users.size() == Config.BSMinUsers) bot_join(this->ci); @@ -172,7 +172,7 @@ void Channel::JoinUser(User *user) * to has synced, or we'll get greet-floods when the net * recovers from a netsplit. -GD */ - if (is_sync(user->server)) + if (user->server->IsSynced()) { ircdproto->SendPrivmsg(this->ci->bi, this->name.c_str(), "[%s] %s", user->Account()->display, user->Account()->greet); this->ci->bi->lastmsg = time(NULL); @@ -975,7 +975,7 @@ bool Channel::Kick(BotInfo *bi, User *u, const char *reason, ...) va_end(args); /* May not kick ulines */ - if (is_ulined(u->server->name)) + if (u->server->IsULined()) return false; EventReturn MOD_RESULT; @@ -1513,7 +1513,7 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes) c->SetMode(NULL, CMODE_VOICE, user->nick); } /* If this channel has secureops or the user matches autodeop or the channel is syncing and this is the first user and they are not ulined, check to remove modes */ - if ((ci->HasFlag(CI_SECUREOPS) || check_access(user, ci, CA_AUTODEOP) || (c->HasFlag(CH_SYNCING) && c->users.size() == 1)) && !is_ulined(user->server->name)) + if ((ci->HasFlag(CI_SECUREOPS) || check_access(user, ci, CA_AUTODEOP) || (c->HasFlag(CH_SYNCING) && c->users.size() == 1)) && !user->server->IsULined()) { if (owner && c->HasUserStatus(user, CMODE_OWNER) && !IsFounder(user, ci)) c->RemoveMode(NULL, CMODE_OWNER, user->nick); diff --git a/src/core/cs_modes.c b/src/core/cs_modes.c index 3df93d912..06e737eff 100644 --- a/src/core/cs_modes.c +++ b/src/core/cs_modes.c @@ -380,7 +380,7 @@ class CSModes : public Module this->AddCommand(CHANSERV, new CommandCSVoice()); this->AddCommand(CHANSERV, new CommandCSDeVoice()); - if (serv_uplink && is_sync(serv_uplink)) + if (Me && Me->IsSynced()) OnUplinkSync(); Implementation i[] = { diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index a6f980ad0..18ff222b1 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -544,7 +544,7 @@ class CSXOP : public Module this->AddCommand(CHANSERV, new CommandCSAOP()); this->AddCommand(CHANSERV, new CommandCSVOP()); - if (serv_uplink && is_sync(serv_uplink)) + if (Me && Me->IsSynced()) OnUplinkSync(); Implementation i[] = { diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c index 403ac1281..654ed89cc 100644 --- a/src/core/os_defcon.c +++ b/src/core/os_defcon.c @@ -156,13 +156,11 @@ class OSDEFCON : public Module EventReturn OnPreUserConnect(User *u) { - std::string mask; - - if (u && is_sync(u->server) && CheckDefCon(DEFCON_AKILL_NEW_CLIENTS) && !is_ulined(u->server->name)) + if (u->server->IsSynced() && CheckDefCon(DEFCON_AKILL_NEW_CLIENTS) && !u->server->IsULined()) { if (CheckDefCon(DEFCON_AKILL_NEW_CLIENTS)) { - mask = "*@" + std::string(u->host); + std::string mask = "*@" + std::string(u->host); Alog() << "DEFCON: adding akill for " << mask; add_akill(NULL, mask.c_str(), Config.s_OperServ, time(NULL) + Config.DefConAKILL, diff --git a/src/core/os_jupe.c b/src/core/os_jupe.c index 9af3d3176..899dd4ea4 100644 --- a/src/core/os_jupe.c +++ b/src/core/os_jupe.c @@ -25,18 +25,20 @@ class CommandOSJupe : public Command { const char *jserver = params[0].c_str(); const char *reason = params.size() > 1 ? params[1].c_str() : NULL; - Server *server = findserver(servlist, jserver); + Server *server = Server::Find(jserver); if (!isValidHost(jserver, 3)) notice_lang(Config.s_OperServ, u, OPER_JUPE_HOST_ERROR); - else if (server && (server->HasFlag(SERVER_ISME) || server->HasFlag(SERVER_ISUPLINK))) + else if (server && (server == Me || server == Me->GetUplink())) notice_lang(Config.s_OperServ, u, OPER_JUPE_INVALID_SERVER); - else { + else + { char rbuf[256]; snprintf(rbuf, sizeof(rbuf), "Juped by %s%s%s", u->nick.c_str(), reason ? ": " : "", reason ? reason : ""); - if (findserver(servlist, jserver)) + if (server) ircdproto->SendSquit(jserver, rbuf); - Server *juped_server = new_server(me_server, jserver, rbuf, SERVER_JUPED, ircd->ts6 ? ts6_sid_retrieve() : ""); + Server *juped_server = new Server(Me, jserver, 0, rbuf, ircd->ts6 ? ts6_sid_retrieve() : ""); + juped_server->SetFlag(SERVER_JUPED); ircdproto->SendServer(juped_server); if (Config.WallOSJupe) diff --git a/src/core/os_noop.c b/src/core/os_noop.c index c0fc33161..eec054ea4 100644 --- a/src/core/os_noop.c +++ b/src/core/os_noop.c @@ -44,7 +44,7 @@ class CommandOSNOOP : public Command for (u2 = firstuser(); u2; u2 = u3) { u3 = nextuser(); - if (u2 && is_oper(u2) && u2->server->name && Anope::Match(u2->server->name, server, true)) + if (u2 && is_oper(u2) && Anope::Match(u2->server->GetName(), server, true)) kill_user(Config.s_OperServ, u2->nick.c_str(), reason.c_str()); } } diff --git a/src/core/os_stats.c b/src/core/os_stats.c index 711e1f646..9dae3474a 100644 --- a/src/core/os_stats.c +++ b/src/core/os_stats.c @@ -21,16 +21,19 @@ void get_operserv_stats(long *nrec, long *memuse); * @param s The server to start counting from * @return Amount of servers connected to server s **/ -int stats_count_servers(Server *s) +static int stats_count_servers(Server *s) { - int count = 0; + if (!s) + return 0; + + int count = 1; - while (s) + if (s->GetLinks()) { - ++count; - if (s->links) - count += stats_count_servers(s->links); - s = s->next; + for (std::list::const_iterator it = s->GetLinks()->begin(); it != s->GetLinks()->end(); ++it) + { + count += stats_count_servers(*it); + } } return count; @@ -214,9 +217,9 @@ class CommandOSStats : public Command if (!buf.empty()) buf.erase(buf.begin()); - notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_SERVER, serv_uplink->name); + notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_SERVER, Me->GetUplink()->GetName().c_str()); notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_CAPAB, buf.c_str()); - notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_SERVER_COUNT, stats_count_servers(serv_uplink)); + notice_lang(Config.s_OperServ, u, OPER_STATS_UPLINK_SERVER_COUNT, stats_count_servers(Me->GetUplink())); return MOD_CONT; } diff --git a/src/main.c b/src/main.c index d17d98a39..234a2e023 100644 --- a/src/main.c +++ b/src/main.c @@ -235,8 +235,6 @@ static void services_shutdown() if (started && UplinkSock) { ircdproto->SendSquit(Config.ServerName, quitmsg); - if (uplink) - delete [] uplink; u = firstuser(); while (u) { next = nextuser(); diff --git a/src/modules.c b/src/modules.c index af3aa2f4d..97a3b55c6 100644 --- a/src/modules.c +++ b/src/modules.c @@ -76,10 +76,6 @@ int protocol_module_init() Alog() << "This IRCd protocol requires a server id to be set in Anope's configuration."; ret = -1; } - else - { - ts6_uid_init(); - } } } diff --git a/src/operserv.c b/src/operserv.c index 455d74923..a5d0f0d61 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -144,60 +144,49 @@ void operserv(User * u, char *buf) /*************************************************************************/ /*********************** OperServ command functions **********************/ -/*************************************************************************/ +/******************************* + * ******************************************/ /*************************************************************************/ -Server *server_global(Server * s, char *msg) +void server_global(Server *s, const std::string &message) { - Server *sl; - - while (s) { - /* Do not send the notice to ourselves our juped servers */ - if (!s->HasFlag(SERVER_ISME) && !s->HasFlag(SERVER_JUPED)) - notice_server(Config.s_GlobalNoticer, s, "%s", msg); - - if (s->links) { - sl = server_global(s->links, msg); - if (sl) - s = sl; - else - s = s->next; - } else { - s = s->next; + /* Do not send the notice to ourselves our juped servers */ + if (s != Me && !s->HasFlag(SERVER_JUPED)) + notice_server(Config.s_GlobalNoticer, s, "%s", message.c_str()); + + if (s->GetLinks()) + { + for (std::list::const_iterator it = s->GetLinks()->begin(); it != s->GetLinks()->end(); ++it) + { + server_global(*it, message); } } - return s; - } void oper_global(char *nick, const char *fmt, ...) { va_list args; char msg[2048]; /* largest valid message is 512, this should cover any global */ - char dmsg[2048]; /* largest valid message is 512, this should cover any global */ va_start(args, fmt); vsnprintf(msg, sizeof(msg), fmt, args); va_end(args); /* I don't like the way this is coded... */ - if ((nick) && (!Config.AnonymousGlobal)) { - snprintf(dmsg, sizeof(dmsg), "[%s] %s", nick, msg); - server_global(servlist, dmsg); - } else { - server_global(servlist, msg); + if (nick && !Config.AnonymousGlobal) + { + std::string rmsg = std::string("[") + nick + std::string("] ") + msg; + server_global(Me->GetUplink(), rmsg.c_str()); } + else + server_global(Me->GetUplink(), msg); } /**************************************************************************/ - -/************************************************************************/ -/*************************************************************************/ - /* Adds an AKILL to the list. Returns >= 0 on success, -1 if it fails, -2 * if only the expiry time was changed. * The success result is the number of AKILLs that were deleted to successfully add one. diff --git a/src/protocol.cpp b/src/protocol.cpp index 2188e86ba..761df1ca1 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -153,12 +153,12 @@ void IRCDProto::SendPrivmsg(BotInfo *bi, const char *dest, const char *fmt, ...) void IRCDProto::SendGlobalNotice(BotInfo *bi, Server *dest, const char *msg) { - send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NOTICE %s%s :%s", ircd->globaltldprefix, dest->name, msg); + send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NOTICE %s%s :%s", ircd->globaltldprefix, dest->GetName().c_str(), msg); } void IRCDProto::SendGlobalPrivmsg(BotInfo *bi, Server *dest, const char *msg) { - send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest->name, msg); + send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest->GetName().c_str(), msg); } void IRCDProto::SendQuit(const char *nick, const char *) diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 1e38a4aa2..d84d3f25a 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -273,15 +273,15 @@ class BahamutIRCdProto : public IRCDProto /* SERVER */ void SendServer(Server *server) { - send_cmd(NULL, "SERVER %s %d :%s", server->name, server->hops, server->desc); + send_cmd(NULL, "SERVER %s %d :%s", server->GetName().c_str(), server->GetHops(), server->GetDescription().c_str()); } void SendConnect() { + Me = new Server(NULL, Config.ServerName, 0, Config.ServerDesc, ""); bahamut_cmd_pass(uplink_server->password); bahamut_cmd_capab(); - me_server = new_server(NULL, Config.ServerName, Config.ServerDesc, SERVER_ISME, ""); - SendServer(me_server); + SendServer(Me); bahamut_cmd_svinfo(); bahamut_cmd_burst(); } @@ -575,11 +575,7 @@ int anope_event_436(const char *source, int ac, const char **av) /* EVENT : SERVER */ int anope_event_server(const char *source, int ac, const char **av) { - if (!stricmp(av[1], "1")) { - uplink = sstrdup(av[0]); - } - - do_server(source, av[0], av[1], av[2], ""); + do_server(source, av[0], atoi(av[1]), av[2], ""); return MOD_CONT; } @@ -711,8 +707,8 @@ int anope_event_error(const char *source, int ac, const char **av) int anope_event_burst(const char *source, int ac, const char **av) { - Server *s; - s = findserver(se