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