Anope IRC Services  Version 2.0
hybrid.cpp
Go to the documentation of this file.
1 /* ircd-hybrid-8 protocol module
2  *
3  * (C) 2003-2014 Anope Team
4  * (C) 2012-2014 ircd-hybrid development team
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 
13 #include "module.h"
14 
16 
17 class HybridProto : public IRCDProto
18 {
20  {
21  BotInfo *bi = Config->GetClient("OperServ");
22  if (bi && bi->introduced)
23  return bi;
24 
25  for (botinfo_map::iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it)
26  if (it->second->introduced)
27  return it->second;
28 
29  return NULL;
30  }
31 
32  void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override
33  {
34  IRCDProto::SendSVSKillInternal(source, user, buf);
35  user->KillInternal(source, buf);
36  }
37 
38  public:
39  HybridProto(Module *creator) : IRCDProto(creator, "Hybrid 8.1.x")
40  {
42  CanSVSNick = true;
43  CanSVSHold = true;
44  CanSVSJoin = true;
45  CanSNLine = true;
46  CanSQLine = true;
47  CanSZLine = true;
48  CanCertFP = true;
49  CanSetVHost = true;
50  RequiresID = true;
51  MaxModes = 4;
52  }
53 
54  void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
55  {
56  UplinkSocket::Message(bi) << "NOTICE $$" << dest->GetName() << " :" << msg;
57  }
58 
59  void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
60  {
61  UplinkSocket::Message(bi) << "PRIVMSG $$" << dest->GetName() << " :" << msg;
62  }
63 
65  {
66  UplinkSocket::Message(source) << "GLOBOPS :" << buf;
67  }
68 
69  void SendSQLine(User *, const XLine *x) anope_override
70  {
71  UplinkSocket::Message(FindIntroduced()) << "ENCAP * RESV " << (x->expires ? x->expires - Anope::CurTime : 0) << " " << x->mask << " 0 :" << x->reason;
72  }
73 
75  {
76  UplinkSocket::Message(Config->GetClient("OperServ")) << "UNXLINE * " << x->mask;
77  }
78 
79  void SendSGLine(User *, const XLine *x) anope_override
80  {
81  UplinkSocket::Message(Config->GetClient("OperServ")) << "XLINE * " << x->mask << " 0 :" << x->GetReason();
82  }
83 
85  {
86  UplinkSocket::Message(Config->GetClient("OperServ")) << "UNDLINE * " << x->GetHost();
87  }
88 
89  void SendSZLine(User *, const XLine *x) anope_override
90  {
91  /* Calculate the time left before this would expire, capping it at 2 days */
92  time_t timeleft = x->expires - Anope::CurTime;
93 
94  if (timeleft > 172800 || !x->expires)
95  timeleft = 172800;
96 
97  UplinkSocket::Message(Config->GetClient("OperServ")) << "DLINE * " << timeleft << " " << x->GetHost() << " :" << x->GetReason();
98  }
99 
101  {
102  if (x->IsRegex() || x->HasNickOrReal())
103  return;
104 
105  UplinkSocket::Message(Config->GetClient("OperServ")) << "UNKLINE * " << x->GetUser() << " " << x->GetHost();
106  }
107 
109  {
110  UplinkSocket::Message(Config->GetClient("OperServ")) << "UNRESV * " << x->mask;
111  }
112 
113  void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
114  {
115  /*
116  * Note that we must send our modes with the SJOIN and
117  * can not add them to the mode stacker because ircd-hybrid
118  * does not allow *any* client to op itself
119  */
120  UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " +"
121  << c->GetModes(true, true) << " :"
122  << (status != NULL ? status->BuildModePrefixList() : "") << user->GetUID();
123 
124  /* And update our internal status for this user since this is not going through our mode handling system */
125  if (status != NULL)
126  {
127  ChanUserContainer *uc = c->FindUser(user);
128 
129  if (uc != NULL)
130  uc->status = *status;
131  }
132  }
133 
135  {
136  if (x->IsRegex() || x->HasNickOrReal())
137  {
138  if (!u)
139  {
140  /*
141  * No user (this akill was just added), and contains nick and/or realname.
142  * Find users that match and ban them.
143  */
144  for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
145  if (x->manager->Check(it->second, x))
146  this->SendAkill(it->second, x);
147 
148  return;
149  }
150 
151  const XLine *old = x;
152 
153  if (old->manager->HasEntry("*@" + u->host))
154  return;
155 
156  /* We can't akill x as it has a nick and/or realname included, so create a new akill for *@host */
157  XLine *xline = new XLine("*@" + u->host, old->by, old->expires, old->reason, old->id);
158 
159  old->manager->AddXLine(xline);
160  x = xline;
161 
162  Log(Config->GetClient("OperServ"), "akill") << "AKILL: Added an akill for " << x->mask << " because " << u->GetMask() << "#"
163  << u->realname << " matches " << old->mask;
164  }
165 
166  /* Calculate the time left before this would expire, capping it at 2 days */
167  time_t timeleft = x->expires - Anope::CurTime;
168 
169  if (timeleft > 172800 || !x->expires)
170  timeleft = 172800;
171 
172  UplinkSocket::Message(Config->GetClient("OperServ")) << "KLINE * " << timeleft << " " << x->GetUser() << " " << x->GetHost() << " :" << x->GetReason();
173  }
174 
175  void SendServer(const Server *server) anope_override
176  {
177  if (server == Me)
178  UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() + 1 << " :" << server->GetDescription();
179  else
180  UplinkSocket::Message(Me) << "SID " << server->GetName() << " " << server->GetHops() + 1 << " " << server->GetSID() << " :" << server->GetDescription();
181  }
182 
184  {
185  UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID();
186 
187  /*
188  * As of October 13, 2012, ircd-hybrid-8 does support the following capabilities
189  * which are required to work with IRC-services:
190  *
191  * QS - Can handle quit storm removal
192  * EX - Can do channel +e exemptions
193  * CHW - Can do channel wall @#
194  * IE - Can do invite exceptions
195  * KNOCK - Supports KNOCK
196  * TBURST - Supports topic burst
197  * ENCAP - Supports ENCAP
198  * HOPS - Supports HalfOps
199  * SVS - Supports services
200  * EOB - Supports End Of Burst message
201  * TS6 - Capable of TS6 support
202  */
203  UplinkSocket::Message() << "CAPAB :QS EX CHW IE ENCAP TBURST SVS HOPS EOB TS6";
204 
205  SendServer(Me);
206 
207  UplinkSocket::Message() << "SVINFO 6 5 0 :" << Anope::CurTime;
208  }
209 
211  {
212  Anope::string modes = "+" + u->GetModes();
213 
214  UplinkSocket::Message(Me) << "UID " << u->nick << " 1 " << u->timestamp << " " << modes << " "
215  << u->GetIdent() << " " << u->host << " 0 " << u->GetUID() << " 0 :" << u->realname;
216  }
217 
219  {
220  UplinkSocket::Message(Me) << "EOB";
221  }
222 
223  void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override
224  {
225  UplinkSocket::Message(source) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf;
226  }
227 
229  {
230  IRCD->SendMode(Config->GetClient("NickServ"), u, "+d %s", na->nc->display.c_str());
231  }
232 
234  {
235  IRCD->SendMode(Config->GetClient("NickServ"), u, "+d 0");
236  }
237 
239  {
240  Anope::string modes = c->GetModes(true, true);
241 
242  if (modes.empty())
243  modes = "+";
244 
245  UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " " << modes << " :";
246  }
247 
249  {
250  UplinkSocket::Message(source) << "TBURST " << c->creation_time << " " << c->name << " " << c->topic_ts << " " << c->topic_setter << " :" << c->topic;
251  }
252 
253  void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override
254  {
255  UplinkSocket::Message(Me) << "SVSNICK " << u->nick << " " << newnick << " " << when;
256  }
257 
258  void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) anope_override
259  {
260  UplinkSocket::Message(source) << "SVSJOIN " << u->GetUID() << " " << chan;
261  }
262 
263  void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) anope_override
264  {
265  if (!param.empty())
266  UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan << " :" << param;
267  else
268  UplinkSocket::Message(source) << "SVSPART " << u->GetUID() << " " << chan;
269  }
270 
271  void SendSVSHold(const Anope::string &nick, time_t t) anope_override
272  {
273  XLine x(nick, Me->GetName(), Anope::CurTime + t, "Being held for registered user");
274  this->SendSQLine(NULL, &x);
275  }
276 
278  {
279  XLine x(nick);
280  this->SendSQLineDel(&x);
281  }
282 
283  void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override
284  {
285  u->SetMode(Config->GetClient("HostServ"), "CLOAK", host);
286  }
287 
289  {
290  u->RemoveMode(Config->GetClient("HostServ"), "CLOAK", u->host);
291  }
292 
294  {
295  if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen"))
296  return false;
297 
298  Anope::string chars = "~}|{ `_^]\\[ .-$";
299 
300  for (unsigned i = 0; i < ident.length(); ++i)
301  {
302  const char &c = ident[i];
303 
304  if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))
305  continue;
306 
307  if (chars.find(c) != Anope::string::npos)
308  continue;
309 
310  return false;
311  }
312 
313  return true;
314  }
315 };
316 
318 {
320 
321  /* 0 1 2 3 */
322  /* :0MC BMASK 1350157102 #channel b :*!*@*.test.com */
323  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
324  {
325  Channel *c = Channel::Find(params[1]);
326  ChannelMode *mode = ModeManager::FindChannelModeByChar(params[2][0]);
327 
328  if (c && mode)
329  {
330  spacesepstream bans(params[3]);
331  Anope::string token;
332  while (bans.GetToken(token))
333  c->SetModeInternal(source, mode, token);
334  }
335  }
336 };
337 
339 {
341 
342  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
343  {
344  source.GetServer()->Sync(true);
345  }
346 };
347 
349 {
350  IRCDMessageJoin(Module *creator) : Message::Join(creator, "JOIN") { }
351 
352  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
353  {
354  if (params.size() < 2)
355  return;
356 
357  std::vector<Anope::string> p = params;
358  p.erase(p.begin());
359 
360  return Message::Join::Run(source, p);
361  }
362 };
363 
365 {
366  IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
367 
368  /* 0 1 */
369  /* :0MCAAAAAB NICK newnick 1350157102 */
370  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
371  {
372  source.GetUser()->ChangeNick(params[0], convertTo<time_t>(params[1]));
373  }
374 };
375 
377 {
379 
380  /* 0 1 2 3 */
381  /* PASS password TS 6 0MC */
382  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
383  {
384  UplinkSID = params[3];
385  }
386 };
387 
389 {
391 
392  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
393  {
394  source.GetServer()->Sync(false);
395  }
396 };
397 
399 {
401 
402  /* 0 1 2 */
403  /* SERVER hades.arpa 1 :ircd-hybrid test server */
404  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
405  {
406  /* Servers other than our immediate uplink are introduced via SID */
407  if (params[1] != "1")
408  return;
409 
410  new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID);
411 
412  IRCD->SendPing(Me->GetName(), params[0]);
413  }
414 };
415 
417 {
419 
420  /* 0 1 2 3 */
421  /* :0MC SID hades.arpa 2 4XY :ircd-hybrid test server */
422  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
423  {
424  unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
425  new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[3], params[2]);
426 
427  IRCD->SendPing(Me->GetName(), params[0]);
428  }
429 };
430 
432 {
434 
435  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
436  {
438  if (params.size() >= 3)
439  for (unsigned i = 2; i < params.size() - 1; ++i)
440  modes += " " + params[i];
441  if (!modes.empty())
442  modes.erase(modes.begin());
443 
444  std::list<Message::Join::SJoinUser> users;
445 
446  spacesepstream sep(params[params.size() - 1]);
447  Anope::string buf;
448 
449  while (sep.GetToken(buf))
450  {
452 
453  /* Get prefixes from the nick */
454  for (char ch; (ch = ModeManager::GetStatusChar(buf[0]));)
455  {
456  buf.erase(buf.begin());
457  sju.first.AddMode(ch);
458  }
459 
460  sju.second = User::Find(buf);
461  if (!sju.second)
462  {
463  Log(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << params[1];
464  continue;
465  }
466 
467  users.push_back(sju);
468  }
469 
470  time_t ts = Anope::string(params[0]).is_pos_number_only() ? convertTo<time_t>(params[0]) : Anope::CurTime;
471  Message::Join::SJoin(source, params[1], ts, modes, users);
472  }
473 };
474 
476 {
477  IRCDMessageSVSMode(Module *creator) : IRCDMessage(creator, "SVSMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
478 
479  /*
480  * parv[0] = nickname
481  * parv[1] = TS
482  * parv[2] = mode
483  * parv[3] = optional argument (services id)
484  */
485  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
486  {
487  User *u = User::Find(params[0]);
488  if (!u)
489  return;
490 
491  if (!params[1].is_pos_number_only() || convertTo<time_t>(params[1]) != u->timestamp)
492  return;
493 
494  u->SetModesInternal(source, "%s", params[2].c_str());
495  }
496 };
497 
499 {
500  IRCDMessageTBurst(Module *creator) : IRCDMessage(creator, "TBURST", 5) { }
501 
502  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
503  {
504  Anope::string setter;
505  sepstream(params[3], '!').GetToken(setter, 0);
506  time_t topic_time = Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime;
507  Channel *c = Channel::Find(params[1]);
508 
509  if (c)
510  c->ChangeTopicInternal(setter, params[4], topic_time);
511  }
512 };
513 
515 {
516  IRCDMessageTMode(Module *creator) : IRCDMessage(creator, "TMODE", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
517 
518  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
519  {
520  time_t ts = 0;
521 
522  try
523  {
524  ts = convertTo<time_t>(params[0]);
525  }
526  catch (const ConvertException &) { }
527 
528  Channel *c = Channel::Find(params[1]);
529  Anope::string modes = params[2];
530 
531  for (unsigned i = 3; i < params.size(); ++i)
532  modes += " " + params[i];
533 
534  if (c)
535  c->SetModesInternal(source, modes, ts);
536  }
537 };
538 
540 {
542 
543  /* 0 1 2 3 4 5 6 7 8 9 */
544  /* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB 1350157108 :Mining all the time */
545  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
546  {
547  Anope::string ip = params[6];
548 
549  if (ip == "0") /* Can be 0 for spoofed clients */
550  ip.clear();
551 
552  NickAlias *na = NULL;
553  if (params[8] != "0")
554  na = NickAlias::Find(params[8]);
555 
556  /* Source is always the server */
557  User::OnIntroduce(params[0], params[4], params[5], "",
558  ip, source.GetServer(),
559  params[9], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0,
560  params[3], params[7], na ? *na->nc : NULL);
561  }
562 };
563 
565 {
566  IRCDMessageCertFP(Module *creator) : IRCDMessage(creator, "CERTFP", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
567 
568  /* 0 */
569  /* :0MCAAAAAB CERTFP 4C62287BA6776A89CD4F8FF10A62FFB35E79319F51AF6C62C674984974FCCB1D */
570  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
571  {
572  User *u = source.GetUser();
573 
574  u->fingerprint = params[0];
575  FOREACH_MOD(OnFingerprint, (u));
576  }
577 };
578 
579 class ProtoHybrid : public Module
580 {
582 
583  /* Core message handlers */
603 
604  /* Our message handlers */
619 
620  void AddModes()
621  {
622  /* Add user modes */
623  ModeManager::AddUserMode(new UserModeOperOnly("ADMIN", 'a'));
624  ModeManager::AddUserMode(new UserModeOperOnly("CALLERID", 'g'));
625  ModeManager::AddUserMode(new UserMode("INVIS", 'i'));
626  ModeManager::AddUserMode(new UserModeOperOnly("LOCOPS", 'l'));
627  ModeManager::AddUserMode(new UserModeOperOnly("OPER", 'o'));
628  ModeManager::AddUserMode(new UserModeNoone("REGISTERED", 'r'));
629  ModeManager::AddUserMode(new UserModeOperOnly("SNOMASK", 's'));
630  ModeManager::AddUserMode(new UserMode("WALLOPS", 'w'));
631  ModeManager::AddUserMode(new UserModeOperOnly("OPERWALLS", 'z'));
632  ModeManager::AddUserMode(new UserMode("DEAF", 'D'));
633  ModeManager::AddUserMode(new UserModeOperOnly("HIDEOPER", 'H'));
634  ModeManager::AddUserMode(new UserMode("REGPRIV", 'R'));
635  ModeManager::AddUserMode(new UserModeNoone("SSL", 'S'));
636  ModeManager::AddUserMode(new UserMode("CLOAK", 'x'));
637 
638  /* b/e/I */
640  ModeManager::AddChannelMode(new ChannelModeList("EXCEPT", 'e'));
641  ModeManager::AddChannelMode(new ChannelModeList("INVITEOVERRIDE", 'I'));
642 
643  /* v/h/o/a/q */
644  ModeManager::AddChannelMode(new ChannelModeStatus("VOICE", 'v', '+', 0));
645  ModeManager::AddChannelMode(new ChannelModeStatus("HALFOP", 'h', '%', 1));
646  ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@', 2));
647 
648  /* l/k */
649  ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true));
651 
652  /* Add channel modes */
653  ModeManager::AddChannelMode(new ChannelMode("BLOCKCOLOR", 'c'));
654  ModeManager::AddChannelMode(new ChannelMode("INVITE", 'i'));
655  ModeManager::AddChannelMode(new ChannelMode("MODERATED", 'm'));
656  ModeManager::AddChannelMode(new ChannelMode("NOEXTERNAL", 'n'));
657  ModeManager::AddChannelMode(new ChannelMode("PRIVATE", 'p'));
658  ModeManager::AddChannelMode(new ChannelModeNoone("REGISTERED", 'r'));
659  ModeManager::AddChannelMode(new ChannelMode("SECRET", 's'));
660  ModeManager::AddChannelMode(new ChannelMode("TOPIC", 't'));
661  ModeManager::AddChannelMode(new ChannelModeOperOnly("OPERONLY", 'O'));
662  ModeManager::AddChannelMode(new ChannelMode("REGMODERATED", 'M'));
663  ModeManager::AddChannelMode(new ChannelMode("REGISTEREDONLY", 'R'));
664  ModeManager::AddChannelMode(new ChannelMode("SSL", 'S'));
665  }
666 
667 public:
668  ProtoHybrid(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
669  ircd_proto(this),
670  message_away(this), message_capab(this), message_error(this), message_invite(this), message_kick(this),
671  message_kill(this), message_mode(this), message_motd(this), message_notice(this), message_part(this),
672  message_ping(this), message_privmsg(this), message_quit(this), message_squit(this), message_stats(this),
673  message_time(this), message_topic(this), message_version(this), message_whois(this),
674  message_bmask(this), message_eob(this), message_join(this),
675  message_nick(this), message_pass(this), message_pong(this), message_server(this), message_sid(this),
676  message_sjoin(this), message_svsmode(this), message_tburst(this), message_tmode(this), message_uid(this),
677  message_certfp(this)
678  {
679  if (Config->GetModule(this))
680  this->AddModes();
681  }
682 
684  {
686  }
687 };
688 
Serialize::Reference< NickCore > nc
Definition: account.h:47
Definition: bots.h:24
Message::Time message_time
Definition: hybrid.cpp:599
bool CanSZLine
Definition: protocol.h:61
static NickAlias * Find(const Anope::string &nick)
Definition: nickalias.cpp:121
Definition: servers.h:42
void SendLogout(User *u) anope_override
Definition: hybrid.cpp:233
IRCDMessageServer(Module *creator)
Definition: hybrid.cpp:400
void SendTopic(const MessageSource &source, Channel *c) anope_override
Definition: hybrid.cpp:248
Anope::string reason
Definition: xline.h:29
bool CanSNLine
Definition: protocol.h:55
IRCDMessageSJoin message_sjoin
Definition: hybrid.cpp:613
IRCDMessageEOB message_eob
Definition: hybrid.cpp:606
Anope::string mask
Definition: xline.h:24
IRCDMessageSJoin(Module *creator)
Definition: hybrid.cpp:433
void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: hybrid.cpp:54
XLineManager * manager
Definition: xline.h:30
Message::MOTD message_motd
Definition: hybrid.cpp:591
void clear()
Definition: anope.h:187
Message::Invite message_invite
Definition: hybrid.cpp:587
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:545
void RemoveModeInternal(const MessageSource &setter, UserMode *um)
Definition: users.cpp:554
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) anope_override
Definition: hybrid.cpp:258
bool is_pos_number_only() const
Definition: anope.h:218
IRCDMessageSID message_sid
Definition: hybrid.cpp:612
virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &)
Definition: protocol.cpp:100
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:404
Anope::string fingerprint
Definition: users.h:73
static Anope::string UplinkSID
Definition: hybrid.cpp:15
IRCDMessageBMask(Module *creator)
Definition: hybrid.cpp:319
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:370
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:63
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:502
ProtoHybrid(const Anope::string &modname, const Anope::string &creator)
Definition: hybrid.cpp:668
const Anope::string & GetSID() const
Definition: servers.cpp:203
void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override
Definition: hybrid.cpp:283
Join(Module *creator, const Anope::string &mname="JOIN")
Definition: messages.h:53
void SendSZLineDel(const XLine *x) anope_override
Definition: hybrid.cpp:84
IRCDMessageCertFP message_certfp
Definition: hybrid.cpp:618
void SendAkill(User *u, XLine *x) anope_override
Definition: hybrid.cpp:134
void SendSVSHoldDel(const Anope::string &nick) anope_override
Definition: hybrid.cpp:277
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
Definition: users.h:34
Anope::string DefaultPseudoclientModes
Definition: protocol.h:47
IRCDMessagePong(Module *creator)
Definition: hybrid.cpp:390
bool introduced
Definition: bots.h:39
IRCDMessageNick message_nick
Definition: hybrid.cpp:608
void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override
Definition: hybrid.cpp:32
void SendEOB() anope_override
Definition: hybrid.cpp:218
bool CanSetVHost
Definition: protocol.h:53
void SendVhostDel(User *u) anope_override
Definition: hybrid.cpp:288
IRCDMessagePong message_pong
Definition: hybrid.cpp:610
bool RequiresID
Definition: protocol.h:69
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:342
BotInfo * FindIntroduced()
Definition: hybrid.cpp:19
IRCDMessageTMode message_tmode
Definition: hybrid.cpp:616
static UserMode * FindUserModeByName(const Anope::string &name)
Definition: modes.cpp:550
void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override
Definition: hybrid.cpp:64
CoreExport time_t CurTime
Definition: main.cpp:41
Message::Kill message_kill
Definition: hybrid.cpp:589
IRCDMessageCertFP(Module *creator)
Definition: hybrid.cpp:566
#define FOREACH_MOD(ename, args)
Definition: modules.h:62
HybridProto(Module *creator)
Definition: hybrid.cpp:39
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:352
iterator erase(const iterator &i)
Definition: anope.h:155
Message::SQuit message_squit
Definition: hybrid.cpp:597
IRCDMessageServer message_server
Definition: hybrid.cpp:611
IRCDMessagePass(Module *creator)
Definition: hybrid.cpp:378
Message::Part message_part
Definition: hybrid.cpp:593
IRCDMessageTMode(Module *creator)
Definition: hybrid.cpp:516
void AddModes()
Definition: hybrid.cpp:620
time_t timestamp
Definition: users.h:81
Message::Whois message_whois
Definition: hybrid.cpp:602
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:570
void SendModeInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override
Definition: hybrid.cpp:223
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:392
bool CanSQLine
Definition: protocol.h:57
Message::Error message_error
Definition: hybrid.cpp:586
Definition: Config.cs:26
bool CanSVSNick
Definition: protocol.h:49
bool CanCertFP
Definition: protocol.h:67
Message::Topic message_topic
Definition: hybrid.cpp:600
unsigned MaxModes
Definition: protocol.h:73
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:382
static char GetStatusChar(char symbol)
Definition: modes.cpp:558
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:485
static bool AddUserMode(UserMode *um)
Definition: modes.cpp:391
void SendConnect() anope_override
Definition: hybrid.cpp:183
static const size_type npos
Definition: anope.h:44
void SetFlag(IRCDMessageFlag f)
Definition: protocol.h:282
const Anope::string & GetUID() const
Definition: users.cpp:230
virtual void SendPing(const Anope::string &servname, const Anope::string &who)
Definition: protocol.cpp:262
void SendSVSHold(const Anope::string &nick, time_t t) anope_override
Definition: hybrid.cpp:271
IRCDMessageUID message_uid
Definition: hybrid.cpp:617
CoreExport Serialize::Checker< botinfo_map > BotListByNick
Definition: modes.h:68
void SendSZLine(User *, const XLine *x) anope_override
Definition: hybrid.cpp:89
static ChannelMode * FindChannelModeByChar(char mode)
Definition: modes.cpp:524
Anope::string by
Definition: xline.h:26
time_t expires
Definition: xline.h:28
static Anope::map< std::pair< bool, Anope::string > > modes
Definition: cs_mode.cpp:745
IRCDMessageJoin(Module *creator)
Definition: hybrid.cpp:350
#define anope_override
Definition: services.h:56
bool empty() const
Definition: anope.h:126
Anope::string id
Definition: xline.h:31
Message::Capab message_capab
Definition: hybrid.cpp:585
void SetModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string &param="", bool enforce_mlock=true)
Definition: channels.cpp:251
Message::Quit message_quit
Definition: hybrid.cpp:596
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:518
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts=0, bool enforce_mlock=true)
Definition: channels.cpp:595
IRCDMessageBMask message_bmask
Definition: hybrid.cpp:605
bool IsIdentValid(const Anope::string &ident) anope_override
Definition: hybrid.cpp:293
void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) anope_override
Definition: hybrid.cpp:263
CoreExport IRCDProto * IRCD
Definition: protocol.cpp:23
IRCDMessagePass message_pass
Definition: hybrid.cpp:609
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:323
std::basic_string< char, ci_char_traits, std::allocator< char > > string
Definition: hashcomp.h:133
#define MODULE_INIT(x)
Definition: modules.h:45
void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: hybrid.cpp:59
void SendSQLineDel(const XLine *x) anope_override
Definition: hybrid.cpp:108
IRCDMessageJoin message_join
Definition: hybrid.cpp:607
IRCDMessageTBurst(Module *creator)
Definition: hybrid.cpp:500
bool CanSVSHold
Definition: protocol.h:63
void SendClientIntroduction(User *u) anope_override
Definition: hybrid.cpp:210
ChannelStatus status
Definition: channels.h:28
CoreExport int CurrentUplink
Definition: main.cpp:43
void SendAkillDel(const XLine *x) anope_override
Definition: hybrid.cpp:100
void SendSGLineDel(const XLine *x) anope_override
Definition: hybrid.cpp:74
Message::Stats message_stats
Definition: hybrid.cpp:598
void SendLogin(User *u, NickAlias *na) anope_override
Definition: hybrid.cpp:228
std::pair< ChannelStatus, User * > SJoinUser
Definition: messages.h:57
IRCDMessageSVSMode(Module *creator)
Definition: hybrid.cpp:477
XLine * HasEntry(const Anope::string &mask)
Definition: xline.cpp:391
IRCDMessageEOB(Module *craetor)
Definition: hybrid.cpp:340
static User * Find(const Anope::string &name, bool nick_only=false)
Definition: users.cpp:815
const Anope::string & GetName() const
Definition: servers.cpp:175
static bool AddChannelMode(ChannelMode *cm)
Definition: modes.cpp:418
void SendSGLine(User *, const XLine *x) anope_override
Definition: hybrid.cpp:79
void SendSQLine(User *, const XLine *x) anope_override
Definition: hybrid.cpp:69
IRCDMessageSVSMode message_svsmode
Definition: hybrid.cpp:614
void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
Definition: hybrid.cpp:113
static Channel * Find(const Anope::string &name)
Definition: channels.cpp:920
Definition: xline.h:18
bool GetToken(Anope::string &token)
Definition: hashcomp.cpp:99
void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override
Definition: hybrid.cpp:253
CoreExport Server * Me
Definition: servers.cpp:24
CoreExport user_map UserListByNick
Definition: users.cpp:28
void SetModesInternal(const MessageSource &source, const char *umodes,...)
Definition: users.cpp:645
Definition: logger.h:53
bool CanSVSJoin
Definition: protocol.h:51
Message::Mode message_mode
Definition: hybrid.cpp:590
IRCDMessageSID(Module *creator)
Definition: hybrid.cpp:418
Message::Version message_version
Definition: hybrid.cpp:601
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
IRCDMessageUID(Module *creator)
Definition: hybrid.cpp:541
Message::Kick message_kick
Definition: hybrid.cpp:588
Message::Away message_away
Definition: hybrid.cpp:584
void AddXLine(XLine *x)
Definition: xline.cpp:286
iterator begin()
Definition: anope.h:282
void SendServer(const Server *server) anope_override
Definition: hybrid.cpp:175
size_type find(const string &_str, size_type pos=0) const
Definition: anope.h:192
Message::Notice message_notice
Definition: hybrid.cpp:592
IRCDMessageTBurst message_tburst
Definition: hybrid.cpp:615
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:435
IRCDMessageNick(Module *creator)
Definition: hybrid.cpp:366
Message::Ping message_ping
Definition: hybrid.cpp:594
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: hybrid.cpp:422
void OnUserNickChange(User *u, const Anope::string &) anope_override
Definition: hybrid.cpp:683
HybridProto ircd_proto
Definition: hybrid.cpp:581
void SendChannel(Channel *c) anope_override
Definition: hybrid.cpp:238
Message::Privmsg message_privmsg
Definition: hybrid.cpp:595