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