Anope IRC Services  Version 2.0
bahamut.cpp
Go to the documentation of this file.
1 /* Bahamut functions
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  */
11 
12 #include "module.h"
13 
15 {
16  public:
17  ChannelModeFlood(char modeChar, bool minusNoArg) : ChannelModeParam("FLOOD", modeChar, minusNoArg) { }
18 
20  {
21  try
22  {
23  Anope::string rest;
24  if (!value.empty() && value[0] != ':' && convertTo<int>(value[0] == '*' ? value.substr(1) : value, rest, false) > 0 && rest[0] == ':' && rest.length() > 1 && convertTo<int>(rest.substr(1), rest, false) > 0 && rest.empty())
25  return true;
26  }
27  catch (const ConvertException &) { }
28 
29  return false;
30  }
31 };
32 
34 {
35  public:
36  BahamutIRCdProto(Module *creator) : IRCDProto(creator, "Bahamut 1.8.x")
37  {
39  CanSVSNick = true;
40  CanSNLine = true;
41  CanSQLine = true;
42  CanSQLineChannel = true;
43  CanSZLine = true;
44  CanSVSHold = true;
45  MaxModes = 60;
46  }
47 
48  void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override
49  {
50  if (Servers::Capab.count("TSMODE") > 0)
51  {
52  UplinkSocket::Message(source) << "MODE " << dest->name << " " << dest->creation_time << " " << buf;
53  }
54  else
55  IRCDProto::SendModeInternal(source, dest, buf);
56  }
57 
58  void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override
59  {
60  UplinkSocket::Message(source) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf;
61  }
62 
63  void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
64  {
65  UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg;
66  }
67 
68  void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
69  {
70  UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg;
71  }
72 
73  /* SVSHOLD - set */
74  void SendSVSHold(const Anope::string &nick, time_t time) anope_override
75  {
76  UplinkSocket::Message(Me) << "SVSHOLD " << nick << " " << time << " :Being held for registered user";
77  }
78 
79  /* SVSHOLD - release */
81  {
82  UplinkSocket::Message(Me) << "SVSHOLD " << nick << " 0";
83  }
84 
85  /* SQLINE */
86  void SendSQLine(User *, const XLine *x) anope_override
87  {
88  UplinkSocket::Message() << "SQLINE " << x->mask << " :" << x->GetReason();
89  }
90 
91  /* UNSLINE */
93  {
94  UplinkSocket::Message() << "UNSGLINE 0 :" << x->mask;
95  }
96 
97  /* UNSZLINE */
99  {
100  /* this will likely fail so its only here for legacy */
101  UplinkSocket::Message() << "UNSZLINE 0 " << x->GetHost();
102  /* this is how we are supposed to deal with it */
103  UplinkSocket::Message() << "RAKILL " << x->GetHost() << " *";
104  }
105 
106  /* SZLINE */
108  {
109  // Calculate the time left before this would expire, capping it at 2 days
110  time_t timeleft = x->expires - Anope::CurTime;
111  if (timeleft > 172800 || !x->expires)
112  timeleft = 172800;
113  /* this will likely fail so its only here for legacy */
114  UplinkSocket::Message() << "SZLINE " << x->GetHost() << " :" << x->GetReason();
115  /* this is how we are supposed to deal with it */
116  UplinkSocket::Message() << "AKILL " << x->GetHost() << " * " << timeleft << " " << x->by << " " << Anope::CurTime << " :" << x->GetReason();
117  }
118 
119  /* SVSNOOP */
120  void SendSVSNOOP(const Server *server, bool set) anope_override
121  {
122  UplinkSocket::Message() << "SVSNOOP " << server->GetName() << " " << (set ? "+" : "-");
123  }
124 
125  /* SGLINE */
127  {
128  UplinkSocket::Message() << "SGLINE " << x->mask.length() << " :" << x->mask << ":" << x->GetReason();
129  }
130 
131  /* RAKILL */
133  {
134  if (x->IsRegex() || x->HasNickOrReal())
135  return;
136 
137  /* ZLine if we can instead */
138  if (x->GetUser() == "*")
139  {
140  cidr a(x->GetHost());
141  if (a.valid())
142  {
143  IRCD->SendSZLineDel(x);
144  return;
145  }
146  }
147 
148  UplinkSocket::Message() << "RAKILL " << x->GetHost() << " " << x->GetUser();
149  }
150 
151  /* TOPIC */
153  {
154  UplinkSocket::Message(source) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_ts << " :" << c->topic;
155  }
156 
157  /* UNSQLINE */
159  {
160  UplinkSocket::Message() << "UNSQLINE " << x->mask;
161  }
162 
163  /* JOIN - SJOIN */
164  void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
165  {
166  UplinkSocket::Message(user) << "SJOIN " << c->creation_time << " " << c->name;
167  if (status)
168  {
169  /* First save the channel status incase uc->Status == status */
170  ChannelStatus cs = *status;
171  /* If the user is internally on the channel with flags, kill them so that
172  * the stacker will allow this.
173  */
174  ChanUserContainer *uc = c->FindUser(user);
175  if (uc != NULL)
176  uc->status.Clear();
177 
178  BotInfo *setter = BotInfo::Find(user->GetUID());
179  for (size_t i = 0; i < cs.Modes().length(); ++i)
180  c->SetMode(setter, ModeManager::FindChannelModeByChar(cs.Modes()[i]), user->GetUID(), false);
181 
182  if (uc != NULL)
183  uc->status = cs;
184  }
185  }
186 
188  {
189  if (x->IsRegex() || x->HasNickOrReal())
190  {
191  if (!u)
192  {
193  /* No user (this akill was just added), and contains nick and/or realname. Find users that match and ban them */
194  for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
195  if (x->manager->Check(it->second, x))
196  this->SendAkill(it->second, x);
197  return;
198  }
199 
200  const XLine *old = x;
201 
202  if (old->manager->HasEntry("*@" + u->host))
203  return;
204 
205  /* We can't akill x as it has a nick and/or realname included, so create a new akill for *@host */
206  x = new XLine("*@" + u->host, old->by, old->expires, old->reason, old->id);
207  old->manager->AddXLine(x);
208 
209  Log(Config->GetClient("OperServ"), "akill") << "AKILL: Added an akill for " << x->mask << " because " << u->GetMask() << "#" << u->realname << " matches " << old->mask;
210  }
211 
212  /* ZLine if we can instead */
213  if (x->GetUser() == "*")
214  {
215  cidr a(x->GetHost());
216  if (a.valid())
217  {
218  IRCD->SendSZLine(u, x);
219  return;
220  }
221  }
222 
223  // Calculate the time left before this would expire, capping it at 2 days
224  time_t timeleft = x->expires - Anope::CurTime;
225  if (timeleft > 172800)
226  timeleft = 172800;
227  UplinkSocket::Message() << "AKILL " << x->GetHost() << " " << x->GetUser() << " " << timeleft << " " << x->by << " " << Anope::CurTime << " :" << x->GetReason();
228  }
229 
230  /*
231  Note: if the stamp is null 0, the below usage is correct of Bahamut
232  */
233  void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override
234  {
235  UplinkSocket::Message(source) << "SVSKILL " << user->nick << " :" << buf;
236  }
237 
239  {
240  UplinkSocket::Message() << "BURST";
241  }
242 
244  {
245  UplinkSocket::Message() << "BURST 0";
246  }
247 
249  {
250  Anope::string modes = "+" + u->GetModes();
251  UplinkSocket::Message() << "NICK " << u->nick << " 1 " << u->timestamp << " " << modes << " " << u->GetIdent() << " " << u->host << " " << u->server->GetName() << " 0 0 :" << u->realname;
252  }
253 
254  /* SERVER */
255  void SendServer(const Server *server) anope_override
256  {
257  UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription();
258  }
259 
261  {
262  UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " :TS";
263  UplinkSocket::Message() << "CAPAB SSJOIN NOQUIT BURST UNCONNECT NICKIP TSMODE TS3";
264  SendServer(Me);
265  /*
266  * SVINFO
267  * parv[0] = sender prefix
268  * parv[1] = TS_CURRENT for the server
269  * parv[2] = TS_MIN for the server
270  * parv[3] = server is standalone or connected to non-TS only
271  * parv[4] = server's idea of UTC time
272  */
273  UplinkSocket::Message() << "SVINFO 3 1 0 :" << Anope::CurTime;
274  this->SendBOB();
275  }
276 
278  {
279  Anope::string modes = c->GetModes(true, true);
280  if (modes.empty())
281  modes = "+";
282  UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :";
283  }
284 
286  {
287  IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %d", u->signon);
288  }
289 
291  {
292  IRCD->SendMode(Config->GetClient("NickServ"), u, "+d 1");
293  }
294 };
295 
297 {
299 
300  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
301  {
302  /* If we found a server with the given source, that one just
303  * finished bursting. If there was no source, then our uplink
304  * server finished bursting. -GD
305  */
306  Server *s = source.GetServer();
307  if (!s)
308  s = Me->GetLinks().front();
309  if (s)
310  s->Sync(true);
311  }
312 };
313 
315 {
316  IRCDMessageMode(Module *creator, const Anope::string &sname) : IRCDMessage(creator, sname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
317 
318  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
319  {
320  if (params.size() > 2 && IRCD->IsChannelValid(params[0]))
321  {
322  Channel *c = Channel::Find(params[0]);
323  time_t ts = 0;
324 
325  try
326  {
327  ts = convertTo<time_t>(params[1]);
328  }
329  catch (const ConvertException &) { }
330 
331  if (c)
332  c->SetModesInternal(source, params[2], ts);
333  }
334  else
335  {
336  User *u = User::Find(params[0]);
337  if (u)
338  u->SetModesInternal(source, "%s", params[1].c_str());
339  }
340  }
341 };
342 
343 /*
344  ** NICK - new
345  ** source = NULL
346  ** parv[0] = nickname
347  ** parv[1] = hopcount
348  ** parv[2] = timestamp
349  ** parv[3] = modes
350  ** parv[4] = username
351  ** parv[5] = hostname
352  ** parv[6] = server
353  ** parv[7] = servicestamp
354  ** parv[8] = IP
355  ** parv[9] = info
356  ** NICK - change
357  ** source = oldnick
358  ** parv[0] = new nickname
359  ** parv[1] = hopcount
360  */
362 {
363  IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
364 
365  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
366  {
367  if (params.size() == 10)
368  {
369  Server *s = Server::Find(params[6]);
370  if (s == NULL)
371  {
372  Log(LOG_DEBUG) << "User " << params[0] << " introduced from nonexistant server " << params[6] << "?";
373  return;
374  }
375 
376  NickAlias *na = NULL;
377  time_t signon = params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0,
378  stamp = params[7].is_pos_number_only() ? convertTo<time_t>(params[7]) : 0;
379  if (signon && signon == stamp)
380  na = NickAlias::Find(params[0]);
381 
382  User::OnIntroduce(params[0], params[4], params[5], "", params[8], s, params[9], signon, params[3], "", na ? *na->nc : NULL);
383  }
384  else
385  source.GetUser()->ChangeNick(params[0]);
386  }
387 };
388 
390 {
392 
393  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
394  {
395  unsigned int hops = Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
396  new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[2]);
397  }
398 };
399 
401 {
402  IRCDMessageSJoin(Module *creator) : IRCDMessage(creator, "SJOIN", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
403 
404  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
405  {
407  if (params.size() >= 4)
408  for (unsigned i = 2; i < params.size(); ++i)
409  modes += " " + params[i];
410  if (!modes.empty())
411  modes.erase(modes.begin());
412 
413  std::list<Message::Join::SJoinUser> users;
414 
415  /* For some reason, bahamut will send a SJOIN from the user joining a channel
416  * if the channel already existed
417  */
418  if (source.GetUser())
419  {
421  sju.second = source.GetUser();
422  users.push_back(sju);
423  }
424  else
425  {
426  spacesepstream sep(params[params.size() - 1]);
427  Anope::string buf;
428 
429  while (sep.GetToken(buf))
430  {
432 
433  /* Get prefixes from the nick */
434  for (char ch; (ch = ModeManager::GetStatusChar(buf[0]));)
435  {
436  buf.erase(buf.begin());
437  sju.first.AddMode(ch);
438  }
439 
440  sju.second = User::Find(buf);
441  if (!sju.second)
442  {
443  Log(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << params[1];
444  continue;
445  }
446 
447  users.push_back(sju);
448  }
449  }
450 
451  time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime;
452  Message::Join::SJoin(source, params[1], ts, modes, users);
453  }
454 };
455 
457 {
458  IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 4) { }
459 
460  void Run(MessageSource &, const std::vector<Anope::string> &params) anope_override
461  {
462  Channel *c = Channel::Find(params[0]);
463  if (c)
464  c->ChangeTopicInternal(params[1], params[3], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime);
465  }
466 };
467 
468 class ProtoBahamut : public Module
469 {
471 
472  /* Core message handlers */
491 
492  /* Our message handlers */
499 
500  void AddModes()
501  {
502  /* Add user modes */
503  ModeManager::AddUserMode(new UserModeOperOnly("SERV_ADMIN", 'A'));
504  ModeManager::AddUserMode(new UserMode("REGPRIV", 'R'));
505  ModeManager::AddUserMode(new UserModeOperOnly("ADMIN", 'a'));
506  ModeManager::AddUserMode(new UserMode("INVIS", 'i'));
507  ModeManager::AddUserMode(new UserModeOperOnly("OPER", 'o'));
508  ModeManager::AddUserMode(new UserModeNoone("REGISTERED", 'r'));
509  ModeManager::AddUserMode(new UserModeOperOnly("SNOMASK", 's'));
510  ModeManager::AddUserMode(new UserModeOperOnly("WALLOPS", 'w'));
511  ModeManager::AddUserMode(new UserMode("DEAF", 'd'));
512 
513  /* b/e/I */
515 
516  /* v/h/o/a/q */
517  ModeManager::AddChannelMode(new ChannelModeStatus("VOICE", 'v', '+', 0));
518  ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@', 1));
519 
520  /* Add channel modes */
521  ModeManager::AddChannelMode(new ChannelMode("BLOCKCOLOR", 'c'));
522  ModeManager::AddChannelMode(new ChannelMode("INVITE", 'i'));
525  ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true));
526  ModeManager::AddChannelMode(new ChannelMode("MODERATED", 'm'));
527  ModeManager::AddChannelMode(new ChannelMode("NOEXTERNAL", 'n'));
528  ModeManager::AddChannelMode(new ChannelMode("PRIVATE", 'p'));
529  ModeManager::AddChannelMode(new ChannelModeNoone("REGISTERED", 'r'));
530  ModeManager::AddChannelMode(new ChannelMode("SECRET", 's'));
531  ModeManager::AddChannelMode(new ChannelMode("TOPIC", 't'));
532  ModeManager::AddChannelMode(new ChannelMode("REGMODERATED", 'M'));
533  ModeManager::AddChannelMode(new ChannelModeOperOnly("OPERONLY", 'O'));
534  ModeManager::AddChannelMode(new ChannelMode("REGISTEREDONLY", 'R'));
535  }
536 
537  public:
538  ProtoBahamut(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
539  ircd_proto(this),
540  message_away(this), message_capab(this), message_error(this), message_invite(this),
541  message_join(this), message_kick(this), message_kill(this), message_motd(this), message_notice(this),
542  message_part(this), message_ping(this), message_privmsg(this), message_quit(this),
543  message_squit(this), message_stats(this), message_time(this), message_version(this), message_whois(this),
544 
545  message_burst(this), message_mode(this, "MODE"), message_svsmode(this, "SVSMODE"),
546  message_nick(this), message_server(this), message_sjoin(this), message_topic(this)
547  {
548 
549  this->AddModes();
550 
551  }
552 
554  {
556  IRCD->SendLogout(u);
557  }
558 };
559 
Serialize::Reference< NickCore > nc
Definition: account.h:47
Definition: bots.h:24
IRCDMessageTopic(Module *creator)
Definition: bahamut.cpp:458
bool CanSZLine
Definition: protocol.h:61
static NickAlias * Find(const Anope::string &nick)
Definition: nickalias.cpp:121
Definition: servers.h:42
IRCDMessageServer(Module *creator)
Definition: bahamut.cpp:391
void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override
Definition: bahamut.cpp:233
Anope::string reason
Definition: xline.h:29
bool CanSNLine
Definition: protocol.h:55
void SendAkill(User *u, XLine *x) anope_override
Definition: bahamut.cpp:187
Anope::string mask
Definition: xline.h:24
bool CanSQLineChannel
Definition: protocol.h:59
void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
Definition: bahamut.cpp:164
IRCDMessageSJoin(Module *creator)
Definition: bahamut.cpp:402
void SendSZLine(User *, const XLine *x) anope_override
Definition: bahamut.cpp:107
XLineManager * manager
Definition: xline.h:30
void RemoveModeInternal(const MessageSource &setter, UserMode *um)
Definition: users.cpp:554
void SetMode(BotInfo *bi, UserMode *um, const Anope::string &param="")
Definition: users.cpp:573
Message::Away message_away
Definition: bahamut.cpp:473
void SendChannel(Channel *c) anope_override
Definition: bahamut.cpp:277
time_t signon
Definition: users.h:79
void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: bahamut.cpp:63
Message::Privmsg message_privmsg
Definition: bahamut.cpp:484
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: bahamut.cpp:393
void SendConnect() anope_override
Definition: bahamut.cpp:260
CoreExport std::set< Anope::string > Capab
Definition: servers.cpp:29
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: bahamut.cpp:365
void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override
Definition: bahamut.cpp:48
Message::Quit message_quit
Definition: bahamut.cpp:485
virtual void SendLogout(User *u)=0
void AddModes()
Definition: bahamut.cpp:500
void SendTopic(const MessageSource &source, Channel *c) anope_override
Definition: bahamut.cpp:152
Message::Part message_part
Definition: bahamut.cpp:482
static User * OnIntroduce(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc)
Definition: users.cpp:116
Message::Kick message_kick
Definition: bahamut.cpp:478
Definition: users.h:34
IRCDMessageServer message_server
Definition: bahamut.cpp:496
Anope::string DefaultPseudoclientModes
Definition: protocol.h:47
void SendLogout(User *u) anope_override
Definition: bahamut.cpp:290
void SendBOB() anope_override
Definition: bahamut.cpp:238
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: bahamut.cpp:300
Message::Error message_error
Definition: bahamut.cpp:475
IRCDMessageTopic message_topic
Definition: bahamut.cpp:498
Definition: sockets.h:87
void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: bahamut.cpp:68
Message::Kill message_kill
Definition: bahamut.cpp:479
static UserMode * FindUserModeByName(const Anope::string &name)
Definition: modes.cpp:550
CoreExport time_t CurTime
Definition: main.cpp:41
void SendClientIntroduction(User *u) anope_override
Definition: bahamut.cpp:248
void Sync(bool sync_links)
Definition: servers.cpp:250
iterator erase(const iterator &i)
Definition: anope.h:155
void SendSVSHoldDel(const Anope::string &nick) anope_override
Definition: bahamut.cpp:80
void SendLogin(User *u, NickAlias *) anope_override
Definition: bahamut.cpp:285
Message::Join message_join
Definition: bahamut.cpp:477
size_type length() const
Definition: anope.h:131
bool CanSQLine
Definition: protocol.h:57
Definition: Config.cs:26
bool CanSVSNick
Definition: protocol.h:49
Message::MOTD message_motd
Definition: bahamut.cpp:480
unsigned MaxModes
Definition: protocol.h:73
static char GetStatusChar(char symbol)
Definition: modes.cpp:558
static bool AddUserMode(UserMode *um)
Definition: modes.cpp:391
void SetFlag(IRCDMessageFlag f)
Definition: protocol.h:282
IRCDMessageNick message_nick
Definition: bahamut.cpp:495
void SendEOB() anope_override
Definition: bahamut.cpp:243
void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override
Definition: bahamut.cpp:58
void SendSGLine(User *, const XLine *x) anope_override
Definition: bahamut.cpp:126
void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts=Anope::CurTime)
Definition: channels.cpp:786
Definition: modes.h:68
virtual void SendSZLineDel(const XLine *)
Definition: protocol.h:117
static ChannelMode * FindChannelModeByChar(char mode)
Definition: modes.cpp:524
Anope::string by
Definition: xline.h:26
time_t expires
Definition: xline.h:28
void SendSVSHold(const Anope::string &nick, time_t time) anope_override
Definition: bahamut.cpp:74
static Anope::map< std::pair< bool, Anope::string > > modes
Definition: cs_mode.cpp:745
BahamutIRCdProto ircd_proto
Definition: bahamut.cpp:470
#define anope_override
Definition: services.h:56
bool empty() const
Definition: anope.h:126
Anope::string id
Definition: xline.h:31
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts=0, bool enforce_mlock=true)
Definition: channels.cpp:595
ChannelModeFlood(char modeChar, bool minusNoArg)
Definition: bahamut.cpp:17
static Server * Find(const Anope::string &name, bool name_only=false)
Definition: servers.cpp:337
CoreExport IRCDProto * IRCD
Definition: protocol.cpp:23
std::basic_string< char, ci_char_traits, std::allocator< char > > string
Definition: hashcomp.h:133
#define MODULE_INIT(x)
Definition: modules.h:45
void Run(MessageSource &, const std::vector< Anope::string > &params) anope_override
Definition: bahamut.cpp:460
IRCDMessageMode(Module *creator, const Anope::string &sname)
Definition: bahamut.cpp:316
const std::vector< Server * > & GetLinks() const
Definition: servers.cpp:216
virtual void SendSZLine(User *u, const XLine *)
Definition: protocol.h:116
IRCDMessageSJoin message_sjoin
Definition: bahamut.cpp:497
bool CanSVSHold
Definition: protocol.h:63
ChannelStatus status
Definition: channels.h:28
CoreExport int CurrentUplink
Definition: main.cpp:43
ProtoBahamut(const Anope::string &modname, const Anope::string &creator)
Definition: bahamut.cpp:538
std::pair< ChannelStatus, User * > SJoinUser
Definition: messages.h:57
XLine * HasEntry(const Anope::string &mask)
Definition: xline.cpp:391
virtual void SendModeInternal(const MessageSource &, const Channel *, const Anope::string &)
Definition: protocol.cpp:105
virtual bool IsChannelValid(const Anope::string &)
Definition: protocol.cpp:372
static User * Find(const Anope::string &name, bool nick_only=false)
Definition: users.cpp:815
void SendServer(const Server *server) anope_override
Definition: bahamut.cpp:255
void Clear()
Definition: modes.cpp:91
static bool AddChannelMode(ChannelMode *cm)
Definition: modes.cpp:418
Message::Time message_time
Definition: bahamut.cpp:488
Message::Ping message_ping
Definition: bahamut.cpp:483
static Channel * Find(const Anope::string &name)
Definition: channels.cpp:920
Definition: xline.h:18
void SendSZLineDel(const XLine *x) anope_override
Definition: bahamut.cpp:98
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: bahamut.cpp:318
CoreExport Server * Me
Definition: servers.cpp:24
CoreExport user_map UserListByNick
Definition: users.cpp:28
const Anope::string & Modes() const
Definition: modes.cpp:96
void SendSQLineDel(const XLine *x) anope_override
Definition: bahamut.cpp:158
void SetModesInternal(const MessageSource &source, const char *umodes,...)
Definition: users.cpp:645
IRCDMessageBurst message_burst
Definition: bahamut.cpp:493
Definition: logger.h:53
void OnUserNickChange(User *u, const Anope::string &) anope_override
Definition: bahamut.cpp:553
Message::Notice message_notice
Definition: bahamut.cpp:481
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list< SJoinUser > &users)
Definition: messages.cpp:97
virtual void SendMode(const MessageSource &source, const Channel *dest, const char *fmt,...)
Definition: protocol.cpp:188
void SendAkillDel(const XLine *x) anope_override
Definition: bahamut.cpp:132
void AddXLine(XLine *x)
Definition: xline.cpp:286
IRCDMessageMode message_mode
Definition: bahamut.cpp:494
iterator begin()
Definition: anope.h:282
void SendSGLineDel(const XLine *x) anope_override
Definition: bahamut.cpp:92
Message::Stats message_stats
Definition: bahamut.cpp:487
bool IsValid(Anope::string &value) const anope_override
Definition: bahamut.cpp:19
Message::Capab message_capab
Definition: bahamut.cpp:474
Message::SQuit message_squit
Definition: bahamut.cpp:486
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: bahamut.cpp:404
static BotInfo * Find(const Anope::string &nick, bool nick_only=false)
Definition: bots.cpp:249
IRCDMessageNick(Module *creator)
Definition: bahamut.cpp:363
IRCDMessageBurst(Module *creator)
Definition: bahamut.cpp:298
void SendSQLine(User *, const XLine *x) anope_override
Definition: bahamut.cpp:86
BahamutIRCdProto(Module *creator)
Definition: bahamut.cpp:36
Message::Version message_version
Definition: bahamut.cpp:489
IRCDMessageMode message_svsmode
Definition: bahamut.cpp:494
void SendSVSNOOP(const Server *server, bool set) anope_override
Definition: bahamut.cpp:120
Message::Invite message_invite
Definition: bahamut.cpp:476
Message::Whois message_whois
Definition: bahamut.cpp:490