diff options
author | Adam <Adam@Anope.org> | 2010-05-24 23:36:40 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-18 21:04:05 -0400 |
commit | 2fba686904e6f78ebab35df171c5757afeebf05d (patch) | |
tree | 523782bccc479606206f271cd6708b2f70fe8278 | |
parent | 3a2c2a916a26f4fa1844e71a9f1c2fc25337fd2b (diff) |
Burned slist, rewrote operservs XLine code
72 files changed, 3155 insertions, 3618 deletions
diff --git a/data/example.conf b/data/example.conf index aa7d9ab8b..0954b8d0d 100644 --- a/data/example.conf +++ b/data/example.conf @@ -603,7 +603,7 @@ options * * operserv/global operserv/news operserv/stats operserv/kick * operserv/mode operserv/session operserv/modlist operserv/ignore - * operserv/chankill operserv/akill operserv/sqline operserv/sgline + * operserv/chankill operserv/akill operserv/sqline operserv/snline * operserv/szline operserv/clearmodes operserv/staff operserv/defcon * operserv/modload operserv/jupe operserv/set operserv/noop * operserv/quit operserv/update operserv/reload operserv/restart @@ -636,7 +636,7 @@ opertype inherits = "Helper, Another Helper" /* What commands (see above) this opertype may use */ - commands = "chanserv/list chanserv/suspend chanserv/status chanserv/topic memoserv/staff nickserv/sendpass nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/szline operserv/akill operserv/session operserv/clearmodes operserv/modlist operserv/sqline operser/staff operserv/kick operserv/ignore operserv/sgline" + commands = "chanserv/list chanserv/suspend chanserv/status chanserv/topic memoserv/staff nickserv/sendpass nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/szline operserv/akill operserv/session operserv/clearmodes operserv/modlist operserv/sqline operserv/staff operserv/kick operserv/ignore operserv/snline" /* What privs (see above) this opertype has */ privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auxpex nickserv/confirm" @@ -1264,7 +1264,7 @@ operserv * The core modules to load for OperServ. This is a space separated list that corresponds * to the base names of the modules for OperServ. This directive is optional, but highly recommended. */ - modules = "os_help os_global os_stats os_staff os_mode os_kick os_clearmodes os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_news os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo" + modules = "os_help os_global os_stats os_staff os_mode os_kick os_clearmodes os_akill os_snline os_sqline os_szline os_chanlist os_userlist os_news os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo" /* * If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant @@ -1280,12 +1280,12 @@ operserv logmaxusers = yes /* - * These define the default expiration times for, respectively, AKILLs, CHANKILLs, SGLINEs, + * These define the default expiration times for, respectively, AKILLs, CHANKILLs, SNLINEs, * SQLINEs, and SZLINEs. */ autokillexpiry = 30d chankillexpiry = 30d - sglineexpiry = 30d + snlineexpiry = 30d sqlineexpiry = 30d szlineexpiry = 30d @@ -1297,11 +1297,11 @@ operserv #akillonadd = yes /* - * If set, this option will make Services send an (SVS)KILL command immediately after SGLINE ADD. - * This eliminates the need for killingthe user after the SGLINE has been added. This directive + * If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD. + * This eliminates the need for killingthe user after the SNLINE has been added. This directive * is optional. */ - #killonsgline = yes + #killonsnline = yes /* * If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD. @@ -1321,13 +1321,13 @@ operserv * - osclearmodes: OperServ's CLEARMODES command was used * - oskick: OperServ's KICK command was used * - osakill: OperServ's AKILL command was used - * - ossgline: OperServ's SGLINE command was used + * - ossnline: OperServ's SNLINE command was used * - ossqline: OperServ's SQLINE command was used * - osszline: OperServ's SZLINE command was used * - osnoop: OperServ's NOOP command was used * - osjupe: OperServ's JUPE command was used * - akillexpire: An AKILL has expired - * - sglineexpire: An SGLINE has expired + * - snlineexpire: An SNLINE has expired * - sqlineexpire: An SQLINE has expired * - szlineexpire: An SZLINE has expired * - exceptionexpire: A session exception has expired @@ -1340,7 +1340,7 @@ operserv * * This directive is optional, if left blank, there will be no notifications. */ - notifications="osglobal osmode osclearmodes oskick osakill ossgline ossqline osszline osnoop osjupe getpass setpass forbid drop" + notifications="osglobal osmode osclearmodes oskick osakill ossnline ossqline osszline osnoop osjupe getpass setpass forbid drop" /* * Enables session limiting. Session limiting prevents users from connecting more than a certain diff --git a/data/tables.sql b/data/tables.sql index 23ba0ca50..deeef41cc 100644 --- a/data/tables.sql +++ b/data/tables.sql @@ -322,7 +322,7 @@ CREATE TABLE anope_os_core ( maxusercnt int(11) NOT NULL default '0', maxusertime int(10) unsigned NOT NULL default '0', akills_count int(11) NOT NULL default '0', - sglines_count int(11) NOT NULL default '0', + snlines_count int(11) NOT NULL default '0', sqlines_count int(11) NOT NULL default '0', szlines_count int(11) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; @@ -346,11 +346,11 @@ CREATE TABLE anope_os_exceptions ( -- -------------------------------------------------------- -- --- Table structure for table 'anope_os_sxlines' +-- Table structure for table 'anope_os_xlines' -- -DROP TABLE IF EXISTS anope_os_sxlines; -CREATE TABLE anope_os_sxlines ( +DROP TABLE IF EXISTS anope_os_xlines; +CREATE TABLE anope_os_xlines ( type varchar(20) NOT NULL, mask varchar(255) NOT NULL, xby text NOT NULL, diff --git a/docs/Changes b/docs/Changes index d88eae010..7786757fa 100644 --- a/docs/Changes +++ b/docs/Changes @@ -6,6 +6,7 @@ A Added official support for InspIRCd 2.0 A Prevent negaitve mode changes, kicks, bans, and autokicks from affecting people with the 'god' user mode (On UnrealIRCd, usermode +q) A Added nickserv/auxpex permission A Added nickserv ungroup command +A Renamed the SGLINE to be SNLINE Anope Version 1.9.2 -------------------- diff --git a/docs/Changes.conf b/docs/Changes.conf index 944238db6..03d012a14 100644 --- a/docs/Changes.conf +++ b/docs/Changes.conf @@ -6,6 +6,11 @@ SSL module added for SSL support opertype:inherits added to allow opertypes to inherit commands and privs from other opertypes ** MODIFIED CONFIGURATION DIRECTIVES ** +opertype:commands changed operserv/sgline to opserv/snline +operserv:modules changed os_sgline to os_snline +operserv:sglineexpiry changed to operserv:snlineexpiry +operserv:killonsgline changed to operserv:killonsnline +operserv:notifications ossgline changed ossnline ** DELETED CONFIGURATION DIRECTIVES ** diff --git a/docs/Changes.lang b/docs/Changes.lang index 4289ba295..701d4fff4 100644 --- a/docs/Changes.lang +++ b/docs/Changes.lang @@ -12,6 +12,31 @@ Anope Version 1.9.3 NICK_MAIL_TEXT NICK_SENDPASS CHAN_LEVEL_FOUNDER + OPER_STATS_SNLINE_COUNT + OPER_STATS_SNLINE_EXPIRE_DAY + OPER_STATS_SNLINE_EXPIRE_HOURS + OPER_STATS_SNLINE_EXPIRE_MINS + OPER_STATS_SNLINE_EXPIRE_MIN + OPER_STATS_SNLINE_EXPIRE_NONE + OPER_SNLINE_SYNTAX + OPER_SNLINE_UNSUPPORTED + OPER_SNLINE_EXISTS + OPER_SNLINE_ALREADY_COVERED + OPER_SNLINE_REACHED_LIMIT + OPER_SNLINE_ADDED + OPER_SNLINE_CHANGED + OPER_SNLINE_NOT_FOUND + OPER_SNLINE_NO_MATCH + OPER_SNLINE_DELETED + OPER_SNLINE_DELETED_ONE + OPER_SNLINE_DELETED_SEVERAL + OPER_SNLINE_LIST_EMPTY + OPER_SNLINE_LIST_HEADER + OPER_SNLINE_LIST_FORMAT + OPER_SNLINE_VIEW_HEADER + OPER_SNLINE_CLEAR + OPER_HELP_CMD_SNLINE + OPER_HELP_SNLINE *** Mod Strings: NICK_GLIST_REPLY @@ -34,6 +59,34 @@ Anope Version 1.9.3 NICK_SENDPASS_HEAD_3 NICK_SENDPASS_HEAD_4 NICK_SENDPASS_HEAD_5 +<<<<<<< HEAD + OPER_STATS_SGLINE_COUNT + OPER_STATS_SGLINE_EXPIRE_DAY + OPER_STATS_SGLINE_EXPIRE_HOURS + OPER_STATS_SGLINE_EXPIRE_MINS + OPER_STATS_SGLINE_EXPIRE_MIN + OPER_STATS_SGLINE_EXPIRE_NONE + OPER_SGLINE_SYNTAX + OPER_SGLINE_UNSUPPORTED + OPER_SGLINE_EXISTS + OPER_SGLINE_ALREADY_COVERED + OPER_SGLINE_REACHED_LIMIT + OPER_SGLINE_ADDED + OPER_SGLINE_CHANGED + OPER_SGLINE_NOT_FOUND + OPER_SGLINE_NO_MATCH + OPER_SGLINE_DELETED + OPER_SGLINE_DELETED_ONE + OPER_SGLINE_DELETED_SEVERAL + OPER_SGLINE_LIST_EMPTY + OPER_SGLINE_LIST_HEADER + OPER_SGLINE_LIST_FORMAT + OPER_SGLINE_VIEW_HEADER + OPER_SGLINE_CLEAR + OPER_HELP_CMD_SGLINE + OPER_HELP_SGLINE +======= +>>>>>>> 1.9.3-2 Anope Version 1.9.2 -------------------- @@ -85,7 +85,7 @@ How To Add IRCd Support 6) VHOST: Can a user's host be changed on the fly? Enabling this allow
HostServ online. Use 1 for yes, 0 for no.
- 7) SGLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
+ 7) SNLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
0 for no.
8) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
@@ -172,7 +172,7 @@ How To Add IRCd Support 35) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
1 for yes, 0 for no.
- 36) SGline Enforce: Does the IRCd enforce SGLINES for us or do we need to
+ 36) SGline Enforce: Does the IRCd enforce SNLINES for us or do we need to
do so? Use 1 for yes, 0 for no.
37) Vhost Character: The character used to represent the vHost mode, if
diff --git a/include/Makefile b/include/Makefile index 4c20fa502..de32199d3 100644 --- a/include/Makefile +++ b/include/Makefile @@ -7,9 +7,6 @@ version.h: Makefile version.sh services.h $(SRCS) services.h: sysconf.h config.h extern.h touch $@ -extern.h: slist.h - touch $@ - clean: (rm -f language.h) diff --git a/include/account.h b/include/account.h index 1a567c317..e44880c29 100644 --- a/include/account.h +++ b/include/account.h @@ -161,7 +161,7 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag> /* Unsaved data */ time_t lastmail; /* Last time this nick record got a mail */ - SList aliases; /* List of aliases */ + std::list<NickAlias *> aliases; /* List of aliases */ /** Check whether this opertype has access to run the given command string. * @param cmdstr The string to check, e.g. botserv/set/private. diff --git a/include/config.h b/include/config.h index c6dbbefb8..dacf3db06 100644 --- a/include/config.h +++ b/include/config.h @@ -623,16 +623,16 @@ class ServerConfig time_t AutokillExpiry; /* Default expiry time for chan kills */ time_t ChankillExpiry; - /* Default expiry time for SGLine Expire */ - time_t SGLineExpiry; + /* Default expiry time for SNLine Expire */ + time_t SNLineExpiry; /* Default expiry time for SQLines */ time_t SQLineExpiry; /* Default expiry time for SZLine */ time_t SZLineExpiry; /* Actually akill the user when the akill is added */ bool AkillOnAdd; - /* Kill users on SGline */ - bool KillonSGline; + /* Kill users on SNLine */ + bool KillonSNline; /* Kill users on SQline */ bool KillonSQline; /* Send a WALLOPS/GLOBOPS when a user opers */ @@ -649,8 +649,8 @@ class ServerConfig bool WallOSKick; /* Send a WALLOPS/GLOBOPS when someone uses the AKILL command */ bool WallOSAkill; - /* Send a WALLOPS/GLOBOPS when someone uses the SGLINE command */ - bool WallOSSGLine; + /* Send a WALLOPS/GLOBOPS when someone uses the SNLINE command */ + bool WallOSSNLine; /* Send a WALLOPS/GLOBOPS when someone uses the SQLINE command */ bool WallOSSQLine; /* Send a WALLOPS/GLOBOPS when someone uses the SZLINE command */ @@ -661,8 +661,8 @@ class ServerConfig bool WallOSJupe; /* Send a WALLOPS/GLOBOPS when an akill expires */ bool WallAkillExpire; - /* Send a WALLOPS/GLOBOPS when SGLines expire */ - bool WallSGLineExpire; + /* Send a WALLOPS/GLOBOPS when SNLines expire */ + bool WallSNLineExpire; /* Send a WALLOPS/GLOBOPS when SQLines expire */ bool WallSQLineExpire; /* Send a WALLOPS/GLOBOPS when SZLines expire */ diff --git a/include/extern.h b/include/extern.h index 6f41c3977..1e88561e3 100644 --- a/include/extern.h +++ b/include/extern.h @@ -17,7 +17,6 @@ #define E extern CoreExport #define EI extern DllExport -#include "slist.h" #include "hashcomp.h" E void ModuleRunTimeDirCleanUp(); @@ -33,7 +32,6 @@ E IRCDProto *ircdproto; E void kill_user(const std::string &source, const std::string &user, const std::string &reason); E bool bad_password(User *u); -E void sqline(const std::string &mask, const std::string &reason); E void common_unban(ChannelInfo *ci, const std::string &nick); E BotInfo *BotServ; @@ -372,50 +370,6 @@ E NickCore *findcore(const std::string &nick); E NickCore *findcore(const ci::string &nick); E bool is_on_access(User *u, NickCore *nc); -/**** operserv.c ****/ - -E SList akills, sglines, sqlines, szlines; - -E int DefConModesSet; -E Flags<ChannelModeName> DefConModesOn; -E Flags<ChannelModeName> DefConModesOff; -E std::map<ChannelModeName, std::string> DefConModesOnParams; -E bool SetDefConParam(ChannelModeName, std::string &); -E bool GetDefConParam(ChannelModeName, std::string *); -E void UnsetDefConParam(ChannelModeName); - -E void operserv(User *u, char *buf); -E void os_init(); - -E int add_akill(User *u, const char *mask, const char *by, const time_t expires, const char *reason); -E int check_akill(const char *nick, const char *username, const char *host, const char *vhost, const char *ip); -E void expire_akills(); -E void oper_global(char *nick, const char *fmt, ...); - -E int add_sgline(User *u, const char *mask, const char *by, time_t expires, const char *reason); -E int check_sgline(const char *nick, const char *realname); -E void expire_sglines(); - -E int add_sqline(User *u, const char *mask, const char *by, time_t expires, const char *reason); -E int check_sqline(const char *nick, int nick_change); -E void expire_sqlines(); -E int check_chan_sqline(const char *chan); - -E int add_szline(User * u, const char *mask, const char *by, - time_t expires, const char *reason); -E void expire_szlines(); -E int check_szline(const char *nick, char *ip); - -E void server_global(Server *s, const std::string &message); - -E std::vector<NewsItem *> News; - -E bool CheckDefCon(DefconLevel Level); -E bool CheckDefCon(int level, DefconLevel Level); -E void AddDefCon(int level, DefconLevel Level); -E void DelDefCon(int level, DefconLevel Level); -E std::vector<std::bitset<32> > DefCon; - /**** process.c ****/ E int allow_ignore; @@ -463,19 +417,6 @@ E int exception_add(User * u, const char *mask, const int limit, const char *reason, const char *who, const time_t expires); -/**** slist.c ****/ -E int slist_add(SList *slist, void *item); -E void slist_clear(SList *slist, int free); -E int slist_delete(SList *slist, int index); -E int slist_delete_range(SList *slist, const char *range, slist_delcheckcb_t cb, ...); -E int slist_enum(SList *slist, const char *range, slist_enumcb_t cb, ...); -E int slist_full(SList *slist); -E int slist_indexof(SList *slist, void *item); -E void slist_init(SList *slist); -E void slist_pack(SList *slist); -E int slist_remove(SList *slist, void *item); -E int slist_setcapacity(SList *slist, int16 capacity); - /**** sockets.cpp ****/ E SocketEngine socketEngine; E int32 TotalRead; diff --git a/include/modules.h b/include/modules.h index 98dfd6d3e..963e07a4c 100644 --- a/include/modules.h +++ b/include/modules.h @@ -713,13 +713,13 @@ class CoreExport Module * @param ak The akill * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it */ - virtual EventReturn OnAddAkill(User *u, Akill *ak) { return EVENT_CONTINUE; } + virtual EventReturn OnAddAkill(User *u, XLine *ak) { return EVENT_CONTINUE; } /** Called before an akill is deleted * @param u The user removing the akill * @param ak The akill, can be NULL for all akills! */ - virtual void OnDelAkill(User *u, Akill *ak) { } + virtual void OnDelAkill(User *u, XLine *ak) { } /** Called after an exception has been added * @param u The user who added it @@ -734,20 +734,20 @@ class CoreExport Module */ virtual void OnExceptionDel(User *u, Exception *ex) { } - /** Called before a SXLine is added - * @param u The user adding the SXLine - * @param sx The SXLine - * @param Type The type of SXLine this is + /** Called before a XLine is added + * @param u The user adding the XLine + * @param sx The XLine + * @param Type The type of XLine this is * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it */ - virtual EventReturn OnAddSXLine(User *u, SXLine *sx, SXLineType Type) { return EVENT_CONTINUE; } + virtual EventReturn OnAddXLine(User *u, XLine *x, XLineType Type) { return EVENT_CONTINUE; } - /** Called before a SXLine is deleted - * @param u The user deleting the SXLine - * @param sx The SXLine, can be NULL for all SXLines - * @param Type The type of SXLine this is + /** Called before a XLine is deleted + * @param u The user deleting the XLine + * @param sx The XLine, can be NULL for all XLines + * @param Type The type of XLine this is */ - virtual void OnDelSXLine(User *u, SXLine *sx, SXLineType Type) { } + virtual void OnDelXLine(User *u, XLine *x, XLineType Type) { } /** Called when a server quits * @param server The server @@ -1118,7 +1118,7 @@ enum Implementation /* OperServ */ I_OnOperServHelp, I_OnDefconLevel, I_OnAddAkill, I_OnDelAkill, I_OnExceptionAdd, I_OnExceptionDel, - I_OnAddSXLine, I_OnDelSXLine, + I_OnAddXLine, I_OnDelXLine, /* Database */ I_OnPostLoadDatabases, I_OnSaveDatabase, I_OnLoadDatabase, diff --git a/include/operserv.h b/include/operserv.h new file mode 100644 index 000000000..ff2149372 --- /dev/null +++ b/include/operserv.h @@ -0,0 +1,231 @@ +/* OperServ support + * + * (C) 2008-2010 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * $Id$ + * + */ + +extern CoreExport std::vector<NewsItem *> News; +extern CoreExport std::vector<std::bitset<32> > DefCon; +extern CoreExport bool DefConModesSet; +extern CoreExport Flags<ChannelModeName> DefConModesOn; +extern CoreExport Flags<ChannelModeName> DefConModesOff; +extern CoreExport std::map<ChannelModeName, std::string> DefConModesOnParams; + +class XLineManager; +extern CoreExport XLineManager *SGLine; +extern CoreExport XLineManager *SZLine; +extern CoreExport XLineManager *SQLine; +extern CoreExport XLineManager *SNLine; + +extern CoreExport bool SetDefConParam(ChannelModeName, std::string &); +extern CoreExport bool GetDefConParam(ChannelModeName, std::string &); +extern CoreExport void UnsetDefConParam(ChannelModeName); +extern CoreExport bool CheckDefCon(DefconLevel Level); +extern CoreExport bool CheckDefCon(int level, DefconLevel Level); +extern CoreExport void AddDefCon(int level, DefconLevel Level); +extern CoreExport void DelDefCon(int level, DefconLevel Level); + +extern CoreExport void operserv(User *u, char *buf); +extern CoreExport void os_init(); + +extern CoreExport void oper_global(char *nick, const char *fmt, ...); +extern CoreExport void server_global(Server *s, const std::string &message); + +enum XLineType +{ + X_SNLINE, + X_SQLINE, + X_SZLINE +}; + +struct XLine +{ + ci::string Mask; + ci::string By; + time_t Created; + time_t Expires; + std::string Reason; + + XLine(const ci::string &mask, const std::string &reason = ""); + + XLine(const ci::string &mask, const ci::string &by, const time_t expires, const std::string &reason); + + ci::string GetNick() const; + ci::string GetUser() const; + ci::string GetHost() const; +}; + +class CoreExport XLineManager +{ + private: + /* List of XLine managers we check users against in XLineManager::CheckAll */ + static std::list<XLineManager *> XLineManagers; + + protected: + /* List of XLines in this XLineManager */ + std::deque<XLine *> XLines; + public: + /** Constructor + */ + XLineManager(); + + /** Destructor + */ + virtual ~XLineManager(); + + /** Register a XLineManager, places it in XLineManagers for use in XLineManager::CheckAll + * It is important XLineManagers are registered in the proper order. Eg, if you had one akilling + * clients and one handing them free olines, you would want the akilling one first. This way if a client + * matches an entry on both of the XLineManagers, they would be akilled. + * @param xlm THe XLineManager + */ + static void RegisterXLineManager(XLineManager *xlm); + + /** Unregister a XLineManager + * @param xlm The XLineManager + */ + static void UnregisterXLineManager(XLineManager *xlm); + + /** Check a user against all known XLineManagers + * Wparam u The user + * @return A pair of the XLineManager the user was found in and the XLine they matched, both may be NULL for no match + */ + static std::pair<XLineManager *, XLine *> CheckAll(User *u); + + /** Get the number of XLines in this XLineManager + * @return The number of XLines + */ + const size_t GetCount() const; + + /** Get the XLine list + * @return The list + */ + const std::deque<XLine *>& GetList() const; + + /** Add an entry to this XLineManager + * @param x The entry + */ + void AddXLine(XLine *x); + + /** Delete an entry from this XLineManager + * @param x The entry + * @return true if the entry was found and deleted, else false + */ + bool DelXLine(XLine *x); + + /** Gets an entry by index + * @param index The index + * @return The XLine, or NULL if the index is out of bounds + */ + XLine *GetEntry(unsigned index) const; + + /** Clear the XLine list + */ + void Clear(); + + /** Add an entry to this XLine Manager + * @param bi The bot error replies should be sent from + * @param u The user adding the XLine + * @param mask The mask of the XLine + * @param expires When this should expire + * @param reaosn The reason + * @return A pointer to the XLine + */ + virtual XLine *Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason); + + /** Delete an XLine, eg, remove it from the IRCd. + * @param x The xline + */ + virtual void Del(XLine *x); + + /** Checks if a mask can/should be added to the XLineManager + * @param mask The mask + * @param expires When the mask would expire + * @return A pair of int and XLine*. + * 1 - Mask already exists + * 2 - Mask already exists, but the expiry time was changed + * 3 - Mask is already covered by another mask + * In each case the XLine it matches/is covered by is returned in XLine* + */ + std::pair<int, XLine *> CanAdd(const ci::string &mask, time_t expires); + + /** Checks if this list has an entry + * @param mask The mask + * @return The XLine the user matches, or NULL + */ + XLine *HasEntry(const ci::string &mask) const; + + /** Check a user against all of the xlines in this XLineManager + * @param u The user + * @return The xline the user marches, if any. Also calls OnMatch() + */ + virtual XLine *Check(User *u); + + /** Called when a user matches a xline in this XLineManager + * @param u The user + * @param x The XLine they match + */ + virtual void OnMatch(User *u, XLine *x); + + /** Called when an XLine expires + * @param x The xline + */ + virtual void OnExpire(XLine *x); +}; + +/* This is for AKILLS */ +class SGLineManager : public XLineManager +{ + public: + XLine *Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason); + + void Del(XLine *x); + + void OnMatch(User *u, XLine *x); + + void OnExpire(XLine *x); +}; + +class SNLineManager : public XLineManager +{ + public: + XLine *Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason); + + void Del(XLine *x); + + void OnMatch(User *u, XLine *x); + + void OnExpire(XLine *x); +}; + +class SQLineManager : public XLineManager +{ + public: + XLine *Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason); + + void Del(XLine *x); + + void OnMatch(User *u, XLine *x); + + void OnExpire(XLine *x); + + static bool Check(Channel *c); +}; + +class SZLineManager : public XLineManager +{ + public: + XLine *Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason); + + void Del(XLine *x); + + void OnMatch(User *u, XLine *x); + + void OnExpire(XLine *x); +}; + diff --git a/include/services.h b/include/services.h index 0a4648105..a84e6ae8c 100644 --- a/include/services.h +++ b/include/services.h @@ -202,7 +202,6 @@ extern int strncasecmp(const char *, const char *, size_t); /* Miscellaneous definitions. */ #include "hashcomp.h" -#include "slist.h" /* Pull in the various bits of STL */ #include <iostream> @@ -359,7 +358,6 @@ struct Session; typedef struct bandata_ BanData; typedef struct mailinfo_ MailInfo; -typedef struct akill_ Akill; typedef struct exception_ Exception; #include "extensible.h" @@ -381,7 +379,7 @@ struct ircdvars_ { const char *botchanumode; /* Modes set when botserv joins a channel */ int svsnick; /* Supports SVSNICK */ int vhost; /* Supports vhost */ - int sgline; /* Supports SGline */ + int snline; /* Supports SNline */ int sqline; /* Supports SQline */ int szline; /* Supports SZline */ int numservargs; /* Number of Server Args */ @@ -780,39 +778,6 @@ struct mailinfo_ { /*************************************************************************/ -struct akill_ { - char *user; /* User part of the AKILL */ - char *host; /* Host part of the AKILL */ - - char *by; /* Who set the akill */ - char *reason; /* Why they got akilled */ - - time_t seton; /* When it was set */ - time_t expires; /* When it expires */ -}; - -/*************************************************************************/ - -/* Structure for OperServ SGLINE and SZLINE commands */ - -enum SXLineType -{ - SX_SGLINE, - SX_SQLINE, - SX_SZLINE -}; - -struct SXLine { - char *mask; - char *by; - char *reason; - time_t seton; - time_t expires; -}; - - -/************************************************************************/ - struct exception_ { char *mask; /* Hosts to which this exception applies */ int limit; /* Session limit for exception */ @@ -906,6 +871,7 @@ struct Uplink; class ServerConfig; #include "extern.h" +#include "operserv.h" #include "mail.h" #include "servers.h" #include "config.h" @@ -933,8 +899,8 @@ class CoreExport IRCDProto virtual void SendSVSNOOP(const char *, int) { } virtual void SendTopic(BotInfo *, Channel *, const char *, const char *) = 0; virtual void SendVhostDel(User *) { } - virtual void SendAkill(Akill *) = 0; - virtual void SendAkillDel(Akill *) = 0; + virtual void SendAkill(XLine *) = 0; + virtual void SendAkillDel(XLine *) = 0; virtual void SendSVSKill(BotInfo *source, User *user, const char *fmt, ...); virtual void SendSVSMode(User *, int, const char **) = 0; virtual void SendMode(BotInfo *bi, Channel *dest, const char *fmt, ...); @@ -959,11 +925,11 @@ class CoreExport IRCDProto virtual void SendPing(const char *servname, const char *who); virtual void SendPong(const char *servname, const char *who); virtual void SendJoin(BotInfo *bi, const char *, time_t) = 0; - virtual void SendSQLineDel(const std::string &) = 0; + virtual void SendSQLineDel(XLine *x) = 0; virtual void SendInvite(BotInfo *bi, const char *chan, const char *nick); virtual void SendPart(BotInfo *bi, Channel *chan, const char *fmt, ...); virtual void SendGlobops(BotInfo *source, const char *fmt, ...); - virtual void SendSQLine(const std::string &, const std::string &) = 0; + virtual void SendSQLine(XLine *x) = 0; virtual void SendSquit(const char *servname, const char *message); virtual void SendSVSO(const char *, const char *, const char *) { } virtual void SendChangeBotNick(BotInfo *bi, const char *newnick); @@ -972,10 +938,10 @@ class CoreExport IRCDProto virtual void SendConnect() = 0; virtual void SendSVSHold(const char *) { } virtual void SendSVSHoldDel(const char *) { } - virtual void SendSGLineDel(SXLine *) { } - virtual void SendSZLineDel(SXLine *) { } - virtual void SendSZLine(SXLine *) { } - virtual void SendSGLine(SXLine *) { } + virtual void SendSGLineDel(XLine *) { } + virtual void SendSZLineDel(XLine *) { } + virtual void SendSZLine(XLine *) { } + virtual void SendSGLine(XLine *) { } virtual void SendBanDel(Channel *, const std::string &) { } virtual void SendSVSModeChan(Channel *, const char *, const char *) { } virtual void SendUnregisteredNick(User *) { } @@ -1064,8 +1030,8 @@ class CoreExport Anope { public: /** Check whether two strings match. - * @param mask The pattern to check (e.g. foo*bar) * @param str The string to check against the pattern (e.g. foobar) + * @param mask The pattern to check (e.g. foo*bar) * @param case_sensitive Whether or not the match is case sensitive, default false. */ static bool Match(const std::string &str, const std::string &mask, bool case_sensitive = false); @@ -1162,7 +1128,7 @@ class ChanServTimer : public Timer void Tick(time_t); }; -/** A class to process numbered lists (passed to most DEL commands). +/** A class to process numbered lists (passed to most DEL/LIST/VIEW commands). * The function HandleNumber is called for every number in the list. Note that * it *always* gets called in descending order. This is so deleting the index passed * to the function from an array will not cause the other indexes passed to the function @@ -1178,12 +1144,25 @@ class NumberList */ NumberList(const std::string &list); + /** Destructor, does nothing + */ virtual ~NumberList(); + /** Should be called after the constructors are done running. This calls the callbacks. + */ void Process(); + /** Called with a number from the list + * @param Number The number + */ virtual void HandleNumber(unsigned Number); + /** Called when there is an error with the numbered list + * Return false to immediatly stop processing the list and return + * This is all done before we start calling HandleNumber, so no numbers will have been processed yet + * @param The list + * @return false to stop processing + */ virtual bool InvalidRange(const std::string &list); }; diff --git a/include/slist.h b/include/slist.h deleted file mode 100644 index 3377cd48f..000000000 --- a/include/slist.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Header for Services list handler. - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for furhter details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * - */ - -#ifndef SLIST_H -#define SLIST_H - -typedef struct slist_ SList; -typedef struct slistopts_ SListOpts; - -struct slist_ { - void **list; - - int16 count; /* Total entries of the list */ - int16 capacity; /* Capacity of the list */ - int16 limit; /* Maximum possible entries on the list */ - - SListOpts *opts; -}; - -struct slistopts_ { - int32 flags; /* Flags for the list. See below. */ - - int (*compareitem) (SList *slist, void *item1, void *item2); /* Called to compare two items */ - int (*isequal) (SList *slist, void *item1, void *item2); /* Called by slist_indexof. item1 can be an arbitrary pointer. */ - void (*freeitem) (SList *slist, void *item); /* Called when an item is removed */ -}; - -#define SLIST_DEFAULT_LIMIT 32767 - -#define SLISTF_NODUP 0x00000001 /* No duplicates in the list. */ -#define SLISTF_SORT 0x00000002 /* Automatically sort the list. Used with compareitem member. */ - -/* Note that number is the index in the array + 1 */ -typedef int (*slist_enumcb_t) (SList *slist, int number, void *item, va_list args); -/* Callback to know whether we can delete the entry. */ -typedef int (*slist_delcheckcb_t) (SList *slist, void *item, va_list args); - -#endif /* SLIST_H */ - diff --git a/lang/cat.l b/lang/cat.l index b662ab0e0..116d42037 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -2575,22 +2575,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Temps d'expiració per defecte de AKILL: 1 minut OPER_STATS_AKILL_EXPIRE_NONE Temps d'expiració per defecte de AKILL: Sense expiració -OPER_STATS_SGLINE_COUNT - Numero actual de SGLINEs: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Temps d'expiració per defecte de SGLINE: %d dies -OPER_STATS_SGLINE_EXPIRE_DAY - Temps d'expiració per defecte de SGLINE: 1 dia -OPER_STATS_SGLINE_EXPIRE_HOURS - Temps d'expiració per defecte de SGLINE: %d hores -OPER_STATS_SGLINE_EXPIRE_HOUR - Temps d'expiració per defecte de SGLINE: 1 hora -OPER_STATS_SGLINE_EXPIRE_MINS - Temps d'expiració per defecte de SGLINE: %d minuts -OPER_STATS_SGLINE_EXPIRE_MIN - Temps d'expiració per defecte de SGLINE: 1 minut -OPER_STATS_SGLINE_EXPIRE_NONE - Temps d'expiració per defecte de SGLINE: Sense expiració +OPER_STATS_SNLINE_COUNT + Numero actual de SNLINEs: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Temps d'expiració per defecte de SNLINE: %d dies +OPER_STATS_SNLINE_EXPIRE_DAY + Temps d'expiració per defecte de SNLINE: 1 dia +OPER_STATS_SNLINE_EXPIRE_HOURS + Temps d'expiració per defecte de SNLINE: %d hores +OPER_STATS_SNLINE_EXPIRE_HOUR + Temps d'expiració per defecte de SNLINE: 1 hora +OPER_STATS_SNLINE_EXPIRE_MINS + Temps d'expiració per defecte de SNLINE: %d minuts +OPER_STATS_SNLINE_EXPIRE_MIN + Temps d'expiració per defecte de SNLINE: 1 minut +OPER_STATS_SNLINE_EXPIRE_NONE + Temps d'expiració per defecte de SNLINE: Sense expiració OPER_STATS_SQLINE_COUNT Numero actual de SQLINEs: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2718,49 +2718,49 @@ OPER_AKILL_VIEW_FORMAT OPER_AKILL_CLEAR La llista de AKILLs ha estat netegada. -# SGLINE responses +# SNLINE responses OPER_CHANKILL_SYNTAX CHANKILL [+expiry] {#channel} [reason] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiració] {mascara | llista}[:raó]] -OPER_SGLINE_UNSUPPORTED - Ho sento, SGLINE no esta disponible en aquesta xarxa. -OPER_SGLINE_EXISTS - %s ja existeix a la llista de SGLINEs. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiració] {mascara | llista}[:raó]] +OPER_SNLINE_UNSUPPORTED + Ho sento, SNLINE no esta disponible en aquesta xarxa. +OPER_SNLINE_EXISTS + %s ja existeix a la llista de SNLINEs. +OPER_SNLINE_ALREADY_COVERED %s ja esta cobert per %s. -OPER_SGLINE_REACHED_LIMIT - Ho sento, sols pots tenir %d SGLINEs. -OPER_SGLINE_ADDED - %s afegit a la llista de SGLINEs. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Ho sento, sols pots tenir %d SNLINEs. +OPER_SNLINE_ADDED + %s afegit a la llista de SNLINEs. +OPER_SNLINE_CHANGED Temps d'expiració per a %s canviat. -OPER_SGLINE_NOT_FOUND - %s no trobat a a la llista de SGLINEs. -OPER_SGLINE_NO_MATCH - No existeixen instàncies similars a la llista de SGLINEs. -OPER_SGLINE_DELETED - %s esborrat de la llista de SGLINEs. -OPER_SGLINE_DELETED_ONE - 1 instància esborrada de la llista de SGLINEs. -OPER_SGLINE_DELETED_SEVERAL - %d instàncies esborrades de la llista de SGLINEs. -OPER_SGLINE_LIST_EMPTY - La llista de SGLINEs esta buida. -OPER_SGLINE_LIST_HEADER - Llista actual de SGLINEs: +OPER_SNLINE_NOT_FOUND + %s no trobat a a la llista de SNLINEs. +OPER_SNLINE_NO_MATCH + No existeixen instàncies similars a la llista de SNLINEs. +OPER_SNLINE_DELETED + %s esborrat de la llista de SNLINEs. +OPER_SNLINE_DELETED_ONE + 1 instància esborrada de la llista de SNLINEs. +OPER_SNLINE_DELETED_SEVERAL + %d instàncies esborrades de la llista de SNLINEs. +OPER_SNLINE_LIST_EMPTY + La llista de SNLINEs esta buida. +OPER_SNLINE_LIST_HEADER + Llista actual de SNLINEs: Num Mascara Raó -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Llista actual de SGLINEs: +OPER_SNLINE_VIEW_HEADER + Llista actual de SNLINEs: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (per %s en %s; %s) %s -OPER_SGLINE_CLEAR - La llista de SGLINEs ha estat netegada. +OPER_SNLINE_CLEAR + La llista de SNLINEs ha estat netegada. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5516,8 +5516,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Mata tots els usuaris en un host OPER_HELP_CMD_AKILL AKILL Manipula la llista AKILL -OPER_HELP_CMD_SGLINE - SGLINE Manipula la llista SGLINE +OPER_HELP_CMD_SNLINE + SNLINE Manipula la llista SNLINE OPER_HELP_CMD_SQLINE SQLINE Manipula la llista SQLINE OPER_HELP_CMD_SZLINE @@ -5726,56 +5726,56 @@ OPER_HELP_AKILL Limitat a operadors de serveis. -OPER_HELP_SGLINE - Sintàxi: SGLINE ADD [+expiració] mascara:raó - SGLINE DEL {mascara | nom | llista} - SGLINE LIST [mascara | llista] - SGLINE VIEW [mascara | llista] - SGLINE CLEAR +OPER_HELP_SNLINE + Sintàxi: SNLINE ADD [+expiració] mascara:raó + SNLINE DEL {mascara | nom | llista} + SNLINE LIST [mascara | llista] + SNLINE VIEW [mascara | llista] + SNLINE CLEAR Permet als operadors de serveis manipular la llista - de SGLINES. Si un usuari amb un nom real concordant - amb una mascara SGLINE s'intenta connectar, els serveis + de SNLINES. Si un usuari amb un nom real concordant + amb una mascara SNLINE s'intenta connectar, els serveis l'impediran aconseguir una sessió d'IRC. - SGLINE ADD afegeix la mascara de nom real especificada a la - llista de SGLINES per la raó especificada (obligatori). + SNLINE ADD afegeix la mascara de nom real especificada a la + llista de SNLINES per la raó especificada (obligatori). expiració es especificada com un sencer seguit de d (dies), h (hores), o m (minuts). Combinacions (com 1h30m) no estan permesses. Si l'especificació de la unitat no es especificada, per defecte són dies (és a dir +30 nomès - significa 30 dies). Per afegir una SGLINE que no caduqui, + significa 30 dies). Per afegir una SNLINE que no caduqui, utilitza +0. Si la mascara de nom real especificada comença amb +, el temp d'expiració ha de ser especificat, encara que sigui el mateix que el per defecte. El temps actual d'expiració - per defecte per SGLINES pot ser consultat amb la comanda + per defecte per SNLINES pot ser consultat amb la comanda STATS AKILL. Nota: Ja que la mascara de nom real pot contenir espais, el separador entre aquest i la raó es un signe de dos punts. - La comanda SGLINE DEL esborra la mascara especificada de la - llista de SGLINES si esta present. Si s'especifica una llista de + La comanda SNLINE DEL esborra la mascara especificada de la + llista de SNLINES si esta present. Si s'especifica una llista de instàncies, aquestes instàncies son esborrades. (Veure l'exemple per LIST especificat més endavant.) - La comanda SGLINE LIST mostra la llista de SGLINES. Si + La comanda SNLINE LIST mostra la llista de SNLINES. Si s'especifica una mascara, nomès les instàncies concordant amb la mascara són mostrades. Si s'especifica una llista de instàncies, nomès aquestes instàncies son mostrades; per exemple: - SGLINE LIST 2-5,7-9 - Llista instàncies de SGLINES enumerades de 2 a 5 i de 7 + SNLINE LIST 2-5,7-9 + Llista instàncies de SNLINES enumerades de 2 a 5 i de 7 a 9. - SGLINE VIEW es una versió més verbal que SGLINE LIST, - i mostrara qui va fegir la SGLINE, la data en la que va + SNLINE VIEW es una versió més verbal que SNLINE LIST, + i mostrara qui va fegir la SNLINE, la data en la que va ser afegida, i quan caducara, a més de la mascara de nom real i la raó. - SGLINE CLEAR neteja totes les instàncies de la llista de - SGLINES. + SNLINE CLEAR neteja totes les instàncies de la llista de + SNLINES. Limitat a operadors de serveis. @@ -2546,22 +2546,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Standard Auslaufzeit von AKILLs: 1 Minute OPER_STATS_AKILL_EXPIRE_NONE Standard Auslaufzeit von AKILLs: Kein Auslauf, permanent -OPER_STATS_SGLINE_COUNT - Aktuelle Anzahl von SGLINEs: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Standard Auslaufzeit von SGLINEs: %d Tage -OPER_STATS_SGLINE_EXPIRE_DAY - Standard Auslaufzeit von SGLINEs: 1 Tag -OPER_STATS_SGLINE_EXPIRE_HOURS - Standard Auslaufzeit von SGLINEs: %d Stunden -OPER_STATS_SGLINE_EXPIRE_HOUR - Standard Auslaufzeit von SGLINEs: 1 Stunde -OPER_STATS_SGLINE_EXPIRE_MINS - Standard Auslaufzeit von SGLINEs: %d Minuten -OPER_STATS_SGLINE_EXPIRE_MIN - Standard Auslaufzeit von SGLINEs: 1 Minute -OPER_STATS_SGLINE_EXPIRE_NONE - Standard Auslaufzeit von SGLINEs: Kein Auslauf, permanent +OPER_STATS_SNLINE_COUNT + Aktuelle Anzahl von SNLINEs: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Standard Auslaufzeit von SNLINEs: %d Tage +OPER_STATS_SNLINE_EXPIRE_DAY + Standard Auslaufzeit von SNLINEs: 1 Tag +OPER_STATS_SNLINE_EXPIRE_HOURS + Standard Auslaufzeit von SNLINEs: %d Stunden +OPER_STATS_SNLINE_EXPIRE_HOUR + Standard Auslaufzeit von SNLINEs: 1 Stunde +OPER_STATS_SNLINE_EXPIRE_MINS + Standard Auslaufzeit von SNLINEs: %d Minuten +OPER_STATS_SNLINE_EXPIRE_MIN + Standard Auslaufzeit von SNLINEs: 1 Minute +OPER_STATS_SNLINE_EXPIRE_NONE + Standard Auslaufzeit von SNLINEs: Kein Auslauf, permanent OPER_STATS_SQLINE_COUNT Aktuelle Anzahl von SQLINEs: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2687,49 +2687,49 @@ OPER_AKILL_VIEW_FORMAT OPER_AKILL_CLEAR Die AKILL-Liste wurde geleert. -# SGLINE responses +# SNLINE responses OPER_CHANKILL_SYNTAX CHANKILL [+Zeit] {Channel} [Grund] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+Zeit] {Hostmask | entry-liste}[:Grund]] -OPER_SGLINE_UNSUPPORTED - SGLINE ist in diesem Netz nicht verfügbar. -OPER_SGLINE_EXISTS - %s existiert bereits auf der SGLINE-Liste. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+Zeit] {Hostmask | entry-liste}[:Grund]] +OPER_SNLINE_UNSUPPORTED + SNLINE ist in diesem Netz nicht verfügbar. +OPER_SNLINE_EXISTS + %s existiert bereits auf der SNLINE-Liste. +OPER_SNLINE_ALREADY_COVERED %s wird bereits durch %s getroffen. -OPER_SGLINE_REACHED_LIMIT - Du kannst nur %d SGLINE's haben. -OPER_SGLINE_ADDED - %s wurde zur SGLINE-Liste hinzugefügt. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Du kannst nur %d SNLINE's haben. +OPER_SNLINE_ADDED + %s wurde zur SNLINE-Liste hinzugefügt. +OPER_SNLINE_CHANGED Auslaufzeit von %s geändert. -OPER_SGLINE_NOT_FOUND - %s wurde nicht auf der SGLINE-Liste gefunden. -OPER_SGLINE_NO_MATCH - Keine entsprechenden Einträge auf der SGLINE-Liste. -OPER_SGLINE_DELETED - %s wurde von der SGLINE-Liste entfernt. -OPER_SGLINE_DELETED_ONE - Es wurde 1 Eintrag aus der SGLINE-Liste entfernt. -OPER_SGLINE_DELETED_SEVERAL - Es wurden %d Einträge aus der SGLINE-Liste entfernt. -OPER_SGLINE_LIST_EMPTY - Die SGLINE-Liste ist leer. -OPER_SGLINE_LIST_HEADER - Aktuelle SGLINE-Liste: +OPER_SNLINE_NOT_FOUND + %s wurde nicht auf der SNLINE-Liste gefunden. +OPER_SNLINE_NO_MATCH + Keine entsprechenden Einträge auf der SNLINE-Liste. +OPER_SNLINE_DELETED + %s wurde von der SNLINE-Liste entfernt. +OPER_SNLINE_DELETED_ONE + Es wurde 1 Eintrag aus der SNLINE-Liste entfernt. +OPER_SNLINE_DELETED_SEVERAL + Es wurden %d Einträge aus der SNLINE-Liste entfernt. +OPER_SNLINE_LIST_EMPTY + Die SNLINE-Liste ist leer. +OPER_SNLINE_LIST_HEADER + Aktuelle SNLINE-Liste: Nummer Maske Grund -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Aktuelle SGLINE-Liste: +OPER_SNLINE_VIEW_HEADER + Aktuelle SNLINE-Liste: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (von %s am %s, %s) %s -OPER_SGLINE_CLEAR - Die SGLINE-Liste wurde geleert. +OPER_SNLINE_CLEAR + Die SNLINE-Liste wurde geleert. # SZLINE responses OPER_SQLINE_SYNTAX @@ -5555,8 +5555,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Alle User mit einem bestimmten Host killen OPER_HELP_CMD_AKILL AKILL Die AutoKill-Liste bearbeiten -OPER_HELP_CMD_SGLINE - SGLINE Die SGLINE-Liste bearbeiten +OPER_HELP_CMD_SNLINE + SNLINE Die SNLINE-Liste bearbeiten OPER_HELP_CMD_SQLINE SQLINE Die SQLINE-Liste bearbeiten OPER_HELP_CMD_SZLINE @@ -5765,21 +5765,21 @@ OPER_HELP_AKILL AKILL CLEAR entfernt alle Einträge aus der AKILL-Liste. -OPER_HELP_SGLINE - Syntax: SGLINE ADD [+Zeit] Maske:Grund - SGLINE DEL {Maske | entry-num | Liste} - SGLINE LIST [Maske | Liste] - SGLINE VIEW [Maske | Liste] - SGLINE CLEAR +OPER_HELP_SNLINE + Syntax: SNLINE ADD [+Zeit] Maske:Grund + SNLINE DEL {Maske | entry-num | Liste} + SNLINE LIST [Maske | Liste] + SNLINE VIEW [Maske | Liste] + SNLINE CLEAR - Erlaubt Services Operatoren die SGLINE-Liste zu + Erlaubt Services Operatoren die SNLINE-Liste zu bearbeiten. Versucht ein User dessen Realname auf - einen Eintrag in der SGLINE-Liste trifft zu verbinden, + einen Eintrag in der SNLINE-Liste trifft zu verbinden, werden die Services ihn die verbindung auf das IRC Netz nicht ausführen lassen. - SGLINE ADD fügt die angegebene Realnamen-Maske mit - dem Grund (muss angegeben werden) zur SGLINE-Liste + SNLINE ADD fügt die angegebene Realnamen-Maske mit + dem Grund (muss angegeben werden) zur SNLINE-Liste hinzu. Mit Hilfe von Zeit lässt sich eine bestimmte Auslaufzeit dieses Eintrags definieren. Zeit wird durch eine Ganzzahl angegeben, gefolgt von @@ -5787,39 +5787,39 @@ OPER_HELP_SGLINE d (Tage), h (Stunden), oder m (Minuten). Kombinationen (wie zum Beispiel 1h30m) sind nicht zulässig. Wird kein Buchstabe angegeben, wird von Tagen ausgegangen (also +30 - bedeutet dann z.B. 30 Tage). Um einen SGLINE-Eintrag zu + bedeutet dann z.B. 30 Tage). Um einen SNLINE-Eintrag zu erstellen, der nicht ausläuft, benutze +0. Beginnt die Realnamen-Maske mit einem +, an, muss eine Auslaufzeit (expiry) definiert werden, auch wenn es die Standard-Zeit ist. Die Standard-Auslaufzeit für eine - SGLINE kann man unter STATS AKILL finden. + SNLINE kann man unter STATS AKILL finden. Beachte: Da die Realnamen-Maske Leerzeichen enthalten kann, ist das Trennzeichen zwischen der Maske und dem Grund ein Doppelpunkt. - Das SGLINE DEL Befehl entfernt die angegebene Maske - von der SGLINE-Liste, sofern ein solcher Eintag existiert. + Das SNLINE DEL Befehl entfernt die angegebene Maske + von der SNLINE-Liste, sofern ein solcher Eintag existiert. Wird eine Liste von Nummern angegeben, werden diese Einträge entfernt. (Siehe das Beispiel für LIST weiter unten.) - Mit Hilfe von SGLINE LIST wird die SGLINE-Liste + Mit Hilfe von SNLINE LIST wird die SNLINE-Liste angezeigt. Werden Platzhalter (Wildcards) in der Maske angegeben, werden nur die entsprechenden Einträge angezeigt. Die Ausgabe lässt sich ebenfalls durch einen Zahlenbereich begrenzen, wie das Beispiel zeigt: - SGLINE LIST 2-5,7-9 + SNLINE LIST 2-5,7-9 Zeigt nur die Einträge 2 bis 5 und 7 bis 9. - SGLINE VIEW ist eine ausführlichere Version des - SGLINE LIST Befehls und zeigt zusätzlich, wer einen + SNLINE VIEW ist eine ausführlichere Version des + SNLINE LIST Befehls und zeigt zusätzlich, wer einen Eintrag wann erstellt hat, wann er ausläuft und natürlich die user@host Maske mit dem Grund. - SGLINE CLEAR entfernt alle Einträge aus der - SGLINE-Liste. + SNLINE CLEAR entfernt alle Einträge aus der + SNLINE-Liste. OPER_HELP_SQLINE Syntax: SQLINE ADD [+Zeit] Maske Grund @@ -5838,7 +5838,7 @@ OPER_HELP_SQLINE die dieses Feature unterstützen). SQLINE ADD fügt den angegeben Nicknamen mit dem Grund (muss - angegeben werden) zur SGLINE-Liste hinzu. ^_Zeit^_ wird + angegeben werden) zur SNLINE-Liste hinzu. ^_Zeit^_ wird durch eine Ganzzahl angegeben, gefolgt von einem Buchstaben: d (Tage), h (Stunden), oder m (Minuten). Kombinationen sind nicht erlaubt. Wird kein Buchstabe angegeben, diff --git a/lang/en_us.l b/lang/en_us.l index 8f1e9c9f0..3a88e10e5 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -2497,22 +2497,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Default AKILL expiry time: 1 minute OPER_STATS_AKILL_EXPIRE_NONE Default AKILL expiry time: No expiration -OPER_STATS_SGLINE_COUNT - Current number of SGLINEs: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Default SGLINE expiry time: %d days -OPER_STATS_SGLINE_EXPIRE_DAY - Default SGLINE expiry time: 1 day -OPER_STATS_SGLINE_EXPIRE_HOURS - Default SGLINE expiry time: %d hours -OPER_STATS_SGLINE_EXPIRE_HOUR - Default SGLINE expiry time: 1 hour -OPER_STATS_SGLINE_EXPIRE_MINS - Default SGLINE expiry time: %d minutes -OPER_STATS_SGLINE_EXPIRE_MIN - Default SGLINE expiry time: 1 minute -OPER_STATS_SGLINE_EXPIRE_NONE - Default SGLINE expiry time: No expiration +OPER_STATS_SNLINE_COUNT + Current number of SNLINEs: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Default SNLINE expiry time: %d days +OPER_STATS_SNLINE_EXPIRE_DAY + Default SNLINE expiry time: 1 day +OPER_STATS_SNLINE_EXPIRE_HOURS + Default SNLINE expiry time: %d hours +OPER_STATS_SNLINE_EXPIRE_HOUR + Default SNLINE expiry time: 1 hour +OPER_STATS_SNLINE_EXPIRE_MINS + Default SNLINE expiry time: %d minutes +OPER_STATS_SNLINE_EXPIRE_MIN + Default SNLINE expiry time: 1 minute +OPER_STATS_SNLINE_EXPIRE_NONE + Default SNLINE expiry time: No expiration OPER_STATS_SQLINE_COUNT Current number of SQLINEs: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2635,46 +2635,46 @@ OPER_AKILL_CLEAR The AKILL list has been cleared. OPER_CHANKILL_SYNTAX CHANKILL [+expiry] {#channel} [reason] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiry] {mask | entry-list}[:reason]] -OPER_SGLINE_UNSUPPORTED - Sorry, SGLINE is not available on this network. -OPER_SGLINE_EXISTS - %s already exists on the SGLINE list. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiry] {mask | entry-list}[:reason]] +OPER_SNLINE_UNSUPPORTED + Sorry, SNLINE is not available on this network. +OPER_SNLINE_EXISTS + %s already exists on the SNLINE list. +OPER_SNLINE_ALREADY_COVERED %s is already covered by %s. -OPER_SGLINE_REACHED_LIMIT - Sorry, you can only have %d SGLINEs. -OPER_SGLINE_ADDED - %s added to the SGLINE list. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Sorry, you can only have %d SNLINEs. +OPER_SNLINE_ADDED + %s added to the SNLINE list. +OPER_SNLINE_CHANGED Expiry time of %s changed. -OPER_SGLINE_NOT_FOUND - %s not found on the SGLINE list. -OPER_SGLINE_NO_MATCH - No matching entries on the SGLINE list. -OPER_SGLINE_DELETED - %s deleted from the SGLINE list. -OPER_SGLINE_DELETED_ONE - Deleted 1 entry from the SGLINE list. -OPER_SGLINE_DELETED_SEVERAL - Deleted %d entries from the SGLINE list. -OPER_SGLINE_LIST_EMPTY - SGLINE list is empty. -OPER_SGLINE_LIST_HEADER - Current SGLINE list: +OPER_SNLINE_NOT_FOUND + %s not found on the SNLINE list. +OPER_SNLINE_NO_MATCH + No matching entries on the SNLINE list. +OPER_SNLINE_DELETED + %s deleted from the SNLINE list. +OPER_SNLINE_DELETED_ONE + Deleted 1 entry from the SNLINE list. +OPER_SNLINE_DELETED_SEVERAL + Deleted %d entries from the SNLINE list. +OPER_SNLINE_LIST_EMPTY + SNLINE list is empty. +OPER_SNLINE_LIST_HEADER + Current SNLINE list: Num Mask Reason -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Current SGLINE list: +OPER_SNLINE_VIEW_HEADER + Current SNLINE list: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (by %s on %s; %s) %s -OPER_SGLINE_CLEAR - The SGLINE list has been cleared. +OPER_SNLINE_CLEAR + The SNLINE list has been cleared. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5287,8 +5287,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Kill all users that have a certain host OPER_HELP_CMD_AKILL AKILL Manipulate the AKILL list -OPER_HELP_CMD_SGLINE - SGLINE Manipulate the SGLINE list +OPER_HELP_CMD_SNLINE + SNLINE Manipulate the SNLINE list OPER_HELP_CMD_SQLINE SQLINE Manipulate the SQLINE list OPER_HELP_CMD_SZLINE @@ -5488,51 +5488,51 @@ OPER_HELP_AKILL AKILL CLEAR clears all entries of the AKILL list. -OPER_HELP_SGLINE - Syntax: SGLINE ADD [+expiry] mask:reason - SGLINE DEL {mask | entry-num | list} - SGLINE LIST [mask | list] - SGLINE VIEW [mask | list] - SGLINE CLEAR +OPER_HELP_SNLINE + Syntax: SNLINE ADD [+expiry] mask:reason + SNLINE DEL {mask | entry-num | list} + SNLINE LIST [mask | list] + SNLINE VIEW [mask | list] + SNLINE CLEAR - Allows Services operators to manipulate the SGLINE list. If - a user with a realname matching an SGLINE mask attempts to + Allows Services operators to manipulate the SNLINE list. If + a user with a realname matching an SNLINE mask attempts to connect, Services will not allow it to pursue his IRC session. - SGLINE ADD adds the given realname mask to the SGLINE + SNLINE ADD adds the given realname mask to the SNLINE list for the given reason (which must be given). expiry is specified as an integer followed by one of d (days), h (hours), or m (minutes). Combinations (such as 1h30m) are not permitted. If a unit specifier is not included, the default is days (so +30 by itself means 30 - days). To add an SGLINE which does not expire, use +0. If the + days). To add an SNLINE which does not expire, use +0. If the realname mask to be added starts with a +, an expiry time must be given, even if it is the same as the default. The - current SGLINE default expiry time can be found with the + current SNLINE default expiry time can be found with the STATS AKILL command. Note: because the realname mask may contain spaces, the separator between it and the reason is a colon. - The SGLINE DEL command removes the given mask from the - SGLINE list if it is present. If a list of entry numbers is + The SNLINE DEL command removes the given mask from the + SNLINE list if it is present. If a list of entry numbers is given, those entries are deleted. (See the example for LIST below.) - The SGLINE LIST command displays the SGLINE list. + The SNLINE LIST command displays the SNLINE list. If a wildcard mask is given, only those entries matching the mask are displayed. If a list of entry numbers is given, only those entries are shown; for example: - SGLINE LIST 2-5,7-9 - Lists SGLINE entries numbered 2 through 5 and 7 + SNLINE LIST 2-5,7-9 + Lists SNLINE entries numbered 2 through 5 and 7 through 9. - SGLINE VIEW is a more verbose version of SGLINE LIST, and - will show who added an SGLINE, the date it was added, and when + SNLINE VIEW is a more verbose version of SNLINE LIST, and + will show who added an SNLINE, the date it was added, and when it expires, as well as the realname mask and reason. - SGLINE CLEAR clears all entries of the SGLINE list. + SNLINE CLEAR clears all entries of the SNLINE list. OPER_HELP_SQLINE Syntax: SQLINE ADD [+expiry] mask reason @@ -2546,22 +2546,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Tiempo de expiracion por defecto de AKILL: 1 minuto OPER_STATS_AKILL_EXPIRE_NONE Tiempo de expiracion por defecto de AKILL: Sin expiracion -OPER_STATS_SGLINE_COUNT - Numero actual de SGLINEs: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Tiempo de expiracion por defecto de SGLINE: %d dias -OPER_STATS_SGLINE_EXPIRE_DAY - Tiempo de expiracion por defecto de SGLINE: 1 dia -OPER_STATS_SGLINE_EXPIRE_HOURS - Tiempo de expiracion por defecto de SGLINE: %d horas -OPER_STATS_SGLINE_EXPIRE_HOUR - Tiempo de expiracion por defecto de SGLINE: 1 hora -OPER_STATS_SGLINE_EXPIRE_MINS - Tiempo de expiracion por defecto de SGLINE: %d minutos -OPER_STATS_SGLINE_EXPIRE_MIN - Tiempo de expiracion por defecto de SGLINE: 1 minuto -OPER_STATS_SGLINE_EXPIRE_NONE - Tiempo de expiracion por defecto de SGLINE: Sin expiracion +OPER_STATS_SNLINE_COUNT + Numero actual de SNLINEs: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Tiempo de expiracion por defecto de SNLINE: %d dias +OPER_STATS_SNLINE_EXPIRE_DAY + Tiempo de expiracion por defecto de SNLINE: 1 dia +OPER_STATS_SNLINE_EXPIRE_HOURS + Tiempo de expiracion por defecto de SNLINE: %d horas +OPER_STATS_SNLINE_EXPIRE_HOUR + Tiempo de expiracion por defecto de SNLINE: 1 hora +OPER_STATS_SNLINE_EXPIRE_MINS + Tiempo de expiracion por defecto de SNLINE: %d minutos +OPER_STATS_SNLINE_EXPIRE_MIN + Tiempo de expiracion por defecto de SNLINE: 1 minuto +OPER_STATS_SNLINE_EXPIRE_NONE + Tiempo de expiracion por defecto de SNLINE: Sin expiracion OPER_STATS_SQLINE_COUNT Numero actual de SQLINEs: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2689,49 +2689,49 @@ OPER_AKILL_VIEW_FORMAT OPER_AKILL_CLEAR La lista de AKILLs ha sido limpiada. -# SGLINE responses +# SNLINE responses OPER_CHANKILL_SYNTAX CHANKILL [+expiry] {#channel} [reason] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiracion] {mascara | lista}[:razon]] -OPER_SGLINE_UNSUPPORTED - Lo siento, SGLINE no esta disponible en esta red. -OPER_SGLINE_EXISTS - %s ya existe en la lista de SGLINEs. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiracion] {mascara | lista}[:razon]] +OPER_SNLINE_UNSUPPORTED + Lo siento, SNLINE no esta disponible en esta red. +OPER_SNLINE_EXISTS + %s ya existe en la lista de SNLINEs. +OPER_SNLINE_ALREADY_COVERED %s ya esta cubierto por %s. -OPER_SGLINE_REACHED_LIMIT - Lo siento, solo puedes tener %d SGLINEs. -OPER_SGLINE_ADDED - %s añadido a la lista de SGLINEs. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Lo siento, solo puedes tener %d SNLINEs. +OPER_SNLINE_ADDED + %s añadido a la lista de SNLINEs. +OPER_SNLINE_CHANGED Tiempo de expiracion para %s cambiado. -OPER_SGLINE_NOT_FOUND - %s no encontrado en la lista de SGLINEs. -OPER_SGLINE_NO_MATCH - No existen instancias similares en la lista de SGLINEs. -OPER_SGLINE_DELETED - %s borrado de la lista de SGLINEs. -OPER_SGLINE_DELETED_ONE - 1 instancia borrada de la lista de SGLINEs. -OPER_SGLINE_DELETED_SEVERAL - %d instancias borradas de la lista de SGLINEs. -OPER_SGLINE_LIST_EMPTY - La lista de SGLINEs esta vacia. -OPER_SGLINE_LIST_HEADER - Lista actual de SGLINEs: +OPER_SNLINE_NOT_FOUND + %s no encontrado en la lista de SNLINEs. +OPER_SNLINE_NO_MATCH + No existen instancias similares en la lista de SNLINEs. +OPER_SNLINE_DELETED + %s borrado de la lista de SNLINEs. +OPER_SNLINE_DELETED_ONE + 1 instancia borrada de la lista de SNLINEs. +OPER_SNLINE_DELETED_SEVERAL + %d instancias borradas de la lista de SNLINEs. +OPER_SNLINE_LIST_EMPTY + La lista de SNLINEs esta vacia. +OPER_SNLINE_LIST_HEADER + Lista actual de SNLINEs: Num Mascara Razon -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Lista actual de SGLINEs: +OPER_SNLINE_VIEW_HEADER + Lista actual de SNLINEs: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (por %s en %s; %s) %s -OPER_SGLINE_CLEAR - La lista de SGLINEs ha sido limpiada. +OPER_SNLINE_CLEAR + La lista de SNLINEs ha sido limpiada. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5485,8 +5485,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Killea todos los usuarios en un host OPER_HELP_CMD_AKILL AKILL Manipula la lista AKILL -OPER_HELP_CMD_SGLINE - SGLINE Manipula la lista SGLINE +OPER_HELP_CMD_SNLINE + SNLINE Manipula la lista SNLINE OPER_HELP_CMD_SQLINE SQLINE Manipula la lista SQLINE OPER_HELP_CMD_SZLINE @@ -5699,56 +5699,56 @@ OPER_HELP_AKILL Limitado a Operadores de Servicios. -OPER_HELP_SGLINE - Sintaxis: SGLINE ADD [+expiracion] mascara:razon - SGLINE DEL {mascara | numero | lista} - SGLINE LIST [mascara | lista] - SGLINE VIEW [mascara | lista] - SGLINE CLEAR +OPER_HELP_SNLINE + Sintaxis: SNLINE ADD [+expiracion] mascara:razon + SNLINE DEL {mascara | numero | lista} + SNLINE LIST [mascara | lista] + SNLINE VIEW [mascara | lista] + SNLINE CLEAR Permite a los operadores de Servicios a manipular la lista - de SGLINES. Si un usuario con un nombre real concordando - una mascara SGLINE se intenta conectar, los Servicios le + de SNLINES. Si un usuario con un nombre real concordando + una mascara SNLINE se intenta conectar, los Servicios le impediran conseguir una sesion de IRC. - SGLINE ADD añade la mascara de nombre real dada a la - lista de SGLINES por la razon dada (la que debe ser + SNLINE ADD añade la mascara de nombre real dada a la + lista de SNLINES por la razon dada (la que debe ser dada). expiracion es especificada como un entero seguido de uno de d (dias), h (horas), o m (minutos). Combinaciones (como 1h30m) no estan permitidas. Si la especificacion de la unidad no es incluida, por defecto son dias (osea +30 por si solo - significa 30 dias). Para añadir una SGLINE que no expire, + significa 30 dias). Para añadir una SNLINE que no expire, usa +0. Si la mascara de nombre real dada empieza con +, el tiempo de expiracion debe ser dado, aun si es el mismo que el por defecto. El tiempo actual de expiracion - por defecto para SGLINES puede ser visto con el comando + por defecto para SNLINES puede ser visto con el comando STATS AKILL. Notese: Ya que la mascara de nombre real puede contener espacios, el separador entre esta y la razon es un signo de dos puntos. - El comando SGLINE DEL remueve la mascara dada de la - lista de SGLINES si esta presente. Si una lista de + El comando SNLINE DEL remueve la mascara dada de la + lista de SNLINES si esta presente. Si una lista de instancias es dada, esas instancias son borradas. (Ver el ejemplo para LIST mas abajo.) - El comando SGLINE LIST muestra la lista de SGLINES. Si + El comando SNLINE LIST muestra la lista de SNLINES. Si una mascara es dada, solo las instancias concordando con la mascara son mostradas. Si una lista de instancias es dada, solo esas instancias son mostradas; por ejemplo: - SGLINE LIST 2-5,7-9 - Lista instancias de SGLINES enumeradas 2 a 5 y 7 + SNLINE LIST 2-5,7-9 + Lista instancias de SNLINES enumeradas 2 a 5 y 7 a 9. - SGLINE VIEW es una version mas verbal que SGLINE LIST, - y mostrara quien añadio la SGLINE, la fecha en la que fue + SNLINE VIEW es una version mas verbal que SNLINE LIST, + y mostrara quien añadio la SNLINE, la fecha en la que fue añadida, y cuando expira, ademas de la mascara de nombre real y la razon. - SGLINE CLEAR limpia todas las instancias de la lista de - SGLINES. + SNLINE CLEAR limpia todas las instancias de la lista de + SNLINES. Limitado a operadores de Servicios. @@ -2596,22 +2596,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Temps d'échéance des AKILLs par défaut: 1 minute OPER_STATS_AKILL_EXPIRE_NONE Temps d'échéance des AKILLs par défaut: Pas d'échéance -OPER_STATS_SGLINE_COUNT - Nombre de SGLINEs actuel: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Temps d'échéance des SGLINEs par défaut: %d jours -OPER_STATS_SGLINE_EXPIRE_DAY - Temps d'échéance des SGLINEs par défaut: 1 jour -OPER_STATS_SGLINE_EXPIRE_HOURS - Temps d'échéance des SGLINEs par défaut: %d heures -OPER_STATS_SGLINE_EXPIRE_HOUR - Temps d'échéance des SGLINEs par défaut: 1 heure -OPER_STATS_SGLINE_EXPIRE_MINS - Temps d'échéance des SGLINEs par défaut: %d minutes -OPER_STATS_SGLINE_EXPIRE_MIN - Temps d'échéance des SGLINEs par défaut: 1 minute -OPER_STATS_SGLINE_EXPIRE_NONE - Temps d'échéance des SGLINEs par défaut: Pas d'échéance +OPER_STATS_SNLINE_COUNT + Nombre de SNLINEs actuel: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Temps d'échéance des SNLINEs par défaut: %d jours +OPER_STATS_SNLINE_EXPIRE_DAY + Temps d'échéance des SNLINEs par défaut: 1 jour +OPER_STATS_SNLINE_EXPIRE_HOURS + Temps d'échéance des SNLINEs par défaut: %d heures +OPER_STATS_SNLINE_EXPIRE_HOUR + Temps d'échéance des SNLINEs par défaut: 1 heure +OPER_STATS_SNLINE_EXPIRE_MINS + Temps d'échéance des SNLINEs par défaut: %d minutes +OPER_STATS_SNLINE_EXPIRE_MIN + Temps d'échéance des SNLINEs par défaut: 1 minute +OPER_STATS_SNLINE_EXPIRE_NONE + Temps d'échéance des SNLINEs par défaut: Pas d'échéance OPER_STATS_SQLINE_COUNT Nombre de SQLINEs actuel: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2739,49 +2739,49 @@ OPER_AKILL_VIEW_FORMAT OPER_AKILL_CLEAR La liste d'AKILL a été vidée. -# SGLINE responses +# SNLINE responses OPER_CHANKILL_SYNTAX CHANKILL [+expiry] {#canal} [raison] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+échéance] {masque | liste d'entrées} [raison]] -OPER_SGLINE_UNSUPPORTED - Désolé, SGLINE n'est pas disponible sur ce réseau. -OPER_SGLINE_EXISTS - %s existe déjà sur la liste de SGLINEs. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+échéance] {masque | liste d'entrées} [raison]] +OPER_SNLINE_UNSUPPORTED + Désolé, SNLINE n'est pas disponible sur ce réseau. +OPER_SNLINE_EXISTS + %s existe déjà sur la liste de SNLINEs. +OPER_SNLINE_ALREADY_COVERED %s est déjà couvert par %s. -OPER_SGLINE_REACHED_LIMIT - Désolé, vous ne pouvez avoir que %d SGLINEs. -OPER_SGLINE_ADDED - %s ajouté à la liste de SGLINEs. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Désolé, vous ne pouvez avoir que %d SNLINEs. +OPER_SNLINE_ADDED + %s ajouté à la liste de SNLINEs. +OPER_SNLINE_CHANGED L'échéance de %s a été changée. -OPER_SGLINE_NOT_FOUND - %s introuvable sur la liste de SGLINEs. -OPER_SGLINE_NO_MATCH - Aucune entrée correspondante sur la liste de SGLINEs. -OPER_SGLINE_DELETED - %s supprimé de la liste de SGLINEs. -OPER_SGLINE_DELETED_ONE - 1 entrée supprimée de la liste de SGLINEs. -OPER_SGLINE_DELETED_SEVERAL - %d entrées supprimées de la liste de SGLINEs. -OPER_SGLINE_LIST_EMPTY - La liste de SGLINEs est vide. -OPER_SGLINE_LIST_HEADER - Liste de SGLINEs actuelle: +OPER_SNLINE_NOT_FOUND + %s introuvable sur la liste de SNLINEs. +OPER_SNLINE_NO_MATCH + Aucune entrée correspondante sur la liste de SNLINEs. +OPER_SNLINE_DELETED + %s supprimé de la liste de SNLINEs. +OPER_SNLINE_DELETED_ONE + 1 entrée supprimée de la liste de SNLINEs. +OPER_SNLINE_DELETED_SEVERAL + %d entrées supprimées de la liste de SNLINEs. +OPER_SNLINE_LIST_EMPTY + La liste de SNLINEs est vide. +OPER_SNLINE_LIST_HEADER + Liste de SNLINEs actuelle: Num Masque Raison -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Liste de SGLINEs actuelle: +OPER_SNLINE_VIEW_HEADER + Liste de SNLINEs actuelle: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (par %s le %s; %s) %s -OPER_SGLINE_CLEAR - La liste de SGLINEs a été vidée. +OPER_SNLINE_CLEAR + La liste de SNLINEs a été vidée. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5542,8 +5542,8 @@ OPER_HELP_CMD_KILLCLONES certain nom d'hôte OPER_HELP_CMD_AKILL AKILL Contrôle la liste des AKILLs -OPER_HELP_CMD_SGLINE - SGLINE Contrôle la liste des SGLINEs +OPER_HELP_CMD_SNLINE + SNLINE Contrôle la liste des SNLINEs OPER_HELP_CMD_SQLINE SQLINE Contrôle la liste des SQLINEs OPER_HELP_CMD_SZLINE @@ -5759,52 +5759,52 @@ OPER_HELP_AKILL Réservé aux opérateurs des Services. -OPER_HELP_SGLINE - Syntaxe: SGLINE ADD [+échéance] masque:raison - SGLINE DEL {masque | numéro d'entrée | liste} - SGLINE LIST [masque | liste] - SGLINE VIEW [masque | liste] - SGLINE CLEAR +OPER_HELP_SNLINE + Syntaxe: SNLINE ADD [+échéance] masque:raison + SNLINE DEL {masque | numéro d'entrée | liste} + SNLINE LIST [masque | liste] + SNLINE VIEW [masque | liste] + SNLINE CLEAR Permet aux OPérateurs des Services de manipuler la liste - de SGLINEs. Si un utilisateur ayant un vrai nom correspondant - à un masque de SGLINE tente de se connecter, les Services ne + de SNLINEs. Si un utilisateur ayant un vrai nom correspondant + à un masque de SNLINE tente de se connecter, les Services ne lui permettront pas de continuer sa session IRC. - SGLINE ADD ajoute le masque de vrai nom donné à la liste - de SGLINEs pour la raison précisée (qui doit être donnée). + SNLINE ADD ajoute le masque de vrai nom donné à la liste + de SNLINEs pour la raison précisée (qui doit être donnée). échéance est un nombre entier suivi par un d (jours), h (heures), ou m (minutes). Les combinaisons (telles que 1h30m) ne sont pas permises. Si l'unité n'est pas incluse, la valeur est en jours par défaut (donc +30 est équivalent - à 30 jours). Pour ajouter une SGLINE qui n'expire pas, utilisez + à 30 jours). Pour ajouter une SNLINE qui n'expire pas, utilisez +0. Si le masque de vrai nom à ajouter commence par un +, une échéance doit être donnée, même si c'est la même que - celle par défaut. L'échéance par défaut pour les SGLINEs peut + celle par défaut. L'échéance par défaut pour les SNLINEs peut être consultée par la commande STATS AKILL. Note: puisque le masque de vrai nom peut contenir des espaces, le séparateur entre lui et la raison est le signe deux points. - La commande SGLINE DEL supprime le masque donné de la liste - de SGLINEs s'il existe. Si une liste de numéros d'entrées + La commande SNLINE DEL supprime le masque donné de la liste + de SNLINEs s'il existe. Si une liste de numéros d'entrées est donnée, ces entrées sont supprimées. (Voyez l'exemple pour LIST ci-dessous.) - La commande SGLINE LIST affiche la liste des SGLINEs. Si un + La commande SNLINE LIST affiche la liste des SNLINEs. Si un masque joker est donné, seules les entrées correspondantes au masque sont affichées. Si une liste de numéros d'entrées est donnée, seules ces entrées sont affichées, par exemple: - SGLINE LIST 2-5,7-9 - Liste les entrées de la liste de SGLINEs numéro 2 à 5 + SNLINE LIST 2-5,7-9 + Liste les entrées de la liste de SNLINEs numéro 2 à 5 et 7 à 9. - SGLINE VIEW est une version plus détaillée de SGLINE LIST, - et affichera par qui et quand a été ajoutée une SGLINE et + SNLINE VIEW est une version plus détaillée de SNLINE LIST, + et affichera par qui et quand a été ajoutée une SNLINE et sa date d'expiration, en plus du masque de vrai nom et de la raison. - SGLINE CLEAR vide toutes les entrées de la liste de SGLINEs. + SNLINE CLEAR vide toutes les entrées de la liste de SNLINEs. Réservé aux OPérateurs des Services. @@ -2578,22 +2578,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Åîáñ÷Þò ÷ñüíïò ëÞîçò AKILL: 1 ëåðôü OPER_STATS_AKILL_EXPIRE_NONE Åîáñ÷Þò ÷ñüíïò ëÞîçò AKILL: Äåí ëÞãåé ðïôÝ -OPER_STATS_SGLINE_COUNT - Ùò ôþñá õðÜñ÷ïõí SGLINEs: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Åîáñ÷Þò ÷ñüíïò ëÞîçò SGLINE: %d ìÝñåò -OPER_STATS_SGLINE_EXPIRE_DAY - Åîáñ÷Þò ÷ñüíïò ëÞîçò SGLINE: 1 ìÝñá -OPER_STATS_SGLINE_EXPIRE_HOURS - Åîáñ÷Þò ÷ñüíïò ëÞîçò SGLINE: %d þñåò -OPER_STATS_SGLINE_EXPIRE_HOUR - Åîáñ÷Þò ÷ñüíïò ëÞîçò SGLINE: 1 þñá -OPER_STATS_SGLINE_EXPIRE_MINS - Åîáñ÷Þò ÷ñüíïò ëÞîçò SGLINE: %d ëåðôÜ -OPER_STATS_SGLINE_EXPIRE_MIN - Åîáñ÷Þò ÷ñüíïò ëÞîçò SGLINE: 1 ëåðôü -OPER_STATS_SGLINE_EXPIRE_NONE - Åîáñ÷Þò ÷ñüíïò ëÞîçò SGLINE: Äåí ëÞãåé ðïôÝ +OPER_STATS_SNLINE_COUNT + Ùò ôþñá õðÜñ÷ïõí SNLINEs: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Åîáñ÷Þò ÷ñüíïò ëÞîçò SNLINE: %d ìÝñåò +OPER_STATS_SNLINE_EXPIRE_DAY + Åîáñ÷Þò ÷ñüíïò ëÞîçò SNLINE: 1 ìÝñá +OPER_STATS_SNLINE_EXPIRE_HOURS + Åîáñ÷Þò ÷ñüíïò ëÞîçò SNLINE: %d þñåò +OPER_STATS_SNLINE_EXPIRE_HOUR + Åîáñ÷Þò ÷ñüíïò ëÞîçò SNLINE: 1 þñá +OPER_STATS_SNLINE_EXPIRE_MINS + Åîáñ÷Þò ÷ñüíïò ëÞîçò SNLINE: %d ëåðôÜ +OPER_STATS_SNLINE_EXPIRE_MIN + Åîáñ÷Þò ÷ñüíïò ëÞîçò SNLINE: 1 ëåðôü +OPER_STATS_SNLINE_EXPIRE_NONE + Åîáñ÷Þò ÷ñüíïò ëÞîçò SNLINE: Äåí ëÞãåé ðïôÝ OPER_STATS_SQLINE_COUNT Ùò ôþñá õðÜñ÷ïõí SQLINEs: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2721,49 +2721,49 @@ OPER_AKILL_VIEW_FORMAT OPER_AKILL_CLEAR Ç ëßóôá AKILL êáèáñßóôçêå. -# SGLINE responses +# SNLINE responses OPER_CHANKILL_SYNTAX CHANKILL [+expiry] {#channel} [reason] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiry] {mask | entry-list}[:reason]] -OPER_SGLINE_UNSUPPORTED - Óõãíþìç, ç åíôïëÞ SGLINE äåí åßíáé äéáèÝóéìç óå áõôü ôï äßêôõï. -OPER_SGLINE_EXISTS - %s õðÜñ÷åé Þäç óôçí ëßóôá SGLINE. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+expiry] {mask | entry-list}[:reason]] +OPER_SNLINE_UNSUPPORTED + Óõãíþìç, ç åíôïëÞ SNLINE äåí åßíáé äéáèÝóéìç óå áõôü ôï äßêôõï. +OPER_SNLINE_EXISTS + %s õðÜñ÷åé Þäç óôçí ëßóôá SNLINE. +OPER_SNLINE_ALREADY_COVERED %s Ý÷åé Þäç êáëõöèåß áðü ôïí %s. -OPER_SGLINE_REACHED_LIMIT - Óõãíþìç, ìðïñåßò íá Ý÷åéò ìüíï %d SGLINEs. -OPER_SGLINE_ADDED - %s ðñïóèÝèçêå óôçí ëßóôá SGLINE. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Óõãíþìç, ìðïñåßò íá Ý÷åéò ìüíï %d SNLINEs. +OPER_SNLINE_ADDED + %s ðñïóèÝèçêå óôçí ëßóôá SNLINE. +OPER_SNLINE_CHANGED Ôï ÷ñïíéêü üñéï ôïõ/ôçò %s Üëëáîå. -OPER_SGLINE_NOT_FOUND - %s äåí âñÝèçêå óôçí ëßóôá SGLINE. -OPER_SGLINE_NO_MATCH - Äåí âñÝèçêáí èÝóåéò óôçí ëßóôá SGLINE. -OPER_SGLINE_DELETED - %s äéáãñÜöçêå áðü ôçí ëßóôá SGLINE. -OPER_SGLINE_DELETED_ONE - ÄéáãñÜöçêå 1 èÝóç áðü ôçí ëßóôá SGLINE. -OPER_SGLINE_DELETED_SEVERAL - ÄéáãñÜöçêáí %d èÝóåéò áðü ôçí ëßóôá SGLINE. -OPER_SGLINE_LIST_EMPTY - Ç ëßóôá SGLINE åßíáé Üäåéá. -OPER_SGLINE_LIST_HEADER - Ç Ýùò ôþñá ëßóôá SGLINE åßíáé ïé åîçò: +OPER_SNLINE_NOT_FOUND + %s äåí âñÝèçêå óôçí ëßóôá SNLINE. +OPER_SNLINE_NO_MATCH + Äåí âñÝèçêáí èÝóåéò óôçí ëßóôá SNLINE. +OPER_SNLINE_DELETED + %s äéáãñÜöçêå áðü ôçí ëßóôá SNLINE. +OPER_SNLINE_DELETED_ONE + ÄéáãñÜöçêå 1 èÝóç áðü ôçí ëßóôá SNLINE. +OPER_SNLINE_DELETED_SEVERAL + ÄéáãñÜöçêáí %d èÝóåéò áðü ôçí ëßóôá SNLINE. +OPER_SNLINE_LIST_EMPTY + Ç ëßóôá SNLINE åßíáé Üäåéá. +OPER_SNLINE_LIST_HEADER + Ç Ýùò ôþñá ëßóôá SNLINE åßíáé ïé åîçò: Íïõ ÌÜóêá Ëüãïò -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Current SGLINE list: +OPER_SNLINE_VIEW_HEADER + Current SNLINE list: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (by %s on %s; %s) %s -OPER_SGLINE_CLEAR - Ç ëßóôá SGLINE êáèáñßóôçêå. +OPER_SNLINE_CLEAR + Ç ëßóôá SNLINE êáèáñßóôçêå. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5456,8 +5456,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Óêïôþíåé üëïõò ôïõò ÷ñÞóôåò ðïõ Ý÷ïõí ôï ßäéï host OPER_HELP_CMD_AKILL AKILL ÐñïóèÝôåé ip êëð óôçí ëßóôá AKILL -OPER_HELP_CMD_SGLINE - SGLINE ÐñïóèÝôåé ip óôçí ëßóôá SGLINE +OPER_HELP_CMD_SNLINE + SNLINE ÐñïóèÝôåé ip óôçí ëßóôá SNLINE OPER_HELP_CMD_SQLINE SQLINE ÐñïóèÝôåé ip óôçí ëßóôá SQLINE OPER_HELP_CMD_SZLINE @@ -5658,50 +5658,50 @@ OPER_HELP_AKILL Ìüíï ãéá ôïõò Services operators. -OPER_HELP_SGLINE - Óýíôáîç: SGLINE ADD [+expiry] ìÜóêá:ëüãïò - SGLINE DEL {ìÜóêá | èÝóåéò-íïýìåñá | ëßóôá} - SGLINE LIST [ìÜóêá | ëßóôá] - SGLINE VIEW [ìÜóêá | ëßóôá] - SGLINE CLEAR - - Ïé Services operators ìðïñïýí íá áëëÜîïõí ôçí ëßóôá SGLINE. Áí - ï ÷ñÞóôçò ìå ôï ðñáãìáôéêü üíïìá ôáéñéÜæåé ìå ôçí SGLINE ìÜóêá,ôá +OPER_HELP_SNLINE + Óýíôáîç: SNLINE ADD [+expiry] ìÜóêá:ëüãïò + SNLINE DEL {ìÜóêá | èÝóåéò-íïýìåñá | ëßóôá} + SNLINE LIST [ìÜóêá | ëßóôá] + SNLINE VIEW [ìÜóêá | ëßóôá] + SNLINE CLEAR + + Ïé Services operators ìðïñïýí íá áëëÜîïõí ôçí ëßóôá SNLINE. Áí + ï ÷ñÞóôçò ìå ôï ðñáãìáôéêü üíïìá ôáéñéÜæåé ìå ôçí SNLINE ìÜóêá,ôá Services äåí èá ôïí áöÞóïõí íá óõíäåèåß. - Ç åíôïëÞ SGLINE ADD ðñïóèÝôåé ìéá ðñáãìáôéêÞ ìÜóêá óôçí ëßóôá SGLINE + Ç åíôïëÞ SNLINE ADD ðñïóèÝôåé ìéá ðñáãìáôéêÞ ìÜóêá óôçí ëßóôá SNLINE ìå êÜðïéïí ëüãï ôïí ïðïßï ðñÝðåé íá ôïí äþóåôå. Ôï expiry åßíáé óõãêåêñéìÝíï êáé åðéëÝãåôáé áðü ôá åðüìåíá, d (ìÝñåò), h (þñåò), Þ m (ëåðôÜ). Óõíäéáóìïß (üðùò 1h30m) äåí åðéôñÝðïíôáé . Áí äåí äþóåôå ôï ÷ñüíï áðü default èá åßíáé óå ìÝñåò (èá åßíáé +30 ðïõ óçìáßíåé 30 - ìÝñåò). Ãéá íá ðñïóèÝóåôå Ýíá SGLINE ðïõ íá ìçí ëÞãåé, ÷ñçóéìïðïéåßóôå +0. + ìÝñåò). Ãéá íá ðñïóèÝóåôå Ýíá SNLINE ðïõ íá ìçí ëÞãåé, ÷ñçóéìïðïéåßóôå +0. usermask îåêéíÜåé ìå +, ï ÷ñüíïò ëÞîçò èá ðñÝðåé íá äßíåôå áêüìá êáé áí åßíáé ßäéïò ìå ôïí default. Ï - óõãêåêñéìÝíïò ÷ñüíïò ëÞîçò ôçò åíôïëÞò SGLINE ìðïñåß íá âñåèåß ìå ôçí åíôïëÞ + óõãêåêñéìÝíïò ÷ñüíïò ëÞîçò ôçò åíôïëÞò SNLINE ìðïñåß íá âñåèåß ìå ôçí åíôïëÞ STATS AKILL. Óçìåßùóç: åðåéäÞ ôï ðñáãìáôéêü üíïìá-ìÜóêá ìðïñåß íá ðåñéÝ÷åé êåíÜ, äéá÷ùñéóôéêÜ ìåôáîý ôïõò íá åßóôå ðñïóåêôéêïß óôï ëüãï. - Ç åíôïëÞ SGLINE DEL áöáéñåß ìßá ìÜóêá áðü ôçí ëßóôá - SGLINE list áí õðÜñ÷åé. Áí ç ëßóôá ìå ôéò èÝóåéò-íïýìåñá äßíåôå, + Ç åíôïëÞ SNLINE DEL áöáéñåß ìßá ìÜóêá áðü ôçí ëßóôá + SNLINE list áí õðÜñ÷åé. Áí ç ëßóôá ìå ôéò èÝóåéò-íïýìåñá äßíåôå, áõôÝò äéáãñÜöïíôáé. (ÄÝò ôï ðáñÜäåéãìá LIST.) - Ç åíôïëÞ SGLINE LIST åìöáíßæåé ôçí ëßóôá ìå ôá SGLINE. + Ç åíôïëÞ SNLINE LIST åìöáíßæåé ôçí ëßóôá ìå ôá SNLINE. Áí äßíåôáé ìéá óõãêåêñéìÝíç ìÜóêá, èá åìöáíéóôïýí ïé èÝóåéò ðïõ áíôéóôïé÷ïýí óå áõôÞ ôç ìÜóêá Áí äßíåôå ç ëßóôá ìå ôéò èÝóåéò-íïýìåñá ìðïñåßôå íá ôéò äåßôå êáé áëëéþò, ðáñÜäåéãìá: - SGLINE LIST 2-5,7-9 + SNLINE LIST 2-5,7-9 Åìöáíßæåé ôéò èÝóåéò ìå ôá íïýìåñá 2 åùò 5 êáé 7 - åùò 9 ôçò ëßóôáò SGLINE. + åùò 9 ôçò ëßóôáò SNLINE. - Ç åíôïëÞ SGLINE VIEW åßíáé ðéï âåëôéùìÝíç áðü ôçí SGLINE LIST, êáé - åìöáíßæåé ðïéïò Ýâáëå ôï êÜèå SGLINE, ôçí çìåñïìçíßá ðïõ ìðÞêå, êáé ðüôå + Ç åíôïëÞ SNLINE VIEW åßíáé ðéï âåëôéùìÝíç áðü ôçí SNLINE LIST, êáé + åìöáíßæåé ðïéïò Ýâáëå ôï êÜèå SNLINE, ôçí çìåñïìçíßá ðïõ ìðÞêå, êáé ðüôå ëÞãåé, êáé öõóéêÜ ôç realname ìÜóêá êáé ôïí ëüãï. - Ç åíôïëÞ SGLINE CLEAR êáèáñßæåé üëåò ôéò èÝóåéò áðü ôçí ëßóôá SGLINE. + Ç åíôïëÞ SNLINE CLEAR êáèáñßæåé üëåò ôéò èÝóåéò áðü ôçí ëßóôá SNLINE. Ìüíï ãéá ôïõò Services operators. diff --git a/lang/hun.l b/lang/hun.l index ec488369b..113b9b94b 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -2540,22 +2540,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Alap AKILL lejárati idõ: 1 perc OPER_STATS_AKILL_EXPIRE_NONE Alap AKILL lejárati idõ: Nem elévülõ -OPER_STATS_SGLINE_COUNT - Aktuális SGLINEok száma: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Alap SGLINE lejárati idõ: %d nap -OPER_STATS_SGLINE_EXPIRE_DAY - Alap SGLINE lejárati idõ: 1 nap -OPER_STATS_SGLINE_EXPIRE_HOURS - Alap SGLINE lejárati idõ: %d óra -OPER_STATS_SGLINE_EXPIRE_HOUR - Alap SGLINE lejárati idõ: 1 óra -OPER_STATS_SGLINE_EXPIRE_MINS - Alap SGLINE lejárati idõ: %d perc -OPER_STATS_SGLINE_EXPIRE_MIN - Alap SGLINE lejárati idõ: 1 perc -OPER_STATS_SGLINE_EXPIRE_NONE - Alap SGLINE lejárati ido: Nem elévülõ +OPER_STATS_SNLINE_COUNT + Aktuális SNLINEok száma: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Alap SNLINE lejárati idõ: %d nap +OPER_STATS_SNLINE_EXPIRE_DAY + Alap SNLINE lejárati idõ: 1 nap +OPER_STATS_SNLINE_EXPIRE_HOURS + Alap SNLINE lejárati idõ: %d óra +OPER_STATS_SNLINE_EXPIRE_HOUR + Alap SNLINE lejárati idõ: 1 óra +OPER_STATS_SNLINE_EXPIRE_MINS + Alap SNLINE lejárati idõ: %d perc +OPER_STATS_SNLINE_EXPIRE_MIN + Alap SNLINE lejárati idõ: 1 perc +OPER_STATS_SNLINE_EXPIRE_NONE + Alap SNLINE lejárati ido: Nem elévülõ OPER_STATS_SQLINE_COUNT Aktuális SQLINEok száma : %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2681,46 +2681,46 @@ OPER_AKILL_CLEAR OPER_CHANKILL_SYNTAX CHANKILL [+lejárat] {#szoba} [indok] -# SGLINE válaszok -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[ +lejárat] {maszk| sorszám }[:Indok]] -OPER_SGLINE_UNSUPPORTED - SGLINE nem használható ezen a hálózaton. -OPER_SGLINE_EXISTS - %s már szerepel az SGLINE listán. -OPER_SGLINE_ALREADY_COVERED +# SNLINE válaszok +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[ +lejárat] {maszk| sorszám }[:Indok]] +OPER_SNLINE_UNSUPPORTED + SNLINE nem használható ezen a hálózaton. +OPER_SNLINE_EXISTS + %s már szerepel az SNLINE listán. +OPER_SNLINE_ALREADY_COVERED %s társítva van %s által. -OPER_SGLINE_REACHED_LIMIT - Te csak %d számú SGLINE-t jegyezhetsz. -OPER_SGLINE_ADDED - %s hozzáadva a SGLINE listához. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Te csak %d számú SNLINE-t jegyezhetsz. +OPER_SNLINE_ADDED + %s hozzáadva a SNLINE listához. +OPER_SNLINE_CHANGED Lejárati idõ megváltozott: %s . -OPER_SGLINE_NOT_FOUND - %s nincs a SGLINE listán. -OPER_SGLINE_NO_MATCH - Nincs ilyen bejegyzés az SGLINE listán. -OPER_SGLINE_DELETED - %s törölve az SGLINE listáról. -OPER_SGLINE_DELETED_ONE - Törölve 1 bejegyzés a SGLINE listáról. -OPER_SGLINE_DELETED_SEVERAL - Törölve %d bejegyzés a SGLINE listáról. -OPER_SGLINE_LIST_EMPTY - SGLINE lista üres. -OPER_SGLINE_LIST_HEADER - Aktuális SGLINE lista: +OPER_SNLINE_NOT_FOUND + %s nincs a SNLINE listán. +OPER_SNLINE_NO_MATCH + Nincs ilyen bejegyzés az SNLINE listán. +OPER_SNLINE_DELETED + %s törölve az SNLINE listáról. +OPER_SNLINE_DELETED_ONE + Törölve 1 bejegyzés a SNLINE listáról. +OPER_SNLINE_DELETED_SEVERAL + Törölve %d bejegyzés a SNLINE listáról. +OPER_SNLINE_LIST_EMPTY + SNLINE lista üres. +OPER_SNLINE_LIST_HEADER + Aktuális SNLINE lista: Szám Maszk Indok -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Aktuális SGLINE lista: +OPER_SNLINE_VIEW_HEADER + Aktuális SNLINE lista: # szám, mask, set-by, set-idõ, lejárat, indok -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (%s által, ekkor: %s; %s) %s -OPER_SGLINE_CLEAR - Az SGLINE lista törölve. +OPER_SNLINE_CLEAR + Az SNLINE lista törölve. # SQLINE válaszok OPER_SQLINE_SYNTAX @@ -5369,8 +5369,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Killeli az összes klónt a hosztról OPER_HELP_CMD_AKILL AKILL Szerkeszti az AKILL listát -OPER_HELP_CMD_SGLINE - SGLINE Szerkeszti az SGLINE listát +OPER_HELP_CMD_SNLINE + SNLINE Szerkeszti az SNLINE listát OPER_HELP_CMD_SQLINE SQLINE Szerkeszti az SQLINE listát OPER_HELP_CMD_SZLINE @@ -5570,19 +5570,19 @@ OPER_HELP_AKILL Korlátozva Szervíz operatornak. -OPER_HELP_SGLINE - Syntax: SGLINE ADD [+lejárat] maszk:indok - SGLINE DEL {maszk | sor-szám | list} - SGLINE LIST [maszk | list] - SGLINE VIEW [maszk | list] - SGLINE CLEAR +OPER_HELP_SNLINE + Syntax: SNLINE ADD [+lejárat] maszk:indok + SNLINE DEL {maszk | sor-szám | list} + SNLINE LIST [maszk | list] + SNLINE VIEW [maszk | list] + SNLINE CLEAR Lehetõséget ad a szervíz opoknak, hogy karbantartsák az - SGLINE listát. Ha egy felhasználó egy valós névvel akar - csatlakozni , ami szerepel az SGLINE listán akkor szervíz + SNLINE listát. Ha egy felhasználó egy valós névvel akar + csatlakozni , ami szerepel az SNLINE listán akkor szervíz nem fogja engedélyezni részére a csatlakozást. - SGLINE ADD hozzáadja a valósnévmaszkot az SGLINE listára + SNLINE ADD hozzáadja a valósnévmaszkot az SNLINE listára a megadott indokkal (amit meg is kell adni). Az elévülést egész számmot kovet egy idoparaméter d (nap), h (óra), m (perc).Ezek kombinálása nem lehetséges(1h30m). @@ -5590,25 +5590,25 @@ OPER_HELP_SGLINE (+30 az 30 napot jelent).Ha +0-át adsz meg akkor nem elévülo lesz.Ha a usermaszk + -al kezdodik akkor elévülést meg kell adni akkor is ha megegyezik az alapértelmezéssel. - Az SGLINE jelenlegi alapértelmezett elévülési ideje + Az SNLINE jelenlegi alapértelmezett elévülési ideje megnézheto a STATS AKILL paranccsal. Jegyzet: a valósnév maszkja tartalmazhat szóközt ezért közte és az indok között az elválasztó karakter a vesszõ. - SGLINE DEL eltávolítja a megadott maszkot az SGLINE listáról, + SNLINE DEL eltávolítja a megadott maszkot az SNLINE listáról, ha jelen van.Ha bejegyzés sorszámot adsz meg akkor azok fognak törlodni. (Lásd a példa alább) - SGLINE LIST kiirja az összes SGLINE bejegyzést; ha + SNLINE LIST kiirja az összes SNLINE bejegyzést; ha egy tetszõleges maszk meg van adva, a lista korlátozva lesz azokra a bejegyzésekre, amelyekre ráillik a maszk. Példa: - SGLINE LIST 2-5,7-9 - Listázza a SGLINE-okat 2-töl 5-ig és 7-tõl 9-ig az - SGLINE listáról + SNLINE LIST 2-5,7-9 + Listázza a SNLINE-okat 2-töl 5-ig és 7-tõl 9-ig az + SNLINE listáról - SGLINE VIEW részletesebb verziója a SGLINE LIST-nek, - és megmutatja, ki készítette a SGLINE bejegyzéseket, + SNLINE VIEW részletesebb verziója a SNLINE LIST-nek, + és megmutatja, ki készítette a SNLINE bejegyzéseket, és mikor jár le, mint a maszkot és az indokot. - SGLINE CLEAR törli az SGLINE bejegyzéseket. + SNLINE CLEAR törli az SNLINE bejegyzéseket. Korlátozva Szervíz operatornak. @@ -5650,7 +5650,7 @@ OPER_HELP_SQLINE SQLINE listáról SQLINE VIEW részletesebb verziója a SQLINE LIST-nek, - és megmutatja, ki készítette a SGLINE bejegyzéseket, + és megmutatja, ki készítette a SNLINE bejegyzéseket, és mikor jár le, mint a maszkot és az indokot. SQLINE CLEAR törli az SQLINE bejegyzéseket. @@ -2502,22 +2502,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Durata di default delle AKILL: 1 minuto OPER_STATS_AKILL_EXPIRE_NONE Durata di default delle AKILL: infinita -OPER_STATS_SGLINE_COUNT - Numero attuale di SGLINE: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Durata di default delle SGLINE: %d giorni -OPER_STATS_SGLINE_EXPIRE_DAY - Durata di default delle SGLINE: 1 giorno -OPER_STATS_SGLINE_EXPIRE_HOURS - Durata di default delle SGLINE: %d ore -OPER_STATS_SGLINE_EXPIRE_HOUR - Durata di default delle SGLINE: 1 ora -OPER_STATS_SGLINE_EXPIRE_MINS - Durata di default delle SGLINE: %d minuti -OPER_STATS_SGLINE_EXPIRE_MIN - Durata di default delle SGLINE: 1 minuto -OPER_STATS_SGLINE_EXPIRE_NONE - Durata di default delle SGLINE: infinita +OPER_STATS_SNLINE_COUNT + Numero attuale di SNLINE: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Durata di default delle SNLINE: %d giorni +OPER_STATS_SNLINE_EXPIRE_DAY + Durata di default delle SNLINE: 1 giorno +OPER_STATS_SNLINE_EXPIRE_HOURS + Durata di default delle SNLINE: %d ore +OPER_STATS_SNLINE_EXPIRE_HOUR + Durata di default delle SNLINE: 1 ora +OPER_STATS_SNLINE_EXPIRE_MINS + Durata di default delle SNLINE: %d minuti +OPER_STATS_SNLINE_EXPIRE_MIN + Durata di default delle SNLINE: 1 minuto +OPER_STATS_SNLINE_EXPIRE_NONE + Durata di default delle SNLINE: infinita OPER_STATS_SQLINE_COUNT Numero attuale di SQLINE: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2642,46 +2642,46 @@ OPER_AKILL_CLEAR La lista AKILL è stata svuotata. OPER_CHANKILL_SYNTAX CHANKILL [+scadenza] {#canale} [motivo] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+durata] {mask | numero-lista}[:motivo]] -OPER_SGLINE_UNSUPPORTED - Spiacente, SGLINE non è disponibile su questa rete. -OPER_SGLINE_EXISTS - %s è già presente nella lista SGLINE. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+durata] {mask | numero-lista}[:motivo]] +OPER_SNLINE_UNSUPPORTED + Spiacente, SNLINE non è disponibile su questa rete. +OPER_SNLINE_EXISTS + %s è già presente nella lista SNLINE. +OPER_SNLINE_ALREADY_COVERED %s è già coperto da %s. -OPER_SGLINE_REACHED_LIMIT - Spiacente, puoi avere un massimo di %d SGLINE. -OPER_SGLINE_ADDED - %s aggiunto alla lista SGLINE. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Spiacente, puoi avere un massimo di %d SNLINE. +OPER_SNLINE_ADDED + %s aggiunto alla lista SNLINE. +OPER_SNLINE_CHANGED Durata di %s modificata. -OPER_SGLINE_NOT_FOUND - %s non trovato nella lista SGLINE. -OPER_SGLINE_NO_MATCH - Nessun record corrispondente nella lista SGLINE. -OPER_SGLINE_DELETED - %s eliminato dalla lista SGLINE. -OPER_SGLINE_DELETED_ONE - Eliminato 1 record dalla lista SGLINE. -OPER_SGLINE_DELETED_SEVERAL - Eliminati %d record dalla lista SGLINE. -OPER_SGLINE_LIST_EMPTY - La lista SGLINE è vuota. -OPER_SGLINE_LIST_HEADER - Lista SGLINE attuale: +OPER_SNLINE_NOT_FOUND + %s non trovato nella lista SNLINE. +OPER_SNLINE_NO_MATCH + Nessun record corrispondente nella lista SNLINE. +OPER_SNLINE_DELETED + %s eliminato dalla lista SNLINE. +OPER_SNLINE_DELETED_ONE + Eliminato 1 record dalla lista SNLINE. +OPER_SNLINE_DELETED_SEVERAL + Eliminati %d record dalla lista SNLINE. +OPER_SNLINE_LIST_EMPTY + La lista SNLINE è vuota. +OPER_SNLINE_LIST_HEADER + Lista SNLINE attuale: Num Mask Motivo -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Lista SGLINE attuale: +OPER_SNLINE_VIEW_HEADER + Lista SNLINE attuale: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (by %s on %s; %s) %s -OPER_SGLINE_CLEAR - La lista SGLINE è stata svuotata. +OPER_SNLINE_CLEAR + La lista SNLINE è stata svuotata. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5365,8 +5365,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Killa tutti gli utenti da un certo host OPER_HELP_CMD_AKILL AKILL Manipola la lista AKILL -OPER_HELP_CMD_SGLINE - SGLINE Manipola la lista SGLINE +OPER_HELP_CMD_SNLINE + SNLINE Manipola la lista SNLINE OPER_HELP_CMD_SQLINE SQLINE Manipola la lista SQLINE OPER_HELP_CMD_SZLINE @@ -5564,51 +5564,51 @@ OPER_HELP_AKILL AKILL CLEAR svuota la lista AKILL. -OPER_HELP_SGLINE - Sintassi: SGLINE ADD [+durata] mask:motivo - SGLINE DEL {mask | numero | lista} - SGLINE LIST [mask | lista] - SGLINE VIEW [mask | lista] - SGLINE CLEAR +OPER_HELP_SNLINE + Sintassi: SNLINE ADD [+durata] mask:motivo + SNLINE DEL {mask | numero | lista} + SNLINE LIST [mask | lista] + SNLINE VIEW [mask | lista] + SNLINE CLEAR - Permette ai Services operator di manipolare la lista SGLINE. - Se un utente che si trova nella lista SGLINE cerca di connettersi, + Permette ai Services operator di manipolare la lista SNLINE. + Se un utente che si trova nella lista SNLINE cerca di connettersi, i Services non gli permetterano di proseguire la sua sessione su IRC. - SGLINE ADD aggiunge la mask di realname specificata alla lista + SNLINE ADD aggiunge la mask di realname specificata alla lista sgline per il motivo specificato (che deve essere indicato). durata è specifcato come un intero seguito da una lettera, che può essere d (giorni), h (ore), o m (minuti). Le combinazioni (ad esempio 1h30m) non sono permesse. Se non viene specificata una unità, il valore viene inteso in giorni - (quindi +30 significa 30 giorni). Per aggiungere una SGLINE + (quindi +30 significa 30 giorni). Per aggiungere una SNLINE senza scadenza, bisogna usare +0. Se la usermask indicata inizia con un +, la durata deve essere indicata esplicitamente, anche se è la stessa di default. La durata di default per le - SGLINE può essere trovata con il comando STATS AKILL. + SNLINE può essere trovata con il comando STATS AKILL. Nota: poiché la mask di realname può contenere spazi, il separatore tra la mask e il motivo è un duepunti. - Il comando SGLINE DEL rimuove la mask specificata dalla lista - SGLINE, se è presente. Se viene indicata una lista di numeri, + Il comando SNLINE DEL rimuove la mask specificata dalla lista + SNLINE, se è presente. Se viene indicata una lista di numeri, verrano rimossi i record corrispondenti (vedi l'esempio di LIST). - Il comando SGLINE LIST mostra la lista SGLINE. Se viene usata + Il comando SNLINE LIST mostra la lista SNLINE. Se viene usata una wildcard nella mask, solo i record che corrispondono alla mask vengono mostrati. Se viene indicata una lista di numeri, soltanto quei record vengono mostrati, ad esempio: - SGLINE LIST 2-5,7-9 - Mostra i record della lista SGLINE che hanno numeri da 2 + SNLINE LIST 2-5,7-9 + Mostra i record della lista SNLINE che hanno numeri da 2 a 5 e da 7 a 9. - SGLINE VIEW mostra più informazioni di SGLINE LIST, e indica - chi ha aggiunto una SGLINE, quando è stata aggiunta, e quando + SNLINE VIEW mostra più informazioni di SNLINE LIST, e indica + chi ha aggiunto una SNLINE, quando è stata aggiunta, e quando scade, oltre alla mask di realname e al motivo. - SGLINE CLEAR svuota la lista SGLINE. + SNLINE CLEAR svuota la lista SNLINE. OPER_HELP_SQLINE Sintassi: SQLINE ADD [+durata] mask motivo @@ -5666,7 +5666,7 @@ OPER_HELP_SZLINE SZLINE CLEAR Permette ai Services operator di manipolare la lista SZLINE. - Se un utente il cui IP si trova nella lista SGLINE cerca di + Se un utente il cui IP si trova nella lista SNLINE cerca di connettersi, i Services non gli permetterano di proseguire la sua sessione su IRC (sia che l'IP abbia un host alfa- numerico corrispondente o meno). @@ -2548,22 +2548,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Standaard AKILL verloop tijd: 1 minuut OPER_STATS_AKILL_EXPIRE_NONE Standaard AKILL verloop tijd: Verloopt niet -OPER_STATS_SGLINE_COUNT - Huidig aantal SGLINEs: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Standaard SGLINE verloop tijd: %d dagen -OPER_STATS_SGLINE_EXPIRE_DAY - Standaard SGLINE verloop tijd: 1 dag -OPER_STATS_SGLINE_EXPIRE_HOURS - Standaard SGLINE verloop tijd: %d uur -OPER_STATS_SGLINE_EXPIRE_HOUR - Standaard SGLINE verloop tijd: 1 uur -OPER_STATS_SGLINE_EXPIRE_MINS - Standaard SGLINE verloop tijd: %d minuten -OPER_STATS_SGLINE_EXPIRE_MIN - Standaard SGLINE verloop tijd: 1 minuut -OPER_STATS_SGLINE_EXPIRE_NONE - Standaard SGLINE verloop tijd: Verloopt niet +OPER_STATS_SNLINE_COUNT + Huidig aantal SNLINEs: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Standaard SNLINE verloop tijd: %d dagen +OPER_STATS_SNLINE_EXPIRE_DAY + Standaard SNLINE verloop tijd: 1 dag +OPER_STATS_SNLINE_EXPIRE_HOURS + Standaard SNLINE verloop tijd: %d uur +OPER_STATS_SNLINE_EXPIRE_HOUR + Standaard SNLINE verloop tijd: 1 uur +OPER_STATS_SNLINE_EXPIRE_MINS + Standaard SNLINE verloop tijd: %d minuten +OPER_STATS_SNLINE_EXPIRE_MIN + Standaard SNLINE verloop tijd: 1 minuut +OPER_STATS_SNLINE_EXPIRE_NONE + Standaard SNLINE verloop tijd: Verloopt niet OPER_STATS_SQLINE_COUNT Huidig aantal SQLINEs: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2687,49 +2687,49 @@ OPER_AKILL_VIEW_FORMAT OPER_AKILL_CLEAR De AKILL lijst is leeggemaakt. -# SGLINE responses +# SNLINE responses OPER_CHANKILL_SYNTAX CHANKILL [+expiry] {#channel} [reason] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+verloop] {mask | toegangslijst}[:reden]] -OPER_SGLINE_UNSUPPORTED - Sorry, SGLINE is niet beschikbaar op dit netwerk. -OPER_SGLINE_EXISTS - %s bestaat al op de SGLINE lijst. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+verloop] {mask | toegangslijst}[:reden]] +OPER_SNLINE_UNSUPPORTED + Sorry, SNLINE is niet beschikbaar op dit netwerk. +OPER_SNLINE_EXISTS + %s bestaat al op de SNLINE lijst. +OPER_SNLINE_ALREADY_COVERED %s is al gedekt door %s. -OPER_SGLINE_REACHED_LIMIT - Sorry, je kan maar %d SGLINEs hebben. -OPER_SGLINE_ADDED - %s toegevoegd aan de SGLINE lijst. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Sorry, je kan maar %d SNLINEs hebben. +OPER_SNLINE_ADDED + %s toegevoegd aan de SNLINE lijst. +OPER_SNLINE_CHANGED Verlooptijd van %s veranderd. -OPER_SGLINE_NOT_FOUND - %s niet gevonden op de SGLINE lijst. -OPER_SGLINE_NO_MATCH - Geen overeenkomsten op de SGLINE lijst. -OPER_SGLINE_DELETED - %s verwijderd van de SGLINE lijst. -OPER_SGLINE_DELETED_ONE - 1 SGLINE verwijderd van de SGLINE lijst. -OPER_SGLINE_DELETED_SEVERAL - %d SGLINEs verwijderd van de SGLINE lijst. -OPER_SGLINE_LIST_EMPTY - SGLINE lijst is leeg. -OPER_SGLINE_LIST_HEADER - Huidige SGLINE lijst: +OPER_SNLINE_NOT_FOUND + %s niet gevonden op de SNLINE lijst. +OPER_SNLINE_NO_MATCH + Geen overeenkomsten op de SNLINE lijst. +OPER_SNLINE_DELETED + %s verwijderd van de SNLINE lijst. +OPER_SNLINE_DELETED_ONE + 1 SNLINE verwijderd van de SNLINE lijst. +OPER_SNLINE_DELETED_SEVERAL + %d SNLINEs verwijderd van de SNLINE lijst. +OPER_SNLINE_LIST_EMPTY + SNLINE lijst is leeg. +OPER_SNLINE_LIST_HEADER + Huidige SNLINE lijst: Nr Mask Reden -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Huidige SGLINE lijst: +OPER_SNLINE_VIEW_HEADER + Huidige SNLINE lijst: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (door %s op %s; %s) %s -OPER_SGLINE_CLEAR - De SGLINE lijst is leeggemaakt. +OPER_SNLINE_CLEAR + De SNLINE lijst is leeggemaakt. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5440,8 +5440,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Kill alle gebruikers met een bepaalde hostmask OPER_HELP_CMD_AKILL AKILL Beheer de AKILL lijst -OPER_HELP_CMD_SGLINE - SGLINE Beheer de SGLINE lijst +OPER_HELP_CMD_SNLINE + SNLINE Beheer de SNLINE lijst OPER_HELP_CMD_SQLINE SQLINE Beheer de SQLINE lijst OPER_HELP_CMD_SZLINE @@ -5645,50 +5645,50 @@ OPER_HELP_AKILL AKILL CLEAR maakt de AKILL lijst leeg. -OPER_HELP_SGLINE - Gebruik: SGLINE ADD [+verlooptijd] mask reden - SGLINE DEL {mask | entry-nr | lijst} - SGLINE LIST [mask | lijst] - SGLINE VIEW [mask | lijst] - SGLINE CLEAR +OPER_HELP_SNLINE + Gebruik: SNLINE ADD [+verlooptijd] mask reden + SNLINE DEL {mask | entry-nr | lijst} + SNLINE LIST [mask | lijst] + SNLINE VIEW [mask | lijst] + SNLINE CLEAR - Stelt Services operators in staat de SGLINE lijst te beheren. - Als een gebruiker die overeenkomt met een SGLINE mask probeert + Stelt Services operators in staat de SNLINE lijst te beheren. + Als een gebruiker die overeenkomt met een SNLINE mask probeert te verbinden zullen Services deze gebruiker niet toestaan zijn of haar IRC sessie voort te zetten. - SGLINE ADD voeg het gegeven user@host mask toe aan de SGLINE + SNLINE ADD voeg het gegeven user@host mask toe aan de SNLINE lijst met de gegeven reden (die moet worden gegeven). verlooptijd wordt gespecificeerd als een getal waarachter d (dagen), h (uur), of m (minuten) geplaatst wordt. Combinaties (zoals 1h30m) zijn niet toegestaan. Als er geen d, h of m wordt meegegeven, is het standaard dagen (dus +30 zelfstandig betekent - 30 dagen). Om een SGLINE die niet verloopt toe te voegen, gebruik je + 30 dagen). Om een SNLINE die niet verloopt toe te voegen, gebruik je +0. Als de usermask die toegevoegd moet worden met een + begint, is een verlooptijd verplicht, zelfs als die overeenkomt met de standaard verlooptijd. De huidige standaard verlooptijd voor een - SGLINE kan gevonden worden met het STATS AKILL commando. + SNLINE kan gevonden worden met het STATS AKILL commando. - Het SGLINE DEL commando verwijdert het gegeven mask van de SGLINE + Het SNLINE DEL commando verwijdert het gegeven mask van de SNLINE lijst als deze erop staat. Als er een lijst van entry-nummers is opgegeven zullen die verwijderd worden. (Zie het voorbeeld voor LIST hier onder.) - Her SGLINE LIST commando geeft de SGLINE lijst weer. - Als een mask met een * is gegeven zullen alleen de SGLINEs die + Her SNLINE LIST commando geeft de SNLINE lijst weer. + Als een mask met een * is gegeven zullen alleen de SNLINEs die overeenkomen met het mask worden weergegeven. Als een lijst van entry-nummers is gegeven worden alleen die weergegeven. Bijvoorbeeld: - SGLINE LIST 2-5,7-9 - Geeft SGLINEs 2 t/m 5 en 7 t/m 9 weer. + SNLINE LIST 2-5,7-9 + Geeft SNLINEs 2 t/m 5 en 7 t/m 9 weer. - SGLINE VIEW is een versie van SGLINE LIST die meer informatie - geeft: de naam van degene die de SGLINE toe heeft gevoegd, de datum + SNLINE VIEW is een versie van SNLINE LIST die meer informatie + geeft: de naam van degene die de SNLINE toe heeft gevoegd, de datum waarop dit gebeurde, waneer deze verloopt, en de user@host mask en de reden. - SGLINE CLEAR maakt de SGLINE lijst leeg. + SNLINE CLEAR maakt de SNLINE lijst leeg. OPER_HELP_SQLINE Gebruik: SQLINE ADD [+verlooptijd] mask reden @@ -3309,29 +3309,29 @@ OPER_STATS_AKILL_EXPIRE_MIN OPER_STATS_AKILL_EXPIRE_NONE Domy¶lny czas wygasania AKILL: nie wygasa -OPER_STATS_SGLINE_COUNT - Aktualna ilo¶æ wpisów SGLINE: %d +OPER_STATS_SNLINE_COUNT + Aktualna ilo¶æ wpisów SNLINE: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Domy¶lny czas wygasania SGLINE: %d dni +OPER_STATS_SNLINE_EXPIRE_DAYS + Domy¶lny czas wygasania SNLINE: %d dni -OPER_STATS_SGLINE_EXPIRE_DAY - Domy¶lny czas wygasania SGLINE: 1 dzieñ +OPER_STATS_SNLINE_EXPIRE_DAY + Domy¶lny czas wygasania SNLINE: 1 dzieñ -OPER_STATS_SGLINE_EXPIRE_HOURS - Domy¶lny czas wygasania SGLINE: %d godzin(y) +OPER_STATS_SNLINE_EXPIRE_HOURS + Domy¶lny czas wygasania SNLINE: %d godzin(y) -OPER_STATS_SGLINE_EXPIRE_HOUR - Domy¶lny czas wygasania SGLINE: 1 godzina +OPER_STATS_SNLINE_EXPIRE_HOUR + Domy¶lny czas wygasania SNLINE: 1 godzina -OPER_STATS_SGLINE_EXPIRE_MINS - Domy¶lny czas wygasania SGLINE: %d minut(y) +OPER_STATS_SNLINE_EXPIRE_MINS + Domy¶lny czas wygasania SNLINE: %d minut(y) -OPER_STATS_SGLINE_EXPIRE_MIN - Domy¶lny czas wygasania SGLINE: 1 minuta +OPER_STATS_SNLINE_EXPIRE_MIN + Domy¶lny czas wygasania SNLINE: 1 minuta -OPER_STATS_SGLINE_EXPIRE_NONE - Domy¶lny czas wygasania SGLINE: nie wygasa +OPER_STATS_SNLINE_EXPIRE_NONE + Domy¶lny czas wygasania SNLINE: nie wygasa OPER_STATS_SQLINE_COUNT Aktualna ilo¶æ wpisów SQLINE: %d @@ -3500,63 +3500,63 @@ OPER_AKILL_CLEAR OPER_CHANKILL_SYNTAX CHANKILL [+czas-trwania] {#kana³} [powód] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+czas-trwania] {maska | pozycja} [powód]] +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+czas-trwania] {maska | pozycja} [powód]] -OPER_SGLINE_UNSUPPORTED - Komenda SGLINE nie jest dostêpna w tej sieci. +OPER_SNLINE_UNSUPPORTED + Komenda SNLINE nie jest dostêpna w tej sieci. -OPER_SGLINE_EXISTS - %s ju¿ istnieje na li¶cie SGLINE. +OPER_SNLINE_EXISTS + %s ju¿ istnieje na li¶cie SNLINE. -OPER_SGLINE_ALREADY_COVERED +OPER_SNLINE_ALREADY_COVERED %s ju¿ jest obejmowane przez %s. -OPER_SGLINE_REACHED_LIMIT - Mo¿esz mieæ tylko %d wpisów na li¶cie SGLINE. +OPER_SNLINE_REACHED_LIMIT + Mo¿esz mieæ tylko %d wpisów na li¶cie SNLINE. -OPER_SGLINE_ADDED - %s dodano do listy SGLINE. +OPER_SNLINE_ADDED + %s dodano do listy SNLINE. -OPER_SGLINE_CHANGED +OPER_SNLINE_CHANGED Zmieniono czas wygasania %s. -OPER_SGLINE_NOT_FOUND - %s nie znaleziono na li¶cie SGLINE. +OPER_SNLINE_NOT_FOUND + %s nie znaleziono na li¶cie SNLINE. -OPER_SGLINE_NO_MATCH - Nie znaleziono pasuj±cych wpisów na li¶cie SGLINE. +OPER_SNLINE_NO_MATCH + Nie znaleziono pasuj±cych wpisów na li¶cie SNLINE. -OPER_SGLINE_DELETED - %s usuniêto z listy SGLINE. +OPER_SNLINE_DELETED + %s usuniêto z listy SNLINE. -OPER_SGLINE_DELETED_ONE - Usuniêto 1 wpis z listy SGLINE. +OPER_SNLINE_DELETED_ONE + Usuniêto 1 wpis z listy SNLINE. -OPER_SGLINE_DELETED_SEVERAL - Usuniêto %d wpisy(ów) z listy SGLINE. +OPER_SNLINE_DELETED_SEVERAL + Usuniêto %d wpisy(ów) z listy SNLINE. -OPER_SGLINE_LIST_EMPTY - Lista SGLINE jest pusta. +OPER_SNLINE_LIST_EMPTY + Lista SNLINE jest pusta. -OPER_SGLINE_LIST_HEADER - Aktualna lista SGLINE: +OPER_SNLINE_LIST_HEADER + Aktualna lista SNLINE: Nr Maska Powód -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Aktualna lista SGLINE: +OPER_SNLINE_VIEW_HEADER + Aktualna lista SNLINE: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (przez %s na %s; %s) %s -OPER_SGLINE_CLEAR - Lista SGLINE zosta³a wyczyszczona. +OPER_SNLINE_CLEAR + Lista SNLINE zosta³a wyczyszczona. # SQLINE responses OPER_SQLINE_SYNTAX @@ -6452,8 +6452,8 @@ OPER_HELP_CMD_KILLCLONES OPER_HELP_CMD_AKILL AKILL Zarz±dza list± AKILL -OPER_HELP_CMD_SGLINE - SGLINE Zarz±dza list± SGLINE +OPER_HELP_CMD_SNLINE + SNLINE Zarz±dza list± SNLINE OPER_HELP_CMD_SQLINE SQLINE Zarz±dza list± SQLINE @@ -6655,19 +6655,19 @@ OPER_HELP_AKILL AKILL CLEAR usuwa wszystkie wpisy z listy AKILL. -OPER_HELP_SGLINE - Sk³adnia: SGLINE ADD [+czas-trwania] maska powód - SGLINE DEL {maska | numer-wpisu | lista} - SGLINE LIST [maska | lista] - SGLINE VIEW [maska | lista] - SGLINE CLEAR +OPER_HELP_SNLINE + Sk³adnia: SNLINE ADD [+czas-trwania] maska powód + SNLINE DEL {maska | numer-wpisu | lista} + SNLINE LIST [maska | lista] + SNLINE VIEW [maska | lista] + SNLINE CLEAR - Pozwala operatorom serwisów na zarz±dzanie list± SGLINE. + Pozwala operatorom serwisów na zarz±dzanie list± SNLINE. Je¶li u¿ytkownik z realname pasuj±cym do maski na li¶cie pod³±czy siê do sieci serwisy natychmiast go roz³±cz±. - SGLINE ADD dodaje wskazan± maskê realname oraz - powód (który musi zostaæ podany) na listê SGLINE. + SNLINE ADD dodaje wskazan± maskê realname oraz + powód (który musi zostaæ podany) na listê SNLINE. Podaj±c czas mo¿na stosowaæ jednostki: s dla sekund, m dla minut, h dla godzin oraz d dla dni. Kombinacja tych jednostek nie jest mo¿liwa. Domy¶ln± @@ -6679,22 +6679,22 @@ OPER_HELP_SGLINE Uwaga: realname mo¿e zawieraæ spacje, dlatego separatorem pomiêdzy mask± i powodem jest dwukropek. - SGLINE DEL usuwa wskazane wpisy z listy SGLINE. + SNLINE DEL usuwa wskazane wpisy z listy SNLINE. Jako argument przyjmuje maskê, numer wpisu lub listê (przyk³ad poni¿ej dla polecenia LIST). - SGLINE LIST wy¶wietla zawarto¶æ listy SGLINE. Je¶li + SNLINE LIST wy¶wietla zawarto¶æ listy SNLINE. Je¶li zostanie podana maska tylko pasuj±ce wpisy zostan± pokazane. Mo¿na tak¿e u¿yæ listy, przyk³ad: - SGLINE LIST 2-5,7-9 + SNLINE LIST 2-5,7-9 Listuje wpisy od 2 do 5 oraz od 7 do 9. - SGLINE VIEW zwraca wiêcej szczegó³ów ni¿ SGLINE LIST. - Wy¶wietla informacje o dodaj±cym SGLINE, datê dodania, + SNLINE VIEW zwraca wiêcej szczegó³ów ni¿ SNLINE LIST. + Wy¶wietla informacje o dodaj±cym SNLINE, datê dodania, datê wyga¶niêcia, maskê oraz powód. - SGLINE CLEAR usuwa wszystkie wpisy z listy. + SNLINE CLEAR usuwa wszystkie wpisy z listy. OPER_HELP_SQLINE Sk³adnia: SQLINE ADD [+czas-trwania] maska powód @@ -2521,22 +2521,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Tempo atual de expiração de akill: 1 minuto OPER_STATS_AKILL_EXPIRE_NONE Tempo atual de expiração de akill: Não expira -OPER_STATS_SGLINE_COUNT - Número atual de SGLINEs: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Tempo atual de expiração de SGLINE: %d dias -OPER_STATS_SGLINE_EXPIRE_DAY - Tempo atual de expiração de SGLINE: 1 dia -OPER_STATS_SGLINE_EXPIRE_HOURS - Tempo atual de expiração de SGLINE: %d horas -OPER_STATS_SGLINE_EXPIRE_HOUR - Tempo atual de expiração de SGLINE: 1 hora -OPER_STATS_SGLINE_EXPIRE_MINS - Tempo atual de expiração de SGLINE: %d minutos -OPER_STATS_SGLINE_EXPIRE_MIN - Tempo atual de expiração de SGLINE: 1 minuto -OPER_STATS_SGLINE_EXPIRE_NONE - Tempo atual de expiração de SGLINE: Não expira +OPER_STATS_SNLINE_COUNT + Número atual de SNLINEs: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Tempo atual de expiração de SNLINE: %d dias +OPER_STATS_SNLINE_EXPIRE_DAY + Tempo atual de expiração de SNLINE: 1 dia +OPER_STATS_SNLINE_EXPIRE_HOURS + Tempo atual de expiração de SNLINE: %d horas +OPER_STATS_SNLINE_EXPIRE_HOUR + Tempo atual de expiração de SNLINE: 1 hora +OPER_STATS_SNLINE_EXPIRE_MINS + Tempo atual de expiração de SNLINE: %d minutos +OPER_STATS_SNLINE_EXPIRE_MIN + Tempo atual de expiração de SNLINE: 1 minuto +OPER_STATS_SNLINE_EXPIRE_NONE + Tempo atual de expiração de SNLINE: Não expira OPER_STATS_SQLINE_COUNT Número atual de SQLINEs: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2662,46 +2662,46 @@ OPER_AKILL_CLEAR OPER_CHANKILL_SYNTAX CHANKILL [+tempo] {#canal} [motivo] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+tempo] {máscara | lista}[:motivo]] -OPER_SGLINE_UNSUPPORTED - Desculpe, SGLINE não está disponível nesta Rede. -OPER_SGLINE_EXISTS - %s já existe na lista de SGLINE. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+tempo] {máscara | lista}[:motivo]] +OPER_SNLINE_UNSUPPORTED + Desculpe, SNLINE não está disponível nesta Rede. +OPER_SNLINE_EXISTS + %s já existe na lista de SNLINE. +OPER_SNLINE_ALREADY_COVERED %s já está coberto por %s. -OPER_SGLINE_REACHED_LIMIT - Desculpe, você pode ter apenas %d SGLINEs. -OPER_SGLINE_ADDED - %s adicionado à lista de SGLINE. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Desculpe, você pode ter apenas %d SNLINEs. +OPER_SNLINE_ADDED + %s adicionado à lista de SNLINE. +OPER_SNLINE_CHANGED Tempo de expiração para %s aterado. -OPER_SGLINE_NOT_FOUND - %s não encontrado na lista de SGLINE. -OPER_SGLINE_NO_MATCH - Nenhum resultado equivalente na lista de SGLINE. -OPER_SGLINE_DELETED - %s removido da lista de SGLINE. -OPER_SGLINE_DELETED_ONE - Removida 1 entrada da lista de SGLINE. -OPER_SGLINE_DELETED_SEVERAL - Removidas %d entradas da lista de SGLINE. -OPER_SGLINE_LIST_EMPTY - A lista de SGLINE está vazia. -OPER_SGLINE_LIST_HEADER - Lista de SGLINE atual: +OPER_SNLINE_NOT_FOUND + %s não encontrado na lista de SNLINE. +OPER_SNLINE_NO_MATCH + Nenhum resultado equivalente na lista de SNLINE. +OPER_SNLINE_DELETED + %s removido da lista de SNLINE. +OPER_SNLINE_DELETED_ONE + Removida 1 entrada da lista de SNLINE. +OPER_SNLINE_DELETED_SEVERAL + Removidas %d entradas da lista de SNLINE. +OPER_SNLINE_LIST_EMPTY + A lista de SNLINE está vazia. +OPER_SNLINE_LIST_HEADER + Lista de SNLINE atual: Núm Máscara Motivo -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Lista de SGLINE atual: +OPER_SNLINE_VIEW_HEADER + Lista de SNLINE atual: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (por %s em %s; %s) %s -OPER_SGLINE_CLEAR - A lista de SGLINE foi apagada. +OPER_SNLINE_CLEAR + A lista de SNLINE foi apagada. # SZLINE responses OPER_SQLINE_SYNTAX @@ -5320,8 +5320,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Derruba todos os usuários de um mesmo host OPER_HELP_CMD_AKILL AKILL Manipula a lista de AKILL -OPER_HELP_CMD_SGLINE - SGLINE Manipula a lista de SGLINE +OPER_HELP_CMD_SNLINE + SNLINE Manipula a lista de SNLINE OPER_HELP_CMD_SQLINE SQLINE Manipula a lista de SQLINE OPER_HELP_CMD_SZLINE @@ -5518,50 +5518,50 @@ OPER_HELP_AKILL AKILL CLEAR apaga todas as entradas da lista de AKILL. -OPER_HELP_SGLINE - Sintaxe: SGLINE ADD [+tempo] máscara:motivo - SGLINE DEL {máscara | entrada | lista-entradas} - SGLINE LIST [máscara | lista-entradas] - SGLINE VIEW [máscara | lista-entradas] - SGLINE CLEAR +OPER_HELP_SNLINE + Sintaxe: SNLINE ADD [+tempo] máscara:motivo + SNLINE DEL {máscara | entrada | lista-entradas} + SNLINE LIST [máscara | lista-entradas] + SNLINE VIEW [máscara | lista-entradas] + SNLINE CLEAR Permite que Operadores dos Services manipulem a lista de - SGLINE. Se um usuário que tenta conectar possui um realname - previsto na lista de SGLINE, os Services não permitirão que + SNLINE. Se um usuário que tenta conectar possui um realname + previsto na lista de SNLINE, os Services não permitirão que ele continue sua sessão de IRC. - SGLINE ADD adiciona uma máscara realname na lista de SGLINE + SNLINE ADD adiciona uma máscara realname na lista de SNLINE para um dado motivo (deve ser fornecido). Opcionalmente, um tempo pode ser fornecido. O tempo precede a máscara e é especificado como um número inteiro seguido por uma das seguintes unidades: d (dias), h (horas) ou m (minutos). Combinações (como 1h30m) não são permitidas. Se uma unidade específica não é incluída, o padrão é em dias (assim, +30 - significa 30 dias). Para adicionar um SGLINE que não expira, + significa 30 dias). Para adicionar um SNLINE que não expira, use +0. Se a máscara de realname a ser adicionada começar com - um +, o tempo do SGLINE deve ser fornecido, mesmo se esse tempo - for igual ao padrão. O tempo atual de expiração de SGLINE pode ser + um +, o tempo do SNLINE deve ser fornecido, mesmo se esse tempo + for igual ao padrão. O tempo atual de expiração de SNLINE pode ser encontrado com o comando STATS AKILL. Nota: devido ao fato da máscara de realname poder conter espaços, o separador entre ela e o motivo é um sinal de dois-pontos. - SGLINE DEL remove uma dada máscara da lista de SGLINE, se ela + SNLINE DEL remove uma dada máscara da lista de SNLINE, se ela estiver presente. Se uma lista de números de entrada for fornecida, essas entradas serão apagadas. (Veja o exemplo para LIST abaixo.) - SGLINE LIST mostra a lista de SGLINE atual. + SNLINE LIST mostra a lista de SNLINE atual. Se uma máscara for fornecida, apenas as entradas que combinarem com a máscara serão exibidas. Se uma lista de números de entrada for fornecida, apenas essas entradas serão exibidas; por exemplo: - SGLINE LIST 2-5,7-9 - Lista as entradas de SGLINE numeradas de 2 a 5 e de 7 a 9. + SNLINE LIST 2-5,7-9 + Lista as entradas de SNLINE numeradas de 2 a 5 e de 7 a 9. - SGLINE VIEW é uma versão mais detalhada do SGLINE LIST, - e mostrará quem adicionou o SGLINE, a data em que foi adicionado, + SNLINE VIEW é uma versão mais detalhada do SNLINE LIST, + e mostrará quem adicionou o SNLINE, a data em que foi adicionado, e quando irá expirar, como também a máscara realname e o motivo. - SGLINE CLEAR apaga todas as entradas da lista de SGLINE. + SNLINE CLEAR apaga todas as entradas da lista de SNLINE. OPER_HELP_SQLINE Sintaxe: SQLINE ADD [+tempo] máscara motivo @@ -2495,22 +2495,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Âðåìÿ èñòå÷åíèÿ AKILL'à ïî-óìîë÷àíèþ : 1 ìèíóòà OPER_STATS_AKILL_EXPIRE_NONE Âðåìÿ èñòå÷åíèÿ AKILL'à ïî-óìîë÷àíèþ : íèêîãäà -OPER_STATS_SGLINE_COUNT - Òåêóùåå êîëè÷åñòâî SGLINE'îâ : %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ : %d äíåé -OPER_STATS_SGLINE_EXPIRE_DAY - Âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ : 1 äåíü -OPER_STATS_SGLINE_EXPIRE_HOURS - Âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ : %d ÷àñîâ -OPER_STATS_SGLINE_EXPIRE_HOUR - Âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ : 1 ÷àñ -OPER_STATS_SGLINE_EXPIRE_MINS - Âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ : %d ìèíóò -OPER_STATS_SGLINE_EXPIRE_MIN - Âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ : 1 ìèíóòà -OPER_STATS_SGLINE_EXPIRE_NONE - Âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ : íèêîãäà +OPER_STATS_SNLINE_COUNT + Òåêóùåå êîëè÷åñòâî SNLINE'îâ : %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ : %d äíåé +OPER_STATS_SNLINE_EXPIRE_DAY + Âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ : 1 äåíü +OPER_STATS_SNLINE_EXPIRE_HOURS + Âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ : %d ÷àñîâ +OPER_STATS_SNLINE_EXPIRE_HOUR + Âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ : 1 ÷àñ +OPER_STATS_SNLINE_EXPIRE_MINS + Âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ : %d ìèíóò +OPER_STATS_SNLINE_EXPIRE_MIN + Âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ : 1 ìèíóòà +OPER_STATS_SNLINE_EXPIRE_NONE + Âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ : íèêîãäà OPER_STATS_SQLINE_COUNT Òåêóùåå êîëè÷åñòâî SQLINE'îâ : %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2632,46 +2632,46 @@ OPER_AKILL_CLEAR Ñïèñîê AKILL'îâ ïîëíîñòüþ î÷èùåí. OPER_CHANKILL_SYNTAX CHANKILL [+ñðîê_èñòå÷åíèÿ] {#êàíàë} [ïðè÷èíà] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD|DEL|LIST|VIEW|CLEAR} [[+ñðîê_èñòå÷åíèÿ] {ìàñêà | íîìåð_çàïèñè}[:ïðè÷èíà]] -OPER_SGLINE_UNSUPPORTED - SGLINE-âîçìîæíîñòè ñåðâèñîâ â âàøåé ñåòè íåäîñòóïíû. -OPER_SGLINE_EXISTS - Çàïèñü âèäà %s óæå ñîäåðæèòñÿ â ñïèñêå SGLINE'îâ. -OPER_SGLINE_ALREADY_COVERED - Óêàçàííàÿ ìàñêà âèäà %s ñîâïàäàåò ñ îäíîé èç ìàñîê â ñïèñêå SGLINE'îâ: %s. -OPER_SGLINE_REACHED_LIMIT - Êîëè÷åñòâî çàïèñåé â SGLINE-ñïèñêå íå ìîæåò ïðåâûøàòü %d. -OPER_SGLINE_ADDED - Çàïèñü âèäà %s óñïåøíî äîáàâëåíà â ñïèñîê SGLINE'îâ. -OPER_SGLINE_CHANGED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD|DEL|LIST|VIEW|CLEAR} [[+ñðîê_èñòå÷åíèÿ] {ìàñêà | íîìåð_çàïèñè}[:ïðè÷èíà]] +OPER_SNLINE_UNSUPPORTED + SNLINE-âîçìîæíîñòè ñåðâèñîâ â âàøåé ñåòè íåäîñòóïíû. +OPER_SNLINE_EXISTS + Çàïèñü âèäà %s óæå ñîäåðæèòñÿ â ñïèñêå SNLINE'îâ. +OPER_SNLINE_ALREADY_COVERED + Óêàçàííàÿ ìàñêà âèäà %s ñîâïàäàåò ñ îäíîé èç ìàñîê â ñïèñêå SNLINE'îâ: %s. +OPER_SNLINE_REACHED_LIMIT + Êîëè÷åñòâî çàïèñåé â SNLINE-ñïèñêå íå ìîæåò ïðåâûøàòü %d. +OPER_SNLINE_ADDED + Çàïèñü âèäà %s óñïåøíî äîáàâëåíà â ñïèñîê SNLINE'îâ. +OPER_SNLINE_CHANGED Ñðîê èñòå÷åíèÿ çàïèñè %s óñïåøíî èçìåíåí. -OPER_SGLINE_NOT_FOUND - Çàïèñü âèäà %s â ñïèñêå SGLINE'îâ íå îáíàðóæåíà. -OPER_SGLINE_NO_MATCH +OPER_SNLINE_NOT_FOUND + Çàïèñü âèäà %s â ñïèñêå SNLINE'îâ íå îáíàðóæåíà. +OPER_SNLINE_NO_MATCH Ñîâïàäàþùèõ çàïèñåé íå îáíàðóæåíî. -OPER_SGLINE_DELETED - Çàïèñü âèäà %s óñïåøíî óäàëåíà èç ñïèñêà SGLINE'îâ. -OPER_SGLINE_DELETED_ONE - Óäàëåíà 1 çàïèñü èç ñïèêà SGLINE'îâ. -OPER_SGLINE_DELETED_SEVERAL - Óäàëåíî %d çàïèñåé èç ñïèñêà SGLINE'îâ. -OPER_SGLINE_LIST_EMPTY - Ñïèñîê SGLINE'îâ ïóñò. -OPER_SGLINE_LIST_HEADER - Òåêóùèé ñïèñîê SGLINE'îâ: +OPER_SNLINE_DELETED + Çàïèñü âèäà %s óñïåøíî óäàëåíà èç ñïèñêà SNLINE'îâ. +OPER_SNLINE_DELETED_ONE + Óäàëåíà 1 çàïèñü èç ñïèêà SNLINE'îâ. +OPER_SNLINE_DELETED_SEVERAL + Óäàëåíî %d çàïèñåé èç ñïèñêà SNLINE'îâ. +OPER_SNLINE_LIST_EMPTY + Ñïèñîê SNLINE'îâ ïóñò. +OPER_SNLINE_LIST_HEADER + Òåêóùèé ñïèñîê SNLINE'îâ: No. Ìàñêà Ïðè÷èíà -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Òåêóùèé ñïèñîê SGLINE'îâ: +OPER_SNLINE_VIEW_HEADER + Òåêóùèé ñïèñîê SNLINE'îâ: # íîìåð, ìàñêà, ñîçäàòåëü, êîãäà, èñòåêàåò, ïðè÷èíà -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (îò %s â %s; %s) %s -OPER_SGLINE_CLEAR - Ñïèñîê SGLINE'îâ ïîëíîñòüþ î÷èùåí. +OPER_SNLINE_CLEAR + Ñïèñîê SNLINE'îâ ïîëíîñòüþ î÷èùåí. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5439,8 +5439,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Îòêëþ÷èòü âñåõ ïîëüçîâàòåëåé ñ îïðåäåëåííîãî õîñòà OPER_HELP_CMD_AKILL AKILL Óïðàâëåíèå ñïèñêîì AKILL'îâ -OPER_HELP_CMD_SGLINE - SGLINE Óïðàâëåíèå ñïèñêîì SGLINE'îâ +OPER_HELP_CMD_SNLINE + SNLINE Óïðàâëåíèå ñïèñêîì SNLINE'îâ OPER_HELP_CMD_SQLINE SQLINE Óïðàâëåíèå ñïèñêîì SQLINE'îâ OPER_HELP_CMD_SZLINE @@ -5651,54 +5651,54 @@ OPER_HELP_AKILL AKILL CLEAR ïîçâîëÿåò ïîëíîñòüþ î÷èñòèòü ñïèñîê AKILL'îâ. -OPER_HELP_SGLINE - Ñèíòàêñèñ: SGLINE ADD [+ñðîê_èñòå÷åíèÿ] ìàñêà:ïðè÷èíà - SGLINE DEL {ìàñêà | íîìåð_çàïèñè | ñïèñîê_çàïèñåé} - SGLINE LIST [ìàñêà | ñïèñîê_çàïèñåé] - SGLINE VIEW [ìàñêà | ñïèñîê_çàïèñåé] - SGLINE CLEAR +OPER_HELP_SNLINE + Ñèíòàêñèñ: SNLINE ADD [+ñðîê_èñòå÷åíèÿ] ìàñêà:ïðè÷èíà + SNLINE DEL {ìàñêà | íîìåð_çàïèñè | ñïèñîê_çàïèñåé} + SNLINE LIST [ìàñêà | ñïèñîê_çàïèñåé] + SNLINE VIEW [ìàñêà | ñïèñîê_çàïèñåé] + SNLINE CLEAR - Ïîçâîëÿåò Îïåðàòîðàì ñåðâèñîâ óïðàâëÿòü ñïèñêîì ñåðâèñíûõ SGLINE'îâ. - SGLINE-çàïèñü ïîçâîëÿåò âàì ïîñòàâèòü ãëîáàëüíûé áàí íà îïðåäåëåííûé + Ïîçâîëÿåò Îïåðàòîðàì ñåðâèñîâ óïðàâëÿòü ñïèñêîì ñåðâèñíûõ SNLINE'îâ. + SNLINE-çàïèñü ïîçâîëÿåò âàì ïîñòàâèòü ãëîáàëüíûé áàí íà îïðåäåëåííûé RealName aka GECOS. Ëþáîé ïîëüçîâàòåëü, ðåàëüíîå èìÿ êîòîðîãî - ïîïàäåò ïîä ìàñêó êàêîé-ëèáî çàïèñè â SGLINE-ñïèñêå, áóäåò ñðàçó æå + ïîïàäåò ïîä ìàñêó êàêîé-ëèáî çàïèñè â SNLINE-ñïèñêå, áóäåò ñðàçó æå îòêëþ÷åí îò ñåòè è â äàëüíåéøåì, ñåðâèñû íå ïîçâîëÿò åìó ïîäêëþ÷èòñÿ. - Êîìàíäà SGLINE ADD äîáàâëÿåò ìàñêó ðåàëüíîãî èìåíè ñ óêàçàííîé - ïðè÷èíîé â ñïèñîê SGLINE'îâ (íàëè÷èå ïðè÷èíû - îáÿçàòåëüíî). + Êîìàíäà SNLINE ADD äîáàâëÿåò ìàñêó ðåàëüíîãî èìåíè ñ óêàçàííîé + ïðè÷èíîé â ñïèñîê SNLINE'îâ (íàëè÷èå ïðè÷èíû - îáÿçàòåëüíî). Çíà÷åíèå ñðîêà èñòå÷åíèÿ - ýòî öåëîå ÷èñëî, êîòîðîå ìîæåò áûòü îäíèì èç: d (äíåé), h (÷àñîâ), èëè m (ìèíóò). Òàêèå ñî÷åòàíèÿ êàê 1h30m - íåäîïóñòèìû. Åñëè åäèíèöà èçìåðåíèÿ íå óêàçàíà, òî ïî-óìîë÷àíèþ, îíà áóäåò ïðèíÿòà çà "d" - "äíè" (òàêèì îáðàçîì, - +30 áóäåò îçíà÷àòü 30 äíåé). ×òîáû äîáàâèòü ïîñòîÿííûé SGLINE, + +30 áóäåò îçíà÷àòü 30 äíåé). ×òîáû äîáàâèòü ïîñòîÿííûé SNLINE, èñïîëüçóéòå âðåìÿ èñòå÷åíèÿ ðàâíûì +0. Ïîìíèòå, ÷òî åñëè â êà÷åñòâå ïåðâîãî ñèìâîëà âòîðîãî ïàðàìåòðà óêàçàí çíàê "+" - âû äîëæíû îáîçíà÷èòü ñðîêè èñòå÷åíèÿ çàïèñè, äàæå åñëè ýòî áóäåò çíà÷åíèå ïî-óìî÷àíèþ. - Òåêóùåå âðåìÿ èñòå÷åíèÿ SGLINE'à ïî-óìîë÷àíèþ, ìîæíî óçíàòü ñ ïîìîùüþ + Òåêóùåå âðåìÿ èñòå÷åíèÿ SNLINE'à ïî-óìîë÷àíèþ, ìîæíî óçíàòü ñ ïîìîùüþ êîìàíäû STATS AKILL. Ïðèìå÷àíèå: òàê êàê ñòðîêè ðåàëüíûõ èìåí ìîãóò ñîäåðæàòü ïðîáåëû, ðàçäåëèòåëåì ìåæäó ìàñêîé ðåàëüíîãî èìåíè è ïðè÷èíîé áóäåò äâîåòî÷èå. - Êîìàíäà SGLINE DEL óäàëÿåò óêàçàííóþ ìàñêó èç ñïèñêà SGLINE'îâ. -  êà÷åñòâå ïàðàìåòðà âû ìîæåòå óêàçàòü íå òîëüêî ìàñêó SGLINE'à, íî + Êîìàíäà SNLINE DEL óäàëÿåò óêàçàííóþ ìàñêó èç ñïèñêà SNLINE'îâ. +  êà÷åñòâå ïàðàìåòðà âû ìîæåòå óêàçàòü íå òîëüêî ìàñêó SNLINE'à, íî è êîíêðåòíûé íîìåð çàïèñè èëè ñïèñîê çàïèñåé (ñì. ïðèìåðû èñïîëüçîâàíèÿ êîìàíäû LIST íèæå). - Êîìàíäà SGLINE LIST ïîêàçûâàåò òåêóùèé ñïèñîê SGLINE'îâ. + Êîìàíäà SNLINE LIST ïîêàçûâàåò òåêóùèé ñïèñîê SNLINE'îâ.  êà÷åñòâå äîïîëíèòåëüíîãî ïàðàìåòðà, âû ìîæåòå óêàçàòü ñèìâîëüíóþ ìàñêó, ÷òî ïîçâîëèò âàì ïîëó÷èòü ñïèñîê ñ êîíêðåòíûìè çàïèñÿìè, ïîïàäàþùèìè ïîä ýòó ìàñêó, èëè æå, âû ìîæåòå óêàçàòü ñïèñîê çàïèñåé. Íàïðèìåð: - SGLINE LIST 2-5,7-9 + SNLINE LIST 2-5,7-9 îòîáðàçèò âñå çàïèñè ñ 2-îé ïî 5-þ è ñ 7-îé ïî 9-þ. - SGLINE VIEW áîëåå ïîäðîáíàÿ âåðñèÿ SGLINE LIST, îíà ïîêàæåò êòî - äîáàâèë SGLINE, âðåìÿ óñòàíîâêè SGLINE'à, êîãäà îí èñòåêàåò, íó è, - êîíå÷íî æå, ìàñêó ðåàëüíîãî èìåíè è ïðè÷èíó SGLINE'à. + SNLINE VIEW áîëåå ïîäðîáíàÿ âåðñèÿ SNLINE LIST, îíà ïîêàæåò êòî + äîáàâèë SNLINE, âðåìÿ óñòàíîâêè SNLINE'à, êîãäà îí èñòåêàåò, íó è, + êîíå÷íî æå, ìàñêó ðåàëüíîãî èìåíè è ïðè÷èíó SNLINE'à. - SGLINE CLEAR ïîçâîëÿåò ïîëíîñòüþ î÷èñòèòü ñïèñîê SGLINE'îâ. + SNLINE CLEAR ïîçâîëÿåò ïîëíîñòüþ î÷èñòèòü ñïèñîê SNLINE'îâ. OPER_HELP_SQLINE Ñèíòàêñèñ: SQLINE ADD [+ñðîê_èñòå÷åíèÿ] ìàñêà ïðè÷èíà @@ -2571,22 +2571,22 @@ OPER_STATS_AKILL_EXPIRE_MIN Varsayýlan AKILL zaman aþýmý: 1 dakika OPER_STATS_AKILL_EXPIRE_NONE Varsayýlan AKILL zaman aþýmý: zaman aþýmý yok -OPER_STATS_SGLINE_COUNT - Þu anki SGLINE sayýsý: %d -OPER_STATS_SGLINE_EXPIRE_DAYS - Varsayýlan SGLINE zaman aþýmý süresi: %d gün -OPER_STATS_SGLINE_EXPIRE_DAY - Varsayýlan SGLINE zaman aþýmý süresi: 1 gün -OPER_STATS_SGLINE_EXPIRE_HOURS - Varsayýlan SGLINE zaman aþýmý süresi: %d saat -OPER_STATS_SGLINE_EXPIRE_HOUR - Varsayýlan SGLINE zaman aþýmý süresi: 1 saat -OPER_STATS_SGLINE_EXPIRE_MINS - Varsayýlan SGLINE zaman aþýmý süresi: %d dakika -OPER_STATS_SGLINE_EXPIRE_MIN - Varsayýlan SGLINE zaman aþýmý süresi: 1 dakika -OPER_STATS_SGLINE_EXPIRE_NONE - Varsayýlan SGLINE zaman aþýmý süresi: Zaman aþýmý yok +OPER_STATS_SNLINE_COUNT + Þu anki SNLINE sayýsý: %d +OPER_STATS_SNLINE_EXPIRE_DAYS + Varsayýlan SNLINE zaman aþýmý süresi: %d gün +OPER_STATS_SNLINE_EXPIRE_DAY + Varsayýlan SNLINE zaman aþýmý süresi: 1 gün +OPER_STATS_SNLINE_EXPIRE_HOURS + Varsayýlan SNLINE zaman aþýmý süresi: %d saat +OPER_STATS_SNLINE_EXPIRE_HOUR + Varsayýlan SNLINE zaman aþýmý süresi: 1 saat +OPER_STATS_SNLINE_EXPIRE_MINS + Varsayýlan SNLINE zaman aþýmý süresi: %d dakika +OPER_STATS_SNLINE_EXPIRE_MIN + Varsayýlan SNLINE zaman aþýmý süresi: 1 dakika +OPER_STATS_SNLINE_EXPIRE_NONE + Varsayýlan SNLINE zaman aþýmý süresi: Zaman aþýmý yok OPER_STATS_SQLINE_COUNT Su anki SQLINE sayisi: %d OPER_STATS_SQLINE_EXPIRE_DAYS @@ -2714,49 +2714,49 @@ OPER_AKILL_VIEW_FORMAT OPER_AKILL_CLEAR AKILL listesi temizlendi. -# SGLINE responses +# SNLINE responses OPER_CHANKILL_SYNTAX CHANKILL [+expiry] {#channel} [reason] -# SGLINE responses -OPER_SGLINE_SYNTAX - SGLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+zamanaþýmý] {mask | kayýt-sýrasý} [sebep]] -OPER_SGLINE_UNSUPPORTED - SGLINE bu networkte mevcut deðil. -OPER_SGLINE_EXISTS - %s zaten SGLINE listesinde. -OPER_SGLINE_ALREADY_COVERED +# SNLINE responses +OPER_SNLINE_SYNTAX + SNLINE {ADD | DEL | LIST | VIEW | CLEAR} [[+zamanaþýmý] {mask | kayýt-sýrasý} [sebep]] +OPER_SNLINE_UNSUPPORTED + SNLINE bu networkte mevcut deðil. +OPER_SNLINE_EXISTS + %s zaten SNLINE listesinde. +OPER_SNLINE_ALREADY_COVERED %s zaten %s tarafýndan deðiþtirildi. -OPER_SGLINE_REACHED_LIMIT - Sadece %d kiþi SGLINE listesinde olabilir. -OPER_SGLINE_ADDED - %s SGLINE listesinde eklendi. -OPER_SGLINE_CHANGED +OPER_SNLINE_REACHED_LIMIT + Sadece %d kiþi SNLINE listesinde olabilir. +OPER_SNLINE_ADDED + %s SNLINE listesinde eklendi. +OPER_SNLINE_CHANGED %s nickinin zaman aþýmý süresi deðiþtirildi. -OPER_SGLINE_NOT_FOUND - %s SGLINE listesinde bulunamadý. -OPER_SGLINE_NO_MATCH - SGLINE listesinde uyuþan kayýt bulunamadý. -OPER_SGLINE_DELETED - %s SGLINE listesinden silindi. -OPER_SGLINE_DELETED_ONE - SGLINE listesinden 1 kayýt silindi. -OPER_SGLINE_DELETED_SEVERAL - SGLINE listesinden %d kayýt silindi. -OPER_SGLINE_LIST_EMPTY - SGLINE listesi boþ. -OPER_SGLINE_LIST_HEADER - Þu anki SGLINE listesi: +OPER_SNLINE_NOT_FOUND + %s SNLINE listesinde bulunamadý. +OPER_SNLINE_NO_MATCH + SNLINE listesinde uyuþan kayýt bulunamadý. +OPER_SNLINE_DELETED + %s SNLINE listesinden silindi. +OPER_SNLINE_DELETED_ONE + SNLINE listesinden 1 kayýt silindi. +OPER_SNLINE_DELETED_SEVERAL + SNLINE listesinden %d kayýt silindi. +OPER_SNLINE_LIST_EMPTY + SNLINE listesi boþ. +OPER_SNLINE_LIST_HEADER + Þu anki SNLINE listesi: No Mask Sebep -OPER_SGLINE_LIST_FORMAT +OPER_SNLINE_LIST_FORMAT %3d %-32s %s -OPER_SGLINE_VIEW_HEADER - Þu anki SGLINE listesi: +OPER_SNLINE_VIEW_HEADER + Þu anki SNLINE listesi: # number, mask, set-by, set-time, expires, reason -OPER_SGLINE_VIEW_FORMAT +OPER_SNLINE_VIEW_FORMAT %3d %s (by %s on %s; %s) %s -OPER_SGLINE_CLEAR - SGLINE listesi temizlendi. +OPER_SNLINE_CLEAR + SNLINE listesi temizlendi. # SQLINE responses OPER_SQLINE_SYNTAX @@ -5414,8 +5414,8 @@ OPER_HELP_CMD_KILLCLONES KILLCLONES Ayni ip'deki tum kullanicilari kill'ler. OPER_HELP_CMD_AKILL AKILL AKILL listesini düzenler -OPER_HELP_CMD_SGLINE - SGLINE SGLINE listesini düzenler +OPER_HELP_CMD_SNLINE + SNLINE SNLINE listesini düzenler OPER_HELP_CMD_SQLINE SQLINE SQLINE listesini düzenler OPER_HELP_CMD_SZLINE @@ -5617,50 +5617,50 @@ OPER_HELP_AKILL Servis operatörlerinin Kullanýmýyla sýnýrlýdýr. -OPER_HELP_SGLINE - Kullanýmý: SGLINE ADD [+zamanaþýmý] mask:sebep - SGLINE DEL {mask | kayýt-no | liste} - SGLINE LIST [mask | liste] - SGLINE VIEW [mask | liste] - SGLINE CLEAR +OPER_HELP_SNLINE + Kullanýmý: SNLINE ADD [+zamanaþýmý] mask:sebep + SNLINE DEL {mask | kayýt-no | liste} + SNLINE LIST [mask | liste] + SNLINE VIEW [mask | liste] + SNLINE CLEAR - Servis operatörlerinin SGLINE listesi oluþturmalarýný saðlar. - Eðer SGLINE listesindeki bir kullanýcý gerçek ismi(realname) + Servis operatörlerinin SNLINE listesi oluþturmalarýný saðlar. + Eðer SNLINE listesindeki bir kullanýcý gerçek ismi(realname) servera baðlanmaya çalýþan bir kullanýcýnýnkiyle uyuþuyorsa o kullanýcýnýn servera baðlanmasý engellenir. - SGLINE ADD komutu belirtilen realname(gerçek isim) mask ýný - SGLINE listesine bir sebeple(belirtilmesi zorunludur) + SNLINE ADD komutu belirtilen realname(gerçek isim) mask ýný + SNLINE listesine bir sebeple(belirtilmesi zorunludur) birlikte ekler. zamanaþýmý zaman belirleyici olarak tanýmlanýr ve þunlar birini takip etmelidir: d (gün), h (saat), veya m (dakika). 1h30m þeklindeki kombinasyonlar kullanýlamaz. Eðer zaman tanýmlayýcý öðe konulmazsa varsayýlan olarak gün kabul edilir (yani +30 un manasý - 30 gündür). Zaman aþýmýna uðramayacak bir SGLINE eklemek için +0 + 30 gündür). Zaman aþýmýna uðramayacak bir SNLINE eklemek için +0 kullanýn. Eklenecek realname mask ý + ile baþlýyorsa, o zaman zaman aþýmý süresi varsayýlanla ayný olsa bile belirtilmelidir. - Mevcut SGLINE varsayýlan zaman aþýmý süresi STATS AKILL komutuyla + Mevcut SNLINE varsayýlan zaman aþýmý süresi STATS AKILL komutuyla bulunabilir. Not: realname maský boþluk içerebileceðinden bunla sebep arasýnda iki nokta üstüste(:) kullanýlmalýdýr. - SGLINE DEL komutu belirtilen maský(eðer listede mevcutsa) SGLINE + SNLINE DEL komutu belirtilen maský(eðer listede mevcutsa) SNLINE listesinden siler. eðer bir kayýt numaralarý listesi belirtilmiþse o kayýtlar silinir. (Aþaðýdaki LIST için verilmiþ örneði inceleyin.) - SGLINE LIST komutu SGLINE listesini görüntüler. Eðer bir yýldýzlý + SNLINE LIST komutu SNLINE listesini görüntüler. Eðer bir yýldýzlý mask verilmiþse, sadece o maskla uyuþan kayýtlarý içeren bir liste görüntülenir. Eðer bir kayýt numaralarý listesi belirtilmiþse, sadece o kayýtlar görüntülenir; örneðin: - SGLINE LIST 2-5,7-9 - 2 den 5 e 7 den 9 a kadar olan SGLINE kayýtlarýný listeler. + SNLINE LIST 2-5,7-9 + 2 den 5 e 7 den 9 a kadar olan SNLINE kayýtlarýný listeler. - SGLINE VIEW komutu SGLINE LIST komutunun daha açýklayýcý bilgi - veren þeklidir, ve SGLINE ý kimin eklediðini, eklendiði tarihi, ve + SNLINE VIEW komutu SNLINE LIST komutunun daha açýklayýcý bilgi + veren þeklidir, ve SNLINE ý kimin eklediðini, eklendiði tarihi, ve ne zaman sona ereceðini realname ve sebeple birlikte gösterir. - SGLINE CLEAR komutu SGLINE listesindeki tüm kayýtlarý siler. + SNLINE CLEAR komutu SNLINE listesindeki tüm kayýtlarý siler. Servis operatörlerinin Kullanýmýyla sýnýrlýdýr. diff --git a/src/Makefile b/src/Makefile index 04d33b040..e7c8ba2fb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,14 +1,14 @@ OBJS = actions.o base64.o bots.o botserv.o channels.o chanserv.o command.o commands.o compat.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 \ + nickcore.o nickserv.o operserv.o process.o protocol.o regchannel.o send.o servers.o sessions.o \ sockets.o threadengine.o threadengine_pthread.o timers.o opertype.o users.o wildcard.o INCLUDES = ../include/commands.h ../include/language.h \ ../include/sysconf.h ../include/config.h \ ../include/services.h ../include/regchannel.h \ ../include/timers.h ../include/extern.h \ - ../include/modules.h ../include/slist.h ../include/hashcomp.h \ + ../include/modules.h ../include/operserv.h ../include/hashcomp.h \ ../include/threadengine.h ../include/mail.h MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ diff --git a/src/actions.c b/src/actions.c index e3f199e80..00ed01100 100644 --- a/src/actions.c +++ b/src/actions.c @@ -70,46 +70,6 @@ void kill_user(const std::string &source, const std::string &user, const std::st /*************************************************************************/ /** - * Check and enforce SQlines - * @param mask of the sqline - * @param reason for the sqline - * @return void - */ -void sqline(const std::string &mask, const std::string &reason) -{ - if (ircd->chansqline) - { - if (mask[0] == '#') - { - ircdproto->SendSQLine(mask, reason); - - for (channel_map::const_iterator cit = ChannelList.begin(); cit != ChannelList.end(); ++cit) - { - Channel *c = cit->second; - - if (!Anope::Match(c->name, mask, false)) - continue; - for (CUserList::iterator it = c->users.begin(); it != c->users.end();) - { - UserContainer *uc = *it; - ++it; - - if (is_oper(uc->user)) - continue; - c->Kick(NULL, uc->user, "%s", reason.c_str()); - } - } - } - else - ircdproto->SendSQLine(mask, reason); - } - else - ircdproto->SendSQLine(mask, reason); -} - -/*************************************************************************/ - -/** * Unban the nick from a channel * @param ci channel info for the channel * @param nick to remove the ban for diff --git a/src/bots.cpp b/src/bots.cpp index 034472774..3c23da7d4 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -68,7 +68,8 @@ BotInfo::BotInfo(const std::string &nnick, const std::string &nuser, const std:: 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"); + XLine x(this->nick.c_str(), "Reserved for services"); + ircdproto->SendSQLine(&x); } } diff --git a/src/config.c b/src/config.c index 1dd312723..a1264abce 100644 --- a/src/config.c +++ b/src/config.c @@ -738,11 +738,11 @@ int ServerConfig::Read(bool bail) {"operserv", "logmaxusers", "no", new ValueContainerBool(&Config.LogMaxUsers), DT_BOOLEAN, NoValidation}, {"operserv", "autokillexpiry", "0", new ValueContainerTime(&Config.AutokillExpiry), DT_TIME, ValidateNotZero}, {"operserv", "chankillexpiry", "0", new ValueContainerTime(&Config.ChankillExpiry), DT_TIME, ValidateNotZero}, - {"operserv", "sglineexpiry", "0", new ValueContainerTime(&Config.SGLineExpiry), DT_TIME, ValidateNotZero}, + {"operserv", "snlineexpiry", "0", new ValueContainerTime(&Config.SNLineExpiry), DT_TIME, ValidateNotZero}, {"operserv", "sqlineexpiry", "0", new ValueContainerTime(&Config.SQLineExpiry), DT_TIME, ValidateNotZero}, {"operserv", "szlineexpiry", "0", new ValueContainerTime(&Config.SZLineExpiry), DT_TIME, ValidateNotZero}, {"operserv", "akillonadd", "no", new ValueContainerBool(&Config.AkillOnAdd), DT_BOOLEAN, NoValidation}, - {"operserv", "killonsgline", "no", new ValueContainerBool(&Config.KillonSGline), DT_BOOLEAN, NoValidation}, + {"operserv", "killonsnline", "no", new ValueContainerBool(&Config.KillonSNline), DT_BOOLEAN, NoValidation}, {"operserv", "killonsqline", "no", new ValueContainerBool(&Config.KillonSQline), DT_BOOLEAN, NoValidation}, {"operserv", "notifications", "", new ValueContainerString(&OSNotifications), DT_STRING, NoValidation}, {"operserv", "limitsessions", "no", new ValueContainerBool(&Config.LimitSessions), DT_BOOLEAN, NoValidation}, @@ -1633,8 +1633,8 @@ int read_config(int reload) } } - Config.WallOper = Config.WallBadOS = Config.WallOSGlobal = Config.WallOSMode = Config.WallOSClearmodes = Config.WallOSKick = Config.WallOSAkill = Config.WallOSSGLine = Config.WallOSSQLine = - Config.WallOSSZLine = Config.WallOSNoOp = Config.WallOSJupe = Config.WallAkillExpire = Config.WallSGLineExpire = Config.WallSQLineExpire = Config.WallSZLineExpire = Config.WallExceptionExpire = Config.WallGetpass = Config.WallSetpass = Config.WallForbid = + Config.WallOper = Config.WallBadOS = Config.WallOSGlobal = Config.WallOSMode = Config.WallOSClearmodes = Config.WallOSKick = Config.WallOSAkill = Config.WallOSSNLine = Config.WallOSSQLine = + Config.WallOSSZLine = Config.WallOSNoOp = Config.WallOSJupe = Config.WallAkillExpire = Config.WallSNLineExpire = Config.WallSQLineExpire = Config.WallSZLineExpire = Config.WallExceptionExpire = Config.WallGetpass = Config.WallSetpass = Config.WallForbid = Config.WallDrop = false; if (!OSNotifications.empty()) { spacesepstream notifications(OSNotifications); @@ -1647,13 +1647,13 @@ int read_config(int reload) else if (notice == "osclearmodes") Config.WallOSClearmodes = true; else if (notice == "oskick") Config.WallOSKick = true; else if (notice == "osakill") Config.WallOSAkill = true; - else if (notice == "ossgline") Config.WallOSSGLine = true; + else if (notice == "ossnline") Config.WallOSSNLine = true; else if (notice == "ossqline") Config.WallOSSQLine = true; else if (notice == "osszline") Config.WallOSSZLine = true; else if (notice == "osnoop") Config.WallOSNoOp = true; else if (notice == "osjupe") Config.WallOSJupe = true; else if (notice == "akillexpire") Config.WallAkillExpire = true; - else if (notice == "sglineexpire") Config.WallSGLineExpire = true; + else if (notice == "snlineexpire") Config.WallSNLineExpire = true; else if (notice == "sqlineexpire") Config.WallSQLineExpire = true; else if (notice == "szlineexpire") Config.WallSZLineExpire = true; else if (notice == "exceptionexpire") Config.WallExceptionExpire = true; diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c index d8cb3db6d..2c5888554 100644 --- a/src/core/bs_bot.c +++ b/src/core/bs_bot.c @@ -242,7 +242,8 @@ class CommandBSBot : public Command the old nick. */ if (ircd->sqline) { - ircdproto->SendSQLineDel(bi->nick); + XLine x(bi->nick.c_str()); + ircdproto->SendSQLineDel(&x); } /* We check whether user with this nick is online, and kill it if so */ @@ -251,9 +252,11 @@ class CommandBSBot : public Command if (user) ircdproto->SendQuit(bi, "Quit: Be right back"); - else { + else + { ircdproto->SendChangeBotNick(bi, nick); - ircdproto->SendSQLine(bi->nick, "Reserved for services"); + XLine x(bi->nick.c_str(), "Reserved for services"); + ircdproto->SendSQLine(&x); } if (bi->nick != nick) @@ -273,7 +276,8 @@ class CommandBSBot : public Command bi->uid = ts6_uid_retrieve(); } ircdproto->SendClientIntroduction(bi->nick, bi->user, bi->host, bi->real, ircd->pseudoclient_mode, bi->uid); - ircdproto->SendSQLine(bi->nick, "Reserved for services"); + XLine x(bi->nick.c_str(), "Reserved for services"); + ircdproto->SendSQLine(&x); bi->RejoinAll(); } @@ -309,7 +313,8 @@ class CommandBSBot : public Command FOREACH_MOD(I_OnBotDelete, OnBotDelete(bi)); ircdproto->SendQuit(bi, "Quit: Help! I'm being deleted by %s!", u->nick.c_str()); - ircdproto->SendSQLineDel(bi->nick); + XLine x(bi->nick.c_str()); + ircdproto->SendSQLineDel(&x); delete bi; notice_lang(Config.s_BotServ, u, BOT_BOT_DELETED, nick); diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c index baae58026..afeb522a9 100644 --- a/src/core/cs_drop.c +++ b/src/core/cs_drop.c @@ -66,7 +66,8 @@ class CommandCSDrop : public Command if (ircd->chansqline && (ci->HasFlag(CI_FORBIDDEN))) { - ircdproto->SendSQLineDel(ci->name.c_str()); + XLine x(ci->name.c_str()); + ircdproto->SendSQLineDel(&x); } Alog() << Config.s_ChanServ << ": Channel " << ci->name << " dropped by " << u->GetMask() << " (founder: " diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index 06447c800..141865bf7 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -87,7 +87,8 @@ class CommandCSForbid : public Command if (ircd->chansqline) { - ircdproto->SendSQLine(ci->name, reason ? reason : "Forbidden"); + XLine x(chan, "Forbidden"); + ircdproto->SendSQLine(&x); } Alog() << Config.s_ChanServ << ": " << u->nick << " set FORBID for channel " << ci->name; diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp index 710d4eb50..98212539e 100644 --- a/src/core/db_plain.cpp +++ b/src/core/db_plain.cpp @@ -458,31 +458,42 @@ static void LoadOperInfo(const std::vector<std::string> ¶ms) maxusercnt = atol(params[1].c_str()); maxusertime = strtol(params[2].c_str(), NULL, 10); } - else if (params[0] == "SGLINE" || params[0] == "SQLINE" || params[0] == "SZLINE") + else if (params[0] == "SNLINE" || params[0] == "SQLINE" || params[0] == "SZLINE") { - SXLine *sx = new SXLine; - sx->mask = sstrdup(params[1].c_str()); - sx->by = sstrdup(params[2].c_str()); - sx->seton = atol(params[3].c_str()); - sx->expires = atol(params[4].c_str()); - sx->reason = sstrdup(params[5].c_str()); - if (params[0] == "SGLINE") - slist_add(&sglines, sx); - else if (params[0] == "SQLINE") - slist_add(&sqlines, sx); - else if (params[0] == "SZLINE") - slist_add(&szlines, sx); + ci::string mask = params[1].c_str(); + ci::string by = params[2].c_str(); + time_t seton = atol(params[3].c_str()); + time_t expires = atol(params[4].c_str()); + std::string reason = params[5]; + + XLine *x = NULL; + if (params[0] == "SNLINE" && SNLine) + x = SNLine->Add(NULL, NULL, mask, expires, reason); + else if (params[0] == "SQLINE" && SQLine) + x = SQLine->Add(NULL, NULL, mask, expires, reason); + else if (params[0] == "SZLINE" && SZLine) + x = SZLine->Add(NULL, NULL, mask, expires, reason); + if (x) + { + x->By = by; + x->Created = seton; + } } - else if (params[0] == "AKILL") + else if (params[0] == "AKILL" && SGLine) { - Akill *ak = new Akill; - ak->user = sstrdup(params[1].c_str()); - ak->host = sstrdup(params[2].c_str()); - ak->by = sstrdup(params[3].c_str()); - ak->seton = atol(params[4].c_str()); - ak->expires = atol(params[5].c_str()); - ak->reason = sstrdup(params[6].c_str()); - slist_add(&akills, ak); + ci::string user = params[1].c_str(); + ci::string host = params[2].c_str(); + ci::string by = params[3].c_str(); + time_t seton = atol(params[4].c_str()); + time_t expires = atol(params[5].c_str()); + std::string reason = params[6]; + + XLine *x = SGLine->Add(NULL, NULL, user + "@" + host, expires, reason); + if (x) + { + x->By = by; + x->Created = seton; + } } else if (params[0] == "EXCEPTION") { @@ -1133,7 +1144,7 @@ class DBPlain : public Module } db << "MD BI TTB BOLDS " << ci->ttb[0] << " COLORS " << ci->ttb[1] << " REVERSES " << ci->ttb[2] << " UNDERLINES " << ci->ttb[3] << " BADWORDS " << ci->ttb[4] << " CAPS " << ci->ttb[5] << " FLOOD " << ci->ttb[6] << " REPEAT " << ci->ttb[7] << endl; if (ci->capsmin) - db << "MD BI CAPSMINS " << ci->capsmin << endl; + db << "MD BI CAPSMIN " << ci->capsmin << endl; if (ci->capspercent) db << "MD BI CAPSPERCENT " << ci->capspercent << endl; if (ci->floodlines) @@ -1153,28 +1164,42 @@ class DBPlain : public Module FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, ci)); } - for (int i = 0; i < akills.count; ++i) + db << "OS STATS " << maxusercnt << " " << maxusertime << endl; + + if (SGLine) { - Akill *ak = static_cast<Akill *>(akills.list[i]); - db << "OS AKILL " << ak->user << " " << ak->host << " " << ak->by << " " << ak->seton << " " << ak->expires << " :" << ak->reason << endl; + for (unsigned i = 0; i < SGLine->GetCount(); ++i) + { + XLine *x = SGLine->GetEntry(i); + db << "OS AKILL " << x->GetUser() << " " << x->GetHost() << " " << x->By << " " << x->Created << " " << x->Expires << " :" << x->Reason << endl; + } } - db << "OS STATS " << maxusercnt << " " << maxusertime << endl; - SXLine *sx; - for (int i = 0; i < sglines.count; ++i) + if (SNLine) { - sx = static_cast<SXLine *>(sglines.list[i]); - db << "OS SGLINE " << sx->mask << " " << sx->by << " " << sx->seton << " " << sx->expires << " :" << sx->reason << endl; + for (unsigned i = 0; i < SNLine->GetCount(); ++i) + { + XLine *x = SNLine->GetEntry(i); + db << "OS SNLINE " << x->Mask << " " << x->By << " " << x->Created << " " << x->Expires << " :" << x->Reason << endl; + } } - for (int i = 0; i < sqlines.count; ++i) + + if (SQLine) { - sx = static_cast<SXLine *>(sqlines.list[i]); - db << "OS SQLINE " << sx->mask << " " << sx->by << " " << sx->seton << " " << sx->expires << " :" << sx->reason << endl; + for (unsigned i = 0; i < SQLine->GetCount(); ++i) + { + XLine *x = SQLine->GetEntry(i); + db << "OS SQLINE " << x->Mask << " " << x->By << " " << x->Created << " " << x->Expires << " :" << x->Reason << endl; + } } - for (int i = 0; i < szlines.count; ++i) + + if (SZLine) { - sx = static_cast<SXLine *>(szlines.list[i]); - db << "OS SZLINE " << sx->mask << " " << sx->by << " " << sx->seton << " " << sx->expires << " :" << sx->reason << endl; + for (unsigned i = 0; i < SZLine->GetCount(); ++i) + { + XLine *x = SZLine->GetEntry(i); + db << "OS SZLINE " << x->Mask << " " << x->By << " " << x->Created << " " << x->Expires << " :" << x->Reason << endl; + } } for (int i = 0; i < nexceptions; i++) diff --git a/src/core/hs_delall.c b/src/core/hs_delall.c index 05c67660d..aaab9b6e1 100644 --- a/src/core/hs_delall.c +++ b/src/core/hs_delall.c @@ -23,10 +23,8 @@ class CommandHSDelAll : public Command CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { - int i; const char *nick = params[0].c_str(); NickAlias *na; - NickCore *nc; if ((na = findnick(nick))) { if (na->HasFlag(NS_FORBIDDEN)) @@ -35,10 +33,10 @@ class CommandHSDelAll : public Command return MOD_CONT; } FOREACH_MOD(I_OnDeleteVhost, OnDeleteVhost(na)); - nc = na->nc; - for (i = 0; i < nc->aliases.count; ++i) + NickCore *nc = na->nc; + for (std::list<NickAlias *>::iterator it = nc->aliases.begin(); it != nc->aliases.end(); ++it) { - na = static_cast<NickAlias *>(nc->aliases.list[i]); + na = *it; na->hostinfo.RemoveVhost(); } Alog() << "vHosts for all nicks in group \002" << nc->display << "\002 deleted by oper \002" << u->nick << "\002"; diff --git a/src/core/ns_drop.c b/src/core/ns_drop.c index 72f99cf7a..16c73f04a 100644 --- a/src/core/ns_drop.c +++ b/src/core/ns_drop.c @@ -69,7 +69,10 @@ class CommandNSDrop : public Command notice_lang(Config.s_NickServ, u, READ_ONLY_MODE); if (ircd->sqline && (na->HasFlag(NS_FORBIDDEN))) - ircdproto->SendSQLineDel(na->nick); + { + XLine x(na->nick); + ircdproto->SendSQLineDel(&x); + } Alog() << Config.s_NickServ << ": " << u->GetMask() << " dropped nickname " << na->nick << " (group " << na->nc->display << ") (e-mail: " << (na->nc->email ? na->nc->email : "none") << ")"; delete na; diff --git a/src/core/ns_forbid.c b/src/core/ns_forbid.c index e4c179243..70943ceeb 100644 --- a/src/core/ns_forbid.c +++ b/src/core/ns_forbid.c @@ -69,7 +69,10 @@ class CommandNSForbid : public Command if (ircd->sqline) - ircdproto->SendSQLine(na->nick, reason ? reason : "Forbidden"); + { + XLine x(na->nick, reason ? reason : "Forbidden"); + ircdproto->SendSQLine(&x); + } if (Config.WallForbid) ircdproto->SendGlobops(NickServ, "\2%s\2 used FORBID on \2%s\2", u->nick.c_str(), nick); diff --git a/src/core/ns_group.c b/src/core/ns_group.c index 10478f8a1..dd6f9b3be 100644 --- a/src/core/ns_group.c +++ b/src/core/ns_group.c @@ -80,7 +80,7 @@ class CommandNSGroup : public Command notice_lang(Config.s_NickServ, u, NICK_GROUP_SAME, target->nick); else if (na && na->nc != u->Account()) notice_lang(Config.s_NickServ, u, NICK_IDENTIFY_REQUIRED, Config.s_NickServ); - else if (Config.NSMaxAliases && (target->nc->aliases.count >= Config.NSMaxAliases) && !target->nc->IsServicesOper()) + else if (Config.NSMaxAliases && (target->nc->aliases.size() >= Config.NSMaxAliases) && !target->nc->IsServicesOper()) notice_lang(Config.s_NickServ, u, NICK_GROUP_TOO_MANY, target->nick, Config.s_NickServ, Config.s_NickServ); else if (enc_check_password(pass, target->nc->pass) != 1) { @@ -163,7 +163,7 @@ class CommandNSUngroup : public Command const char *nick = params.size() ? params[0].c_str() : NULL; NickAlias *na = nick ? findnick(nick) : findnick(u->nick); - if (u->Account()->aliases.count == 1) + if (u->Account()->aliases.size() == 1) notice_lang(Config.s_NickServ, u, NICK_UNGROUP_ONE_NICK); else if (!na) notice_lang(Config.s_NickServ, u, NICK_X_NOT_REGISTERED, nick ? nick : u->nick.c_str()); @@ -173,14 +173,19 @@ class CommandNSUngroup : public Command { NickCore *oldcore = na->nc; - slist_remove(&oldcore->aliases, na); + std::list<NickAlias *>::iterator it = std::find(oldcore->aliases.begin(), oldcore->aliases.end(), na); + if (it != oldcore->aliases.end()) + { + oldcore->aliases.erase(it); + } + if (!stricmp(oldcore->display, na->nick)) { change_core_display(oldcore); } na->nc = new NickCore(na->nick); - slist_add(&na->nc->aliases, na); + na->nc->aliases.push_back(na); na->nc->pass = oldcore->pass; if (oldcore->email) @@ -224,7 +229,6 @@ class CommandNSGList : public Command const char *nick = params.size() ? params[0].c_str() : NULL; NickCore *nc = u->Account(); - int i; if (nick && (stricmp(nick, u->nick.c_str()) && !u->Account()->IsServicesOper())) notice_lang(Config.s_NickServ, u, ACCESS_DENIED, Config.s_NickServ); @@ -238,9 +242,9 @@ class CommandNSGList : public Command int wont_expire; notice_lang(Config.s_NickServ, u, nick ? NICK_GLIST_HEADER_X : NICK_GLIST_HEADER, nc->display); - for (i = 0; i < nc->aliases.count; ++i) + for (std::list<NickAlias *>::iterator it = nc->aliases.begin(); it != nc->aliases.end(); ++it) { - NickAlias *na2 = static_cast<NickAlias *>(nc->aliases.list[i]); + NickAlias *na2 = *it; if (!(wont_expire = na2->HasFlag(NS_NO_EXPIRE))) { @@ -250,7 +254,7 @@ class CommandNSGList : public Command } 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); + notice_lang(Config.s_NickServ, u, NICK_GLIST_FOOTER, nc->aliases.size()); } return MOD_CONT; } diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c index 3bedbd301..7117ffab7 100644 --- a/src/core/ns_saset.c +++ b/src/core/ns_saset.c @@ -20,8 +20,6 @@ private: CommandReturn DoSetDisplay(User *u, const std::vector<ci::string> ¶ms, NickCore *nc) { ci::string param = params.size() > 2 ? params[2] : ""; - int i; - NickAlias *na; if (param.empty()) { @@ -30,17 +28,9 @@ private: } /* First check whether param is a valid nick of the group */ - for (i = 0; i < nc->aliases.count; ++i) - { - na = static_cast<NickAlias *>(nc->aliases.list[i]); - if (na->nick == param) - { - param = na->nick; /* Because case may differ */ - break; - } - } + NickAlias *na = findnick(param); - if (i == nc->aliases.count) + if (!na || na->nc != nc) { notice_lang(Config.s_NickServ, u, NICK_SASET_DISPLAY_INVALID, nc->display); return MOD_CONT; diff --git a/src/core/ns_set.c b/src/core/ns_set.c index 79561af76..1325f6b32 100644 --- a/src/core/ns_set.c +++ b/src/core/ns_set.c @@ -27,21 +27,9 @@ class CommandNSSet : public Command return MOD_CONT; } - int i; - NickAlias *na; - - /* First check whether param is a valid nick of the group */ - for (i = 0; i < nc->aliases.count; ++i) - { - na = static_cast<NickAlias *>(nc->aliases.list[i]); - if (na->nick == param) - { - param = na->nick; /* Because case may differ */ - break; - } - } - - if (i == nc->aliases.count) + NickAlias *na = findnick(param); + + if (!na || na->nc != nc) { notice_lang(Config.s_NickServ, u, NICK_SET_DISPLAY_INVALID); return MOD_CONT; diff --git a/src/core/ns_suspend.c b/src/core/ns_suspend.c index 1f0b885a4..94408adac 100644 --- a/src/core/ns_suspend.c +++ b/src/core/ns_suspend.c @@ -23,11 +23,10 @@ class CommandNSSuspend : public Command CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) { - NickAlias *na, *na2; + NickAlias *na; User *u2; const char *nick = params[0].c_str(); const char *reason = params[1].c_str(); - int i; if (readonly) { @@ -61,9 +60,10 @@ class CommandNSSuspend : public Command na->nc->UnsetFlag(NI_KILL_QUICK); na->nc->UnsetFlag(NI_KILL_IMMED); - for (i = 0; i < na->nc->aliases.count; ++i) + for (std::list<NickAlias *>::iterator it = na->nc->aliases.begin(); it != na->nc->aliases.end(); ++it) { - na2 = static_cast<NickAlias *>(na->nc->aliases.list[i]); + NickAlias *na2 = *it; + if (na2->nc == na->nc) { if (na2->last_quit) diff --git a/src/core/os_akill.c b/src/core/os_akill.c index 590767bbe..47a2b9dd1 100644 --- a/src/core/os_akill.c +++ b/src/core/os_akill.c @@ -14,24 +14,123 @@ #include "module.h" -int akill_view_callback(SList *slist, int number, void *item, va_list args); -int akill_list_callback(SList *slist, int number, void *item, va_list args); -int akill_view(int number, Akill *ak, User *u, int *sent_header); -int akill_list(int number, Akill *ak, User *u, int *sent_header); +class AkillDelCallback : public NumberList +{ + User *u; + unsigned Deleted; + public: + AkillDelCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), Deleted(0) + { + } + + ~AkillDelCallback() + { + if (!Deleted) + notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_MATCH); + else if (Deleted == 1) + notice_lang(Config.s_OperServ, u, OPER_AKILL_DELETED_ONE); + else + notice_lang(Config.s_OperServ, u, OPER_AKILL_DELETED_SEVERAL, Deleted); + } + + void HandleNumber(unsigned Number) + { + XLine *x = SGLine->GetEntry(Number - 1); + + if (!x) + return; + + ++Deleted; + DoDel(u, x); + } + + static void DoDel(User *u, XLine *x) + { + SGLine->DelXLine(x); + } +}; + +class AkillListCallback : public NumberList +{ + protected: + User *u; + bool SentHeader; + public: + AkillListCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), SentHeader(false) + { + } + + ~AkillListCallback() + { + if (!SentHeader) + notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_MATCH); + else + notice_lang(Config.s_OperServ, u, END_OF_ANY_LIST, "Akill"); + } + + void HandleNumber(unsigned Number) + { + XLine *x = SGLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_FORMAT, Number + 1, x->Mask.c_str(), x->Reason.c_str()); + } +}; -static int akill_del_callback(SList *slist, void *item, va_list args) +class AkillViewCallback : public AkillListCallback { - User *u = va_arg(args, User *); - FOREACH_MOD(I_OnDelAkill, OnDelAkill(u, static_cast<Akill *>(item))); - return 1; -} + public: + AkillViewCallback(User *_u, const std::string &numlist) : AkillListCallback(_u, numlist) + { + } + + void HandleNumber(unsigned Number) + { + XLine *x = SGLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_AKILL_VIEW_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + char timebuf[32], expirebuf[256]; + struct tm tm; + + tm = *localtime(&x->Created); + strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); + expire_left(u->Account(), expirebuf, sizeof(expirebuf), x->Expires); + + notice_lang(Config.s_OperServ, u, OPER_AKILL_VIEW_FORMAT, Number + 1, x->Mask.c_str(), x->By.c_str(), timebuf, expirebuf, x->Reason.c_str()); + } +}; class CommandOSAKill : public Command { private: CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { - int deleted = 0; unsigned last_param = 2; const char *expiry, *mask; char reason[BUFSIZE]; @@ -68,37 +167,13 @@ class CommandOSAKill : public Command return MOD_CONT; } snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 && params.size() > 3 ? " " : "", last_param == 2 && params.size() > 3 ? params[3].c_str() : ""); - if (mask && *reason) { - /* We first do some sanity check on the proposed mask. */ - if (strchr(mask, '!')) - { - notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_NICK); - return MOD_CONT; - } - - if (!strchr(mask, '@')) - { - notice_lang(Config.s_OperServ, u, BAD_USERHOST_MASK); - return MOD_CONT; - } + if (mask && *reason) + { + XLine *x = SGLine->Add(OperServ, u, mask, expires, reason); - if (mask && strspn(mask, "~@.*?") == strlen(mask)) - { - notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask); + if (!x) return MOD_CONT; - } - - std::string realreason; - if (Config.AddAkiller) - realreason = "[" + u->nick + "] " + std::string(reason); - else - realreason = reason; - deleted = add_akill(u, mask, u->nick.c_str(), expires, realreason.c_str()); - if (deleted < 0) - return MOD_CONT; - else if (deleted) - notice_lang(Config.s_OperServ, u, OPER_AKILL_DELETED_SEVERAL, deleted); notice_lang(Config.s_OperServ, u, OPER_AKILL_ADDED, mask); if (Config.WallOSAkill) @@ -131,7 +206,7 @@ class CommandOSAKill : public Command snprintf(buf, sizeof(buf), "expires in %d %s%s", wall_expiry, s, wall_expiry == 1 ? "" : "s"); } - ircdproto->SendGlobops(OperServ, "%s added an AKILL for %s (%s) (%s)", u->nick.c_str(), mask, realreason.c_str(), buf); + ircdproto->SendGlobops(OperServ, "%s added an AKILL for %s (%s) (%s)", u->nick.c_str(), mask, reason, buf); } if (readonly) @@ -145,49 +220,36 @@ class CommandOSAKill : public Command CommandReturn DoDel(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res = 0; - - mask = params.size() > 1 ? params[1].c_str() : NULL; + const ci::string mask = params.size() > 1 ? params[0] : ""; - if (!mask) + if (mask.empty()) { this->OnSyntaxError(u, "DEL"); return MOD_CONT; } - if (!akills.count) + if (SGLine->GetList().empty()) { notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_EMPTY); return MOD_CONT; } - if (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask)) - { - /* Deleting a range */ - res = slist_delete_range(&akills, mask, akill_del_callback, u); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_MATCH); - return MOD_CONT; - } - else if (res == 1) - notice_lang(Config.s_OperServ, u, OPER_AKILL_DELETED_ONE); - else - notice_lang(Config.s_OperServ, u, OPER_AKILL_DELETED_SEVERAL, res); - } + if (isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new AkillDelCallback(u, mask.c_str()))->Process(); else { - if ((res = slist_indexof(&akills, const_cast<void *>(static_cast<const void *>(mask)))) == -1) // XXX: possibly unsafe cast + XLine *x = SGLine->HasEntry(mask); + + if (!x) { - notice_lang(Config.s_OperServ, u, OPER_AKILL_NOT_FOUND, mask); + notice_lang(Config.s_OperServ, u, OPER_AKILL_NOT_FOUND, mask.c_str()); return MOD_CONT; } - FOREACH_MOD(I_OnDelAkill, OnDelAkill(u, static_cast<Akill *>(akills.list[res]))); + FOREACH_MOD(I_OnDelAkill, OnDelAkill(u, x)); - slist_delete(&akills, res); - notice_lang(Config.s_OperServ, u, OPER_AKILL_DELETED, mask); + AkillDelCallback::DoDel(u, x); + notice_lang(Config.s_OperServ, u, OPER_AKILL_DELETED, mask.c_str()); } if (readonly) @@ -198,41 +260,37 @@ class CommandOSAKill : public Command CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res, sent_header = 0; - - if (!akills.count) + if (SGLine->GetList().empty()) { notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_EMPTY); return MOD_CONT; } - mask = params.size() > 1 ? params[1].c_str() : NULL; + const ci::string mask = params.size() > 1 ? params[1] : ""; - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&akills, mask, &akill_list_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_MATCH); - return MOD_CONT; - } - else - notice_lang(Config.s_OperServ, u, END_OF_ANY_LIST, "Akill"); - } + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new AkillListCallback(u, mask.c_str()))->Process(); else { - int i; - char amask[BUFSIZE]; + bool SentHeader = false; - for (i = 0; i < akills.count; ++i) + for (unsigned i = 0; i < SGLine->GetCount(); ++i) { - snprintf(amask, sizeof(amask), "%s@%s", (static_cast<Akill *>(akills.list[i]))->user, (static_cast<Akill *>(akills.list[i]))->host); - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - akill_list(i + 1, static_cast<Akill *>(akills.list[i]), u, &sent_header); + XLine *x = SGLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_HEADER); + } + + AkillListCallback::DoList(u, x, i); + } } - if (!sent_header) + if (!SentHeader) notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_MATCH); else notice_lang(Config.s_OperServ, u, END_OF_ANY_LIST, "Akill"); @@ -243,39 +301,37 @@ class CommandOSAKill : public Command CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res, sent_header = 0; - - if (!akills.count) + if (SGLine->GetList().empty()) { notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_EMPTY); return MOD_CONT; } - mask = params.size() > 1 ? params[1].c_str() : NULL; + const ci::string mask = params.size() > 1 ? params[1] : ""; - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&akills, mask, &akill_view_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_MATCH); - return MOD_CONT; - } - } + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new AkillViewCallback(u, mask.c_str()))->Process(); else { - int i; - char amask[BUFSIZE]; + bool SentHeader = false; - for (i = 0; i < akills.count; ++i) + for (unsigned i = 0; i < SGLine->GetCount(); ++i) { - snprintf(amask, sizeof(amask), "%s@%s", (static_cast<Akill *>(akills.list[i]))->user, (static_cast<Akill *>(akills.list[i]))->host); - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - akill_view(i + 1, static_cast<Akill *>(akills.list[i]), u, &sent_header); + XLine *x = SGLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_AKILL_VIEW_HEADER); + } + + AkillViewCallback::DoList(u, x, i); + } } - if (!sent_header) + if (!SentHeader) notice_lang(Config.s_OperServ, u, OPER_AKILL_NO_MATCH); } @@ -285,7 +341,7 @@ class CommandOSAKill : public Command CommandReturn DoClear(User *u) { FOREACH_MOD(I_OnDelAkill, OnDelAkill(u, NULL)); - slist_clear(&akills, 1); + SGLine->Clear(); notice_lang(Config.s_OperServ, u, OPER_AKILL_CLEAR); return MOD_CONT; @@ -344,66 +400,4 @@ class OSAKill : public Module } }; -int akill_view(int number, Akill *ak, User *u, int *sent_header) -{ - char mask[BUFSIZE]; - char timebuf[32], expirebuf[256]; - struct tm tm; - - if (!ak) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_AKILL_VIEW_HEADER); - *sent_header = 1; - } - - snprintf(mask, sizeof(mask), "%s@%s", ak->user, ak->host); - tm = *localtime(&ak->seton); - strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); - expire_left(u->Account(), expirebuf, sizeof(expirebuf), ak->expires); - notice_lang(Config.s_OperServ, u, OPER_AKILL_VIEW_FORMAT, number, mask, ak->by, timebuf, expirebuf, ak->reason); - - return 1; -} - -/* Lists an AKILL entry, prefixing it with the header if needed */ -int akill_list_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return akill_list(number, static_cast<Akill *>(item), u, sent_header); -} - -/* Callback for enumeration purposes */ -int akill_view_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return akill_view(number, static_cast<Akill *>(item), u, sent_header); -} - -/* Lists an AKILL entry, prefixing it with the header if needed */ -int akill_list(int number, Akill *ak, User *u, int *sent_header) -{ - char mask[BUFSIZE]; - - if (!ak) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_HEADER); - *sent_header = 1; - } - - snprintf(mask, sizeof(mask), "%s@%s", ak->user, ak->host); - notice_lang(Config.s_OperServ, u, OPER_AKILL_LIST_FORMAT, number, mask, ak->reason); - - return 1; -} - MODULE_INIT(OSAKill) diff --git a/src/core/os_chankill.c b/src/core/os_chankill.c index 6d06f75c5..aa6ffa142 100644 --- a/src/core/os_chankill.c +++ b/src/core/os_chankill.c @@ -26,7 +26,6 @@ class CommandOSChanKill : public Command const char *expiry, *channel; char reason[BUFSIZE]; time_t expires; - char *mask = new char[Config.UserLen + Config.HostLen + 2]; unsigned last_param = 1; Channel *c; @@ -46,7 +45,6 @@ class CommandOSChanKill : public Command if (expires != 0 && expires < 60) { notice_lang(Config.s_OperServ, u, BAD_EXPIRY_TIME); - delete [] mask; return MOD_CONT; } else if (expires > 0) @@ -55,7 +53,6 @@ class CommandOSChanKill : public Command if (params.size() <= last_param) { this->OnSyntaxError(u, ""); - delete [] mask; return MOD_CONT; } snprintf(reason, sizeof(reason), "%s%s", params[last_param].c_str(), (params.size() > last_param + 1 ? params[last_param + 1].c_str() : "")); @@ -77,10 +74,8 @@ class CommandOSChanKill : public Command if (is_oper(uc->user)) continue; - strlcpy(mask, "*@", Config.UserLen + Config.HostLen + 2); /* Use *@" for the akill's, */ - strlcat(mask, uc->user->host, Config.UserLen + Config.HostLen + 2); - add_akill(NULL, mask, Config.s_OperServ, expires, realreason.c_str()); - check_akill(uc->user->nick.c_str(), uc->user->GetIdent().c_str(), uc->user->host, NULL, NULL); + SGLine->Add(OperServ, u, ci::string("*@") + uc->user->host, expires, realreason); + SGLine->Check(uc->user); } if (Config.WallOSAkill) ircdproto->SendGlobops(OperServ, "%s used CHANKILL on %s (%s)", u->nick.c_str(), channel, realreason.c_str()); @@ -88,7 +83,6 @@ class CommandOSChanKill : public Command else notice_lang(Config.s_OperServ, u, CHAN_X_NOT_IN_USE, channel); } - delete [] mask; return MOD_CONT; } diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c index edb2a51aa..6f9197a2b 100644 --- a/src/core/os_defcon.c +++ b/src/core/os_defcon.c @@ -160,12 +160,10 @@ class OSDEFCON : public Module { if (CheckDefCon(DEFCON_AKILL_NEW_CLIENTS)) { - 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, - Config.DefConAkillReason ? Config.DefConAkillReason : - "DEFCON AKILL"); + Alog() << "DEFCON: adding akill for *@" << u->host; + XLine *x = SGLine->Add(NULL, NULL, ci::string("*@") + u->host, time(NULL) + Config.DefConAKILL, Config.DefConAkillReason ? Config.DefConAkillReason : "DEFCON AKILL"); + if (x) + x->By = Config.s_OperServ; } if (CheckDefCon(DEFCON_NO_NEW_CLIENTS) || CheckDefCon(DEFCON_AKILL_NEW_CLIENTS)) @@ -199,7 +197,7 @@ class OSDEFCON : public Module { std::string param; - if (GetDefConParam(Name, ¶m)) + if (GetDefConParam(Name, param)) { c->SetMode(OperServ, Name, param); } @@ -301,10 +299,8 @@ class OSDEFCON : public Module session->hits++; if (Config.MaxSessionKill && session->hits >= Config.MaxSessionKill) { - char akillmask[BUFSIZE]; - snprintf(akillmask, sizeof(akillmask), "*@%s", u->host); - add_akill(NULL, akillmask, Config.s_OperServ, time(NULL) + Config.SessionAutoKillExpiry, "Session limit exceeded"); - ircdproto->SendGlobops(OperServ, "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask); + SGLine->Add(NULL, NULL, ci::string("*@") + u->host, time(NULL) + Config.SessionAutoKillExpiry, "Session limit exceeded"); + ircdproto->SendGlobops(OperServ, "Added a temporary AKILL for \2*@%s\2 due to excessive connections", u->host); } } } @@ -373,18 +369,18 @@ void runDefCon() if (Config.DefConChanModes[0] == '+' || Config.DefConChanModes[0] == '-') { Alog() << "DEFCON: setting " << Config.DefConChanModes << " on all channels"; - DefConModesSet = 1; + DefConModesSet = true; MassChannelModes(OperServ, Config.DefConChanModes); } } } else { - if (Config.DefConChanModes && (DefConModesSet != 0)) + if (Config.DefConChanModes && DefConModesSet) { if (Config.DefConChanModes[0] == '+' || Config.DefConChanModes[0] == '-') { - DefConModesSet = 0; + DefConModesSet = false; if ((newmodes = defconReverseModes(Config.DefConChanModes))) { Alog() << "DEFCON: setting " << newmodes << " on all channels"; diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c deleted file mode 100644 index 27b062ee0..000000000 --- a/src/core/os_sgline.c +++ /dev/null @@ -1,410 +0,0 @@ -/* OperServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * - */ -/*************************************************************************/ - -#include "module.h" -#include "hashcomp.h" - -int sgline_view_callback(SList *slist, int number, void *item, va_list args); -int sgline_list_callback(SList *slist, int number, void *item, va_list args); -int sgline_view(int number, SXLine *sx, User *u, int *sent_header); -int sgline_list(int number, SXLine *sx, User *u, int *sent_header); - -static int sxline_del_callback(SList *slist, void *item, va_list args) -{ - User *u = va_arg(args, User *); - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, static_cast<SXLine *>(item), SX_SGLINE)); - return 1; -} - -class CommandOSSGLine : public Command -{ - private: - CommandReturn OnAdd(User *u, const std::vector<ci::string> ¶ms) - { - int deleted = 0; - unsigned last_param = 2; - const char *param, *expiry; - char rest[BUFSIZE]; - time_t expires; - - param = params.size() > 1 ? params[1].c_str() : NULL; - if (param && *param == '+') - { - expiry = param; - param = params.size() > 2 ? params[2].c_str() : NULL; - last_param = 3; - } - else - expiry = NULL; - - expires = expiry ? dotime(expiry) : Config.SGLineExpiry; - /* If the expiry given does not contain a final letter, it's in days, - * said the doc. Ah well. - */ - if (expiry && isdigit(expiry[strlen(expiry) - 1])) - expires *= 86400; - /* Do not allow less than a minute expiry time */ - if (expires && expires < 60) - { - notice_lang(Config.s_OperServ, u, BAD_EXPIRY_TIME); - return MOD_CONT; - } - else if (expires > 0) - expires += time(NULL); - - if (!param) - { - this->OnSyntaxError(u, "ADD"); - return MOD_CONT; - } - snprintf(rest, sizeof(rest), "%s%s%s", param, params.size() > last_param ? " " : "", params.size() > last_param ? params[last_param].c_str() : ""); - - if (std::string(rest).find(':') == std::string::npos) - { - this->OnSyntaxError(u, "ADD"); - return MOD_CONT; - } - - sepstream sep(rest, ':'); - std::string mask; - sep.GetToken(mask); - std::string reason = sep.GetRemaining(); - - if (!mask.empty() && !reason.empty()) { - /* Clean up the last character of the mask if it is a space - * See bug #761 - */ - unsigned masklen = mask.size(); - if (mask[masklen - 1] == ' ') - mask.erase(masklen - 1); - - const char *cmask = mask.c_str(); - - /* We first do some sanity check on the proposed mask. */ - - if (!mask.empty() && strspn(cmask, "*?") == strlen(cmask)) { - notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, cmask); - return MOD_CONT; - } - - deleted = add_sgline(u, cmask, u->nick.c_str(), expires, reason.c_str()); - if (deleted < 0) - return MOD_CONT; - else if (deleted) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_DELETED_SEVERAL, deleted); - notice_lang(Config.s_OperServ, u, OPER_SGLINE_ADDED, cmask); - - if (Config.WallOSSGLine) - { - char buf[128]; - - if (!expires) - strcpy(buf, "does not expire"); - else - { - int wall_expiry = expires - time(NULL); - const char *s = NULL; - - if (wall_expiry >= 86400) - { - wall_expiry /= 86400; - s = "day"; - } - else if (wall_expiry >= 3600) - { - wall_expiry /= 3600; - s = "hour"; - } - else if (wall_expiry >= 60) - { - wall_expiry /= 60; - s = "minute"; - } - - snprintf(buf, sizeof(buf), "expires in %d %s%s", wall_expiry, s, wall_expiry == 1 ? "" : "s"); - } - - ircdproto->SendGlobops(OperServ, "%s added an SGLINE for %s (%s)", u->nick.c_str(), cmask, buf); - } - - if (readonly) - notice_lang(Config.s_OperServ, u, READ_ONLY_MODE); - - } - else - this->OnSyntaxError(u, "ADD"); - - return MOD_CONT; - } - - CommandReturn OnDel(User *u, const std::vector<ci::string> ¶ms) - { - const char *mask; - int res = 0; - - mask = params.size() > 1 ? params[1].c_str() : NULL; - - if (!mask) - { - this->OnSyntaxError(u, "DEL"); - return MOD_CONT; - } - - if (!sglines.count) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_LIST_EMPTY); - return MOD_CONT; - } - - if (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask)) - { - /* Deleting a range */ - res = slist_delete_range(&sglines, mask, sxline_del_callback); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_NO_MATCH); - return MOD_CONT; - } - else if (res == 1) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_DELETED_ONE); - else - notice_lang(Config.s_OperServ, u, OPER_SGLINE_DELETED_SEVERAL, res); - } - else { - if ((res = slist_indexof(&sglines, const_cast<char *>(mask))) == -1) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_NOT_FOUND, mask); - return MOD_CONT; - } - - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, static_cast<SXLine *>(sglines.list[res]), SX_SGLINE)); - slist_delete(&sglines, res); - notice_lang(Config.s_OperServ, u, OPER_SGLINE_DELETED, mask); - } - - if (readonly) - notice_lang(Config.s_OperServ, u, READ_ONLY_MODE); - - return MOD_CONT; - } - - CommandReturn OnList(User *u, const std::vector<ci::string> ¶ms) - { - const char *mask; - int res, sent_header = 0; - - if (!sglines.count) { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_LIST_EMPTY); - return MOD_CONT; - } - - mask = params.size() > 1 ? params[1].c_str() : NULL; - - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&sglines, mask, &sgline_list_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_NO_MATCH); - return MOD_CONT; - } - } - else - { - int i; - char *amask; - - for (i = 0; i < sglines.count; ++i) - { - amask = (static_cast<SXLine *>(sglines.list[i]))->mask; - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - sgline_list(i + 1, static_cast<SXLine *>(sglines.list[i]), u, &sent_header); - } - - if (!sent_header) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_NO_MATCH); - else - notice_lang(Config.s_OperServ, u, END_OF_ANY_LIST, "SGLine"); - } - - return MOD_CONT; - } - - CommandReturn OnView(User *u, const std::vector<ci::string> ¶ms) - { - const char *mask; - int res, sent_header = 0; - - if (!sglines.count) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_LIST_EMPTY); - return MOD_CONT; - } - - mask = params.size() > 1 ? params[1].c_str() : NULL; - - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&sglines, mask, &sgline_view_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_NO_MATCH); - return MOD_CONT; - } - } - else - { - int i; - char *amask; - - for (i = 0; i < sglines.count; ++i) - { - amask = (static_cast<SXLine *>(sglines.list[i]))->mask; - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - sgline_view(i + 1, static_cast<SXLine *>(sglines.list[i]), u, &sent_header); - } - - if (!sent_header) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_NO_MATCH); - } - - return MOD_CONT; - } - - CommandReturn OnClear(User *u) - { - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, NULL, SX_SGLINE)); - slist_clear(&sglines, 1); - notice_lang(Config.s_OperServ, u, OPER_SGLINE_CLEAR); - - return MOD_CONT; - } - public: - CommandOSSGLine() : Command("SGLINE", 1, 3, "operserv/sgline") - { - } - - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) - { - ci::string cmd = params[0]; - - if (cmd == "ADD") - return this->OnAdd(u, params); - else if (cmd == "DEL") - return this->OnDel(u, params); - else if (cmd == "LIST") - return this->OnList(u, params); - else if (cmd == "VIEW") - return this->OnView(u, params); - else if (cmd == "CLEAR") - return this->OnClear(u); - else - this->OnSyntaxError(u, ""); - return MOD_CONT; - } - - bool OnHelp(User *u, const ci::string &subcommand) - { - notice_help(Config.s_OperServ, u, OPER_HELP_SGLINE); - return true; - } - - void OnSyntaxError(User *u, const ci::string &subcommand) - { - syntax_error(Config.s_OperServ, u, "SGLINE", OPER_SGLINE_SYNTAX); - } -}; - -class OSSGLine : public Module -{ - public: - OSSGLine(const std::string &modname, const std::string &creator) : Module(modname, creator) - { - - this->SetAuthor("Anope"); - this->SetVersion(VERSION_STRING); - this->SetType(CORE); - - this->AddCommand(OperServ, new CommandOSSGLine()); - - if (!ircd->sgline) - throw ModuleException("Your IRCd does not support SGLine"); - - ModuleManager::Attach(I_OnOperServHelp, this); - } - void OnOperServHelp(User *u) - { - notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_SGLINE); - } -}; - -/* Lists an SGLINE entry, prefixing it with the header if needed */ -int sgline_view(int number, SXLine *sx, User *u, int *sent_header) -{ - char timebuf[32], expirebuf[256]; - struct tm tm; - - if (!sx) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_VIEW_HEADER); - *sent_header = 1; - } - - tm = *localtime(&sx->seton); - strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); - expire_left(u->Account(), expirebuf, sizeof(expirebuf), sx->expires); - notice_lang(Config.s_OperServ, u, OPER_SGLINE_VIEW_FORMAT, number, sx->mask, sx->by, timebuf, expirebuf, sx->reason); - - return 1; -} - -/* Callback for enumeration purposes */ -int sgline_view_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return sgline_view(number, static_cast<SXLine *>(item), u, sent_header); -} - -/* Lists an SGLINE entry, prefixing it with the header if needed */ -int sgline_list(int number, SXLine *sx, User *u, int *sent_header) -{ - if (!sx) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_SGLINE_LIST_HEADER); - *sent_header = 1; - } - - notice_lang(Config.s_OperServ, u, OPER_SGLINE_LIST_FORMAT, number, sx->mask, sx->reason); - - return 1; -} - -/* Callback for enumeration purposes */ -int sgline_list_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return sgline_list(number, static_cast<SXLine *>(item), u, sent_header); -} - -MODULE_INIT(OSSGLine) diff --git a/src/core/os_snline.cpp b/src/core/os_snline.cpp new file mode 100644 index 000000000..503b63b5c --- /dev/null +++ b/src/core/os_snline.cpp @@ -0,0 +1,426 @@ +/* OperServ core functions + * + * (C) 2003-2010 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * $Id$ + * + */ +/*************************************************************************/ + +#include "module.h" +#include "hashcomp.h" + +class SNLineDelCallback : public NumberList +{ + User *u; + unsigned Deleted; + public: + SNLineDelCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), Deleted(0) + { + } + + ~SNLineDelCallback() + { + if (!Deleted) + notice_lang(Config.s_OperServ, u, OPER_SNLINE_NO_MATCH); + else if (Deleted == 0) + notice_lang(Config.s_OperServ, u, OPER_SNLINE_DELETED_ONE); + else + notice_lang(Config.s_OperServ, u, OPER_SNLINE_DELETED_SEVERAL, Deleted); + } + + void HandleNumber(unsigned Number) + { + XLine *x = SNLine->GetEntry(Number - 1); + + if (!x) + return; + + ++Deleted; + DoDel(u, x); + } + + static void DoDel(User *u, XLine *x) + { + SNLine->DelXLine(x); + } +}; + +class SNLineListCallback : public NumberList +{ + protected: + User *u; + bool SentHeader; + public: + SNLineListCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), SentHeader(false) + { + } + + ~SNLineListCallback() + { + if (!SentHeader) + notice_lang(Config.s_OperServ, u, OPER_SNLINE_NO_MATCH); + } + + virtual void HandleNumber(unsigned Number) + { + XLine *x = SNLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SNLINE_LIST_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + notice_lang(Config.s_OperServ, u, OPER_SNLINE_LIST_FORMAT, Number + 1, x->Mask.c_str(), x->Reason.c_str()); + } +}; + +class SNLineViewCallback : public SNLineListCallback +{ + public: + SNLineViewCallback(User *_u, const std::string &numlist) : SNLineListCallback(_u, numlist) + { + } + + void HandleNumber(unsigned Number) + { + XLine *x = SNLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SNLINE_VIEW_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + char timebuf[32], expirebuf[256]; + struct tm tm; + + tm = *localtime(&x->Created); + strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); + expire_left(u->Account(), expirebuf, sizeof(expirebuf), x->Expires); + notice_lang(Config.s_OperServ, u, OPER_SNLINE_VIEW_FORMAT, Number + 1, x->Mask.c_str(), x->By.c_str(), timebuf, expirebuf, x->Reason.c_str()); + } +}; + +class CommandOSSNLine : public Command +{ + private: + CommandReturn OnAdd(User *u, const std::vector<ci::string> ¶ms) + { + unsigned last_param = 2; + const char *param, *expiry; + char rest[BUFSIZE]; + time_t expires; + + param = params.size() > 1 ? params[1].c_str() : NULL; + if (param && *param == '+') + { + expiry = param; + param = params.size() > 2 ? params[2].c_str() : NULL; + last_param = 3; + } + else + expiry = NULL; + + expires = expiry ? dotime(expiry) : Config.SNLineExpiry; + /* If the expiry given does not contain a final letter, it's in days, + * said the doc. Ah well. + */ + if (expiry && isdigit(expiry[strlen(expiry) - 1])) + expires *= 86400; + /* Do not allow less than a minute expiry time */ + if (expires && expires < 60) + { + notice_lang(Config.s_OperServ, u, BAD_EXPIRY_TIME); + return MOD_CONT; + } + else if (expires > 0) + expires += time(NULL); + + if (!param) + { + this->OnSyntaxError(u, "ADD"); + return MOD_CONT; + } + snprintf(rest, sizeof(rest), "%s%s%s", param, params.size() > last_param ? " " : "", params.size() > last_param ? params[last_param].c_str() : ""); + + if (std::string(rest).find(':') == std::string::npos) + { + this->OnSyntaxError(u, "ADD"); + return MOD_CONT; + } + + sepstream sep(rest, ':'); + ci::string mask; + sep.GetToken(mask); + std::string reason = sep.GetRemaining(); + + if (!mask.empty() && !reason.empty()) { + /* Clean up the last character of the mask if it is a space + * See bug #761 + */ + unsigned masklen = mask.size(); + if (mask[masklen - 1] == ' ') + mask.erase(masklen - 1); + + XLine *x = SNLine->Add(OperServ, u, mask, expires, reason); + + if (!x) + return MOD_CONT; + + notice_lang(Config.s_OperServ, u, OPER_SNLINE_ADDED, mask.c_str()); + + if (Config.WallOSSNLine) + { + char buf[128]; + + if (!expires) + strcpy(buf, "does not expire"); + else + { + int wall_expiry = expires - time(NULL); + const char *s = NULL; + + if (wall_expiry >= 86400) + { + wall_expiry /= 86400; + s = "day"; + } + else if (wall_expiry >= 3600) + { + wall_expiry /= 3600; + s = "hour"; + } + else if (wall_expiry >= 60) + { + wall_expiry /= 60; + s = "minute"; + } + + snprintf(buf, sizeof(buf), "expires in %d %s%s", wall_expiry, s, wall_expiry == 1 ? "" : "s"); + } + + ircdproto->SendGlobops(findbot(Config.s_OperServ), "%s added an SNLINE for %s (%s)", u->nick.c_str(), mask.c_str(), buf); + } + + if (readonly) + notice_lang(Config.s_OperServ, u, READ_ONLY_MODE); + + } + else + this->OnSyntaxError(u, "ADD"); + + return MOD_CONT; + } + + CommandReturn OnDel(User *u, const std::vector<ci::string> ¶ms) + { + if (SNLine->GetList().empty()) + { + notice_lang(Config.s_OperServ, u, OPER_SNLINE_LIST_EMPTY); + return MOD_CONT; + } + + const ci::string mask = params.size() > 1 ? params[1] : ""; + + if (mask.empty()) + { + this->OnSyntaxError(u, "DEL"); + return MOD_CONT; + } + + if (isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SNLineDelCallback(u, mask.c_str()))->Process(); + else + { + XLine *x = SNLine->HasEntry(mask); + + if (!x) + { + notice_lang(Config.s_OperServ, u, OPER_SNLINE_NOT_FOUND, mask.c_str()); + return MOD_CONT; + } + + FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, x, X_SNLINE)); + + SNLineDelCallback::DoDel(u, x); + notice_lang(Config.s_OperServ, u, OPER_SNLINE_DELETED, mask.c_str()); + } + + if (readonly) + notice_lang(Config.s_OperServ, u, READ_ONLY_MODE); + + return MOD_CONT; + } + + CommandReturn OnList(User *u, const std::vector<ci::string> ¶ms) + { + if (SNLine->GetList().empty()) + { + notice_lang(Config.s_OperServ, u, OPER_SNLINE_LIST_EMPTY); + return MOD_CONT; + } + + const ci::string mask = params.size() > 1 ? params[1] : ""; + + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SNLineListCallback(u, mask.c_str()))->Process(); + else + { + bool SentHeader = false; + + for (unsigned i = 0; i < SNLine->GetCount(); ++i) + { + XLine *x = SNLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SNLINE_LIST_HEADER); + } + + SNLineListCallback::DoList(u, x, i); + } + } + + if (!SentHeader) + notice_lang(Config.s_OperServ, u, OPER_SNLINE_NO_MATCH); + else + notice_lang(Config.s_OperServ, u, END_OF_ANY_LIST, "SNLine"); + } + + return MOD_CONT; + } + + CommandReturn OnView(User *u, const std::vector<ci::string> ¶ms) + { + if (SNLine->GetList().empty()) + { + notice_lang(Config.s_OperServ, u, OPER_SNLINE_LIST_EMPTY); + return MOD_CONT; + } + + const ci::string mask = params.size() > 1 ? params[1] : ""; + + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SNLineViewCallback(u, mask.c_str()))->Process(); + else + { + bool SentHeader = false; + + for (unsigned i = 0; i < SNLine->GetCount(); ++i) + { + XLine *x = SNLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SNLINE_VIEW_HEADER); + } + + SNLineViewCallback::DoList(u, x, i); + } + } + + if (!SentHeader) + notice_lang(Config.s_OperServ, u, OPER_SNLINE_NO_MATCH); + } + + return MOD_CONT; + } + + CommandReturn OnClear(User *u) + { + FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, NULL, X_SNLINE)); + SNLine->Clear(); + notice_lang(Config.s_OperServ, u, OPER_SNLINE_CLEAR); + + return MOD_CONT; + } + public: + CommandOSSNLine() : Command("SNLINE", 1, 3, "operserv/snline") + { + } + + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) + { + ci::string cmd = params[0]; + + if (cmd == "ADD") + return this->OnAdd(u, params); + else if (cmd == "DEL") + return this->OnDel(u, params); + else if (cmd == "LIST") + return this->OnList(u, params); + else if (cmd == "VIEW") + return this->OnView(u, params); + else if (cmd == "CLEAR") + return this->OnClear(u); + else + this->OnSyntaxError(u, ""); + return MOD_CONT; + } + + bool OnHelp(User *u, const ci::string &subcommand) + { + notice_help(Config.s_OperServ, u, OPER_HELP_SNLINE); + return true; + } + + void OnSyntaxError(User *u, const ci::string &subcommand) + { + syntax_error(Config.s_OperServ, u, "SNLINE", OPER_SNLINE_SYNTAX); + } +}; + +class OSSNLine : public Module +{ + public: + OSSNLine(const std::string &modname, const std::string &creator) : Module(modname, creator) + { + + this->SetAuthor("Anope"); + this->SetVersion("$Id$"); + this->SetType(CORE); + + this->AddCommand(OperServ, new CommandOSSNLine()); + + if (!ircd->snline) + throw ModuleException("Your IRCd does not support SNLine"); + + ModuleManager::Attach(I_OnOperServHelp, this); + } + void OnOperServHelp(User *u) + { + notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_SNLINE); + } +}; + +MODULE_INIT(OSSNLine) diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c index b73c3ce8b..89864c69e 100644 --- a/src/core/os_sqline.c +++ b/src/core/os_sqline.c @@ -14,24 +14,122 @@ #include "module.h" -int sqline_view_callback(SList *slist, int number, void *item, va_list args); -int sqline_list_callback(SList *slist, int number, void *item, va_list args); -int sqline_view(int number, SXLine *sx, User *u, int *sent_header); -int sqline_list(int number, SXLine *sx, User *u, int *sent_header); +class SQLineDelCallback : public NumberList +{ + User *u; + unsigned Deleted; + public: + SQLineDelCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), Deleted(0) + { + } + + ~SQLineDelCallback() + { + if (!Deleted) + notice_lang(Config.s_OperServ, u, OPER_SQLINE_NO_MATCH); + else if (Deleted == 0) + notice_lang(Config.s_OperServ, u, OPER_SQLINE_DELETED_ONE); + else + notice_lang(Config.s_OperServ, u, OPER_SQLINE_DELETED_SEVERAL, Deleted); + } + + void HandleNumber(unsigned Number) + { + XLine *x = SQLine->GetEntry(Number - 1); + + if (!x) + return; + + ++Deleted; + DoDel(u, x); + } + + static void DoDel(User *u, XLine *x) + { + SQLine->DelXLine(x); + } +}; -static int sxline_del_callback(SList *slist, void *item, va_list args) +class SQLineListCallback : public NumberList { - User *u = va_arg(args, User *); - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, static_cast<SXLine *>(item), SX_SQLINE)); - return 1; -} + protected: + User *u; + bool SentHeader; + public: + SQLineListCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), SentHeader(false) + { + } + + ~SQLineListCallback() + { + if (!SentHeader) + notice_lang(Config.s_OperServ, u, OPER_SQLINE_NO_MATCH); + } + + virtual void HandleNumber(unsigned Number) + { + XLine *x = SQLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_FORMAT, Number + 1, x->Mask.c_str(), x->Reason.c_str()); + } +}; + +class SQLineViewCallback : public SQLineListCallback +{ + public: + SQLineViewCallback(User *_u, const std::string &numlist) : SQLineListCallback(_u, numlist) + { + } + + void HandleNumber(unsigned Number) + { + XLine *x = SQLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SQLINE_VIEW_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + char timebuf[32], expirebuf[256]; + struct tm tm; + + tm = *localtime(&x->Created); + strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); + expire_left(u->Account(), expirebuf, sizeof(expirebuf), x->Expires); + notice_lang(Config.s_OperServ, u, OPER_SQLINE_VIEW_FORMAT, Number + 1, x->Mask.c_str(), x->By.c_str(), timebuf, +expirebuf, x->Reason.c_str()); + } +}; + class CommandOSSQLine : public Command { private: CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { - int deleted = 0; unsigned last_param = 2; const char *expiry, *mask; char reason[BUFSIZE]; @@ -70,25 +168,11 @@ class CommandOSSQLine : public Command snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 && params.size() > 3 ? " " : "", last_param == 2 && params.size() > 3 ? params[3].c_str() : ""); if (mask && *reason) { - /* We first do some sanity check on the proposed mask. */ - if (strspn(mask, "*") == strlen(mask)) - { - notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask); + XLine *x = SQLine->Add(OperServ, u, mask, expires, reason); + + if (!x) return MOD_CONT; - } - /* Channel SQLINEs are only supported on Bahamut servers */ - if (*mask == '#' && !ircd->chansqline) - { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_CHANNELS_UNSUPPORTED); - return MOD_CONT; - } - - deleted = add_sqline(u, mask, u->nick.c_str(), expires, reason); - if (deleted < 0) - return MOD_CONT; - else if (deleted) - notice_lang(Config.s_OperServ, u, OPER_SQLINE_DELETED_SEVERAL, deleted); notice_lang(Config.s_OperServ, u, OPER_SQLINE_ADDED, mask); if (Config.WallOSSQLine) @@ -136,47 +220,36 @@ class CommandOSSQLine : public Command CommandReturn DoDel(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res = 0; - - mask = params.size() > 1 ? params[1].c_str() : NULL; - - if (!mask) + if (SQLine->GetList().empty()) { - this->OnSyntaxError(u, "DEL"); + notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_EMPTY); return MOD_CONT; } - if (!sqlines.count) + const ci::string mask = params.size() > 1 ? params[1] : ""; + + if (mask.empty()) { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_EMPTY); + this->OnSyntaxError(u, "DEL"); return MOD_CONT; } - if (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask)) + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SQLineDelCallback(u, mask.c_str()))->Process(); + else { - /* Deleting a range */ - res = slist_delete_range(&sqlines, mask, sxline_del_callback); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_NO_MATCH); - return MOD_CONT; - } - else if (res == 1) - notice_lang(Config.s_OperServ, u, OPER_SQLINE_DELETED_ONE); - else - notice_lang(Config.s_OperServ, u, OPER_SQLINE_DELETED_SEVERAL, res); - } - else { - if ((res = slist_indexof(&sqlines, const_cast<char *>(mask))) == -1) + XLine *x = SQLine->HasEntry(mask); + + if (!x) { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_NOT_FOUND, mask); + notice_lang(Config.s_OperServ, u, OPER_SQLINE_NOT_FOUND, mask.c_str()); return MOD_CONT; } - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, static_cast<SXLine *>(sqlines.list[res]), SX_SQLINE)); - slist_delete(&sqlines, res); - notice_lang(Config.s_OperServ, u, OPER_SQLINE_DELETED, mask); + FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, x, X_SQLINE)); + + SQLineDelCallback::DoDel(u, x); + notice_lang(Config.s_OperServ, u, OPER_SQLINE_DELETED, mask.c_str()); } if (readonly) @@ -187,39 +260,37 @@ class CommandOSSQLine : public Command CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res, sent_header = 0; - - if (!sqlines.count) + if (SQLine->GetList().empty()) { notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_EMPTY); return MOD_CONT; } - mask = params.size() > 1 ? params[1].c_str() : NULL; + const ci::string mask = params.size() > 1 ? params[1] : ""; - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&sqlines, mask, &sqline_list_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_NO_MATCH); - return MOD_CONT; - } - } + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SQLineListCallback(u, mask.c_str()))->Process(); else { - int i; - char *amask; + bool SentHeader = false; - for (i = 0; i < sqlines.count; ++i) + for (unsigned i = 0; i < SQLine->GetCount(); ++i) { - amask = (static_cast<SXLine *>(sqlines.list[i]))->mask; - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - sqline_list(i + 1, static_cast<SXLine *>(sqlines.list[i]), u, &sent_header); + XLine *x = SQLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_HEADER); + } + + SQLineListCallback::DoList(u, x, i); + } } - if (!sent_header) + if (!SentHeader) notice_lang(Config.s_OperServ, u, OPER_SQLINE_NO_MATCH); else notice_lang(Config.s_OperServ, u, END_OF_ANY_LIST, "SQLine"); @@ -230,39 +301,37 @@ class CommandOSSQLine : public Command CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res, sent_header = 0; - - if (!sqlines.count) + if (SQLine->GetList().empty()) { notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_EMPTY); return MOD_CONT; } - mask = params.size() > 1 ? params[1].c_str() : NULL; + const ci::string mask = params.size() > 1 ? params[1] : ""; - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&sqlines, mask, &sqline_view_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_NO_MATCH); - return MOD_CONT; - } - } + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SQLineViewCallback(u, mask.c_str()))->Process(); else { - int i; - char *amask; + bool SentHeader = false; - for (i = 0; i < sqlines.count; ++i) + for (unsigned i = 0; i < SQLine->GetCount(); ++i) { - amask = (static_cast<SXLine *>(sqlines.list[i]))->mask; - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - sqline_view(i + 1, static_cast<SXLine *>(sqlines.list[i]), u, &sent_header); + XLine *x = SQLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SQLINE_VIEW_HEADER); + } + + SQLineViewCallback::DoList(u, x, i); + } } - if (!sent_header) + if (!SentHeader) notice_lang(Config.s_OperServ, u, OPER_SQLINE_NO_MATCH); } @@ -271,8 +340,8 @@ class CommandOSSQLine : public Command CommandReturn DoClear(User *u) { - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, NULL, SX_SQLINE)); - slist_clear(&sqlines, 1); + FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, NULL, X_SQLINE)); + SGLine->Clear(); notice_lang(Config.s_OperServ, u, OPER_SQLINE_CLEAR); return MOD_CONT; @@ -335,61 +404,4 @@ class OSSQLine : public Module } }; -int sqline_view(int number, SXLine *sx, User *u, int *sent_header) -{ - char timebuf[32], expirebuf[256]; - struct tm tm; - - if (!sx) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_VIEW_HEADER); - *sent_header = 1; - } - - tm = *localtime(&sx->seton); - strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); - expire_left(u->Account(), expirebuf, sizeof(expirebuf), sx->expires); - notice_lang(Config.s_OperServ, u, OPER_SQLINE_VIEW_FORMAT, number, sx->mask, sx->by, timebuf, expirebuf, sx->reason); - - return 1; -} - -/* Callback for enumeration purposes */ -int sqline_view_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return sqline_view(number, static_cast<SXLine *>(item), u, sent_header); -} - -/* Lists an SQLINE entry, prefixing it with the header if needed */ -int sqline_list(int number, SXLine *sx, User *u, int *sent_header) -{ - if (!sx) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_HEADER); - *sent_header = 1; - } - - notice_lang(Config.s_OperServ, u, OPER_SQLINE_LIST_FORMAT, number, sx->mask, sx->reason); - - return 1; -} - -/* Callback for enumeration purposes */ -int sqline_list_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return sqline_list(number, static_cast<SXLine *>(item), u, sent_header); -} - MODULE_INIT(OSSQLine) diff --git a/src/core/os_stats.c b/src/core/os_stats.c index f98e94a19..fb9623771 100644 --- a/src/core/os_stats.c +++ b/src/core/os_stats.c @@ -46,7 +46,7 @@ class CommandOSStats : public Command { int timeout; /* AKILLs */ - notice_lang(Config.s_OperServ, u, OPER_STATS_AKILL_COUNT, akills.count); + notice_lang(Config.s_OperServ, u, OPER_STATS_AKILL_COUNT, SGLine->GetCount()); timeout = Config.AutokillExpiry + 59; if (timeout >= 172800) notice_lang(Config.s_OperServ, u, OPER_STATS_AKILL_EXPIRE_DAYS, timeout / 86400); @@ -62,30 +62,30 @@ class CommandOSStats : public Command notice_lang(Config.s_OperServ, u, OPER_STATS_AKILL_EXPIRE_MIN); else notice_lang(Config.s_OperServ, u, OPER_STATS_AKILL_EXPIRE_NONE); - if (ircd->sgline) + if (ircd->snline) { - /* SGLINEs */ - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_COUNT, sglines.count); - timeout = Config.SGLineExpiry + 59; + /* SNLINEs */ + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_COUNT, SNLine->GetCount()); + timeout = Config.SNLineExpiry + 59; if (timeout >= 172800) - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_EXPIRE_DAYS, timeout / 86400); + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_EXPIRE_DAYS, timeout / 86400); else if (timeout >= 86400) - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_EXPIRE_DAY); + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_EXPIRE_DAY); else if (timeout >= 7200) - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_EXPIRE_HOURS, timeout / 3600); + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_EXPIRE_HOURS, timeout / 3600); else if (timeout >= 3600) - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_EXPIRE_HOUR); + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_EXPIRE_HOUR); else if (timeout >= 120) - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_EXPIRE_MINS, timeout / 60); + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_EXPIRE_MINS, timeout / 60); else if (timeout >= 60) - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_EXPIRE_MIN); + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_EXPIRE_MIN); else - notice_lang(Config.s_OperServ, u, OPER_STATS_SGLINE_EXPIRE_NONE); + notice_lang(Config.s_OperServ, u, OPER_STATS_SNLINE_EXPIRE_NONE); } if (ircd->sqline) { /* SQLINEs */ - notice_lang(Config.s_OperServ, u, OPER_STATS_SQLINE_COUNT, sqlines.count); + notice_lang(Config.s_OperServ, u, OPER_STATS_SQLINE_COUNT, SQLine->GetCount()); timeout = Config.SQLineExpiry + 59; if (timeout >= 172800) notice_lang(Config.s_OperServ, u, OPER_STATS_SQLINE_EXPIRE_DAYS, timeout / 86400); @@ -105,7 +105,7 @@ class CommandOSStats : public Command if (ircd->szline) { /* SZLINEs */ - notice_lang(Config.s_OperServ, u, OPER_STATS_SZLINE_COUNT, szlines.count); + notice_lang(Config.s_OperServ, u, OPER_STATS_SZLINE_COUNT, SZLine->GetCount()); timeout = Config.SZLineExpiry + 59; if (timeout >= 172800) notice_lang(Config.s_OperServ, u, OPER_STATS_SZLINE_EXPIRE_DAYS, timeout / 86400); @@ -316,64 +316,74 @@ class OSStats : public Module void get_operserv_stats(long *nrec, long *memuse) { - int i; + unsigned i; long mem = 0, count = 0, mem2 = 0, count2 = 0; - Akill *ak; - SXLine *sx; + XLine *x; - count += akills.count; - mem += akills.capacity; - mem += akills.count * sizeof(Akill); + count += SGLine->GetCount(); + mem += SGLine->GetCount() * sizeof(XLine); - for (i = 0; i < akills.count; ++i) + for (i = 0; i < SGLine->GetCount(); ++i) { - ak = static_cast<Akill *>(akills.list[i]); - mem += strlen(ak->user) + 1; - mem += strlen(ak->host) + 1; - mem += strlen(ak->by) + 1; - mem += strlen(ak->reason) + 1; + x = SGLine->GetEntry(i); + + mem += x->GetNick().length() + 1; + mem += x->GetUser().length() + 1; + mem += x->GetHost().length() + 1; + mem += x->Mask.length() + 1; + mem += x->By.length() + 1; + mem += x->Reason.length() + 1; } - if (ircd->sgline) + if (ircd->snline) { - count += sglines.count; - mem += sglines.capacity; - mem += sglines.count * sizeof(SXLine); + count += SNLine->GetCount(); + mem += SNLine->GetCount() * sizeof(XLine); - for (i = 0; i < sglines.count; ++i) + for (i = 0; i < SNLine->GetCount(); ++i) { - sx = static_cast<SXLine *>(sglines.list[i]); - mem += strlen(sx->mask) + 1; - mem += strlen(sx->by) + 1; - mem += strlen(sx->reason) + 1; + x = SNLine->GetEntry(i); + + mem += x->GetNick().length() + 1; + mem += x->GetUser().length() + 1; + mem += x->GetHost().length() + 1; + mem += x->Mask.length() + 1; + mem += x->By.length() + 1; + mem += x->Reason.length() + 1; } } if (ircd->sqline) { - count += sqlines.count; - mem += sqlines.capacity; - mem += sqlines.count * sizeof(SXLine); + count += SQLine->GetCount(); + mem += SGLine->GetCount() * sizeof(XLine); - for (i = 0; i < sqlines.count; ++i) + for (i = 0; i < SQLine->GetCount(); ++i) { - sx = static_cast<SXLine *>(sqlines.list[i]); - mem += strlen(sx->mask) + 1; - mem += strlen(sx->by) + 1; - mem += strlen(sx->reason) + 1; + x = SNLine->GetEntry(i); + + mem += x->GetNick().length() + 1; + mem += x->GetUser().length() + 1; + mem += x->GetHost().length() + 1; + mem += x->Mask.length() + 1; + mem += x->By.length() + 1; + mem += x->Reason.length() + 1; } } if (ircd->szline) { - count += szlines.count; - mem += szlines.capacity; - mem += szlines.count * sizeof(SXLine); - - for (i = 0; i < szlines.count; ++i) + count += SZLine->GetCount(); + mem += SZLine->GetCount() * sizeof(XLine); + + for (i = 0; i < SZLine->GetCount(); ++i) { - sx = static_cast<SXLine *>(szlines.list[i]); - mem += strlen(sx->mask) + 1; - mem += strlen(sx->by) + 1; - mem += strlen(sx->reason) + 1; + x = SZLine->GetEntry(i); + + mem += x->GetNick().length() + 1; + mem += x->GetUser().length() + 1; + mem += x->GetHost().length() + 1; + mem += x->Mask.length() + 1; + mem += x->By.length() + 1; + mem += x->Reason.length() + 1; } } diff --git a/src/core/os_szline.c b/src/core/os_szline.c index b45c5eed2..674b8d7d5 100644 --- a/src/core/os_szline.c +++ b/src/core/os_szline.c @@ -14,24 +14,122 @@ #include "module.h" -int szline_view_callback(SList *slist, int number, void *item, va_list args); -int szline_list_callback(SList *slist, int number, void *item, va_list args); -int szline_view(int number, SXLine *sx, User *u, int *sent_header); -int szline_list(int number, SXLine *sx, User *u, int *sent_header); +class SZLineDelCallback : public NumberList +{ + User *u; + unsigned Deleted; + public: + SZLineDelCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), Deleted(0) + { + } + + ~SZLineDelCallback() + { + if (!Deleted) + notice_lang(Config.s_OperServ, u, OPER_SZLINE_NO_MATCH); + else if (Deleted == 0) + notice_lang(Config.s_OperServ, u, OPER_SZLINE_DELETED_ONE); + else + notice_lang(Config.s_OperServ, u, OPER_SZLINE_DELETED_SEVERAL, Deleted); + } + + void HandleNumber(unsigned Number) + { + XLine *x = SZLine->GetEntry(Number - 1); + + if (!x) + return; + + ++Deleted; + DoDel(u, x); + } + + static void DoDel(User *u, XLine *x) + { + SZLine->DelXLine(x); + } +}; -static int sxline_del_callback(SList *slist, void *item, va_list args) +class SZLineListCallback : public NumberList { - User *u = va_arg(args, User *); - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, static_cast<SXLine *>(item), SX_SZLINE)); - return 1; -} + protected: + User *u; + bool SentHeader; + public: + SZLineListCallback(User *_u, const std::string &numlist) : NumberList(numlist), u(_u), SentHeader(false) + { + } + + ~SZLineListCallback() + { + if (!SentHeader) + notice_lang(Config.s_OperServ, u, OPER_SZLINE_NO_MATCH); + } + + virtual void HandleNumber(unsigned Number) + { + XLine *x = SZLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_FORMAT, Number + 1, x->Mask.c_str(), x->Reason.c_str()); + } +}; + +class SZLineViewCallback : public SZLineListCallback +{ + public: + SZLineViewCallback(User *_u, const std::string &numlist) : SZLineListCallback(_u, numlist) + { + } + + void HandleNumber(unsigned Number) + { + XLine *x = SZLine->GetEntry(Number - 1); + + if (!x) + return; + + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SZLINE_VIEW_HEADER); + } + + DoList(u, x, Number); + } + + static void DoList(User *u, XLine *x, unsigned Number) + { + char timebuf[32], expirebuf[256]; + struct tm tm; + + tm = *localtime(&x->Created); + strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); + expire_left(u->Account(), expirebuf, sizeof(expirebuf), x->Expires); + notice_lang(Config.s_OperServ, u, OPER_SZLINE_VIEW_FORMAT, Number + 1, x->Mask.c_str(), x->By.c_str(), timebuf, +expirebuf, x->Reason.c_str()); + } +}; + class CommandOSSZLine : public Command { private: CommandReturn DoAdd(User *u, const std::vector<ci::string> ¶ms) { - int deleted = 0; unsigned last_param = 2; const char *expiry, *mask; char reason[BUFSIZE]; @@ -70,25 +168,11 @@ class CommandOSSZLine : public Command snprintf(reason, sizeof(reason), "%s%s%s", params[last_param].c_str(), last_param == 2 && params.size() > 3 ? " " : "", last_param == 2 && params.size() > 3 ? params[3].c_str() : ""); if (mask && *reason) { - /* We first do some sanity check on the proposed mask. */ + XLine *x = SZLine->Add(OperServ, u, mask, expires, reason); - if (strchr(mask, '!') || strchr(mask, '@')) - { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_ONLY_IPS); + if (!x) return MOD_CONT; - } - if (strspn(mask, "*?") == strlen(mask)) - { - notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask); - return MOD_CONT; - } - - deleted = add_szline(u, mask, u->nick.c_str(), expires, reason); - if (deleted < 0) - return MOD_CONT; - else if (deleted) - notice_lang(Config.s_OperServ, u, OPER_SZLINE_DELETED_SEVERAL, deleted); notice_lang(Config.s_OperServ, u, OPER_SZLINE_ADDED, mask); if (Config.WallOSSZLine) @@ -136,48 +220,36 @@ class CommandOSSZLine : public Command CommandReturn DoDel(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res = 0; - - mask = params.size() > 1 ? params[1].c_str() : NULL; - - if (!mask) + if (SZLine->GetList().empty()) { - this->OnSyntaxError(u, "DEL"); + notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_EMPTY); return MOD_CONT; } - if (!szlines.count) + const ci::string mask = params.size() > 1 ? params[1].c_str() : ""; + + if (mask.empty()) { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_EMPTY); + this->OnSyntaxError(u, "DEL"); return MOD_CONT; } - if (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask)) - { - /* Deleting a range */ - res = slist_delete_range(&szlines, mask, sxline_del_callback); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_NO_MATCH); - return MOD_CONT; - } - else if (res == 1) - notice_lang(Config.s_OperServ, u, OPER_SZLINE_DELETED_ONE); - else - notice_lang(Config.s_OperServ, u, OPER_SZLINE_DELETED_SEVERAL, res); - } + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SZLineDelCallback(u, mask.c_str()))->Process(); else { - if ((res = slist_indexof(&szlines, const_cast<char *>(mask))) == -1) + XLine *x = SZLine->HasEntry(mask); + + if (!x) { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_NOT_FOUND, mask); + notice_lang(Config.s_OperServ, u, OPER_SZLINE_NOT_FOUND, mask.c_str()); return MOD_CONT; } - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, static_cast<SXLine *>(szlines.list[res]), SX_SZLINE)); - slist_delete(&szlines, res); - notice_lang(Config.s_OperServ, u, OPER_SZLINE_DELETED, mask); + FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, x, X_SZLINE)); + + SZLineDelCallback::DoDel(u, x); + notice_lang(Config.s_OperServ, u, OPER_SZLINE_DELETED, mask.c_str()); } if (readonly) @@ -188,39 +260,37 @@ class CommandOSSZLine : public Command CommandReturn DoList(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res, sent_header = 0; - - if (!szlines.count) + if (SZLine->GetList().empty()) { notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_EMPTY); return MOD_CONT; } - mask = params.size() > 1 ? params[1].c_str() : NULL; + const ci::string mask = params.size() > 1 ? params[1] : ""; - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&szlines, mask, &szline_list_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_NO_MATCH); - return MOD_CONT; - } - } + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SZLineListCallback(u, mask.c_str()))->Process(); else { - int i; - char *amask; + bool SentHeader = false; - for (i = 0; i < szlines.count; ++i) + for (unsigned i = 0; i < SZLine->GetCount(); ++i) { - amask = (static_cast<SXLine *>(szlines.list[i]))->mask; - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - szline_list(i + 1, static_cast<SXLine *>(szlines.list[i]), u, &sent_header); + XLine *x = SZLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_HEADER); + } + + SZLineListCallback::DoList(u, x, i); + } } - if (!sent_header) + if (!SentHeader) notice_lang(Config.s_OperServ, u, OPER_SZLINE_NO_MATCH); } @@ -229,39 +299,37 @@ class CommandOSSZLine : public Command CommandReturn DoView(User *u, const std::vector<ci::string> ¶ms) { - const char *mask; - int res, sent_header = 0; - - if (!szlines.count) + if (SZLine->GetList().empty()) { notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_EMPTY); return MOD_CONT; } - mask = params.size() > 1 ? params[1].c_str() : NULL; + const ci::string mask = params.size() > 1 ? params[1] : ""; - if (!mask || (isdigit(*mask) && strspn(mask, "1234567890,-") == strlen(mask))) - { - res = slist_enum(&szlines, mask, &szline_view_callback, u, &sent_header); - if (!res) - { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_NO_MATCH); - return MOD_CONT; - } - } + if (!mask.empty() && isdigit(mask[0]) && strspn(mask.c_str(), "1234567890,-") == mask.length()) + (new SZLineViewCallback(u, mask.c_str()))->Process(); else { - int i; - char *amask; + bool SentHeader = false; - for (i = 0; i < szlines.count; ++i) + for (unsigned i = 0; i < SZLine->GetCount(); ++i) { - amask = (static_cast<SXLine *>(szlines.list[i]))->mask; - if (!stricmp(mask, amask) || Anope::Match(amask, mask, false)) - szline_view(i + 1, static_cast<SXLine *>(szlines.list[i]), u, &sent_header); + XLine *x = SZLine->GetEntry(i); + + if (mask.empty() || (mask == x->Mask || Anope::Match(x->Mask, mask))) + { + if (!SentHeader) + { + SentHeader = true; + notice_lang(Config.s_OperServ, u, OPER_SZLINE_VIEW_HEADER); + } + + SZLineViewCallback::DoList(u, x, i); + } } - if (!sent_header) + if (!SentHeader) notice_lang(Config.s_OperServ, u, OPER_SZLINE_NO_MATCH); } @@ -270,8 +338,8 @@ class CommandOSSZLine : public Command CommandReturn DoClear(User *u) { - FOREACH_MOD(I_OnDelSXLine, OnDelSXLine(u, NULL, SX_SZLINE)); - slist_clear(&szlines, 1); + FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, NULL, X_SZLINE)); + SZLine->Clear(); notice_lang(Config.s_OperServ, u, OPER_SZLINE_CLEAR); return MOD_CONT; @@ -334,61 +402,4 @@ class OSSZLine : public Module } }; -int szline_view(int number, SXLine *sx, User *u, int *sent_header) -{ - char timebuf[32], expirebuf[256]; - struct tm tm; - - if (!sx) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_VIEW_HEADER); - *sent_header = 1; - } - - tm = *localtime(&sx->seton); - strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm); - expire_left(u->Account(), expirebuf, sizeof(expirebuf), sx->expires); - notice_lang(Config.s_OperServ, u, OPER_SZLINE_VIEW_FORMAT, number, sx->mask, sx->by, timebuf, expirebuf, sx->reason); - - return 1; -} - -/* Callback for enumeration purposes */ -int szline_view_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return szline_view(number, static_cast<SXLine *>(item), u, sent_header); -} - -/* Callback for enumeration purposes */ -int szline_list_callback(SList *slist, int number, void *item, va_list args) -{ - User *u = va_arg(args, User *); - int *sent_header = va_arg(args, int *); - - return szline_list(number, static_cast<SXLine *>(item), u, sent_header); -} - -/* Lists an SZLINE entry, prefixing it with the header if needed */ -int szline_list(int number, SXLine *sx, User *u, int *sent_header) -{ - if (!sx) - return 0; - - if (!*sent_header) - { - notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_HEADER); - *sent_header = 1; - } - - notice_lang(Config.s_OperServ, u, OPER_SZLINE_LIST_FORMAT, number, sx->mask, sx->reason); - - return 1; -} - MODULE_INIT(OSSZLine) diff --git a/src/hostserv.c b/src/hostserv.c index ec46cdc86..9d7362903 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -177,9 +177,9 @@ void HostServSyncVhosts(NickAlias *na) if (!na || !na->hostinfo.HasVhost()) return; - for (int i = 0; i < na->nc->aliases.count; i++) + for (std::list<NickAlias *>::iterator it = na->nc->aliases.begin(); it != na->nc->aliases.end(); ++it) { - NickAlias *nick = static_cast<NickAlias *>(na->nc->aliases.list[i]); + NickAlias *nick = *it; nick->hostinfo.SetVhost(na->hostinfo.GetIdent(), na->hostinfo.GetHost(), na->hostinfo.GetCreator()); } } diff --git a/src/init.c b/src/init.c index faa37764b..2c2a64ed4 100644 --- a/src/init.c +++ b/src/init.c @@ -43,7 +43,8 @@ void introduce_user(const std::string &user) if (user.empty() || ci_bi_nick == user) { ircdproto->SendClientIntroduction(bi->nick, bi->user, bi->host, bi->real, ircd->pseudoclient_mode, bi->uid); - ircdproto->SendSQLine(bi->nick, "Reserved for services"); + XLine x(bi->nick.c_str(), "Reserved for services"); + ircdproto->SendSQLine(&x); } } } diff --git a/src/main.c b/src/main.c index 8b95d4a2c..d4746cf93 100644 --- a/src/main.c +++ b/src/main.c @@ -155,16 +155,6 @@ extern void expire_all() expire_nicks(); expire_chans(); expire_requests(); - expire_akills(); - if (ircd->sgline) { - expire_sglines(); - } - if (ircd->sqline) { - expire_sqlines(); - } - if (ircd->szline) { - expire_szlines(); - } expire_exceptions(); FOREACH_MOD(I_OnDatabaseExpire, OnDatabaseExpire()); diff --git a/src/memoserv.c b/src/memoserv.c index 11121cee3..4d33bde3e 100644 --- a/src/memoserv.c +++ b/src/memoserv.c @@ -272,7 +272,6 @@ void memo_send(User * u, const char *name, const char *text, int z) if (z == 0 || z == 3) notice_lang(Config.s_MemoServ, u, MEMO_SENT, name); if (!ischan) { - NickAlias *na; NickCore *nc = (findnick(name))->nc; FOREACH_MOD(I_OnMemoSend, OnMemoSend(u, nc, m)); @@ -280,10 +279,10 @@ void memo_send(User * u, const char *name, const char *text, int z) if (Config.MSNotifyAll) { if ((nc->HasFlag(NI_MEMO_RECEIVE)) && get_ignore(name) == NULL) { - int i; - for (i = 0; i < nc->aliases.count; i++) { - na = static_cast<NickAlias *>(nc->aliases.list[i]); + for (std::list<NickAlias *>::iterator it = nc->aliases.begin(); it != nc->aliases.end(); ++it) + { + NickAlias *na = *it; User *user = finduser(na->nick); if (user && user->IsIdentified()) notice_lang(Config.s_MemoServ, user, diff --git a/src/misc.c b/src/misc.c index d7060660e..22ea81432 100644 --- a/src/misc.c +++ b/src/misc.c @@ -226,6 +226,7 @@ const char *merge_args(int argc, char **argv) NumberList::NumberList(const std::string &list) { + char *error; commasepstream sep(list); std::string token; @@ -238,9 +239,8 @@ NumberList::NumberList(const std::string &list) if (!h) { - errno = 0; - unsigned num = strtol(token.c_str(), NULL, 10); - if (!errno) + unsigned num = strtol(token.c_str(), &error, 10); + if (*error == '\0') { numbers.insert(num); } @@ -255,11 +255,11 @@ NumberList::NumberList(const std::string &list) } else { + char *error2; *h++ = '\0'; - errno = 0; - unsigned num1 = strtol(token.c_str(), NULL, 10); - unsigned num2 = strtol(h, NULL, 10); - if (!errno) + unsigned num1 = strtol(token.c_str(), &error, 10); + unsigned num2 = strtol(h, &error2, 10); + if (*error == '\0' && *error2 == '\0') { for (unsigned i = num1; i <= num2; ++i) { diff --git a/src/modules/mysql/db_mysql_read.cpp b/src/modules/mysql/db_mysql_read.cpp index 1b4ce33fa..3c5fb359a 100644 --- a/src/modules/mysql/db_mysql_read.cpp +++ b/src/modules/mysql/db_mysql_read.cpp @@ -620,42 +620,51 @@ static void LoadDatabase() query << "SELECT * FROM `anope_os_akills`"; qres = StoreQuery(query); - if (qres) + if (qres && SGLine) { for (size_t i = 0; i < qres.size(); ++i) { - Akill *ak = new Akill; - ak->user = sstrdup(qres[i]["user"].c_str()); - ak->host = sstrdup(qres[i]["host"].c_str()); - ak->by = sstrdup(qres[i]["xby"].c_str()); - ak->reason = sstrdup(qres[i]["reason"].c_str()); - ak->seton = atol(qres[i]["seton"].c_str()); - ak->expires = atol(qres[i]["expire"].c_str()); - slist_add(&akills, ak); + ci::string user = qres[i]["user"].c_str(); + ci::string host = qres[i]["host"].c_str(); + ci::string by = qres[i]["xby"].c_str(); + std::string reason = SQLAssign(qres[i]["reason"]); + time_t seton = atol(qres[i]["seton"].c_str()); + time_t expires = atol(qres[i]["expire"].c_str()); + + XLine *x = SGLine->Add(NULL, NULL, user + "@" + host, expires, reason); + if (x) + { + x->By = by; + x->Created = seton; + } } } - query << "SELECT * FROM `anope_os_sxlines`"; + query << "SELECT * FROM `anope_os_xlines`"; qres = StoreQuery(query); if (qres) { for (size_t i = 0; i < qres.size(); ++i) { - SXLine *sx = new SXLine; - sx->mask = sstrdup(qres[i]["mask"].c_str()); - sx->by = sstrdup(qres[i]["xby"].c_str()); - sx->reason = sstrdup(qres[i]["reason"].c_str()); - sx->seton = atol(qres[i]["seton"].c_str()); - sx->expires = atol(qres[i]["expires"].c_str()); - if (qres[i]["type"] == "SGLINE") - slist_add(&sglines, sx); - else if (qres[i]["type"] == "SQLINE") - slist_add(&sqlines, sx); - else if (qres[i]["type"] == "SZLINE") - slist_add(&szlines, sx); - else - delete sx; + ci::string mask = qres[i]["mask"].c_str(); + ci::string by = qres[i]["xby"].c_str(); + std::string reason = SQLAssign(qres[i]["reason"]); + time_t seton = atol(qres[i]["seton"].c_str()); + time_t expires = atol(qres[i]["expires"].c_str()); + + XLine *x = NULL; + if (qres[i]["type"] == "SNLINE" && SNLine) + x = SNLine->Add(NULL, NULL, mask, expires, reason); + else if (qres[i]["type"] == "SQLINE" && SQLine) + x = SQLine->Add(NULL, NULL, mask, expires, reason); + else if (qres[i]["type"] == "SZLINE" && SZLine) + x = SZLine->Add(NULL, NULL,mask, expires, reason); + if (x) + { + x->By = by; + x->Created = seton; + } } } } diff --git a/src/modules/mysql/db_mysql_write.cpp b/src/modules/mysql/db_mysql_write.cpp index 1888195f3..427be43bd 100644 --- a/src/modules/mysql/db_mysql_write.cpp +++ b/src/modules/mysql/db_mysql_write.cpp @@ -235,9 +235,7 @@ static void SaveDatabases() for (nickalias_map::const_iterator it = NickAliasList.begin(); it != NickAliasList.end(); ++it) { - NickAlias *na = it->second; - - me->OnNickRegister(na); + me->OnNickRegister(it->second); } query << "TRUNCATE TABLE `anope_ns_core`"; @@ -269,8 +267,7 @@ static void SaveDatabases() for (botinfo_map::const_iterator it = BotList.begin(); it != BotList.end(); ++it) { - BotInfo *bi = it->second; - me->OnBotCreate(bi); + me->OnBotCreate(it->second); } query << "TRUNCATE TABLE `anope_cs_info`"; @@ -311,7 +308,7 @@ static void SaveDatabases() me->OnAkickAdd(NULL, ci, ak); } - + for (int k = 0; k < CA_SIZE; ++k) { query << "INSERT DELAYED INTO `anope_cs_levels` (channel, position, level) VALUES(" << mysqlpp::quote << ci->name << ", '" << k << "', '" << ci->levels[k] << "') ON DUPLICATE KEY UPDATE position=VALUES(position), level=VALUES(level)"; @@ -334,32 +331,36 @@ static void SaveDatabases() me->OnMakeNickRequest(it->second); } - for (int i = 0; i < akills.count; ++i) + if (SGLine) { - Akill *ak = static_cast<Akill *>(akills.list[i]); - - me->OnAddAkill(NULL, ak); + for (unsigned i = 0; i < SGLine->GetCount(); ++i) + { + me->OnAddAkill(NULL, SGLine->GetEntry(i)); + } } - for (int i = 0; i < sglines.count; ++i) + if (SZLine) { - SXLine *x = static_cast<SXLine *>(sglines.list[i]); - - me->OnAddSXLine(NULL, x, SX_SGLINE); + for (unsigned i = 0; i < SZLine->GetCount(); ++i) + { + me->OnAddXLine(NULL, SZLine->GetEntry(i), X_SZLINE); + } } - for (int i = 0; i < sqlines.count; ++i) + if (SQLine) { - SXLine *x = static_cast<SXLine *>(sqlines.list[i]); - - me->OnAddSXLine(NULL, x, SX_SQLINE); + for (unsigned i = 0; i < SQLine->GetCount(); ++i) + { + me->OnAddXLine(NULL, SQLine->GetEntry(i), X_SQLINE); + } } - for (int i = 0; i < szlines.count; ++i) + if (SNLine) { - SXLine *x = static_cast<SXLine *>(szlines.list[i]); - - me->OnAddSXLine(NULL, x, SX_SZLINE); + for (unsigned i = 0; i < SNLine->GetCount(); ++i) + { + me->OnAddXLine(NULL, SNLine->GetEntry(i), X_SNLINE); + } } for (int i = 0; i < nexceptions; ++i) @@ -433,7 +434,7 @@ class DBMySQLWrite : public DBMySQL I_OnMemoSend, I_OnMemoDel, /* OperServ */ I_OnOperServHelp, I_OnAddAkill, I_OnDelAkill, I_OnExceptionAdd, I_OnExceptionDel, - I_OnAddSXLine, I_OnDelSXLine + I_OnAddXLine, I_OnDelXLine }; ModuleManager::Attach(i, this, 40); } @@ -450,7 +451,7 @@ class DBMySQLWrite : public DBMySQL query << "TRUNCATE TABLE `anope_os_core`"; ExecuteQuery(query); query << "INSERT DELAYED INTO `anope_os_core` (maxusercnt, maxusertime, akills_count, sglines_count, sqlines_count, szlines_count) VALUES("; - query << maxusercnt << ", " << maxusertime << ", " << akills.count << ", " << sqlines.count << ", " << sglines.count << ", " << szlines.count << ")"; + query << maxusercnt << ", " << maxusertime << ", " << (SGLine ? SGLine->GetCount() : 0) << ", " << (SQLine ? SQLine->GetCount() : 0) << ", " << (SNLine ? SNLine->GetCount() : 0) << ", " << (SZLine ? SZLine->GetCount() : 0) << ")"; ExecuteQuery(query); for (nickcore_map::const_iterator it = NickCoreList.begin(); it != NickCoreList.end(); ++it) @@ -1028,21 +1029,21 @@ class DBMySQLWrite : public DBMySQL ExecuteQuery(query); } - EventReturn OnAddAkill(User *, Akill *ak) + EventReturn OnAddAkill(User *, XLine *ak) { mysqlpp::Query query(me->Con); query << "INSERT DELAYED INTO `anope_os_akills` (user, host, xby, reason, seton, expire) VALUES("; - query << mysqlpp::quote << ak->user << ", " << mysqlpp::quote << ak->host << ", " << mysqlpp::quote << ak->by; - query << ", " << mysqlpp::quote << ak->reason << ", " << ak->seton << ", " << ak->expires << ")"; + query << mysqlpp::quote << ak->GetUser().c_str() << ", " << mysqlpp::quote << ak->GetHost().c_str() << ", " << mysqlpp::quote << ak->By.c_str(); + query << ", " << mysqlpp::quote << ak->Reason << ", " << ak->Created << ", " << ak->Expires << ")"; ExecuteQuery(query); return EVENT_CONTINUE; } - void OnDelAkill(User *, Akill *ak) + void OnDelAkill(User *, XLine *ak) { mysqlpp::Query query(me->Con); if (ak) - query << "DELETE FROM `anope_os_akills` WHERE `host` = " << mysqlpp::quote << ak->host; + query << "DELETE FROM `anope_os_akills` WHERE `host` = " << mysqlpp::quote << ak->GetHost().c_str(); else query << "TRUNCATE TABLE `anope_os_akills`"; ExecuteQuery(query); @@ -1065,27 +1066,27 @@ class DBMySQLWrite : public DBMySQL ExecuteQuery(query); } - EventReturn OnAddSXLine(User *, SXLine *sx, SXLineType Type) + EventReturn OnAddXLine(User *, XLine *x, XLineType Type) { mysqlpp::Query query(me->Con); query << "INSERT DELAYED INTO `anope_os_sxlines` (type, mask, xby, reason, seton, expire) VALUES('"; - query << (Type == SX_SGLINE ? "SGLINE" : (Type == SX_SQLINE ? "SQLINE" : "SZLINE")) << "', "; - query << mysqlpp::quote << sx->mask << ", " << mysqlpp::quote << sx->by << ", " << mysqlpp::quote << sx->reason; - query << ", " << sx->seton << ", " << sx->expires << ")"; + query << (Type == X_SNLINE ? "SNLINE" : (Type == X_SQLINE ? "SQLINE" : "SZLINE")) << "', "; + query << mysqlpp::quote << x->Mask.c_str() << ", " << mysqlpp::quote << x->By.c_str() << ", " << mysqlpp::quote << x->Reason; + query << ", " << x->Created << ", " << x->Expires << ")"; ExecuteQuery(query); return EVENT_CONTINUE; } - void OnDelSXLine(User *, SXLine *sx, SXLineType Type) + void OnDelXLine(User *, XLine *x, XLineType Type) { mysqlpp::Query query(me->Con); - if (sx) + if (x) { - query << "DELETE FROM `anope_os_sxlines` WHERE `mask` = " << mysqlpp::quote << sx->mask << " AND `type` = '"; - query << (Type == SX_SGLINE ? "SGLINE" : (Type == SX_SQLINE ? "SQLINE" : "SZLINE")) << "'"; + query << "DELETE FROM `anope_os_xlines` WHERE `mask` = " << mysqlpp::quote << x->Mask.c_str() << " AND `type` = '"; + query << (Type == X_SNLINE ? "SNLINE" : (Type == X_SQLINE ? "SQLINE" : "SZLINE")) << "'"; } else - query << "DELETE FROM `anope_os_sxlines` WHERE `type` = '" << (Type == SX_SGLINE ? "SGLINE" : (Type == SX_SQLINE ? "SQLINE" : "SZLINE")) << "'"; + query << "DELETE FROM `anope_os_xlines` WHERE `type` = '" << (Type == X_SNLINE ? "SNLINE" : (Type == X_SQLINE ? "SQLINE" : "SZLINE")) << "'"; ExecuteQuery(query); } }; diff --git a/src/nickalias.cpp b/src/nickalias.cpp index 95d5bc4e9..a196145b9 100644 --- a/src/nickalias.cpp +++ b/src/nickalias.cpp @@ -42,7 +42,7 @@ NickAlias::NickAlias(const std::string &nickname, NickCore *nickcore) this->nick = sstrdup(nickname.c_str()); this->nc = nickcore; - slist_add(&nc->aliases, this); + nc->aliases.push_back(this); NickAliasList[this->nick] = this; @@ -88,8 +88,12 @@ NickAlias::~NickAlias() if (this->nc) { /* Next: see if our core is still useful. */ - slist_remove(&this->nc->aliases, this); - if (this->nc->aliases.count == 0) + std::list<NickAlias *>::iterator it = std::find(this->nc->aliases.begin(), this->nc->aliases.end(), this); + if (it != this->nc->aliases.end()) + { + nc->aliases.erase(it); + } + if (this->nc->aliases.empty()) { delete this->nc; this->nc = NULL; diff --git a/src/nickcore.cpp b/src/nickcore.cpp index 3becf8ab4..cf92b0b3d 100644 --- a/src/nickcore.cpp +++ b/src/nickcore.cpp @@ -16,7 +16,6 @@ NickCore::NickCore(const std::string &coredisplay) lastmail = 0; this->display = sstrdup(coredisplay.c_str()); - slist_init(&this->aliases); /* Set default nick core flags */ for (size_t t = NI_BEGIN + 1; t != NI_END; ++t) diff --git a/src/nickserv.c b/src/nickserv.c index be1ed5470..c3b3d31c6 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -148,7 +148,7 @@ void get_core_stats(long *nrec, long *memuse) mem += strlen(nc->memos.memos[j]->text) + 1; } - mem += sizeof(void *) * nc->aliases.count; + mem += sizeof(NickAlias *) * nc->aliases.size(); } *nrec = count; *memuse = mem; @@ -485,9 +485,9 @@ void change_core_display(NickCore * nc, const char *newdisplay) void change_core_display(NickCore * nc) { NickAlias *na; - if (nc->aliases.count <= 0) + if (nc->aliases.empty()) return; - na = static_cast<NickAlias *>(nc->aliases.list[0]); + na = nc->aliases.front(); change_core_display(nc,na->nick); } diff --git a/src/operserv.c b/src/operserv.c index fda5f5fd8..c8432b9f9 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -15,27 +15,10 @@ #include "modules.h" #include "language.h" -/*************************************************************************/ - -/* AKILL, SGLINE, SQLINE and SZLINE lists */ -SList akills, sglines, sqlines, szlines; - -/*************************************************************************/ - -static int is_akill_entry_equal(SList * slist, void *item1, void *item2); -static void free_akill_entry(SList * slist, void *item); -static int is_sgline_entry_equal(SList * slist, void *item1, void *item2); -static void free_sgline_entry(SList * slist, void *item); -static int is_sqline_entry_equal(SList * slist, void *item1, void *item2); -static void free_sqline_entry(SList * slist, void *item); -static int is_szline_entry_equal(SList * slist, void *item1, void *item2); -static void free_szline_entry(SList * slist, void *item); - -/* News items */ std::vector<NewsItem *> News; std::vector<std::bitset<32> > DefCon; -int DefConModesSet = 0; +bool DefConModesSet = false; /* Defcon modes mlocked on */ Flags<ChannelModeName> DefConModesOn; /* Defcon modes mlocked off */ @@ -43,20 +26,53 @@ Flags<ChannelModeName> DefConModesOff; /* Map of Modesa and Params for DefCon */ std::map<ChannelModeName, std::string> DefConModesOnParams; +XLineManager *SGLine, *SZLine, *SQLine, *SNLine; + +void os_init() +{ + ModuleManager::LoadModuleList(Config.OperServCoreModules); + + /* Yes, these are in this order for a reason. Most violent->least violent. */ + XLineManager::RegisterXLineManager(SGLine = new SGLineManager()); + XLineManager::RegisterXLineManager(SZLine = new SZLineManager()); + XLineManager::RegisterXLineManager(SQLine = new SQLineManager()); + XLineManager::RegisterXLineManager(SNLine = new SNLineManager()); +} + +void operserv(User * u, char *buf) +{ + const char *cmd, *s; + + Alog() << Config.s_OperServ << ": " << u->nick << ": " << buf; + + cmd = strtok(buf, " "); + if (!cmd) + return; + else if (!stricmp(cmd, "\1PING")) { + if (!(s = strtok(NULL, ""))) { + s = ""; + } + ircdproto->SendCTCP(OperServ, u->nick.c_str(), "PING %s", s); + } + else { + mod_run_cmd(OperServ, u, cmd); + } +} + bool SetDefConParam(ChannelModeName Name, std::string &buf) { return DefConModesOnParams.insert(std::make_pair(Name, buf)).second; } -bool GetDefConParam(ChannelModeName Name, std::string *buf) +bool GetDefConParam(ChannelModeName Name, std::string &buf) { std::map<ChannelModeName, std::string>::iterator it = DefConModesOnParams.find(Name); - buf->clear(); + buf.clear(); if (it != DefConModesOnParams.end()) { - *buf = it->second; + buf = it->second; return true; } @@ -73,83 +89,44 @@ void UnsetDefConParam(ChannelModeName Name) } } -/*************************************************************************/ - -void moduleAddOperServCmds(); -/*************************************************************************/ - -/* Options for the lists */ -SListOpts akopts = { 0, NULL, &is_akill_entry_equal, &free_akill_entry }; - -SListOpts sgopts = { 0, NULL, &is_sgline_entry_equal, &free_sgline_entry }; -SListOpts sqopts = - { SLISTF_SORT, NULL, &is_sqline_entry_equal, &free_sqline_entry }; -SListOpts szopts = { 0, NULL, &is_szline_entry_equal, &free_szline_entry }; - -/*************************************************************************/ -/* *INDENT-OFF* */ -void moduleAddOperServCmds() { - ModuleManager::LoadModuleList(Config.OperServCoreModules); +/** Check if a certain defcon option is currently in affect + * @param Level The level + * @return true and false + */ +bool CheckDefCon(DefconLevel Level) +{ + if (Config.DefConLevel) + return DefCon[Config.DefConLevel][Level]; + return false; } -/* *INDENT-ON* */ -/*************************************************************************/ -/*************************************************************************/ - -/* OperServ initialization. */ - -void os_init() +/** Check if a certain defcon option is in a certain defcon level + * @param level The defcon level + * @param Level The defcon level name + * @return true or false + */ +bool CheckDefCon(int level, DefconLevel Level) { - moduleAddOperServCmds(); - - slist_init(&akills); - akills.opts = &akopts; - - if (ircd->sgline) { - slist_init(&sglines); - sglines.opts = &sgopts; - } - if (ircd->sqline) { - slist_init(&sqlines); - sqlines.opts = &sqopts; - } - if (ircd->szline) { - slist_init(&szlines); - szlines.opts = &szopts; - } + return DefCon[level][Level]; } -/*************************************************************************/ - -/* Main OperServ routine. */ - -void operserv(User * u, char *buf) +/** Add a defcon level option to a defcon level + * @param level The defcon level + * @param Level The defcon level option + */ +void AddDefCon(int level, DefconLevel Level) { - const char *cmd; - const char *s; - - Alog() << Config.s_OperServ << ": " << u->nick << ": " << buf; - - cmd = strtok(buf, " "); - if (!cmd) { - return; - } else if (stricmp(cmd, "\1PING") == 0) { - if (!(s = strtok(NULL, ""))) { - s = ""; - } - ircdproto->SendCTCP(OperServ, u->nick.c_str(), "PING %s", s); - } else { - mod_run_cmd(OperServ, u, cmd); - } + DefCon[level][Level] = true; } -/*************************************************************************/ -/*********************** OperServ command functions **********************/ -/******************************* - * ******************************************/ - -/*************************************************************************/ - +/** Remove a defcon level option from a defcon level + * @param level The defcon level + * @param Level The defcon level option + */ +void DelDefCon(int level, DefconLevel Level) +{ + DefCon[level][Level] = false; +} void server_global(Server *s, const std::string &message) { @@ -175,7 +152,6 @@ void oper_global(char *nick, const char *fmt, ...) vsnprintf(msg, sizeof(msg), fmt, args); va_end(args); - /* I don't like the way this is coded... */ if (nick && !Config.AnonymousGlobal) { std::string rmsg = std::string("[") + nick + std::string("] ") + msg; @@ -188,868 +164,665 @@ void oper_global(char *nick, const char *fmt, ...) /**************************************************************************/ -/* 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. - */ +/* List of XLine managers we check users against in XLineManager::CheckAll */ +std::list<XLineManager *> XLineManager::XLineManagers; -int add_akill(User * u, const char *mask, const char *by, const time_t expires, - const char *reason) +XLine::XLine(const ci::string &mask, const std::string &reason) : Mask(mask), Reason(reason) { - int deleted = 0, i; - char *user, *mask2, *host; - Akill *entry; + Expires = Created = 0; +} - if (!mask) { - return -1; - } +XLine::XLine(const ci::string &mask, const ci::string &by, const time_t expires, const std::string &reason) : Mask(mask), By(by), Created(time(NULL)), Expires(expires), Reason(reason) +{ +} - /* Checks whether there is an AKILL that already covers - * the one we want to add, and whether there are AKILLs - * that would be covered by this one. The masks AND the - * expiry times are used to determine this, because some - * AKILLs may become useful when another one expires. - * If so, warn the user in the first case and cleanup - * the useless AKILLs in the second. - */ - - if (akills.count > 0) { - - for (i = akills.count - 1; i >= 0; i--) { - char amask[BUFSIZE]; - - entry = static_cast<Akill *>(akills.list[i]); - - if (!entry) - continue; - - snprintf(amask, sizeof(amask), "%s@%s", entry->user, - entry->host); - - if (!stricmp(amask, mask)) { - /* We change the AKILL expiry time if its current one is less than the new. - * This is preferable to be sure we don't change an important AKILL - * accidentely. - */ - if (entry->expires >= expires || entry->expires == 0) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_AKILL_EXISTS, - mask); - return -1; - } else { - entry->expires = expires; - if (u) - notice_lang(Config.s_OperServ, u, OPER_AKILL_CHANGED, - amask); - return -2; - } - } +ci::string XLine::GetNick() const +{ + size_t nick_t = Mask.find('!'); - if (Anope::Match(mask, amask, false) - && (entry->expires >= expires || entry->expires == 0)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_AKILL_ALREADY_COVERED, - mask, amask); - return -1; - } + if (nick_t == ci::string::npos) + return ""; - if (Anope::Match(amask, mask, false) - && (entry->expires <= expires || expires == 0)) { - slist_delete(&akills, i); - deleted++; - } - } + return Mask.substr(0, nick_t - 1); +} - } +ci::string XLine::GetUser() const +{ + size_t user_t = Mask.find('!'), host_t = Mask.find('@'); - /* We can now check whether the list is full or not. */ - if (slist_full(&akills)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_AKILL_REACHED_LIMIT, - akills.limit); - return -1; + if (user_t == ci::string::npos) + { + return Mask.substr(0, host_t); } - - /* We can now (really) add the AKILL. */ - mask2 = sstrdup(mask); - host = strchr(mask2, '@'); - - if (!host) { - delete [] mask2; - return -1; + else if (host_t != ci::string::npos) + { + return Mask.substr((user_t != ci::string::npos ? user_t + 1 : 0), host_t); } - - user = mask2; - *host = 0; - host++; - - entry = new Akill; - - if (!entry) { - delete [] mask2; - return -1; + else + { + return ""; } +} - entry->user = sstrdup(user); - entry->host = sstrdup(host); - entry->by = sstrdup(by); - entry->reason = sstrdup(reason); - entry->seton = time(NULL); - entry->expires = expires; +ci::string XLine::GetHost() const +{ + size_t host_t = Mask.find('@'); - EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnAddAkill, OnAddAkill(u, entry)); - if (MOD_RESULT == EVENT_STOP) + if (host_t == ci::string::npos) { - delete entry; - return -1; + return Mask; + } + else + { + return Mask.substr(host_t + 1); } - - slist_add(&akills, entry); - - if (Config.AkillOnAdd) - ircdproto->SendAkill(entry); - - delete [] mask2; - - return deleted; } -/* Does the user match any AKILLs? */ +/** Constructor + */ +XLineManager::XLineManager() +{ +} -int check_akill(const char *nick, const char *username, const char *host, - const char *vhost, const char *ip) +/** Destructor + * Clears all XLines in this XLineManager + */ +XLineManager::~XLineManager() { - int i; - Akill *ak; + Clear(); +} - if (akills.count == 0) - return 0; + /** Register a XLineManager, places it in XLineManagers for use in XLineManager::CheckAll + * It is important XLineManagers are registered in the proper order. Eg, if you had one akilling + * clients and one handing them free olines, you would want the akilling one first. This way if a client + * matches an entry on both of the XLineManagers, they would be akilled. + * @param xlm THe XLineManager + */ +void XLineManager::RegisterXLineManager(XLineManager *xlm) +{ + XLineManagers.push_back(xlm); +} - for (i = 0; i < akills.count; i++) { - ak = static_cast<Akill *>(akills.list[i]); - if (!ak) - continue; - if (Anope::Match(username, ak->user, false) - && Anope::Match(host, ak->host, false)) { - ircdproto->SendAkill(ak); - return 1; - } - if (ircd->vhost) { - if (vhost) { - if (Anope::Match(username, ak->user, false) - && Anope::Match(vhost, ak->host, false)) { - ircdproto->SendAkill(ak); - return 1; - } - } - } - if (ircd->nickip) { - if (ip) { - if (Anope::Match(username, ak->user, false) - && Anope::Match(ip, ak->host, false)) { - ircdproto->SendAkill(ak); - return 1; - } - } - } +/** Unregister a XLineManager + * @param xlm The XLineManager + */ +void XLineManager::UnregisterXLineManager(XLineManager *xlm) +{ + std::list<XLineManager *>::iterator it = std::find(XLineManagers.begin(), XLineManagers.end(), xlm); + if (it != XLineManagers.end()) + { + XLineManagers.erase(it); } - - return 0; } -/* Delete any expired autokills. */ - -void expire_akills() +/* Check a user against all known XLineManagers + * @param u The user + * @return A pair of the XLineManager the user was found in and the XLine they matched, both may be NULL for no match + */ +std::pair<XLineManager *, XLine *> XLineManager::CheckAll(User *u) { - int i; - time_t now = time(NULL); - Akill *ak; + std::pair<XLineManager *, XLine *> ret(NULL, NULL); - for (i = akills.count - 1; i >= 0; i--) { - ak = static_cast<Akill *>(akills.list[i]); + for (std::list<XLineManager *>::iterator it = XLineManagers.begin(); it != XLineManagers.end(); ++it) + { + XLineManager *xlm = *it; - if (!ak->expires || ak->expires > now) - continue; + XLine *x = xlm->Check(u); - if (Config.WallAkillExpire) - ircdproto->SendGlobops(OperServ, "AKILL on %s@%s has expired", - ak->user, ak->host); - slist_delete(&akills, i); + if (x) + { + ret.first = xlm; + ret.second = x;; + break; + } } + + return ret; } -static void free_akill_entry(SList * slist, void *item) +/** Get the number of XLines in this XLineManager + * @return The number of XLines + */ +const size_t XLineManager::GetCount() const { - Akill *ak = static_cast<Akill *>(item); - - /* Remove the AKILLs from all the servers */ - ircdproto->SendAkillDel(ak); + return XLines.size(); +} - /* Free the structure */ - delete [] ak->user; - delete [] ak->host; - delete [] ak->by; - delete [] ak->reason; - delete ak; +/** Get the XLine list + * @return The list + */ +const std::deque<XLine *>& XLineManager::GetList() const +{ + return XLines; } -/* item1 is not an Akill pointer, but a char +/** Add an entry to this XLineManager + * @param x The entry */ - -static int is_akill_entry_equal(SList * slist, void *item1, void *item2) +void XLineManager::AddXLine(XLine *x) { - char *ak1 = static_cast<char *>(item1), buf[BUFSIZE]; - Akill *ak2 = static_cast<Akill *>(item2); - - if (!ak1 || !ak2) - return 0; - - snprintf(buf, sizeof(buf), "%s@%s", ak2->user, ak2->host); - - if (!stricmp(ak1, buf)) - return 1; - else - return 0; + XLines.push_back(x); } - -/*************************************************************************/ - -/* Adds an SGLINE to the list. Returns >= 0 on success, -1 if it failed, -2 if - * only the expiry time changed. - * The success result is the number of SGLINEs that were deleted to successfully add one. +/** Delete an entry from this XLineManager + * @param x The entry + * @return true if the entry was found and deleted, else false */ - -int add_sgline(User * u, const char *mask, const char *by, time_t expires, - const char *reason) +bool XLineManager::DelXLine(XLine *x) { - int deleted = 0, i; - SXLine *entry; - - /* Checks whether there is an SGLINE that already covers - * the one we want to add, and whether there are SGLINEs - * that would be covered by this one. - * If so, warn the user in the first case and cleanup - * the useless SGLINEs in the second. - */ - - if (!mask) { - return -1; - } + std::deque<XLine *>::iterator it = std::find(XLines.begin(), XLines.end(), x); - if (sglines.count > 0) { - - for (i = sglines.count - 1; i >= 0; i--) { - entry = static_cast<SXLine *>(sglines.list[i]); - - if (!entry) - continue; - - if (!stricmp(entry->mask, mask)) { - if (entry->expires >= expires || entry->expires == 0) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_EXISTS, - mask); - return -1; - } else { - entry->expires = expires; - if (u) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_CHANGED, - entry->mask); - return -2; - } - } - - if (Anope::Match(mask, entry->mask, false ) - && (entry->expires >= expires || entry->expires == 0)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_ALREADY_COVERED, - mask, entry->mask); - return -1; - } - - if (Anope::Match(entry->mask, mask, false) - && (entry->expires <= expires || expires == 0)) { - slist_delete(&sglines, i); - deleted++; - } - } - - } + if (it != XLines.end()) + { + delete x; + XLines.erase(it); - /* We can now check whether the list is full or not. */ - if (slist_full(&sglines)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SGLINE_REACHED_LIMIT, - sglines.limit); - return -1; + return true; } - /* We can now (really) add the SGLINE. */ - entry = new SXLine; - if (!entry) - return -1; + return false; +} - entry->mask = sstrdup(mask); - entry->by = sstrdup(by); - entry->reason = sstrdup(reason); - entry->seton = time(NULL); - entry->expires = expires; +/** Gets an entry by index + * @param index The index + * @return The XLine, or NULL if the index is out of bounds + */ +XLine *XLineManager::GetEntry(unsigned index) const +{ + if (index >= XLines.size()) + return NULL; + + return XLines[index]; +} - EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnAddSXLine, OnAddSXLine(u, entry, SX_SGLINE)); - if (MOD_RESULT == EVENT_STOP) +/** Clear the XLine list + */ +void XLineManager::Clear() +{ + for (std::deque<XLine *>::iterator it = XLines.begin(); it != XLines.end(); ++it) { - delete entry; - return -1; + delete *it; } + XLines.clear(); +} + +/** Add an entry to this XLine Manager + * @param bi The bot error replies should be sent from + * @param u The user adding the XLine + * @param mask The mask of the XLine + * @param expires When this should expire + * @param reaosn The reason + * @return A pointer to the XLine + */ +XLine *XLineManager::Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason) +{ + return NULL; +} - slist_add(&sglines, entry); +/** Delete an XLine, eg, remove it from the IRCd. + * @param x The xline + */ +void XLineManager::Del(XLine *x) +{ +} - ircdproto->SendSGLine(entry); +/** Checks if a mask can/should be added to the XLineManager + * @param mask The mask + * @param expires When the mask would expire + * @return A pair of int and XLine*. + * 1 - Mask already exists + * 2 - Mask already exists, but the expiry time was changed + * 3 - Mask is already covered by another mask + * In each case the XLine it matches/is covered by is returned in XLine* + */ +std::pair<int, XLine *> XLineManager::CanAdd(const ci::string &mask, time_t expires) +{ + std::pair<int, XLine *> ret(0, NULL); - if (Config.KillonSGline && !ircd->sglineenforce) + for (unsigned i = 0; i < GetCount(); ++i) { - char buf[BUFSIZE]; - snprintf(buf, (BUFSIZE - 1), "G-Lined: %s", entry->reason); + XLine *x = GetEntry(i); + ret.second = x; - for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end();) + if (x->Mask == mask) { - User *u2 = it->second; - ++it; - - if (!is_oper(u2) && Anope::Match(u2->realname, entry->mask, false)) + if (x->Expires == 0 || x->Expires >= expires) + { + ret.first = 1; + break; + } + else { - kill_user(Config.ServerName, u2->nick, buf); + x->Expires = expires; + + ret.first = 2; + break; } } + else if (Anope::Match(mask, x->Mask) && (x->Expires == 0 || x->Expires >= expires)) + { + ret.first = 3; + break; + } + else if (Anope::Match(x->Mask, mask) && (expires == 0 || x->Expires <= expires)) + { + this->DelXLine(x); + --i; + } } - return deleted; -} -/* Does the user match any SGLINEs? */ + return ret; +} -int check_sgline(const char *nick, const char *realname) +/** Checks if this list has an entry + * @param mask The mask + * @return The XLine the user matches, or NULL + */ +XLine *XLineManager::HasEntry(const ci::string &mask) const { - int i; - SXLine *sx; - - if (sglines.count == 0) - return 0; - - for (i = 0; i < sglines.count; i++) { - sx = static_cast<SXLine *>(sglines.list[i]); - if (!sx) - continue; + for (unsigned i = 0; i < XLines.size(); ++i) + { + XLine *x = XLines[i]; - if (Anope::Match(realname, sx->mask, false)) { - ircdproto->SendSGLine(sx); - /* We kill nick since s_sgline can't */ - ircdproto->SendSVSKill(NULL, finduser(nick), "G-Lined: %s", sx->reason); - return 1; + if (x->Mask == mask) + { + return x; } } - return 0; + return NULL; } -/* Delete any expired SGLINEs. */ - -void expire_sglines() +/** Check a user against all of the xlines in this XLineManager + * @param u The user + * @return The xline the user marches, if any. Also calls OnMatch() + */ +XLine *XLineManager::Check(User *u) { - int i; - time_t now = time(NULL); - SXLine *sx; + const time_t now = time(NULL); - for (i = sglines.count - 1; i >= 0; i--) { - sx = static_cast<SXLine *>(sglines.list[i]); + for (std::deque<XLine *>::iterator it = XLines.begin(); it != XLines.end(); ++it) + { + XLine *x = *it; - if (!sx->expires || sx->expires > now) + if (x->Expires && x->Expires < now) + { + OnExpire(x); + delete x; + it = XLines.erase(it); + --it; continue; + } - if (Config.WallSGLineExpire) - ircdproto->SendGlobops(OperServ, "SGLINE on \2%s\2 has expired", - sx->mask); - slist_delete(&sglines, i); - } -} + if (!x->GetNick().empty() && !Anope::Match(u->nick.c_str(), x->GetNick())) + continue; -static void free_sgline_entry(SList * slist, void *item) -{ - SXLine *sx = static_cast<SXLine *>(item); + if (!x->GetUser().empty() && !Anope::Match(u->GetIdent().c_str(), x->GetUser())) + continue; - /* Remove the SGLINE from all the servers */ - ircdproto->SendSGLineDel(sx); + if (x->GetNick().empty() && x->GetUser().empty() || ((u->hostip && Anope::Match(u->hostip, x->GetHost())) || Anope::Match(u->host, x->GetHost()) || (!u->chost.empty() && Anope::Match(u->chost.c_str(), x->GetHost())) || (u->vhost && Anope::Match(u->vhost, x->GetHost())))) + { + OnMatch(u, x); + return x; + } + } - /* Free the structure */ - delete [] sx->mask; - delete [] sx->by; - delete [] sx->reason; - delete sx; + return NULL; } -/* item1 is not an SXLine pointer, but a char */ - -static int is_sgline_entry_equal(SList * slist, void *item1, void *item2) +/** Called when a user matches a xline in this XLineManager + * @param u The user + * @param x The XLine they match + */ +void XLineManager::OnMatch(User *u, XLine *x) { - char *sx1 = static_cast<char *>(item1); - SXLine *sx2 = static_cast<SXLine *>(item2); - - if (!sx1 || !sx2) - return 0; - - if (!stricmp(sx1, sx2->mask)) - return 1; - else - return 0; } -/*************************************************************************/ - -/* Adds an SQLINE to the list. Returns >= 0 on success, -1 if it failed, -2 if - * only the expiry time changed. - * The success result is the number of SQLINEs that were deleted to successfully add one. +/** Called when an XLine expires + * @param x The xline */ +void XLineManager::OnExpire(XLine *x) +{ +} -int add_sqline(User * u, const char *mask, const char *by, time_t expires, - const char *reason) +XLine *SGLineManager::Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason) { - int deleted = 0, i; - SXLine *entry; - - /* Checks whether there is an SQLINE that already covers - * the one we want to add, and whether there are SQLINEs - * that would be covered by this one. - * If so, warn the user in the first case and cleanup - * the useless SQLINEs in the second. - */ - - if (!mask) { - return -1; + if (mask.find('!') != ci::string::npos) + { + if (bi && u) + notice_lang(bi->nick.c_str(), u, OPER_AKILL_NO_NICK); + return NULL; } - if (sqlines.count > 0) { - - for (i = sqlines.count - 1; i >= 0; i--) { - entry = static_cast<SXLine *>(sqlines.list[i]); - - if (!entry) - continue; - - if ((*mask == '#' && *entry->mask != '#') || - (*mask != '#' && *entry->mask == '#')) - continue; - - if (!stricmp(entry->mask, mask)) { - if (entry->expires >= expires || entry->expires == 0) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SQLINE_EXISTS, - mask); - return -1; - } else { - entry->expires = expires; - if (u) - notice_lang(Config.s_OperServ, u, OPER_SQLINE_CHANGED, - entry->mask); - return -2; - } - } + if (mask.find('@') == ci::string::npos) + { + if (bi && u) + notice_lang(bi->nick.c_str(), u, BAD_USERHOST_MASK); + return NULL; + } - if (Anope::Match(mask, entry->mask, false) - && (entry->expires >= expires || entry->expires == 0)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SQLINE_ALREADY_COVERED, - mask, entry->mask); - return -1; - } + if (strspn(mask.c_str(), "~@.*?") == mask.length()) + { + if (bi && u) + notice_lang(bi->nick.c_str(), u, USERHOST_MASK_TOO_WIDE, mask.c_str()); + return NULL; + } - if (Anope::Match(entry->mask, mask, false) - && (entry->expires <= expires || expires == 0)) { - slist_delete(&sqlines, i); - deleted++; - } + std::pair<int, XLine *> canAdd = this->CanAdd(mask, expires); + if (canAdd.first) + { + if (bi && u) + { + if (canAdd.first == 1) + notice_lang(bi->nick.c_str(), u, OPER_AKILL_EXISTS, canAdd.second->Mask.c_str()); + else if (canAdd.first == 2) + notice_lang(bi->nick.c_str(), u, OPER_AKILL_CHANGED, canAdd.second->Mask.c_str()); + else if (canAdd.first == 3) + notice_lang(bi->nick.c_str(), u, OPER_AKILL_ALREADY_COVERED, mask.c_str(), canAdd.second->Mask.c_str()); } + return canAdd.second; } - /* We can now check whether the list is full or not. */ - if (slist_full(&sqlines)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SQLINE_REACHED_LIMIT, - sqlines.limit); - return -1; - } - - /* We can now (really) add the SQLINE. */ - entry = new SXLine; - if (!entry) - return -1; - - entry->mask = sstrdup(mask); - entry->by = sstrdup(by); - entry->reason = sstrdup(reason); - entry->seton = time(NULL); - entry->expires = expires; + std::string realreason = reason; + if (u && Config.AddAkiller) + realreason = "[" + u->nick + "]" + reason; + + XLine *x = new XLine(mask, u ? u->nick.c_str() : "", expires, realreason); EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnAddSXLine, OnAddSXLine(u, entry, SX_SQLINE)); + FOREACH_RESULT(I_OnAddAkill, OnAddAkill(u, x)); if (MOD_RESULT == EVENT_STOP) { - delete entry; - return -1; + delete x; + return NULL; } + + this->AddXLine(x); - slist_add(&sqlines, entry); - - sqline(entry->mask, entry->reason); - - if (Config.KillonSQline) - { - char buf[BUFSIZE]; - snprintf(buf, (BUFSIZE - 1), "Q-Lined: %s", entry->reason); - - for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end();) - { - User *u2 = it->second; - ++it; - - if (!is_oper(u2) && Anope::Match(u2->nick, entry->mask, false)) - { - kill_user(Config.ServerName, u2->nick, buf); - } - } - } - - return deleted; + if (Config.AkillOnAdd) + ircdproto->SendAkill(x); + + return x; } -/* Does the user match any SQLINEs? */ - -int check_sqline(const char *nick, int nick_change) +void SGLineManager::Del(XLine *x) { - int i; - SXLine *sx; - char reason[300]; + ircdproto->SendAkillDel(x); +} - if (sqlines.count == 0) - return 0; +void SGLineManager::OnMatch(User *u, XLine *x) +{ + ircdproto->SendAkill(x); +} - for (i = 0; i < sqlines.count; i++) { - sx = static_cast<SXLine *>(sqlines.list[i]); - if (!sx) - continue; +void SGLineManager::OnExpire(XLine *x) +{ + if (Config.WallAkillExpire) + ircdproto->SendGlobops(OperServ, "AKILL on %s has expired", x->Mask.c_str()); +} - if (ircd->chansqline) { - if (*sx->mask == '#') - continue; - } +XLine *SNLineManager::Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason) +{ + if (!mask.empty() && strspn(mask.c_str(), "*?") == mask.length()) + { + if (bi && u) + notice_lang(bi->nick.c_str(), u, USERHOST_MASK_TOO_WIDE, mask.c_str()); + return NULL; + } - if (Anope::Match(nick, sx->mask, false)) { - sqline(sx->mask, sx->reason); - /* We kill nick since s_sqline can't */ - snprintf(reason, sizeof(reason), "Q-Lined: %s", sx->reason); - kill_user(Config.s_OperServ, nick, reason); - return 1; + std::pair<int, XLine *> canAdd = this->CanAdd(mask, expires); + if (canAdd.first) + { + if (bi && u) + { + if (canAdd.first == 1) + notice_lang(bi->nick.c_str(), u, OPER_SNLINE_EXISTS, canAdd.second->Mask.c_str()); + else if (canAdd.first == 2) + notice_lang(bi->nick.c_str(), u, OPER_SNLINE_CHANGED, canAdd.second->Mask.c_str()); + else if (canAdd.first == 3) + notice_lang(bi->nick.c_str(), u, OPER_SNLINE_ALREADY_COVERED, mask.c_str(), canAdd.second->Mask.c_str()); } + + return canAdd.second; } - return 0; -} + XLine *x = new XLine(mask, u ? u->nick.c_str() : "", expires, reason); -int check_chan_sqline(const char *chan) -{ - int i; - SXLine *sx; + EventReturn MOD_RESULT; + FOREACH_RESULT(I_OnAddXLine, OnAddXLine(u, x, X_SNLINE)); + if (MOD_RESULT == EVENT_STOP) + { + delete x; + return NULL; + } - if (sqlines.count == 0) - return 0; + this->AddXLine(x); - for (i = 0; i < sqlines.count; i++) { - sx = static_cast<SXLine *>(sqlines.list[i]); - if (!sx) - continue; + if (Config.KillonSNline && !ircd->sglineenforce) + { + std::string rreason = "G-Lined: " + reason; - if (*sx->mask != '#') - continue; + for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end();) + { + User *user = it->second; + ++it; - if (Anope::Match(chan, sx->mask, false)) { - sqline(sx->mask, sx->reason); - return 1; + if (!is_oper(user) && Anope::Match(user->realname, x->Mask)) + { + kill_user(Config.ServerName, user->nick, rreason.c_str()); + } } } - return 0; + return x; } -/* Delete any expired SQLINEs. */ - -void expire_sqlines() +void SNLineManager::Del(XLine *x) { - int i; - time_t now = time(NULL); - SXLine *sx; - - for (i = sqlines.count - 1; i >= 0; i--) { - sx = static_cast<SXLine *>(sqlines.list[i]); - - if (!sx->expires || sx->expires > now) - continue; - - if (Config.WallSQLineExpire) - ircdproto->SendGlobops(OperServ, "SQLINE on \2%s\2 has expired", - sx->mask); - - slist_delete(&sqlines, i); - } + ircdproto->SendSGLineDel(x); } -static void free_sqline_entry(SList * slist, void *item) +void SNLineManager::OnMatch(User *u, XLine *x) { - SXLine *sx = static_cast<SXLine *>(item); - - /* Remove the SQLINE from all the servers */ - ircdproto->SendSQLineDel(sx->mask); + ircdproto->SendSGLine(x); - /* Free the structure */ - delete [] sx->mask; - delete [] sx->by; - delete [] sx->reason; - delete sx; + std::string reason = "G-Lined: " + x->Reason; + kill_user(Config.s_OperServ, u->nick, reason.c_str()); } -/* item1 is not an SXLine pointer, but a char */ - -static int is_sqline_entry_equal(SList * slist, void *item1, void *item2) +void SNLineManager::OnExpire(XLine *x) { - char *sx1 = static_cast<char *>(item1); - SXLine *sx2 = static_cast<SXLine *>(item2); - - if (!sx1 || !sx2) - return 0; - - if (!stricmp(sx1, sx2->mask)) - return 1; - else - return 0; + if (Config.WallSNLineExpire) + ircdproto->SendGlobops(OperServ, "SNLINE on \2%s\2 has expired", x->Mask.c_str()); } -/*************************************************************************/ - -/* Adds an SZLINE to the list. Returns >= 0 on success, -1 on error, -2 if - * only the expiry time changed. - * The success result is the number of SZLINEs that were deleted to successfully add one. - */ - -int add_szline(User * u, const char *mask, const char *by, time_t expires, - const char *reason) +XLine *SQLineManager::Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason) { - int deleted = 0, i; - SXLine *entry; - - if (!mask) { - return -1; + if (strspn(mask.c_str(), "*") == mask.length()) + { + if (bi && u) + notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask.c_str()); + return NULL; } - /* Checks whether there is an SZLINE that already covers - * the one we want to add, and whether there are SZLINEs - * that would be covered by this one. - * If so, warn the user in the first case and cleanup - * the useless SZLINEs in the second. - */ - - if (szlines.count > 0) { - - for (i = szlines.count - 1; i >= 0; i--) { - entry = static_cast<SXLine *>(szlines.list[i]); - - if (!entry) - continue; - - if (!stricmp(entry->mask, mask)) { - if (entry->expires >= expires || entry->expires == 0) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SZLINE_EXISTS, - mask); - return -1; - } else { - entry->expires = expires; - if (u) - notice_lang(Config.s_OperServ, u, OPER_SZLINE_EXISTS, - mask); - return -2; - } - } - - if (Anope::Match(mask, entry->mask, false)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SZLINE_ALREADY_COVERED, - mask, entry->mask); - return -1; - } + if (mask[0] == '#' && !ircd->chansqline) + { + if (bi && u) + notice_lang(Config.s_OperServ, u, OPER_SQLINE_CHANNELS_UNSUPPORTED); + return NULL; + } - if (Anope::Match(entry->mask, mask, false)) { - slist_delete(&szlines, i); - deleted++; - } + std::pair<int, XLine *> canAdd = this->CanAdd(mask, expires); + if (canAdd.first) + { + if (bi && u) + { + if (canAdd.first == 1) + notice_lang(bi->nick.c_str(), u, OPER_SQLINE_EXISTS, canAdd.second->Mask.c_str()); + else if (canAdd.first == 2) + notice_lang(bi->nick.c_str(), u, OPER_SQLINE_CHANGED, canAdd.second->Mask.c_str()); + else if (canAdd.first == 3) + notice_lang(bi->nick.c_str(), u, OPER_SQLINE_ALREADY_COVERED, mask.c_str(), canAdd.second->Mask.c_str()); } + return canAdd.second; } - /* We can now check whether the list is full or not. */ - if (slist_full(&szlines)) { - if (u) - notice_lang(Config.s_OperServ, u, OPER_SZLINE_REACHED_LIMIT, - szlines.limit); - return -1; - } - - /* We can now (really) add the SZLINE. */ - entry = new SXLine; - if (!entry) - return -1; - - entry->mask = sstrdup(mask); - entry->by = sstrdup(by); - entry->reason = sstrdup(reason); - entry->seton = time(NULL); - entry->expires = expires; + XLine *x = new XLine(mask, u ? u->nick.c_str() : "", expires, reason); EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnAddSXLine, OnAddSXLine(u, entry, SX_SZLINE)); + FOREACH_RESULT(I_OnAddXLine, OnAddXLine(u, x, X_SQLINE)); if (MOD_RESULT == EVENT_STOP) { - delete entry; - return -1; + delete x; + return NULL; } - slist_add(&szlines, entry); - ircdproto->SendSZLine(entry); - - return deleted; -} - -/* Check and enforce any Zlines that we have */ -int check_szline(const char *nick, char *ip) -{ - int i; - SXLine *sx; - - if (szlines.count == 0) { - return 0; - } + this->AddXLine(x); - if (!ip) { - return 0; - } + if (Config.KillonSQline) + { + std::string rreason = "Q-Lined: " + reason; - for (i = 0; i < szlines.count; i++) { - sx = static_cast<SXLine *>(szlines.list[i]); - if (!sx) { - continue; + if (mask[0] == '#') + { + for (channel_map::const_iterator cit = ChannelList.begin(); cit != ChannelList.end(); ++cit) + { + Channel *c = cit->second; + + if (!Anope::Match(c->name.c_str(), mask)) + continue; + for (CUserList::iterator it = c->users.begin(); it != c->users.end();) + { + UserContainer *uc = *it; + ++it; + + if (is_oper(uc->user)) + continue; + c->Kick(NULL, uc->user, "%s", reason.c_str()); + } + } } + else + { + for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end();) + { + User *user = it->second; + ++it; - if (Anope::Match(ip, sx->mask, false)) { - ircdproto->SendSZLine(sx); - return 1; + if (!is_oper(user) && Anope::Match(user->nick.c_str(), x->Mask)) + { + kill_user(Config.ServerName, user->nick, rreason.c_str()); + } + } } } - return 0; -} + ircdproto->SendSQLine(x); + return x; +} -/* Delete any expired SZLINEs. */ +void SQLineManager::Del(XLine *x) +{ + ircdproto->SendSQLineDel(x); +} -void expire_szlines() +void SQLineManager::OnMatch(User *u, XLine *x) { - int i; - time_t now = time(NULL); - SXLine *sx; + ircdproto->SendSQLine(x); - for (i = szlines.count - 1; i >= 0; i--) { - sx = static_cast<SXLine *>(szlines.list[i]); + char reason[300]; + snprintf(reason, sizeof(reason), "Q-Lined: %s", x->Reason.c_str()); + kill_user(Config.s_OperServ, u->nick, reason); +} - if (!sx->expires || sx->expires > now) - continue; +void SQLineManager::OnExpire(XLine *x) +{ + if (Config.WallSQLineExpire) + ircdproto->SendGlobops(OperServ, "SQLINE on \2%s\2 has expired", x->Mask.c_str()); +} + +bool SQLineManager::Check(Channel *c) +{ + if (ircd->chansqline && SQLine) + { + for (std::deque<XLine *>::const_iterator it = SGLine->GetList().begin(); it != SGLine->GetList().end(); ++it) + { + XLine *x = *it; - if (Config.WallSZLineExpire) - ircdproto->SendGlobops(OperServ, "SZLINE on \2%s\2 has expired", - sx->mask); - slist_delete(&szlines, i); + if (Anope::Match(c->name.c_str(), x->Mask)) + { + return true; + } + } } + + return false; } -static void free_szline_entry(SList * slist, void *item) +XLine *SZLineManager::Add(BotInfo *bi, User *u, const ci::string &mask, time_t expires, const std::string &reason) { - SXLine *sx = static_cast<SXLine *>(item); + if (mask.find('!') != ci::string::npos || mask.find('@') != ci::string::npos) + { + notice_lang(Config.s_OperServ, u, OPER_SZLINE_ONLY_IPS); + return NULL; + } - /* Remove the SZLINE from all the servers */ - ircdproto->SendSZLineDel(sx); + if (strspn(mask.c_str(), "*?") == mask.length()) + { + notice_lang(Config.s_OperServ, u, USERHOST_MASK_TOO_WIDE, mask.c_str()); + return NULL; + } - /* Free the structure */ - delete [] sx->mask; - delete [] sx->by; - delete [] sx->reason; - delete sx; -} + std::pair<int, XLine *> canAdd = this->CanAdd(mask, expires); + if (canAdd.first) + { + if (bi && u) + { + if (canAdd.first == 1) + notice_lang(bi->nick.c_str(), u, OPER_SZLINE_EXISTS, canAdd.second->Mask.c_str()); + else if (canAdd.first == 2) + notice_lang(bi->nick.c_str(), u, OPER_SZLINE_CHANGED, canAdd.second->Mask.c_str()); + else if (canAdd.first == 3) + notice_lang(bi->nick.c_str(), u, OPER_SZLINE_ALREADY_COVERED, mask.c_str(), canAdd.second->Mask.c_str()); + } -/* item1 is not an SXLine pointer, but a char - */ + return canAdd.second; + } -static int is_szline_entry_equal(SList * slist, void *item1, void *item2) -{ - char *sx1 = static_cast<char *>(item1); - SXLine *sx2 = static_cast<SXLine *>(item2); + XLine *x = new XLine(mask, u ? u->nick.c_str() : "", expires, reason); - if (!sx1 || !sx2) - return 0; + EventReturn MOD_RESULT; + FOREACH_RESULT(I_OnAddXLine, OnAddXLine(u, x, X_SZLINE)); + if (MOD_RESULT == EVENT_STOP) + { + delete x; + return NULL; + } - if (!stricmp(sx1, sx2->mask)) - return 1; - else - return 0; -} + this->AddXLine(x); -/*************************************************************************/ + ircdproto->SendSZLine(x); -/** Check if a certain defcon option is currently in affect - * @param Level The level - * @return true and false - */ -bool CheckDefCon(DefconLevel Level) -{ - if (Config.DefConLevel) - return DefCon[Config.DefConLevel][Level]; - return false; + return x; } -/** Check if a certain defcon option is in a certain defcon level - * @param level The defcon level - * @param Level The defcon level name - * @return true or false - */ -bool CheckDefCon(int level, DefconLevel Level) +void SZLineManager::Del(XLine *x) { - return DefCon[level][Level]; + ircdproto->SendSZLineDel(x); } -/** Add a defcon level option to a defcon level - * @param level The defcon level - * @param Level The defcon level option - */ -void AddDefCon(int level, DefconLevel Level) +void SZLineManager::OnMatch(User *u, XLine *x) { - DefCon[level][Level] = true; + ircdproto->SendSZLine(x); } -/** Remove a defcon level option from a defcon level - * @param level The defcon level - * @param Level The defcon level option - */ -void DelDefCon(int level, DefconLevel Level) +void SZLineManager::OnExpire(XLine *x) { - DefCon[level][Level] = false; + if (Config.WallSZLineExpire) + ircdproto->SendGlobops(OperServ, "SZLINE on \2%s\2 has expired", x->Mask.c_str()); } diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 14dc68cb5..040144737 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -23,7 +23,7 @@ IRCDVar myIrcd[] = { "+o", /* Channel Umode used by Botserv bots */ 1, /* SVSNICK */ 0, /* Vhost */ - 1, /* Supports SGlines */ + 1, /* Supports SNlines */ 1, /* Supports SQlines */ 1, /* Supports SZlines */ 3, /* Number of server args */ @@ -141,35 +141,33 @@ class BahamutIRCdProto : public IRCDProto } /* SQLINE */ - void SendSQLine(const std::string &mask, const std::string &reason) + void SendSQLine(XLine *x) { - if (mask.empty() || reason.empty()) - return; - send_cmd(NULL, "SQLINE %s :%s", mask.c_str(), reason.c_str()); + send_cmd(NULL, "SQLINE %s :%s", x->Mask.c_str(), x->Reason.c_str()); } - /* UNSGLINE */ - void SendSGLineDel(SXLine *sx) + /* UNSLINE */ + void SendSGLineDel(XLine *x) { - send_cmd(NULL, "UNSGLINE 0 :%s", sx->mask); + send_cmd(NULL, "UNSGLINE 0 :%s", x->Mask.c_str()); } /* UNSZLINE */ - void SendSZLineDel(SXLine *sx) + void SendSZLineDel(XLine *x) { /* this will likely fail so its only here for legacy */ - send_cmd(NULL, "UNSZLINE 0 %s", sx->mask); + send_cmd(NULL, "UNSZLINE 0 %s", x->Mask.c_str()); /* this is how we are supposed to deal with it */ - send_cmd(NULL, "RAKILL %s *", sx->mask); + send_cmd(NULL, "RAKILL %s *", x->Mask.c_str()); } /* SZLINE */ - void SendSZLine(SXLine *sx) + void SendSZLine(XLine *x) { /* this will likely fail so its only here for legacy */ - send_cmd(NULL, "SZLINE %s :%s", sx->mask, sx->reason); + send_cmd(NULL, "SZLINE %s :%s", x->Mask.c_str(), x->Reason.c_str()); /* this is how we are supposed to deal with it */ - send_cmd(NULL, "AKILL %s * %d %s %ld :%s", sx->mask, 172800, sx->by, static_cast<long>(time(NULL)), sx->reason); + send_cmd(NULL, "AKILL %s * %d %s %ld :%s", x->Mask.c_str(), 172800, x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str()); } /* SVSNOOP */ @@ -179,15 +177,15 @@ class BahamutIRCdProto : public IRCDProto } /* SGLINE */ - void SendSGLine(SXLine *sx) + void SendSGLine(XLine *x) { - send_cmd(NULL, "SGLINE %d :%s:%s", static_cast<int>(strlen(sx->mask)), sx->mask, sx->reason); + send_cmd(NULL, "SGLINE %d :%s:%s", x->Mask.length(), x->Mask.c_str(), x->Reason.c_str()); } /* RAKILL */ - void SendAkillDel(Akill *ak) + void SendAkillDel(XLine *x) { - send_cmd(NULL, "RAKILL %s %s", ak->host, ak->user); + send_cmd(NULL, "RAKILL %s %s", x->GetHost().c_str(), x->GetUser().c_str()); } /* TOPIC */ @@ -197,11 +195,9 @@ class BahamutIRCdProto : public IRCDProto } /* UNSQLINE */ - void SendSQLineDel(const std::string &user) + void SendSQLineDel(XLine *x) { - if (user.empty()) - return; - send_cmd(NULL, "UNSQLINE %s", user.c_str()); + send_cmd(NULL, "UNSQLINE %s", x->Mask.c_str()); } /* JOIN - SJOIN */ @@ -210,12 +206,12 @@ class BahamutIRCdProto : public IRCDProto send_cmd(user->nick, "SJOIN %ld %s", static_cast<long>(chantime), channel); } - void SendAkill(Akill *ak) + void SendAkill(XLine *x) { // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = ak->expires - time(NULL); + time_t timeleft = x->Expires - time(NULL); if (timeleft > 172800) timeleft = 172800; - send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", ak->host, ak->user, static_cast<int>(timeleft), ak->by, static_cast<long>(time(NULL)), ak->reason); + send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", x->GetHost().c_str(), x->GetUser().c_str(), static_cast<int>(timeleft), x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str()); } /* diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index 4c698edad..8fe766824 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -40,7 +40,7 @@ IRCDVar myIrcd[] = { "+ao", /* Channel Umode used by Botserv bots */ 1, /* SVSNICK */ 1, /* Vhost */ - 1, /* Supports SGlines */ + 1, /* Supports SNlines */ 1, /* Supports SQlines */ 1, /* Supports SZlines */ 4, /* Number of server args */ @@ -119,9 +119,9 @@ void inspircd_cmd_pass(const char *pass) class InspIRCdProto : public IRCDProto { - void SendAkillDel(Akill *ak) + void SendAkillDel(XLine *x) { - send_cmd(Config.s_OperServ, "GLINE %s@%s", ak->user, ak->host); + send_cmd(Config.s_OperServ, "GLINE %s", x->Mask.c_str()); } void SendTopic(BotInfo *whosets, Channel *c, const char *whosetit, const char *topic) @@ -142,13 +142,13 @@ class InspIRCdProto : public IRCDProto } } - void SendAkill(Akill *ak) + void SendAkill(XLine *x) { // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = ak->expires - time(NULL); + time_t timeleft = x->Expires - time(NULL); if (timeleft > 172800) timeleft = 172800; - send_cmd(Config.ServerName, "ADDLINE G %s@%s %s %ld %ld :%s", ak->user, ak->host, ak->by, static_cast<long>(time(NULL)), static_cast<long>(timeleft), ak->reason); + send_cmd(Config.ServerName, "ADDLINE G %s %s %ld %ld :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), static_cast<long>(timeleft), x->Reason.c_str()); } void SendSVSKillInternal(BotInfo *source, User *user, const char *buf) @@ -214,19 +214,15 @@ class InspIRCdProto : public IRCDProto } /* UNSQLINE */ - void SendSQLineDel(const std::string &user) + void SendSQLineDel(XLine *x) { - if (user.empty()) - return; - send_cmd(Config.s_OperServ, "QLINE %s", user.c_str()); + send_cmd(Config.s_OperServ, "QLINE %s", x->Mask.c_str()); } /* SQLINE */ - void SendSQLine(const std::string &mask, const std::string &reason) + void SendSQLine(XLine *x) { - if (mask.empty() || reason.empty()) - return; - send_cmd(Config.ServerName, "ADDLINE Q %s %s %ld 0 :%s", mask.c_str(), Config.s_OperServ, static_cast<long>(time(NULL)), reason.c_str()); + send_cmd(Config.ServerName, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config.s_OperServ, static_cast<long>(time(NULL)), x->Reason.c_str()); } /* SQUIT */ @@ -281,15 +277,15 @@ class InspIRCdProto : public IRCDProto } /* UNSZLINE */ - void SendSZLineDel(SXLine *sx) + void SendSZLineDel(XLine *x) { - send_cmd(Config.s_OperServ, "ZLINE %s", sx->mask); + send_cmd(Config.s_OperServ, "ZLINE %s", x->Mask.c_str()); } /* SZLINE */ - void SendSZLine(SXLine *sx) + void SendSZLine(XLine *x) { - send_cmd(Config.ServerName, "ADDLINE Z %s %s %ld 0 :%s", sx->mask, sx->by, static_cast<long>(time(NULL)), sx->reason); + send_cmd(Config.ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str()); } /* SVSMODE +- */ diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index d326b6820..5fa330197 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -40,7 +40,7 @@ IRCDVar myIrcd[] = { "+ao", /* Channel Umode used by Botserv bots */ 1, /* SVSNICK */ 1, /* Vhost */ - 0, /* Supports SGlines */ + 0, /* Supports SNlines */ 1, /* Supports SQlines */ 1, /* Supports SZlines */ 4, /* Number of server args */ @@ -123,10 +123,10 @@ void inspircd_cmd_pass(const char *pass) class InspIRCdProto : public IRCDProto { - void SendAkillDel(Akill *ak) + void SendAkillDel(XLine *x) { BotInfo *bi = OperServ; - send_cmd(bi->uid, "GLINE %s@%s", ak->user, ak->host); + send_cmd(bi->uid, "GLINE %s", x->Mask.c_str()); } void SendTopic(BotInfo *whosets, Channel *c, const char *whosetit, const char *topic) @@ -147,14 +147,14 @@ class InspIRCdProto : public IRCDProto } } - void SendAkill(Akill *ak) + void SendAkill(XLine *x) { // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = ak->expires - time(NULL); - if (timeleft > 172800 || !ak->expires) + time_t timeleft = x->Expires - time(NULL); + if (timeleft > 172800 || !x->Expires) timeleft = 172800; BotInfo *bi = OperServ; - send_cmd(bi->uid, "ADDLINE G %s@%s %s %ld %ld :%s", ak->user, ak->host, ak->by, static_cast<long>(time(NULL)), static_cast<long>(timeleft), ak->reason); + send_cmd(bi->uid, "ADDLINE G %s@%s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(time(NULL)), static_cast<long>(timeleft), x->Reason.c_str()); } void SendSVSKillInternal(BotInfo *source, User *user, const char *buf) @@ -219,19 +219,15 @@ class InspIRCdProto : public IRCDProto } /* UNSQLINE */ - void SendSQLineDel(const std::string &user) + void SendSQLineDel(XLine *x) { - if (user.empty()) - return; - send_cmd(TS6SID, "DELLINE Q %s", user.c_str()); + send_cmd(TS6SID, "DELLINE Q %s", x->Mask.c_str()); } /* SQLINE */ - void SendSQLine(const std::string &mask, const std::string &reason) + void SendSQLine(XLine *x) { - if (mask.empty() || reason.empty()) - return; - send_cmd(TS6SID, "ADDLINE Q %s %s %ld 0 :%s", mask.c_str(), Config.s_OperServ, static_cast<long>(time(NULL)), reason.c_str()); + send_cmd(TS6SID, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config.s_OperServ, static_cast<long>(time(NULL)), x->Reason.c_str()); } /* SQUIT */ @@ -288,15 +284,15 @@ class InspIRCdProto : public IRCDProto } /* UNSZLINE */ - void SendSZLineDel(SXLine *sx) + void SendSZLineDel(XLine *x) { - send_cmd(TS6SID, "DELLINE Z %s", sx->mask); + send_cmd(TS6SID, "DELLINE Z %s", x->Mask.c_str()); } /* SZLINE */ - void SendSZLine(SXLine *sx) + void SendSZLine(XLine *x) { - send_cmd(TS6SID, "ADDLINE Z %s %s %ld 0 :%s", sx->mask, sx->by, static_cast<long>(time(NULL)), sx->reason); + send_cmd(TS6SID, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str()); } /* SVSMODE -r */ diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index 58ab14154..95ccf6392 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -23,7 +23,7 @@ IRCDVar myIrcd[] = { "+o", /* Channel Umode used by Botserv bots */ 0, /* SVSNICK */ 0, /* Vhost */ - 1, /* Supports SGlines */ + 1, /* Supports SNlines */ 1, /* Supports SQlines */ 0, /* Supports SZlines */ 3, /* Number of server args */ @@ -136,36 +136,32 @@ class RatboxProto : public IRCDTS6Proto send_cmd(TS6SID, "OPERWALL :%s", buf); } - void SendSQLine(const std::string &mask, const std::string &reason) + void SendSQLine(XLine *x) { - if (mask.empty() || reason.empty()) - return; - send_cmd(TS6SID, "RESV * %s :%s", mask.c_str(), reason.c_str()); + send_cmd(TS6SID, "RESV * %s :%s", x->Mask.c_str(), x->Reason.c_str()); } - void SendSGLineDel(SXLine *sx) + void SendSGLineDel(XLine *x) { BotInfo *bi = OperServ; - send_cmd(bi ? bi->uid : Config.s_OperServ, "UNXLINE * %s", sx->mask); + send_cmd(bi ? bi->uid : Config.s_OperServ, "UNXLINE * %s", x->Mask.c_str()); } - void SendSGLine(SXLine *sx) + void SendSGLine(XLine *x) { BotInfo *bi = OperServ; - send_cmd(bi ? bi->uid : Config.s_OperServ, "XLINE * %s 0 :%s", sx->mask, sx->reason); + send_cmd(bi ? bi->uid : Config.s_OperServ, "XLINE * %s 0 :%s", x->Mask.c_str(), x->Reason.c_str()); } - void SendAkillDel(Akill *ak) + void SendAkillDel(XLine *x) { BotInfo *bi = OperServ; - send_cmd(bi ? bi->uid : Config.s_OperServ, "UNKLINE * %s %s", ak->user, ak->host); + send_cmd(bi ? bi->uid : Config.s_OperServ, "UNKLINE * %s %s", x->GetUser().c_str(), x->GetHost().c_str()); } - void SendSQLineDel(const std::string &user) + void SendSQLineDel(XLine *x) { - if (user.empty()) - return; - send_cmd(TS6SID, "UNRESV * %s", user.c_str()); + send_cmd(TS6SID, "UNRESV * %s", x->Mask.c_str()); } void SendJoin(BotInfo *user, const char *channel, time_t chantime) @@ -173,10 +169,10 @@ class RatboxProto : public IRCDTS6Proto send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, user->uid.c_str()); } - void SendAkill(Akill *ak) + void SendAkill(XLine *x) { BotInfo *bi = OperServ; - send_cmd(bi ? bi->uid : Config.s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(ak->expires - time(NULL)), ak->user, ak->host, ak->reason); + send_cmd(bi ? bi->uid : Config.s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(x->Expires - time(NULL)), x->GetUser().c_str(), x->GetHost().c_str(), x->Reason.c_str()); } void SendSVSKillInternal(BotInfo *source, User *user, const char *buf) diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index b14c48343..4d90e6bcf 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -23,7 +23,7 @@ IRCDVar myIrcd[] = { "+ao", /* Channel Umode used by Botserv bots */ 1, /* SVSNICK */ 1, /* Vhost */ - 1, /* Supports SGlines */ + 1, /* Supports SNlines */ 1, /* Supports SQlines */ 1, /* Supports SZlines */ 3, /* Number of server args */ @@ -133,9 +133,9 @@ class UnrealIRCdProto : public IRCDProto send_cmd(NULL, "f %s %s", server, set ? "+" : "-"); } - void SendAkillDel(Akill *ak) + void SendAkillDel(XLine *x) { - send_cmd(NULL, "BD - G %s %s %s", ak->user, ak->host, Config.s_OperServ); + send_cmd(NULL, "BD - G %s %s %s", x->GetUser().c_str(), x->GetHost().c_str(), Config.s_OperServ); } void SendTopic(BotInfo *whosets, Channel *c, const char *whosetit, const char *topic) @@ -153,12 +153,12 @@ class UnrealIRCdProto : public IRCDProto ModeManager::ProcessModes(); } - void SendAkill(Akill *ak) + void SendAkill(XLine *x) { // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = ak->expires - time(NULL); + time_t timeleft = x->Expires - time(NULL); if (timeleft > 172800) timeleft = 172800; - send_cmd(NULL, "BD + G %s %s %s %ld %ld :%s", ak->user, ak->host, ak->by, static_cast<long>(time(NULL) + timeleft), static_cast<long>(ak->expires), ak->reason); + send_cmd(NULL, "BD + G %s %s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(time(NULL) + timeleft), static_cast<long>(x->Expires), x->Reason.c_str()); } void SendSVSKillInternal(BotInfo *source, User *user, const char *buf) @@ -228,31 +228,21 @@ class UnrealIRCdProto : public IRCDProto } /* unsqline - ** parv[0] = sender - ** parv[1] = nickmask */ - void SendSQLineDel(const std::string &user) + void SendSQLineDel(XLine *x) { - if (user.empty()) - return; - send_cmd(NULL, "d %s", user.c_str()); + send_cmd(NULL, "d %s", x->Mask.c_str()); } /* SQLINE */ /* - ** parv[0] = sender - ** parv[1] = nickmask - ** parv[2] = reason - ** ** - Unreal will translate this to TKL for us ** */ - void SendSQLine(const std::string &mask, const std::string &reason) + void SendSQLine(XLine *x) { - if (mask.empty() || reason.empty()) - return; - send_cmd(NULL, "c %s :%s", mask.c_str(), reason.c_str()); + send_cmd(NULL, "c %s :%s", x->Mask.c_str(), x->Reason.c_str()); } /* @@ -309,33 +299,33 @@ class UnrealIRCdProto : public IRCDProto /* * SVSNLINE - :realname mask */ - void SendSGLineDel(SXLine *sx) + void SendSGLineDel(XLine *x) { - send_cmd(NULL, "BR - :%s", sx->mask); + send_cmd(NULL, "BR - :%s", x->Mask.c_str()); } /* UNSZLINE */ - void SendSZLineDel(SXLine *sx) + void SendSZLineDel(XLine *x) { - send_cmd(NULL, "BD - Z * %s %s", sx->mask, Config.s_OperServ); + send_cmd(NULL, "BD - Z * %s %s", x->Mask.c_str(), Config.s_OperServ); } /* SZLINE */ - void SendSZLine(SXLine *sx) + void SendSZLine(XLine *x) { - send_cmd(NULL, "BD + Z * %s %s %ld %ld :%s", sx->mask, sx->by, static_cast<long>(time(NULL) + 172800), static_cast<long>(time(NULL)), sx->reason); + send_cmd(NULL, "BD + Z * %s %s %ld %ld :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL) + 172800), static_cast<long>(time(NULL)), x->Reason.c_str()); } /* SGLINE */ /* * SVSNLINE + reason_where_is_space :realname mask with spaces */ - void SendSGLine(SXLine *sx) + void SendSGLine(XLine *x) { char edited_reason[BUFSIZE]; - strlcpy(edited_reason, sx->reason, BUFSIZE); + strlcpy(edited_reason, x->Reason.c_str(), BUFSIZE); strnrepl(edited_reason, BUFSIZE, " ", "_"); - send_cmd(NULL, "BR + %s :%s", edited_reason, sx->mask); + send_cmd(NULL, "BR + %s :%s", edited_reason, x->Mask.c_str()); } /* SVSMODE -b */ diff --git a/src/regchannel.cpp b/src/regchannel.cpp index d214eb6bd..8ee823e33 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -603,6 +603,12 @@ bool ChannelInfo::CheckKick(User *user) * as this will likely lead to kick/rejoin floods. ~ Viper */ if (user->server->IsULined()) return false; + + if (!do_kick && user->IsProtected()) + return false; + + if (ircd->chansqline && SQLineManager::Check(this->c)) + do_kick = true; if (!is_oper(user) && (this->HasFlag(CI_SUSPENDED) || this->HasFlag(CI_FORBIDDEN))) { @@ -612,9 +618,6 @@ bool ChannelInfo::CheckKick(User *user) do_kick = true; } - if (!do_kick && user->IsProtected()) - return false; - if (!do_kick && ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted(this, user) == 1) return false; diff --git a/src/send.c b/src/send.c index e16856598..4209e2a1b 100644 --- a/src/send.c +++ b/src/send.c @@ -32,6 +32,15 @@ void send_cmd(const char *source, const char *fmt, ...) vsnprintf(buf, BUFSIZE - 1, fmt, args); + if (!UplinkSock) + { + if (source) + Alog(LOG_DEBUG) << "Attemtped to send \"" << source << " " << buf << "\" with UplinkSock NULL"; + else + Alog(LOG_DEBUG) << "Attemtped to send \"" << buf << "\" with UplinkSock NULL"; + return; + } + if (source) { UplinkSock->Write(":%s %s", source, buf); @@ -59,6 +68,15 @@ void send_cmd(const std::string &source, const char *fmt, ...) vsnprintf(buf, BUFSIZE - 1, fmt, args); + if (!UplinkSock) + { + if (!source.empty()) + Alog(LOG_DEBUG) << "Attemtped to send \"" << source << " " << buf << "\" with UplinkSock NULL"; + else + Alog(LOG_DEBUG) << "Attemtped to send " << buf << "\" with UplinkSock NULL"; + return; + } + if (!source.empty()) { UplinkSock->Write(":%s %s", source.c_str(), buf); diff --git a/src/sessions.c b/src/sessions.c index cef071443..e0c20e185 100644 --- a/src/sessions.c +++ b/src/sessions.c @@ -140,10 +140,10 @@ int add_session(const char *nick, const char *host, char *hostip) if (Config.MaxSessionKill && session->hits >= Config.MaxSessionKill) { char akillmask[BUFSIZE]; snprintf(akillmask, sizeof(akillmask), "*@%s", host); - add_akill(NULL, akillmask, Config.s_OperServ, - time(NULL) + Config.SessionAutoKillExpiry, "Session limit exceeded"); - ircdproto->SendGlobops(OperServ, - "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask); + XLine *x = new XLine(ci::string("*@") + host, Config.s_OperServ, time(NULL) + Config.SessionAutoKillExpiry, "Session limit exceeded"); + if (x) + x->By = Config.s_OperServ; + ircdproto->SendGlobops(OperServ, "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask); } return 0; } else { diff --git a/src/slist.c b/src/slist.c deleted file mode 100644 index d01d58ecd..000000000 --- a/src/slist.c +++ /dev/null @@ -1,395 +0,0 @@ -/* Services list handler implementation. - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * - */ - -#include "services.h" -#include "slist.h" - -static SListOpts slist_defopts = { 0, NULL, NULL, NULL }; - -/*************************************************************************/ - -/** - * Adds a pointer to the list. Returns the index of the new item. - * Returns -2 if there are too many items in the list, -3 if the - * item already exists when the flags of the list contain SLISTF_NODUP. - * @param slist Slist Struct - * @param item Item being added - * @return int - */ -int slist_add(SList * slist, void *item) -{ - if (slist->limit != 0 && slist->count >= slist->limit) - return -2; - if (slist->opts && (slist->opts->flags & SLISTF_NODUP) - && slist_indexof(slist, item) != -1) - return -3; - if (slist->capacity == slist->count) - slist_setcapacity(slist, slist->capacity + 1); - - if (slist->opts && (slist->opts->flags & SLISTF_SORT) - && slist->opts->compareitem) { - int i; - - for (i = 0; i < slist->count; i++) { - if (slist->opts->compareitem(slist, item, slist->list[i]) <= 0) { - memmove(&slist->list[i + 1], &slist->list[i], - sizeof(void *) * (slist->count - i)); - slist->list[i] = item; - break; - } - } - - if (i == slist->count) - slist->list[slist->count] = item; - } else { - slist->list[slist->count] = item; - } - - return slist->count++; -} - -/*************************************************************************/ - -/** - * Clears the list. If free is 1, the freeitem function will be called - * for each item before clearing. - * @param slist Slist Struct - * @param mustfree What is being freed - * @return void - */ -void slist_clear(SList * slist, int mustfree) -{ - if (mustfree && slist->opts && slist->opts->freeitem && slist->count) { - int i; - - for (i = 0; i < slist->count; i++) - if (slist->list[i]) - slist->opts->freeitem(slist, slist->list[i]); - } - - if (slist->list) { - free(slist->list); - slist->list = NULL; - } - slist->capacity = 0; - slist->count = 0; -} - -/*************************************************************************/ - -/** - * Deletes an item from the list, by index. Returns 1 if successful, - * 0 otherwise. - * @param slist Slist Struct - * @param index beign deleted - * @return int Returns 1 if successful, 0 otherwise. - */ -int slist_delete(SList * slist, int index) -{ - /* Range check */ - if (index >= slist->count) - return 0; - - if (slist->list[index] && slist->opts && slist->opts->freeitem) - slist->opts->freeitem(slist, slist->list[index]); - - slist->list[index] = NULL; - slist->count--; - - if (index < slist->count) - memmove(&slist->list[index], &slist->list[index + 1], - sizeof(void *) * (slist->count - index)); - - slist_setcapacity(slist, slist->capacity - 1); - - return 1; -} - -/*************************************************************************/ - -/** - * Deletes a range of entries. Return -1 if the permission was denied, - * 0 if no records were deleted, or the number of records deleted - * @param slist Slist Struct - * @param range Range to delete - * @param cb Call back function - * @param ... various args - * @return int - */ -int slist_delete_range(SList * slist, const char *crange, slist_delcheckcb_t cb, ...) -{ - int count = 0, i, n1, n2; - va_list args, preserve; - char *range = const_cast<char *>(crange); // XXX: unsafe cast - - va_start(args, cb); - - for (;;) { - n1 = n2 = strtol(range, &range, 10); - range += strcspn(range, "0123456789,-"); - - if (*range == '-') { - range++; - range += strcspn(range, "0123456789,"); - if (isdigit(*range)) { - n2 = strtol(range, &range, 10); - range += strcspn(range, "0123456789,-"); - } - } - - for (i = n1; i <= n2 && i > 0 && i <= slist->count; i++) { - - if (!slist->list[i - 1]) - continue; - - /* copy this off the stack for safety's sake --nenolod */ - VA_COPY(preserve, args); - - if (cb && !cb(slist, slist->list[i - 1], preserve)) { - va_end(preserve); - return -1; - } - - /* if it's to be freed, lets free it */ - if (slist->opts && slist->opts->freeitem) - slist->opts->freeitem(slist, slist->list[i - 1]); - slist->list[i - 1] = NULL; - - /* and release the copied list */ - va_end(preserve); - - count++; - } - - range += strcspn(range, ","); - if (*range) - range++; - else - break; - } - - /* We only really delete the items from the list after having processed - * everything because it would change the position of the items in the - * list otherwise. - */ - slist_pack(slist); - - va_end(args); - return count; -} - -/*************************************************************************/ - -/** - * Enumerates all entries of the list. If range is not NULL, will only - * enumerate entries that are in the range. Returns the total number - * of entries enumerated. - * @param slit Slist struct - * @param range Range to enum - * @param cb Call back function - * @param ... various args - * @return int - */ -int slist_enum(SList * slist, const char *crange, slist_enumcb_t cb, ...) -{ - int count = 0, i, res; - va_list args, preserve; - char *range = const_cast<char *>(crange); // XXX: unsafe cast - - va_start(args, cb); - - if (!range) { - for (i = 0; i < slist->count; i++) { - if (!slist->list[i]) { - Alog() << "SList: warning: NULL pointer in the list (?)"; - continue; - } - - /* copy off stack for safety */ - VA_COPY(preserve, args); - - res = cb(slist, i + 1, slist->list[i], preserve); - if (res < 0) { - va_end(preserve); - break; - } - - /* and release our copy */ - va_end(preserve); - - count += res; - } - } else { - int n1, n2; - - for (;;) { - res = 0; - n1 = n2 = strtol(range, &range, 10); - range += strcspn(range, "0123456789,-"); - if (*range == '-') { - range++; - range += strcspn(range, "0123456789,"); - if (isdigit(*range)) { - n2 = strtol(range, &range, 10); - range += strcspn(range, "0123456789,-"); - } - } - for (i = n1; i <= n2 && i > 0 && i <= slist->count; i++) { - if (!slist->list[i - 1]) { - Alog() << "SList: warning: NULL pointer in the list (?)"; - continue; - } - - /* copy off stack for safety */ - VA_COPY(preserve, args); - - res = cb(slist, i, slist->list[i - 1], preserve); - if (res < 0) { - va_end(preserve); - break; - } - count += res; - - /* and release our copy */ - va_end(preserve); - } - if (res < -1) - break; - range += strcspn(range, ","); - if (*range) - range++; - else - break; - } - } - - va_end(args); - - return count; -} - -/*************************************************************************/ - -/** - * Determines whether the list is full. - * @param slist Slist Struct - * @return int - */ -int slist_full(SList * slist) -{ - if (slist->limit != 0 && slist->count >= slist->limit) - return 1; - else - return 0; -} - -/*************************************************************************/ - -/** - * Initialization of the list. - * @param slist Slist Struct - * @return int - */ -void slist_init(SList * slist) -{ - memset(slist, 0, sizeof(SList)); - slist->limit = SLIST_DEFAULT_LIMIT; - slist->opts = &slist_defopts; -} - -/*************************************************************************/ - -/** - * Returns the index of an item in the list, -1 if inexistant. - * @param slist Slist Struct - * @param item Item index - * @return int - */ -int slist_indexof(SList * slist, void *item) -{ - int16 i; - void *entry; - - if (slist->count == 0) - return -1; - - for (i = 0, entry = slist->list[0]; i < slist->count; - i++, entry = slist->list[i]) { - if ((slist->opts - && slist->opts->isequal) ? (slist->opts->isequal(slist, item, - entry)) - : (item == entry)) - return i; - } - - return -1; -} - -/*************************************************************************/ - -/** - * Removes all NULL pointers from the list. - * @param slist Slist Struct - * @return void - */ -void slist_pack(SList * slist) -{ - int i; - - for (i = slist->count - 1; i >= 0; i--) - if (!slist->list[i]) - slist_delete(slist, i); -} - -/*************************************************************************/ - -/** - * Removes a specific item from the list. Returns the old index of the - * deleted item, or -1 if the item was not found. - * @param slist Slist Struct - * @param item to remove - * @return int - */ -int slist_remove(SList * slist, void *item) -{ - int index = slist_indexof(slist, item); - if (index == -1) - return -1; - slist_delete(slist, index); - return index; -} - -/*************************************************************************/ - -/** - * Sets the maximum capacity of the list - * @param slist Slist Struct - * @param capacity How large the list can be - * @return int - */ -int slist_setcapacity(SList * slist, int16 capacity) -{ - if (slist->capacity == capacity) - return 1; - slist->capacity = capacity; - if (slist->capacity) - slist->list = - static_cast<void **>(srealloc(slist->list, sizeof(void *) * slist->capacity)); - else { - free(slist->list); - slist->list = NULL; - } - if (slist->capacity < slist->count) - slist->count = slist->capacity; - return 1; -} diff --git a/src/tools/db-convert.c b/src/tools/db-convert.c index 0f8a35ebc..4e3d01034 100644 --- a/src/tools/db-convert.c +++ b/src/tools/db-convert.c @@ -969,7 +969,7 @@ int main(int argc, char *argv[]) fs << "OS AKILL " << user << " " << host << " " << by << " " << seton << " " << expires << " :" << reason << std::endl; free(user); free(host); free(by); free(reason); } - /* SGLINES */ + /* SNLINES */ read_int16(&capacity, f); for (i = 0; i < capacity; i++) { @@ -978,7 +978,7 @@ int main(int argc, char *argv[]) SAFE(read_string(&reason, f)); SAFE(read_int32(&seton, f)); SAFE(read_int32(&expires, f)); - fs << "OS SGLINE " << mask << " " << by << " " << seton << " " << expires << " :" << reason << std::endl; + fs << "OS SNLINE " << mask << " " << by << " " << seton << " " << expires << " :" << reason << std::endl; free(mask); free(by); free(reason); } /* SQLINES */ diff --git a/src/users.c b/src/users.c index 4311f8d33..946f70f6a 100644 --- a/src/users.c +++ b/src/users.c @@ -849,20 +849,11 @@ User *do_nick(const char *source, const char *nick, const char *username, const if (MOD_RESULT == EVENT_STOP) return finduser(nick); - check_akill(nick, username, host, vhost, ipbuf); - - if (ircd->sgline) - check_sgline(nick, realname); - - if (ircd->sqline) - check_sqline(nick, 0); - - if (ircd->szline && ircd->nickip) - check_szline(nick, ipbuf); - if (Config.LimitSessions && !serv->IsULined()) add_session(nick, host, ipbuf); + XLineManager::CheckAll(user); + /* User is no longer connected, return */ if (!finduser(nick)) return NULL; @@ -937,7 +928,7 @@ User *do_nick(const char *source, const char *nick, const char *username, const if (ircd->sqline) { - if (!is_oper(user) && check_sqline(user->nick.c_str(), 1)) + if (!is_oper(user) && SQLine->Check(user)) return NULL; } } |