/************************************************************************ * Unreal Internet Relay Chat Daemon, src/help.c * Copyright (C) 1996 DALnet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Updated to use UnrealIRCd commands -Techie/Stskeeps * */ #include "struct.h" #include "common.h" #include "sys.h" #include "h.h" ID_CVS("$Id$"); ID_Copyright("DALnet & Techie"); ID_Notes("6.20 7/5/99"); void xx(sptr, str, num) aClient *sptr; char *str; int num; { if (sptr == NULL) { printf("%s\n", str); return; } sendto_one(sptr, ":%s %i %s :%s", me.name, num, sptr->name, str); } #define HDR(str) xx(sptr, str, 290) #define SND(str) xx(sptr, str, 291) #define FTR(str) xx(sptr, str, 292) #define HLP(str) xx(sptr, str, 293) /* * This is _not_ the final help.c, we're just testing the functionality... * Return 0 to forward request to helpops... -Donwulff */ extern struct Message msgtab[]; int parse_help(sptr, name, help) aClient *sptr; char *name; char *help; { int i; // sendto_one(sptr, ":%s NOTICE %s :%s", me.name, sptr->name, help); if (BadPtr(help)) { HDR(" ***** UnrealIRCd Help System *****"); SND (" You need to specify your question after the help-command"); SND (" If the IRC Server is unable to satisfy your help-request"); SND (" it will be forwarded to appropriate people for handling."); SND (" Preceed your question with ! to automatically forward it to"); SND(" qualified helpers, or ? to never forward it."); SND(" Else type /HELPOP CMDS to get some help on the IRCd"); SND(" /HELPOP ABOUT gets some info about UnrealIRCd"); } else if (!myncmp(help, "CMDS", 8)) { HDR(" *** UnrealIRCd Commands *** "); SND(" Currently help is available on these commands "); SND (" Use /HelpOp to get info about the command"); SND(" WATCH HELPOP LIST"); SND(" PRIVMSG KNOCK LICENSE"); SND(" SETNAME MODE STATSERV"); SND(" CREDITS DALINFO"); SND(" ----------------------------"); SND(" OPERCMDS - IRCop Commands"); SND(" UMODES - Usermodes"); SND(" CHMODES - Channelmodes"); SND(" OFLAGS - O:Line flags"); SND(" -----------oOo------------"); } else if (!myncmp(help, "ABOUT", 8)) { SND ("Type /info for UnrealIRCd information -- Carsten Munk / Techie .. =)"); } else if (!myncmp(help, "WATCH", 8)) { HDR(" *** WATCH Command ***"); SND ("Watch is a new notify-type system in UnrealIRCd which is both faster"); SND ("and uses less network resources than any old-style notify"); SND ("system. You may add entries to your Watch list with the command"); SND ("/watch +nick1 [+nick2 +nick3 ..., and the server will send"); SND ("you a message when any nickname in your watch list logs on or off."); SND ("Use /watch -nick to remove a nickname from the watch list, and"); SND("just /watch to view your watch list."); SND ("The watch list DOES NOT REMAIN BETWEEN SESSIONS - you (or your"); SND ("script or client) must add the nicknames to your watch list every"); SND ("time you connect to an IRC server. /Watch was made in DreamForge IRCd"); SND("which UnrealIRCd in ground is based off"); } else if (!myncmp(help, "HELPOP", 8)) { HDR(" *** HELPOP Command ***"); SND ("HelpOp is a new system of getting IRC Server help. You type either"); SND("/HelpOp ? or /HelpOp ! "); SND ("The ï?ï in /HelpOp means query the help system and if you get no"); SND ("response you can choose '!' to send it to the Help Operators online"); SND("------------oOo--------------"); } else if (!myncmp(help, "LIST", 8)) { HDR(" *** LIST Command ***"); SND ("New extended /list command options are supported. To use these"); SND ("features, you will likely need to prefix the LIST command with"); SND("/quote to avoid your client interpreting the command."); SND(""); SND("Usage: /quote LIST options"); SND(""); SND ("If you don't include any options, the default is to send you the"); SND ("entire unfiltered list of channels. Below are the options you can"); SND ("use, and what channels LIST will return when you use them."); SND(">number List channels with more than people."); SND(" people."); SND ("C>number List channels created between now and minutes ago."); SND ("C minutes ago."); SND ("T>number List channels whose topics are older than minutes"); SND (" (Ie., they have not changed in the last minutes."); SND ("T minutes."); SND("*mask* List channels that match *mask*"); SND("!*mask* List channels that do not match *mask*"); SND ("LIST defaults to sending a list of channels with 2 or more members,"); SND("so use the >0 option to get the full channel listing."); } else if (!myncmp(help, "PRIVMSG", 8)) { HDR("*** PRIVMSG Command ***"); SND ("PRIVMSG and NOTICE, which are used internally by the client for"); SND ("/msg and /notice, in UnrealIRCd support two additional formats:"); SND ("/msg @#channel will send the text to channel-ops on the"); SND ("given channel only. /msg @+#channel will send the text"); SND ("to both ops and voiced users on the channel. While some clients"); SND ("may support these as-is, on others (such as ircII), it's necessary"); SND ("to use/quote privmsg @#channel instead. It's perhaps a"); SND ("good idea to add the/alias omsg /quote privmsg @$0 $1 into"); SND("your script (.ircrc) file in that case."); } else if (!myncmp(help, "KNOCK", 8)) { HDR("**** KNOCK Command ****"); SND("/Knock is a new UnrealIRCd command which enables you to"); SND ("'knock' on a channel if it is +i and these criteria is met"); SND("- Channel is not +K (No knocks)"); SND("- Channel is not +I (No invites!)"); SND("- You're not banned!"); SND("- And you are not already there:)"); SND("Syntax:"); SND(" /Knock #Channel :Reason"); } else if (!myncmp(help, "LICENSE", 8)) { HDR("*** LICENSE Command ***"); SND("This command shows the GNU License"); SND("Which is hard-coded into the IRCd"); SND("Syntax: /License [optional server]"); } else if (!myncmp(help, "SETNAME", 8)) { HDR("*** SetName Command ***"); SND("/SetName is a new feature in UnrealIRCd"); SND("Which allows users to change their 'Real name'"); SND(" (GECOS) directly online at IRC without reconnecting"); SND("Syntax:"); SND(" /SetName :New Real Name"); } else if (!myncmp(help, "MODE", 8)) { HDR("*** MODE Command ***"); SND("This is basically the /mode command as it has always"); SND("been on IRC. Thou in Channel mode basis it has got an"); SND("Extra feature (/mode #Channel ^ ) which reports channel"); SND ("modes represented in a bitstring (may be handy, maybe not)"); SND ("UnrealIRCd has got some new channel / usermodes I think you"); SND("wish to take a look at"); SND("Channel Modes Help: /HelpOp CHMODES"); SND("User modes help: /HelpOp UMODES"); } else if (!myncmp(help, "STATSERV", 8)) { HDR("*** STATSERV Command ***"); SND("This is a alias for the /msg StatServ command,"); SND ("But is more secure. If the IRC network doesn't have StatServ"); SND("It will report it is down."); SND("Syntax:"); SND("/StatServ "); } else if (!myncmp(help, "CREDITS", 8)) { HDR("*** /Credits Help ***"); SND("This command will list the credits I've created"); SND("to thank the people who has helped me with making"); SND("UnrealIRCd. Anyone who I've forgotten all my kind"); SND("thoughts go to -- Techie'99"); SND("Syntax:"); SND(" /Credits [optional server]"); } else if (!myncmp(help, "DALINFO", 8)) { HDR("*** /DALINFO Help ***"); SND("This command will list the credits that the"); SND("Dreamforge IRCd team/the IRCd developers"); SND("from the start when IRCd got developed"); SND("Syntax:"); SND(" /DALInfo [optional server]"); } else if (!myncmp(help, "OPERCMDS", 8)) { HDR("*** IRCop Commands Help ***"); SND("This section is the IRCOp's only commands"); SND("area:) - These topics are available:"); SND("Note: This doesnt include Dreamforge commands"); SND("-------------oOo---------------"); SND("SETHOST SETIDENT SDESC"); SND("ADCHAT NACHAT TECHAT"); SND("GLINE REMGLINE STATS"); SND("MKPASSWD SAJOIN SAPART"); SND("ADDLINE LAG RPING"); SND("ADDMOTD ADDOMOTD OPERMOTD"); SND("CHGHOST TSCTL SDESC"); SND("SETHOST SETIDENT REHASH"); SND("HTM"); SND("-------------oOo---------------"); } else if (!myncmp(help, "ADDMOTD", 8)) { HDR("*** ADDMOTD Command Help ***"); SND("This will add the text you specify to the MOTD"); SND("(the general motd - T:lines doesnt count ..)"); SND("Server Admin & Co-Admin only"); SND("-"); SND("Syntax: /ADDMOTD :text"); } else if (!myncmp(help, "HTM", 8)) { HDR("*** HTM Command Help ***"); SND("HTM stands for High Traffic Mode, it is activated"); SND ("When the server is receiving extremely high ammounts of information"); SND("-"); SND("Syntax: /HTM [option]"); SND("-"); SND ("If no option is specified it just displays the current HTM state"); SND ("If an option is specified it does a more specific task, valid options are:"); SND("ON - Force HTM to activate"); SND("OFF - Force HTM to deactivate"); SND ("NOISY - Make HTM announce when it is entering/leaving HTM"); SND ("QUIET - Stop HTM from announcing when it is entering/leaving HTM"); SND ("TO - Tell HTM at what incoming rate to activate HTM"); } else if (!myncmp(help, "REHASH", 8)) { HDR("*** REHASH Command Help ***"); SND ("Rehash is used to reload many different files in the IRCd"); SND ("This is mainly used to rehash the ircd.conf but can be used"); SND("For much more"); SND("-"); SND("Syntax: /REHASH [servername] [-flags]"); SND("or /REHASH [-flags]"); SND("-"); SND ("If servername and flags are not specified this rehashes the ircd.conf"); SND ("If servername is specified, this is used to rehash config files on servername"); SND("Only TechAdmins and NetAdmins may specify a server name"); SND ("The flags are used to rehash other config files, valid flags are:"); SND("-dccdeny - rehashes dccdeny.conf"); SND("-dynconf - rehashes unrealircd.conf and network file"); SND("-restrict - rehashes chrestrict.conf"); SND("-vhost - rehashes vhost.conf"); SND ("-motd - rehashes all MOTD files and RULES files (including T:lines)"); SND("-opermotd - rehashes the OPREMOTD"); SND("-botmotd - rehashes the BOTMOTD"); } else if (!myncmp(help, "ADDOMOTD", 8)) { HDR("*** ADDOMOTD Command Help ***"); SND("This will add the text you specify to the Operator MOTD"); SND("Server Admin & Co-Admin only"); SND("-"); SND("Syntax: /ADDOMOTD :text"); } else if (!myncmp(help, "CHGHOST", 8)) { HDR("*** CHGHOST Command help ***"); SND ("This command makes you able to change other people's virtual hostname"); SND("- IRCop only."); SND("Syntax: /CHGHOST "); } else if (!myncmp(help, "OPERMOTD", 8)) { HDR("*** OPERMOTD Command Help ***"); HDR ("This is a IRCop only command - shows the IRCd Operator MOTD"); HDR("Syntax: /OperMotd"); } else if (!myncmp(help, "SETHOST", 8)) { HDR("*** SETHOST Command Help ***"); SND("This command is so you can change your"); SND("Virtual host (hiddenhost) to everything you want to"); SND("Except special characters;). Syntax:"); SND("/SetHost )"); SND("Example:"); SND(" /Sethost ircaddicts.org"); } else if (!myncmp(help, "SETIDENT", 8)) { HDR("*** SETIDENT Command Help ***"); SND("With this command you can change your"); SND("ident (username)."); SND("Syntax:"); SND("/SetIdent "); SND("Example:"); SND(" /SetIdent root"); } else if (!myncmp(help, "SDESC", 8)) { HDR("*** SDesc Command help ***"); SND("NOTE: This is a Server Admin/Co Admin only command"); SND("With this command you can change your Server Info Line"); SND("Without having to squit and reconnect."); SND("Syntax: /SDesc :New description"); SND("Example: /SDesc :If you belong to me.."); } else if (!myncmp(help, "ADCHAT", 8)) { HDR("*** AdChat Command Help ***"); SND("This command sends to all Admins online (IsAdmin)"); SND("Only for Admins. This is a ChatOps style command"); SND("Syntax: /AdChat "); SND("Example: /AdChat Hey guys!"); } else if (!myncmp(help, "NACHAT", 8)) { HDR("*** NAChat Command Help ***"); SND("This command sends to all NetAdmins & TechAdmins online"); SND("Only for Net/Techadmins. This is a ChatOps style command"); SND("Syntax: /NAChat "); SND("Example: /NAChat Hey guys!"); } else if (!myncmp(help, "STATS", 8)) { HDR("*** Stats Command Help ***"); SND("UnrealIRCd has got a extension called /Stats G"); SND("Which will list the current G:Lines"); SND("Syntax: /Stats G"); } else if (!myncmp(help, "TECHAT", 8)) { HDR("*** TEChat Command Help ***"); SND("This command sends to all TechAdmins online"); SND("Only for Net/Techadmins. This is a ChatOps style command"); SND("Syntax: /TEChat "); SND("Example: /TEChat Hey guys!"); } else if (!myncmp(help, "REMGLINE", 8)) { HDR("*** RemGline Command Help"); SND("This command can remove G:Lines"); SND("Syntax:"); SND(" /RemGline "); SND("Example:"); SND(" /RemGline *@*.flirt.org"); } else if (!myncmp(help, "GLINE", 8)) { HDR("*** G:line command Help ***"); SND("This command provides timed G:Lines. If you match"); SND("a G:Line you cannot connect to ANY server at the"); SND("IRC network"); SND("Syntax:"); SND (" /GLINE :"); SND("Example:"); SND(" /GLINE *@*.dal.net 900 :Spammers"); SND (" this will ban all users matching *@*.dal.net for 15 minutes"); SND(" with reason 'Spammers'"); } else if (!myncmp(help, "MKPASSWD", 8)) { HDR("*** MkPasswd Command help ***"); SND("This command will encrypt the string it has been given"); SND("So u can add it directly to the ircd.conf if you use"); SND ("Encrypted passwords. /MKPassWd is disabled in UnrealIRCd/32"); SND("Syntax : /MkPasswd :string to be encrypted"); } else if (!myncmp(help, "ADDLINE", 8)) { HDR("*** ADDLINE Command Help ***"); SND ("This command can be used to add lines to the ircd.conf file"); SND("Only for Server Admins"); SND("Syntax: /AddLine :"); } else if (!myncmp(help, "LAG", 8)) { HDR("*** LAG Command Help ***"); SND("This command is like a sonar/traceroute for IRC servers"); SND("You type in /lag server1.irc.net and it will"); SND("reply from every server it passes with time and so on"); SND ("Useful for looking where lag is and optional TS future/past travels"); SND("Syntax: /LAG "); } else if (!myncmp(help, "RPING", 8)) { HDR("*** RPING Command Help ***"); SND ("This will calculate the milliseconds (lag) between servers"); SND("Syntax: /RPING "); } else if (!myncmp(help, "TSCTL", 8)) { HDR("*** TSCTL Command Help ***"); SND ("This is a highly advanced command used to sync server's clocks"); SND("Syntax:"); SND(" /TSCTL OFFSET +|-