diff options
| author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-04 05:45:58 +0000 |
|---|---|---|
| committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-04 05:45:58 +0000 |
| commit | 2708eea5d13c249143b83fbaa8b552992f0ac8b6 (patch) | |
| tree | 5afffad5f83ca6daa89784c27f4d4e9c5f4eb8fc | |
| parent | f58026749b0c0770a322893b27c013168be5cdbc (diff) | |
Removed NICKMAX and CHANMAX, replaced user->nick, c->name, and ci->name with std::string
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2732 5417fbe8-f217-4b02-8779-1006273d7864
113 files changed, 636 insertions, 680 deletions
diff --git a/data/example.conf b/data/example.conf index 7299b5f04..c90b90eb0 100644 --- a/data/example.conf +++ b/data/example.conf @@ -222,10 +222,10 @@ networkinfo networkname = "LocalNet" /* - * Set this to the maximum allowed nick length on your network. Anope does not - * support values larger than 31. Be sure to set this correctly, as setting - * this wrong can result in Services being disconnected from the network. - * This directive is optional, but recommended. + * Set this to the maximum allowed nick length on your network. + * Be sure to set this correctly, as setting this wrong can result in + * Services being disconnected from the network. This directive is optional, + * but recommended. */ nicklen = 31 } diff --git a/include/config.h b/include/config.h index a5151e071..c6a0cb9d2 100644 --- a/include/config.h +++ b/include/config.h @@ -50,17 +50,6 @@ * unusable. */ -/* Maximum length of a channel name, including the trailing null. Any - * channels with a length longer than (CHANMAX-1) including the leading # - * will not be usable with ChanServ. */ -#define CHANMAX 64 - -/* Maximum length of a nickname, including the trailing null. This MUST be - * at least one greater than the maximum allowable nickname length on your - * network, or people will run into problems using Services! The default - * (32) works with all servers I know of. */ -#define NICKMAX 32 - /* Maximum length of a password */ #define PASSMAX 32 diff --git a/include/regchannel.h b/include/regchannel.h index 8a906c818..a6275db1d 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -80,7 +80,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag> ~ChannelInfo(); ChannelInfo *next, *prev; - char name[CHANMAX]; + std::string name; /* Channel name */ NickCore *founder; NickCore *successor; /* Who gets the channel if the founder * nick is dropped or expires */ @@ -91,7 +91,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag> time_t time_registered; time_t last_used; char *last_topic; /* Last topic on the channel */ - char last_topic_setter[NICKMAX]; /* Who set the last topic */ + std::string last_topic_setter; /* Who set the last topic */ time_t last_topic_time; /* When the last topic was set */ char *forbidby; diff --git a/include/services.h b/include/services.h index 9393c9091..0465fa631 100644 --- a/include/services.h +++ b/include/services.h @@ -495,7 +495,7 @@ class Memo : public Flags<MemoFlag> public: uint32 number; /* Index number -- not necessarily array position! */ time_t time; /* When it was sent */ - char sender[NICKMAX]; + std::string sender; char *text; }; @@ -854,11 +854,11 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags> ~Channel(); Channel *next, *prev; - char name[CHANMAX]; + std::string name; /* Channel name */ ChannelInfo *ci; /* Corresponding ChannelInfo */ time_t creation_time; /* When channel was created */ char *topic; - char topic_setter[NICKMAX]; /* Who set the topic */ + std::string topic_setter; time_t topic_time; /* When topic was set */ std::bitset<128> modes; @@ -1055,7 +1055,7 @@ struct NewsItem NewsType type; uint32 num; std::string Text; - char who[NICKMAX]; + std::string who; time_t time; }; @@ -1101,7 +1101,7 @@ struct sxline_ { struct exception_ { char *mask; /* Hosts to which this exception applies */ int limit; /* Session limit for exception */ - char who[NICKMAX]; /* Nick of person who added the exception */ + std::string who; /* Nick of person who added the exception */ char *reason; /* Reason for exception's addition */ time_t time; /* When this exception was added */ time_t expires; /* Time when it expires. 0 == no expiry */ diff --git a/include/users.h b/include/users.h index 3733609ac..0d702bb19 100644 --- a/include/users.h +++ b/include/users.h @@ -29,7 +29,7 @@ class CoreExport User : public Extensible public: // XXX: exposing a tiny bit too much User *next, *prev; - char nick[NICKMAX]; + std::string nick; /* User's current nick */ char *host; /* User's real hostname */ char *hostip; /* User's IP number */ diff --git a/src/actions.c b/src/actions.c index 6ed840653..0e15f2cf4 100644 --- a/src/actions.c +++ b/src/actions.c @@ -97,8 +97,8 @@ void sqline(const std::string &mask, const std::string &reason) cunext = cu->next; if (is_oper(cu->user)) continue; - av[0] = c->name; - av[1] = cu->user->nick; + av[0] = c->name.c_str(); + av[1] = cu->user->nick.c_str(); av[2] = reason.c_str(); ircdproto->SendKick(findbot(Config.s_OperServ), c, cu->user, "Q-Lined: %s", av[2]); do_kick(Config.s_ChanServ, 3, av); @@ -158,7 +158,7 @@ void common_unban(ChannelInfo *ci, const std::string &nick) for (ban = ci->c->bans->entries; ban; ban = next) { next = ban->next; - if (entry_match(ban, u->nick, u->GetIdent().c_str(), u->host, ip) || entry_match(ban, u->nick, u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip)) + if (entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->host, ip) || entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip)) ci->c->RemoveMode(NULL, CMODE_BAN, ban->mask); } } diff --git a/src/bots.cpp b/src/bots.cpp index cae202bf2..ddd517b77 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -167,7 +167,7 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci) if (ci->c && ci->c->usercount >= Config.BSMinUsers) { if (u) - ircdproto->SendPart(ci->bi, ci->c, "UNASSIGN from %s", u->nick); + ircdproto->SendPart(ci->bi, ci->c, "UNASSIGN from %s", u->nick.c_str()); else ircdproto->SendPart(ci->bi, ci->c, ""); } diff --git a/src/botserv.c b/src/botserv.c index bbe3f30c9..f145e7028 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -91,7 +91,7 @@ void botserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { *s = 0; } - ircdproto->SendCTCP(findbot(Config.s_BotServ), u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(Config.s_BotServ), u->nick.c_str(), "PING %s", s); } else { mod_run_cmd(Config.s_BotServ, u, BOTSERV, cmd); } @@ -114,7 +114,7 @@ void botmsgs(User * u, BotInfo * bi, char *buf) if (!(s = strtok(NULL, ""))) { *s = 0; } - ircdproto->SendCTCP(bi, u->nick, "PING %s", s); + ircdproto->SendCTCP(bi, u->nick.c_str(), "PING %s", s); } else if (cmd && bi->cmdTable) { @@ -145,7 +145,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) /* Answer to ping if needed, without breaking the buffer. */ if (!strnicmp(buf, "\1PING", 5)) { - ircdproto->SendCTCP(ci->bi, u->nick, "PING %s", buf); + ircdproto->SendCTCP(ci->bi, u->nick.c_str(), "PING %s", buf); } /* If it's a /me, cut the CTCP part at the beginning (not @@ -409,7 +409,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) /* return if the user is on the ignore list */ - if (get_ignore(u->nick) != NULL) { + if (get_ignore(u->nick.c_str()) != NULL) { return; } @@ -650,7 +650,7 @@ void bot_join(ChannelInfo * ci) "%s invited %s into the channel.", ci->bi->nick, ci->bi->nick); } - ircdproto->SendJoin(ci->bi, ci->c->name, ci->c->creation_time); + ircdproto->SendJoin(ci->bi, ci->c->nam |
