00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "services.h"
00013 #include "pseudo.h"
00014 #include "plexus3.h"
00015
00016 IRCDVar myIrcd[] = {
00017 {"hybrid-7.2.1+plexus-3.0.0+",
00018 "+i",
00019 "+i",
00020 "+i",
00021 "+i",
00022 "+oai",
00023 "+i",
00024 "+i",
00025 "+i",
00026 "+i",
00027 "+i",
00028 "+i",
00029 "+i",
00030 "+i",
00031 "+oai",
00032 "+i",
00033 "+i",
00034 "+i",
00035 "+i",
00036 "+i",
00037 5,
00038 "-cilmnpstBMNORS",
00039 "+ao",
00040 1,
00041 1,
00042 1,
00043 "+q",
00044 "-q",
00045 "+a",
00046 "-a",
00047 "+rd",
00048 "N",
00049 NULL,
00050 NULL,
00051 "-r+d",
00052 "+d",
00053 1,
00054 1,
00055 0,
00056 1,
00057 3,
00058 0,
00059 0,
00060 1,
00061 0,
00062 0,
00063 UMODE_N,
00064 0,
00065 1,
00066 0,
00067 0,
00068 1,
00069 0,
00070 0,
00071 0,
00072 0,
00073 1,
00074 1,
00075 0,
00076 0,
00077 1,
00078 1,
00079 0,
00080 CMODE_p,
00081 0,
00082 DEFAULT_MLOCK,
00083 UMODE_x,
00084 0,
00085 0,
00086 0,
00087 0,
00088 1,
00089 0,
00090 NULL,
00091 0,
00092 1,
00093 0,
00094 1,
00095 0,
00096 0,
00097 0,
00098 0,
00099 0,
00100 "x",
00101 0,
00102 0,
00103 0,
00104 NULL,
00105 1,
00106 }
00107 ,
00108 {NULL}
00109 };
00110
00111 IRCDCAPAB myIrcdcap[] = {
00112 {
00113 0,
00114 0,
00115 0,
00116 0,
00117 0,
00118 CAPAB_ZIP,
00119 0,
00120 CAPAB_TS5,
00121 0,
00122 0,
00123 0,
00124 0,
00125 CAPAB_QS,
00126 CAPAB_UID,
00127 CAPAB_KNOCK,
00128 0,
00129 0,
00130 0,
00131 0,
00132 0,
00133 0,
00134 0,
00135 0,
00136 0,
00137 0,
00138 0,
00139 0,
00140 0,
00141 0, 0, 0}
00142 };
00143
00144
00145
00146 void
00147 plexus_set_umode (User * user, int ac, char **av)
00148 {
00149 int add = 1;
00150 char *modes = av[0];
00151
00152 ac--;
00153
00154 if (debug)
00155 alog ("debug: Changing mode for %s to %s", user->nick, modes);
00156
00157 while (*modes)
00158 {
00159
00160
00161
00162
00163 if (add)
00164 user->mode |= umodes[(int) *modes];
00165 else
00166 user->mode &= ~umodes[(int) *modes];
00167
00168 switch (*modes++)
00169 {
00170 case '+':
00171 add = 1;
00172 break;
00173 case '-':
00174 add = 0;
00175 break;
00176 case 'd':
00177 if (ac == 0)
00178 {
00179 alog ("user: umode +d with no parameter (?) for user %s",
00180 user->nick);
00181 break;
00182 }
00183
00184 ac--;
00185 av++;
00186 user->svid = strtoul (*av, NULL, 0);
00187 break;
00188 case 'x':
00189 update_host (user);
00190 break;
00191 case 'o':
00192 if (add)
00193 {
00194 opcnt++;
00195
00196 if (WallOper)
00197 anope_cmd_global (s_OperServ,
00198 "\2%s\2 is now an IRC operator.",
00199 user->nick);
00200 display_news (user, NEWS_OPER);
00201
00202 }
00203 else
00204 {
00205 opcnt--;
00206 }
00207 break;
00208 case 'r':
00209 if (add && !nick_identified (user))
00210 {
00211 common_svsmode (user, "-r", NULL);
00212 user->mode &= ~UMODE_r;
00213 }
00214 break;
00215 }
00216 }
00217 }
00218
00219 unsigned long umodes[128] = {
00220 0, 0, 0,
00221 0, 0, 0,
00222 0, 0, 0,
00223 0, 0, 0,
00224 0, 0, 0,
00225 0, 0, 0,
00226 0, 0, 0,
00227 0, 0, 0,
00228 0, 0, 0,
00229 0, 0, 0,
00230 0, 0, 0,
00231 0, 0, 0,
00232 0, 0, 0,
00233 0, 0, 0,
00234 0, 0, 0,
00235 0, 0, 0,
00236 0, 0,
00237 0, 0,
00238 0, 0,
00239 0, 0,
00240 0, 0,
00241 0, 0,
00242 0, 0, 0,
00243 0, 0,
00244 0, 0, 0,
00245 0, 0, 0,
00246 0, 0, 0,
00247 0, 0, 0,
00248 0, UMODE_N, 0,
00249 0, 0, UMODE_R,
00250 UMODE_S, 0, 0,
00251 0, 0, 0,
00252 0,
00253 0,
00254 0, 0, 0,
00255 0, 0, 0,
00256 UMODE_a, 0, 0,
00257 0, 0, 0,
00258 0, 0, UMODE_i,
00259 0, 0, 0,
00260 0, 0, UMODE_o,
00261 0, 0, UMODE_r,
00262 0, 0, 0,
00263 0, UMODE_w, UMODE_x,
00264 0,
00265 0,
00266 0, 0, 0,
00267 0, 0
00268 };
00269
00270
00271 char myCsmodes[128] = {
00272 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00273 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00274
00275 0,
00276 0,
00277 0, 0, 0,
00278 'h',
00279 'a',
00280 0, 0, 0, 0,
00281
00282 'v', 0, 0, 0, 0,
00283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00284
00285 'o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00286 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00287
00288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'q', 0
00290 };
00291
00292 CMMode myCmmodes[128] = {
00293 {NULL}, {NULL}, {NULL},
00294 {NULL}, {NULL}, {NULL},
00295 {NULL}, {NULL}, {NULL},
00296 {NULL}, {NULL}, {NULL},
00297 {NULL}, {NULL}, {NULL},
00298 {NULL}, {NULL}, {NULL},
00299 {NULL}, {NULL}, {NULL},
00300 {NULL}, {NULL}, {NULL},
00301 {NULL}, {NULL}, {NULL},
00302 {NULL}, {NULL}, {NULL},
00303 {NULL}, {NULL}, {NULL},
00304 {NULL}, {NULL}, {NULL},
00305 {NULL}, {NULL}, {NULL},
00306 {NULL}, {NULL}, {NULL},
00307 {NULL}, {NULL}, {NULL},
00308 {NULL}, {NULL}, {NULL},
00309 {NULL}, {NULL}, {NULL},
00310 {NULL}, {NULL}, {NULL},
00311 {NULL}, {NULL}, {NULL},
00312 {NULL}, {NULL}, {NULL},
00313 {NULL}, {NULL}, {NULL},
00314 {NULL}, {NULL}, {NULL},
00315 {NULL}, {NULL}, {NULL},
00316 {NULL}, {NULL}, {NULL},
00317 {NULL},
00318 {add_invite, del_invite},
00319 {NULL},
00320 {NULL}, {NULL}, {NULL},
00321 {NULL}, {NULL}, {NULL},
00322 {NULL}, {NULL}, {NULL},
00323 {NULL}, {NULL}, {NULL},
00324 {NULL}, {NULL}, {NULL},
00325 {NULL},
00326 {NULL}, {NULL},
00327 {NULL}, {NULL}, {NULL},
00328 {NULL},
00329 {NULL},
00330 {add_ban, del_ban},
00331 {NULL},
00332 {NULL},
00333 {add_exception, del_exception},
00334 {NULL},
00335 {NULL},
00336 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00337 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00338 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}
00339 };
00340
00341
00342 CBMode myCbmodes[128] = {
00343 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00344 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00345 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00346 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00347 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00348 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00349 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00350 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00351 {0},
00352 {0},
00353 {CMODE_B, CBM_NO_USER_MLOCK, NULL, NULL},
00354 {0},
00355 {0},
00356 {0},
00357 {0},
00358 {0},
00359 {0},
00360 {0},
00361 {0},
00362 {0},
00363 {0},
00364 {CMODE_M, 0, NULL, NULL},
00365 {CMODE_N, 0, NULL, NULL},
00366 {CMODE_O, CBM_NO_USER_MLOCK, NULL, NULL},
00367 {0},
00368 {0},
00369 {CMODE_R, 0, NULL, NULL},
00370 {CMODE_S, 0, NULL, NULL},
00371 {0},
00372 {0},
00373 {0},
00374 {0},
00375 {0},
00376 {0},
00377 {0},
00378 {0}, {0}, {0}, {0}, {0}, {0},
00379 {0},
00380 {0},
00381 {CMODE_c, 0, NULL, NULL},
00382 {0},
00383 {0},
00384 {0},
00385 {0},
00386 {0},
00387 {CMODE_i, 0, NULL, NULL},
00388 {0},
00389 {CMODE_k, 0, chan_set_key, cs_set_key},
00390 {CMODE_l, CBM_MINUS_NO_ARG, set_limit, cs_set_limit},
00391 {CMODE_m, 0, NULL, NULL},
00392 {CMODE_n, 0, NULL, NULL},
00393 {0},
00394 {CMODE_p, 0, NULL, NULL},
00395 {0},
00396 {0},
00397 {CMODE_s, 0, NULL, NULL},
00398 {CMODE_t, 0, NULL, NULL},
00399 {0},
00400 {0},
00401 {0},
00402 {0},
00403 {0},
00404 {0},
00405 {0}, {0}, {0}, {0}
00406 };
00407
00408 CBModeInfo myCbmodeinfos[] = {
00409 {'c', CMODE_c, 0, NULL, NULL},
00410 {'i', CMODE_i, 0, NULL, NULL},
00411 {'k', CMODE_k, 0, get_key, cs_get_key},
00412 {'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit},
00413 {'m', CMODE_m, 0, NULL, NULL},
00414 {'n', CMODE_n, 0, NULL, NULL},
00415 {'p', CMODE_p, 0, NULL, NULL},
00416 {'s', CMODE_s, 0, NULL, NULL},
00417 {'t', CMODE_t, 0, NULL, NULL},
00418 {'B', CMODE_B, 0, NULL, NULL},
00419 {'M', CMODE_M, 0, NULL, NULL},
00420 {'N', CMODE_N, 0, NULL, NULL},
00421 {'O', CMODE_O, 0, NULL, NULL},
00422 {'R', CMODE_R, 0, NULL, NULL},
00423 {'S', CMODE_S, 0, NULL, NULL},
00424 {0}
00425 };
00426
00427
00428 CUMode myCumodes[128] = {
00429 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00430 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00431 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00432 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00433
00434 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00435 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00436 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00437 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00438
00439 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00440 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00441 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00442 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00443
00444 {0},
00445
00446 {CUS_PROTECT, CUF_PROTECT_BOTSERV, check_valid_op},
00447 {0},
00448 {0},
00449 {0},
00450 {0},
00451 {0},
00452 {0},
00453 {CUS_HALFOP, 0, check_valid_op},
00454 {0},
00455 {0},
00456 {0},
00457 {0},
00458 {0},
00459 {0},
00460 {CUS_OP, CUF_PROTECT_BOTSERV, check_valid_op},
00461 {0},
00462 {CUS_OWNER, 0, check_valid_op},
00463 {0},
00464 {0},
00465 {0},
00466 {0},
00467 {CUS_VOICE, 0, NULL},
00468 {0},
00469 {0},
00470 {0},
00471 {0},
00472 {0}, {0}, {0}, {0}, {0}
00473 };
00474
00475
00476
00477 void
00478 plexus_cmd_notice (char *source, char *dest, char *buf)
00479 {
00480 if (!buf)
00481 {
00482 return;
00483 }
00484
00485 if (NSDefFlags & NI_MSG)
00486 {
00487 plexus_cmd_privmsg2 (source, dest, buf);
00488 }
00489 else
00490 {
00491 send_cmd (source, "NOTICE %s :%s", dest, buf);
00492 }
00493 }
00494
00495 void
00496 plexus_cmd_notice2 (char *source, char *dest, char *msg)
00497 {
00498 send_cmd (source, "NOTICE %s :%s", dest, msg);
00499 }
00500
00501 void
00502 plexus_cmd_privmsg (char *source, char *dest, char *buf)
00503 {
00504 if (!buf)
00505 {
00506 return;
00507 }
00508
00509 send_cmd (source, "PRIVMSG %s :%s", dest, buf);
00510 }
00511
00512 void
00513 plexus_cmd_privmsg2 (char *source, char *dest, char *msg)
00514 {
00515 send_cmd (source, "PRIVMSG %s :%s", dest, msg);
00516 }
00517
00518 void
00519 plexus_cmd_serv_notice (char *source, char *dest, char *msg)
00520 {
00521 send_cmd (source, "NOTICE $$%s :%s", dest, msg);
00522 }
00523
00524 void
00525 plexus_cmd_serv_privmsg (char *source, char *dest, char *msg)
00526 {
00527 send_cmd (source, "PRIVMSG $$%s :%s", dest, msg);
00528 }
00529
00530
00531 void
00532 plexus_cmd_global (char *source, char *buf)
00533 {
00534 if (!buf)
00535 {
00536 return;
00537 }
00538
00539 send_cmd (source ? source : ServerName, "OPERWALL :%s", buf);
00540 }
00541
00542
00543 void
00544 plexus_cmd_global_legacy (char *source, char *fmt)
00545 {
00546 send_cmd (source ? source : ServerName, "OPERWALL :%s", fmt);
00547 }
00548
00549 int
00550 anope_event_sjoin (char *source, int ac, char **av)
00551 {
00552 do_sjoin (source, ac, av);
00553 return MOD_CONT;
00554 }
00555
00556 int
00557 anope_event_nick (char *source, int ac, char **av)
00558 {
00559 if (ac != 2)
00560 {
00561 User *user = do_nick (source, av[0], av[4], av[8], av[6], av[9],
00562 strtoul (av[2], NULL, 10),
00563 strtoul (av[7], NULL, 0), 0, av[5], NULL);
00564 if (user)
00565 anope_set_umode (user, 1, &av[3]);
00566 }
00567 else
00568 {
00569 do_nick (source, av[0], NULL, NULL, NULL, NULL,
00570 strtoul (av[1], NULL, 10), 0, 0, NULL, NULL);
00571 }
00572 return MOD_CONT;
00573 }
00574
00575 int
00576 anope_event_topic (char *source, int ac, char **av)
00577 {
00578 if (ac == 4)
00579 {
00580 do_topic (source, ac, av);
00581 }
00582 else
00583 {
00584 Channel *c = findchan (av[0]);
00585 time_t topic_time = time (NULL);
00586
00587 if (!c)
00588 {
00589 if (debug)
00590 {
00591 alog ("debug: TOPIC %s for nonexistent channel %s",
00592 merge_args (ac - 1, av + 1), av[0]);
00593 }
00594 return MOD_CONT;
00595 }
00596
00597 if (check_topiclock (c, topic_time))
00598 return MOD_CONT;
00599
00600 if (c->topic)
00601 {
00602 free (c->topic);
00603 c->topic = NULL;
00604 }
00605 if (ac > 1 && *av[1])
00606 c->topic = sstrdup (av[1]);
00607
00608 strscpy (c->topic_setter, source, sizeof (c->topic_setter));
00609 c->topic_time = topic_time;
00610
00611 record_topic (av[0]);
00612
00613 if (ac > 1 && *av[1])
00614 send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[1]);
00615 else
00616 send_event(EVENT_TOPIC_UPDATED, 2, av[0], "");
00617
00618 }
00619 return MOD_CONT;
00620 }
00621
00622 int
00623 anope_event_tburst (char *source, int ac, char **av)
00624 {
00625 if (ac != 5)
00626 return MOD_CONT;
00627
00628 av[0] = av[1];
00629 av[1] = av[3];
00630 av[3] = av[4];
00631 do_topic (source, 4, av);
00632 return MOD_CONT;
00633 }
00634
00635
00636
00637
00638
00639
00640
00641 int
00642 anope_event_encap (char *source, int ac, char **av)
00643 {
00644 if (ac < 2)
00645 return MOD_CONT;
00646
00647 if (!stricmp (av[1], "CHGHOST"))
00648 {
00649 User *u;
00650
00651 if (ac != 4)
00652 return MOD_CONT;
00653
00654 u = finduser (av[2]);
00655 if (!u)
00656 {
00657 if (debug)
00658 {
00659 alog ("debug: CHGHOST for nonexistent user %s", av[2]);
00660 }
00661 return MOD_CONT;
00662 }
00663
00664 change_user_host (u, av[3]);
00665 return MOD_CONT;
00666 }
00667 return MOD_CONT;
00668 }
00669
00670 int
00671 anope_event_436 (char *source, int ac, char **av)
00672 {
00673 if (ac < 1)
00674 return MOD_CONT;
00675
00676 m_nickcoll (av[0]);
00677 return MOD_CONT;
00678 }
00679
00680
00681 void
00682 moduleAddIRCDMsgs (void)
00683 {
00684 Message *m;
00685
00686 updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+a","-a");
00687
00688 m = createMessage ("401", anope_event_null);
00689 addCoreMessage (IRCD, m);
00690 m = createMessage ("402", anope_event_null);
00691 addCoreMessage (IRCD, m);
00692 m = createMessage ("436", anope_event_436);
00693 addCoreMessage (IRCD, m);
00694 m = createMessage ("AWAY", anope_event_away);
00695 addCoreMessage (IRCD, m);
00696 m = createMessage ("INVITE", anope_event_invite);
00697 addCoreMessage (IRCD, m);
00698 m = createMessage ("JOIN", anope_event_join);
00699 addCoreMessage (IRCD, m);
00700 m = createMessage ("KICK", anope_event_kick);
00701 addCoreMessage (IRCD, m);
00702 m = createMessage ("KILL", anope_event_kill);
00703 addCoreMessage (IRCD, m);
00704 m = createMessage ("MODE", anope_event_mode);
00705 addCoreMessage (IRCD, m);
00706 m = createMessage ("MOTD", anope_event_motd);
00707 addCoreMessage (IRCD, m);
00708 m = createMessage ("NICK", anope_event_nick);
00709 addCoreMessage (IRCD, m);
00710 m = createMessage ("NOTICE", anope_event_notice);
00711 addCoreMessage (IRCD, m);
00712 m = createMessage ("PART", anope_event_part);
00713 addCoreMessage (IRCD, m);
00714 m = createMessage ("PASS", anope_event_pass);
00715 addCoreMessage (IRCD, m);
00716 m = createMessage ("PING", anope_event_ping);
00717 addCoreMessage (IRCD, m);
00718 m = createMessage ("PRIVMSG", anope_event_privmsg);
00719 addCoreMessage (IRCD, m);
00720 m = createMessage ("QUIT", anope_event_quit);
00721 addCoreMessage (IRCD, m);
00722 m = createMessage ("SERVER", anope_event_server);
00723 addCoreMessage (IRCD, m);
00724 m = createMessage ("SQUIT", anope_event_squit);
00725 addCoreMessage (IRCD, m);
00726 m = createMessage ("TOPIC", anope_event_topic);
00727 addCoreMessage (IRCD, m);
00728 m = createMessage ("TBURST", anope_event_tburst);
00729 addCoreMessage (IRCD, m);
00730 m = createMessage ("USER", anope_event_null);
00731 addCoreMessage (IRCD, m);
00732 m = createMessage ("WALLOPS", anope_event_null);
00733 addCoreMessage (IRCD, m);
00734 m = createMessage ("WHOIS", anope_event_whois);
00735 addCoreMessage (IRCD, m);
00736 m = createMessage ("CAPAB", anope_event_capab);
00737 addCoreMessage (IRCD, m);
00738 m = createMessage ("SJOIN", anope_event_sjoin);
00739 addCoreMessage (IRCD, m);
00740 m = createMessage ("SVINFO", anope_event_svinfo);
00741 addCoreMessage (IRCD, m);
00742 m = createMessage ("EOB", anope_event_eob);
00743 addCoreMessage (IRCD, m);
00744 m = createMessage ("ADMIN", anope_event_admin);
00745 addCoreMessage (IRCD, m);
00746 m = createMessage ("ERROR", anope_event_error);
00747 addCoreMessage (IRCD, m);
00748 m = createMessage ("ENCAP", anope_event_encap);
00749 addCoreMessage (IRCD, m);
00750 m = createMessage ("SVSMODE", anope_event_mode);
00751 addCoreMessage (IRCD, m);
00752 }
00753
00754 void
00755 plexus_cmd_sqline (char *mask, char *reason)
00756 {
00757 send_cmd (s_OperServ, "RESV * %s :%s", mask, reason);
00758 }
00759
00760 void
00761 plexus_cmd_unsgline (char *mask)
00762 {
00763 send_cmd (s_OperServ, "UNXLINE * %s", mask);
00764 }
00765
00766 void
00767 plexus_cmd_unszline (char *mask)
00768 {
00769
00770 }
00771
00772 void
00773 plexus_cmd_szline (char *mask, char *reason, char *whom)
00774 {
00775
00776 }
00777
00778 void
00779 plexus_cmd_svsnoop (char *server, int set)
00780 {
00781 send_cmd(ServerName, "ENCAP %s SVSNOOP %s",
00782 server, (set ? "+" : "-"));
00783 }
00784
00785 void
00786 plexus_cmd_svsadmin (char *server, int set)
00787 {
00788 plexus_cmd_svsnoop (server, set);
00789 }
00790
00791 void
00792 plexus_cmd_sgline (char *mask, char *reason)
00793 {
00794 send_cmd (s_OperServ, "XLINE * %s 0 :%s", mask, reason);
00795 }
00796
00797 void
00798 plexus_cmd_remove_akill (char *user, char *host)
00799 {
00800 send_cmd (s_OperServ, "UNKLINE * %s %s", user, host);
00801 }
00802
00803 void
00804 plexus_cmd_topic (char *whosets, char *chan, char *whosetit,
00805 char *topic, time_t when)
00806 {
00807 send_cmd (whosets, "ENCAP * TOPIC %s %s %lu :%s", chan, whosetit,
00808 (unsigned long int) when, topic);
00809 }
00810
00811 void
00812 plexus_cmd_vhost_off (User * u)
00813 {
00814 common_svsmode (u, "-x", NULL);
00815 }
00816
00817 void
00818 plexus_cmd_vhost_on (char *nick, char *vIdent, char *vhost)
00819 {
00820 User *u;
00821
00822 if (!nick)
00823 {
00824 return;
00825 }
00826
00827 u = finduser (nick);
00828
00829 if (u)
00830 {
00831 send_cmd (ServerName, "ENCAP * CHGHOST %s %s", u->nick, vhost);
00832 common_svsmode (u, "+x", NULL);
00833 u->mode |= UMODE_x;
00834 }
00835 }
00836
00837 void
00838 plexus_cmd_unsqline (char *user)
00839 {
00840 send_cmd (s_OperServ, "UNRESV * %s", user);
00841 }
00842
00843 void
00844 plexus_cmd_join (char *user, char *channel, time_t chantime)
00845 {
00846 send_cmd (ServerName, "SJOIN %ld %s + :%s", (long int) chantime, channel,
00847 user);
00848 }
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859 void
00860 plexus_cmd_akill (char *user, char *host, char *who, time_t when,
00861 time_t expires, char *reason)
00862 {
00863 send_cmd (s_OperServ, "KLINE * %ld %s %s :%s",
00864 (long int) (expires - (long) time (NULL)), user, host, reason);
00865 }
00866
00867 void
00868 plexus_cmd_svskill (char *source, char *user, char *buf)
00869 {
00870 if (!buf)
00871 {
00872 return;
00873 }
00874
00875 if (!source || !user)
00876 {
00877 return;
00878 }
00879
00880 send_cmd (source, "KILL %s :%s", user, buf);
00881 }
00882
00883 void
00884 plexus_cmd_svsmode (User * u, int ac, char **av)
00885 {
00886 send_cmd (ServerName, "ENCAP * SVSMODE %s %ld %s%s%s", u->nick,
00887 (long int) u->timestamp, av[0], (ac == 2 ? " " : ""),
00888 (ac == 2 ? av[1] : ""));
00889 }
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899 void
00900 plexus_cmd_svinfo ()
00901 {
00902 send_cmd (NULL, "SVINFO 5 5 0 :%ld", (long int) time (NULL));
00903 }
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927 void
00928 plexus_cmd_capab ()
00929 {
00930 send_cmd (NULL,
00931 "CAPAB :QS EX CHW IE EOB KLN UNKLN GLN HUB KNOCK TBURST PARA ENCAP SVS");
00932 }
00933
00934
00935 void
00936 plexus_cmd_pass (char *pass)
00937 {
00938 send_cmd (NULL, "PASS %s :TS", pass);
00939 }
00940
00941
00942 void
00943 plexus_cmd_server (char *servname, int hop, char *descript)
00944 {
00945 send_cmd (NULL, "SERVER %s %d :%s", servname, hop, descript);
00946 }
00947
00948 void
00949 plexus_cmd_connect (int servernum)
00950 {
00951 me_server = new_server (NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
00952
00953 if (servernum == 1)
00954 plexus_cmd_pass (RemotePassword);
00955 else if (servernum == 2)
00956 plexus_cmd_pass (RemotePassword2);
00957 else if (servernum == 3)
00958 plexus_cmd_pass (RemotePassword3);
00959
00960 plexus_cmd_capab ();
00961 plexus_cmd_server (ServerName, 1, ServerDesc);
00962 plexus_cmd_svinfo ();
00963 }
00964
00965 void
00966 plexus_cmd_svsinfo ()
00967 {
00968
00969 }
00970
00971
00972
00973 void
00974 plexus_cmd_bot_nick (char *nick, char *user, char *host, char *real,
00975 char *modes)
00976 {
00977 EnforceQlinedNick (nick, NULL);
00978 send_cmd (ServerName, "NICK %s 1 %ld %s %s %s %s 0 %s :%s", nick,
00979 (long int) time (NULL), modes, user, host, ServerName, host,
00980 real);
00981 plexus_cmd_sqline (nick, "Reserved for services");
00982
00983 }
00984
00985 void
00986 plexus_cmd_part (char *nick, char *chan, char *buf)
00987 {
00988 if (buf)
00989 {
00990 send_cmd (nick, "PART %s :%s", chan, buf);
00991 }
00992 else
00993 {
00994 send_cmd (nick, "PART %s", chan);
00995 }
00996 }
00997
00998 int
00999 anope_event_ping (char *source, int ac, char **av)
01000 {
01001 if (ac < 1)
01002 return MOD_CONT;
01003 plexus_cmd_pong (ac > 1 ? av[1] : ServerName, av[0]);
01004 return MOD_CONT;
01005 }
01006
01007 int
01008 anope_event_away (char *source, int ac, char **av)
01009 {
01010 if (!source)
01011 {
01012 return MOD_CONT;
01013 }
01014 m_away (source, (ac ? av[0] : NULL));
01015 return MOD_CONT;
01016 }
01017
01018 int
01019 anope_event_kill (char *source, int ac, char **av)
01020 {
01021 if (ac != 2)
01022 return MOD_CONT;
01023
01024 m_kill (av[0], av[1]);
01025 return MOD_CONT;
01026 }
01027
01028 int
01029 anope_event_kick (char *source, int ac, char **av)
01030 {
01031 if (ac != 3)
01032 return MOD_CONT;
01033 do_kick (source, ac, av);
01034 return MOD_CONT;
01035 }
01036
01037 int
01038 anope_event_eob (char *source, int ac, char **av)
01039 {
01040 Server *s;
01041 s = findserver (servlist, source);
01042
01043
01044
01045
01046 if (!s && serv_uplink)
01047 s = serv_uplink;
01048 finish_sync (s, 1);
01049
01050 return MOD_CONT;
01051 }
01052
01053 void
01054 plexus_cmd_eob ()
01055 {
01056 send_cmd (ServerName, "EOB");
01057 }
01058
01059
01060 int
01061 anope_event_join (char *source, int ac, char **av)
01062 {
01063 if (ac != 1)
01064 return MOD_CONT;
01065 do_join (source, ac, av);
01066 return MOD_CONT;
01067 }
01068
01069 int
01070 anope_event_motd (char *source, int ac, char **av)
01071 {
01072 if (!source)
01073 {
01074 return MOD_CONT;
01075 }
01076
01077 m_motd (source);
01078 return MOD_CONT;
01079 }
01080
01081 int
01082 anope_event_privmsg (char *source, int ac, char **av)
01083 {
01084 if (ac != 2)
01085 return MOD_CONT;
01086 m_privmsg (source, av[0], av[1]);
01087 return MOD_CONT;
01088 }
01089
01090 int
01091 anope_event_part (char *source, int ac, char **av)
01092 {
01093 if (ac < 1 || ac > 2)
01094 return MOD_CONT;
01095 do_part (source, ac, av);
01096 return MOD_CONT;
01097 }
01098
01099 int
01100 anope_event_whois (char *source, int ac, char **av)
01101 {
01102 if (source && ac >= 1)
01103 {
01104 m_whois (source, av[0]);
01105 }
01106 return MOD_CONT;
01107 }
01108
01109
01110 int
01111 anope_event_server (char *source, int ac, char **av)
01112 {
01113 if (!stricmp (av[1], "1"))
01114 {
01115 uplink = sstrdup (av[0]);
01116 }
01117 do_server (source, av[0], av[1], av[2], NULL);
01118 return MOD_CONT;
01119 }
01120
01121 int
01122 anope_event_squit (char *source, int ac, char **av)
01123 {
01124 if (ac != 2)
01125 return MOD_CONT;
01126 do_squit (source, ac, av);
01127 return MOD_CONT;
01128 }
01129
01130 int
01131 anope_event_quit (char *source, int ac, char **av)
01132 {
01133 if (ac != 1)
01134 return MOD_CONT;
01135 do_quit (source, ac, av);
01136 return MOD_CONT;
01137 }
01138
01139 void
01140 plexus_cmd_372 (char *source, char *msg)
01141 {
01142 send_cmd (ServerName, "372 %s :- %s", source, msg);
01143 }
01144
01145 void
01146 plexus_cmd_372_error (char *source)
01147 {
01148 send_cmd (ServerName, "422 %s :- MOTD file not found! Please "
01149 "contact your IRC administrator.", source);
01150 }
01151
01152 void
01153 plexus_cmd_375 (char *source)
01154 {
01155 send_cmd (ServerName, "375 %s :- %s Message of the Day",
01156 source, ServerName);
01157 }
01158
01159 void
01160 plexus_cmd_376 (char *source)
01161 {
01162 send_cmd (ServerName, "376 %s :End of /MOTD command.", source);
01163 }
01164
01165
01166 void
01167 plexus_cmd_391 (char *source, char *timestr)
01168 {
01169 if (!timestr)
01170 {
01171 return;
01172 }
01173 send_cmd (ServerName, "391 :%s %s :%s", source, ServerName, timestr);
01174 }
01175
01176
01177 void
01178 plexus_cmd_250 (char *buf)
01179 {
01180 if (!buf)
01181 {
01182 return;
01183 }
01184
01185 send_cmd (ServerName, "250 %s", buf);
01186 }
01187
01188
01189 void
01190 plexus_cmd_307 (char *buf)
01191 {
01192 if (!buf)