00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "services.h"
00016 #include "pseudo.h"
00017 #include "viagra.h"
00018
00019 IRCDVar myIrcd[] = {
00020 {"ViagraIRCd 1.3.*",
00021 "+oS",
00022 "+oS",
00023 "+oS",
00024 "+oS",
00025 "+ioS",
00026 "+oS",
00027 "+oS",
00028 "+i",
00029 "+ioS",
00030 "+oS",
00031 "+oS",
00032 "+oS",
00033 "+ioS",
00034 "+ioS",
00035 "+oS",
00036 "+oS",
00037 "+iS",
00038 "+ioS",
00039 "+qS",
00040 5,
00041 "-ciklmnpstOR",
00042 "+ao",
00043 1,
00044 1,
00045 1,
00046 "+q",
00047 "-q",
00048 "+a",
00049 "-a",
00050 "+rd",
00051 NULL,
00052 NULL,
00053 NULL,
00054 "-r+d",
00055 "-r+d",
00056 1,
00057 1,
00058 1,
00059 1,
00060 3,
00061 0,
00062 0,
00063 1,
00064 0,
00065 0,
00066 0,
00067 1,
00068 0,
00069 1,
00070 1,
00071 1,
00072 0,
00073 1,
00074 CMODE_r,
00075 1,
00076 0,
00077 1,
00078 1,
00079 0,
00080 1,
00081 1,
00082 1,
00083 0,
00084 0,
00085 DEFAULT_MLOCK,
00086 UMODE_x,
00087 0,
00088 0,
00089 0,
00090 0,
00091 1,
00092 1,
00093 NULL,
00094 0,
00095 1,
00096 0,
00097 0,
00098 0,
00099 0,
00100 0,
00101 0,
00102 0,
00103 "x",
00104 0,
00105 1,
00106 0,
00107 NULL,
00108 1,
00109 0,
00110 }
00111 ,
00112 {NULL}
00113 };
00114
00115
00116 IRCDCAPAB myIrcdcap[] = {
00117 {
00118 CAPAB_NOQUIT,
00119 CAPAB_TSMODE,
00120 CAPAB_UNCONNECT,
00121 CAPAB_NICKIP,
00122 CAPAB_NSJOIN,
00123 CAPAB_ZIP,
00124 CAPAB_BURST,
00125 CAPAB_TS5,
00126 CAPAB_TS3,
00127 CAPAB_DKEY,
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,
00142 0,
00143 0,
00144 CAPAB_DODKEY,
00145 CAPAB_DOZIP,
00146 0, 0, 0}
00147 };
00148
00149
00150
00151
00152 void viagra_set_umode(User * user, int ac, char **av)
00153 {
00154 int add = 1;
00155 char *modes = av[0];
00156
00157 ac--;
00158
00159 if (debug)
00160 alog("debug: Changing mode for %s to %s", user->nick, modes);
00161
00162 while (*modes) {
00163
00164
00165
00166
00167 if (add)
00168 user->mode |= umodes[(int) *modes];
00169 else
00170 user->mode &= ~umodes[(int) *modes];
00171
00172 switch (*modes++) {
00173 case '+':
00174 add = 1;
00175 break;
00176 case '-':
00177 add = 0;
00178 break;
00179 case 'd':
00180 if (ac == 0) {
00181 alog("user: umode +d with no parameter (?) for user %s",
00182 user->nick);
00183 break;
00184 }
00185
00186 ac--;
00187 av++;
00188 user->svid = strtoul(*av, NULL, 0);
00189 break;
00190 case 'o':
00191 if (add) {
00192 opcnt++;
00193 if (WallOper) {
00194 anope_cmd_global(s_OperServ,
00195 "\2%s\2 is now an IRC operator.",
00196 user->nick);
00197 }
00198 display_news(user, NEWS_OPER);
00199 } else {
00200 opcnt--;
00201 }
00202 break;
00203 case 'r':
00204 if (add && !nick_identified(user)) {
00205 common_svsmode(user, "-r", NULL);
00206 user->mode &= ~UMODE_r;
00207 }
00208 break;
00209 case 'x':
00210 update_host(user);
00211 break;
00212 }
00213 }
00214 }
00215
00216 unsigned long umodes[128] = {
00217 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00218 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00220 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00221 0, UMODE_A, 0, UMODE_C, 0, 0, 0, 0, 0, UMODE_I, 0, 0, 0, 0, UMODE_N,
00222 UMODE_O,
00223 0,
00224 UMODE_Q,
00225 UMODE_R,
00226 UMODE_S, UMODE_T, 0, 0, 0, 0, 0,
00227 0,
00228 0, 0, 0, 0, 0,
00229 0, UMODE_a, UMODE_b, UMODE_c, UMODE_d, UMODE_e, UMODE_f,
00230 UMODE_g,
00231 UMODE_h, UMODE_i, 0, 0, 0, 0, UMODE_n, UMODE_o,
00232 0,
00233 0, UMODE_r, UMODE_s, 0, 0, 0, UMODE_w,
00234 UMODE_x,
00235 0,
00236 0,
00237 0, 0, 0, 0, 0
00238 };
00239
00240
00241 char myCsmodes[128] = {
00242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00243 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00244
00245 0,
00246 0,
00247 0, 0, 0,
00248 'h',
00249 0,
00250 0, 0, 0,
00251 'q',
00252
00253 'v', 0, 0, 0, 0,
00254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00255
00256 'o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00258
00259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'a', 0
00261 };
00262
00263 CMMode myCmmodes[128] = {
00264 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00265 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00266 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00267 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00268 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00269 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00270 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00271 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00272 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00273 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00274 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00275 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00276 {NULL},
00277 {NULL},
00278 {add_ban, del_ban},
00279 {NULL},
00280 {NULL},
00281 {add_exception, del_exception},
00282 {NULL},
00283 {NULL},
00284 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00285 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00286 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}
00287 };
00288
00289
00290
00291 CBMode myCbmodes[128] = {
00292 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00293 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00294 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00295 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00296 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00297 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00298 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00299 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00300 {0},
00301 {0},
00302 {0},
00303 {0},
00304 {0},
00305 {0},
00306 {0},
00307 {0},
00308 {CMODE_H, 0, NULL, NULL},
00309 {0},
00310 {0},
00311 {0},
00312 {0},
00313 {CMODE_M, 0, NULL, NULL},
00314 {CMODE_N, 0, NULL, NULL},
00315 {CMODE_O, CBM_NO_USER_MLOCK, NULL, NULL},
00316 {CMODE_P, 0, NULL, NULL},
00317 {0},
00318 {CMODE_R, 0, NULL, NULL},
00319 {CMODE_S, 0, NULL, NULL},
00320 {0},
00321 {0},
00322 {0},
00323 {0},
00324 {0},
00325 {0},
00326 {0},
00327 {0}, {0}, {0}, {0}, {0}, {0},
00328 {0},
00329 {0},
00330 {CMODE_c, 0, NULL, NULL},
00331 {0},
00332 {0},
00333 {0},
00334 {0},
00335 {0},
00336 {CMODE_i, 0, NULL, NULL},
00337 {0},
00338 {CMODE_k, 0, chan_set_key, cs_set_key},
00339 {CMODE_l, CBM_MINUS_NO_ARG, set_limit, cs_set_limit},
00340 {CMODE_m, 0, NULL, NULL},
00341 {CMODE_n, 0, NULL, NULL},
00342 {0},
00343 {CMODE_p, 0, NULL, NULL},
00344 {0},
00345 {CMODE_r, CBM_NO_MLOCK, NULL, NULL},
00346 {CMODE_s, 0, NULL, NULL},
00347 {CMODE_t, 0, NULL, NULL},
00348 {0},
00349 {0},
00350 {0},
00351 {CMODE_x, 0, NULL, NULL},
00352 {0},
00353 {0},
00354 {0}, {0}, {0}, {0}
00355 };
00356
00357 CBModeInfo myCbmodeinfos[] = {
00358 {'c', CMODE_c, 0, NULL, NULL},
00359 {'i', CMODE_i, 0, NULL, NULL},
00360 {'k', CMODE_k, 0, get_key, cs_get_key},
00361 {'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit},
00362 {'m', CMODE_m, 0, NULL, NULL},
00363 {'n', CMODE_n, 0, NULL, NULL},
00364 {'p', CMODE_p, 0, NULL, NULL},
00365 {'r', CMODE_r, 0, NULL, NULL},
00366 {'s', CMODE_s, 0, NULL, NULL},
00367 {'t', CMODE_t, 0, NULL, NULL},
00368 {'x', CMODE_x, 0, NULL, NULL},
00369 {'H', CMODE_H, 0, NULL, NULL},
00370 {'M', CMODE_M, 0, NULL, NULL},
00371 {'N', CMODE_N, 0, NULL, NULL},
00372 {'O', CMODE_O, 0, NULL, NULL},
00373 {'P', CMODE_P, 0, NULL, NULL},
00374 {'R', CMODE_R, 0, NULL, NULL},
00375 {'S', CMODE_S, 0, NULL, NULL},
00376 {0}
00377 };
00378
00379 CUMode myCumodes[128] = {
00380 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00381 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00382 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00383 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00384
00385 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00386 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00387 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00388 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00389
00390 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00391 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00392 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00393 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00394
00395 {0},
00396
00397 {CUS_PROTECT, CUF_PROTECT_BOTSERV, check_valid_op},
00398 {0},
00399 {0},
00400 {0},
00401 {0},
00402 {0},
00403 {0},
00404 {CUS_HALFOP, 0, check_valid_op},
00405 {0},
00406 {0},
00407 {0},
00408 {0},
00409 {0},
00410 {0},
00411 {CUS_OP, CUF_PROTECT_BOTSERV, check_valid_op},
00412 {0},
00413 {CUS_OWNER, 0, check_valid_op},
00414 {0},
00415 {0},
00416 {0},
00417 {0},
00418 {CUS_VOICE, 0, NULL},
00419 {0},
00420 {0},
00421 {0},
00422 {0},
00423 {0}, {0}, {0}, {0}, {0}
00424 };
00425
00426
00427 void viagra_cmd_bot_unban(ChannelInfo * ci, char *nick)
00428 {
00429 send_cmd(ServerName, "SVSMODE %s -b %s", ci->name, nick);
00430 }
00431
00432 int anope_event_setname(char *source, int ac, char **av)
00433 {
00434 User *u;
00435
00436 if (ac != 1)
00437 return MOD_CONT;
00438
00439 u = finduser(source);
00440 if (!u) {
00441 if (debug) {
00442 alog("debug: SETNAME for nonexistent user %s", source);
00443 }
00444 return MOD_CONT;
00445 }
00446
00447 change_user_realname(u, av[0]);
00448 return MOD_CONT;
00449 }
00450
00451 int anope_event_sjoin(char *source, int ac, char **av)
00452 {
00453 do_sjoin(source, ac, av);
00454 return MOD_CONT;
00455 }
00456
00457 int anope_event_chgname(char *source, int ac, char **av)
00458 {
00459 User *u;
00460
00461 if (ac != 2)
00462 return MOD_CONT;
00463
00464 u = finduser(av[0]);
00465 if (!u) {
00466 if (debug) {
00467 alog("debug: CHGNAME for nonexistent user %s", av[0]);
00468 }
00469 return MOD_CONT;
00470 }
00471
00472 change_user_realname(u, av[1]);
00473 return MOD_CONT;
00474 }
00475
00476 int anope_event_setident(char *source, int ac, char **av)
00477 {
00478 User *u;
00479
00480 if (ac != 1)
00481 return MOD_CONT;
00482
00483 u = finduser(source);
00484 if (!u) {
00485 if (debug) {
00486 alog("debug: SETIDENT for nonexistent user %s", source);
00487 }
00488 return MOD_CONT;
00489 }
00490
00491 change_user_username(u, av[0]);
00492 return MOD_CONT;
00493 }
00494
00495 int anope_event_chgident(char *source, int ac, char **av)
00496 {
00497 User *u;
00498
00499 if (ac != 2)
00500 return MOD_CONT;
00501
00502 u = finduser(av[0]);
00503 if (!u) {
00504 if (debug) {
00505 alog("debug: CHGIDENT for nonexistent user %s", av[0]);
00506 }
00507 return MOD_CONT;
00508 }
00509
00510 change_user_username(u, av[1]);
00511 return MOD_CONT;
00512 }
00513
00514
00515
00516
00517
00518
00519 int anope_event_sethost(char *source, int ac, char **av)
00520 {
00521 User *u;
00522
00523 if (ac != 1)
00524 return MOD_CONT;
00525
00526 u = finduser(source);
00527 if (!u) {
00528 if (debug) {
00529 alog("debug: SETHOST for nonexistent user %s", source);
00530 }
00531 return MOD_CONT;
00532 }
00533
00534 change_user_host(u, av[0]);
00535 return MOD_CONT;
00536 }
00537
00538 int anope_event_nick(char *source, int ac, char **av)
00539 {
00540 User *user;
00541
00542 if (ac != 2) {
00543 user = do_nick(source, av[0], av[4], av[5], av[6], av[9],
00544 strtoul(av[2], NULL, 10), strtoul(av[7], NULL, 0),
00545 strtoul(av[8], NULL, 0), "*", NULL);
00546 if (user) {
00547 anope_set_umode(user, 1, &av[3]);
00548 }
00549 } else {
00550 do_nick(source, av[0], NULL, NULL, NULL, NULL,
00551 strtoul(av[1], NULL, 10), 0, 0, NULL, NULL);
00552 }
00553 return MOD_CONT;
00554 }
00555
00556 int anope_event_vs(char *source, int ac, char **av)
00557 {
00558 User *u;
00559
00560 if (ac != 2)
00561 return MOD_CONT;
00562
00563 u = finduser(av[0]);
00564 if (!u) {
00565 if (debug) {
00566 alog("debug: VS for nonexistent user %s", av[0]);
00567 }
00568 return MOD_CONT;
00569 }
00570
00571 change_user_host(u, av[1]);
00572 return MOD_CONT;
00573
00574 }
00575
00576 int anope_event_chghost(char *source, int ac, char **av)
00577 {
00578 User *u;
00579
00580 if (ac != 2)
00581 return MOD_CONT;
00582
00583 u = finduser(av[0]);
00584 if (!u) {
00585 if (debug) {
00586 alog("debug: CHGHOST for nonexistent user %s", av[0]);
00587 }
00588 return MOD_CONT;
00589 }
00590
00591 change_user_host(u, av[1]);
00592 return MOD_CONT;
00593 }
00594
00595 int anope_event_436(char *source, int ac, char **av)
00596 {
00597 if (ac < 1)
00598 return MOD_CONT;
00599
00600 m_nickcoll(av[0]);
00601 return MOD_CONT;
00602 }
00603
00604 int anope_event_notice(char *source, int ac, char **av)
00605 {
00606 return MOD_CONT;
00607 }
00608
00609 int anope_event_pass(char *source, int ac, char **av)
00610 {
00611 return MOD_CONT;
00612 }
00613
00614 int anope_event_svinfo(char *source, int ac, char **av)
00615 {
00616 return MOD_CONT;
00617 }
00618
00619
00620
00621
00622
00623
00624 int anope_event_gnotice(char *source, int ac, char **av)
00625 {
00626 return MOD_CONT;
00627 }
00628
00629 int anope_event_sqline(char *source, int ac, char **av)
00630 {
00631 return MOD_CONT;
00632 }
00633
00634 int anope_event_burst(char *source, int ac, char **av)
00635 {
00636 Server *s;
00637 s = findserver(servlist, source);
00638 if (!ac) {
00639
00640 } else {
00641
00642
00643
00644
00645 if (!s && serv_uplink)
00646 s = serv_uplink;
00647 finish_sync(s, 1);
00648 }
00649 return MOD_CONT;
00650 }
00651
00652 int anope_event_tctrl(char *source, int ac, char **av)
00653 {
00654 return MOD_CONT;
00655 }
00656
00657
00658
00659
00660
00661
00662 int anope_event_error(char *source, int ac, char **av)
00663 {
00664 if (ac >= 1) {
00665 if (debug) {
00666 alog("debug: %s", av[0]);
00667 }
00668 }
00669 return MOD_CONT;
00670 }
00671
00672
00673 void moduleAddIRCDMsgs(void) {
00674 Message *m;
00675
00676 updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+a","-a");
00677
00678 m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
00679 m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
00680 m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
00681 m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
00682 m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
00683 m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
00684 m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
00685 m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
00686 m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
00687 m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
00688 m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
00689 m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
00690 m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
00691 m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
00692 m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
00693 m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
00694 m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
00695 m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m);
00696 m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m);
00697 m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m);
00698 m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m);
00699 m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
00700 m = createMessage("AKILL", anope_event_null); addCoreMessage(IRCD,m);
00701 m = createMessage("GLOBOPS", anope_event_null); addCoreMessage(IRCD,m);
00702 m = createMessage("GNOTICE", anope_event_gnotice); addCoreMessage(IRCD,m);
00703 m = createMessage("GOPER", anope_event_null); addCoreMessage(IRCD,m);
00704 m = createMessage("RAKILL", anope_event_null); addCoreMessage(IRCD,m);
00705 m = createMessage("SILENCE", anope_event_null); addCoreMessage(IRCD,m);
00706 m = createMessage("SVSKILL", anope_event_null); addCoreMessage(IRCD,m);
00707 m = createMessage("SVSMODE", anope_event_mode); addCoreMessage(IRCD,m);
00708 m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m);
00709 m = createMessage("SVSNOOP", anope_event_null); addCoreMessage(IRCD,m);
00710 m = createMessage("SQLINE", anope_event_sqline); addCoreMessage(IRCD,m);
00711 m = createMessage("UNSQLINE", anope_event_null); addCoreMessage(IRCD,m);
00712 m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m);
00713 m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m);
00714 m = createMessage("HS", anope_event_hs); addCoreMessage(IRCD,m);
00715 m = createMessage("MS", anope_event_ms); addCoreMessage(IRCD,m);
00716 m = createMessage("NS", anope_event_ns); addCoreMessage(IRCD,m);
00717 m = createMessage("OS", anope_event_os); addCoreMessage(IRCD,m);
00718 m = createMessage("RS", anope_event_null); addCoreMessage(IRCD,m);
00719 m = createMessage("SGLINE", anope_event_null); addCoreMessage(IRCD,m);
00720 m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
00721 m = createMessage("SS", anope_event_null); addCoreMessage(IRCD,m);
00722 m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m);
00723 m = createMessage("SZLINE", anope_event_null); addCoreMessage(IRCD,m);
00724 m = createMessage("UNSGLINE", anope_event_null); addCoreMessage(IRCD,m);
00725 m = createMessage("UNSZLINE", anope_event_null); addCoreMessage(IRCD,m);
00726 m = createMessage("CHGHOST", anope_event_chghost); addCoreMessage(IRCD,m);
00727 m = createMessage("CHGIDENT", anope_event_chgident); addCoreMessage(IRCD,m);
00728 m = createMessage("CHGNAME", anope_event_chgname); addCoreMessage(IRCD,m);
00729 m = createMessage("SETHOST", anope_event_sethost); addCoreMessage(IRCD,m);
00730 m = createMessage("SETIDENT", anope_event_setident); addCoreMessage(IRCD,m);
00731 m = createMessage("SETNAME", anope_event_setname); addCoreMessage(IRCD,m);
00732 m = createMessage("VS", anope_event_vs); addCoreMessage(IRCD,m);
00733 m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m);
00734 m = createMessage("TCTRL", anope_event_tctrl); addCoreMessage(IRCD,m);
00735 m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
00736 m = createMessage("REHASH", anope_event_rehash); addCoreMessage(IRCD,m);
00737 m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
00738 m = createMessage("SNOTICE", anope_event_snotice); addCoreMessage(IRCD,m);
00739 }
00740
00741
00742
00743
00744
00745 void viagra_cmd_sqline(char *mask, char *reason)
00746 {
00747 if (!mask || !reason) {
00748 return;
00749 }
00750
00751 send_cmd(NULL, "SQLINE %s :%s", mask, reason);
00752 }
00753
00754 void viagra_cmd_unsgline(char *mask)
00755 {
00756 send_cmd(NULL, "UNSGLINE 0 :%s", mask);
00757 }
00758
00759 void viagra_cmd_unszline(char *mask)
00760 {
00761 send_cmd(NULL, "UNSZLINE 0 %s", mask);
00762 }
00763
00764 void viagra_cmd_szline(char *mask, char *reason, char *whom)
00765 {
00766 send_cmd(NULL, "SZLINE %s :%s", mask, reason);
00767 }
00768
00769 void viagra_cmd_svsnoop(char *server, int set)
00770 {
00771 send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
00772 }
00773
00774 void viagra_cmd_svsadmin(char *server, int set)
00775 {
00776 viagra_cmd_svsnoop(server, set);
00777 }
00778
00779 void viagra_cmd_sgline(char *mask, char *reason)
00780 {
00781 send_cmd(NULL, "SGLINE %d :%s:%s", (int)strlen(mask), mask, reason);
00782 }
00783
00784 void viagra_cmd_remove_akill(char *user, char *host)
00785 {
00786 send_cmd(NULL, "RAKILL %s %s", host, user);
00787 }
00788
00789
00790 void viagra_cmd_part(char *nick, char *chan, char *buf)
00791 {
00792 if (!nick || !chan) {
00793 return;
00794 }
00795
00796 if (buf) {
00797 send_cmd(nick, "PART %s :%s", chan, buf);
00798 } else {
00799 send_cmd(nick, "PART %s", chan);
00800 }
00801 }
00802
00803 void viagra_cmd_topic(char *whosets, char *chan, char *whosetit,
00804 char *topic, time_t when)
00805 {
00806 send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit,
00807 (unsigned long int) when, topic);
00808 }
00809
00810 void viagra_cmd_vhost_off(User * u)
00811 {
00812 send_cmd(NULL, "SVSMODE %s -x", u->nick);
00813 notice_lang(s_HostServ, u, HOST_OFF_UNREAL, u->nick, ircd->vhostchar);
00814 }
00815
00816 void viagra_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
00817 {
00818 if (vIdent) {
00819 send_cmd(NULL, "CHGIDENT %s %s", nick, vIdent);
00820 }
00821 send_cmd(NULL, "SVSMODE %s +x", nick);
00822 send_cmd(NULL, "SVSCHGHOST %s %s", nick, vhost);
00823 }
00824
00825 void viagra_cmd_unsqline(char *user)
00826 {
00827 send_cmd(NULL, "UNSQLINE %s", user);
00828 }
00829
00830 void viagra_cmd_join(char *user, char *channel, time_t chantime)
00831 {
00832 send_cmd(user, "SJOIN %ld %s", (long int) chantime, channel);
00833 }
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845 void viagra_cmd_akill(char *user, char *host, char *who, time_t when,
00846 time_t expires, char *reason)
00847 {
00848 send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400 * 2, who,
00849 (long int) time(NULL), reason);
00850 }
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860 void viagra_cmd_svskill(char *source, char *user, char *buf)
00861 {
00862 if (buf) {
00863 send_cmd(source, "SVSKILL %s :%s", user, buf);
00864 }
00865 return;
00866 }
00867
00868 void viagra_cmd_mode(char *source, char *dest, char *buf)
00869 {
00870 if (!buf) {
00871 return;
00872 }
00873
00874 if (ircdcap->tsmode) {
00875 if (uplink_capab & ircdcap->tsmode) {
00876 send_cmd(source, "MODE %s 0 %s", dest, buf);
00877 } else {
00878 send_cmd(source, "MODE %s %s", dest, buf);
00879 }
00880 } else {
00881 send_cmd(source, "MODE %s %s", dest, buf);
00882 }
00883 }
00884
00885
00886 void viagra_cmd_quit(char *source, char *buf)
00887 {
00888 if (buf) {
00889 send_cmd(source, "QUIT :%s", buf);
00890 } else {
00891 send_cmd(source, "QUIT");
00892 }
00893 }
00894
00895 int anope_event_away(char *source, int ac, char **av)
00896 {
00897 if (!source) {
00898 return MOD_CONT;
00899 }
00900 m_away(source, (ac ? av[0] : NULL));
00901 return MOD_CONT;
00902 }
00903
00904 int anope_event_ping(char *source, int ac, char **av)
00905 {
00906 if (ac < 1)
00907 return MOD_CONT;
00908 viagra_cmd_pong(ac > 1 ? av[1] : ServerName, av[0]);
00909 return MOD_CONT;
00910 }
00911
00912 void viagra_cmd_svsmode(User * u, int ac, char **av)
00913 {
00914 send_cmd(ServerName, "SVSMODE %s %ld %s%s%s", u->nick,
00915 (long int) u->timestamp, av[0], (ac == 2 ? " " : ""),
00916 (ac == 2 ? av[1] : ""));
00917 }
00918
00919 void viagra_cmd_squit(char *servname, char *message)
00920 {
00921 send_cmd(NULL, "SQUIT %s :%s", servname, message);
00922 }
00923
00924
00925 void viagra_cmd_pong(char *servname, char *who)
00926 {
00927 send_cmd(servname, "PONG %s", who);
00928 }
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938 void viagra_cmd_svinfo()
00939 {
00940 send_cmd(NULL, "SVINFO 5 3 0 :%ld", (long int) time(NULL));
00941 }
00942
00943
00944 void viagra_cmd_capab()
00945 {
00946 send_cmd(NULL, "CAPAB TS5 NOQUIT SSJOIN BURST UNCONNECT NICKIP");
00947 }
00948
00949
00950 void viagra_cmd_pass(char *pass)
00951 {
00952 send_cmd(NULL, "PASS %s :TS", pass);
00953 }
00954
00955
00956 void viagra_cmd_server(char *servname, int hop, char *descript)
00957 {
00958 send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript);
00959 }
00960
00961 void viagra_cmd_burst()
00962 {
00963 send_cmd(NULL, "BURST");
00964 }
00965
00966 void viagra_cmd_connect(int servernum)
00967 {
00968 me_server =
00969 new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
00970
00971 if (servernum == 1) {
00972 viagra_cmd_pass(RemotePassword);
00973 } else if (servernum == 2) {
00974 viagra_cmd_pass(RemotePassword2);
00975 } else if (servernum == 3) {
00976 viagra_cmd_pass(RemotePassword3);
00977 }
00978 viagra_cmd_capab();
00979 viagra_cmd_server(ServerName, 1, ServerDesc);
00980