1
0
mirror of https://github.com/anope/anope.git synced 2026-06-16 15:14:47 +02:00

Compare commits

..

146 Commits

Author SHA1 Message Date
sjaz 29bd5a7daa Bump files to 1.8.3 for release
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2771 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-19 07:58:13 +00:00
sjaz 975b0cd374 Update docs/INSTALL with some more upto date information
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2770 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-19 07:52:44 +00:00
Adam- a0ebea2049 Updated docs/IRCD to be up to date
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2769 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-18 22:14:41 +00:00
sjaz cc8e88aec8 Another attempt at making the makefile understand
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2768 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-17 20:15:48 +00:00
sjaz 11d47efc7a Fix small omission in src/tools/Makefile and update version.log
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2767 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-17 15:09:43 +00:00
sjaz c7154edb4d Small documentation update.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2766 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-17 15:03:02 +00:00
Adam- 5559f91fae Fixed bug #1135 - Don't allow BotServ to kick and ban ULined clients
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2761 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-15 19:29:39 +00:00
pimpmylinux 3dd71f207d updated copyright info for 2010
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2752 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-11 19:22:52 +00:00
pimpmylinux 7776fb8548 Some language fixes closing issue #1124 and #1122, fixed wrong language string invoked in bot add closing issue #1118
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2750 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-11 18:51:50 +00:00
Adam- 7954542a86 Fixed a reply in bs_bot to be correct when you use an invalid ident, reported by Phil
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2747 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-11 14:25:56 +00:00
Adam- a1c45be517 Fix a crash introduced in r2679 cause by is_on_access messing up the users host buffers
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2743 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-09 20:49:21 +00:00
Adam- bab5a37970 Added two missing language strings to de.l and ru.l
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2735 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-06 19:56:17 +00:00
Adam- da1162f770 Made elist_match_user also check against the users cloaked host
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2734 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-06 19:56:06 +00:00
Adam- abc8b4aa4e Mark users as unrecognized on Inspircd 1.2 if no/invalid metadata is recieved for them before the next uid/eob
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2731 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-03 23:53:28 +00:00
jantje_85 60c7b5b10f Fixed typo in inspircd12.h causing 2 modes to use the same bit.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2730 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-03 14:19:11 +00:00
Adam- a939b821a7 Fixed a few SASET help replies to reply to services opers, and fixed the rest to not reply to anyone who requests help
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2727 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-02 20:10:17 +00:00
Adam- 14150647bc Fixed help system to use notice_help instead of notice_lang (bug from r2473)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2726 5417fbe8-f217-4b02-8779-1006273d7864
2010-01-02 18:48:30 +00:00
Adam- 1b265bf291 Using SQL with RDB will now automatically fix databases affected by the bug fixed in r2386
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2712 5417fbe8-f217-4b02-8779-1006273d7864
2009-12-20 19:05:56 +00:00
Adam- ac279a1637 Documented the SQL table change in Changes.mysql from r2386
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2707 5417fbe8-f217-4b02-8779-1006273d7864
2009-12-16 20:50:44 +00:00
jantje_85 6ed06539be Reverted & updated Changes.. ;)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2680 5417fbe8-f217-4b02-8779-1006273d7864
2009-12-01 00:16:48 +00:00
Adam- b5242e3be0 Fixed bug #1106 - Anope now keeps track of users cloaked hosts as well as virtual host and will use both in matching for things
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2679 5417fbe8-f217-4b02-8779-1006273d7864
2009-12-01 00:06:21 +00:00
jantje_85 84ac00e953 Fix bug #1114. Fixed a bug in cs_clear caused by do_cmode() modifying params passed to it.
Also fixed some warnings in cs_xop.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2671 5417fbe8-f217-4b02-8779-1006273d7864
2009-11-25 22:57:00 +00:00
Adam- 822e75b501 Fix a few more XOP related problems
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2668 5417fbe8-f217-4b02-8779-1006273d7864
2009-11-25 20:57:22 +00:00
Adam- e2c6825cd2 Cleaned up a lot of the channel access reordering code, properly change users with less than voice access on channels to XOP, and fix a potential crashbug after switching to XOP on IRCds that do not support halfop
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2667 5417fbe8-f217-4b02-8779-1006273d7864
2009-11-25 04:52:49 +00:00
jantje_85 fdcc5b5ee1 Added missing entry to version.log.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2606 5417fbe8-f217-4b02-8779-1006273d7864
2009-11-03 14:19:38 +00:00
jantje_85 4f438917f1 All usermodes are now recognized and properly set internally on Insp 1.2.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2601 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-30 20:45:16 +00:00
jantje_85 250aecb683 More dynamic detection of channel modes on InspIRCd 1.2.
Also fixes params being linked to the wrong mode.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2598 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-30 02:03:57 +00:00
jantje_85 4ca2b60f91 Fixed small typo in dutch translation.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2571 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-18 18:42:21 +00:00
sjaz e305db41ce Removed proxy server from ulined servers in example config as more people use a client proxy scanner and this should reduce occurences of user servers being listed.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2550 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-11 12:40:42 +00:00
Adam- 6ad63349c1 Reset errno before calling strtol in bs_kick, it would sometimes not allow valid kick settings to work
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2546 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-10 16:21:29 +00:00
Adam- d0646a37dc Now send the QUIT command before changing bots internally for /botserv bot change, so InspIRCd 1.2 (and possibly others) can get the UID and other info from the bot
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2545 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-09 22:34:17 +00:00
Adam- b80e0cb996 Fixed the NICK command syntax on InspIRCd 1.2 to work when changing clients nicknames
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2544 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-09 22:33:39 +00:00
Adam- 5b65c9ce87 Fixed crash when juping servers on InspIRCd 1.2
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2543 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-09 22:33:23 +00:00
Adam- f07f92e30d Fixed remote whoises on services clients on InspIRCd 1.2
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2542 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-09 22:33:00 +00:00
Adam- 594c161622 Added InspIRCd 1.2 protocol module into Windows makefiles and installer scripts
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2537 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-06 21:54:33 +00:00
jantje_85 0570b57a99 This is it! Added InspIRCd 1.2 protocol module.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2536 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-06 13:21:05 +00:00
jantje_85 727bcf1fde Added option for delayed pseudo-client introduction. (Required for Insp 1.2)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2535 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-06 13:08:37 +00:00
jantje_85 699bee06c3 Added ability to mark users as either ID'd or UNID'd after user introduction. This is the responsibility of the protocol module!(Required for Insp 1.2)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2534 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-06 12:52:14 +00:00
Adam- ab337e8de0 Backport of r2531, reset +r on registered channels after a netmerge when our creation time is newer than what we recieved
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2533 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-05 21:26:29 +00:00
sjaz 381f74a26e Test Commit Please Ignore! :)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2530 5417fbe8-f217-4b02-8779-1006273d7864
2009-10-04 16:33:04 +00:00
jantje_85 471043c5c4 git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2525 5417fbe8-f217-4b02-8779-1006273d7864 2009-10-03 00:32:52 +00:00
adam- 29c8702c35 Updated french language file, patch from Saka
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2511 5417fbe8-f217-4b02-8779-1006273d7864
2009-09-22 00:38:26 +00:00
jantje_85 0b82d74262 Fixed a number of TS6 issues, mainly related to nicks instead of IDs being given to anope_cmd_mode() in combination with a status change (Bug #1096). Also Fixed a small bug in os_oline.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2495 5417fbe8-f217-4b02-8779-1006273d7864
2009-09-09 22:23:09 +00:00
Adam- 5cb5dc197a Fixed typo in install.js so it will correctly detect MySQL 5.1 on Windows
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2491 5417fbe8-f217-4b02-8779-1006273d7864
2009-09-01 22:28:54 +00:00
jantje_85 664ca1bbf2 Fixed MLOCK locked mode removal getting priority over DEFCON locked
mode setting.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2485 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-30 17:37:35 +00:00
jantje_85 efa7c81ca8 Fixed defcon not setting modes on newly created unregged channels and
failing to force remove defcon-locked modes.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2480 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-28 23:54:25 +00:00
adam- 2874513e0a Updated German language file, patch from Han`
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2479 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-28 23:42:16 +00:00
adam- 51d9b5056d Fixed bug #1104 - Corrected help replies for /operserv HELP *NEWS to say services admin is always required
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2477 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-28 21:49:18 +00:00
sjaz 3c219be3c7 Updated version.log and bumped build version because I forgot in previous commit.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2476 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-28 19:35:22 +00:00
sjaz cc8f2117f8 Clarify installing of PSDK in windows installation requirements.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2475 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-28 19:32:13 +00:00
sjaz 230f9e9a35 Updated docs/README to include real help for incorporating new languages into builds.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2474 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-28 07:05:33 +00:00
adam- d468567a12 Made help system fall back to the highest help string available instead of giving "no help" to services opers etc everywhere.
Fixes bug #1102 and any other bugs related to it.


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2473 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-26 22:35:43 +00:00
adam- d3d36ff73c Fixed bug #1103 - show services opers /nickserv help saset
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2472 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-26 22:04:47 +00:00
adam- 4897cdf60f Fixed bug #1099 and #1100 - Show services opers /chanserv help (un)suspend and /nickserv help (un)suspend
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2471 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-25 21:29:34 +00:00
pimpmylinux ef8db98e5c fixed typo. i apologize for being an idiot, i promise i will test even oneliners next time...
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2468 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-24 19:41:29 +00:00
pimpmylinux d9e57f5651 trying to delete sessions when a ulined server quits
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2467 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-24 19:29:06 +00:00
adam- e50c6a5efb Fixed entry_match to work properly when matching hostnames and given a NULL username (although this should never happen in the core)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2464 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-23 22:06:22 +00:00
adam- a331432030 Fixed bug #1094
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2456 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-19 21:30:34 +00:00
adam- ac338268c9 Updated Turkish language file
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2448 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-11 23:42:05 +00:00
DukePyrolator 1354bf8815 another small update for the german langfile
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2438 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-08 09:28:55 +00:00
sjaz ed1469d3b1 Updated German Translation from Han. (han@mefalcon.org)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2437 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-08 09:07:32 +00:00
sjaz 6b8277f152 Updated FAQ and pointing to wiki for updates. (yay wiki)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2434 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-06 19:02:15 +00:00
sjaz 2d69fea6d2 Fixed wording in short description of CHANKILL from OS HELP except in ru.l because it's scary. (Thanks Taros!)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2430 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-06 17:53:31 +00:00
sjaz af916f28f4 dos2unix'd several files.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2428 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-06 17:25:38 +00:00
jantje_85 7c2db57965 Fixed possible segfault introduced by TS6 fix in rev. 2401.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2406 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-04 18:14:50 +00:00
jantje_85 b13836f3cf Fixed do_server() so it doesn't go nuts if a SID is the source. Added some sanity checks and debug output as well.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2402 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-03 17:25:32 +00:00
jantje_85 2bd483c273 Added forgotten entries to version.log and Changes, some cleanup, and fixed a few minor TS6 issues.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2401 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-01 17:11:58 +00:00
adam- 217a375517 Fixed some memory leaks when setting vhosts on users
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2400 5417fbe8-f217-4b02-8779-1006273d7864
2009-08-01 08:16:56 +00:00
jantje_85 97a42e4f7d Fixed a TS6 bug in chan_set_modes() causing restrictions such as secureops to fail if the IRCd sends UUIDs instead of nicks.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2398 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-31 17:55:24 +00:00
jantje_85 113237964d Fixed a bug in UMODE causing anope to send an extra umode change as a channel mode change.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2397 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-31 17:17:19 +00:00
DukePyrolator a3afe44ca6 Added german language support to hs_request.c. Patch provided by Han.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2395 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-28 16:47:40 +00:00
DukePyrolator b60b06ad76 Updated german language file. Update provided by Han.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2394 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-28 16:20:41 +00:00
adam- 902158671a Fixed a problem with saving and loading nickcore access lists when using
MySQL and RDB


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2386 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-20 01:53:54 +00:00
adam- 1873d67093 Fix some syntax error replies to use syntax_error
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2378 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-13 02:50:05 +00:00
adam- 2629a580a1 Fixed elist_match_user to check against vhosts, patch from sergio
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2376 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-12 19:52:32 +00:00
adam- cfc81d5aca Updated Polish language file, thanks to Szymek
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2374 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-11 18:53:34 +00:00
sjaz 72ae5cacd4 Updated NSIS Windows Installer Scripts post 1.8.2 Release
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2372 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-11 13:12:56 +00:00
sjaz f2598bdb6e Initialise 1.8.2-SVN and update README.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2371 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-11 12:52:18 +00:00
adam- 101fe6882d Added ChanServ HELP CLEAR INVITES to documentation
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2365 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-10 05:32:13 +00:00
adam- a30afed7b2 Fix a crash when mysql is used without MysqlSecure defined. Thanks to
jerrcs for finding and testing


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2364 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-07 21:02:38 +00:00
adam- feedbd6b0d Fix unsetting founder_chans when logging out other users
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2362 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-06 16:03:48 +00:00
DukePyrolator 05bc74d9cb updated german language file. thanks to Han`
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2360 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-05 15:13:55 +00:00
sjaz e0cc7a6c0b Initialise 1.8.1 SVN
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2359 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-04 13:41:09 +00:00
sjaz 2fdcb30beb Anope 1.8.1 Release
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2357 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-04 12:28:19 +00:00
sjaz feff8c1fb1 Small amendment to version.log to complete a few missing entries.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2356 5417fbe8-f217-4b02-8779-1006273d7864
2009-07-04 12:26:52 +00:00
jantje_85 ea05ff108a Fixed several bugs in messages.c regarding parsing TS6 encoded commands. This is a prerequisite for an InspIRCd 1.2 protocol module.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2337 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-26 19:18:30 +00:00
sjaz bcae4f00e1 Update to allow windows build to function with the removal of inspircd10.c
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2329 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-20 19:54:44 +00:00
cyberbotx 01f65c7e64 Fix memory leak in NS SUSPEND, patch by Adam.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2327 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-15 20:28:57 +00:00
jantje_85 958521b8c6 Added a few missing entries to Changes.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2325 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-15 10:55:05 +00:00
cyberbotx 06d5233502 Bugfix for bug #1082, remove check for NSModeOnID from NS UPDATE, it's not logical to check for NSModeOnID since you must be identified to use NS UPDATE anyways.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2322 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-12 03:11:18 +00:00
cyberbotx a4b40f6f67 Fix potential crash in Charybdis protocol module, patch by Adam.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2321 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-11 21:41:08 +00:00
cyberbotx 1d4f61e089 Change default of UnRestrictSAdmin to be enabled, so hopefully we get less users complaining about their +a being removed and being unable to use /sa* commands.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2316 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-10 05:38:11 +00:00
sjaz 8ff16f17cc Fix to fix the broken langfiles in my last commit. Langfiles 1 - Me 0 (Spaces != Tab)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2308 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-02 21:29:46 +00:00
sjaz 2bb115f6e4 [#1081] - Fixing CS HELP output to not imply you can invite anyone bar yourself into a channel.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2307 5417fbe8-f217-4b02-8779-1006273d7864
2009-06-02 21:20:26 +00:00
cyberbotx e46b0f0ccd Change sizeof() to strlen() in db_mysql_secure(), patch by DukePyrolator.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2301 5417fbe8-f217-4b02-8779-1006273d7864
2009-05-17 05:57:08 +00:00
cyberbotx 572d1a94bd Fix bug #1078, MySQL query should no longer fail when password and salt are too long, patch from Adam.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2299 5417fbe8-f217-4b02-8779-1006273d7864
2009-05-10 23:01:07 +00:00
sjaz 9210aae6f9 Patch to allow jupe on all bar uplink and self. Thanks Adam. (Bug #1076)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2297 5417fbe8-f217-4b02-8779-1006273d7864
2009-05-08 15:10:05 +00:00
sjaz d4b6968108 Fix link to Link Block Generator on our site. Good find whoever it was :)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2294 5417fbe8-f217-4b02-8779-1006273d7864
2009-05-07 17:33:53 +00:00
sjaz 672acf306f Patch from DukeP - founderstatus (gained by /cs identify) is not removed on logout, and on remote logout the nicktracking and the timers are removed from the wrong user
(u instead of u2). Cheers! :)


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2293 5417fbe8-f217-4b02-8779-1006273d7864
2009-05-06 07:52:57 +00:00
sjaz a408ceee74 Backport from 1.9 to document the use of /ms set notify mail and nomail (Adam)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2289 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-26 16:37:38 +00:00
sjaz 55a564a0b4 Patch to rectify Syntax output from langfiles and update certain modules to use syntax_error rather than notice_lang. (Adam)
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2287 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-22 18:10:38 +00:00
jantje_85 027567b4b0 Don't enfoce akick/forbidden/etc.. settings on clients on ulined servers.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2284 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-17 22:39:18 +00:00
cyberbotx 25e81f6ea9 Backport of r2271, remove files from the modules runtime directory on startup, just in case files were left behind during a previous run.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2272 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-11 06:57:52 +00:00
sjaz ea090fae8d [#1039] Patch to update documentation on CS RESTRICTED to reflect historical behaviour.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2262 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-06 16:30:34 +00:00
jantje_85 74c5d989bc Backport of bugfix for bug #1004 from SVN r2003, Modechanges from ulined server are no longer being blocked by SECUREOPS.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2253 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-03 19:45:24 +00:00
jantje_85 1dec3ee8fb Fixed non-standard C-style comment.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2251 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-03 18:25:20 +00:00
jantje_85 446a6f6ea5 Updated example.conf regarding removal of the inspirc10 protocol module and SRA requirement for SuperAdmin.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2250 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-03 18:13:37 +00:00
jantje_85 9d89891a90 Someone seems to have forgotten about Changes.. added most significant commits to Changes.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2249 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-03 18:07:13 +00:00
cyberbotx 1cbfdac929 Backport of bugfix for bug #1050 from SVN r2163, patch from Adam, MS STAFF's syntax shows correctly, required adding a language string as well, currently they are all English until they can be properly translated.
Also update version.log with previous 4 revisions as well.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2245 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-03 02:57:40 +00:00
cyberbotx 49d1d9e79b Fix compile error with inspircd11 module.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2240 5417fbe8-f217-4b02-8779-1006273d7864
2009-04-02 22:51:21 +00:00
rburchell eb4510946f Modified patch to change vhost removal to work correctly in all cases, originally by Szymek.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2221 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-30 09:47:20 +00:00
rburchell 104b52b06e Correctly initialise variables in jointhrottle check, noted by Szymek.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2220 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-30 09:46:36 +00:00
rburchell 697f535f8b Remove insp1.0 protocol modules. 1.0 has been unsupported by upstream for a very long time, and they contain a number of bugs since fixed in the 1.1 module.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2219 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-30 09:46:08 +00:00
cyberbotx 35ca9adc25 Backport of bugfix for bug #1073 from SVN r2217, fantasy commands in CTCP ACTIONs will now be ignored instead of processed.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2218 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-30 06:17:26 +00:00
cyberbotx 8f3958d0f4 Correct backport of bug #1065, patch from DukePyrolator, there is no nc on the User struct in 1.8.x, use nickTrack instead, oops.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2199 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-23 17:05:52 +00:00
cyberbotx 57fb28e70a Backport of bugfix for bug #1044 from SVN r2195, CS SET MLOCK no longer requires a parameter, and leaving out the parameter renders the mlock to +r as it should be.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2196 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-23 04:57:15 +00:00
cyberbotx 1ba8e796c7 Backport of bugfix for buf #1065 from SVN r2192, original patch from DukePyrolator, force a user off a nick when it is suspended.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2193 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-23 02:54:46 +00:00
cyberbotx 645c224ff7 Backport of bugfix for bug #1064 from SVN r2188, original patch from DukePyrolator, fixes NS RECOVER so it doesn't display "(null)" in some places.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2189 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-23 00:46:53 +00:00
cyberbotx 66a9b8605f Backport of bugfix for bug #1062 from SVN r2185 and 2186, patch from Adam, BS ASSIGN, BS ACT, and BS SAY should no longer send error messags to users without access.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2187 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-23 00:35:45 +00:00
sjaz 9ee3f37bee Updated version.log with changes since 1.8.0 Release.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2183 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-22 09:50:41 +00:00
sjaz 9d7edd3055 Fix memleak in channels.c from DukePyrolator. (Same fix applied to 1.9 earlier). Thanks DP!
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2182 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-22 09:40:57 +00:00
cyberbotx 2af1c0a5e9 Backport of bugfix for bug #1043 from SVN r2178, patch from Adam, CS LIST will no longer show suspended channels to normal users.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2181 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-22 01:31:43 +00:00
cyberbotx 08c8a883ef Backport of bugfix for bug #1030 from SVN r2179, patch from Adam, deleting from the channel access list now logs a message about the deleted items.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2180 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-22 01:31:20 +00:00
sjaz 7cc23d874f #1054 Backported fix from 1.9 to hide password in log/logchan whilst user is ignored.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2175 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-18 21:21:00 +00:00
sjaz 324b4ee85e Patch from DukePyrolator to log an entry for when NSMemoReceipt isn't defined in the config.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2166 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-15 18:25:42 +00:00
cyberbotx 3ba4d4e97d Backport of bugfix for bug #1025 from SVN r2148, the message for "no such entry" should show whatever was passed in to the command, not -1 every time.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2152 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-09 23:29:35 +00:00
cyberbotx 9bb905229d Backport of bugfix for bug #1020 from SVN r2150, read and write the mlock for flood and redirect regardless of the IRCd's setting for the mode.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2151 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-09 23:23:27 +00:00
robbeh f98a3a85d6 Applied adams patch for re-ordering lists
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2145 5417fbe8-f217-4b02-8779-1006273d7864
2009-03-07 17:45:11 +00:00
cyberbotx ef83568646 Backport of fix from r2131, inspircd11 module should send the current timestamp, not the timestamp that the akill was set at.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2132 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-23 03:20:20 +00:00
cyberbotx 64fee38976 Backport fix in sgets which lacked FD_ZERO() call before FD_SET().
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2127 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-23 01:47:26 +00:00
rburchell 4768beb328 Fix compile caused by careless backport, thanks DP.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2110 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-18 23:22:42 +00:00
rburchell 60c88393a0 Backport: Correctly lower TS (if the ircd provided it) on reciept of JOIN messages. This fixes dropped mode changes coming from services on TS6 (and TS6-alike) ircds for channels where TS is dropped elsewhere on the network.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2024 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-12 22:15:58 +00:00
rburchell 07892e8b4b Backport from 1.9.1 - inspircd11: Pass chants in JOIN message to not blow away timestamps.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2023 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-12 21:54:33 +00:00
rburchell 6c801d5780 Patch by Adam fixing #1006 (originally caused by #922): modes set by ChanServ are reversed. Thanks!
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1946 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-07 22:32:02 +00:00
robbeh 0b76c8b5e6 Applied patch by mooncup to re-apply the cloaked host when using /hs off for unreal32
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1943 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-04 17:27:59 +00:00
jantje_85 942b1a8800 Giving credits for +j support..
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1941 5417fbe8-f217-4b02-8779-1006273d7864
2009-02-01 02:00:28 +00:00
jantje_85 308d7937ef Bug 1001: Added support for internal tracking of +j channel mode (throttling).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1940 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-29 02:02:44 +00:00
rburchell 9c2591c20a Manual backport of r1935 / 183bf6525b84: check noexpire/readonly in expire_all(), otherwise stuff will get expired on shutdown.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1937 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-26 20:11:11 +00:00
rburchell 6c51b17ef1 Don't allow an empty ident when reading HS vident. Rob, this needs review before I want to push it to SVN.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1936 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-26 20:10:44 +00:00
cyberbotx 5a191ce5a6 Backport of fix for bug 1000, do not allow a nick to be grouped if the IRCd protocol deems the nick invalid.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1926 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-22 11:49:08 +00:00
cyberbotx a68730adb1 Fixed check for backtrace() in configure.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1924 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-18 21:05:42 +00:00
jantje_85 9d24e8f35c Initialized 1.8 SVN.
Fixed MySQL dumping failing on unsafe queries. [Bug #994]

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1923 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-17 14:52:23 +00:00
sjaz 4a8bc79a06 Update install.js with correct url for windows build help links.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1915 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-03 17:14:32 +00:00
sjaz b37da9de9e More housekeeping contact address updates.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1913 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-03 16:31:29 +00:00
sjaz a632cdc732 Update copyright & contact information within files.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1912 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-03 16:17:00 +00:00
sjaz c777c8d9aa Anope Stable Branch
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1902 5417fbe8-f217-4b02-8779-1006273d7864
2009-01-01 12:00:20 +00:00
400 changed files with 122742 additions and 71893 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
CURVER
This program will help you to compile your Services, and ask you
questions regarding the compile-time settings of it during the
process. For more options type SOURCE_DIR/Config --help
process. For more options type ./Config --help
Anope is a set of Services for IRC networks that allows users to
manage their nicks and channels in a secure and efficient way,
-5
View File
@@ -1,5 +0,0 @@
/autom4te.cache
Makefile
config.cache
config.log
config.status
-501
View File
@@ -1,501 +0,0 @@
###############################################################################
# strip_string(<input string> <output string>)
#
# A macro to handle stripping the leading and trailing spaces from a string,
# uses string(STRIP) if using CMake 2.6.x or better, otherwise uses
# string(REGEX REPLACE).
###############################################################################
macro(strip_string INPUT_STRING OUTPUT_STRING)
if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, we can just use the STRIP sub-command of string()
string(STRIP ${INPUT_STRING} ${OUTPUT_STRING})
else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we will have to use the REGEX REPLACE sub-command of string() instead
# First check if the input string is empty or not
if (${INPUT_STRING} STREQUAL "")
set(${OUTPUT_STRING} "")
else(${INPUT_STRING} STREQUAL "")
# Determine if the string is entirely empty or not
string(REGEX MATCH "^[ \t]*$" EMPTY_STRING "${INPUT_STRING}")
if(EMPTY_STRING)
set(${OUTPUT_STRING} "")
else(EMPTY_STRING)
# We detect if there is any leading whitespace and remove any if there is
string(SUBSTRING "${INPUT_STRING}" 0 1 FIRST_CHAR)
if(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
string(REGEX REPLACE "^[ \t]+" "" TEMP_STRING "${INPUT_STRING}")
else(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
set(TEMP_STRING "${INPUT_STRING}")
endif(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
# Next we detect if there is any trailing whitespace and remove any if there is
string(LENGTH "${TEMP_STRING}" STRING_LEN)
math(EXPR STRING_LEN "${STRING_LEN} - 1")
string(SUBSTRING "${TEMP_STRING}" ${STRING_LEN} 1 LAST_CHAR)
if(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
string(REGEX REPLACE "[ \t]+$" "" ${OUTPUT_STRING} "${TEMP_STRING}")
else(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
set(${OUTPUT_STRING} "${TEMP_STRING}")
endif(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
endif(EMPTY_STRING)
endif(${INPUT_STRING} STREQUAL "")
endif(CMAKE26_OR_BETTER)
endmacro(strip_string)
###############################################################################
# append_to_list(<list> <args>...)
#
# A macro to handle appending to lists, uses list(APPEND) if using CMake 2.4.2
# or better, otherwise uses set() instead.
###############################################################################
macro(append_to_list LIST)
if(CMAKE242_OR_BETTER)
# For CMake 2.4.2 or better, we can just use the APPEND sub-command of list()
list(APPEND ${LIST} ${ARGN})
else(CMAKE242_OR_BETTER)
# For CMake 2.4.x before 2.4.2, we have to do this manually use set() instead
set(${LIST} ${${LIST}} ${ARGN})
endif(CMAKE242_OR_BETTER)
endmacro(append_to_list)
###############################################################################
# find_in_list(<list> <value> <output variable>)
#
# A macro to handle searching within a list, will store the result in the
# given <output variable>, uses list(FIND) if using CMake 2.6.x or better
# (or CMake 2.4.8 or better), otherwise it iterates through the list to find
# the item.
###############################################################################
macro(find_in_list LIST ITEM_TO_FIND FOUND)
if(CMAKE248_OR_BETTER)
# For CMake 2.4.8 or better, we can use the FIND sub-command of list()
list(FIND ${LIST} ${ITEM_TO_FIND} ITEM_FOUND)
else(CMAKE248_OR_BETTER)
# For CMake 2.4.x before 2.4.8, we have to do this ourselves (NOTE: This is very slow due to a lack of break() as well)
# Firstly we set the position to -1 indicating nothing found, we also use a temporary position
set(ITEM_FOUND -1)
set(POS 0)
# Iterate through the list
foreach(ITEM ${${LIST}})
# If the item we are looking at is the item we are trying to find, set that we've found the item
if(${ITEM} STREQUAL ${ITEM_TO_FIND})
set(ITEM_FOUND ${POS})
endif(${ITEM} STREQUAL ${ITEM_TO_FIND})
# Increase the position value by 1
math(EXPR POS "${POS} + 1")
endforeach(ITEM)
endif(CMAKE248_OR_BETTER)
# Set the given FOUND variable to the result
set(${FOUND} ${ITEM_FOUND})
endmacro(find_in_list)
###############################################################################
# remove_list_duplicates(<list>)
#
# A macro to handle removing duplicates from a list, uses
# list(REMOVE_DUPLICATES) if using CMake 2.6.x or better, otherwise it uses
# a slower method of creating a temporary list and only adding to it when
# a duplicate item hasn't been found.
###############################################################################
macro(remove_list_duplicates LIST)
if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, this can be done automatically
list(REMOVE_DUPLICATES ${LIST})
else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we have to do this ourselves, firstly we'll clear a temporary list
set(NEW_LIST)
# Iterate through the old list
foreach(ITEM ${${LIST}})
# Check if the item is in the new list
find_in_list(NEW_LIST ${ITEM} FOUND_ITEM)
if(FOUND_ITEM EQUAL -1)
# If the item was not found, append it to the list
append_to_list(NEW_LIST ${ITEM})
endif(FOUND_ITEM EQUAL -1)
endforeach(ITEM)
# Replace the old list with the new list
set(${LIST} ${NEW_LIST})
endif(CMAKE26_OR_BETTER)
endmacro(remove_list_duplicates)
###############################################################################
# remove_item_from_list(<list> <value>)
#
# A macro to handle removing a value from a list, uses list(REMOVE_ITEM) in
# both cases, but can remove the value itself using CMake 2.4.2 or better,
# while older versions use a slower method of iterating the list to find the
# index of the value to remove.
###############################################################################
macro(remove_item_from_list LIST VALUE)
if(CMAKE242_OR_BETTER)
# For CMake 2.4.2 or better, this can be done automatically
list(REMOVE_ITEM ${LIST} ${VALUE})
else(CMAKE242_OR_BETTER)
# For CMake 2.4.x before 2.4.2, we have to do this ourselves, firstly we set the index and a variable to indicate if the item was found
set(INDEX 0)
set(FOUND FALSE)
# Iterate through the old list
foreach(ITEM ${${LIST}})
# If the item hasn't been found yet, but the current item is the same, remove it
if(NOT FOUND)
if(ITEM STREQUAL ${VALUE})
set(FOUND TRUE)
list(REMOVE_ITEM ${LIST} ${INDEX})
endif(ITEM STREQUAL ${VALUE})
endif(NOT FOUND)
# Increase the index value by 1
math(EXPR INDEX "${INDEX} + 1")
endforeach(ITEM)
endif(CMAKE242_OR_BETTER)
endmacro(remove_item_from_list)
###############################################################################
# sort_list(<list>)
#
# A macro to handle sorting a list, uses list(SORT) if using CMake 2.4.4 or
# better, otherwise it uses a slower method of creating a temporary list and
# adding elements in alphabetical order.
###############################################################################
macro(sort_list LIST)
if(CMAKE244_OR_BETTER)
# For CMake 2.4.4 or better, this can be done automatically
list(SORT ${LIST})
else(CMAKE244_OR_BETTER)
# For CMake 2.4.x before 2.4.4, we have to do this ourselves, firstly we'll create a teporary list
set(NEW_LIST)
# Iterate through the old list
foreach(ITEM ${${LIST}})
# Temporary index position for the new list, as well as temporary value to store if the item was ever found
set(INDEX 0)
set(FOUND FALSE)
# Iterate through the new list
foreach(NEW_ITEM ${NEW_LIST})
# Compare the items, only if nothing was found before
if(NOT FOUND)
if(NEW_ITEM STRGREATER "${ITEM}")
set(FOUND TRUE)
list(INSERT NEW_LIST ${INDEX} ${ITEM})
endif(NEW_ITEM STRGREATER "${ITEM}")
endif(NOT FOUND)
# Increase the index value by 1
math(EXPR INDEX "${INDEX} + 1")
endforeach(NEW_ITEM)
# If the item was never found, just append it to the end
if(NOT FOUND)
append_to_list(NEW_LIST ${ITEM})
endif(NOT FOUND)
endforeach(ITEM)
# Replace the old list with the new list
set(${LIST} ${NEW_LIST})
endif(CMAKE244_OR_BETTER)
endmacro(sort_list)
###############################################################################
# read_from_file(<filename> <regex> <output variable>)
#
# A macro to handle reading specific lines from a file, uses file(STRINGS) if
# using CMake 2.6.x or better, otherwise we read in the entire file and
# perform a string(REGEX MATCH) on each line of the file instead. This
# macro can also be used to read in all the lines of a file if REGEX is set
# to "".
###############################################################################
macro(read_from_file FILE REGEX STRINGS)
if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, we can just use the STRINGS sub-command to get the lines that match the given regular expression (if one is given, otherwise get all lines)
if(REGEX STREQUAL "")
file(STRINGS ${FILE} RESULT)
else(REGEX STREQUAL "")
file(STRINGS ${FILE} RESULT REGEX ${REGEX})
endif(REGEX STREQUAL "")
else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we need to do this manually, firstly we read the file in
execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
# Next we replace all newlines with semicolons
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
if(REGEX STREQUAL "")
# For no regular expression, just set the result to all the lines
set(RESULT ${ALL_STRINGS})
else(REGEX STREQUAL "")
# Clear the result list
set(RESULT)
# Iterate through all the lines of the file
foreach(STRING ${ALL_STRINGS})
# Check for a match against the given regular expression
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
# If we had a match, append the match to the list
if(STRING_MATCH)
append_to_list(RESULT ${STRING})
endif(STRING_MATCH)
endforeach(STRING)
endif(REGEX STREQUAL "")
endif(CMAKE26_OR_BETTER)
# Set the given STRINGS variable to the result
set(${STRINGS} ${RESULT})
endmacro(read_from_file)
###############################################################################
# extract_include_filename(<line> <output variable> [<optional output variable of quote type>])
#
# This macro will take a #include line and extract the filename.
###############################################################################
macro(extract_include_filename INCLUDE FILENAME)
# Strip the leading and trailing spaces from the include line
strip_string(${INCLUDE} INCLUDE_STRIPPED)
# Make sure to only do the following if there is a string
if(INCLUDE_STRIPPED STREQUAL "")
set(FILE "")
else(INCLUDE_STRIPPED STREQUAL "")
# Extract the filename including the quotes or angle brackets
string(REGEX REPLACE "^.*([\"<].*[\">]).*$" "\\1" FILE "${INCLUDE_STRIPPED}")
# If an optional 3rd argument is given, we'll store if the quote style was quoted or angle bracketed
if(${ARGC} GREATER 2)
string(SUBSTRING ${FILE} 0 1 QUOTE)
if(QUOTE STREQUAL "<")
set(${ARGV2} "angle brackets")
else(QUOTE STREQUAL "<")
set(${ARGV2} "quotes")
endif(QUOTE STREQUAL "<")
endif(${ARGC} GREATER 2)
# Now remove the quotes or angle brackets
string(REGEX REPLACE "^[\"<](.*)[\">]$" "\\1" FILE "${FILE}")
endif(INCLUDE_STRIPPED STREQUAL "")
# Set the filename to the the given variable
set(${FILENAME} "${FILE}")
endmacro(extract_include_filename)
###############################################################################
# find_includes(<source filename> <output variable>)
#
# This macro will search through a file for #include lines, regardless of
# whitespace, but only returns the lines that are valid for the current
# platform CMake is running on.
###############################################################################
macro(find_includes SRC INCLUDES)
# Read all lines from the file that start with #, regardless of whitespace before the #
read_from_file(${SRC} "^[ \t]*#.*$" LINES)
# Set that any #include lines found are valid, and create temporary variables for the last found #ifdef/#ifndef
set(VALID_LINE TRUE)
set(LAST_DEF)
set(LAST_CHECK)
# Create an empty include list
set(INCLUDES_LIST)
# Iterate through all the # lines
foreach(LINE ${LINES})
# Search for #ifdef, #ifndef, #else, #endif, and #include
string(REGEX MATCH "^[ \t]*#[ \t]*ifdef[ \t]*.*$" FOUND_IFDEF ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*ifndef[ \t]*.*$" FOUND_IFNDEF ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*else.*$" FOUND_ELSE ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*endif.*$" FOUND_ENDIF ${LINE})
string(REGEX MATCH "^[ \t]*#[ \t]*include[ \t]*[\"<].*[\">][\ t]*.*$" FOUND_INCLUDE ${LINE})
# If we found a #ifdef on the line, extract the data after the #ifdef and set if the lines after it are valid based on the variables in CMake
if(FOUND_IFDEF)
# Extract the define
string(REGEX REPLACE "^[ \t]*#[ \t]*ifdef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
if(DEFINE STREQUAL "_WIN32")
set(DEFINE WIN32)
endif(DEFINE STREQUAL "_WIN32")
# Set the last define to this one, and set the last check to true, so when #else is encountered, we can do an opposing check
set(LAST_DEF ${DEFINE})
set(LAST_CHECK TRUE)
# If the define is true (it either exists or is a non-false result), the lines following will be checked, otherwise they will be skipped
if(${DEFINE})
set(VALID_LINE TRUE)
else(${DEFINE})
set(VALID_LINE FALSE)
endif(${DEFINE})
else(FOUND_IFDEF)
# If we found a #ifndef on the line, the same thing as #ifdef is done, except with the checks in the opposite direction
if(FOUND_IFNDEF)
# Extract the define
string(REGEX REPLACE "^[ \t]*#[ \t]*ifndef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
if(DEFINE STREQUAL "_WIN32")
set(DEFINE WIN32)
endif(DEFINE STREQUAL "_WIN32")
# Set the last define to this one, and set the last check to false, so when #else is encountered, we can do an opposing check
set(LAST_DEF ${DEFINE})
set(LAST_CHECK FALSE)
# If the define is not true (it either doesn't exists or is a false result), the lines following will be checked, otherwise they will be skipped
if(${DEFINE})
set(VALID_LINE FALSE)
else(${DEFINE})
set(VALUE_LINE TRUE)
endif(${DEFINE})
else(FOUND_IFNDEF)
# If we found a #else on the line, we check the last define in the opposite direction
if(FOUND_ELSE)
# When LAST_CHECK is true, we were inside a #ifdef, now act as if we are entering a #ifndef section by doing an opposing check
if(LAST_CHECK)
if(${LAST_DEF})
set(VALID_LINE FALSE)
else(${LAST_DEF})
set(VALID_LINE TRUE)
endif(${LAST_DEF})
# When LAST_CHECK is false, we were inside a #ifndef, now act as if we are entering a #ifdef section by doing an opposing check
else(LAST_CHECK)
if(${LAST_DEF})
set(VALID_LINE TRUE)
else(${LAST_DEF})
set(VALID_LINE FALSE)
endif(${LAST_DEF})
endif(LAST_CHECK)
else(FOUND_ELSE)
# If we found a #endif on the line, we'll assume everything following the line is valid until we meet another one of the above lines
if(FOUND_ENDIF)
set(VALID_LINE TRUE)
else(FOUND_ENDIF)
# If we found a #include on the line, add the entire line to the list of includes unless the line isn't valid
if(FOUND_INCLUDE)
if(VALID_LINE)
append_to_list(INCLUDES_LIST "${LINE}")
endif(VALID_LINE)
endif(FOUND_INCLUDE)
endif(FOUND_ENDIF)
endif(FOUND_ELSE)
endif(FOUND_IFNDEF)
endif(FOUND_IFDEF)
endforeach(LINE)
set(${INCLUDES} ${INCLUDES_LIST})
endmacro(find_includes)
###############################################################################
# calculate_depends(<source filename> [<optional output variable for includes>])
#
# This macro is used in most of the src (sub)directories to calculate the
# header file dependencies for the given source file.
###############################################################################
macro(calculate_depends SRC)
# Temporarily set that we didn't get a 2nd argument before we actually check if we did get one or not
set(CHECK_ANGLE_INCLUDES FALSE)
# Check for a second argument
if(${ARGC} GREATER 1)
set(CHECK_ANGLE_INCLUDES TRUE)
endif(${ARGC} GREATER 1)
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on
find_includes(${SRC} INCLUDES)
# Reset the list of headers to empty
set(HEADERS)
# Iterate through the strings containing #include (if any)
foreach(INCLUDE ${INCLUDES})
# Extract the filename from the #include line
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
if(QUOTE_TYPE STREQUAL "angle brackets")
# The following checks will only be done if there was a request for angle includes to be checked
if(CHECK_ANGLE_INCLUDES)
# Find the path of the include file
if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include)
else(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME})
endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
# If the include file was found, add it's path to the list of include paths, but only if it doesn't already exist and isn't in the defaults for the compiler
if(FOUND_${FILENAME}_INCLUDE)
find_in_list(DEFAULT_INCLUDE_DIRS "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_DEFAULTS)
if(FOUND_IN_DEFAULTS EQUAL -1)
find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
if(FOUND_IN_INCLUDES EQUAL -1)
append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}")
endif(FOUND_IN_INCLUDES EQUAL -1)
endif(FOUND_IN_DEFAULTS EQUAL -1)
else(FOUND_${FILENAME}_INCLUDE)
message(FATAL_ERROR "${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.")
endif(FOUND_${FILENAME}_INCLUDE)
endif(CHECK_ANGLE_INCLUDES)
endif(QUOTE_TYPE STREQUAL "angle brackets")
endforeach(INCLUDE)
endmacro(calculate_depends)
###############################################################################
# calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
#
# This macro is used in most of the src (sub)directories to calculate the
# library dependencies for the given source file.
###############################################################################
macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
# Set up a temporary LDFLAGS for this file
set(THIS_LDFLAGS "${LDFLAGS}")
# Reset extra dependencies
set(EXTRA_DEPENDENCIES)
# Reset library paths
set(LIBRARY_PATHS)
# Reset libraries
set(LIBRARIES)
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
# Iterate through those lines
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
# Strip off the /* RequiredLibraries: and */ from the line
string(REGEX REPLACE "/\\*[ \t]*RequiredLibraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Replace all commas with semicolons
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Iterate through the libraries given
foreach(LIBRARY ${REQUIRED_LIBRARY})
# Locate the library to see if it exists
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib)
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY})
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
# If the library was found, we will add it to the linker flags
if(FOUND_${LIBRARY}_LIBRARY)
# Get the path only of the library, to add it to linker flags
get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH)
if(MSVC)
# For Visual Studio, instead of editing the linker flags, we'll add the library to a separate list of extra dependencies
append_to_list(EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}")
else(MSVC)
# For all others, add the library paths and libraries
append_to_list(LIBRARY_PATHS "${LIBRARY_PATH}")
append_to_list(LIBRARIES "${LIBRARY}")
endif(MSVC)
else(FOUND_${LIBRARY}_LIBRARY)
# In the case of the library not being found, we fatally error so CMake stops trying to generate
message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
endif(FOUND_${LIBRARY}_LIBRARY)
endforeach(LIBRARY)
endforeach(REQUIRED_LIBRARY)
# Remove duplicates from the library paths
if(LIBRARY_PATHS)
remove_list_duplicates(LIBRARY_PATHS)
endif(LIBRARY_PATHS)
# Remove diplicates from the libraries
if(LIBRARIES)
remove_list_duplicates(LIBRARIES)
endif(LIBRARIES)
# Iterate through library paths and add them to the linker flags
foreach(LIBRARY_PATH ${LIBRARY_PATHS})
find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS)
if(FOUND_IN_DEFAULTS EQUAL -1)
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
endif(FOUND_IN_DEFAULTS EQUAL -1)
endforeach(LIBRARY_PATH)
# Iterate through libraries and add them to the linker flags
foreach(LIBRARY ${LIBRARIES})
set(THIS_LDFLAGS "${THIS_LDFLAGS} -l${LIBRARY}")
endforeach(LIBRARY)
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
endmacro(calculate_libraries)
###############################################################################
# add_to_cpack_ignored_files(<item> [TRUE])
#
# A macro to update the environment variable CPACK_IGNORED_FILES which
# contains a list of files for CPack to ignore. If the optional 2nd argument
# of TRUE is given, periods will be converted to \\. for CPack.
###############################################################################
macro(add_to_cpack_ignored_files ITEM)
# Temporary copy of the orignal item
set(REAL_ITEM "${ITEM}")
# If we have 2+ arguments, assume that the second one was something like TRUE (doesn't matter really) and convert periods so they will be \\. for CPack
if(${ARGC} GREATER 1)
string(REPLACE "." "\\\\." REAL_ITEM ${REAL_ITEM})
endif(${ARGC} GREATER 1)
# If the environment variable is already defined, just tack the item to the end
if(DEFINED ENV{CPACK_IGNORED_FILES})
set(ENV{CPACK_IGNORED_FILES} "$ENV{CPACK_IGNORED_FILES};${REAL_ITEM}")
# Otherwise set the environment variable to the item
else(DEFINED ENV{CPACK_IGNORED_FILES})
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
endif(DEFINED ENV{CPACK_IGNORED_FILES})
endmacro(add_to_cpack_ignored_files)
-474
View File
@@ -1,474 +0,0 @@
# This usage of CMake requires at least version 2.4 (checks are made to determine what to use when certain versions lack functions)
cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows)
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
message(FATAL_ERROR "You can not use CMake to build Anope from the root of it's source tree! Remove the CMakeCache.txt file from this directory, then create a separate directory (either below this directory or elsewhere), and then re-run CMake from there.")
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
# Set the project as C++ primarily, but have C enabled for the checks required later
project(Anope CXX)
enable_language(C)
# Detect the version of CMake for the later conditional checks
execute_process(COMMAND ${CMAKE_COMMAND} --version OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "cmake version 2\\.(.*)" "\\1" ONLY_VERSION "${VERSION}")
string(REGEX MATCH "-patch .*$" HAS_PATCH "${ONLY_VERSION}")
if(HAS_PATCH)
string(REGEX REPLACE "(.*)-patch .*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
string(REGEX REPLACE ".*-patch (.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
else(HAS_PATCH)
string(REGEX MATCH "\\." HAS_DOT "${ONLY_VERSION}")
if(HAS_DOT)
string(REGEX REPLACE "(.*)\\..*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
string(REGEX REPLACE ".*\\.(.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
else(HAS_DOT)
string(REGEX REPLACE "(.*)-beta" "\\1" MINOR_VERSION "${ONLY_VERSION}")
if(MINOR_VERSION STREQUAL "4-1\n")
set(PATCH_VERSION 1)
else(MINOR_VERSION STREQUAL "4-1\n")
set(PATCH_VERSION 0)
endif(MINOR_VERSION STREQUAL "4-1\n")
set(MINOR_VERSION 4)
endif(HAS_DOT)
endif(HAS_PATCH)
# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does
if(MINOR_VERSION GREATER 5)
set(CMAKE26_OR_BETTER TRUE)
set(CMAKE248_OR_BETTER TRUE)
set(CMAKE244_OR_BETTER TRUE)
set(CMAKE242_OR_BETTER TRUE)
else(MINOR_VERSION GREATER 5)
set(CMAKE26_OR_BETTER FALSE)
# Also detect if we are using CMake 2.4.8 or better, the FIND sub-command of list() is non-existant in earlier versions
if(PATCH_VERSION GREATER 7)
set(CMAKE248_OR_BETTER TRUE)
set(CMAKE244_OR_BETTER TRUE)
set(CMAKE242_OR_BETTER TRUE)
else(PATCH_VERSION GREATER 7)
set(CMAKE248_OR_BETTER FALSE)
# Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module and SORT sub-command of list() are non-existant in earlier versions
if(PATCH_VERSION GREATER 3)
set(CMAKE244_OR_BETTER TRUE)
set(CMAKE242_OR_BETTER TRUE)
else(PATCH_VERSION GREATER 3)
set(CMAKE244_OR_BETTER FALSE)
# ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is non-existant in earlier versions
if(PATCH_VERSION GREATER 1)
set(CMAKE242_OR_BETTER TRUE)
else(PATCH_VERSION GREATER 1)
set(CMAKE242_OR_BETTER FALSE)
endif(PATCH_VERSION GREATER 1)
endif(PATCH_VERSION GREATER 3)
endif(PATCH_VERSION GREATER 7)
endif(MINOR_VERSION GREATER 5)
# Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template
set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR})
include(Anope)
# Force the locale to C for later uses of things like gcc so the messages come up in English, not the user's default language
set(ENV{LC_ALL} C)
# Start with empty defaults for library and include directories, to be used by GNU compilers only
set(DEFAULT_LIBRARY_DIRS)
set(DEFAULT_INCLUDE_DIRS)
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
if(CMAKE_COMPILER_IS_GNUCXX)
# First look for the compiler's default library directories
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
# Find only the part after "libraries: "
string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
# Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line
if(NOT MINGW)
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
else(NOT MINGW)
set(LIBRARIES "${LINE}")
endif(NOT MINGW)
# Iterate through the libraries
foreach(LIBRARY ${LIBRARIES})
# Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
string(SUBSTRING ${LIBRARY} 0 1 FIRST_CHAR)
if(NOT FIRST_CHAR STREQUAL "=")
# If the directory had no = in front of it, make sure it's absolute and add it to the list of default library directories
get_filename_component(LIBRARY ${LIBRARY} ABSOLUTE)
append_to_list(DEFAULT_LIBRARY_DIRS ${LIBRARY})
endif(NOT FIRST_CHAR STREQUAL "=")
endforeach(LIBRARY)
# Remove duplicate entries from the list
if(DEFAULT_LIBRARY_DIRS)
remove_list_duplicates(DEFAULT_LIBRARY_DIRS)
endif(DEFAULT_LIBRARY_DIRS)
# Next, we look for the compiler's default include directories
# Run the command to find the default include directories
execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.c ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
# Convert the new lines to semicolons
string(REGEX REPLACE "\n" ";" LINES ${LINES})
# Temporary variable saying if we are in the search list or not
set(IN_SEARCH_LIST FALSE)
# Iterate through the lines
foreach(LINE ${LINES})
# If the line has the following on it, the next lines will contain directory names
if(LINE STREQUAL "#include <...> search starts here:")
set(IN_SEARCH TRUE)
else(LINE STREQUAL "#include <...> search starts here:")
# If the line has the following on it, we hit the end of the list
if(LINE STREQUAL "End of search list.")
set(IN_SEARCH FALSE)
else(LINE STREQUAL "End of search list.")
# If we are within the block between the above two lines...
if(IN_SEARCH)
# Get everything but the first character of the line
string(LENGTH ${LINE} LINE_LENGTH)
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
# Convert the path to an absolute one, just in case it wasn't
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
# Add that directory to the list of default include directories
append_to_list(DEFAULT_INCLUDE_DIRS ${INCLUDE})
endif(IN_SEARCH)
endif(LINE STREQUAL "End of search list.")
endif(LINE STREQUAL "#include <...> search starts here:")
endforeach(LINE)
# Remove duplicate entries from the list
if(DEFAULT_INCLUDE_DIRS)
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
endif(DEFAULT_INCLUDE_DIRS)
endif(CMAKE_COMPILER_IS_GNUCXX)
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
if(MSVC)
# If the path comes up as "/registry" from any of these, the path wasn't found, otherwise, we'll set WSDK_PATH to the corresponding path
# Look for the 2008 SDK under HKLM first
get_filename_component(WSDK2008_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
if(WSDK2008_PATH STREQUAL "/registry")
# If not found, look for the 2003 SDK under HKLM
get_filename_component(WSDK2003_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
if(WSDK2003_PATH STREQUAL "/registry")
# If not found, look for the 2008 SDK under HKCU
get_filename_component(WSDK2008_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
if(WSDK2008_PATH STREQUAL "/registry")
# If not found, look for the 2003 SDK under HKCU
get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
if(WSDK2003_PATH STREQUAL "/regsitry")
# The SDK was never found, set the path to nothing
set(WSDK_PATH "")
else(WSDK2003_PATH STREQUAL "/regsitry")
set(WSDK_PATH "${WSDK2003_PATH}")
endif(WSDK2003_PATH STREQUAL "/regsitry")
else(WSDK2008_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2008_PATH}")
endif(WSDK2008_PATH STREQUAL "/registry")
else(WSDK2003_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2003_PATH}")
endif(WSDK2003_PATH STREQUAL "/registry")
else(WSDK2008_PATH STREQUAL "/registry")
set(WSDK_PATH "${WSDK2008_PATH}")
endif(WSDK2008_PATH STREQUAL "/registry")
endif(MSVC)
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition
# and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE
# to Debug
# Only do this if not using Visual Studio
if(NOT MSVC)
if(CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
else(CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
endif(CMAKE_BUILD_TYPE)
endif(NOT MSVC)
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
if(MINGW)
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
endif(MINGW)
# Include the checking functions used later in this CMakeLists.txt
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckTypeSize)
include(CheckLibraryExists)
if(CMAKE244_OR_BETTER)
include(CheckCXXCompilerFlag)
else(CMAKE244_OR_BETTER)
include(TestCXXAcceptsFlag)
endif(CMAKE244_OR_BETTER)
# Add an optional variable for using run-cc.pl for building, Perl will be checked later regardless of this setting
option(USE_RUN_CC_PL "Use run-cc.pl for building" OFF)
# Use the following directories as includes
include_directories(${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/include ${Anope_BINARY_DIR}/lang)
# If using Windows, always add the _WIN32 define
if(WIN32)
add_definitions(-D_WIN32)
endif(WIN32)
# If using Visual Studio, set the C++ flags accordingly
if(MSVC)
# Remove the default exception handling flags, also remove default warning level flag
string(REPLACE "/EHsc " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4251 /wd4706 /wd4800 /wd4996 /EHs")
add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS)
# Otherwise, we're not using Visual Studio
else(MSVC)
# Set the compile flags to have all warnings on (including shadowed variables)
set(CXXFLAGS "${CXXFLAGS} -Wall -Wshadow")
# If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols
if(UNIX)
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic -fno-leading-underscore")
# Set the module-specific compile flags to the same setting as the compile flags
set(MODULE_CXXFLAGS "${CXXFLAGS}")
# If we aren't on a *nix system, we are using MinGW
else(UNIX)
# Also, if we are building under MinGW, add another define for MinGW
if(MINGW)
add_definitions(-DMINGW)
endif(MINGW)
endif(UNIX)
endif(MSVC)
# If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags
if(CMAKE_DL_LIBS)
set(LDFLAGS "${LDFLAGS} -l${CMAKE_DL_LIBS}")
endif(CMAKE_DL_LIBS)
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
if(MINGW)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
endif(MINGW)
# Under Windows, we set the executable name for Anope to be anope
if(WIN32)
set(PROGRAM_NAME anope)
# Under *nix, we set the executable name for Anope to be services
else(WIN32)
set(PROGRAM_NAME services)
endif(WIN32)
# If we are not using Visual Studio, we'll run the following checks
if(NOT MSVC)
# Check if the C++ compiler can accept the -pipe flag, and add it to the compile flags if it works
if(CMAKE244_OR_BETTER)
# If using CMake 2.4.4 or better, we can use check_cxx_compiler_flag
check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG)
else(CMAKE244_OR_BETTER)
# If using CMake 2.4.3 or older, we will use check_cxx_accepts_flags instead
check_cxx_accepts_flag(-pipe HAVE_PIPE_FLAG)
endif(CMAKE244_OR_BETTER)
# If the flag was accepted, add it to the list of flags
if(HAVE_PIPE_FLAG)
set(CXXFLAGS "${CXXFLAGS} -pipe")
endif(HAVE_PIPE_FLAG)
# The following are additional library checks, they are not required for Windows
if(NOT WIN32)
# Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
if(HAVE_SOCKET_LIB)
set(LDFLAGS "${LDFLAGS} -lsocket")
endif(HAVE_SOCKET_LIB)
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
if(HAVE_NSL_LIB)
set(LDFLAGS "${LDFLAGS} -lnsl")
endif(HAVE_NSL_LIB)
endif(NOT WIN32)
endif(NOT MSVC)
# If DEFUMASK wasn't passed to CMake, set a default depending on if RUNGROUP was passed in or not
if(NOT DEFUMASK)
if(RUNGROUP)
set(DEFUMASK "007")
else(RUNGROUP)
set(DEFUMASK "077")
endif(RUNGROUP)
endif(NOT DEFUMASK)
# Check for the existance of the following include files
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(strings.h HAVE_STRINGS_H)
check_include_file(sys/select.h HAVE_SYS_SELECT_H)
# Check for the existance of the following functions
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists(setgrent HAVE_SETGRENT)
check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(stricmp HAVE_STRICMP)
check_function_exists(strlcat HAVE_STRLCAT)
check_function_exists(strlcpy HAVE_STRLCPY)
check_function_exists(umask HAVE_UMASK)
check_function_exists(backtrace HAVE_BACKTRACE)
# Check for the existance of the following types
check_type_size(uint8_t UINT8_T)
check_type_size(u_int8_t U_INT8_T)
check_type_size(int16_t INT16_T)
check_type_size(uint16_t UINT16_T)
check_type_size(u_int16_t U_INT16_T)
check_type_size(int32_t INT32_T)
check_type_size(uint32_t UINT32_T)
check_type_size(u_int32_t U_INT32_T)
# Strip the leading and trailing spaces from the compile flags
if(CXXFLAGS)
strip_string(${CXXFLAGS} CXXFLAGS)
endif(CXXFLAGS)
# Strip the leading and trailing spaces from the linker flags
if(LDFLAGS)
strip_string(${LDFLAGS} LDFLAGS)
endif(LDFLAGS)
# Search for the following programs
find_program(GREP grep)
find_program(SH sh)
find_program(CHGRP chgrp)
find_program(CHMOD chmod)
find_program(PERL perl)
# If perl is included on the system and the user wants to use run-cc.pl, change the commands for compiling and linking
if(PERL AND USE_RUN_CC_PL)
set(CMAKE_CXX_COMPILE_OBJECT "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_COMPILE_OBJECT}")
set(CMAKE_CXX_LINK_EXECUTABLE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_LINK_EXECUTABLE}")
set(CMAKE_CXX_CREATE_SHARED_MODULE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_CREATE_SHARED_MODULE}")
endif(PERL AND USE_RUN_CC_PL)
# If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the services directory under the user's home directory
if(INSTDIR)
set(CMAKE_INSTALL_PREFIX "${INSTDIR}")
else(INSTDIR)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/services")
endif(INSTDIR)
# Version number processing
# Find all lines in version.log that start with VERSION_
read_from_file(${Anope_SOURCE_DIR}/version.log "^VERSION_" VERSIONS)
# Iterate through the strings found
foreach(VERSION_STR ${VERSIONS})
# Get the length of the string
string(LENGTH ${VERSION_STR} VERSION_LEN)
# Subtract 16 from the string's length (8 for VERSION_, 5 more for the type, 2 for the space and leading quote, 1 for the trailing quote)
math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - 16")
# Extract the type from the string
string(SUBSTRING ${VERSION_STR} 8 5 VERSION_TYPE)
# Extract the actual value from the string
string(SUBSTRING ${VERSION_STR} 15 ${VERSION_NUM_LEN} VERSION)
# Set the version type to the value extract from above
set(VERSION_${VERSION_TYPE} ${VERSION})
endforeach(VERSION_STR ${VERSIONS})
# Set the version variables based on what was found above
set(VERSION_COMMA "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_BUILD}")
set(VERSION_DOTTED_NOBUILD "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
set(VERSION_DOTTED "${VERSION_DOTTED_NOBUILD}.${VERSION_BUILD}")
set(VERSION_FULL "${VERSION_DOTTED}${VERSION_EXTRA}")
set(VERSION_FULL_NOBUILD "${VERSION_DOTTED_NOBUILD}${VERSION_EXTRA}")
# Only do the following for Windows
if(WIN32)
# Generate the win32.rc file using the above variables
configure_file(${Anope_SOURCE_DIR}/src/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32.rc)
endif(WIN32)
# Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source
add_to_cpack_ignored_files(".git\;config.cache\;.svn\;CMakeFiles\;sysconf.h$\;Makefile.inc$\;config.log\;config.status\;build\;autom4te.cache" TRUE)
# Add the files we don't want the periods converted for
add_to_cpack_ignored_files(".\\\\\\\\.so$;.\\\\\\\\.o$;.\\\\\\\\.s$;${Anope_SOURCE_DIR}/Makefile$")
# If the two directories are the same, we are building in-source, thus we need to ignore more files from the build
if(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
# Add the files that need their periods converted
add_to_cpack_ignored_files("Makefile\;cmake_install.cmake\;sysconf.h$\;CMakeCache.txt\;install_manifest.txt" TRUE)
# Add the files we don't want the periods converted for
add_to_cpack_ignored_files(".\\\\\\\\.so$;CPack.;anope-${VERSION_FULL_NOBUILD}-source\\\\\\\\..")
# If using Visual Studio, add these files as well
if(MSVC)
add_to_cpack_ignored_files(".vcproj$\;.sln$\;.ncb$\;.suo$\;.dir$\;.ilk$\;.exp$\;.pdb$\;.lib$\;/debug$;/release$;/relwithdebinfo$;/minsizerel$" TRUE)
endif(MSVC)
endif(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
# Go into the following directories and run their CMakeLists.txt as well
add_subdirectory(data)
add_subdirectory(docs)
add_subdirectory(lang)
add_subdirectory(src)
add_subdirectory(include)
# Get the filename of the Anope binary, to use later
get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
# At install time, create the following additional directories
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/backups\")")
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/logs\")")
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/modules/runtime\")")
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
if(NOT WIN32 AND RUNGROUP)
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/backups\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/logs\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/modules/runtime\")")
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
endif(NOT WIN32 AND RUNGROUP)
# On Windows platforms, install extra files
if(WIN32)
install(FILES ${Anope_SOURCE_DIR}/anope.bat
DESTINATION bin
)
install(FILES ${Anope_SOURCE_DIR}/docs/Changes ${Anope_SOURCE_DIR}/docs/Changes.conf ${Anope_SOURCE_DIR}/docs/Changes.lang
DESTINATION .
)
endif(WIN32)
# Only process the CPack section if we have CPack
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Various options for CPack
set(CPACK_PACKAGE_NAME "Anope IRC Services")
set(CPACK_PACKAGE_VENDOR "Anope Team")
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}${VERSION_EXTRA}")
set(CPACK_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}")
set(CPACK_RESOURCE_FILE_LICENSE "${Anope_SOURCE_DIR}/docs/COPYING")
# The following doesn't actually do anything. :(
#set(CPACK_RESOURCE_FILE_README "${Anope_SOURCE_DIR}/docs/README")
# The following is primarily for NSIS
if(WIN32)
# Also for Windows, include installing the MSVCRT library
include(InstallRequiredSystemLibraries)
set(CPACK_GENERATOR "NSIS")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Anope")
set(CPACK_PACKAGE_EXECUTABLES "")
set(CPACK_NSIS_MENU_LINKS
"bin\\\\${SERVICES_BINARY}" "Anope IRC Services"
"bin\\\\anope.bat\\\" \\\"-debug -nofork" "Anope IRC Services (Debug and Window Logging)"
"bin\\\\anope.bat\\\" \\\"-nofork" "Anope IRC Services (Window Logging)"
"bin\\\\anope.bat\\\" \\\"-nothird" "Anope IRC Services (No Third Party Modules)"
"http://www.anope.org/" "Anope Web Site"
)
# The following doesn't work, but a bug report has been filed about it
#set(CPACK_CREATE_DESKTOP_LINK_${SERVICES_BINARY} TRUE)
set(CPACK_NSIS_MUI_ICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico")
set(CPACK_NSIS_MUI_UNIICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico")
set(CPACK_NSIS_INSTALLED_ICON_NAME "${SERVICES_BINARY}")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.anope.org/")
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
endif(WIN32)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}-source")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES "$ENV{CPACK_IGNORED_FILES}")
set(CPACK_MONOLITHIC_INSTALL TRUE)
include(CPack)
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
+1316
View File
File diff suppressed because it is too large Load Diff
+847
View File
@@ -0,0 +1,847 @@
Anope Version 1.8.3
-------------------
** ADDED CONFIGURATION DIRECTIVES **
inspircd12 - IRCDModule
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.8.2
-------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.8.1
-------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
# IRCDModule <module_name> [REQUIRED]
# The ircd protocol module should be used when connecting anope to your
# chosen IRCD. This should be one of the following options, or a file
# provided by your IRCD author.
#
# Bahamut 1.4.27 [or later] - "bahamut"
# Charybdis 1.0 [or later] - "charybdis"
# DreamForge 4.6.7 - "dreamforge"
# Hybrid IRCd 7.0 [experimental] - "hybrid"
# InspIRCd 1.1 [beta 8 or later] - "inspircd11"
# Plexus 3.0 [or later] - "plexus3"
# Plexus 2.0 [or later] - "plexus2"
# PTLink 6.15.0 [experimental] - "ptlink"
# RageIRCd 2.0.x - "rageircd"
# Ratbox 2.0.6 [or later] - "ratbox"
# ShadowIRCD 4.0x [beta 7 or later] - "shadowircd"
# Solid IRCD 3.4.x [3.4.6 or later] - "solidircd"
# UltimateIRCd 3.0.0 [or later] - "ultimate3"
# UltimateIRCd 2.8.2 [or later] - "ultimate2"
# Unreal 3.2 [beta-19 or later] - "unreal32"
# Unreal 3.1.1 [or later] - "unreal31"
# ViagraIRCd 1.3.x [or later] - "viagra"
#
#IRCDModule "unreal32"
# SuperAdmin [OPTIONAL]
# When enabled, Services Roots will be able to use SuperAdmin [ON|OFF]
# which will temporarily grant them extra privileges, such as being a
# founder of _all_ channels, ability to adjust another users modes etc..
#SuperAdmin
# UnRestrictSAdmin [OPTIONAL]
# On many ircd Anope removes the umode of +a from users whom are not
# Service Admin in Anope. This mode is NOT used by Anope for any form
# of access. Thus this option allows them to keep the mode without having
# to be a Service Admin in Anope
#UnRestrictSAdmin
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.8.0
-------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.24
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.23b
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.23
--------------------
** ADDED CONFIGURATION DIRECTIVES **
# OSIgnoreDBName [OPTIONAL]
# Module: os_ignore_db
#
# Use the given filename as database for services ignores.
# If not given, the default of "os_ignore.db" will be used.
#
#OSIgnoreDBName "os_ignore.db"
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.22
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
# BotCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of BotServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
BotCoreModules "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot bs_fantasy bs_fantasy_kick bs_fantasy_kickban bs_fantasy_owner bs_fantasy_seen"
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.21
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.20
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.19
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.18
--------------------
** ADDED CONFIGURATION DIRECTIVES **
###########################################################################
#
# Encryption settings
#
###########################################################################
# EncModule <module_name> [REQUIRED]
# The encryption module to use when dealing with passwords.
# This determines how the passwords are stored in the databases,
# and does not add any security as far as transmitting passwords over
# the network goes.
# enc_none provides no password encryption, storing the password in
# plain text, this is the most versiatle as passwords can easily be
# recovered.
#
# NOTE: users of anope's previous (broken) md5 implementation should
# select the enc_old option, or things may break.
#
# NOTE2: Some of these encryption methods are one-way (md5, sha1, old)
# meaning that you can NOT retrive the passwords in plain text once
# encrypted.
#
# Plain Text - enc_none
# Previous (broken) MD5 - enc_old
# MD5 - enc_md5
# SHA1 - enc_sha1
#
EncModule "enc_none"
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.17
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.16
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.15
--------------------
** ADDED CONFIGURATION DIRECTIVES **
# UseStrictPrivMsg [OPTIONAL]
# Using this directive will force services to only respond to privmsgs
# addressed to Nick@ServerName - e.g. NickServ@localhost.net.
# This should be used on conjunction with ircd aliases.
#
#UseStrictPrivMsg
# NSResendDelay <time> [RECOMMENDED]
# Sets the minimum length of time between consecutive uses of the
# RESEND command. If not given, this restriction is disabled (note
# that this allows "resend flooding" or "mail bombing").
NSResendDelay 90s
NSDefAutoop
** MODIFIED CONFIGURATION DIRECTIVES **
ModuleDelayedAutoload "cs_appendtopic cs_enforce ns_maxemail os_info hs_request"
# LimitSessions [OPTIONAL]
# Enables session limiting. Session limiting prevents users from
# connecting more than a certain number of times from the same host at the
# same time - thus preventing most types of cloning. Once a host reaches
# it's session limit, all clients attempting to connect from that host
# will be killed. Exceptions to the default session limit, which are based
# on host names, can be defined via the exception list. It should be noted
# that session limiting, along with a large exception list, can degrade
# services' performance. See the source and comments in sessions.c and the
# online help for more information about session limiting.
#
# NOTE: This option is not available when STREAMLINED is defined in
# the Makefile.
LimitSessions
** DELETED CONFIGURATION DIRECTIVES **
# NSAutoOPDBName [OPTIONAL]
# Module: ns_noop
#
# Use the given filename as database for the autoop list. If not given,
# the default of "autoop.db" will be used.
#
#NSAutoOPDBName "autoop.db"
# KillClonesAkillExpire <time> [REQUIRED]
# Sets the expiry time for autokills added for hosts that have been
# killed using the KILLCLONES command.
KillClonesAkillExpire 30m
# CheckClones <minusers> <maxdelay> <warningdelay> [DEPRECATED]
# Causes Services to try and detect "clones" connecting to the network.
# A WALLOPS (or GOPER, if supported on the IRC server) will be sent if
# Services thinks it has found clones.
#
# This feature has been superseded by Session Limiting.
#
# <minusers> sets the minimum number of users which must successively
# connect to the network before Services will send a clone warning.
#
# <maxdelay> sets the maximum time that can elapse between successive
# users before Services decides they are not clones.
#
# <warningdelay> sets the minimum time between clone warnings for
# clones from the same host.
#
# NOTE: This option is not available when STREAMLINED is defined in
# the Makefile.
# CheckClones 5 10s 30s
# KillClones [DISCOURAGED] [DEPRECATED]
# Causes Services to kill users which trigger the clone warnings. (If
# CheckClones is disabled, this will have no effect.)
#
# This feature has been superceded by Session Limiting.
#
# BEWARE! The clone checking code is easily fooled; it can be
# triggered falsely under many conditions, for example:
#
# - Multiple users connecting from a shell machine.
#
# - A single user repeatedly connecting and disconnecting.
#
# Be very sure you know what you're doing before you even think about
# enabling this option, and remember that Services comes with no
# warranty.
#
# If that wasn't enough discouragement:
#
# ***** DO NOT ENABLE THIS OPTION! *****
#
# NOTE: This option is not available when STREAMLINED is defined in
# the Makefile.
#KillClones
Anope Version 1.7.13
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.12
--------------------
** ADDED CONFIGURATION DIRECTIVES **
# BSFantasyCharacter [REQUIRED]
# This option allows you to change the default prefix for fantasy
# commands in channels. This character will have to be prepended to all
# fantasy commands. If you choose "!" (the default), fantasy commands
# will, for example, be "!kick", "!op", etc.
BSFantasyCharacter "!"
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.11
--------------------
** ADDED CONFIGURATION DIRECTIVES **
# NickLen [REQUIRED]
# Set this to the maximum allowed nick length on your network. Anope does
# not support values larger than 31, so setting them makes no sense. Be
# sure to set this correctly, as setting this wrong can result in services
# being disconnected from the network.
NickLen 31
** MODIFIED CONFIGURATION DIRECTIVES **
# UserKey1|2|3 <value> [RECOMMENDED]
#
# These keys are required to initiate the random number generator. These
# numbers MUST be random as you want your passcodes to be random. Don't
# give these keys to anyone! Keep them private!
#
# *** NOTE ***
# If you don't enable these, or keep their default values, any talented
# programmer would be able to easily "guess" random strings used to mask
# information. Be safe, and come up with three different 7 digit numbers
#UserKey1 9866235
#UserKey2 8362013
#UserKey3 2362899
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.10
--------------------
** ADDED CONFIGURATION DIRECTIVES **
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.9
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# IRCDModule <module_name> [REQUIRED]
# The ircd protocol module should be used when connecting anope to your
# chosen IRCD. This should be one of the following options, or a file
# provided by your IRCD author.
#
# Bahamut 1.4.27 [or later] - "bahamut"
# DreamForge 4.6.7 - "dreamforge"
# Hybrid IRCd 7.0 [experimental] - "hybrid"
# InspIRCd 1.0 Beta 5 - "inspircd"
# InspIRCd module is provided by Brain <brain@inspircd.org>
# Plexus 2.0 [or later] - "plexus"
# PTLink 6.15.0 [experimental] - "ptlink"
# RageIRCd 2.0.0 [beta-6 of later] - "rageircd"
# Ratbox 2.0.6 [or later] - "ratbox"
# ShadowIRCD 4.0x [beta 7 or later] - "shadowircd"
# Solid IRCD 3.4.x [3.4.6 or later] - "solidircd"
# UltimateIRCd 3.0.0 [or later] - "ultimate3"
# UltimateIRCd 2.8.2 [or later] - "ultimate2"
# Unreal 3.2 [beta-19 or later] - "unreal32"
# Unreal 3.1.1 [or later] - "unreal31"
# ViagraIRCd 1.3.x [or later] - "viagra"
#
#IRCDModule "unreal32"
# HostCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of HostServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
HostCoreModules "hs_help hs_on hs_off hs_group hs_list hs_set hs_setall hs_del hs_delall"
# MemoCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of MemoServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
MemoCoreModules "ms_send ms_cancel ms_list ms_read ms_del ms_set ms_info ms_rsend ms_check ms_staff ms_sendall ms_help"
# HelpCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of HelpServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
HelpCoreModules "he_help"
# BotCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of BotServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
BotCoreModules "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot bs_fantasy bs_fantasy_kick bs_fantasy_kickban bs_fantasy_owner bs_fantasy_seen bs_fantasy_unban"
# OperCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of OperServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
OperCoreModules "os_help os_global os_stats os_oper os_admin os_staff os_mode os_kick os_clearmodes os_killclones os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_logonnews os_randomnews os_opernews os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo"
# NickCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of NickServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
NickCoreModules "ns_help ns_register ns_group ns_identify ns_access ns_set ns_drop ns_recover ns_release ns_sendpass ns_ghost ns_alist ns_info ns_list ns_logout ns_status ns_update ns_getpass ns_getemail ns_forbid ns_suspend"
# ChanCoreModules <list> [RECOMMENDED]
# These modules will be loaded as part of ChanServ's core.
# It is not recommended you change these settings unless you are
# sure you understand exactly what it is you are doing.
ChanCoreModules "cs_help cs_register cs_identify cs_set cs_xop cs_access cs_akick cs_drop cs_sendpass cs_ban cs_clear cs_modes cs_getkey cs_invite cs_kick cs_list cs_logout cs_topic cs_info cs_getpass cs_forbid cs_suspend cs_status"
# OSOpersOnly [RECOMMENDED]
# If this is defined, only IRC Operators will be permitted to use
# OperServ, regardless of module based command access restrictions.
OSOpersOnly
# NSEmailMax [OPTIONAL]
# Module: ns_maxemail
#
# Limit the amount of registrations with the same email address to the
# amount given here. If set to 0 or left commented, there will be no limit
# enforced when registering new accounts or using /msg NickServ SET EMAIL.
#
#NSEmailMax 1
# NSAutoOPDBName [OPTIONAL]
# Module: ns_noop
#
# Use the given filename as database for the autoop list. If not given,
# the default of "autoop.db" will be used.
#
#NSAutoOPDBName "autoop.db"
# OSInfoDBName [OPTIONAL]
# Module: os_info
#
# Use the given filename as database for the oper information lines.
# If not given, the default of "os_info.db" will be used.
#
#OSInfoDBName "os_info.db"
** MODIFIED CONFIGURATION DIRECTIVES **
# UserKey1|2|3 <value> [REQUIRED]
#
# These keys are required to initiate the random number generator. These
# numbers MUST be random as you want your passcodes to be random. Don't
# give these keys to no anyone! Keep them private!
# For those pple who don't understand what to do here: Just pick three
# _different_ _random_ numbers with about 6 or 7 digits and put them here.
# If the keys don't work, they might be too long or you forgot to remove
# the # in front of them. Example:
# UserKey1 9866235
# UserKey1 <your_first_random_number_here>
# UserKey2 <your_second_random_number_here>
# UserKey3 <you_third_random_number_here>
# Numeric [OPTIONAL]
# Many ircd identify themselves with a Numeric ID when using this option
# consult your ircds documentation before using this.
#Numeric "3AX"
#Numeric "4"
# ModuleDelayedAutoload [OPTIONAL]
#
# When compiled with module support, this contains a space separated list
# of modules to automaticaly load when services are ready for new clients.
# e.g. new pesudo clients such as CatServ :-) *meow*
# By default a number of modules that we found worth adding by default are
# loaded. Feel free to change this if you want to add more, or remove some
# from the list.
#
ModuleDelayedAutoload "cs_appendtopic cs_enforce ns_maxemail ns_noop os_info"
** DELETED CONFIGURATION DIRECTIVES **
###########################################################################
#
# Proxy detection
#
###########################################################################
# Note: if ProxyDetect is not set, all parameters after it in this section
# are optional.
# ProxyDetect [OPTIONAL]
#
# Enables insecure proxy detection. Services will automatically
# scan each incoming user and akill those that use insecure proxy.
#
# Anope currently supports detection of Wingate (port 23), SOCKS4/5
# (port 1080), and HTTP proxy (ports 3128 and 8080). It uses the
# protocol of each proxy type to connect to an IRC server, it does
# not only check if the port is open (so your users may still have
# an open telnet server on their port 23 for example).
#
# WARNING: You should get the authorization of the administrator of
# the computer which runs the proxy detector before enabling it; not
# all administrators will accept it. Also note that in certain
# countries, port scanning is prohibited.
#
# This feature requires threading support to be compiled into Anope.
#ProxyDetect
# ProxyThreads <number> [REQUIRED]
#
# Sets the number of threads Services will launch when starting. Each
# thread will have the responsibility to scan queued hostname for
# proxies.
#
# This value must be set depending of the number of users you have
# on your network. The more threads are used, the more simultaneous
# checks can be done. Remember however, that threads are
# resource-consuming.
#
# WARNING: On Linux, each thread takes a background process, and there
# is an additional process used for thread management; this is a problem
# if you are limited in the number of background process you can use
# (on a paid shell for example).
ProxyThreads 5
# ProxyMessage... <message> [RECOMMENDED]
#
# Sets the notices that will be sent out to users before Services
# scan them for proxy. You may not use all of them, but just as much as
# necessary.
ProxyMessage1 "I will now detect if you're using an insecure proxy."
ProxyMessage2 "If you see a connection on port 23, 1080, 3128 or 8080 from"
ProxyMessage3 "my.box.net, please disregard it, as it is the detector in action."
ProxyMessage4 "See http://proxy.myirc.net/ for information about our proxy policy."
#ProxyMessage5 "Enter"
#ProxyMessage6 "whatever"
#ProxyMessage7 "you want"
#ProxyMessage8 "here."
# ProxyCheck... [OPTIONAL]
#
# Determines what types of proxy Anope will try to find (respectively
# Wingate on port 23, SOCKS4 on port 1080, SOCKS5 on port 1080, HTTP
# proxy on port 3128, HTTP proxy on port 8080 and HTTP proxy on port
# 80).
ProxyCheckWingate
ProxyCheckSocks4
ProxyCheckSocks5
ProxyCheckHTTP1
ProxyCheckHTTP2
ProxyCheckHTTP3
# ProxyTimeout <time> [REQUIRED]
# Sets the maximum length of time we allow a connect/read operation to
# take. If you set this value too high, your threads may hang on a single
# check for a very long time. The best is to try different values
# and see which one is the more efficient for your network.
ProxyTimeout 15s
# ProxyTestServer <ip> <port> [REQUIRED]
#
# Sets the *IP* and port of the IRC server to use as a target when
# testing users for proxy.
ProxyTestServer "1.2.3.4" 6667
# ProxyExpire <time> [RECOMMENDED]
#
# Sets the length of time before a proxy host cache entry expires, if
# not used. If this is not set the default time is 2 days.
ProxyExpire 30d
# ProxyCacheExpire <time> [REQUIRED]
#
# Sets the length of time before a normal host cache entry expires, if
# not used. This cannot be set to 0d.
#
# Every non-proxy hosts will be stored in cache (to avoid too many scans
# to the same host), so you should set this enough low to not fill your
# memory, especially on large networks.
ProxyCacheExpire 1d
# ProxyAkillReason <reason> [REQUIRED]
#
# Sets the reason that will be used to AKILL an user from the network
# if a proxy is detected.
ProxyAkillReason "You're using an insecure proxy. See http://proxy.myirc.net/config.html for information about how to config your proxy in a safe manner."
# WallProxy [OPTIONAL]
#
# Sends a WALLOPS/GLOBOPS when an user using an insecure proxy is being
# AKILLed.
WallProxy
# ProxyMax <number> [REQUIRED]
#
# Sets the maximum proxy cache entries that can be displayed in a single
# call to OperServ CACHE.
ProxyMax 50
Anope Version 1.7.8
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# UseTS6 [OPTIONAL]
#
# Modern hybrid ircd like Ratbox 2.0.x support a protocol called TS6.
# However this protocol is optional thus our default support is for without
# TS6, if you want to take advantage of TS6, enable this option.
#UseTS6
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.7
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# NSAddAccessOnReg [OPTIONAL]
#
# When enabled, services will add the usermask of registering users to the
# access list of their newly created account. If you disable this, users
# will always have to identify to nickserv before being recognized, unless
# they manually add an address to the access list of their account.
NSAddAccessOnReg
# UlineServers [OPTIONAL]
#
# A list of ulined servers on your network, these servers are assumed they
# can set channel modes and we will not attempt to take them from them
# WARNING: do not put your user servers in this option
UlineServers "stats.your.network, proxy.your.network"
# KillOnSGline [OPTIONAL]
#
# When enabled, this option makes the services send an (SVS)KILL command
# immediately after SGLINE ADD. This eliminates the need of killing the
# users after the SGLINE has been added.
# KillOnSGline
# KillOnSQline [OPTIONAL]
#
# When enabled, this option makes the services send an (SVS)KILL command
# immediately after SQLINE ADD. This eliminates the need of killing the
# users after the SQLINE has been added.
# KillOnSQline
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
# NetworkDomain <name> [OPTIONAL]
#
# If your network has a common domain name, specify it there (for
# example, all IRCZONE servers have a name ending in ".irczone.cl",
# so "irczone.cl" would be set there.
#
# You can specify more than one Network Domain by separating each one by
# a space: NetworkDomain "localnet.net localnet.com"
#
# Note that this directive is no longer used by the GLOBAL command, since
# it uses a dynamic list of connected servers regardless of their
# domains. However, some modules may still use this value, so you might
# want to keep it just in case.
NetworkDomain "localnet.com"
# ListOpersOnly [DEPRECATED]
# When enabled, limits use of the ChanServ and NickServ LIST commands
# to IRC operators.
#
# This directive has been superseded by the NSListOpersOnly and
# CSListOpersOnly directives.
#ListOpersOnly
Anope Version 1.7.6
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# UserKey1|2|3 <value> [REQUIRED]
#
# These keys are required to initiate the random number generator. These
# numbers MUST be random as you want your passcodes to be random. Don't
# give these keys to no anyone! Keep them private!
#UserKey1 9866235
#UserKey2 5216332
#UserKey3 9651291
# RestrictOperNick [OPTIONAL]
# Forbids the registration of nicks that contain nick with services
# access. So if Tester is a Services Oper, for example, You can't
# register NewTester or Tester123 unless you are an IRC operator.
#RestrictOperNicks
# UseTokens [OPTIONAL]
# Allows irc networks to use TOKEN commands instead of the
# standard commands. This saves bandwidth but can break older
# modules that are not set to trap for TOKEN - if you are using
# older modules do NOT use this option
#UseTokens
# UseSVS2MODE [OPTIONAL]
# On Unreal IRCD use SVS2MODE instead of SVSMODE, doing this will
# show services changing user modes.
#UseSVS2MODE
# NewsCount [OPTIONAL]
# The number of LOGON/OPER News item to display when a user logs
# on. The default value is 3
#NewsCount 3
# Numeric [OPTIONAL]
# Many ircd identify themselves with a Numeric when using this option
# consult your ircds documentation before using this
#Numeric 0
# UnRestrictSAdmin [OPTIONAL]
# On many ircd Anope removes the umode of +a from users whom are not
# Service Admin in Anope. This mode is NOT used by Anope for any form
# of access. Thus this option allows them to keep the mode without having
# to be a Service Admin in Anope
#UnRestrictSAdmin
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.5
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# UseSVSHOLD [OPTIONAL]
# Allows Bahamut-networks to use SVSHOLD instead of the services
# enforcer. This option has been introduced in Bahamut 1.4.35 and
# places a temporary Q:Line instead of introducing a new nick,
# which is better for both CPU and bandwidth. If you enable this
# option on a pre-1.4.35 Bahamut, it is most likely to break.
#UseSVSHOLD
** MODIFIED CONFIGURATION DIRECTIVES **
# NetworkDomain <name> [OPTIONAL]
#
# If your network has a common domain name, specify it there (for
# example, all IRCZONE servers have a name ending in ".irczone.cl",
# so "irczone.cl" would be set there.
#
# You can specify more than one Network Domain by separating each one by
# a space: NetworkDomain "localnet.net localnet.com"
#
# Note that this directive is no longer used by the GLOBAL command, since
# it uses a dynamic list of connected servers regardless of their
# domains. However, some modules may still use this value, so you might
# want to keep it just in case.
NetworkDomain "localnet.com"
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.4
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# NSNickTracking [OPTIONAL]
#
# When enabled, services will track your last nick identified when issuing
# nick changes.
#NSNickTracking
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
Anope Version 1.7.3
-------------------
** ADDED CONFIGURATION DIRECTIVES **
# BSCaseSensitive [OPTIONAL]
# This option will make botserv use cAsE sEnSiTiVe checking for badwords
# BSCaseSensitive
# MSMemoReceipt [OPTIONAL]
# Allow the use of memo receipts for the following groups:
# 1 - Opers Only
# 2 - Everybody
#
#MSMemoReceipt 1
Anope Version 1.7.2
--------------------
No Changes.
Anope Version 1.7.1
--------------------
** ADDED CONFIGURATION DIRECTIVES **
# UseRDB [OPTIONAL]
#
# Enable this if you want anope to load its data from a remote database.
# (e.g. MySQL)
#
#UseRDB
# NickRegDelay <seconds> [OPTIONAL]
# Prevents users from regging their nick if they are not
# connected for at least X seconds.
#NickRegDelay 30
** MODIFIED CONFIGURATION DIRECTIVES **
** DELETED CONFIGURATION DIRECTIVES **
+585
View File
@@ -0,0 +1,585 @@
Anope Version 1.8.3
-------------------
*** New Strings:
*** Mod Strings:
NEWS_HELP_LOGON
NEWS_HELP_OPER
NEWS_HELP_RANDOM
*** Del Strings:
Anope Version 1.8.2
-------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.8.1
-------------------
*** New Strings:
HOST_OFF
*** Mod Strings:
*** Del Strings:
Anope Version 1.8.0
-------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.24
--------------------
*** New Strings:
OPER_STATS_HOSTSERV_MEM
*** Mod Strings:
NICK_HELP_SASET_AUTOOP
*** Del Strings:
Anope Version 1.7.23b
--------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.23
--------------------
*** New Strings:
PASSWORD_TOO_LONG
CHAN_LOGOUT_FOUNDER_FAILED
*** Mod Strings:
OPER_HELP_OPER
NICK_HELP_SASET_PASSWORD
OPER_IGNORE_SYNTAX
OPER_HELP_IGNORE
CHAN_LOGOUT_ALL_SUCCEEDED
OPER_HELP_MODLIST
*** Del Strings:
PASSWORD_TRUNCATED
Anope Version 1.7.22
--------------------
*** New Strings:
NICK_SASET_LANGUAGE_SYNTAX
NICK_SASET_LANGUAGE_UNKNOWN
NICK_SASET_LANGUAGE_CHANGED
NICK_HELP_SASET_LANGUAGE
NICK_HELP_RESEND
*** Mod Strings:
NICK_HELP_SASET
NICK_RECOVERED
NICK_LIST_SERVADMIN_SYNTAX
NICK_SERVADMIN_HELP_LIST
CHAN_GETKEY_KEY
NICK_SERVADMIN_HELP_LIST
CHAN_SERVADMIN_HELP_LIST
OPER_HELP_GLOBAL
OPER_HELP_UMODE
OPER_HELP_OLINE
OPER_HELP_KICK
OPER_HELP_SVSNICK
OPER_HELP_SET_LOGCHAN
OPER_HELP_SET_SUPERADMIN
CHAN_HELP_AKICK
NICK_HELP_RECOVER
NICK_HELP_RELEASE
NEWS_HELP_LOGON
NEWS_HELP_OPER
OPER_HELP_IGNORE
OPER_IGNORE_TIME_DONE
OPER_IGNORE_PERM_DONE
OPER_IGNORE_DEL_DONE
*** Del Strings:
NICK_SET_UNKNOWN_OPTION_OR_BAD_NICK
OPER_HELP_KILLCLONES
Anope Version 1.7.21
--------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.20
--------------------
*** New Strings:
NICK_HELP_CONFIRM
CHAN_XOP_NOT_AVAILABLE
HELP_LIMIT_SERV_OPER
HELP_LIMIT_SERV_ADMIN
HELP_LIMIT_SERV_ROOT
HELP_LIMIT_IRC_OPER
HELP_LIMIT_HOST_SETTER
HELP_LIMIT_HOST_REMOVER
*** Mod Strings:
OPER_HELP_SET
In all of the following strings only the trailing 'Limited to ...' line has been removed:
OPER_HELP_EXCEPTION
OPER_HELP_SESSION
NICK_HELP_SASET
NICK_HELP_SASET_DISPLAY
NICK_HELP_SASET_PASSWORD
NICK_HELP_SASET_URL
NICK_HELP_SASET_EMAIL
NICK_HELP_SASET_ICQ
NICK_HELP_SASET_GREET
NICK_HELP_SASET_KILL
NICK_HELP_SASET_SECURE
NICK_HELP_SASET_PRIVATE
NICK_HELP_SASET_HIDE
NICK_HELP_SASET_MSG
NICK_HELP_SASET_NOEXPIRE
NICK_HELP_SASET_AUTOOP
NICK_SERVADMIN_HELP_GETPASS
NICK_SERVADMIN_HELP_GETEMAIL
NICK_SERVADMIN_HELP_FORBID
NICK_SERVADMIN_HELP_SUSPEND
NICK_SERVADMIN_HELP_UNSUSPEND
CHAN_SERVADMIN_HELP_SET_NOEXPIRE
CHAN_SERVADMIN_HELP_GETPASS
CHAN_SERVADMiN_HELP_FORBID
CHAN_SERVADMIN_HELP_SUSPEND
CHAN_SERVADMIN_HELP_UNSUSPEND
CHAN_SERVADMIN_HELP_STATUS
OPER_HELP_MODE
OPER_HELP_CLEARMODES
OPER_HELP_KICK
OPER_HELP_SVSNICK
OPER_HELP_AKILL
OPER_HELP_SGLINE
OPER_HELP_SQLINE
OPER_HELP_SZLINE
OPER_HELP_SET
OPER_HELP_NOOP
OPER_HELP_JUPE
OPER_HELP_RAW
OPER_HELP_UPDATE
OPER_HELP_RELOAD
OPER_HELP_QUIT
OPER_HELP_SHUTDOWN
OPER_HELP_RESTART
OPER_HELP_KILLCLONES
OPER_HELP_CHANLIST
OPER_HELP_USERLIST
OPER_HELP_MODLOAD
OPER_HELP_MODUNLOAD
OPER_HELP_MODINFO
OPER_HELP_MODLIST
BOT_SERVADMIN_HELP_SET_NOBOT
BOT_SERVADMIN_HELP_SET_PRIVATE
HOST_HELP_SET
HOST_HELP_DELALL
HOST_HELP_SETALL
HOST_HELP_DEL
HOST_HELP_LIST
*** Del Strings:
Anope Version 1.7.19
--------------------
*** New Strings:
*** Mod Strings:
CHAN_HELP_LIST
BOT_SET_SYNTAX
BOT_HELP_SET
*** Del Strings:
Anope Version 1.7.18
--------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.17
--------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.16
--------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.15
--------------------
*** New Strings:
INVALID_TARGET
NICK_SET_AUTOOP_SYNTAX
NICK_SET_AUTOOP_ON
NICK_SET_AUTOOP_OFF
BOT_LONG_IDENT
*** Mod Strings:
NICK_HELP_SET
*** Del Strings:
Anope Version 1.7.14
--------------------
*** New Strings:
CHAN_X_INVALID
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.13
--------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.12
--------------------
*** New Strings:
OPER_STATS_UPLINK_SERVER
OPER_STATS_UPLINK_CAPAB
OPER_STATS_UPLINK_SERVER_COUNT
*** Mod Strings:
OPER_HELP_STATS
*** Del Strings:
Anope Version 1.7.11
---------------------
*** New Strings:
NICK_SASET_SYNTAX
NICK_SASET_DISABLED
NICK_SASET_UNKNOWN_OPTION
NICK_SASET_BAD_NICK
NICK_SASET_OPTION_DISABLED
NICK_SASET_DISPLAY_INVALID
NICK_SASET_DISPLAY_CHANGED
NICK_SASET_PASSWORD_FAILED
NICK_SASET_PASSWORD_CHANGED
NICK_SASET_PASSWORD_CHANGED_TO
NICK_SASET_LANGUAGE_SYNTAX
NICK_SASET_LANGUAGE_UNKNOWN
NICK_SASET_LANGUAGE_CHANGED
NICK_SASET_URL_CHANGED
NICK_SASET_URL_UNSET
NICK_SASET_EMAIL_CHANGED
NICK_SASET_EMAIL_UNSET
NICK_SASET_EMAIL_UNSET_IMPOSSIBLE
NICK_SASET_ICQ_CHANGED
NICK_SASET_ICQ_UNSET
NICK_SASET_ICQ_INVALID
NICK_SASET_GREET_CHANGED
NICK_SASET_GREET_UNSET
NICK_SASET_KILL_SYNTAX
NICK_SASET_KILL_IMMED_SYNTAX
NICK_SASET_KILL_ON
NICK_SASET_KILL_QUICK
NICK_SASET_KILL_IMMED
NICK_SASET_KILL_IMMED_DISABLED
NICK_SASET_KILL_OFF
NICK_SASET_SECURE_SYNTAX
NICK_SASET_SECURE_ON
NICK_SASET_SECURE_OFF
NICK_SASET_PRIVATE_SYNTAX
NICK_SASET_PRIVATE_ON
NICK_SASET_PRIVATE_OFF
NICK_SASET_HIDE_SYNTAX
NICK_SASET_HIDE_EMAIL_ON
NICK_SASET_HIDE_EMAIL_OFF
NICK_SASET_HIDE_MASK_ON
NICK_SASET_HIDE_MASK_OFF
NICK_SASET_HIDE_QUIT_ON
NICK_SASET_HIDE_QUIT_OFF
NICK_SASET_HIDE_STATUS_ON
NICK_SASET_HIDE_STATUS_OFF
NICK_SASET_MSG_SYNTAX
NICK_SASET_MSG_ON
NICK_SASET_MSG_OFF
NICK_SASET_NOEXPIRE_SYNTAX
NICK_SASET_NOEXPIRE_ON
NICK_SASET_NOEXPIRE_OFF
NICK_HELP_SASET
NICK_HELP_SASET_DISPLAY
NICK_HELP_SASET_PASSWORD
NICK_HELP_SASET_LANGUAGE
NICK_HELP_SASET_URL
NICK_HELP_SASET_EMAIL
NICK_HELP_SASET_ICQ
NICK_HELP_SASET_GREET
NICK_HELP_SASET_KILL
NICK_HELP_SASET_SECURE
NICK_HELP_SASET_PRIVATE
NICK_HELP_SASET_HIDE
NICK_HELP_SASET_MSG
NICK_HELP_SASET_NOEXPIRE
NICK_HELP_CMD_SASET
*** Mod Strings:
OPER_HELP_MODLIST
*** Del Strings:
NICK_SERVADMIN_HELP_SET
NICK_SERVADMIN_HELP_SET_NOEXPIRE
NICK_SET_NOEXPIRE_SYNTAX
NICK_SET_NOEXPIRE_ON
NICK_SET_NOEXPIRE_OFF
NICK_SASET_LANGUAGE_SYNTAX
NICK_SASET_LANGUAGE_UNKNOWN
NICK_SASET_LANGUAGE_CHANGED
NICK_HELP_SASET_LANGUAGE
Anope Version 1.7.10
--------------------
*** New Strings:
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.9
-------------------
*** New Strings:
CHAN_HELP_IRCD_HALFOP
CHAN_HELP_IRCD_PROTECT
CHAN_GETKEY_SYNTAX
CHAN_GETKEY_NOKEY
CHAN_GETKEY_KEY
OPER_SET_SQL_ERROR_DISABLED
NICK_X_SUSPENDED
NICK_INFO_SUSPENDED
NICK_SUSPEND_SYNTAX
NICK_SUSPEND_SUCCEEDED
NICK_SUSPEND_FAILED
NICK_UNSUSPEND_SYNTAX
NICK_UNSUSPEND_SUCCEEDED
NICK_UNSUSPEND_FAILED
NICK_SERVADMIN_HELP_SUSPEND
NICK_SERVADMIN_HELP_UNSUSPEND
*** Mod Strings:
OPER_HELP_SET
NICK_HELP
CHAN_AOP_CLEAR
CHAN_HOP_CLEAR
CHAN_SOP_CLEAR
CHAN_VOP_CLEAR
CHAN_ACCESS_CLEAR
CHAN_AKICK_CLEAR
CHAN_SET_KEEPTOPIC_ON
CHAN_SET_KEEPTOPIC_OFF
CHAN_SET_TOPICLOCK_ON
CHAN_SET_TOPICLOCK_OFF
CHAN_SET_PEACE_ON
CHAN_SET_PEACE_OFF
CHAN_SET_PRIVATE_ON
CHAN_SET_PRIVATE_OFF
CHAN_SET_SECUREOPS_ON
CHAN_SET_SECUREOPS_OFF
CHAN_SET_SECUREFOUNDER_ON
CHAN_SET_SECUREFOUNDER_OFF
CHAN_SET_RESTRICTED_ON
CHAN_SET_RESTRICTED_OFF
CHAN_SET_SECURE_ON
CHAN_SET_SECURE_OFF
CHAN_SET_SIGNKICK_ON
CHAN_SET_SIGNKICK_LEVEL
CHAN_SET_SIGNKICK_OFF
CHAN_SET_OPNOTICE_ON
CHAN_SET_OPNOTICE_OFF
CHAN_SET_XOP_ON
CHAN_SET_XOP_OFF
*** Del Strings:
CHAN_HELP_ULTIMATE
OPER_STATS_PROXY_MEM
OPER_CACHE_SYNTAX
OPER_CACHE_DISABLED
OPER_CACHE_NOT_FOUND
OPER_CACHE_REMOVED
OPER_CACHE_HEADER
OPER_CACHE_LIST
OPER_CACHE_FOOTER
OPER_CACHE_QUEUED
OPER_CACHE_PROGRESS
OPER_CACHE_NORMAL
OPER_CACHE_WINGATE
OPER_CACHE_SOCKS4
OPER_CACHE_SOCKS5
OPER_CACHE_HTTP
OPER_HELP_CACHE
Anope Version 1.7.8
-------------------
*** New Strings:
OPER_HELP_SET_IGNORE
OPER_HELP_ADMIN_CMD_EXTRA
OPER_HELP_ADMIN_CMD_OLINE
OPER_HELP_ADMIN_CMD_UMODE
OPER_HELP_ADMIN_CMD_SVSNICK
OPER_HELP_OPER_CMD_EXTRA
OPER_HELP_OPER_CMD_SGLINE
OPER_HELP_OPER_CMD_SQLINE
OPER_HELP_OPER_CMD_SZLINE
*** Mod Strings:
HOST_OFF_UNREAL
OPER_HELP_OPER_CMD
OPER_HELP_ADMIN_CMD
*** Del Strings:
Anope Version 1.7.7
-------------------
*** New Strings:
MEMO_NO_RSEND_SELF
NICK_REGISTERED_NO_MASK
OPER_ADMIN_MOVED
OPER_OPER_MOVED
OPER_HELP_SET_SQL
OPER_SET_SQL_ON
OPER_SET_SQL_OFF
OPER_SET_SQL_ERROR
OPER_SET_SQL_ERROR_INIT
OPER_EXCEPTION_EXISTS
OPER_EXCEPTION_CHANGED
OPER_SET_LIST_OPTION_ON
OPER_SET_LIST_OPTION_OFF
OPER_HELP_SET_LIST
OPER_SUPER_ADMIN_NOT_ENABLED
*** Mod Strings:
BOT_SERVADMIN_HELP_BOT
NICK_HELP_STATUS
*** Del Strings:
Anope Version 1.7.6
-------------------
*** New Strings:
CHAN_REGISTER_NONE_CHANNEL
CHAN_SYMBOL_REQUIRED
OPER_SVSNICK_UNSUPPORTED
OPER_SQLINE_UNSUPPORTED
OPER_SVSO_UNSUPPORTED
OPER_UMODE_UNSUPPORTED
CHAN_CLEARED_INVITES
NICK_INFO_VHOST2
NICK_STATUS_0
NICK_STATUS_1
NICK_STATUS_2
NICK_STATUS_3
CHAN_STATUS_SYNTAX
CHAN_STATUS_NOT_REGGED
CHAN_STATUS_FORBIDDEN
CHAN_STATUS_NOTONLINE
CHAN_STATUS_INFO
NICK_INFO_EXPIRE
NICK_GLIST_REPLY
NICK_GLIST_REPLY_ADMIN
CHAN_INFO_EXPIRE
NICK_ACCESS_LIST_EMPTY
NICK_ACCESS_LIST_X_EMPTY
*** Mod Strings:
*** Del Strings:
Anope Version 1.7.5
-------------------
*** New Strings:
*** Mod Strings:
MEMO_HELP
CHAN_LEVEL_NOJOIN
*** Del Strings:
Anope Version 1.7.4
-------------------
*** New Strings:
CHAN_CLEARED_HOPS
OPER_MODULE_LIST_HEADER
OPER_MODULE_LIST_FOOTER
NICK_X_IS_SERVICES
*** Mod Strings:
CHAN_HELP_CLEAR
*** Del Strings:
Anope Version 1.7.3
-------------------
*** New Strings:
MEMO_RSEND_PLEASE_WAIT
MEMO_RSEND_DISABLED
MEMO_RSEND_SYNTAX
MEMO_RSEND_NICK_MEMO_TEXT
MEMO_RSEND_CHAN_MEMO_TEXT
MEMO_RSEND_USER_NOTIFICATION
MEMO_HELP_RSEND
MEMO_CHECK_SYNTAX
MEMO_CHECK_NOT_READ
MEMO_CHECK_READ
MEMO_CHECK_NO_MEMO
MEMO_HELP_CHECK
*** Mod Strings:
MEMO_HELP
NICK_LIST_SERVADMIN_SYNTAX
NICK_SERVADMIN_HELP_LIST
Anope Version 1.7.2
--------------------
No Changes.
Anope Version 1.7.1
--------------------
*** New Strings:
MEMO_SET_NOTIFY_MAIL
MEMO_SET_NOTIFY_NOMAIL
MEMO_SET_NOTIFY_INVALIDMAIL
MEMO_MAIL_SUBJECT
MEMO_MAIL_TEXT1
MEMO_MAIL_TEXT2
MEMO_MAIL_TEXT3
NICK_INFO_SERVICES_ROOT
NICK_SET_HIDE_STATUS_ON
NICK_SET_HIDE_STATUS_OFF
NICK_REG_DELAY
*** Mod Strings:
MEMO_SET_NOTIFY_SYNTAX
NICK_HELP_SET_HIDE
*** Del Strings:
+141
View File
@@ -0,0 +1,141 @@
Anope Version 1.8.3
-------------------
ALTER TABLE `anope_ns_access` DROP INDEX `display` ;
Anope Version 1.8.2
-------------------
- NONE
Anope Version 1.8.1
-------------------
- NONE
Anope Version 1.8.0
-------------------
ALTER TABLE `anope_ns_access` DROP INDEX display;
Anope Version 1.7.24
--------------------
- NONE
Anope Version 1.7.23b
--------------------
- NONE
Anope Version 1.7.23
--------------------
- NONE
Anope Version 1.7.22
--------------------
- NONE
Anope Version 1.7.21
--------------------
- NONE
Anope Version 1.7.20
--------------------
ALTER TABLE `anope_ns_request` DROP INDEX `nick_index` ;
ALTER TABLE `anope_ns_core` DROP INDEX `display_index` ;
ALTER TABLE `anope_ns_access` ADD UNIQUE (`display`) ;
ALTER TABLE `anope_ms_info` ADD UNIQUE (`nm_id` , `serv`) ;
ALTER TABLE `anope_ns_alias` DROP INDEX `nick_index` ;
ALTER TABLE `anope_cs_info` DROP INDEX `name_index` ;
ALTER TABLE `anope_cs_access` ADD UNIQUE (`channel` , `display`) ;
ALTER TABLE `anope_cs_levels` ADD UNIQUE (`channel` , `position`) ;
ALTER TABLE `anope_cs_akicks` CHANGE `dmask` `dmask` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_cs_akicks` ADD UNIQUE (`channel` , `dmask`) ;
ALTER TABLE `anope_cs_badwords` CHANGE `word` `word` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_cs_badwords` ADD UNIQUE (`channel` , `word`) ;
ALTER TABLE `anope_cs_ttb` ADD UNIQUE (`channel` , `ttb_id`) ;
ALTER TABLE `anope_os_akills` CHANGE `user` `user` VARCHAR( 255 ) NOT NULL , CHANGE `host` `host` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_os_akills` ADD UNIQUE (`user` , `host`) ;
ALTER TABLE `anope_os_sglines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_os_sglines` ADD UNIQUE (`mask`) ;
ALTER TABLE `anope_os_sqlines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_os_sqlines` ADD UNIQUE (`mask`) ;
ALTER TABLE `anope_os_szlines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_os_szlines` ADD UNIQUE (`mask`) ;
ALTER TABLE `anope_os_news` ADD UNIQUE (`type` , `num` , `time`) ;
ALTER TABLE `anope_os_exceptions` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_os_exceptions` ADD UNIQUE (`mask`) ;
ALTER TABLE `anope_hs_core` DROP INDEX `nick_index` ;
ALTER TABLE `anope_bs_core` DROP INDEX `nick_index` ;
ALTER TABLE `anope_ms_info` CHANGE `receiver` `receiver` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `anope_ms_info` ADD INDEX ( `receiver` , `serv` ) ;
Anope Version 1.7.19
--------------------
- NONE
Anope Version 1.7.18
--------------------
- DROP TABLE IF EXISTS `anope_os_status`
- ALTER TABLE `anope_bs_core` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_cs_access` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_cs_akicks` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_cs_badwords` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_cs_levels` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_cs_ttb` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_hs_core` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_ms_info` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_ns_access` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_ns_request` CHANGE `active` `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_os_akills` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_os_exceptions` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_os_news` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_os_sglines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_os_sqlines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
- ALTER TABLE `anope_os_szlines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
Anope Version 1.7.17
--------------------
- CREATE TABLE anope_cs_ttb (
ct_id int(11) NOT NULL auto_increment,
channel varchar(255) NOT NULL default '',
ttb_id int(11) NOT NULL default '0',
value int(11) NOT NULL default '0',
PRIMARY KEY (ct_id)
) TYPE=MyISAM
- ALTER TABLE anope_cs_info DROP ttb
Anope Version 1.7.16
--------------------
- NONE
Anope Version 1.7.15
--------------------
- NONE
Anope Version 1.7.14
--------------------
- NONE
Anope Version 1.7.13
--------------------
- NONE
Anope Version 1.7.12
--------------------
- NONE
Anope Version 1.7.11
--------------------
- NONE
Anope Version 1.7.10
--------------------
- NONE
Anope Version 1.7.9
-------------------
- DROP TABLE IF EXISTS anope_os_cache
Anope Version 1.7.8
-------------------
- NONE
Anope Version 1.7.7
-------------------
- ALTER TABLE anope_ns_alias CHANGE status status int(11) unsigned NOT NULL default '0'
+176 -275
View File
@@ -14,133 +14,73 @@
###########################################################################
echo2 () {
$ECHO2 "$*$ECHO2SUF" # these are defined later
$ECHO2 "$*$ECHO2SUF" # these are defined later
}
exists () { # because some shells don't have test -e
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
return 0
else
return 1
fi
exists () { # because some shells don't have test -e
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
return 0
else
return 1
fi
}
Load_Cache () {
if [ -f $SOURCE_DIR/config.cache -a -r $SOURCE_DIR/config.cache -a ! "$IGNORE_CACHE" ] ; then
echo "Using defaults from config.cache. To ignore, $SOURCE_DIR/Config -nocache"
echo ""
. $SOURCE_DIR/config.cache
CAN_QUICK="yes"
else
CAN_QUICK="no"
fi
if [ -f config.cache -a -r config.cache -a ! "$IGNORE_CACHE" ] ; then
echo "Using defaults from config.cache. To ignore, ./Config -nocache"
echo ""
. config.cache
CAN_QUICK="yes"
else
CAN_QUICK="no"
fi
}
Run_Build_System () {
WITH_INST=""
WITH_RUN=""
WITH_PERM=""
BUILD_TYPE=""
RUN_CC_PL=""
GEN_TYPE=""
Run_Configure () {
WITH_BIN=""
WITH_DATA=""
WITH_ENC=""
WITH_RUN=""
WITH_PERM=""
WITH_MYSQL=""
if [ "$INSTDIR" != "" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
else
WITH_INST="--with-instdir=$INSTDIR"
fi
fi
if [ "$BINDEST" != "" ] ; then
WITH_BIN=" --with-bindir=$BINDEST"
WITH_DATA=" --with-datadir=$DATDEST"
fi
if [ "$RUNGROUP" != "" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
else
WITH_RUN="--with-rungroup=$RUNGROUP"
fi
fi
if [ "$DATDEST" != "" ] ; then
WITH_DATA=" --with-datadir=$DATDEST"
fi
if [ "$UMASK" != "" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
else
WITH_PERM="--with-permissions=$UMASK"
fi
fi
if [ "$RUNGROUP" != "" ] ; then
WITH_RUN=" --with-rungroup=$RUNGROUP"
fi
if [ "$DEBUG" = "yes" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
else
BUILD_TYPE="--with-debugsym"
fi
else
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
fi
fi
if [ "$UMASK" != "" ] ; then
WITH_PERM=" --with-permissions=$UMASK"
fi
if [ "$USE_RUN_CC_PL" = "yes" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
else
pwdsave=`pwd`
cd "`dirname $SOURCE_DIR/run-cc.pl`"
RUN_CC_PL="--with-makebin=`pwd`/run-cc.pl"
cd "$pwdsave"
fi
else
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
else
RUN_CC_PL="--with-makebin="
fi
fi
if [ "$MYSQL" != "yes" ] ; then
WITH_MYSQL=" --without-mysql"
fi
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
case `uname -s` in
MINGW*)
GEN_TYPE="-G\"MSYS Makefiles\""
;;
esac
if [ "$SOURCE_DIR" = "." ] ; then
pwdsave=`pwd`
test -d build || mkdir build
cd "build"
REAL_SOURCE_DIR=".."
else
REAL_SOURCE_DIR="$SOURCE_DIR"
fi
echo "./configure $WITH_BIN $WITH_DATA $WITH_ENC $WITH_RUN $WITH_PERM $WITH_MYSQL"
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
echo ""
if [ "$SOURCE_DIR" = "." ] ; then
echo "Now cd build, then run make to build Anope."
cd "$pwdsave"
else
echo "Now run make to build Anope."
fi
else
echo "./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_CONFIG_ARGS $RUN_CC_PL"
./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_CONFIG_ARGS $RUN_CC_PL
fi
./configure $WITH_BIN $WITH_DATA $WITH_ENC $WITH_RUN $WITH_PERM $WITH_MYSQL
}
ECHO2SUF=''
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
ECHO2='echo -n'
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
ECHO2='echo' ; ECHO2SUF='\c'
ECHO2='echo' ; ECHO2SUF='\c'
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
ECHO2='printf "%s"'
ECHO2='printf "%s"'
else
# oh well...
ECHO2='echo'
# oh well...
ECHO2='echo'
fi
export ECHO2 ECHO2SUF
@@ -148,68 +88,50 @@ export ECHO2 ECHO2SUF
# Init values
###########################################################################
BUILD_SYSTEM="cmake"
INSTDIR=$HOME/services
BINDEST=$HOME/services
DATDEST=$HOME/services
RUNGROUP=
UMASK=
DEBUG="yes"
USE_RUN_CC_PL="no"
EXTRA_CONFIG_ARGS=
IRCTYPE="no default"
CAN_QUICK="no"
SOURCE_DIR=`dirname $0`
which cmake > /dev/null
if [ $? -ne 0 ] ; then
BUILD_SYSTEM="configure"
fi
###########################################################################
# Check out the options
###########################################################################
while [ $# -ge 1 ] ; do
if [ $1 = "--help" ] ; then
echo "Config utility for Anope"
echo "------------------------"
echo "Syntax: ./Config [options]"
echo "-nocache Ignore settings saved in config.cache"
echo "-nointro Skip intro (disclaimer, etc)"
echo "-quick Skip questions, go straight to cmake"
exit 0
elif [ $1 = "-nocache" ] ; then
IGNORE_CACHE="1"
elif [ $1 = "-nointro" ] ; then
NO_INTRO="1"
elif [ $1 = "-quick" -o $1 = "-q" ] ; then
Load_Cache
if [ "$CAN_QUICK" = "yes" ] ; then
Run_Build_System
else
echo ""
echo "Can't find cache file (config.cache), aborting..."
fi
exit 0
fi
shift 1
if [ $1 = "--help" ] ; then
echo "Config utility for Anope"
echo "------------------------"
echo "Syntax: ./Config [options]"
echo "-nocache Ignore settings saved in config.cache"
echo "-nointro Skip intro (disclaimer, etc)"
echo "-quick Skip questions, go straight to configure"
exit 0
elif [ $1 = "-nocache" ] ; then
IGNORE_CACHE="1"
elif [ $1 = "-nointro" ] ; then
NO_INTRO="1"
elif [ $1 = "-quick" -o $1 = "-q" ] ; then
Load_Cache
if [ $CAN_QUICK = "yes" ] ; then
Run_Configure
else
echo ""
echo "Can't find cache file (config.cache), aborting..."
fi
exit 0
fi
shift 1
done
###########################################################################
if [ ! "$NO_INTRO" ] ; then
case `uname -s` in
MINGW*)
PAGER=less
;;
*)
PAGER=more
clear
;;
esac
. $SOURCE_DIR/version.log
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
echo ""
clear
. ./version.log
cat .BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | more
echo ""
else
echo ""
echo ""
fi
echo "Beginning Services configuration."
@@ -218,9 +140,8 @@ echo ""
###########################################################################
# Load the cache
###########################################################################
if [ ! "$IGNORE_CACHE" ] ; then
Load_Cache
Load_Cache
fi
# Ask the user anything we need to know ahead of time.
@@ -231,41 +152,12 @@ export ok INPUT
ok=0
echo "Note: press Return for the default, or enter a new value."
echo "Are you using configure or cmake?"
while [ $ok -eq 0 ] ; do
echo2 "[$BUILD_SYSTEM] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$BUILD_SYSTEM
fi
case $INPUT in
cmake)
ok=1
;;
configure)
ok=1
;;
*)
echo "That is not a valid choice!"
ok=0
;;
esac
done
BUILD_SYSTEM=$INPUT
echo ""
if [ "$SOURCE_DIR" != "." -a "$BUILD_SYSTEM" = "configure" ] ; then
echo "You can not use configure unless you are in the same folder as Config!"
exit 0
fi
ok=0
echo "In what directory do you want the binaries to be installed?"
while [ $ok -eq 0 ] ; do
echo2 "[$INSTDIR] "
echo2 "[$BINDEST] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$INSTDIR
INPUT=$BINDEST
fi
if [ ! -d "$INPUT" ] ; then
if exists "$INPUT" ; then
@@ -286,139 +178,148 @@ while [ $ok -eq 0 ] ; do
ok=1
fi
done
INSTDIR=$INPUT
BINDEST=$INPUT
DATDEST=$INPUT
echo ""
####
ok=0
echo "Where do you want the data files to be installed?"
while [ $ok -eq 0 ] ; do
echo2 "[$DATDEST] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$DATDEST
fi
if [ ! -d "$INPUT" ] ; then
if exists "$INPUT" ; then
echo "$INPUT exists, but is not a directory!"
else
echo "$INPUT does not exist. Create it?"
echo2 "[y] "
read YN
if [ "$YN" != "n" ] ; then
if mkdir -p $INPUT ; then
ok=1
fi
fi
fi
elif exists "$INPUT/include/services.h" ; then
echo "You cannot use the Services source directory as a target directory."
else
ok=1
fi
done
DATDEST=$INPUT
echo ""
####
OLD_RUNGROUP="$RUNGROUP"
if [ "$RUNGROUP" ] ; then
echo "Which group should all Services data files be owned by? (If Services"
echo "should not force files to be owned by a particular group, type \"none\""
echo "(without the quotes) and press Return.)"
echo "Which group should all Services data files be owned by? (If Services"
echo "should not force files to be owned by a particular group, type "\"none\"
echo "(without the quotes) and press Return.)"
else
echo "Which group should all Services data files be owned by? (If Services"
echo "should not force files to be owned by a particular group, just press"
echo "Return.)"
echo "Which group should all Services data files be owned by? (If Services"
echo "should not force files to be owned by a particular group, just press"
echo "Return.)"
fi
echo2 "[$RUNGROUP] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
if [ "$INPUT" = "none" ] ; then
RUNGROUP=""
else
RUNGROUP="$INPUT"
fi
if [ "$INPUT" = "none" ] ; then
RUNGROUP=""
else
RUNGROUP="$INPUT"
fi
fi
echo ""
####
if [ ! "$UMASK" -o "$RUNGROUP" != "$OLD_RUNGROUP" ] ; then
if [ "$RUNGROUP" ] ; then
UMASK=007
else
UMASK=077
fi
if [ "$RUNGROUP" ] ; then
UMASK=007
else
UMASK=077
fi
fi
ok=0
echo "What should the default umask for data files be (in octal)?"
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
while [ $ok -eq 0 ] ; do
echo2 "[$UMASK] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$UMASK
fi
if [ `echo "$INPUT" | grep -c '[^0-7]'` -gt 0 ] ; then
echo "$UMASK is not a valid octal number!"
else
if [ "`echo $INPUT | cut -c1`" != "0" ] ; then
INPUT=0$INPUT
fi
ok=1
fi
echo2 "[$UMASK] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$UMASK
fi
if [ `echo "$INPUT" | grep -c '[^0-7]'` -gt 0 ] ; then
echo "$UMASK is not a valid octal number!"
else
if [ "`echo $INPUT | cut -c1`" != "0" ] ; then
INPUT=0$INPUT
fi
ok=1
fi
done
UMASK=$INPUT
echo ""
####
TEMP_YN="n"
if [ "$DEBUG" = "yes" ] ; then
TEMP_YN="y"
fi
echo "Would you like to build a debug version of Anope?"
echo2 "[$TEMP_YN] "
read YN
if [ "$YN" ] ; then
if [ "$YN" = "y" ] ; then
DEBUG="yes"
else
DEBUG="no"
fi
fi
ok=0
DEF=yes
echo "Allow anope to automatically check for mysql libaries?"
echo "unless you get errors with make, there is no need to"
echo "change this setting."
while [ $ok -eq 0 ] ; do
echo2 "[$DEF] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$DEF
fi
case $INPUT in
n*|N*)
MYSQL=
ok=1
;;
y*|Y*)
MYSQL="yes"
ok=1
;;
*)
echo "Please enter 'yes' or 'no'."
;;
esac
done
echo ""
####
TEMP_YN="n"
if [ "$USE_RUN_CC_PL" = "yes" ] ; then
TEMP_YN="y"
fi
echo "You can optionally have the build run through run-cc.pl, which will"
echo "cause warnings and errors (if any) to be colored yellow and red,"
echo "respectively. This relies on Perl being installed, so if you say yes"
echo "to this without Perl, the option will be ignored."
echo "NOTE: If you are using MinGW, it is NOT recommended to say yes to"
echo "this, it may fail."
echo "Would you like to utilize run-cc.pl?"
echo2 "[$TEMP_YN] "
read YN
if [ "$YN" ] ; then
if [ "$YN" = "y" ] ; then
USE_RUN_CC_PL="yes"
else
USE_RUN_CC_PL="no"
fi
fi
echo ""
####
echo "Are there any extra arguments you wish to pass to $BUILD_SYSTEM?"
echo "(You may only need to do this if $BUILD_SYSTEM is unable to locate"
echo "missing dependencies without hints)"
echo2 "[$EXTRA_CONFIG_ARGS] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
EXTRA_CONFIG_ARGS=$INPUT
fi
echo ""
####
################################################################################
# Store values
################################################################################
echo2 "Saving configuration results in config.cache... "
cat <<EOT >$SOURCE_DIR/config.cache
BUILD_SYSTEM="$BUILD_SYSTEM"
INSTDIR="$INSTDIR"
cat <<EOT >config.cache
BINDEST="$BINDEST"
DATDEST="$DATDEST"
RUNGROUP="$RUNGROUP"
UMASK=$UMASK
DEBUG="$DEBUG"
USE_RUN_CC_PL="$USE_RUN_CC_PL"
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
IRCTYPE="$IRCTYPE"
IRCTYPE_DEF="$IRCTYPE_DEF"
MYSQL="$MYSQL"
EOT
echo "done."
################################################################################
# Build the build system string
# Build the configure string
################################################################################
Run_Build_System
Run_Configure
+2 -2
View File
@@ -1,3 +1,3 @@
@echo off
cscript /nologo "%~dp0\install.js"
pause
cscript /nologo install.js
+69 -41
View File
@@ -1,103 +1,131 @@
CC=g++ # probably wrong but oh well.
CC=@CC@
INCLUDEDIR=../include
ANOPELIBS=@ANOPELIBS@
CFLAGS=@CFLAGS@ -Wall -ansi -pedantic -Wshadow
CFLAGS=@CFLAGS@
STRICT=-Wall -ansi -pedantic
PROFILE=-pg
LDPROFILE=
SHELL=/bin/sh
INSTDIR=@INSTDIR@
MAKEBIN=@MAKEBIN@
MYSQLDIR=@MYSQLDIR@
SUBDIRS=src
BINDEST=@BINDEST@
DATDEST=@DATDEST@
INSTALL=@INSTALL@
RM=@RM@
CP=@CP@
TOUCH=@TOUCH@
MODULE_PATH=@MODULE_PATH@
MYSQL=@MYSQL@
RDB=@RDB@
LDFLAGS=@LDFLAGS@
RUNGROUP=@RUNGROUP@
SHARED=@SHARED@
MODULEFLAGS=@MODULEFLAGS@
all: language headers build core protocols tools modules
all: language headers build core protocols tools modules
strict: language headers strict_build strict_core strict_protocols strict_tools strict_modules
profile: language headers profile_build profile_core profile_protocols profile_tools profile_modules
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'LDFLAGS=${LDFLAGS}' 'BINDEST=${BINDEST}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' \
'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' \
'MAKEBIN=${MAKEBIN}' 'MYSQLDIR=${MYSQLDIR}'
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \
'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' 'RDB=${RDB}'\
'MYSQL=${MYSQL}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}'
build: language headers
@${MAKE} -C src ${MAKEARGS} all
@for i in $(SUBDIRS); do \
echo "*** Building $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} all; ) \
done
strict_build:
@for i in $(SUBDIRS); do \
echo "*** Strict Building $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} $(STRICT)' all; ) \
done
profile_build:
@${MAKE} -C src ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' 'LDFLAGS=${LDFLAGS} ${PROFILE}' all
@for i in $(SUBDIRS); do \
echo "*** Strict Building $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' 'LDFLAGS=${LDFLAGS} ${PROFILE}' all; ) \
done
modules: build
@src/modules/configure src/modules
@${MAKE} -C src/modules ${MAKEARGS} all
(cd src/modules ; ./configure ; ${MAKE} ${MAKEARGS} all; )
@echo "*** All done, now (g)make install to install Anope/Modules";
clean_modules:
@${MAKE} -C src ${MAKEARGS} clean_modules
(cd src ; ${MAKE} ${MAKEARGS} clean_modules )
distclean_modules:
@${MAKE} -C src ${MAKEARGS} distclean_modules
(cd src ; ${MAKE} ${MAKEARGS} distclean_modules )
protocols: build
@echo "*** Building protocol support";
@src/protocol/configure src/protocol
@${MAKE} -C src/protocol ${MAKEARGS} all
(cd src/protocol ; ./configure ; ${MAKE} ${MAKEARGS} all; )
strict_protocols: build
@echo "*** Building protocol support";
(cd src/protocol ; ./configure ; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} $(STRICT)' all; )
profile_protocols: build
@echo "*** Building protocol support";
@src/protocol/configure src/protocol
@${MAKE} -C src/protocol ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all
(cd src/protocol ; ./configure ; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all; )
core: build
core: build
@echo "*** Building Core modules";
@${MAKE} -C src ${MAKEARGS} core
(cd src/ ; ${MAKE} ${MAKEARGS} core; )
profile_core: build
strict_core: build
@echo "*** Building Core modules";
@${MAKE} -C src ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' core
(cd src/ ; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} $(STRICT)' core; )
profile_core: build
@echo "*** Building Core modules";
(cd src/ ; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' core; )
tools: build
@${MAKE} -C src/tools ${MAKEARGS} all
(cd src/tools ; ${MAKE} ${MAKEARGS} all; )
@echo "*** All done, now (g)make install to install Anope/Modules/Tools";
strict_tools: strict_build
(cd src/tools ; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} $(STRICT)' all; )
@echo "*** All done, now (g)make install to install Anope/Modules/Tools";
profile_tools: profile_build
@${MAKE} -C src/tools ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' all
(cd src/tools ; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' all; )
@echo "*** All done, now (g)make install to install Anope/Modules/Tools";
strict_modules: strict_build
(cd src/modules ; ./configure ; ${MAKE} ${MAKEARGS} 'CFLAGS=$(CFLAGS) $(STRICT)' all; )
@echo "*** All done, now (g)make install to install Anope/Modules";
profile_modules: profile_build
@src/modules/configure src/modules
@${MAKE} -C src/modules ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all
(cd src/modules ; ./configure ; ${MAKE} ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all; )
@echo "*** All done, now (g)make install to install Anope/Modules";
language:
@$(MAKE) -C lang ${MAKEARGS} all language.h
(cd lang ; $(MAKE) ${MAKEARGS} all language.h ; )
headers:
@${MAKE} -C include ${MAKEARGS}
(cd include ; ${MAKE} ${MAKEARGS} )
clean:
${MAKE} -C lang ${MAKEARGS} clean
${MAKE} -C include ${MAKEARGS} clean
${MAKE} -C src ${MAKEARGS} clean
${MAKE} -C src/tools ${MAKEARGS} clean
(cd lang ; ${MAKE} ${MAKEARGS} clean )
(cd include ; ${MAKE} ${MAKEARGS} clean )
(cd src ; ${MAKE} ${MAKEARGS} clean )
(cd src/tools ; ${MAKE} ${MAKEARGS} clean )
distclean: clean
${MAKE} -C lang ${MAKEARGS} distclean
${MAKE} -C include ${MAKEARGS} distclean
${MAKE} -C src ${MAKEARGS} distclean
${MAKE} -C src/tools ${MAKEARGS} distclean
(cd lang ; ${MAKE} distclean )
(cd include ; ${MAKE} distclean )
(cd src ; ${MAKE} distclean )
(cd src/tools ; ${MAKE} distclean )
rm -f config.log config.status config.cache Makefile src/bin/anoperc
install: DUMMY
${MAKE} -C src ${MAKEARGS} install
${MAKE} -C src/tools ${MAKEARGS} install
(cd src ; ${MAKE} ${MAKEARGS} install)
(cd src/tools ; ${MAKE} ${MAKEARGS} install)
@echo "*** All done, Anope is now installed. Please read docs/INSTALL for details on what to do now.";
DUMMY:
+96
View File
@@ -0,0 +1,96 @@
# Makefile for Anope.
#
# (C) 2003-2010 Anope Team
# Contact us at team@anope.org
#
# This program is free but copyrighted software; see the file COPYING for
# details.
#
# Based on the original code of Epona by Lara.
# Based on the original code of Services by Andy Church.
include Makefile.inc.win32
###########################################################################
all: src core protocols languages tools modules install
src: include\version.h include\sysconf.h include\language.h include\sysconf.h
cd src && $(MAKE) && cd ..
install:
-@mkdir $(DATDEST)\backups
-@mkdir $(DATDEST)\logs
-@mkdir $(DATDEST)\languages
cd lang && $(MAKE) install && cd ..
cd src && $(MAKE) install && cd ..
cd src\modules && $(MAKE) install && cd ..
cd src\modules && $(MAKE) subs-install && cd ..
cd src\protocol && $(MAKE) install && cd ..
cd src\core && $(MAKE) install && cd ..
cd src\tools && $(MAKE) install && cd ..
-@echo ---
-@echo Anope has been installed successfully!
-@echo See docs\INSTALL for details on how to configure Anope for use.
-@echo ---
spotless:
cd lang && $(MAKE) spotless && cd ..
cd src && $(MAKE) spotless && cd ..
cd src\modules && $(MAKE) spotless && cd ..\..
cd src\protocol && $(MAKE) spotless && cd ..\..
cd src\core && $(MAKE) spotless && cd ..\..
cd src\tools && $(MAKE) spotless && cd ..\..
-@erase include\language.h include\version.h *.manifest *~ anope.exe version.sh.exe *.obj anopesmtp.exe
-@echo --
-@echo NOTICE:
-@echo You will need to run cscript /nologo install.js again
-@echo --
mypasql:
$(MYPASQL_BUILD)
distclean: spotless
clean: spotless
###########################################################################
languages: FRC
cd lang && $(MAKE) && cd ..
tools: FRC
cd src\tools && $(MAKE) && cd ..\..
core: FRC
cd src\core && $(MAKE) && cd ..\..
protocols: FRC
cd src\protocol && $(MAKE) && cd ..\..
modules: FRC
cd src\modules && $(MAKE) && cd ..\..
###########################################################################
include\sysconf.h:
copy include\sysconf.h.win32 include\sysconf.h
lang\language.h: lang\Makefile lang\index
cd lang && $(MAKE) language.h && cd ..
lang\index:
cd lang && $(MAKE) index && cd ..
include\language.h: lang\language.h
cd lang && copy language.h ..\include\language.h && cd ..
include\version.h: version.sh.exe version.log include\services.h include\pseudo.h include\messages.h
version.sh.exe
move version.h include\version.h
version.sh.exe:
$(CC) $(BASE_CFLAGS) include\version.sh.c /link $(LFLAGS)
FRC:
-825
View File
@@ -1,825 +0,0 @@
; CPack install script designed for a nmake build
;--------------------------------
; You must define these values
!define VERSION "@CPACK_PACKAGE_VERSION@"
!define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@"
;--------------------------------
;Variables
Var MUI_TEMP
Var STARTMENU_FOLDER
Var SV_ALLUSERS
Var START_MENU
Var DO_NOT_ADD_TO_PATH
Var ADD_TO_PATH_ALL_USERS
Var ADD_TO_PATH_CURRENT_USER
Var INSTALL_DESKTOP
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
;Default installation folder
InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
;--------------------------------
;General
;Name and file
Name "@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@"
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
;Set compression
SetCompressor @CPACK_NSIS_COMPRESSOR@
@CPACK_NSIS_DEFINES@
!include Sections.nsh
;--- Component support macros: ---
; The code for the add/remove functionality is from:
; http://nsis.sourceforge.net/Add/Remove_Functionality
; It has been modified slightly and extended to provide
; inter-component dependencies.
Var AR_SecFlags
Var AR_RegFlags
@CPACK_NSIS_SECTION_SELECTED_VARS@
; Loads the "selected" flag for the section named SecName into the
; variable VarName.
!macro LoadSectionSelectedIntoVar SecName VarName
SectionGetFlags ${${SecName}} $${VarName}
IntOp $${VarName} $${VarName} & ${SF_SELECTED} ;Turn off all other bits
!macroend
; Loads the value of a variable... can we get around this?
!macro LoadVar VarName
IntOp $R0 0 + $${VarName}
!macroend
; Sets the value of a variable
!macro StoreVar VarName IntValue
IntOp $${VarName} 0 + ${IntValue}
!macroend
!macro InitSection SecName
; This macro reads component installed flag from the registry and
;changes checked state of the section on the components page.
;Input: section index constant name specified in Section command.
ClearErrors
;Reading component status from registry
ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed"
IfErrors "default_${SecName}"
;Status will stay default if registry value not found
;(component was never installed)
IntOp $AR_RegFlags $AR_RegFlags & ${SF_SELECTED} ;Turn off all other bits
SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags
IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off
IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit
; Note whether this component was installed before
!insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags
IntOp $R0 $AR_RegFlags & $AR_RegFlags
;Writing modified flags
SectionSetFlags ${${SecName}} $AR_SecFlags
"default_${SecName}:"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
!macroend
!macro FinishSection SecName
; This macro reads section flag set by user and removes the section
;if it is not selected.
;Then it writes component installed flag to registry
;Input: section index constant name specified in Section command.
SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags
;Checking lowest bit:
IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED}
IntCmp $AR_SecFlags 1 "leave_${SecName}"
;Section is not selected:
;Calling Section uninstall macro and writing zero installed flag
!insertmacro "Remove_${${SecName}}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
"Installed" 0
Goto "exit_${SecName}"
"leave_${SecName}:"
;Section is selected:
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
"Installed" 1
"exit_${SecName}:"
!macroend
!macro RemoveSection SecName
; This macro is used to call section's Remove_... macro
;from the uninstaller.
;Input: section index constant name specified in Section command.
!insertmacro "Remove_${${SecName}}"
!macroend
; Determine whether the selection of SecName changed
!macro MaybeSelectionChanged SecName
!insertmacro LoadVar ${SecName}_selected
SectionGetFlags ${${SecName}} $R1
IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits
; See if the status has changed:
IntCmp $R0 $R1 "${SecName}_unchanged"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected"
!insertmacro "Deselect_required_by_${SecName}"
goto "${SecName}_unchanged"
"${SecName}_was_selected:"
!insertmacro "Select_${SecName}_depends"
"${SecName}_unchanged:"
!macroend
;--- End of Add/Remove macros ---
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;----------------------------------------
; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02"
;----------------------------------------
!verbose 3
!include "WinMessages.NSH"
!verbose 4
;====================================================
; get_NT_environment
; Returns: the selected environment
; Output : head of the stack
;====================================================
!macro select_NT_profile UN
Function ${UN}select_NT_profile
StrCmp $ADD_TO_PATH_ALL_USERS "1" 0 environment_single
DetailPrint "Selected environment for all users"
Push "all"
Return
environment_single:
DetailPrint "Selected environment for current user only."
Push "current"
Return
FunctionEnd
!macroend
!insertmacro select_NT_profile ""
!insertmacro select_NT_profile "un."
;----------------------------------------------------
!define NT_current_env 'HKCU "Environment"'
!define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!ifndef WriteEnvStr_RegKey
!ifdef ALL_USERS
!define WriteEnvStr_RegKey \
'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!else
!define WriteEnvStr_RegKey 'HKCU "Environment"'
!endif
!endif
; AddToPath - Adds the given dir to the search path.
; Input - head of the stack
; Note - Win9x systems requires reboot
Function AddToPath
Exch $0
Push $1
Push $2
Push $3
# don't add if the path doesn't exist
IfFileExists "$0\*.*" "" AddToPath_done
ReadEnvStr $1 PATH
Push "$1;"
Push "$0;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
Push "$1;"
Push "$0\;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
GetFullPathName /SHORT $3 $0
Push "$1;"
Push "$3;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
Push "$1;"
Push "$3\;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
Call IsNT
Pop $1
StrCmp $1 1 AddToPath_NT
; Not on NT
StrCpy $1 $WINDIR 2
FileOpen $1 "$1\autoexec.bat" a
FileSeek $1 -1 END
FileReadByte $1 $2
IntCmp $2 26 0 +2 +2 # DOS EOF
FileSeek $1 -1 END # write over EOF
FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
FileClose $1
SetRebootFlag true
Goto AddToPath_done
AddToPath_NT:
ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
StrCmp $1 "" AddToPath_NTdoIt
Push $1
Call Trim
Pop $1
StrCpy $0 "$1;$0"
AddToPath_NTdoIt:
WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
AddToPath_done:
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
; RemoveFromPath - Remove a given dir from the path
; Input: head of the stack
Function un.RemoveFromPath
Exch $0
Push $1
Push $2
Push $3
Push $4
Push $5
Push $6
IntFmt $6 "%c" 26 # DOS EOF
Call un.IsNT
Pop $1
StrCmp $1 1 unRemoveFromPath_NT
; Not on NT
StrCpy $1 $WINDIR 2
FileOpen $1 "$1\autoexec.bat" r
GetTempFileName $4
FileOpen $2 $4 w
GetFullPathName /SHORT $0 $0
StrCpy $0 "SET PATH=%PATH%;$0"
Goto unRemoveFromPath_dosLoop
unRemoveFromPath_dosLoop:
FileRead $1 $3
StrCpy $5 $3 1 -1 # read last char
StrCmp $5 $6 0 +2 # if DOS EOF
StrCpy $3 $3 -1 # remove DOS EOF so we can compare
StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
StrCmp $3 "" unRemoveFromPath_dosLoopEnd
FileWrite $2 $3
Goto unRemoveFromPath_dosLoop
unRemoveFromPath_dosLoopRemoveLine:
SetRebootFlag true
Goto unRemoveFromPath_dosLoop
unRemoveFromPath_dosLoopEnd:
FileClose $2
FileClose $1
StrCpy $1 $WINDIR 2
Delete "$1\autoexec.bat"
CopyFiles /SILENT $4 "$1\autoexec.bat"
Delete $4
Goto unRemoveFromPath_done
unRemoveFromPath_NT:
ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
StrCpy $5 $1 1 -1 # copy last char
StrCmp $5 ";" +2 # if last char != ;
StrCpy $1 "$1;" # append ;
Push $1
Push "$0;"
Call un.StrStr ; Find `$0;` in $1
Pop $2 ; pos of our dir
StrCmp $2 "" unRemoveFromPath_done
; else, it is in path
# $0 - path to add
# $1 - path var
StrLen $3 "$0;"
StrLen $4 $2
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
StrCpy $3 $5$6
StrCpy $5 $3 1 -1 # copy last char
StrCmp $5 ";" 0 +2 # if last char == ;
StrCpy $3 $3 -1 # remove last char
WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
unRemoveFromPath_done:
Pop $6
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Uninstall sutff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
###########################################
# Utility Functions #
###########################################
;====================================================
; IsNT - Returns 1 if the current system is NT, 0
; otherwise.
; Output: head of the stack
;====================================================
; IsNT
; no input
; output, top of the stack = 1 if NT or 0 if not
;
; Usage:
; Call IsNT
; Pop $R0
; ($R0 at this point is 1 or 0)
!macro IsNT un
Function ${un}IsNT
Push $0
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCmp $0 "" 0 IsNT_yes
; we are not NT.
Pop $0
Push 0
Return
IsNT_yes:
; NT!!!
Pop $0
Push 1
FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."
; StrStr
; input, top of stack = string to search for
; top of stack-1 = string to search in
; output, top of stack (replaces with the portion of the string remaining)
; modifies no other variables.
;
; Usage:
; Push "this is a long ass string"
; Push "ass"
; Call StrStr
; Pop $R0
; ($R0 at this point is "ass string")
!macro StrStr un
Function ${un}StrStr
Exch $R1 ; st=haystack,old$R1, $R1=needle
Exch ; st=old$R1,haystack
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
Push $R3
Push $R4
Push $R5
StrLen $R3 $R1
StrCpy $R4 0
; $R1=needle
; $R2=haystack
; $R3=len(needle)
; $R4=cnt
; $R5=tmp
loop:
StrCpy $R5 $R2 $R3 $R4
StrCmp $R5 $R1 done
StrCmp $R5 "" done
IntOp $R4 $R4 + 1
Goto loop
done:
StrCpy $R1 $R2 "" $R4
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Exch $R1
FunctionEnd
!macroend
!insertmacro StrStr ""
!insertmacro StrStr "un."
Function Trim ; Added by Pelaca
Exch $R1
Push $R2
Loop:
StrCpy $R2 "$R1" 1 -1
StrCmp "$R2" " " RTrim
StrCmp "$R2" "$\n" RTrim
StrCmp "$R2" "$\r" RTrim
StrCmp "$R2" ";" RTrim
GoTo Done
RTrim:
StrCpy $R1 "$R1" -1
Goto Loop
Done:
Pop $R2
Exch $R1
FunctionEnd
Function ConditionalAddToRegisty
Pop $0
Pop $1
StrCmp "$0" "" ConditionalAddToRegisty_EmptyString
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \
"$1" "$0"
;MessageBox MB_OK "Set Registry: '$1' to '$0'"
DetailPrint "Set install registry entry: '$1' to '$0'"
ConditionalAddToRegisty_EmptyString:
FunctionEnd
;--------------------------------
!ifdef CPACK_USES_DOWNLOAD
Function DownloadFile
IfFileExists $INSTDIR\* +2
CreateDirectory $INSTDIR
Pop $0
; Skip if already downloaded
IfFileExists $INSTDIR\$0 0 +2
Return
StrCpy $1 "@CPACK_DOWNLOAD_SITE@"
try_again:
NSISdl::download "$1/$0" "$INSTDIR\$0"
Pop $1
StrCmp $1 "success" success
StrCmp $1 "Cancelled" cancel
MessageBox MB_OK "Download failed: $1"
cancel:
Return
success:
FunctionEnd
!endif
;--------------------------------
; Installation types
@CPACK_NSIS_INSTALLATION_TYPES@
;--------------------------------
; Component sections
@CPACK_NSIS_COMPONENT_SECTIONS@
;--------------------------------
; Define some macro setting for the gui
@CPACK_NSIS_INSTALLER_MUI_ICON_CODE@
@CPACK_NSIS_INSTALLER_ICON_CODE@
@CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@
;--------------------------------
;Pages
!define MUI_LANGDLL_REGISTRY_ROOT "SHCTX"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
@CPACK_NSIS_PAGE_COMPONENTS@
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "Spanish"
;--------------------------------
;Installer Sections
Section "-Core installation"
;Use the entire tree produced by the INSTALL target. Keep the
;list of directories here in sync with the RMDir commands below.
SetOutPath "$INSTDIR"
@CPACK_NSIS_FULL_INSTALL@
;Store installation folder
WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
Push "DisplayName"
Push "@CPACK_NSIS_DISPLAY_NAME@"
Call ConditionalAddToRegisty
Push "DisplayVersion"
Push "@CPACK_PACKAGE_VERSION@"
Call ConditionalAddToRegisty
Push "Publisher"
Push "@CPACK_PACKAGE_VENDOR@"
Call ConditionalAddToRegisty
Push "UninstallString"
Push "$INSTDIR\Uninstall.exe"
Call ConditionalAddToRegisty
Push "NoRepair"
Push "1"
Call ConditionalAddToRegisty
!ifdef CPACK_NSIS_ADD_REMOVE
;Create add/remove functionality
Push "ModifyPath"
Push "$INSTDIR\AddRemove.exe"
Call ConditionalAddToRegisty
!else
Push "NoModify"
Push "1"
Call ConditionalAddToRegisty
!endif
; Optional registration
Push "DisplayIcon"
Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
Call ConditionalAddToRegisty
Push "HelpLink"
Push "@CPACK_NSIS_HELP_LINK@"
Call ConditionalAddToRegisty
Push "URLInfoAbout"
Push "@CPACK_NSIS_URL_INFO_ABOUT@"
Call ConditionalAddToRegisty
Push "Contact"
Push "@CPACK_NSIS_CONTACT@"
Call ConditionalAddToRegisty
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
@CPACK_NSIS_CREATE_ICONS@
@CPACK_NSIS_CREATE_ICONS_EXTRA@
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
; Write special uninstall registry entries
Push "StartMenu"
Push "$STARTMENU_FOLDER"
Call ConditionalAddToRegisty
Push "DoNotAddToPath"
Push "$DO_NOT_ADD_TO_PATH"
Call ConditionalAddToRegisty
Push "AddToPathAllUsers"
Push "$ADD_TO_PATH_ALL_USERS"
Call ConditionalAddToRegisty
Push "AddToPathCurrentUser"
Push "$ADD_TO_PATH_CURRENT_USER"
Call ConditionalAddToRegisty
Push "InstallToDesktop"
Push "$INSTALL_DESKTOP"
Call ConditionalAddToRegisty
@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
;--------------------------------
; determine admin versus local install
Function un.onInit
ClearErrors
UserInfo::GetName
IfErrors noLM
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group'
Goto done
StrCmp $1 "Power" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
Goto done
noLM:
;Get installation folder from registry if available
done:
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
;--- Add/Remove callback functions: ---
!macro SectionList MacroName
;This macro used to perform operation on multiple sections.
;List all of your components in following manner here.
@CPACK_NSIS_COMPONENT_SECTION_LIST@
!macroend
Section -FinishComponents
;Removes unselected components and writes component status to registry
!insertmacro SectionList "FinishSection"
!ifdef CPACK_NSIS_ADD_REMOVE
; Get the name of the installer executable
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
StrCpy $R3 $R0
; Strip off the last 13 characters, to see if we have AddRemove.exe
StrLen $R1 $R0
IntOp $R1 $R0 - 13
StrCpy $R2 $R0 13 $R1
StrCmp $R2 "AddRemove.exe" addremove_installed
; We're not running AddRemove.exe, so install it
CopyFiles $R3 $INSTDIR\AddRemove.exe
addremove_installed:
!endif
SectionEnd
;--- End of Add/Remove callback functions ---
;--------------------------------
; Component dependencies
Function .onSelChange
!insertmacro SectionList MaybeSelectionChanged
FunctionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
ReadRegStr $START_MENU SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu"
;MessageBox MB_OK "Start menu is in: $START_MENU"
ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath"
ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers"
ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser"
;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS"
ReadRegStr $INSTALL_DESKTOP SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop"
;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP "
@CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@
;Remove files we installed.
;Keep the list of directories here in sync with the File commands above.
@CPACK_NSIS_DELETE_FILES@
@CPACK_NSIS_DELETE_DIRECTORIES@
!ifdef CPACK_NSIS_ADD_REMOVE
;Remove the add/remove program
Delete "$INSTDIR\AddRemove.exe"
!endif
;Remove the uninstaller itself.
Delete "$INSTDIR\Uninstall.exe"
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@"
;Remove the installation directory if it is empty.
RMDir "$INSTDIR"
; Remove the registry entries.
DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
; Removes all optional components
!insertmacro SectionList "RemoveSection"
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_ICONS_EXTRA@
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
startMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
IfErrors startMenuDeleteLoopDone
StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:
; If the user changed the shortcut, then untinstall may not work. This should
; try to fix it.
StrCpy $MUI_TEMP "$START_MENU"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS_EXTRA@
;Delete empty start menu parent diretories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
secondStartMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
IfErrors secondStartMenuDeleteLoopDone
StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop
secondStartMenuDeleteLoopDone:
DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
Push $INSTDIR\bin
StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0
Call un.RemoveFromPath
doNotRemoveFromPath:
SectionEnd
;--------------------------------
; determine admin versus local install
; Is install for "AllUsers" or "JustMe"?
; Default to "JustMe" - set to "AllUsers" if admin or on Win9x
; This function is used for the very first "custom page" of the installer.
; This custom page does not show up visibly, but it executes prior to the
; first visible page and sets up $INSTDIR properly...
; Choose different default installation folder based on SV_ALLUSERS...
; "Program Files" for AllUsers, "My Documents" for JustMe...
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
; Reads components status for registry
!insertmacro SectionList "InitSection"
StrCpy $SV_ALLUSERS "JustMe"
StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
ClearErrors
UserInfo::GetName
IfErrors noLM
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
StrCmp $1 "Power" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
noLM:
StrCpy $SV_ALLUSERS "AllUsers"
;Get installation folder from registry if available
done:
StrCmp $SV_ALLUSERS "AllUsers" 0 +2
StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
FunctionEnd
-5
View File
@@ -1,5 +0,0 @@
# This file is external to the read_from_file macro in Anope.cmake in order to
# get around a possible memory leak in older versions of CMake.
file(READ "${FILE}" RESULT)
message("${RESULT}")
Vendored
+24 -32
View File
@@ -835,37 +835,29 @@ dnl Check the size of several types and define a valid int16_t and int32_t.
dnl
AC_DEFUN(anope_CHECK_TYPE_SIZES,
[dnl Check type sizes
dnl AC_CHECK_SIZEOF(short)
dnl AC_CHECK_SIZEOF(int)
dnl AC_CHECK_SIZEOF(long)
dnl if test "$ac_cv_sizeof_int" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, int)
dnl AC_CHECK_TYPE(u_int16_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, short)
dnl AC_CHECK_TYPE(u_int16_t, unsigned short)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 16 bits])
dnl fi
dnl if test "$ac_cv_sizeof_int" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, int)
dnl AC_CHECK_TYPE(u_int32_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, short)
dnl AC_CHECK_TYPE(u_int32_t, unsigned short)
dnl elif test "$ac_cv_sizeof_long" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, long)
dnl AC_CHECK_TYPE(u_int32_t, unsigned long)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 32 bits])
dnl fi
AC_CHECK_TYPE(uint8_t, AC_DEFINE(HAVE_UINT8_T, 1, "Has uint8_t type"))
AC_CHECK_TYPE(u_int8_t, AC_DEFINE(HAVE_U_INT8_T, 1, "Has u_int8_t type"))
AC_CHECK_TYPE(int16_t, AC_DEFINE(HAVE_INT16_T, 1, "Has int16_t type"))
AC_CHECK_TYPE(uint16_t, AC_DEFINE(HAVE_UINT16_T, 1, "Has uint16_t type"))
AC_CHECK_TYPE(u_int16_t, AC_DEFINE(HAVE_U_INT16_T, 1, "Has u_int16_t type"))
AC_CHECK_TYPE(int32_t, AC_DEFINE(HAVE_INT32_T, 1, "Has int32_t type"))
AC_CHECK_TYPE(uint32_t, AC_DEFINE(HAVE_UINT32_T, 1, "Has uint32_t type"))
AC_CHECK_TYPE(u_int32_t, AC_DEFINE(HAVE_U_INT32_T, 1, "Has u_int32_t type"))
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
if test "$ac_cv_sizeof_int" = 2 ; then
AC_CHECK_TYPE(int16_t, int)
AC_CHECK_TYPE(u_int16_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 2 ; then
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(u_int16_t, unsigned short)
else
AC_MSG_ERROR([Cannot find a type with size of 16 bits])
fi
if test "$ac_cv_sizeof_int" = 4 ; then
AC_CHECK_TYPE(int32_t, int)
AC_CHECK_TYPE(u_int32_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 4 ; then
AC_CHECK_TYPE(int32_t, short)
AC_CHECK_TYPE(u_int32_t, unsigned short)
elif test "$ac_cv_sizeof_long" = 4 ; then
AC_CHECK_TYPE(int32_t, long)
AC_CHECK_TYPE(u_int32_t, unsigned long)
else
AC_MSG_ERROR([Cannot find a type with size of 32 bits])
fi
])
+24 -32
View File
@@ -4,36 +4,28 @@ dnl Check the size of several types and define a valid int16_t and int32_t.
dnl
AC_DEFUN(anope_CHECK_TYPE_SIZES,
[dnl Check type sizes
dnl AC_CHECK_SIZEOF(short)
dnl AC_CHECK_SIZEOF(int)
dnl AC_CHECK_SIZEOF(long)
dnl if test "$ac_cv_sizeof_int" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, int)
dnl AC_CHECK_TYPE(u_int16_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, short)
dnl AC_CHECK_TYPE(u_int16_t, unsigned short)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 16 bits])
dnl fi
dnl if test "$ac_cv_sizeof_int" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, int)
dnl AC_CHECK_TYPE(u_int32_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, short)
dnl AC_CHECK_TYPE(u_int32_t, unsigned short)
dnl elif test "$ac_cv_sizeof_long" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, long)
dnl AC_CHECK_TYPE(u_int32_t, unsigned long)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 32 bits])
dnl fi
AC_CHECK_TYPE(uint8_t, AC_DEFINE(HAVE_UINT8_T, 1, "Has uint8_t type"))
AC_CHECK_TYPE(u_int8_t, AC_DEFINE(HAVE_U_INT8_T, 1, "Has u_int8_t type"))
AC_CHECK_TYPE(int16_t, AC_DEFINE(HAVE_INT16_T, 1, "Has int16_t type"))
AC_CHECK_TYPE(uint16_t, AC_DEFINE(HAVE_UINT16_T, 1, "Has uint16_t type"))
AC_CHECK_TYPE(u_int16_t, AC_DEFINE(HAVE_U_INT16_T, 1, "Has u_int16_t type"))
AC_CHECK_TYPE(int32_t, AC_DEFINE(HAVE_INT32_T, 1, "Has int32_t type"))
AC_CHECK_TYPE(uint32_t, AC_DEFINE(HAVE_UINT32_T, 1, "Has uint32_t type"))
AC_CHECK_TYPE(u_int32_t, AC_DEFINE(HAVE_U_INT32_T, 1, "Has u_int32_t type"))
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
if test "$ac_cv_sizeof_int" = 2 ; then
AC_CHECK_TYPE(int16_t, int)
AC_CHECK_TYPE(u_int16_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 2 ; then
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(u_int16_t, unsigned short)
else
AC_MSG_ERROR([Cannot find a type with size of 16 bits])
fi
if test "$ac_cv_sizeof_int" = 4 ; then
AC_CHECK_TYPE(int32_t, int)
AC_CHECK_TYPE(u_int32_t, unsigned int)
elif test "$ac_cv_sizeof_short" = 4 ; then
AC_CHECK_TYPE(int32_t, short)
AC_CHECK_TYPE(u_int32_t, unsigned short)
elif test "$ac_cv_sizeof_long" = 4 ; then
AC_CHECK_TYPE(int32_t, long)
AC_CHECK_TYPE(u_int32_t, unsigned long)
else
AC_MSG_ERROR([Cannot find a type with size of 32 bits])
fi
])
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
echo "Generating build information using aclocal, autoheader, automake and autoconf."
echo
# Regerate configuration files
aclocal
autoheader
automake --gnu --add-missing --copy
autoconf
echo
echo "Now you are ready to run ./configure"
Vendored
+2549 -490
View File
File diff suppressed because it is too large Load Diff
+90 -31
View File
@@ -5,17 +5,14 @@ dnl Contact us at team@anope.org
dnl This program is free but copyrighted software; see the file COPYING for
dnl details.
dnl Based heavily on the Unreal configure.in script, and extra thanks to
dnl codemastr from UnrealIRCD.
AC_INIT
# Clear out any CFLAGS (cept -g) the os is using, usually -g -O2
CFLAGS="-g"
# If no bindir, we tell him to run ./Config.
if test "${with_instdir+set}" != set; then
if test "${with_bindir+set}" != set || test "${with_datadir+set}" != set; then
echo "You might want to run ./Config or provide some parameters to this script."
echo "./configure --help for information about this script"
exit 0
@@ -68,7 +65,7 @@ AC_CACHE_VAL(ac_cv_valistisarray,
}
int main()
{ foo(0, 123); return(0); }]])],[ac_cv_valistisarray=false],[ac_cv_valistisarray=true],[ac_cv_valistisarray=false])])
if test "$ac_cv_valistisarray" = true ; then
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY,[1],[va_list as array])
AC_MSG_RESULT(yes)
@@ -76,6 +73,59 @@ else
AC_MSG_RESULT(no)
fi
DIS_MYSQL=" MySQL: No"
AC_ARG_WITH(mysql, [ --without-mysql Do not use MySQL or attempt to find it],,[
AC_ARG_WITH(mysqlconfig-path, [ --with-mysqlconfig-path=PATH Complete path to the mysql_config executable],
mysql_config_path="$withval", mysql_config_path="")
MYSQLCONF=""
if test "$mysql_config_path" != ""; then
if test -x "$mysql_config_path"; then
MYSQLCONF="$mysql_config_path"
echo "checking for mysql_config... $MYSQLCONF" >&6
fi
fi
if test "$MYSQLCONF" = ""; then
AC_PATH_PROG(MYSQLCONF,mysql_config, "")
fi
if test "$MYSQLCONF" != ""; then
hold_cflags="$CFLAGS"
hold_ldflags="$LDFLAGS"
if test "$MYSQL_CFLAGS" = ""; then
MYSQL_CFLAGS="`$MYSQLCONF --cflags`"
fi
if test "$MYSQL_LDFLAGS" = ""; then
MYSQL_LDFLAGS="`$MYSQLCONF --libs`"
fi
CFLAGS="$CFLAGS $MYSQL_CFLAGS"
LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
echo $ECHO_N "checking if mysql_config produces valid values... $ECHO_C" >&6
AC_TRY_RUN([
#include <mysql.h>
int main()
{
MYSQL *mysql = mysql_init(0);
return 0;
}
], ac_cv_mysql_valid=yes, ac_cv_mysql_valid=no)
echo $ac_cv_mysql_valid >&6
if test "$ac_cv_mysql_valid" = "yes"; then
AC_DEFINE_UNQUOTED(USE_MYSQL,1,"Use Mysql")
AC_DEFINE_UNQUOTED(USE_RDB,1,"Use RDB")
MYSQL=" mysql.c "
RDB=" rdb.c "
AC_SUBST(MYSQL)
AC_SUBST(RDB)
DIS_MYSQL=" MySQL: Yes"
else
CFLAGS="$hold_cflags"
LDFLAGS="$hold_ldflags"
fi
fi
])
AC_MSG_CHECKING(whether this is a bit or little endian system)
AC_TRY_RUN([
int main()
@@ -83,12 +133,12 @@ int main()
short s = 1;
short* ptr = &s;
unsigned char c = *((char*)ptr);
return c;
return c;
}
]
, AC_DEFINE(BIG_ENDIAN)
AC_MSG_RESULT(big)
, AC_DEFINE(LITTLE_ENDIAN)
, AC_DEFINE(LITTLE_ENDIAN)
AC_MSG_RESULT(little)
)
@@ -96,14 +146,22 @@ AC_SUBST(ANOPELIBS)
AC_SUBST(LDFLAGS)
AC_CHECK_HEADER(sys/types.h,AC_DEFINE(HAS_SYS_TYPES_H,1,"Has sys/types.h"))
DIS_MODULES="Modules: Yes"
dnl module checking based on Unreal's module checking code
AC_DEFUN(AC_ENABLE_DYN,
[
AC_CHECK_FUNC(dlopen,, AC_CHECK_LIB(dl,dlopen,[
ANOPELIBS="$ANOPELIBS -ldl"
AC_DEFINE(USE_MODULES,1,"Modules are available")
USE_MODULES="yes"
DIS_MODULES="Modules: Yes"
],
[
AC_ERROR("dlopen() is required for Anope to be compiled and used. Sorry.")
AC_MSG_WARN(Dynamic linking is not enabled because dlopen was not found)
AC_DEFINE(STATIC_LINKING,"NO_MODULES","modules not available")
DIS_MODULES="Modules: No"
]))
hold_cflags=$CFLAGS
@@ -172,6 +230,7 @@ fi
MODULEFLAGS=$ac_cv_pic
AC_SUBST(MODULEFLAGS)
AC_DEFINE(USE_MODULES,1,"Modules available")
])
AC_ENABLE_DYN
@@ -181,8 +240,14 @@ AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H,1,""))
AC_CHECK_HEADER(sys/select.h,AC_DEFINE(HAVE_SYS_SELECT_H,1,""))
AC_CHECK_FUNCS(backtrace,AC_DEFINE(HAVE_BACKTRACE,1))
AC_CHECK_FUNCS(strerror,AC_DEFINE(HAVE_STRERROR,1))
AC_CHECK_FUNCS(sys_errlist,AC_DEFINE(HAVE_SYS_ERRLIST,1))
AC_CHECK_FUNCS(snprintf,AC_DEFINE(HAVE_SNPRINTF,1))
AC_CHECK_FUNCS(stricmp,AC_DEFINE(HAVE_STRICMP,1))
AC_CHECK_FUNCS(strcasecmp,AC_DEFINE(HAVE_STRCASECMP,1))
AC_CHECK_FUNCS(strdup,AC_DEFINE(HAVE_STRDUP,1))
AC_CHECK_FUNCS(strspn,AC_DEFINE(HAVE_STRSPN,1))
AC_CHECK_FUNCS(strsignal,AC_DEFINE(HAVE_STRSIGNAL,1))
AC_CHECK_FUNCS(gettimeofday,AC_DEFINE(HAVE_GETTIMEOFDAY,1))
AC_CHECK_FUNCS(setgrent,AC_DEFINE(HAVE_SETGRENT,1))
AC_CHECK_FUNCS(umask,AC_DEFINE(HAVE_UMASK,1))
@@ -192,40 +257,34 @@ AC_CHECK_FUNCS(gethostbyname_r,AC_DEFINE(HAVE_GETHOSTBYNAME_R,1))
AC_CHECK_FUNCS(strlcpy,AC_DEFINE(HAVE_STRLCPY,1))
AC_CHECK_FUNCS(strlcat,AC_DEFINE(HAVE_STRLCAT,1))
AC_ARG_WITH(rungroup, [ --with-rungroup=group Specify the rungroup for anope], [
AC_ARG_WITH(rungroup, [ --with-rungroup=group Specify the rungroup for anope], [
AC_DEFINE_UNQUOTED(RUNGROUP,"$withval","Run group")
RUNGROUP=$withval
])
AC_SUBST(RUNGROUP)
dnl AC_DEFINE_UNQUOTED(MYOSNAME,"`uname -a`","uname")
AC_ARG_WITH(permissions, [ --with-permissions=permissions Specify the default permissions for anope], AC_DEFINE_UNQUOTED(DEFUMASK,$withval,"Default umask permissions"), AC_DEFINE(DEFUMASK, 007,"Default umask Permissions"))
AC_ARG_WITH(permissions, [ --with-permissions=permissions Specify the default permissions for anope], AC_DEFINE_UNQUOTED(DEFUMASK,$withval,"Default umask permissions"), AC_DEFINE(DEFUMASK, 007,"Default umask Permissions"))
AC_ARG_WITH(instdir, [ --with-instdir=instdir Specify the default install dir for anope], [
INSTDIR=$withval
AC_ARG_WITH(bindir, [ --with-bindir=bindir Specify the default binary dir for anope], [
AC_DEFINE_UNQUOTED(SERVICES_BIN,"${withval}/services","Binary Dir")
BINDEST=$withval
DATDEST=$withval
MODULE_PATH=${withval}/modules/
])
MAKEBIN=`pwd`/run-cc.pl
AC_SUBST(BINDEST)
AC_ARG_WITH(makebin, [ --with-makebin=run-cc.pl Specify the default make binary to use],[MAKEBIN=$withval])
MYSQLDIR=/usr/local/
AC_ARG_WITH(mysqlpp, [ --with-mysqlpp=/usr/local/ The base directory of the MySQL++ installation],[MYSQLDIR=$withval])
AC_SUBST(INSTDIR)
AC_SUBST(MAKEBIN)
AC_SUBST(MYSQLDIR)
AC_ARG_WITH(optimization, [ --with-optimization=1|2|3|4|5 Specify the optimization level], [
CFLAGS="$CFLAGS -O$withval"
])
AC_ARG_WITH(debugsym, [ --with-debugsym Include debugging symbols], [
CFLAGS="$CFLAGS -g"
AC_ARG_WITH(datadir, [ --with-datadir=datadir Specify the location of the services data folder], [
AC_DEFINE_UNQUOTED(SERVICES_DIR,"$withval","services bin dir")
AC_DEFINE_UNQUOTED(MODULE_PATH,"${withval}/modules/","Module dir")
DATDEST=$withval
MODULE_PATH=${withval}/modules/
])
AC_SUBST(DATDEST)
AC_SUBST(MODULE_PATH)
AC_CONFIG_FILES( \
Makefile \
@@ -237,7 +296,7 @@ AC_OUTPUT
cat <<EOT
$DIS_MODULES
$DIS_MYSQL
All done! Now run "make" (or possibly "gmake") to compile Anope.
See the INSTALL, README and FAQ files if you have any problems.
-6
View File
@@ -1,6 +0,0 @@
# Only install example.chk and example.conf from this directory
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
set(DATA example.chk example.conf tables.sql)
install(FILES ${DATA}
DESTINATION data
)
+6 -9
View File
@@ -1,7 +1,7 @@
#!/bin/sh
# Crontab script for Anope
#
#
# To know how to install the crontab, read the INSTALL file.
###############################################################
@@ -9,10 +9,7 @@
###############################################################
# Anope binary directory
ANOPATH=/home/ircd/services/bin
# Anope data directory
ANODATA=/home/ircd/services/data
ANOPATH=/home/ircd/services/
# Name of the pid file
ANOPIDF=services.pid
@@ -34,14 +31,14 @@ ANOPID=
cd $ANOPATH
if [ -f "$ANODATA/$ANOPIDF" ]
if [ -f $ANOPIDF ]
then
ANOPID=`cat "$ANODATA/$ANOPIDF"`
ANOPID=`cat $ANOPIDF`
if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ]
then
exit
exit
fi
rm -f "$ANODATA/$ANOPIDF"
rm -f $ANOPIDF
fi
./$ANOPROG $ANOARGS
+1606 -1547
View File
File diff suppressed because it is too large Load Diff
-174
View File
@@ -1,174 +0,0 @@
<?php
/*
* (C) 2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
*
*
*/
/** Object representing a MySQL query
*/
class MySQLQuery
{
/* Our query */
private $Query;
/* The result */
private $Result;
/* Socket used to connect to MySQL */
private $MysqlSock;
/** Constructor
* @param MysqlSock The MySQL socket
*/
function __construct($MysqlSock)
{
$this->MysqlSock = $MysqlSock;
}
/** Destructor
*/
function __destruct()
{
}
/** Execute a query
* @return true or false
*/
private function Execute()
{
$Res = mysql_query($this->Query, $this->MysqlSock);
$this->Result = array();
if (!empty($Res))
{
while (($Result = @mysql_fetch_assoc($Res)))
{
$this->Result[] = $Result;
}
return true;
}
return false;
}
/** Get the result for the query
* @return The result
*/
public function Result()
{
return $this->Result;
}
/** Execute a query
* @param A formatted string
* @param ... Args
* @return true or false
*/
public function Query($String, $P1 = NULL, $P2 = NULL, $P3 = NULL, $P4 = NULL, $P5 = NULL, $P6 = NULL, $P7 = NULL,
$P8 = NULL, $P9 = NULL, $P10 = NULL, $P11 = NULL, $P12 = NULL, $P13 = NULL, $P14 = NULL)
{
$this->Query = sprintf($String, $P1, $P2, $P3, $P4, $P5, $P6, $P7, $P8, $P9, $P10, $P11, $P12, $P13, $P14);
return $this->Execute();
}
/** Escape a string to by MySQL safe
* @return A new, MySQL safe string
*/
public function Escape($String)
{
return mysql_real_escape_string($String, $this->MysqlSock);
}
}
/** Main Anope class
*/
class Anope
{
/* Socket used to connect to MySQL */
private $MysqlSock;
/* True if we were able to connect successfully */
private $Connected;
/** Constructor
* @param MysqlHost The host of the MySQLd server, port can be included on this too
* @param MysqlUser The username to authenticate to MySQL with
* @param MysqlPassword The password to authenticate with
* @param MysqlDatabase The name of the Anope database
*/
function __construct($MysqlHost, $MysqlUser, $MysqlPassword, $MysqlDatabase)
{
$this->Connected = false;
$this->MysqlSock = @mysql_connect($MysqlHost, $MysqlUser, $MysqlPassword);
if ($this->MysqlSock)
$this->Connected = @mysql_select_db($MysqlDatabase, $this->MysqlSock);
}
/** Destructor
* Closes the connection to the MySQL server
*/
function __destruct()
{
if ($this->MysqlSock)
@mysql_close($this->MysqlSock);
}
/** Check if we are connected successfully
* @return true or false
*/
public function Connected()
{
return $this->Connected;
}
/** Retrieve a new query object
* @return A new Query object
*/
public function Query()
{
return new MySQLQuery($this->MysqlSock);
}
/** Anope Functions **/
/** Execute a command in Anope
* For more information read docs/MYSQL
* @param Nick The nickname to execute the command from
* @param Service The service to execute the command on
* @param Command The command to execute
*/
public function Command($Nick, $Service, $Command)
{
$Query = $this->Query();
return $Query->Query("INSERT DELAYED INTO `anope_commands` (nick, service, command) VALUES('%s', '%s', '%s')", $Query->Escape($Nick), $Query->Escape($Service), $Query->Escape($Command));
}
/** Register a nick
* @param Nick The nick to be registered
* @param Password The password
* @param Email The email address to use, defaults to NULL
* @param Returns a message confirming or denying the registration process
*/
public function Register($Nick, $Password, $Email = NULL)
{
$Query = $this->Query();
$Query->Query("SELECT nick FROM `anope_ns_alias` WHERE `nick` = '%s'", $Query->Escape($Nick));
$Result = $Query->Result();
if (isset($Result[0]['nick']))
{
return "Nickname already registered";
}
if ($this->Command($Nick, "NickServ", "REGISTER ".$Password." ".$Email))
{
return "Nick registration successful. If your network has email registration enabled check your inbox for the next step of the registration process.";
}
return "Error registering nick";
}
}
?>
-59
View File
@@ -1,59 +0,0 @@
<?php
/*
* (C) 2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
*
*
*
*/
/* This is an example functional webpage showing how to use Anopes MySQL
* Execute feature to register a nickname online
*/
/* Include Anope's PHP API */
include('Anope.php');
function IsValidEmail($Email)
{
return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email);
}
if (!empty($_POST['nick']) && !empty($_POST['password1']) && !empty($_POST['password2']) && !empty($_POST['email']))
{
if ($_POST['password1'] != $_POST['password2'])
{
echo 'Passwords do not match';
}
else if (!IsValidEmail($_POST['email']))
{
echo 'Invalid email address';
}
else
{
/* Create a new connection, arguments are hostname, username, password, and database name */
$Anope = new Anope("localhost", "anope", "anoperules", "anope");
/* Check if we connected */
if (!$Anope->Connected())
{
echo "Error connecting to MySQL database";
}
else
{
echo $Anope->Register($_POST['nick'], $_POST['password1'], $_POST['email']);
}
die;
}
}
?>
</br>
<form method="post" action="Register.php">
Nick: <input type="text" name="nick"></br>
Password: <input type="password" name="password1"></br>
Confirm Password: <input type="password" name="password2"></br>
Email: <input type="text" name="email"></br>
<input type="submit" value="Submit">
</form>
+322 -276
View File
@@ -4,120 +4,23 @@
-- CREATE DATABASE anope;
-- USE anope;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_extra'
--
DROP TABLE IF EXISTS anope_extra;
CREATE TABLE anope_extra (
data text NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_commands'
--
DROP TABLE IF EXISTS anope_commands;
CREATE TABLE anope_commands (
nick varchar(255) NOT NULL default '',
service varchar(255) NOT NULL default '',
command text NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ns_core'
--
DROP TABLE IF EXISTS anope_ns_core;
CREATE TABLE anope_ns_core (
display varchar(255) NOT NULL default '',
pass text NOT NULL,
email text NOT NULL default '',
greet text NOT NULL default '',
icq int(10) unsigned NOT NULL default '0',
url text NOT NULL default '',
flags text NOT NULL default '',
language smallint(5) unsigned NOT NULL default '0',
channelcount smallint(5) unsigned NOT NULL default '0',
memomax smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (display)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table 'anope_ns_core_metadata'
--
DROP TABLE IF EXISTS anope_ns_core_metadata;
CREATE TABLE anope_ns_core_metadata (
nick varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
value text NOT NULL default '',
PRIMARY KEY (name)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- ---------------------------------------------------------
-- Table structure for table 'anope_bs_core'
--
-- Table structure for table 'anope_ns_alias'
--
DROP TABLE IF EXISTS anope_ns_alias;
CREATE TABLE anope_ns_alias (
DROP TABLE IF EXISTS anope_bs_core;
CREATE TABLE anope_bs_core (
bs_id int(11) NOT NULL auto_increment,
nick varchar(255) NOT NULL default '',
last_quit text NOT NULL,
last_realname text NOT NULL,
last_usermask text NOT NULL,
time_registered int(10) unsigned NOT NULL default '0',
last_seen int(10) unsigned NOT NULL default '0',
flags text NOT NULL default '',
display varchar(255) NOT NULL default '',
PRIMARY KEY (nick)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table 'anope_ns_alias_metadata'
--
DROP TABLE IF EXISTS anope_ns_alias_metadata;
CREATE TABLE anope_ns_alias_metadata (
nick varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
value text NOT NULL default '',
PRIMARY KEY (name)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ns_access'
--
DROP TABLE IF EXISTS anope_ns_access;
CREATE TABLE anope_ns_access (
display varchar(255) NOT NULL default '',
access varchar(160) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- ---------------------------------------------------------
--
-- Table structure for table 'anope_ns_request'
--
DROP TABLE IF EXISTS anope_ns_request;
CREATE TABLE anope_ns_request (
nick varchar(255) NOT NULL default '',
passcode text NOT NULL,
password text NOT NULL,
email text NOT NULL,
requested int(10) unsigned NOT NULL default '0',
PRIMARY KEY (nick)
`user` text NOT NULL,
host text NOT NULL,
rname text NOT NULL,
flags int(11) NOT NULL default '0',
created int(11) NOT NULL default '0',
chancount int(11) NOT NULL default '0',
active int(1) NOT NULL default '1',
PRIMARY KEY (bs_id),
UNIQUE KEY nick (nick)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
@@ -128,43 +31,51 @@ CREATE TABLE anope_ns_request (
DROP TABLE IF EXISTS anope_cs_access;
CREATE TABLE anope_cs_access (
level int(11) NOT NULL default '0',
ca_id int(11) NOT NULL auto_increment,
in_use int(11) NOT NULL default '0',
`level` int(11) NOT NULL default '0',
display varchar(255) NOT NULL default '',
channel varchar(255) NOT NULL default '',
last_seen int(10) unsigned NOT NULL default '0',
creator varchar(255) NOT NULL default '',
UNIQUE KEY (channel,display)
last_seen int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (ca_id),
UNIQUE KEY channel (channel,display)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_cs_akick'
--
--
-- Table structure for table 'anope_cs_akicks'
--
DROP TABLE IF EXISTS anope_cs_akick;
CREATE TABLE anope_cs_akick (
DROP TABLE IF EXISTS anope_cs_akicks;
CREATE TABLE anope_cs_akicks (
ck_id int(11) NOT NULL auto_increment,
channel varchar(255) NOT NULL default '',
flags varchar(255) NOT NULL default '',
mask varchar(255) NOT NULL default '',
reason text NOT NULL default '',
creator varchar(255) NOT NULL default '',
created int(10) unsigned NOT NULL default '0',
last_used int(10) unsigned NOT NULL default '0',
UNIQUE KEY channel (channel, mask)
flags int(11) NOT NULL default '0',
dmask varchar(255) NOT NULL,
reason text NOT NULL,
creator text NOT NULL,
addtime int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (ck_id),
UNIQUE KEY channel (channel,dmask)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_bs_badwords'
--
--
-- Table structure for table 'anope_cs_badwords'
--
DROP TABLE IF EXISTS anope_bs_badwords;
CREATE TABLE anope_bs_badwords (
DROP TABLE IF EXISTS anope_cs_badwords;
CREATE TABLE anope_cs_badwords (
cw_id int(11) NOT NULL auto_increment,
channel varchar(255) NOT NULL default '',
word varchar(255) NOT NULL,
type varchar(50) NOT NULL,
`type` int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (cw_id),
UNIQUE KEY channel (channel,word)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@@ -176,9 +87,11 @@ CREATE TABLE anope_bs_badwords (
DROP TABLE IF EXISTS anope_cs_info;
CREATE TABLE anope_cs_info (
name varchar(255) NOT NULL default '',
ci_id int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
founder text NOT NULL,
successor text NOT NULL,
founderpass tinyblob NOT NULL,
descr text NOT NULL,
url text NOT NULL,
email text NOT NULL,
@@ -187,36 +100,31 @@ CREATE TABLE anope_cs_info (
last_topic text NOT NULL,
last_topic_setter text NOT NULL,
last_topic_time int(10) unsigned NOT NULL default '0',
flags text NOT NULL default '',
flags int(10) unsigned NOT NULL default '0',
forbidby text NOT NULL,
forbidreason text NOT NULL,
bantype smallint(6) NOT NULL default '0',
mlock_on text NOT NULL default '',
mlock_off text NOT NULL default '',
mlock_params text NOT NULL default '',
accesscount smallint(6) NOT NULL default '0',
akickcount smallint(6) NOT NULL default '0',
mlock_on int(10) unsigned NOT NULL default '0',
mlock_off int(10) unsigned NOT NULL default '0',
mlock_limit int(10) unsigned NOT NULL default '0',
mlock_key text NOT NULL,
mlock_flood text NOT NULL,
mlock_redirect text NOT NULL,
entry_message text NOT NULL,
memomax smallint(5) unsigned NOT NULL default '0',
botnick varchar(255) NOT NULL default '',
botflags text NOT NULL default '',
botflags int(10) unsigned NOT NULL default '0',
bwcount smallint(6) NOT NULL default '0',
capsmin smallint(6) NOT NULL default '0',
capspercent smallint(6) NOT NULL default '0',
floodlines smallint(6) NOT NULL default '0',
floodsecs smallint(6) NOT NULL default '0',
repeattimes smallint(6) NOT NULL default '0',
PRIMARY KEY (name)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_cs_info_metadata'
--
DROP TABLE IF EXISTS anope_cs_info_metadata;
CREATE TABLE anope_cs_info_metadata (
channel varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
value text NOT NULL default ''
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (ci_id),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
@@ -227,149 +135,49 @@ CREATE TABLE anope_cs_info_metadata (
DROP TABLE IF EXISTS anope_cs_levels;
CREATE TABLE anope_cs_levels (
cl_id int(11) NOT NULL auto_increment,
channel varchar(255) NOT NULL default '',
position int(11) NOT NULL default '0',
level int(11) NOT NULL default '0',
`level` int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (cl_id),
UNIQUE KEY channel (channel,position)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
--
-- Table structure for table 'anope_cs_ttb'
--
--
DROP TABLE IF EXISTS anope_cs_ttb;
CREATE TABLE anope_cs_ttb (
ct_id int(11) NOT NULL auto_increment,
channel varchar(255) NOT NULL default '',
ttb_id int(11) NOT NULL default '0',
value int(11) NOT NULL default '0',
`value` int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (ct_id),
UNIQUE KEY channel (channel,ttb_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_bs_core'
--
--
-- Table structure for table 'anope_hs_core'
--
DROP TABLE IF EXISTS anope_bs_core;
CREATE TABLE anope_bs_core (
DROP TABLE IF EXISTS anope_hs_core;
CREATE TABLE anope_hs_core (
bs_id int(11) NOT NULL auto_increment,
nick varchar(255) NOT NULL default '',
user varchar(255) NOT NULL default '',
host text NOT NULL default '',
rname text NOT NULL default '',
flags text NOT NULL default '',
created int(10) unsigned NOT NULL default '0',
chancount int(11) NOT NULL default '0',
PRIMARY KEY (nick)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_bs_info_metadata'
--
DROP TABLE IF EXISTS anope_bs_info_metadata;
CREATE TABLE anope_bs_info_metadata (
botname varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
value text NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ms_info'
--
DROP TABLE IF EXISTS anope_ms_info;
CREATE TABLE anope_ms_info (
receiver varchar(255) NOT NULL,
number int(11) NOT NULL default '0',
flags int(11) NOT NULL default '0',
time int(10) unsigned NOT NULL default '0',
sender text NOT NULL,
text blob NOT NULL,
serv enum('NICK','CHAN') NOT NULL default 'NICK'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_akills'
--
DROP TABLE IF EXISTS anope_os_akills;
CREATE TABLE anope_os_akills (
user varchar(255) NOT NULL,
host varchar(255) NOT NULL,
xby text NOT NULL,
reason text NOT NULL,
seton int(10) unsigned NOT NULL default '0',
expire int(10) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_core'
--
DROP TABLE IF EXISTS anope_os_core;
CREATE TABLE anope_os_core (
maxusercnt int(11) NOT NULL default '0',
maxusertime int(10) unsigned NOT NULL default '0',
akills_count int(11) NOT NULL default '0',
sglines_count int(11) NOT NULL default '0',
sqlines_count int(11) NOT NULL default '0',
szlines_count int(11) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_exceptions'
--
DROP TABLE IF EXISTS anope_os_exceptions;
CREATE TABLE anope_os_exceptions (
mask varchar(255) NOT NULL,
slimit int(11) NOT NULL default '0',
who text NOT NULL,
reason text NOT NULL,
time int(10) unsigned NOT NULL default '0',
expires int(10) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_sxlines'
--
DROP TABLE IF EXISTS anope_os_sxlines;
CREATE TABLE anope_os_sxlines (
type varchar(20) NOT NULL,
mask varchar(255) NOT NULL,
xby text NOT NULL,
reason text NOT NULL,
seton int(10) unsigned NOT NULL default '0',
expire int(10) unsigned NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_metadata'
--
DROP TABLE IF EXISTS anope_metadata;
CREATE TABLE anope_metadata (
name varchar(255) NOT NULL default '',
value text NOT NULL default '',
PRIMARY KEY (name)
vident text NOT NULL,
vhost text NOT NULL,
creator text NOT NULL,
`time` int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (bs_id),
UNIQUE KEY nick (nick)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
@@ -381,6 +189,244 @@ CREATE TABLE anope_metadata (
DROP TABLE IF EXISTS anope_info;
CREATE TABLE anope_info (
version int(11) default NULL,
date datetime default NULL
`date` datetime default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ms_info'
--
DROP TABLE IF EXISTS anope_ms_info;
CREATE TABLE anope_ms_info (
nm_id int(11) NOT NULL auto_increment,
receiver varchar(255) NOT NULL,
number int(11) NOT NULL default '0',
flags int(11) NOT NULL default '0',
`time` int(11) NOT NULL default '0',
sender text NOT NULL,
`text` blob NOT NULL,
serv enum('NICK','CHAN') NOT NULL default 'NICK',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (nm_id),
UNIQUE KEY nm_id (nm_id,serv),
KEY receiver (receiver,serv)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ns_access'
--
DROP TABLE IF EXISTS anope_ns_access;
CREATE TABLE anope_ns_access (
na_id int(11) NOT NULL auto_increment,
display varchar(255) NOT NULL default '',
access text NOT NULL,
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (na_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ns_alias'
--
DROP TABLE IF EXISTS anope_ns_alias;
CREATE TABLE anope_ns_alias (
na_id int(11) NOT NULL auto_increment,
display varchar(255) NOT NULL default '',
nick varchar(255) NOT NULL default '',
time_registered int(10) unsigned NOT NULL default '0',
last_seen int(10) unsigned NOT NULL default '0',
`status` int(11) unsigned NOT NULL default '0',
last_usermask text NOT NULL,
last_realname text NOT NULL,
last_quit text NOT NULL,
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (na_id),
UNIQUE KEY nick (nick)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ns_core'
--
DROP TABLE IF EXISTS anope_ns_core;
CREATE TABLE anope_ns_core (
nc_id int(11) NOT NULL auto_increment,
display varchar(255) NOT NULL default '',
pass tinyblob NOT NULL,
email text NOT NULL,
icq int(10) unsigned NOT NULL default '0',
url text NOT NULL,
flags int(11) NOT NULL default '0',
`language` smallint(5) unsigned NOT NULL default '0',
accesscount smallint(6) NOT NULL default '0',
memocount smallint(5) unsigned NOT NULL default '0',
memomax smallint(5) unsigned NOT NULL default '0',
channelcount smallint(5) unsigned NOT NULL default '0',
channelmax smallint(5) unsigned NOT NULL default '0',
greet text NOT NULL,
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (nc_id),
UNIQUE KEY display (display)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_ns_request'
--
DROP TABLE IF EXISTS anope_ns_request;
CREATE TABLE anope_ns_request (
nr_id int(11) NOT NULL auto_increment,
nick varchar(255) NOT NULL default '',
passcode text NOT NULL,
`password` tinyblob NOT NULL,
email text NOT NULL,
requested int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (nr_id),
UNIQUE KEY nick (nick)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_akills'
--
DROP TABLE IF EXISTS anope_os_akills;
CREATE TABLE anope_os_akills (
ok_id int(11) NOT NULL auto_increment,
`user` varchar(255) NOT NULL,
host varchar(255) NOT NULL,
xby text NOT NULL,
reason text NOT NULL,
seton int(11) NOT NULL default '0',
expire int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (ok_id),
UNIQUE KEY `user` (`user`,host)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_core'
--
DROP TABLE IF EXISTS anope_os_core;
CREATE TABLE anope_os_core (
oc_id int(11) NOT NULL auto_increment,
maxusercnt int(11) NOT NULL default '0',
maxusertime int(11) NOT NULL default '0',
akills_count int(11) NOT NULL default '0',
sglines_count int(11) NOT NULL default '0',
sqlines_count int(11) NOT NULL default '0',
szlines_count int(11) NOT NULL default '0',
PRIMARY KEY (oc_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_exceptions'
--
DROP TABLE IF EXISTS anope_os_exceptions;
CREATE TABLE anope_os_exceptions (
oe_id int(11) NOT NULL auto_increment,
mask varchar(255) NOT NULL,
lim int(11) NOT NULL default '0',
who text NOT NULL,
reason text NOT NULL,
`time` int(11) NOT NULL default '0',
expires int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (oe_id),
UNIQUE KEY mask (mask)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_news'
--
DROP TABLE IF EXISTS anope_os_news;
CREATE TABLE anope_os_news (
on_id int(11) NOT NULL auto_increment,
`type` int(11) NOT NULL default '0',
num int(11) NOT NULL default '0',
ntext text NOT NULL,
who text NOT NULL,
`time` int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (on_id),
UNIQUE KEY `type` (`type`,num,`time`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_sglines'
--
DROP TABLE IF EXISTS anope_os_sglines;
CREATE TABLE anope_os_sglines (
og_id int(11) NOT NULL auto_increment,
mask varchar(255) NOT NULL,
xby text NOT NULL,
reason text NOT NULL,
seton int(11) NOT NULL default '0',
expire int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (og_id),
UNIQUE KEY mask (mask)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_sqlines'
--
DROP TABLE IF EXISTS anope_os_sqlines;
CREATE TABLE anope_os_sqlines (
og_id int(11) NOT NULL auto_increment,
mask varchar(255) NOT NULL,
xby text NOT NULL,
reason text NOT NULL,
seton int(11) NOT NULL default '0',
expire int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (og_id),
UNIQUE KEY mask (mask)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table 'anope_os_szlines'
--
DROP TABLE IF EXISTS anope_os_szlines;
CREATE TABLE anope_os_szlines (
og_id int(11) NOT NULL auto_increment,
mask varchar(255) NOT NULL,
xby text NOT NULL,
reason text NOT NULL,
seton int(11) NOT NULL default '0',
expire int(11) NOT NULL default '0',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (og_id),
UNIQUE KEY mask (mask)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-1
View File
@@ -1 +0,0 @@
astyle --style=java --indent=tab --brackets=break-closing --indent-switches --indent-cases --brackets=break
+1 -1
View File
@@ -1,4 +1,4 @@
Reported Bugs from Bugzilla: http://bugs.anope.org/
Reported Bugs from Tracker: http://bugs.anope.org/
---------------------------------------------------
-106
View File
@@ -1,106 +0,0 @@
C++-style Casting
=================
In C, you can cast in one of two ways:
(type)var
type(var)
The problem with C-style casting is that it allows a programmer to get away
with too much, and is also not designed to handle C++ classes.
C++ has 4 types of casting in addition to allowing C-style casting. They are:
static_cast
const_cast
dynamic_cast
reinterpret_cast
The syntax is usually *_cast<type>(var).
static_cast
-----------
From my expierence, this cast is closest to C-style casting for non-pointer
types as well as between some (but not all) pointer types. This type of cast,
like C-style casting, is performed at compile-time. static_cast can also do
a downcast of a derived class to a base class, but only if the base class is
not a virtual base class. Sometimes the result of this cast can become
undefined. static_cast is a bit more strict that C-style casting, though. It
disallows certain class conversions that would've been allowed with a C-style
cast. static_cast also doesn't allow you to cast to an incomplete type. In
these cases, I would try either dynamic_cast or reinterpret_cast.
const_cast
----------
This cast is mainly to add or remove const-ness or volatile-ness from a
variable. This is safer than using a C-style cast to change the const-ness
of a variable. In most cases if you try to use one of the other casts and it
complains about const-ness, you will want to either use this cast instead or
wrap the other cast around this cast. An example:
const int *a;
static_cast<void *>(a); <-- This will fail.
To remedy the above, you would might try this:
const int *a;
const_cast<void *>(a); <-- But this will still fail.
The real solution is this:
const int *a;
static_cast<void *>(const_cast<int *>(a));
It is not recommended to use const_cast on the this variable within a member
function of a class that is declared const. Instead you should use the mutable
keyword on the variable in the class's definition.
dynamic_cast
------------
This cast can only be used on pointers or references to classes. It can cast a
derived class to a base class, a derived class to another derived class
(provided that both are children of the same base class), or a base class to a
derived class. You can also use this to cast a class to void *. This cast is
done at run-time as opposed to the other casts, and relies on C++'s RTTI to be
enabled. It is meant to be used on polymorphic classes, so use static_cast on
non-polymorphic classes.
derived-to-base conversions are actually done statically, so you use either
dynamic_cast or static_cast on them, regardless of if the classes are
polymorphic or not.
derived-to-derived or base-to-derived conversions, however, rely on run-time
type information, and this cast is used on those classes that are polymorphic.
This is safer than C-style casting in that an invalid pointer conversion will
return a NULL pointer, and an invalid reference conversion will throw a
Bad_cast exception.
reinterpret_cast
----------------
This cast I would use only as a last resort if static_cast isn't allowed on a
conversion. It allows for conversions between two unrelated types, such as
going from char * to int *. It can also be used to convert a pointer to an
integral type and vica versa. The sites I've read mention how the result is
non-portable, which I assume means the resulting object code is non-portable,
so since the code is compiled on many systems anyways, I don't see this as
being a huge issue. It is recommended to only use this if necessary, though.
Links
=====
The following links are web sites I've used to get this information, and might
describe some of the above a bit better than I have. :P
http://www.acm.org/crossroads/xrds3-1/ovp3-1.html
http://www.cplusplus.com/doc/tutorial/typecasting.html
http://www.codeguru.com/forum/showthread.php?t=312456
http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/cast.html
http://msdn.microsoft.com/en-us/library/5f6c9f8h(VS.80).aspx
http://en.wikibooks.org/wiki/C%2B%2B_Programming/Type_Casting
http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=134
-- CyberBotX, Nov 23, 2008
-15
View File
@@ -1,15 +0,0 @@
# We only need to install these docs on Windows as most Windows installations will be binary, not source
if(WIN32)
# Only install given files from this directory
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
if(IN_SOURCE)
# Add README.txt to list of files for CPack to ignore
add_to_cpack_ignored_files("README.txt$" TRUE)
endif(IN_SOURCE)
set(DOCS DEFCON FAQ INSTALL MODULES NEWS PROXY ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
install(FILES ${DOCS}
DESTINATION docs
)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/README.txt")
endif(WIN32)
-170
View File
@@ -1,170 +0,0 @@
Orginally pulled from: http://www.inspircd.org/wiki/Coding_Guidelines
Yes, I'm aware the formatting of this document is ugly. It'll be fixed when someone cares. Read the wiki page if you want pretty for now.
---
InspIRCd Coding Guidelines
The following are a set of guidelines for writing patches to InspIRCd, or for creating modules for distribution with the official package. These
guidelines were written a time after InspIRCd development started, and so not all code yet follows these. This will be rectified with time.
1. Comments
Multi Line
Multiple line comments should follow the C-style comment, for example:
/*
* This is a multiple line comment, huzzah..
*/
Single Line
Single line comments should also be in the C style, for example:
/* This is a boring one-line comment */
Doxygen commenting
If you wish your comment to show in doxygen, the comment should be directly above the item you are documenting (a class, function, enum, etc)
and the first line should be "/**". For example:
/** This is a doxygen multiline comment.
* Description of thingymebob here.
*/
The first line after the "**" is used as the short description of the item (up to the full stop) and everything afterwards as the detailed
description.
Indentation
Tabs. Tabs. ONLY TABS. Use a single tab for each level of indentation, for example:
int main()
{
<tab>if (condition)
<tab>{
<tab><tab>code
<tab>}
}
Separation
Always put a space in between a keyword like if/while and the condition, for example:
if (foo == bar)
NOT
if(foo == bar)
Braces
Always put braces opening and closing blocks on separate lines, see the identation example. For example, place braces like this:
if (apples == "green")
{
cout << "Apples are green" << endl;
}
and not:
if (apples == "green") {
cout << "Apples are green" << endl;
}
The one exception to this is if you are declaring a class method which is only one line long, in that case the following is acceptable in most cases:
class foo : public bar
{
foo() { }
getrandomfoo() { return rand(); }
};
Templates
Where possible, use templates rather than #defines. Avoid use of RTTI.
Structs
Structs should be declared in the following fashion:
struct BodyPartBasket
{
int arms;
int legs;
int scrotalsacs;
};
and not like this:
typedef struct
{
int arms;
int legs;
int scrotalsacs;
} BodyPartBasket;
The second way is not required in C++ to be able to do this:
BodyPartBasket mybasket;
Plus, placing the name at the bottom of the declaration makes readability more difficult (as you have to scroll down to the bottom of the
struct to find its name).
(where possible, call them classes rather than structs.)
Variable naming
Class and struct names should be in camel case with a leading capital letter, for example "MyBagOfBones" and not "my_bag_of_bones" or
"mybagofbones". Variable names can be in either camel case with a leading capital letter or alternatively all lower case, so long as the same
naming convention is adhered to throughout the class. No classes or variables should be named in capitals unless this makes sense for the
name (for example "class DNS"). Constants and enum values should always be completely in CAPITALS and underscores may be used, for example:
enum DecayState
{
DECAYED_MOULDY = 0,
DECAYED_SMELLY = 1,
DECAYED_MAGGOTS = 2
};
All value names in an enum should be started with the same text which should be related in some way to the enum's use. For example "DNS_CNAME,
DNS_A, DNS_AAAA".
Use of references
Wherever possible, when dealing with any complex class, pass a const reference rather than a copy of the class. For example:
MyThingy::MyThingy(const std::string &thingyvalue)
{
}
Of course, if you intended to change the string you can just omit the 'const'.
Use of char pointers
Whenever you use char pointers (char*, char**) try to use const equivalents. This is much safer and avoids ugly and dangerous casts. For example:
MyThingy::Thingify(const char* const* wotsits)
{
}
If it is possible without performance loss, consider avoiding char pointers altogether and using std::string instead.
Use of STL
For more information on use of STL in InspIRCd, please see the separate STL FAQ.
Making copies of data
Never ever make a copy of a piece of data unless it is absolutely necessary. For example, don't use strlcpy() to make a copy of the const char* string
returned by std::string::c_str(), if the change can be done to the std::string itself. The same goes for unnecessary variable assignments, especially
those which assign large classes.
namespace std
Avoid the following:
using namespace std;
It might take a bit more typing, but things work better if you don't set (then later assume) the namespace -- specify it explicitly when you want to
use it.
Linefeeds
Unix linefeeds only please. We do not like to see our screens covered in ^M. :-)
Portability
Always make sure your code is portable to all supported operating systems, remember of course that as of 1.1.8 this includes windows. Don't write code
that only works on windows, or only works on Linux. Test your code on all platforms or ask for help from other developers who have the platforms you
want to test on.
new() and delete(), malloc() and free()
Apart from the fact that using malloc() and free() is bad practice in C++ code, you must never use malloc() or free() in InspIRCd, within its modules
or within the core. This is because if you use malloc() or free() in windows, the memory is claimed from the program's local heap. In windows, each
shared object (module, dll) has its own heap, which is protected from other dlls and executables. To get around this issue and allow more posix-like
memory access from other dlls in the program (other modules), InspIRCd overrides the operators new and delete to ensure that memory allocated by them
comes from the windows global heap. If you use malloc() and free() for this, the ircd will segfault when another module tries to access the memory you
have allocated!
strdup()
As with malloc(), above, strdup() should be avoided. Where strdup() is absolutely necessary, use strnewdup() which is our strdup() implementation that
calls operator new instead of using malloc(). char arrays allocated by strnewdup() should be deleted with operator delete[].
CoreExport and DllImport
Prefix all types you want to import or export to other modules with CoreExport and DllImport macros. These do nothing in POSIX operating systems,
however in windows these are expanded to the instructions __declspec(dllimport) and __declspec(dllexport) respectively depending on where they are
used and how.
External Dependencies
If a module is compiled as standard, or the code is part of the core, you must not use any dependencies that are not available as standard on all
supported operating systems beyond libstdc++, libc, and whatever else is currently required to build the core. Modules which use nonstandard
dependencies belong in the modules/extra directory.
Profiling and Performance
It is one thing to assume that code performs bad, it is another thing to prove that it actually is. A lot of experienced programmers talk about
'premature optimisation', and here is what it means: if you have a piece of code called once on startup that takes 10 seconds instead of one second to
run, and a piece of code that takes 0.05 seconds to run when it should take 0.01, and it is called once per second, the second piece of code is the
priority.
In other words, make sure that what you think is slow, and a performance problem in Insp actually is.
To do this, use the callgrind tool from Valgrind (valgrind --tool=cachegrind bin/inspircd -nofork -debug), and kcachegrind (or similar) to view the
output files.
-100
View File
@@ -1,100 +0,0 @@
Anope Version 1.9.2
--------------------
A K alias to chanserv kick command
A KB alias to chanserv ban command
A The ability to register empty nonregistered channels
A Flatfile plaintext databases and removed old binary ones
A Added in live updating SQL and the ability to execute commands through SQL (see docs/MYSQL)
A Added support for many more modes into Anope and the ability to have generic support for modes unknown to Anope
A Added a mode stacker to combine many mode changes into fewer
A Added in the CS SET PERSIST command which can be used to keep service bots in channels even when the channel is empty
A Added AUTOOWNER OWNER and OWNERME into CS LEVELS
A Added ns_resetpass module to the core
A CS ACCESS VIEW which shows who added the access and last time used
A Last used time to CS AKICK VIEW
A Added a sha_256 encryption module
A Added the ability to load multiple encryption modules, and the ability to seamlessly convert your database between diferent encryptions
A Added configuration options to allow Anope to reconnect if it disconnects from the uplink instead of dieing
A Added support for linking with IPv6
F Unban command to accept an optional nick arg
F Some typos in services.conf
F Crash when users change their host that are identified to a group, but not a nick
F Host length checking in HS SET(ALL) and HS REQUEST
F Only show if a user is online in NS INFO if they are really identiifed for the group of the nick they are on
F Crash when using BSSmartJoin
F Converting access entries to access from xop when a users access is below voice
F A bad pointer passed to the OnDelEvent which could cause some 3rd party modules to crash
F CS FORBID allows to you forbid unregistered channels
F The -nothird command line option to work
F ms_rsend to really work
F SQUITing juped servers on InspIRCd1.2+
Anope Version 1.9.1
--------------------
F Don't enforce akick/forbidden/etc.-restrictions on clients on ulined servers.
F Remove modules_unload_all fini + hack that goes with it.
F Signal handling cleanup.
A Seamless fantasy support on all ChanServ commands, instead of requiring bs_fantasy_*.
F Allow fantasy to be disabled on some commands (e.g. FORBID).
F Some commands (e.g. !help) need to strip the pre-provided channelname from them.
D HelpServ removed
F Command parser cleanup: mod_current_buffer removed and replaced with proper parser. Commands now indicate how they want the buffer split.
F Make NS ENFORCE/RELEASE stuff more sane, redo timers.
A Opertypes (similar to InspIRCd's opertypes)
Provided by Ankit <ankit@nevitus.com> - 2009
F Segfault on shutdown
Provided by Adam <adam@anope.org> - 2009
F NickServ registration is sometimes denied.
F Applied patch from Adam to fix some potential screwups
F More fixes to bs_bot from Adam, plus an extra fix within DoAdd not covered in Adam's patch.
F Fix bs_bot to use the correct parameters, patch from Adam.
F Fix for bug #1004, based from second half of patch from Adam.
F Partial patch by Adam, commenting fix for #1006 for future reference.
F Forward-port r1946: Patch by Adam fixing #1006 (originally caused by #922): modes set by ChanServ are reversed. Thanks!
Provided by DukePyrolator <dukepyrolator@gmx.de> - 2009
F Patch converting all match calls to new method, thanks!
F Add 'w' and 'y' support to dotime(), also prevent an overflow.
F Allow NS STATUS from unregistered users, thanks DP!
F Wild pointers do not a happy Anope make. Thanks DP :)
F Allow NS REGISTER to unregistered nicks, silly oversight. Thanks DP! :)
F Fix call order, thanks to DP
F Pass the right array to do_umode(), fixes mode tracking on Unreal. Thanks to DukePyrolator (yet again :P)
F Fix bs_set help, thanks to DukePyrolator! :)
F Fix two segfaults, noted by DukePyrolator. Thanks!
F Fix part one of #1010, reported by DukePyrolator. (Language settings are not respected in message sending.) Thanks!
F Memory leak on +beI modes.
Provided by Liber <Liber@jasonirc.net> - 2009
F Support operoverride and such things (stop reversing changes from nonopped people where unnecessary)
Anope Version 1.9.0
--------------------
F Modified compile to use g++
F Improve protocol modules support (classes, virtual methods, etc)
F Move core services to use BotInfo
F Move BotInfo and related methods into a class
F Move modules into a class
F Fixed ns resending of passcode issue
F Modules now delete themselves
F additional field where users' masked host can be stored so both masked IP and vhost are available instead of just one.
F No struct Uid, ugly, and, unnecessary that we store UID in BotInfo.
F Prevent deletion of core services via /bs bot
F Module subsystem cleanup ('modules' branch)
F Move modules to use classes somewhat (AnopeInit, AnopeFini)
F Change MODULE_INIT to return a pointer
F Remove duplicate module creation.. have loadModule return a pointer rather than creating one
F Remove buffered loading/unloading, this makes os_modunload perm, but who cares
F Remove 'delayed' loading, this is necessary because of before/after connected to ircd (ircd is before, rest after), I'm sure this can be done better.
A Remove old config, replace with insp-inspired (albeit bind format) config (CBX)
F Clean up protocol modules a bit
A InspIRCd 1.2 support
F Remove old (prior to 1.8.0) db compat
F Establish a proper base for services pseudoclients
F Add ss_main StatServ Hal9000 to play with :)
F Burn automake with fire (CBX)
Provided by mooncup <mooncup@anonnet.org> - 2009
F Automatically reapply vhost on hs off for unreal.
-52
View File
@@ -1,52 +0,0 @@
Anope Version 1.9.2
--------------------
** ADDED CONFIGURATION DIRECTIVES **
options:enablelogchannel added to auto turn on the logchannel on startup
options:mlock added to configure the default mlock modes on new channels
options:database added for the database modules
options:botmodes added to configure modes BotServ bots should use
options:userlen added to configure maxiumum ident length
options:hostlen added to configure maximum hostname length
options:database added to configure what database modules to use
options:passlen added to specify the maximum length of passwords
uplink:ipv6 added to enable IPv6 connectivity
options:maxretries added to specify the number of reconnect attempts allowed
options:retrywait added to specify how long to wait between reconnect attempts
opertype command chanserv/aop/list removed as it was unnecessary, use chanserv/access/list instead
** MODIFIED CONFIGURATION DIRECTIVES **
options:encryption added enc_sha256
chanserv:modules added cs_unban
nickserv:modules added ns_resetpass
** DELETED CONFIGURATION DIRECTIVES **
nickserv:database deleted because of new database system
nickserv:prenickdatabase deleted because of new database system
chanserv:database deleted because of the new database system
botserv:database deleted because of the new database system
hostserv:database deleted because of the new database system
operserv:database deleted because of the new database system
operserv:newsdatabase deleted because of the new database system
operserv:exceptiondatabase deleted because of the new database system
hs_request:database deleted because of the new database system
os_ignore:database deleted because of the new database system
serverinfo:localport deleted
Anope Version 1.9.1
-------------------
** ADDED CONFIGURATION DIRECTIVES **
Opertypes have been added, through the opertype blocks.
Services Operators are now specified in the oper blocks.
** MODIFIED CONFIGURATION DIRECTIVES **
botserv:modules no longer contains bs_fantasy* modules, fantasy is now seamless.
operserv:modules has replaced os_logonnews, os_opernews, and os_randomnews with os_news.
operserv:modules no longer contains os_admin and os_oper modules, removed in favor of oper blocks.
operserv:notifications no longer contains osraw due to removal of OS RAW.
** DELETED CONFIGURATION DIRECTIVES **
Nick tracking has been removed as an option.
Restricting of NS GETPASS and CS GETPASS removed in favor of opertypes.
Host Setters were removed in favor of opertypes.
HelpServ has been removed entirely.
operserv:disableraw removed due to removal of OS RAW.
-255
View File
@@ -1,255 +0,0 @@
Anope Version 1.9.2
--------------------
*** New Strings:
CHAN_INVITE_OTHER_SUCCESS
NICK_HELP_CONFIRM_OPER
CHAN_QOP_DISABLED
CHAN_QOP_NICKS_ONLY
CHAN_QOP_ADDED
CHAN_QOP_MOVED
CHAN_QOP_NO_SUCH_ENTRY
CHAN_QOP_NOT_FOUND
CHAN_QOP_DELETED
CHAN_QOP_DELETED_ONE
CHAN_QOP_DELETED_SEVERAL
CHAN_QOP_LIST_EMPTY
CHAN_QOP_LIST_HEADER
CHAN_QOP_CLEAR
CHAN_HELP_QOP
CHAN_QOP_SYNTAX
CHAN_HELP_CMD_QOP
CHAN_HELP_SET_PASSWORD
CHAN_LEVEL_AUTOOWNER
CHAN_LEVEL_OWNER
CHAN_LEVEL_OWNERME
CHAN_ACCESS_VIEW_XOP_FORMAT
CHAN_ACCESS_VIEW_AXS_FORMAT
CHAN_SET_PERSIST_SYNTAX
CHAN_SET_PERSIST_ON
CHAN_SET_PERSIST_OFF
CHAN_INFO_OPT_PERSIST
BOT_UNASSIGN_PERSISTANT_CHAN
CHAN_HELP_SET_PERSIST
NICK_RESETPASS_SYNTAX
NICK_RESETPASS_SUBJECT
NICK_RESETPASS_MESSAGE
NICK_RESETPASS_COMPLETE
NICK_CONFIRM_EXPIRED
NICK_CONFIRM_SUCCESS
NICK_HELP_CMD_RESETPASS
NICK_HELP_RESETPASS
CHAN_UNBANNED_OTHER
OPER_HELP_SYNC
OPER_HELP_CMD_SQLSYNC
OPER_SYNC_UPDATING
OPER_SYNC_UPDATED
CHAN_LEVELS_CHANGED_FOUNDER
*** Mod Strings:
CHAN_HELP_SET
CHAN_REGISTER_SYNTAX
CHAN_ACCESS_SYNTAX
CHAN_HELP_ACCESS
CHAN_HELP_SET
NICK_HELP_CONFIRM
CHAN_UNBAN_SYNTAX
CHAN_HELP_CMD_UNBAN
CHAN_HELP_UNBAN
CHAN_HELP_REGISTER
CHAN_HELP_DROP
CHAN_HELP_LEVELS
*** Del Strings:
CHAN_PASSWORD_IS
CHAN_SET_PASSWORD_FAILED
CHAN_PASSWORD_CHANGED
CHAN_IDENTIFY_SUCCEEDED
CHAN_IDENTIFY_FAILED
CHAN_HELP_IDENTIFY
CHAN_IDENTIFY_SYNTAX
CHAN_HELP_CMD_IDENTIFY
CHAN_LOGOUT_FOUNDER_FAILED
CHAN_LOGOUT_SUCCEDED
CHAN_LOGOUT_NOT_LOGGEDIN
CHAN_LOGOUT_ALL_SUCCEEDED
CHAN_SERVADMIN_HELP_LOGOUT
CHAN_HELP_LOGOUT
CHAN_LOGOUT_SERVADMIN_SYNTAX
CHAN_LOGOUT_SYNTAX
CHAN_HELP_CMD_LOGOUT
CHAN_GETPASS_UNAVAILABLE
CHAN_GETPASSWORD_IS
CHAN_SERVADMIN_HELP_GETPASS
CHAN_GETPASS_SYNTAX
CHAN_HELP_CMD_GETPASS
CHAN_SENDPASS_SUBJECT
CHAN_SENDPASS_HEAD
CHAN_SENDPASS_LINE_1
CHAN_SENDPASS_LINE_2
CHAN_SENDPASS_LINE_3
CHAN_SENDPASS_LINE_4
CHAN_SENDPASS_LINE_5
CHAN_SENDPASS_OK
CHAN_SENDPASS_UNAVAILABLE
CHAN_HELP_SENDPASS
CHAN_SENDPASS_SYNTAX
CHAN_HELP_CMD_SENDPASS
OPER_DEFCON_NO_CONF
Anope Version 1.9.1
--------------------
*** New Strings:
COMMAND_REQUIRES_PERM
COMMAND_IDENTIFY_REQUIRED
COMMAND_CANNOT_USE
COMMAND_CAN_USE
NICK_STATUS_REPLY
NICK_INFO_SERVICES_OPERTYPE
CHAN_LOGOUT_NOT_LOGGEDIN
CHAN_INVITE_ALREADY_IN
CHAN_INVITE_SUCCESS
CHAN_OP_SYNTAX
CHAN_HALFOP_SYNTAX
CHAN_VOICE_SYNTAX
CHAN_PROTECT_SYNTAX
CHAN_OWNER_SYNTAX
CHAN_DEOP_SYNTAX
CHAN_DEHALFOP_SYNTAX
CHAN_DEVOICE_SYNTAX
CHAN_DEPROTECT_SYNTAX
CHAN_DEOWNER_SYNTAX
CHAN_KICK_SYNTAX
CHAN_BAN_SYNTAX
MEMO_STAFF_SYNTAX
OPER_JUPE_INVALID_SERVER
*** Mod Strings:
NICK_LOGOUT_SERVICESADMIN
CHAN_STATUS_SYNTAX
CHAN_GETKEY_KEY
MEMO_SET_NOTIFY_SYNTAX
BOT_REASON_BADWORD
BOT_BOTLIST_EMPTY
OPER_IGNORE_SYNTAX
OPER_DEFCON_SYNTAX
OPER_HELP_EXCEPTION
OPER_HELP_SESSION
NEWS_LOGON_SYNTAX
NEWS_OPER_SYNTAX
NEWS_RANDOM_SYNTAX
NEWS_HELP_LOGON
NEWS_HELP_OPER
NEWS_HELP_RANDOM
NICK_HELP_STATUS
NICK_HELP_SENDPASS
NICK_SERVADMIN_HELP
NICK_SERVADMIN_HELP_LOGOUT
NICK_SERVADMIN_HELP_DROP
NICK_SERVADMIN_HELP_INFO
NICK_SERVADMIN_HELP_LIST
NICK_SERVADMIN_HELP_ALIST
NICK_SERVADMIN_HELP_GLIST
CHAN_HELP_SET_RESTRICTED
CHAN_HELP_OP
CHAN_HELP_DEOP
CHAN_HELP_VOICE
CHAN_HELP_DEVOICE
CHAN_HELP_HALFOP
CHAN_HELP_DEHALFOP
CHAN_HELP_PROTECT
CHAN_HELP_DEPROTECT
CHAN_HELP_OWNER
CHAN_HELP_DEOWNER
CHAN_HELP_KICK
CHAN_HELP_CLEAR
CHAN_HELP_GETKEY
CHAN_HELP_SENDPASS
CHAN_SERVADMIN_HELP
CHAN_SERVADMIN_HELP_LOGOUT
CHAN_SERVADMIN_HELP_DROP
CHAN_SERVADMIN_HELP_SET
CHAN_SERVADMIN_HELP_INFO
CHAN_SERVADMIN_HELP_LIST
MEMO_HELP_SET_NOTIFY
MEMO_HELP_STAFF
OPER_HELP_CMD_CHANKILL
OPER_HELP_STATS
OPER_HELP_IGNORE
OPER_HELP_UMODE
OPER_HELP_ULINE
OPER_HELP_SVSNICK
OPER_HELP_SET
BOT_HELP
BOT_SERVADMIN_HELP_BOT
BOT_SERVADMIN_HELP_SET
HOST_DELALL_SYNTAX
HOST_SET_SYNTAX
HOST_SETALL_SYNTAX
HOST_DEL_SYNTAX
*** Del Strings:
PERMISSION_DENIED
RAW_DISABLED
HELP_LIMIT_SERV_OPER
HELP_LIMIT_SERV_ADMIN
HELP_LIMIT_SERV_ROOT
HELP_LIMIT_IRC_OPER
HELP_LIMIT_HOST_SETTER
HELP_LIMIT_HOST_REMOVER
NICK_STATUS_0
NICK_STATUS_1
NICK_STATUS_2
NICK_STATUS_3
NICK_INFO_SERVICES_OPER
NICK_INFO_SERVICES_ADMIN
NICK_INFO_SERVICES_ROOT
CHAN_MUST_REGISTER_NICK
CHAN_MUST_IDENTIFY_NICK
OPER_ADMIN_SYNTAX
OPER_ADMIN_SKELETON
OPER_ADMIN_EXISTS
OPER_ADMIN_REACHED_LIMIT
OPER_ADMIN_ADDED
OPER_ADMIN_NOT_FOUND
OPER_ADMIN_NO_MATCH
OPER_ADMIN_DELETED
OPER_ADMIN_DELETED_ONE
OPER_ADMIN_DELETED_SEVERAL
OPER_ADMIN_LIST_EMPTY
OPER_ADMIN_LIST_HEADER
OPER_ADMIN_LIST_FORMAT
OPER_ADMIN_CLEAR
OPER_ADMIN_MOVED
OPER_OPER_SYNTAX
OPER_OPER_SKELETON
OPER_OPER_EXISTS
OPER_OPER_REACHED_LIMIT
OPER_OPER_ADDED
OPER_OPER_NOT_FOUND
OPER_OPER_NO_MATCH
OPER_OPER_DELETED
OPER_OPER_DELETED_ONE
OPER_OPER_DELETED_SEVERAL
OPER_OPER_LIST_EMPTY
OPER_OPER_LIST_HEADER
OPER_OPER_LIST_FORMAT
OPER_OPER_CLEAR
OPER_OPER_MOVED
OPER_SET_SQL_ON
OPER_SET_SQL_OFF
OPER_SET_SQL_ERROR
OPER_SET_SQL_ERROR_INIT
OPER_SET_SQL_ERROR_DISABLED
OPER_RAW_SYNTAX
HELP_HELP
HELP_HELP_BOT
HELP_HELP_HOST
OPER_HELP_CMD_OPER
OPER_HELP_CMD_ADMIN
OPER_HELP_OPER
OPER_HELP_ADMIN
OPER_HELP_SET_SQL
OPER_HELP_RAW
HOST_ID
HOST_NOT_REGGED
HOST_OFF_UNREAL
+35 -14
View File
@@ -32,8 +32,8 @@ Anope DefCon
The DefCon system is part of Anope's core,
The DefCon system has to be configured on your services.conf file to
be enabled. The defcon module will not unload unless all non-optional
directives are set. Look for the defcon block
be enabled. All directives are optional unless they depend on what
options you enable for each level. Look for the "DefCon configuration"
section on your services.conf file for more information.
Make sure you restart Anope after changing the DefCon configuration
@@ -43,19 +43,40 @@ Anope DefCon
Pre-defined DefCon actions:
No new channel registrations
No New Nick Registrations
No MLOCK changes
Force Chan Mode
Use Reduced Session Limit
KILL any new clients trying to connect
Services will ignore everyone but opers
Services will silently ignore everyone but opers
AKILL all new clients trying to connect
No new memos sent to block MemoServ attacks
No new channel registrations 1
No New Nick Registrations 2
No MLOCK changes 4
Force Chan Mode 8
Use Reduced Session Limit 16
KILL any new clients trying to connect 32
Services will ignore everyone but opers 64
Services will silently ignore everyone but opers 128
AKILL all new clients trying to connect 256
No new memos sent to block MemoServ attacks 512
These are the values used to determine each defcon setting, are set via:
DefCon1 XX
DefCon2 XX
DefCon3 XX
DefCon4 XX
To set the desired value, you simply add the value of the numbers together
and place that as your DefCon# setting. For instance:
Say you wish to set:
No Channel Registrations, No Nickname Registrations and Services Ignoring
everyone except for Operators. You would do this by:
1 + 2 + 128 (Each value listed above is added together)
Giving: 131
You would then place this as which ever Defcon setting you want:
Information regarding how to enable this for specific defcon levels can
be found in services.conf
DefCon1 131
The recommended default values are safe to use on any network.
4) Usage
+395 -21
View File
@@ -2,41 +2,415 @@ Anope Internal Events
---------------------
1) Intro
2) Using Events
2) Complex Events
3) Triggered Events
4) Triggered Events List
1) Introduction to Internal Events
Internal Events are setup to give module developers more information
about what the core is doing at different times. This information can
be as complex as data we are feeding to the uplink, to simple triggered
events such as the databases being saved.
Additionally there is a module included with the core
events such as the databases being saved. A list of triggered events
can be found below. Additional there is a module included with the core
which can provide some clue as to how to use the code in your modules.
The rest of this document assumes that you are used to writing modules.
2) Using Events
2) Complex Events
Anope is told about modules wanting to hook to events by the function
ModuleManager::Attach(EventName, Module*);, eg:
This type of events are based around what happens when we talk to the
IRCd, much like MESSAGE events that the IRCD sends to us. The events
are triggered when Anope writes to the ircd. To watch for these events
you must have some knowledge of how the IRCd command system works. In
our example we will trap for NICK events.
ModuleManager::Attach(I_OnJoinChannel, this);
A) All functions most be formatted as:
You can also specifcy an array of events:
int functioname(char *source, int ac, char **av);
Implementation i[] = { I_OnJoinChannel, I_OnPartChannel };
ModuleManager::Attach(i, this, 2);
Where 2 is the number of events in the list
B) In AnopeInit you must declare EvtMessage in some fashion, it is into
this variable that we will create the event handler. Here is what the
base AnopeInit should look like at this point:
int AnopeInit(int argc, char **argv)
{
EvtMessage *msg = NULL;
int status;
You must then overload these functions in your main modules class.
The full list of functions and parameters are in modules.h. In this
case, you would be overloading OnJoinChannel() and OnPartChannel() like so:
moduleAddAuthor(AUTHOR);
moduleAddVersion(VERSION);
return MOD_CONT;
}
void OnJoinChannel(User *u, Channel *c) { }
void OnPartChannel(User *u, Channel *c) { }
Note that AUTHOR and VERSION should be defined above the AnopeInit
function, just like you should do with any module.
Some of these events can be used to prevent or allow things to happen that
would normally not be allowed or denied. You can also use ModuleManager
(not explained here) to set control which order the modules are queried
(when multiple modules hook to the same event).
C) Pass "createEventHandler" the name of the message in this case NICK,
and the function that was created in Step A. At this point you should
assign the return of "createEventHandler" to the EvtMessage variable.
msg = createEventHandler("NICK", my_nick);
D) The Handler is not ready for use yet; now you must add it to the hash
with "moduleAddEventHandler". You will want to pass to this function
the return of "createEventHandler".
status = moduleAddEventHandler(msg);
It will return the same module error codes as adding a regular message,
which you can use to confirm it was added correctly.
E) With that setup in your function you will be passed 3 items. The source
most of the time this will be set to ServerName or NULL; consult our
IRCd documentation about how messages are formatted. AC is the count of
variables you will find in AV.
int my_nick(char *source, int ac, char **av)
{
alog("Internal Event - nick is %s",av[0]);
return MOD_CONT;
}
3) Triggered Events
These events also known as "event hooks" are internal events such as
expiring of nicks to the saving of databases.
A) All functions most be formatted as:
int functioname(int argc, char **argv);
B) In AnopeInit you must declare EvtHook in some fashion; it is into
this variable that we will create the event handler. Here is what
the base AnopeInit should look like at this point:
int AnopeInit(int argc, char **argv)
{
EvtHook *hook = NULL;
int status;
moduleAddAuthor(AUTHOR);
moduleAddVersion(VERSION);
return MOD_CONT;
}
C) Pass "createEventHook" the name of the event. In this case we are
going to hook to the saving of databases, "EVENT_DB_SAVING".
hook = createEventHook(EVENT_DB_SAVING, my_save);
D) The Handler is not ready for use yet; now you must add it to the hash
with "moduleAddEventHook". You will want to pass to this function the
return of "createEventHook"
status = moduleAddEventHook(hook);
It will return the same module error codes as adding a regular message,
which you can use to confirm it was added correctly.
E) With that setup in your function you will be passed 1 item. The message
is very simple; it could be as simple as a start, stop or message. In
the case of saving it has a start and stop.
int my_save(int argc, char **argv)
{
if (argc < 1) {
return MOD_CONT;
}
if (!stricmp(argv[0], EVENT_START)) {
alog("Saving the databases! has started");
} else {
alog("Saving the databases is complete");
}
return MOD_CONT;
}
4) Triggered Events List
Here's a list of all event hooks we currently offer, with a description
of what argument is being passed to the event functions for this type of
event. All arguments are plain-text strings (char *). The list is sorted
in alphabetical order.
Note that all events are emitted AFTER the action has taken place, so
any deleted nick/channel/etc won't exist anymore and any created one will
exist when your function is being run, unless noted otherwise.
Also note that EVENT_START and EVENT_STOP should not be matched with an
equal sign, but with string comparision. See the bundled events module for
an example on how to do this.
The arguments are given as av[0] for the first argument, av[1] for the
second argument, and so on. If av[0] and av[1] are given, the event has
two arguments, and argc should be 2.
EVENT_ACCESS_ADD
An user has been added to a channel access list.
av[0] Name of the channel the user has been added to.
av[1] The nickname of the user that has just added an entry to the
access list.
av[2] The nickname of the user that has been added to the access
list.
av[3] The level number the user has been added with.
EVENT_ACCESS_CHANGE
An user level has been changed on a channel access list.
av[0] Name of the channel the access list has been modified which.
av[1] The nickname of the user that has just modified the access
list of the channel.
av[2] The nickname of the user wich his access level has just been
modified.
av[3] The new access level for the user.
EVENT_ACCESS_CLEAR
A channel access list has been cleared.
av[0] Name of the channel the access list has been cleared of
av[1] The nickname of the user that has cleared the access list
EVENT_ACCESS_DEL
An user has been deleted of a channel access list.
av[0] Name of the channel the access entry has been deleted which.
av[1] The nickname of the user that has just deleted the access entry.
av[2] [OPTIONAL] The nickname of the user wich his access level has just
been removed. Not present if numbers were used (e.g. /cs access
del 7).
EVENT_BOT_ASSIGN
A BotServ bot has been assigned to a channel.
av[0] Name of the channel the bot has been assigned to.
av[1] The nickname of the bot that has been assigned to the channel.
EVENT_BOT_BAN
A BotServ bot has banned a user, e.g. kickers.
av[0] The nick of the user banned.
av[1] The Channel the user was banned from.
av[2] The mask that was banned.
EVENT_BOT_CHANGE
The properties of a BotServ bot have been changed.
av[0] The nickname of the bot involved.
EVENT_BOT_CREATE
A new BotServ bot has been created, and is ready to use.
av[0] The nickname of the newly created bot.
EVENT_BOT_DEL
A BotServ bot is being deleted from BotServ. This event is being sent
just before the actual deletion is performed.
av[0] The nickname of the bot being deleted.
EVENT_BOT_FANTASY
A fantasy command of the bot has been triggered. This event should be
used to create your own fantasy commands.
av[0] The fantasy command that has been triggered without leading '!'.
av[1] The nickname of the user that has triggered the fantasy
command.
av[2] The name of the channel the fantasy command has been triggered
on.
av[3] Contains any optional paramenters passed after the fantasy
command. If none are present, this will not exist, and argc will
will be 3.
EVENT_BOT_FANTASY_NO_ACCESS
A fantasy command of the bot has been triggered by someone without
access to BotServ FANTASY commands on the channel. This will NOT
trigger if someone with access has triggered a fantasy command; use
EVENT_BOT_FANTASY for those. Hook to both events to catch both event
triggers.
av[0] The fantasy command that has been triggered without leading '!'.
av[1] The nickname of the user that has triggered the fantasy
command.
av[2] The name of the channel the fantasy command has been triggered
on.
av[3] Contains any optional paramenters passed after the fantasy
command. If none are present, this will not exist, and argc will
will be 3.
EVENT_BOT_JOIN
A BotServ bot has joined a channel and opped itself.
av[0] The channel name the bot has just joined.
av[1] The nickname of the bot that has joined the channel.
EVENT_BOT_KICK
A BotServ bot has kicked a user from a channel.
av[0] The name of the user that has been kicked.
av[1] The name of the channel the user was kicked from.
av[2] The reason for the kick.
EVENT_BOT_UNASSIGN
A BotServ bot is being unassigned from a channel. This event is being
sent before the actual removing of the bot is done.
av[0] The channel name the bot has been unassigned from.
av[1] The nickname of the bot that has been unassigned.
EVENT_CHAN_DROP
A channel has been dropped and deleted.
av[0] The name of the channel that has been dropped.
EVENT_CHAN_EXPIRE
A channel has been expired and will be deleted. The event will be
emitted just before the actual channel deletion happens.
av[0] The name of the channel that has been expired.
EVENT_CHAN_FORBIDDEN
A channel has been forbidden (ChanServ FORBID).
av[0] The name of the channel that has been forbidden.
EVENT_CHAN_KICK
Someone has just been kicked from a channel.
av[0] The nick of the user that has been kicked.
av[1] The channel the user has been kicked from.
EVENT_CHAN_REGISTERED
A new channel has been registered.
av[0] The name of the channel that has been registered.
EVENT_CHAN_SUSPENDED
A channel has been suspended (ChanServ SUSPEND).
av[0] The name of the channel that has been suspended.
EVENT_CHAN_UNSUSPEND
A channel has been unsuspended (ChanServ UNSUSPEND).
av[0] The name of the channel that has been unsuspended.
EVENT_CHANGE_NICK
A user has just changed it's nick.
av[0] The new nickname of the user.
EVENT_CONNECT
This event is emitted when the connection to our uplink hub is being
made.
av[0] EVENT_START or EVENT_STOP, to indicate if it's emitted before
or after the connection has been made. EVENT_STOP is emitted
before our burst is being sent over the link.
EVENT_DB_EXPIRE
This event is emitted when the expiry routines for all things that can
expire in Anope are being run.
av[0] EVENT_START or EVENT_STOP, to indicate if it's being emitted
before or after the expiry routines have been run.
EVENT_DB_SAVING
This event is emitted when the databases are being saved.
av[0] EVENT_START or EVENT_STOP, to indicate if it's emitted before
or after the saving routines have been run.
EVENT_DB_BACKUP
This event is emitted when the databases are backed up.
av[0] EVENT_START when the backup commences, and EVENT_STOP when it
finishes.
EVENT_DEFCON_LEVEL
The DefCon level has just been changed. This event is emitted before
any DefCon-related action is taken. The internal DefConLevel has
already been raised at this point.
av[0] The new level of DefCon being invoked.
EVENT_GROUP
A user has grouped it's nickname to another user group.
av[0] The nickname of the user that joined the group.
EVENT_JOIN_CHANNEL
A user joins a channel.
av[0] EVENT_START or EVENT_STOP. EVENT_START when the user has passed
all access checks and is allowed to join, but has not yet
joined the channel. EVENT_STOP when the user has joined and all
needed modes are set etc.
av[1] The nickname of the user joining the channel.
av[2] The name of the channel the user has joined.
EVENT_NEWNICK
A new user has been introduced on the network.
av[0] The nickname of the newly introduced user.
EVENT_NICK_DROPPED
A user's nick has just been dropped. Note that the nickname information
has already been deleted!
av[0] The nickname of the user that has just been dropped.
EVENT_NICK_EXPIRE
A user's nick has just expired. Note that, as with EVENT_NICK_DROPPED,
the nickname information has already been deleted!
av[0] The nickname of the user that has just expired.
EVENT_NICK_FORBIDDEN
A user's nick has just been forbidden.
av[0] The nickname that has just been forbidden.
EVENT_NICK_IDENTIFY
A user has just identified for it's nickname with NickServ.
av[0] The nickname of the user that just identified.
EVENT_NICK_LOGOUT
A user has just (been) logged out.
av[0] The nickname of the user that has (been) logged out.
EVENT_NICK_REGISTERED
A new user has just registered it's nickname. This event is being
emitted when the registration is completed, but the user modes have not
yet been set.
av[0] The nickname of the newly registered user.
EVENT_NICK_SUSPENDED
A user's nick has just been suspended.
av[0] The nickname that has just been suspended.
EVENT_NICK_UNSUSPEND
A user's nick has just been unsuspended.
av[0] The nickname that has just been unsuspended.
EVENT_PART_CHANNEL
A user parts a channel.
av[0] EVENT_START or EVENT_STOP. EVENT_START when the user is about
to be removed from the channel internally, EVENT_STOP when
this has been done.
av[1] The nickname of the user parting the channel.
av[2] The name of the channel the user has parted.
av[3] The reason the user parted the channel, this is not always sent
so check the count to make sure it was passed. (ac == 4)
EVENT_RELOAD
This event is emitted after the configuration file has been reloaded.
av[0] Always EVENT_START.
EVENT_RESTART
This event is emitted before the services are being restarted.
av[0] Always EVENT_START.
EVENT_SERVER_CONNECT
A new server has just connected to the network.
av[0] The name of the new server.
EVENT_SERVER_SQUIT
A server has sent an SQUIT and is about to be removed from the
network. This event is being sent before the server is actually
removed from the network.
av[0] The name of the server that is being removed.
EVENT_SHUTDOWN
This event is emitted when Anope is being shut down.
av[0] EVENT_START or EVENT_STOP, to indicate where in the process of
restarting the core is. With EVENT_START, services are still
fully online and operating. With EVENT_STOP, every internal
clean up has been done already, and the SQUIT has been sent;
the only thing done after emitting the event is closing the
socket to the uplink hub.
EVENT_SIGNAL
This event is emitted when Anope is quitting because of a signal it
received.
av[0] The quit message that will be sent with the SQUIT for this
shutdown.
EVENT_TOPIC_UPDATED
A channel topic has been succesfully updated. Note that this event is
only emitted if the new topic has been fully accepted and set by the
Anope core.
av[0] The name of the channel involved.
av[1] The new topic set on the channel.
EVENT_USER_LOGOFF
A user has left the network. This event is emitted before the internal
removal is performed, so the user still exists internally.
av[0] The nickname of the user leaving the network.
+1 -10
View File
File diff suppressed because one or more lines are too long
+31 -35
View File
@@ -6,7 +6,7 @@ Anope Installation Instructions
3) Setting up the IRCd
4) Starting Anope
5) Setting up a crontab
Note: You should also read the README and FAQ files!
1) Installing Anope
@@ -21,35 +21,15 @@ Note: You should also read the README and FAQ files!
http://www.anope.org/
Anope can be built one of two ways. The recommended way is to use CMake.
You can check if CMake is already installed on your system using the
command:
cmake --version
If it's installed, you will get a line that says something similar to
"cmake version 2.6-patch 1". If the version is less than 2.4 or you get
an error saying the command was not found, you will not be able to use
CMake unless you install it yourself into your home directory. CMake
can be downloaded from:
http://www.cmake.org/cmake/resources/software.html
If you are unable to install CMake yourself (either due to lack of space
or restrictions by your hosting provider), you still have the alternative
to use the provided configure script. This option is not recommended and
will eventually be phased out, but is provided for compatibility for those
lacking CMake.
Next, unpack the package in your home directory, and go into the created
directory.
Now type ./Config to start the configuration script. It will ask you a
few questions, and figure out how to compile Anope on your system. If
you are unsure about the answer to a question, use the default value.
The question to using configure or cmake depends on your decision from
above. If you have CMake and wish to use it, answer with cmake, otherwise
answer with configure.
you are unsure about the answer to a question, use the default value.
NOTE: although you may specify different binary and data paths, it is
RECOMMENDED that you use the same value for both.
You can now type make to compile Anope. If there are errors in the
Makefile, *try to use gmake* instead. If it still doesn't work, you (or
@@ -64,10 +44,10 @@ Note: You should also read the README and FAQ files!
the memos of any user.
If you see errors during this process, please mail us with the *complete*
error output, and don't forget to mention your OS, compiler and C++ library
versions.
error output, and don't forget to mention your OS, compiler and C library
versions.
Now go into the data directory (by default, ~/services/data). Copy the example
Now go into the data directory (by default, ~/services). Copy the example
configuration file (example.conf) to services.conf, and open the latter
with your favorite text editor. It contains all the configuration
directives Anope will use at startup. Read the instructions contained in
@@ -93,7 +73,8 @@ Note: You should also read the README and FAQ files!
section 1. There are however a few specific guidelines:
* IMPORTANT: Back up your old databases!
* If you are upgrading to a new major release, ALWAYS restart a
* Check Changes.conf for the new version for small config changes.
* If you are upgrading to a new major release, create a
fresh configuration file from example.conf.
3) Setting up the IRCd
@@ -135,21 +116,34 @@ Note: You should also read the README and FAQ files!
Don't forget to /rehash your IRCd to apply changes.
A new trend in ircd configuration is popping all over the place, good
examples are the latest Hybrid, Unreal and Bahamut, which use a more
examples are the latest Hybrid, Unreal, Bahamut & InspIRCd, which use a more
"readable" form of configuration. For those, use something like:
UnrealIRCd
link services.localhost.net
{
username *;
hostname localhost;
bind-ip *;
port 6667;
port 7000;
hub *;
password-connect "mypass";
password-receive "mypass";
class servers;
};
InspIRCd
<link name="services.localhost.net"
ipaddr="127.0.0.1"
port="7000"
allowmask="127.0.0.0/8"
sendpass="mypass"
recvpass="mypass">
Note that this block-style configuration files differ heavily, depending
on the IRCd. Consult the interactive link maker (link is below) for more
details on the exact configuration used by your IRCd.
@@ -157,7 +151,9 @@ Note: You should also read the README and FAQ files!
If you're unable to get a link with your IRCd after reading this section,
you might try the interactive link maker, which is located at:
http://anope.org/ilm.php
http://www.anope.org/ilm.php
Or finally, contact your IRCd Support Community to seek advice.
4) Starting Anope
@@ -166,7 +162,7 @@ Note: You should also read the README and FAQ files!
If there are syntax errors in the configuration file they will be
displayed on the screen. Correct them until there are no errors anymore.
A successful startup won't generate any message.
A successful startup won't generate any message.
Give Services at least one minute to link to your network, as certain
IRCds on some OSes may be really slow for the link process. If nothing
@@ -174,8 +170,8 @@ Note: You should also read the README and FAQ files!
to launch Anope with ./services -debug -nofork to see any errors that it
encounters, and try to correct them.
If you need help to solve errors, feel free to subscribe to the Anope
mailing list and ask there. See the README file for details.
If you need help to solve errors, feel free to visit us on IRC at
irc.anope.org #anope and ask there. See the README file for further details.
5) Setting up a crontab
+538 -378
View File
@@ -1,378 +1,538 @@
How To Add IRCd Support
-----------------------
1) Files to Edit
2) The Code
3) The IRCDVar struct
4) Modes
5) Functions / Events
6) CAPAB/PROTOCTL
7) IRCDProto Class
1) Files to Edit
When preparing to add supprt to Anope for your IRCd, you need to edit
the following files
A) Make a copy of the .cpp file of the IRCd that matches the IRCd that
you are attempting to add support for best.
B) Add your IRCd into the supported IRCds in example.conf
2) The Code
Here is where the code of the .cpp file comes in. Be prepared to spend at
least an hour, if not longer, going over the code and getting it right;
Especially if you are setting up an ircd that is completely different
than the one you used as a base. This section covers the majority of the
code that is in use.
The first bit of code you will face is the IRCDVar structure, which is
explained in depth in the next section.
Scroll down to the bottom and find the class for this module and rename it
to something reflecting your IRCd name. Find the function:
pmodule_ircd_version("Unreal 3.2+");
This is the protocol name which will appear in various places; especially
when you do -version at the command prompt, this is where you state the
server name. The version is not always needed unless you are showing that
the support is for one branch of a ircd family, such as Unreal 3.1 and
Unreal 3.2.
The next task that you will face is setting whether the IRCD sends time
stamps on modes but does not tell us that it will do so. If it does, set
UseTSMODE to 1; if it does not set it to be 0. If you're not sure refer
to your IRCd's documentation on how MODE is sent.
pmodule_ircd_useTSMode(0);
3) The IRCDVar struct
Now you've come to the part where you setup your ircd. There are two
structs which hold this information; This allows you to quickly setup
your specific ircd.
IRCDVar myIrcd[] = { };
This struct contains your basic IRCd functions. Your base source file has
the list of all available variables; note that you should not swap any
around, or you will break stuff. Here is a brief description of the usage
of each.
1) Name: This member tells Anope about the IRCD's name. It may contain
text about it's name and version. This is used to identify the
build on startup.
2) Pseudo Client Mode: This is the user mode set by Anope on all BotServ
bots. Normally you want this to be a some form of
service or bot flag; you can use + for no mode at
all.
3) Max Channelmode Symbols: This is the total number of possible channel
modes that can appear before a nick. Do
remember to count each possible mode, so +ov
is 2.
4) Channelmode for bots: When a BotServ bot joins a channel, this is the
mode set on them. Normally you will want them
opped (+o), and protected (+a) on IRCd's that
support it.
5) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise,
KILL is used. Use 1 for yes, 0 for no.
6) VHOST: Can a user's host be changed on the fly? Enabling this allow
HostServ online. Use 1 for yes, 0 for no.
7) SGLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
0 for no.
8) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
9) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no.
10) Number of Server Args: When an IRCd connects, this is the number of
parameters that are passed.
11) Join to Set: Services must join a channel to set any modes on that
channel. Use 1 for yes, 0 for no.
12) Join to Message: Services must join a channel to send any message to
that channel (cannot override +n). Use 1 for yes,
0 for no.
13) TS Topic Forward: Some IRCd's (like UnrealIRCd) like their topic TS
set forward by +1. Use 1 for yes, 0 for no.
14) TS Topic Backward: Some IRCd's (mainly older DreamForge-like ones)
like their topic TS set back by -1. Use 1 for yes,
0 for no.
15) SQline Channels: The IRCd's supports banning channel names via
SQLINES. Use 1 for yes, 0 for no.
16) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a
QUIT message for that user? Use 1 for yes, 0 for no.
17) SVSMODE -b: We can use SVSMODE to unban hosts from a channel. Use
1 for yes, 0 for no.
18) Reverse: We can do a reverse check when unbanning. For use with
DreamForge based IRCd's. Use 1 for yes, 0 for no.
19) vIdent: Support for including a user's ident in their vHost. Use
1 for yes, 0 for no.
20) SVSHOLD: Support for temporarily 'holding' a nick, instead of using
a nick enforcer client. Use 1 for yes, 0 for no.
21) TS on MODE: We need to send a timestamp when modes are being changed.
Use 1 for yes, 0 for no.
22) NICKIP: The IP address of new users is being sent along with their
hostname when new users are being introduced on the network.
Use 1 for yes, 0 for no.
23) OMODE: We can use OperServ to give some user a temporary O:LINE.
Use 1 for yes, 0 for no.
24) Umode: We can use OperServ to change a user's mode. Use 1 for yes,
0 for no.
25) Vhost On Nick: On NICK the IRCd sends the VHOST. Use 1 for yes,
0 for no.
26) Change Realname: Change real name. Use 1 for yes, 0 for no.
27) Check Nick ID: Should we check if a user should remain identified when
changing their nick? This is for IRCd's that remove
their registered-user mode when someone changes their
nick (like Bahamut does).
Use 1 for yes, 0 for no.
28) No Knock Requires +i: Does the No Knock channel mode require invite
only channels? Use 1 for yes, 0 for no.
29) Chan Modes: If sent in CAPAB/PROTOCOL, we store it in here. This is
NULL by default.
30) Tokens: Can we use tokens to talk to the IRCd? Use 1 for yes,
0 for no.
31) base64 SJOIN TS: Are the timestamps sent with a SJOIN in base64? Use
1 for yes, 0 for no.
32) SJOIN Ban Char: Character used to identify bans. Use ''.
33) SJOIN Except Char: Character used to identify exceptions. Use ''.
34) SJOIN Invite char: Character used to idenfity invexs. Use ''.
35) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
1 for yes, 0 for no.
36) SGline Enforce: Does the IRCd enforce SGLINES for us or do we need to
do so? Use 1 for yes, 0 for no.
37) Vhost Character: The character used to represent the vHost mode, if
this is supported by the IRCd.
38) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
39) P10: Is this IRCd a P10-style IRCd? Use 1 for yes, 0 for no.
40) Character Set: Unreal passes the character set during PROTOCTL,
the value is stored here. Set this NULL to start.
41) Channel CIDR: Set to 1 if channel bans, excepts and invites
support CIDR masks. Expected syntax: *!*@ip/mask.
When set to 1, anope will only parse strict CIDR masks.
IRCd's that try to correct invalid CIDR's (like nefarious)
will need a custom implementation in the core.
Contact the anope Dev Team if this is the case.
Set to 0 if CIDR's are not supported by your IRCd.
42) Global TLD Prefix: Prefix used to send global messages, should probably
be "$"
43) Max Modes: The max number of mode changes we can send in one line
4) Modes
Anope is told about modes in the moduleAddModes() function.
For the most part, the syntax for adding channel and user modes are:
ModeManager::AddUserMode(new UserMode(UMODE_NETADMIN, 'N'));
Where 'N' is the char for the mode, and UMODE_NETADMIN shows what the
mode does. Or:
ModeManager::AddChannelMode(new ChannelMode(CMODE_BLOCKCOLOR, 'c'));
Where 'c' is the char for the mode and CMODE_BLOCKCOLOR shows what
the mode does
A full list of valid mode names for the second param can be found
in services.h in the enum for ChannelModeName and UserModeName
If necessary, you can add additional modes to this list.
Adding simple modes with parameters is similar, instead adding a
'new ChannelMode', use 'new ChannelModeParam', set the third optional
arg of ChannelModeParam to false if the param should NOT be sent when unsetting
it. Eg:
ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, 'j', true));
Anope will internally track the params, and they can be retrieved through
Channel::GetParam();
If you want to make param validity checking for a mode, you must create a new
class which inherits from ChannelModeParam and overload the IsValid function.
Modes CMODE_OPERONLY, CMODE_ADMINONLY, and CMODE_REGISTERED already exist
internally as classes, to overload the CanSet function to disable non opers
from mlocking (or in CMODE_REGISTERED's case, anyone) from setting them.
This should be added like:
ModeManager::AddChannelMode(new ChannelModeOper('O'));
The CMODE_FLOOD param also has its own class, but due to the wide range of
valid parameters accepted across IRCds, your protocol module MUST have the
IsValid function for this.
bool ChannelModeFlood::IsValid(const std::string &value) { }
5) Functions and Events
A brief word about functions and events. All events are captured using:
void moduleAddIRCDMsgs(void)
{
m = createMessage("NICK", anope_event_nick);
addCoreMessage(IRCD,m);
}
Each event should have a event handler if its important enough to be
processed by services. All event functions should be formed like this:
int anope_event_capab(char *source, int ac, char **av)
{
return MOD_CONT;
}
They will receive the source; this can be NULL at times depending on the
event. Next, ac is the number of arguments that are in the event, and av
holds the values for each; so av[0] is the first variable, av[1] will be
the second one, and so on. Events are likely to pass to various upper
level event handlers; see the previous ircd source for how they handle
these events.
All commands are formed like this:
void anope_cmd_svsnoop(char *server, int set)
{
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
They may take any number of arguments, depending on the command. They
should eventually come to a send_cmd(); this root function is how
commands are sent to the IRCd.
6) CAPAB/PROTOCTL
Most IRCD send a CAPAB or PROTOCTL line so that they can work out what
the other end of the connection is capable of doing. Anope has a function
to read these lines and set itself up to to handle these events better.
When adding support for your ircd, take the following steps.
1) In the module constructor you must tell Anope what the uplink is capable of that
isn't already passed in the CAPAB/PROTOCTL, you do this by something similar to:
CapabType c[] = { CAPAB_NOQUIT, CAPAB_NICKIP, CAPAB_ZIP, CAPAB_TOKEN, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT, CAPAB_CHANMODE, CAPAB_SJB64, CAPAB_NICKCHARS };
for (unsigned i = 0; i < 11; ++i)
Capab.SetFlag(c[i]);
Anything else given to Anope in the CAPAB/PROTOCTL message will be handled later by CapabParse.
The available CAPAB options are:
--------------------------------------------------------------------------
Define | Description
----------------|------------|-----------|--------------------------------
CAPAB_NOQUIT | NOQUIT protocol support
CAPAB_TSMODE | Chanmodes are timestamped
CAPAB_UNCONNECT | UNCONNECT protocol support
CAPAB_NICKIP | IP sent in the NICK line
CAPAB_NSJOIN | Smart SJOIN support
CAPAB_ZIP | Support for gzipped links
CAPAB_BURST | Supports BURST command
CAPAB_TS3 | Support for TS3 protocol
CAPAB_TS5 | Support for TS5 protocol
CAPAB_DKEY | DH-Key exchange using DKEY
CAPAB_DOZIP | Link traffic will be gzipped
CAPAB_DODKEY | Do DKEY with this link
CAPAB_QS | Supports quit storm removal
CAPAB_SCS | String Cache System support
CAPAB_PT4 | Support for PT4 protocol
CAPAB_UID | Support for UIDs
CAPAB_KNOCK | Supports KNOCK
CAPAB_CLIENT | Supports CLIENT
CAPAB_IPV6 | Support for IPv6 addresses
CAPAB_SSJ5 | Smart Join protocol 5 support
CAPAB_SN2 | Support for SN2 protocol
CAPAB_VHOST | Supports VHOST protocol
CAPAB_TOKEN | Supports s2s tokens
CAPAB_SSJ3 | Smart Join protocol 3 support
CAPAB_NICK2 | Support for extended NICK (v2)
CAPAB_UMODE2 | Supports UMODE2 command
CAPAB_VL | VLine information in info field
CAPAB_TLKEXT | Not 8, but 10 params in TKL's
CAPAB_CHANMODE | Channel modes are passed here
CAPAB_SJB64 | SJOIN timestamps are base64 encoded
CAPAB_NICKCHARS | Character set used by the IRCD for nicks
2) In the ircd.c find the function anope_cmd_capab(); this function will
send the CAPAB/PROTOCTL line (consult your ircd documentation for
which to send). In a single line type in the tokens that anope must
send. Here is an example of Hybrid's capab line:
/* CAPAB */
void anope_cmd_capab()
{
send_cmd(NULL, "CAPAB TS5 EX IE HOPS HUB AOPS");
}
3) Ensure that the CAPAB/PROTOCTL event his handled correctly.
A) In the function module constructor make sure that you have the
following two lines:
m = createMessage("CAPAB", anope_event_capab);
addCoreMessage(IRCD,m);
B) Add the function to handle the event
int anope_event_capab(char *source, int ac, char **av)
{
CapabParse(ac, av);
return MOD_CONT;
}
This function should call the CapabParse function which parses
the received CAPAB/PROTOCTL line.
7) IRCDProto Class
The IRCDProto class is set up like:
class MyIRCdProto : public IRCDProto { } ircdproto;
And told to Anope through the
pmodule_ircd_proto(&ircd_proto);
function.
This is used for sending out specific messages from Anope to your IRCd.
A list of all of the valid function names to overload and their args
are in services.h. If the protocol module you are editing is similar enough
to the IRCd you are adding support for, many of these probably won't need to
be changed.
How To Add IRCd Support
-----------------------
1) Files to Edit
2) Modifing the Header File
3) The Code
4) Modes
5) Functions / Events
6) CAPAB/PROTOCTL
1) Files to Edit
When preparing to add support to Anope for your ircd, you need to edit
the following files.
A) Make a copy of the .c and .h file of the IRCd that matches the ircd
that you are attempting to add support for best.
First step in this process is to rename the .c and .h file after the IRCd
that you are going to be adding support for. Its recommended that you come
up with a name that is clear and easy to understand.
You are now ready to start getting into the code.
2) Modifying the Header File
Now that you have gotten past the first part of the creation process, you
are into the code. This part is the harder and more complex part. You
will need a general understanding of C code to continue. Here are the
step by step instructions required to make this work.
Open the .h file and find the section of code with
#define UMODE_a 0x00000001
#define UMODE_b 0x00000002
This is where you define the MODES. All user modes are stored
with UMODE_ followed by a letter matching the modes case; be careful to
use the correct case as this will make it clear when you setup MODES in
the .c in a few. Use hex values for the modes so starting at 0x00000001
to 0x8000000. In most cases you want to list all modes. If you run out of
values look at removing any modes that do not impact services.
Channel modes are done much like user modes, with the exception that
bans, exceptions, invites, and modes that are applied to a user such as
op and voice are not defined here. All other modes are defined in here.
Again be clear and use the correct case and use hex values as done with
user modes.
Finally we come to DEFAULT_MLOCK; this is the mode that services will set
by default on channels when they are registered. In general you want this
to be what is acceptable by the ircd; in most cases this is "+ntr". This is
expressed by:
#define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r
3) The Code
Here is where the code of the .c file comes in. Be prepared to spend at
least an hour, if not longer, going over the code and getting it right;
Especially if you are setting up an ircd that is completely different
than the one you used as a base. This section covers the majority of the
code that is in use.
The first bit of code you will face is:
IRCDVar ircd[] = { }
This struct contains your basic IRCd functions. Your base source file has
the list of all available variables; note that you should not swap any
around, or you will break stuff. Here is a brief description of the usage
of each.
1) Name: This member tells Anope about the IRCD's name. It may contain
text about it's name and version. This is used to identify the
build on startup.
2) NickServ Mode: This is the user mode set by Anope on NickServ.
Normally you want this to be some form of oper flag,
or a services flag.
3) ChanServ Mode: This is the user mode set by Anope on ChanServ.
Normally you want this to be some form of oper flag,
or a services flag.
4) MemoServ Mode: This is the user mode set by Anope on MemoServ.
Normally you want this to be some form of oper flag,
or a services flag.
5) HostServ Mode: This is the user mode set by Anope on HostServ.
Normally you want this to be some form of oper flag,
or a services flag. Note that if your ircd does not
support HostServ, you can safely make this NULL or +,
as there is a check before bringing HostServ online.
6) OperServ Mode: This is the user mode set by Anope on OperServ.
Normally you want this to be some form of oper flag,
or a services flag.
7) BotServ Mode: This is the user mode set by Anope on BotServ.
Normally you want this to be some form of oper flag,
or a services flag.
8) HelpServ Mode: This is the user mode set by Anope on HelpServ.
Normally you want this to be some form of oper flag,
or a services flag.
9) DevNull Mode: This is the user mode set by Anope on DevNull.
Normally you want this to be some form of oper flag,
or a services flag.
10) Global Mode: This is the user mode set by Anope on Global.
Normally you want this to be some form of oper flag,
or a services flag.
11) NickServ Alias Mode: This is the user mode set by Anope on the alias
of NickServ. Normally you want this to be some
form of oper flag, or a services flag.
12) ChanServ Alias Mode: This is the user mode set by Anope on the alias
of ChanServ. Normally you want this to be some
form of oper flag, or a services flag.
13) MemoServ Alias Mode: This is the user mode set by Anope on the alias
of MemoServ. Normally you want this to be some
form of oper flag, or a services flag.
14) HostServ Alias Mode: This is the user mode set by Anope on the alias
of MemoServ. Normally you want this to be some
form of oper flag, or a services flag. Note that
if your ircd does not support HostServ, you can
safely make this NULL or +, as there is a check
before bringing HostServ online.
15) OperServ Alias Mode: This is the user mode set by Anope on the alias
of OperServ. Normally you want this to be some
form of oper flag, or a services flag.
16) BotServ Alias Mode: This is the user mode set by Anope on the alias
of BotServ. Normally you want this to be some
form of oper flag, or a services flag.
17) HelpServ Alias Mode: This is the user mode set by Anope on the alias
of HelpServ. Normally you want this to be some
form of oper flag, or a services flag.
18) DevNull Alias Mode: This is the user mode set by Anope on the alias
of DevNull. Normally you want this to be some
form of oper flag, or a services flag.
19) Global Alias Mode: This is the user mode set by Anope on the alias
of Global. Normally you want this to be some form
of oper flag, or a services flag.
20) BotServ Bots Mode: This is the user mode set by Anope on all BotServ
bots. Normally you want this to be a some form of
service or bot flag; you can use + for no mode at
all.
21) Max Channelmode Symbols: This is the total number of possible channel
modes that can appear before a nick. Do
remember to count each possible mode, so +ov
is 2.
22) Modes to Remove: This is every mode that Anope should remove when
stripping channel modes.
23) Channelmode for bots: When a BotServ bot joins a channel, this is the
mode set on them. Normally you will want them
opped (+o), and protected (+a) on IRCd's that
support it.
24) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise,
KILL is used. Use 1 for yes, 0 for no.
25) VHOST: Can a user's host be changed on the fly? Enabling this allow
HostServ online. Use 1 for yes, 0 for no.
26) OWNER: Has a channel umode for being the channel owner. For example,
UnrealIRCd has mode +q. Use 1 for yes, 0 for no.
27) OWNER MODE SET: What mode to set to make someone the owner. If the
IRCd doesn't support owners, set this to NULL.
28) OWNER MODE UNSET: What mode to unset to take away someone's channel
owner status. If the IRCd doesn't support owners,
set this to NULL.
29) ADMIN MODE SET: What mode to set to make someone a channel admin.
If the IRCd dosn't support admins, set to NULL.
30) ADMIN MODE UNSET: What mode to unset to take away channel admin.
If the IRCd dosn't support admins, set to NULL.
31) Mode on Nick Register: What mode to give users when they register
with NickServ. If your ircd doesn't set expect
a mode to be set on registration, you should
set this to NULL.
32) Mode on Root ID: What modes to set on services roots when they identify
33) Mode on Admin ID: What modes to set on services admins when they identify
34) Mode on Oper ID: What modes to set on services opers when they identify
35) Mode on Nick Unregister: What mode to set give users when they cancel
their registration with NickServ. If your
IRCd doesn't set a mode for registered users
you should set this to NULL.
36) Mode on Nick Change: What mode to give users when they change their
nick. If your ircd doesn't set a mode, you
should set this to NULL.
37) SGLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
0 for no.
38) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
39) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no.
40) HALFOP: Is channel mode +h for halfop supported by the IRCd? Use 1 for
yes, 0 for no.
41) Number of Server Args: When an IRCd connects, this is the number of
parameters that are passed.
42) Join to Set: Services must join a channel to set any modes on that
channel. Use 1 for yes, 0 for no.
43) Join to Message: Services must join a channel to send any message to
that channel (cannot override +n). Use 1 for yes,
0 for no.
44) Exceptions: Support for channel exceptions (mode +e). Use 1 for yes,
0 for no.
45) TS Topic Forward: Some IRCd's (like UnrealIRCd) like their topic TS
set forward by +1. Use 1 for yes, 0 for no.
46) TS Topic Backward: Some IRCd's (mainly older DreamForge-like ones)
like their topic TS set back by -1. Use 1 for yes,
0 for no.
47) Protected Umode: UMODE_ define that defines the protected usermod.
Use 0 for no support, or enter the UMODE_ define.
48) Admin: Support for channel admins (Mainly used by UltimateIRCd). Use
1 for yes, 0 for no.
49) SQline Channels: The IRCd's supports banning channel names via
SQLINES. Use 1 for yes, 0 for no.
50) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a
QUIT message for that user? Use 1 for yes, 0 for no.
51) SVSMODE -b: We can use SVSMODE to unban hosts from a channel. Use
1 for yes, 0 for no.
52) Protect: Support for channel protect (mode +a, mainly being used by
UnrealIRCd and ViagraIRCd). Use 1 for yes, 0 for no.
53) Reverse: We can do a reverse check when unbanning. For use with
DreamForge based IRCd's. Use 1 for yes, 0 for no.
54) Register Channels: Supports sending a channelmode for registered
channels. Use 1 for yes, 0 for no.
55) Registered Mode: Channelmode to set on registered channels, see the
option above. Use 1 for yes, 0 for no.
56) vIdent: Support for including a user's ident in their vHost. Use
1 for yes, 0 for no.
57) SVSHOLD: Support for temporarily 'holding' a nick, instead of using
a nick enforcer client. Use 1 for yes, 0 for no.
58) TS on MODE: We need to send a timestamp when modes are being changed.
Use 1 for yes, 0 for no.
59) NICKIP: The IP address of new users is being sent along with their
hostname when new users are being introduced on the network.
Use 1 for yes, 0 for no.
60) Omode: We can use OperServ to change a user's mode. Use 1 for yes,
0 for no.
61) Umode: We can use OperServ to change a user's mode. Use 1 for yes,
0 for no.
62) Vhost On Nick: On NICK the IRCd sends the VHOST. Use 1 for yes,
0 for no.
63) Change Realname: Change real name. Use 1 for yes, 0 for no.
64) No Knock: CMODE_ that defines NO KNOCK. Use 0 for no support.
65) Admin Only: CMODE_ that defines Admin Only. Use 0 for no support.
66) Default MLock: Default channelmodes for MLOCK. Use 0 for no modes.
67) Vhost Umode: UMODE_ that indicates if the user currently has a vHost.
Use 0 for no support.
68) Flood Mode: The IRCd has a channelmode for blocking floods. Use 1 for
yes, 0 for no.
69) Link Mode: The IRCd has a channelmode for linking a channel to some
other channel. Use 1 for yes, 0 for no.
70) CMode F: CMODE_ that defines flood mode. Use 0 for no support.
71) CMode L: CMODE_ that defines link mode. Use 0 for no support.
72) Check Nick ID: Should we check if a user should remain identified when
changing their nick? This is for IRCd's that remove
their registered-user mode when someone changes their
nick (like Bahamut does).
Use 1 for yes, 0 for no.
73) No Knock Requires +i: Does the No Knock channel mode require invite
only channels? Use 1 for yes, 0 for no.
74) Chan Modes: If sent in CAPAB/PROTOCOL, we store it in here. This is
NULL by default.
75) Tokens: Can we use tokens to talk to the IRCd? Use 1 for yes,
0 for no.
76) Token Case Senstive: Are the IRCd's TOKENS/COMMANDS case sensitive?
Use 1 for yes, 0 for no.
77) base64 SJOIN TS: Are the timestamps sent with a SJOIN in base64? Use
1 for yes, 0 for no.
78) Supports +I: Does the IRCd support channelmode +I? Use 1 for yes,
0 for no.
79) SJOIN Ban Char: Character used to identify bans. Use ''.
80) SJOIN Except Char: Character used to identify exceptions. Use ''.
81) SJOIN Invex Char: Character used to identify invexes. Use ''.
82) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
1 for yes, 0 for no.
83) SGline Enforce: Does the IRCd enforce SGLINES for us or do we need to
do so? Use 1 for yes, 0 for no.
84) Vhost Character: The character used to represent the vHost mode, if
this is supported by the IRCd.
85) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
86) UMode +h: Does the IRCd support usermode +h for helpers?
Use 1 for yes, 0 for no.
87) P10: Is this IRCd a P10-style IRCd? Use 1 for yes, 0 for no.
88) Character Set: Unreal passes the character set during PROTOCTL,
the value is stored here. Set this NULL to start.
89) Reports sync: Does the IRCd report when it's in sync (or done bursting,
depending on how you want to say it)? Remember to set
the sync state for servers correctly if it does.
Use 1 for yes, 0 for no.
90) Channel CIDR: Set to 1 if channel bans, excepts and invites
support CIDR masks. Expected syntax: *!*@ip/mask.
When set to 1, anope will only parse strict CIDR masks.
IRCd's that try to correct invalid CIDR's (like nefarious)
will need a custom implementation in the core.
Contact the anope Dev Team if this is the case.
Set to 0 if CIDR's are not supported by your IRCd.
91) Throttle Mode: The IRCd has a channelmode for throttling joins per-user.
Use 1 for yes, 0 for no.
92) CMode j: CMODE_ that defines throttle mode. Use 0 for no support.
93) Delayed client introduction: Delay the introduction of services pseudo-
client till after we have received the uplinks
CAPAB.
So we've had this long list. Now there's a second struct to fill. This
struct isn't as long as the previous one though, so we'll handle it quite
quick compared to the previous one.
IRCDCAPAB ircdcap[] = { }
This struct is based on the CAPAB defines. You should review the CAPAB
table below to see how this should be done.
Define Table
--------------------------------------------------------------------------
Define | Value | Token | Description
----------------|------------|-----------|--------------------------------
CAPAB_NOQUIT | 0x00000001 | NOQUIT | NOQUIT protocol support
CAPAB_TSMODE | 0x00000002 | TS | Chanmodes are timestamped
CAPAB_UNCONNECT | 0x00000004 | UNCONNECT | UNCONNECT protocol support
CAPAB_NICKIP | 0x00000008 | NICKIP | IP sent in the NICK line
CAPAB_NSJOIN | 0x00000010 | SSJOIN | Smart SJOIN support
CAPAB_ZIP | 0x00000020 | ZIP | Support for gzipped links
CAPAB_BURST | 0x00000040 | BURST | Supports BURST command
CAPAB_TS3 | 0x00000080 | TS3 | Support for TS3 protocol
CAPAB_TS5 | 0x00000100 | TS5 | Support for TS5 protocol
CAPAB_DKEY | 0x00000200 | DKEY | DH-Key exchange using DKEY
CAPAB_DOZIP | 0x00000400 | ZIP | Link traffic will be gzipped
CAPAB_DODKEY | 0x00000800 | DKEY | Do DKEY with this link
CAPAB_QS | 0x00001000 | QS | Supports quit storm removal
CAPAB_SCS | 0x00002000 | SCS | String Cache System support
CAPAB_PT4 | 0x00004000 | PT4 | Support for PT4 protocol
CAPAB_UID | 0x00008000 | UID | Support for UIDs
CAPAB_KNOCK | 0x00010000 | KNOCK | Supports KNOCK
CAPAB_CLIENT | 0x00020000 | CLIENT | Supports CLIENT
CAPAB_IPV6 | 0x00040000 | IPV6 | Support for IPv6 addresses
CAPAB_SSJ5 | 0x00080000 | SSJ5 | Smart Join protocol 5 support
CAPAB_SN2 | 0x00100000 | SN2 | Support for SN2 protocol
CAPAB_VHOST | 0x00200000 | VHOST | Supports VHOST protocol
CAPAB_TOKEN | 0x00400000 | TOKEN | Supports s2s tokens
CAPAB_SSJ3 | 0x00800000 | SSJ3 | Smart Join protocol 3 support
CAPAB_NICK2 | 0x01000000 | NICK2 | Support for extended NICK (v2)
CAPAB_UMODE2 | 0x02000000 | UMODE2 | Supports UMODE2 command
CAPAB_VL | 0x04000000 | VL | VLine information in info field
CAPAB_TLKEXT | 0x08000000 | TLKEXT | Not 8, but 10 params in TKL's
CAPAB_CHANMODE | 0x10000000 | CHANMODE | Channel modes are passed here
CAPAB_SJB64 | 0x20000000 | SJB64 | SJOIN timestamps are base64 encoded
CAPAB_NICKCHARS | 0x40000000 | NICKCHARS | Character set used by the IRCD for nicks
4) Modes
The next thing you should do is defining the user modes. You will want to
have your .h file handy for this part.
unsigned long umodes[128] = { }
This array goes from 0 to 127 in the ASCII character set. Insert the user
modes at the slot where the mode fits. If you are adding a the user mode
of +i find the 105th (ASCII code of 'i') character slot in the array, and
place the UMODE_i into this slot. Your base .c file should contain a good
start for this, as well as a little help locating the characters.
The following mode set is for the channel symbols. During a SJOIN event
the modes are sent usually before the nick. These normally are @, +, %
etc.. depending on the ircd. Starting at ASCII 0 and running to 127.
Replace the 0 with the character (o = @, h = %) for the given mode. In the
case of halfop which is usually sent as % replace the 37th character with
'h', do this until all modes that are possible be received in this manor
have been inserted into the array.
Now that you have that complete, the following array is ready to be dealt
with. This is the cmmodes array, like the others it is a ASCII array
starting at 0 and going to 127. However at the given letter you will want
to enter the add, and delete function for the given mode. In the case of
bans (+b) there is add_ban, and del_ban. Anope provides functions for
bans, exceptions and invites, should your ircd have more then these please
contact Anope to discuss what can be done to add this mode.
5) Functions and Events
A brief word about functions and events. All events are captured using:
void moduleAddIRCDMsgs(void)
{
m = createMessage("NICK", anope_event_nick);
addCoreMessage(IRCD, m);
}
Each event should have a event handler if its important enough to be
processed by services. All event functions should be formed like this:
int anope_event_capab(char *source, int ac, char **av)
{
return MOD_CONT;
}
They will receive the source; this can be NULL at times depending on the
event. Next, ac is the number of arguments that are in the event, and av
holds the values for each; so av[0] is the first variable, av[1] will be
the second one, and so on. Events are likely to pass to various upper
level event handlers; see the previous ircd source for how they handle
these events.
All commands are formed like this:
void anope_cmd_svsnoop(char *server, int set)
{
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
}
They may take any number of arguments, depending on the command. They
should eventually come to a send_cmd(); this root function is how
commands are sent to the IRCd.
6) CAPAB/PROTOCTL
Most IRCD send a CAPAB or PROTOCTL line so that they can work out what
the other end of the connection is capable of doing. Anope has a function
to read these lines and set itself up to to handle these events better.
When adding support for your ircd, take the following steps.
1) In the ircd.c find the function anope_cmd_capab(); this function will
send the CAPAB/PROTOCTL line (consult your ircd documentation for
which to send). In a single line type in the tokens that anope must
send. Here is an example of Hybrid's capab line:
/* CAPAB */
void anope_cmd_capab()
{
send_cmd(NULL, "CAPAB TS5 EX IE HOPS HUB AOPS");
}
2) In the ircd.h file make sure to place the defines (see below) that
match your IRCd's tokens; only use the ones that matter to your ircd.
Should your IRCd add new features not covered in the defined, please
contact the Anope Dev team before doing so. See README for information
on how to contact the Anope team.
3) Ensure that the CAPAB/PROTOCTL event his handled correctly.
A) In the function "moduleAddIRCDMsgs" making sure that you have the
following two lines:
m = createMessage("CAPAB", anope_event_capab);
addCoreMessage(IRCD, m);
B) Add the function to handle the event
int anope_event_capab(char *source, int ac, char **av)
{
capab_parse(ac, av);
return MOD_CONT;
}
This function should call the capab_parse function which parses
the received CAPAB/PROTOCTL line.
+97 -15
View File
@@ -1,27 +1,109 @@
Anope MySQL Support
-------------------
MySQL support was readded in version 1.9.2 In the form of three modules.
1) Introduction
db_mysql_read - Allows you to load your databases from MySQL.
db_mysql_write - Allows live updating of SQL tables whenever something is executed in Anope.
db_mysql_execute - Allows executing of Anope commands via SQL.
Anope 1.6 onwards supports MySQL databases. On Anope 1.6.0 only PHASE 1
has been implemented. Since the next phases require major changes in the
core, we decided to save it for 2.0. However, having your db's easily
accessible on your website is still a great feature.
To execute commands via SQL, you must insert the command into the anope_commands table, an example is as follows:
PHASE 1:Anope will be able to save all it's databases to MySQL. It will
happen in conjunction with the current FFF databases. This first step is
nothing more than a MySQL dump of the databases (i.e. read-only), since
Anope will not (for now) read from Mysql. (COMPLETED)
INSERT INTO `anope_commands` (nick, service, command) VALUES('Adam', 'NickServ', 'REGISTER qwerty Adam@anope.org');
PHASE 2:The next step is load the databases from MySQL, being able to
replace the FFF completely as an archive method (since all changes to
the MySQL db would be lost on the next Services save). All, while keeping
FFF intact. This is still not the final goal, but it's a milestone.
(COMPLETED)
UPDATE: Anope 1.7.0 (Revision 11 and above) finally supports phase 2!
A new config directive called 'UseRDB' has been added.
If you enable this, anope will automatically try to load its
data from MySQL (if configured and compiled with).
By default, every 60 seconds Anope checks this table for commands to execute. When Anope sees a new command to execute, it checks the following.
PHASE 3:The next step, and most convoluted of all (since we'll need to
modify pretty much all the source) is to load/save (SELECT/INSERT) data
in realtime. That way the MySQL db could be modified externally (web?).
Again, the FFF will be kept intact.
If the nick given is -SQLUser, then the command gets executed by a special fake user within Anope called -SQLUser. -SQLUser has every permission and command available, there are no permission checks at all for this user, it can do anything.
2) Requirements
If the nick is not -SQLUser, it checks to see if it is a registered nick. If it is, it sees if there are any users online using the NickCore of that nick.
If there is a user online with that core the command gets executed as if that user executed it, and the reply goes to that user.
If there isn't a user online with the core, it creates a fake user as the nick given to it, and gives to it the permissions the user would have if they were online and identified.
If the nick is not registered, it checks to see if there is a user currently on that nick. If there is, it executes the command as that user, and the reply goes to that user.
If the nick is not registered and no one is using the nick, it creates a fake user of the nick given to it, and gives it regular nonidentified user access.
1. MySQL server version 3.23.32 or greater
2. MySQL libs and development files (usually called mysql-dev).
3. A MySQL user account
4. A MySQL database
Currently there is no way to check to see if a command was executed successfully within Anope from SQL (even if there was, the possibly update delay would be a problem).
3) Installation
IMPORTANT: When using db_mysql_write when you already have a database, you need to do an initial import of the data to SQL (as db_mysql_write only updates it when it is changed, it never actually mass-dumps all of your data into SQL). To do this, start Anope and execute /OperServ SQLSYNC.
1. The ./Config script automatically detects if your system is capable
of running Anope with MySQL support. There is no need anymore to
answer yes when asked.
Note: You might need to run "make distclean" prior to running ./Config
2. Compile Anope as usual. The (g)make process will now compile MySQL
support into Anope.
3. Install Anope as usual.
4) Configuration
1. Go to your "services bin directory" (eg: /home/someuser/services/) and run mydbgen
to help on the schema creation and adjustments.
2. Edit services.conf and add your MySQL data to the MySQL configuration
block.
3. Start or restart services to make use of the new Anope executable.
5) Security
To add a layer of security you have the option of encrypting or encoding
all passwords for nicks and chans. Use the "MysqlSecure" directive on your
services.conf file to enable it. The available storage methods are:
#MysqlSecure ""
or
MysqlSecure ""
Disables security. All passwords will be saved on the MySQL database
as clear text, with no encryption or encoding. FASTEST
MysqlSecure "des"
Encrypts all passwords using a UNIX DES encryption. This is a one way
encryption algorithm. You can only validate it against another DES
encrypted string, using the same "salt" (the first two characters of
the encrypted string). FAST
MysqlSecure "md5"
Calculates an MD5 128-bit checksum for the password. The value is
returned as a 32-digit hex number that may be used as a hash key.
This is a one way encryption algorithm. SLOW
MysqlSecure "sha"
Calculates an SHA 160-bit checksum for the password. The value is
returned as a 40-digit hex number. This is a one way encryption
algorithm. SLOWEST
MysqlSecure "mykey"
Encodes the passwords using "mykey" as the encryption password. It
produces a binary string and can be decoded using the MySQL built in
function DECODE(crypt_str,mykey). VARIABLE
Caveat: Keep in mind that this if you use any method other than clear
text, services will need to encrypt/encode every single password on
every database save. On large networks, it may impact responsiveness
during the saves.
Caveat: If you enable MysqlSecure you can not longer use the UseRDB directive
as all the password types are encrypted with a one way encryption method for
older MySQL servers.
+53 -5
View File
@@ -1,7 +1,55 @@
Highlighted News in Anope 1.9
=============================
Highlighted News in Anope 1.8
============================================
* Added a new and improved ./Config script.
* Added MySQL phase 2 implementation (see docs/MYSQL).
* Added NickServ registration delays.
* Added read receipts for memos.
* Added a way for modules to store data with internal structures.
* Added nick tracking support.
* Added support for SVSHOLD.
* Added support for U:Lined servers.
* Added support for TS6 IRCd's.
* Added support for Windows.
* Added internal events for modules.
* Added a way to suspend nicks.
* Added support for module configuration directives.
* Added translation support for modules.
* Added a module pack with handy modules.
* Added IRCd protocol modules.
* Added support for new IRCd's. Currently supported:
- Bahamut 1.4.27 or later (including 1.8)
- Charybdis 1.0 or later
- DreamForge 4.6.7
- Hybrid 7 or later
- InspIRCd 1.0 or later (including 1.1 & 1.2)
- Plexus 2.0 or later (including 3.0)
- PTLink 6.15 or later
- RageIRCd 2.0 or later
- Ratbox 2.0.6 or later
- ShadowIRCd 4.0 beta 7 or later
- Solid IRCd 3.4.6 or later
- UltimateIRCd 2.8.2 or later (including 3.0)
- UnrealIRCd 3.1.1 or later (including 3.2)
- ViagraIRCd 1.3 or later
* Added new languages. Currently included:
Catalan, German, English, Spanish, French, Greek,
Hungarian, Italian, Dutch, Polish, Portugese,
Russian, Turkish
* Added support for CIDR channel lists.
* Converted the core to be completely modular.
* Improved random number algorithm.
* Removed proxy detector (see docs/PROXY).
* Fixed various exploits and vulnerabilities.
* Fixed various language typos and inconsistencies.
* Fixed a bug in the database system causing nickserv passwords
to be saved incorrectly. Note that this breaks backwards
compatibility on nick.db !!!
For the full changes, see the Changes file.
For announcements and discussions about Anope, please visit our
web site http://www.anope.org
* Added in live updating SQL and the ability to execute commands through SQL
* Re-designed configuration file
* Code refresh / rewrite into C++
+1299
View File
File diff suppressed because it is too large Load Diff
+139
View File
@@ -0,0 +1,139 @@
Highlighted News in Anope 1.7 (and soon 1.8)
============================================
* Added a new and improved ./Config script.
* Added MySQL phase 2 implementation (see docs/MYSQL).
* Added NickServ registration delays.
* Added read receipts for memos.
* Added a way for modules to store data with internal structures.
* Added nick tracking support.
* Added support for SVSHOLD.
* Added support for U:Lined servers.
* Added support for TS6 IRCd's.
* Added support for Windows.
* Added internal events for modules.
* Added a way to suspend nicks.
* Added support for module configuration directives.
* Added translation support for modules.
* Added a module pack with handy modules.
* Added IRCd protocol modules.
* Added support for new IRCd's. Currently supported:
- Bahamut 1.4.27 or later (including 1.8)
- Charybdis 1.0 or later
- DreamForge 4.6.7
- Hybrid 7 or later
- InspIRCd 1.0 or later (including 1.1)
- Plexus 2.0 or later (including 3.0)
- PTLink 6.15 or later
- RageIRCd 2.0 or later
- Ratbox 2.0.6 or later
- ShadowIRCd 4.0 beta 7 or later
- Solid IRCd 3.4.6 or later
- UltimateIRCd 2.8.2 or later (including 3.0)
- UnrealIRCd 3.1.1 or later (including 3.2)
- ViagraIRCd 1.3 or later
* Added new languages. Currently included:
Catalan, German, English, Spanish, French, Greek,
Hungarian, Italian, Dutch, Polish, Portugese,
Russian, Turkish
* Added support for CIDR channel lists.
* Converted the core to be completely modular.
* Improved random number algorithm.
* Removed proxy detector (see docs/PROXY).
* Fixed various exploits and vulnerabilities.
* Fixed various language typos and inconsistencies.
* Fixed a bug in the database system causing nickserv passwords
to be saved incorrectly. Note that this breaks backwards
compatibility on nick.db !!!
Highlighted News in Anope 1.6
=============================
* Fixed various exploits and vulnerabilities.
* Fixed various language typos and inconsistencies.
* Improved ignore system.
* Improved ./configure script.
* Removed all compile warning fixed.
* Converted HelpServ into a proper service.
* Added external module support.
* Added Defense Condition (DEFCON) System.
* Added MySQL support for mirroring databases.
* Added multi-server configuration.
* Added multi-domain /OS GLOBAL support.
* Added combined +oq +oa +ha +va on net-joins.
* Added support for ircd changes and upgrades.
* Added HostSetters configuration directive.
* Added /OS STAFF command.
* Added /OS SVSNICK command.
* Added /OS CHANKILL command.
* Added /MS STAFF command.
* Added /NS UPDATE command.
* Added /MS SENDALL command.
* Added /NS GETMAIL command.
* Added /HS DELALL command.
* Added /HS LIST command with pattern matching.
* New support scripts and tools.
* New ircd support, complete list: DreamForge 4.6.7, Bahamut 1.4.27,
UnrealIRCd 3.1.1, UltimateIRCd 2.8.2,
UltimateIRCd 3.0.0, Hybrid IRCd 7.0
ViagraIRCd 1.3.x, PTlink 6.15.0
* New Language files, complete list: cat.l, de.l, en_us.l, es.l, fr.l,
gr.l, it.l, nl.l, pt.l, ru.l, tr.l
Highlighted News in Anope 1.4
=============================
After the change from Epona to Anope
------------------------------------
* New Italian Language file
* Added support for UltimateIRCd 3.0 and later
* Services realtime logging to a channel
* SuperAdmin directive for access to "super" commands.
* Ban system is now exception aware.
* HostServ for hostname masquerading.
* Smarter XOP System.
* Email verification/handshake upon registration.
* Services can now /ignore users.
* Smarter memo notification for channels.
* Channel can be SUSPENDed instead of FORBIDen.
Before the change from Epona to Anope
-------------------------------------
* HostServ for networks that support them.
* UnrealIRCd support has been rewritten, it is now fully
working (hopefully) and officially supported again.
* Added support for UltimateIRCd 2.8.2 and later.
* A multi-threaded proxy detector that can scan Wingates,
SOCKS 4/5 and HTTP proxies on ports 3128 and 8080. Don't use
it if you have not been authorized to use it by your system
administrator!
* The ChanServ AOP/SOP/VOP commands, and, on networks that
support halfops, the HOP command, have been added. They
allow a more user-friendly control of channel privileges.
* Use of services IDs that allow an user to be automatically
identified after a split (if he was identified before the split)
in a secure way. This also saves lots of bandwidth.
* Services' default language can now be set in services.conf.
* The OperServ RANDOMNEWS command provides an easy way to show
network news in a random manner without flooding your users
with them (one news per connection).
* The BotServ SET PRIVATE option allows services admins to
make the bot usable by IRC operators only.
* The OperServ SQLINE command allows you to forbid nick masks
and even channel masks with the latest Bahamut.
* The ChanServ AKICK STICK command allows akicks to be permanently
kept on channel.
* The ChanServ SET TOPIC command has been renamed to TOPIC, and
a new BAN command has been added. They both have their own
associated levels.
* A SET PEACE command has been added to ChanServ. It prevents
users to use pejorative services commands (DEOP, KICK, ...)
on users with greater or equal levels.
Networks using Bahamut must upgrade to Bahamut 1.4.27 or later,
while networks using UnrealIRCd must upgrade to Unreal 3.1.1.
For the full changes, see the Changes file.
For announcements and discussions about Anope, please visit our
web site http://www.anope.org
+423 -367
View File
@@ -1,367 +1,423 @@
Anope -- a set of IRC services for IRC networks
-----------------------------------------------
Anope is 2003-2010 Anope Team <team@anope.org>.
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
This program is free but copyrighted software; see the file COPYING for
details.
Information about Anope may be found at http://www.anope.org/
Information about Epona may be found at http://www.epona.org/
Information about Services may be found at http://www.ircservices.esper.net/
Table of Contents
-----------------
1) Credits
2) Presentation
3) Installation
4) Command Line Options
5) Messages Translation
6) Contact and Mailing List
1) Credits
Anope is based on Lara's Epona version 1.4.14.
Epona is based on Andy Church's IRC Services version 4.3.3.
The original credits:
* Mauritz Antunes
Portuguese translation
* Jose R. Holzmann, Raul S. Villarreal
Spanish translation
* Andrew Kempe <theshadow@shadowfire.org>
News system
* <d.duca@eurcom.net>
Italian translation
* <mikado@holyfire.com>
Turkish translation
* Andrew Kempe <theshadow@shadowfire.org>
Session limiting
Epona credits:
* lara <lara@pegsoft.net>
Main coding
* CafeiN <oytuny@yahoo.com>
Turkish translation
* Sylvain Cresto aka tost <scresto@netsante.fr>
FreeBSD 5 patch
* Marcelo Conde Foscarini aka Bras <ircadmin@brmarket.net>
Portuguese translation
* Alvaro Toledo aka POLLITO <atoledo@keldon.org>
Spanish translation
* chemical <chemical@musicplay.de>
German translation
* shine <dh@shinewelt.de>
German translation
* Guven Guzelbey aka MeShGuL <guzelbey@cs.utk.edu>
Turkish translation
* Jordi Pujol <jordi.pujol@aujac.org>
Catalan translation
* Eva Dachs <evadachs@terra.es>
Catalan translation
* Toni Perez <toni.perez@aujac.org>
Catalan translation
* Sergios Karalis <sergios_k@hotmail.com>
Greek translation
* Thomas J. Stensas aka ShadowMaster <shadowmaster@shadow-realm.org>
Ultimate 3.x support
Anope credits:
* Adam Kramer <ribosome@anope.org>
* Adam <adam@anope.org>
* Alvaro Toledo <atoledo@keldon.org>
* Amanda Folson <amanda@anope.org>
* Andrew Berquist <vash@anope.org>
* Björn Stiddien <keeper@anope.org>
* Charles Kingsley <chaz@anope.org>
* Chris Hogben <heinz@anope.org>
* Daniel Engel <dane@zero.org>
* David <dv@diboo.net>
* David Narayan <jester@phrixus.net>
* David Robson <rob@anope.org>
* Daniele Nicolucci <jollino@sogno.net>
* Florian Schulze <certus@anope.org>
* Gabriel Acevedo H. <drstein@anope.org>
* Jan Milants <viper@anope.org>
* Jens Voss <dukepyrolator@anope.org>
* JH <jh@irc-chat.net>
* Joris Vink <joris@anope.org>
* Lucas Nussbaum <lucas@lucas-nussbaum.net>
* Mark Summers <mark@goopler.net>
* Matthew Beeching <jobe@invictachat.net>
* Naram Qashat <cyberbotx@anope.org>
* Pieter Bootsma <geniusdex@anope.org>
* Robin Burchell <w00t@inspircd.org>
* Thomas Juberg StensĂĄs <ShadowMaster@Shadow-Realm.org>
* Trystan .S Lee <trystan@nomadirc.net>
* openglx <openglx@brasnerd.com.br>
Anope Translations:
* GeniusDex <geniusdex@anope.org> (nl.l)
* Kein <kein-of@yandex.ru> (ru.l)
* Stuff <the.stuff@gmx.de> (de.l)
* Gabriel Acevedo H. <drstein@anope.org> (es.l)
* Janos Kapitany <sarkanyka@cjbchat.hu> (hun.l)
* Szymon S'wierkosz <szymek@adres.pl> (pl.l)
Anope uses the strlcat() and strlcpy() functions from OpenSSH 2.5.1p2.
These functions are copyrighted by Todd C. Miller:
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
2) Presentation
Anope is a set of Services for IRC networks that allows users to manage
their nicks and channels in a secure and efficient way, and administrators
to manage their network with powerful tools.
Currently available services are:
* NickServ, a powerful nickname manager that users can use to protect
themselves against nick stealing. Each user has its own nickname
group, that allows the user to register as many nicks as needed
while still being able to take profit of his privileges and to
modify the nick configuration. NickServ also has an optional
password retrieval feature.
* ChanServ, a powerful channel manager that helps users to administer
their channels in a totally customizable way. ChanServ has an
internal list of privileged users and banned users that controls
accesses on a per-channel basis. It eliminates all takeover
problems, because of its powerful op/unban/invite and even mass
deop and mass kick functions.
* MemoServ, an helpful companion that allows sending short messages
to offline users, that they can then read when they come online
later.
* BotServ, an original service that allows users to get a permanent,
friendly bot on their channels in an easy way. Each bot can be
configured to monitor the channels against floods, repetitions,
caps writing, and swearing, and to take appropriate actions. It
also can handle user-friendly commands (like !op, !deop, !voice,
!devoice, !kick, and many others), say a short greet message when
an user joins a channel, and even "take over" ChanServ actions such
as auto-opping users, saying the entry notice, and so on. This
service can be disabled if you want to save some bandwidth.
* OperServ, the IRCops' and IRC admins' black box, that allows them
to manage the list of network bans (also known as AKILL (DALnet) or
GLINE (Undernet)), to configure messages displayed to users when
they log on, to set modes and to kick users from any channel, to
send notices quickly to the entire network, and much more!
* HostServ, a neat service that allows users to show custom vHosts
(virtual hosts) instead of their real IP address; this only works
on daemons supporting ip cloaking, such as UnrealIRCd, UltimateIRCd
and ViagraIRCd.
Anope currently works with:
* Bahamut 1.4.27 or later (including 1.8)
* InspIRCd 1.1, 1.2, or 2.0
* Ratbox 2.0.6 or later
* UnrealIRCd 3.2 or later
Anope could also work with some of the daemons derived by the ones listed
above, but there's no support for them if they work or don't work.
3) Installation
See the INSTALL file for instruction on installing Anope.
4) Command Line Options
Normally, Anope can be run simply by invoking the "services" executable.
Anope will then use the defaults specified in the services.conf file, and
connect to the specified uplink server. Alternatively, any of the
following command-line options can be specified to change the default
values:
-remote server[:port] Connect to the specified server
-local host -or- Connect from the specified address (e.g. for
[host]:[port] multihomed servers)
-name servername Our server name (e.g. services.some.net)
-desc string Description of us (e.g. SomeNet Services)
-user username Username for Services' nicks (e.g. services)
-host hostname Hostname for Services' nicks (e.g. esper.net)
-dir directory Directory containing Services' data files
(e.g. /usr/local/lib/services)
-log filename Services log filename (e.g. services.log)
-update secs How often to update databases (in seconds)
-expire secs How often to check for nick/channel
expiration (in seconds)
Additionally, the following command-line options can be used to modify
the behavior of Anope:
-debug Enable debugging mode; more info sent to log (give
option more times for more info)
-readonly Enable read-only mode; no changes to databases
allowed, .db files and log not written
-skeleton Enable skeleton mode; like read-only mode, but only
OperServ is available
-nofork Do not fork after startup; log messages will be
written to terminal (as well as to the log file
if not in read-only mode)
-forceload Try to load as much of the databases as possible,
even if errors are encountered
-noexpire Expiration routines won't be run at all
-logchan Startup with logchan enabled
-version Display the version of Anope
-nothird Do not load the modules specified in ModulesAutoload
or ModulesDelayedAutoload in the config file
-protocoldebug Debug each incoming message after protocol parsing
-support Used for support, same as -debug -nofork -nothird
Upon starting, Anope will parse its command-line parameters, open its
logfile, then (assuming the -nofork option is not given) detach itself
and run in the background. If Anope encounters a problem reading the
database files or cannot connect to its uplink server, it will terminate
immediately; otherwise, it will run until the connection is terminated
(or a QUIT, SHUTDOWN, or RESTART command is sent; see OperServ's help).
In the case of an error, an appropriate error message will be written to
the log file.
If Anope is run with the "-readonly" command-line option, it can serve as
a "backup" to the full version of services. A "full" version of services
(run without -readonly) will automatically reintroduce its pseudo-clients
(NickServ, ChanServ, etc.), while a "backup" services will not, thus
allowing full services to be brought up at any time without disrupting
the network (and without having to take backup services down beforehand).
If Anope is run with the "-skeleton" command-line option, it will not try
to load the nickname or channel databases, and will respond with "service
is inactive" messages to any commands sent to NickServ, ChanServ,
MemoServ or BotServ. This can be useful as an emergency stopgap measure
when the main copy of Anope cannot be started.
The "-debug" option is useful if you find or suspect a problem in Anope.
Giving it once on the command line will cause all traffic to and from
services as well as some other debugging information to be recorded in
the log file; if you send a bug report, PLEASE include an excerpt from
the log file WITH DEBUGGING ACTIVE; we cannot emphasize enough how
important this is to tracking down problems. (You can also enable
debugging while Services is running using OperServ's SET DEBUG command.)
If you repeat the -debug option more than once, the debugging level will
be increased, which provides more detailed information but may also slow
Anope down considerably and make the log file grow dramatically faster
(in particular, at debug level 4 a message is written to the log for
every character received from the server). In general, a debug level of 1
is sufficient for the coding team to be able to trace a problem, because
all network traffic is included and we can usually reproduce the problem.
The "-forceload" option is provided to attempt recovery of data from
corrupted or truncated databases. Normally, if Anope encounters an error
writing to a database file, it will attempt to restore the original
version of the file and report an error to the logfile and through
WALLOPS. However, if this should fail (which normally should not happen),
or if Anope is terminated abruptly e.g. by kill -9 or a power failure,
then one or more of the databases may be corrupt. Normally, this will
cause Anope to abort the next time you try to run it; however, if yo
give the -forceload option to Anope, it will instead read as much as it
can, then skip to the next database. For obvious reasons, it's highly
recommended to keep backup copies of your databases in case something
does happen (since Anope will stop at the first error in a database, even
with -forceload, meaning you lose any data after that).
5) Messages Translations
Anope has a powerful option in NickServ allowing users to choose what
language it must use when sending messages to users. Messages are stored
in language files (located in the lang directory).
Anope is currently provided with thirteen languages: Catalan, Dutch,
English, French, German, Greek, Hungarian, Italian, Polish, Portuguese,
Russian, Spanish and Turkish. If you want to translate Anope messages
into another language, follow this instructions:
* Copy the lang/en_us.l file to a meaningful name (for example, if
you would like to translate messages in Spanish, you would rename
it to es.l).
* Edit the file with your favorite text editor. Carefully read the
instructions given at the top of the file, and start translating
the whole file. The file is big, so make sure you have some coffee
available ;) Try to avoid the use of English words as much as
possible. If the new language contains only a few 'special'
characters, try and use latin representations of it, if possible.
Remember that most clients are only capable of handling the
ISO-8859-1 charset. Of course, if you are translating Anope to a
language with a totally different charset, such as Russian, feel
free to use the one that suites it best (and the one that is in use
by most speakers of that language ;)).
* When this is done, you have two solutions: either patch Services
source code so they take in account the new language file
(basically, you'll have to modify lang/Makefile, language.c and
maybe services.h), or send us the translated file so we can make
the patch and include your language in the next Anope release.
* Note that there is a language tool on bin/langtool.pl that can aid
the verification process on newly created language files. Try to
use it before you submit a language file.
When new major releases come out, you'll not have to retranslate the
whole file; the Changes.lang file will help you to know which messages
were added, modified or deleted.
If you did a language file translation, and want to let others use it,
please send it to team@anope.org (don't forget to mention clearly your
(nick)name, your e-mail and the language name). You'll of course get full
credit for it, and will even get future final major releases before
anyone else to complete the translation!... ;)
6) Contact
For announcements and discussions about Anope, please visit our
Portal and Forums at http://www.anope.org/ -- make sure you register
yourself and your network to get full benefits.
If you read the documentation carefully, and didn't find the answer to
your question, feel free to post on the website forums or join our irc
channel (irc.anope.org #anope). Once you join our Support channel, just
type "? report" for instructions on how to report a Bug. Be as precise as
possible when asking a question, because we have no extraordinary powers
and can't guess things if they aren't provided. The more precise you are,
the sooner you'll be likely to get an answer.
If you think you found a bug, add it to the bug tracking system
(http://bugs.anope.org) and - again - be as precise as possible. Also say
whether the bug happens always or under what circumstances, and anything
that could be useful to track your bug down. If you wrote a patch, send
it over. :)
Anope - a set of IRC services for IRC networks
----------------------------------------------
Anope is 2003-2010 Anope Team <team@anope.org>.
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
This program is free but copyrighted software; see the file COPYING for
details.
Information about Anope may be found at http://www.anope.org/
Information about Epona may be found at http://www.epona.org/
Information about Services may be found at http://www.ircservices.esper.net/
Table of Contents
-----------------
1) Credits
2) Presentation
3) Installation
4) Command Line Options
5) Messages Translation
6) Adding Your Translation Into The Source
7) Contact and Mailing List
1) Credits
Anope is based on Lara's Epona version 1.4.14.
Epona is based on Andy Church's IRC Services version 4.3.3.
The original credits:
* Mauritz Antunes
Portuguese translation
* Jose R. Holzmann, Raul S. Villarreal
Spanish translation
* Andrew Kempe <theshadow@shadowfire.org>
News system
* <d.duca@eurcom.net>
Italian translation
* <mikado@holyfire.com>
Turkish translation
* Andrew Kempe <theshadow@shadowfire.org>
Session limiting
Epona credits:
* lara <lara@pegsoft.net>
Main coding
* CafeiN <oytuny@yahoo.com>
Turkish translation
* Sylvain Cresto aka tost <scresto@netsante.fr>
FreeBSD 5 patch
* Marcelo Conde Foscarini aka Bras <ircadmin@brmarket.net>
Portuguese translation
* Alvaro Toledo aka POLLITO <atoledo@keldon.org>
Spanish translation
* chemical <chemical@musicplay.de>
German translation
* shine <dh@shinewelt.de>
German translation
* Guven Guzelbey aka MeShGuL <guzelbey@cs.utk.edu>
Turkish translation
* Jordi Pujol <jordi.pujol@aujac.org>
Catalan translation
* Eva Dachs <evadachs@terra.es>
Catalan translation
* Toni Perez <toni.perez@aujac.org>
Catalan translation
* Sergios Karalis <sergios_k@hotmail.com>
Greek translation
* Thomas J. Stensas aka ShadowMaster <shadowmaster@shadow-realm.org>
Ultimate 3.x support
Anope credits:
* Adam Kramer <ribosome@anope.org>
* Adam <adam@anope.org>
* Alvaro Toledo <atoledo@keldon.org>
* Amanda Folson <amanda@anope.org>
* Andrew Berquist <vash@anope.org>
* Björn Stiddien <keeper@anope.org>
* Charles Kingsley <chaz@anope.org>
* Chris Hogben <heinz@anope.org>
* Daniel Engel <dane@zero.org>
* David <dv@diboo.net>
* David Narayan <jester@phrixus.net>
* David Robson <rob@anope.org>
* Daniele Nicolucci <jollino@sogno.net>
* Florian Schulze <certus@anope.org>
* Gabriel Acevedo H. <drstein@anope.org>
* Jan Milants <viper@anope.org>
* Jens Voss <dukepyrolator@anope.org>
* JH <jh@irc-chat.net>
* Joris Vink <joris@anope.org>
* Lucas Nussbaum <lucas@lucas-nussbaum.net>
* Mark Summers <mark@goopler.net>
* Matthew Beeching <jobe@invictachat.net>
* Naram Qashat <cyberbotx@anope.org>
* Pieter Bootsma <geniusdex@anope.org>
* Robin Burchell <w00t@inspircd.org>
* Thomas Juberg StensĂĄs <ShadowMaster@Shadow-Realm.org>
* Trystan .S Lee <trystan@nomadirc.net>
* openglx <openglx@brasnerd.com.br>
Anope Translations:
* GeniusDex <geniusdex@anope.org> (nl.l)
* Kein <kein-of@yandex.ru> (ru.l)
* Han` <Han@mefalcon.org> (de.l)
* Gabriel Acevedo H. <drstein@anope.org> (es.l)
* Janos Kapitany <sarkanyka@cjbchat.hu> (hun.l)
* Szymon S'wierkosz <szymek@adres.pl> (pl.l)
* Christopher N. <saka@epiknet.org> (fr.l)
Anope uses the strlcat() and strlcpy() functions from OpenSSH 2.5.1p2.
These functions are copyrighted by Todd C. Miller:
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
2) Presentation
Anope is a set of Services for IRC networks that allows users to manage
their nicks and channels in a secure and efficient way, and administrators
to manage their network with powerful tools.
Currently available services are:
* NickServ, a powerful nickname manager that users can use to protect
themselves against nick stealing. Each user has its own nickname
group, that allows the user to register as many nicks as needed
while still being able to take profit of his privileges and to
modify the nick configuration. NickServ also has an optional
password retrieval feature.
* ChanServ, a powerful channel manager that helps users to administer
their channels in a totally customizable way. ChanServ has an
internal list of privileged users and banned users that controls
accesses on a per-channel basis. It eliminates all takeover
problems, because of its powerful op/unban/invite and even mass
deop and mass kick functions.
* MemoServ, an helpful companion that allows sending short messages
to offline users, that they can then read when they come online
later.
* BotServ, an original service that allows users to get a permanent,
friendly bot on their channels in an easy way. Each bot can be
configured to monitor the channels against floods, repetitions,
caps writing, and swearing, and to take appropriate actions. It
also can handle user-friendly commands (like !op, !deop, !voice,
!devoice, !kick, and many others), say a short greet message when
an user joins a channel, and even "take over" ChanServ actions such
as auto-opping users, saying the entry notice, and so on. This
service can be disabled if you want to save some bandwidth.
* OperServ, the IRCops' and IRC admins' black box, that allows them
to manage the list of network bans (also known as AKILL (DALnet) or
GLINE (Undernet)), to configure messages displayed to users when
they log on, to set modes and to kick users from any channel, to
send notices quickly to the entire network, and much more!
* HostServ, a neat service that allows users to show custom vHosts
(virtual hosts) instead of their real IP address; this only works
on daemons supporting ip cloaking, such as UnrealIRCd, UltimateIRCd
and ViagraIRCd.
* HelpServ, a skeleton service used to serve help files.
Anope currently works with:
* Bahamut 1.4.27 or later (including 1.8)
* Charybdis 1.0 or later
* DreamForge 4.6.7
* Hybrid 7 or later
* InspIRCd 1.0 or later (including 1.1 and 1.2)
* Plexus 2.0 or later (including 3.0)
* PTlink 6.15 or later
* RageIRCd 2.0 beta-6 or later
* Ratbox 2.0.6 or later
* ShadowIRCd 4.0 beta 7 or later
* Solid IRCd 3.4.6 or later
* UltimateIRCd 2.8.2 or later (including 3.0)
* UnrealIRCd 3.1.1 or later (including 3.2)
* ViagraIRCd 1.3 or later
Anope could also work with some of the daemons derived by the ones listed
above, but there's no support for them if they work or don't work.
3) Installation
See the INSTALL file for instruction on installing Anope.
4) Command Line Options
Normally, Anope can be run simply by invoking the "services" executable.
Anope will then use the defaults specified in the services.conf file, and
connect to the specified uplink server. Alternatively, any of the
following command-line options can be specified to change the default
values:
-remote server[:port] Connect to the specified server
-local host -or- Connect from the specified address (e.g. for
[host]:[port] multihomed servers)
-name servername Our server name (e.g. services.some.net)
-desc string Description of us (e.g. SomeNet Services)
-user username Username for Services' nicks (e.g. services)
-host hostname Hostname for Services' nicks (e.g. esper.net)
-dir directory Directory containing Services' data files
(e.g. /usr/local/lib/services)
-log filename Services log filename (e.g. services.log)
-update secs How often to update databases (in seconds)
-expire secs How often to check for nick/channel
expiration (in seconds)
Additionally, the following command-line options can be used to modify
the behavior of Anope:
-debug Enable debugging mode; more info sent to log (give
option more times for more info)
-readonly Enable read-only mode; no changes to databases
allowed, .db files and log not written
-skeleton Enable skeleton mode; like read-only mode, but only
OperServ is available
-nofork Do not fork after startup; log messages will be
written to terminal (as well as to the log file
if not in read-only mode)
-forceload Try to load as much of the databases as possible,
even if errors are encountered
-noexpire Expiration routines won't be run at all
-logchan Startup with logchan enabled
-version Display the version of Anope
-nothird Do not load the modules specified in ModulesAutoload
or ModulesDelayedAutoload in the config file
-protocoldebug Debug each incoming message after protocol parsing
-support Used for support, same as -debug -nofork -nothird
Upon starting, Anope will parse its command-line parameters, open its
logfile, then (assuming the -nofork option is not given) detach itself
and run in the background. If Anope encounters a problem reading the
database files or cannot connect to its uplink server, it will terminate
immediately; otherwise, it will run until the connection is terminated
(or a QUIT, SHUTDOWN, or RESTART command is sent; see OperServ's help).
In the case of an error, an appropriate error message will be written to
the log file.
If Anope is run with the "-readonly" command-line option, it can serve as
a "backup" to the full version of services. A "full" version of services
(run without -readonly) will automatically reintroduce its pseudo-clients
(NickServ, ChanServ, etc.), while a "backup" services will not, thus
allowing full services to be brought up at any time without disrupting
the network (and without having to take backup services down beforehand).
If Anope is run with the "-skeleton" command-line option, it will not try
to load the nickname or channel databases, and will respond with "service
is inactive" messages to any commands sent to NickServ, ChanServ,
MemoServ or BotServ. This can be useful as an emergency stopgap measure
when the main copy of Anope cannot be started.
The "-debug" option is useful if you find or suspect a problem in Anope.
Giving it once on the command line will cause all traffic to and from
services as well as some other debugging information to be recorded in
the log file; if you send a bug report, PLEASE include an excerpt from
the log file WITH DEBUGGING ACTIVE; we cannot emphasize enough how
important this is to tracking down problems. (You can also enable
debugging while Services is running using OperServ's SET DEBUG command.)
If you repeat the -debug option more than once, the debugging level will
be increased, which provides more detailed information but may also slow
Anope down considerably and make the log file grow dramatically faster
(in particular, at debug level 4 a message is written to the log for
every character received from the server). In general, a debug level of 1
is sufficient for the coding team to be able to trace a problem, because
all network traffic is included and we can usually reproduce the problem.
The "-forceload" option is provided to attempt recovery of data from
corrupted or truncated databases. Normally, if Anope encounters an error
writing to a database file, it will attempt to restore the original
version of the file and report an error to the logfile and through
WALLOPS. However, if this should fail (which normally should not happen),
or if Anope is terminated abruptly e.g. by kill -9 or a power failure,
then one or more of the databases may be corrupt. Normally, this will
cause Anope to abort the next time you try to run it; however, if yo
give the -forceload option to Anope, it will instead read as much as it
can, then skip to the next database. For obvious reasons, it's highly
recommended to keep backup copies of your databases in case something
does happen (since Anope will stop at the first error in a database, even
with -forceload, meaning you lose any data after that).
5) Messages Translations
Anope has a powerful option in NickServ allowing users to choose what
language it must use when sending messages to users. Messages are stored
in language files (located in the lang directory).
Anope is currently provided with thirteen languages: Catalan, Dutch,
English, French, German, Greek, Hungarian, Italian, Polish, Portuguese,
Russian, Spanish and Turkish. If you want to translate Anope messages
into another language, follow this instructions:
* Copy the lang/en_us.l file to a meaningful name (for example, if
you would like to translate messages in Spanish, you would rename
it to es.l).
* Edit the file with your favorite text editor. Carefully read the
instructions given at the top of the file, and start translating
the whole file. The file is big, so make sure you have some coffee
available ;) Try to avoid the use of English words as much as
possible. If the new language contains only a few 'special'
characters, try and use latin representations of it, if possible.
Remember that most clients are only capable of handling the
ISO-8859-1 charset. Of course, if you are translating Anope to a
language with a totally different charset, such as Russian, feel
free to use the one that suites it best (and the one that is in use
by most speakers of that language ;)).
* When this is done, you have two solutions: either patch Services
source code so they take in account the new language file (section 6),
or send us the translated file so we can make the patch and include
your language in the next Anope release.
* Note that there is a language tool on bin/langtool.pl that can aid
the verification process on newly created language files. Try to
use it before you submit a language file.
When new major releases come out, you'll not have to retranslate the
whole file; the Changes.lang file will help you to know which messages
were added, modified or deleted.
If you did a language file translation, and want to let others use it,
please send it to team@anope.org (don't forget to mention clearly your
(nick)name, your e-mail and the language name). You'll of course get full
credit for it, and will even get future final major releases before
anyone else to complete the translation!... ;)
6) Adding Your Translation Into The Source
First, get the latest svn version of Anope. This can be done by doing
'svn co http://anope.svn.sourceforge.net/svnroot/anope/stable ./anope-stable`
Second, Place your language file in lang/, and type 'svn add file.l`. Where file is
your language file.
Next, edit lang/Makefile and add your file into both the LANGOBJS variable and
the LANGSRCS variable (alphabetically please). Then, go down and add an entry for
it similar the others, eg:
en_us: en_us.l langcomp index
./langcomp $@.l
(which creates the english language file)
Now, edit include/services.h and search for "#define LANG_EN_US", and add your language to
the bottom of the list, eg:
#define LANG_BLAH 16 /* Blah language! */
(given the language above its number is 15).
Then change the NUM_LANGS to one more than it currently is (in this case, 17)
and add one to USED_LANGS.
Finially, edit src/language.c and add your language to the bottom of the array there, eg:
...
LANG_HUN, /* Hungarian */
LANG_PL, /* Polish */
LANG_BLAH, /* Blah language! */
};
then, go down and add it with the others using load_lang(), eg:
...
load_lang(LANG_HUN, "hun");
load_lang(LANG_PL, "pl");
load_lang(LANG_BLAH, "blah");
Now use 'svn diff > language.diff` to get the changes you made, and if it looks good (test it)
email it to team@anope.org!
Please be aware we will only include a new language if there is sufficient demand for it.
Please do not be disappointed if we do not include your language within Anope.
Check Changes.lang in order for your language to continue to work on your copy of Anope upgrades.
7) Contact
For announcements and discussions about Anope, please visit our
Portal and Forums at http://www.anope.org/ -- make sure you register
yourself and your network to get full benefits.
If you read the documentation carefully, and didn't find the answer to
your question, feel free to post on the website forums or join our irc
channel (irc.anope.org #anope). Once you join our Support channel, just
type "? report" for instructions on how to report a Bug. Be as precise as
possible when asking a question, because we have no extraordinary powers
and can't guess things if they aren't provided. The more precise you are,
the sooner you'll be likely to get an answer.
If you think you found a bug, add it to the bug tracking system
(http://bugs.anope.org) and - again - be as precise as possible. Also say
whether the bug happens always or under what circumstances, and anything
that could be useful to track your bug down. If you wrote a patch, send
it over. :)
-80
View File
@@ -1,80 +0,0 @@
Legend:
x = done
? = unsure
+ = in progress
1.9.2
-----
[x] Redo database insanity.
[x] Move database load/save to a module
[x] realtime SQL/whatever module using events (possibly ongoing)
[x] flatfile save on a periodic timer
[x] SANE password encryption - prefix password with the method it was encrypted with, allowing for *seamless* upgrading to different methods
[x] Salted SHA256 (contact Special for this)
[x] New database format (text, not binary - works very well for merging and so on)
[x] generic database routines modules can use to create their own database
[?] IRCd capability support: don't rely on CAPAB, provide an interface to turn capabilities on specifically
[x] Socket subsystem needs some serious loving
[x] Multiple sockets
[x] Asynchronous, using select() (multiple engines? not really needed..)
[x] Callbacks, event style, see also inspircd
[x] generic way to check which modes a user has set (u->HasUmode(UMODE_OPER))
[x] way for one module to depend on another... not like 2 MOD_HEADs and it being unpredictable which is loaded first..
the MOD_HEAD MOD_TAIL allows for too few combinations (interface code of insp, hooks code of insp?)
[x] Last used time on AKICK/access entries
[x] Channel passwords seem to be of limited use, think of a more appropriate way to handle this
[+] General options block, ability to turn LOGCHAN on from the config file..
[x] Docs directory cleanup
[x] Fix permanent channels support properly
[x] CS SET INHABIT to keep pseudoclient in a channel after it empties to maintain banlists and such
[x] Set forbidden channels +s
[x] SendAkill should just take a pointer to the Akill class instead of millions of fields (same for some other stuff)
[x] burn do_sjoin with fire
[x] Channel access additions
[x] Setter
[x] Last used
Future
------
[ ] Asynchronous DNS
[ ] CIDR Akills, session exceptions, etc
[ ] Hashing system for storing just about everything needs to die
[ ] Move a (lot) of stuff to class members as a defined interface rather than copypasta everywhere (ns_set, ns_saset!)
[?] Remote identification (1.9.1? will this break stuff?)
[ ] Language charset stuff, including collation (1.9.1? phoenix?)
[ ] Add support for +k, +q, etc type umodes
[ ] fantasy: allow replies/notifications to fantasy commands to go to the channel via notice
[?] a way for a module to queue itself (or even another module) for unloading
[ ] Language system is disgusting, it must die.
[ ] Modules should also have a way to add strings programatically
[ ] Should be able to add many strings by dropping a file in a set location.
[ ] I forsee this working via a function rather than defines, as it seems to do now: e.g. _("NS_NICK_IS_REGISTERED").
[?] Update help to reflect the fact /msg memoserv set notify mail - works just fine ;)
[ ] Useful/common "third party" modules to core distro
[ ] NS AJOIN
[+] Method to store listmodes (more generically than AKICK, too) for e.g. +beI and extbans, etc.
[ ] Channel access additions
[ ] Time added
[ ] Time modified
[ ] Expiry (useful?)
[ ] NS INFO: seperate field for last seen realhost, shown to SRA only
[ ] NS SUSPEND: show suspender and reason, probably to sopers only (see CS SUSPEND)
[ ] Merge NS INFO blah ALL with NS INFO blah, if you're requesting info, you really want the info anyway.
[?] Don't allow soper accounts to expire
[?] Reason for CS SET RESTRICTED
[ ] NS IDENTIFY changes
[?] Last failed identify? Maybe more useful for sopers only, so users don't get unnecessarily worried
[?] Last successful login time/ip? perhaps both of these should be a new nick setting
[x] AKILL/SGLINE/etc..
[x] Setter
[x] Time added
[+] Time modified (can they be modified?)
[ ] Time until expiry/expiry time (YES, time until expiry *instead of* expiry time, more human)
[x] Reason
[ ] Unique IDs on each AKILL/blah so that networks may use them as ticket IDs
[ ] HS ACTIVATE -ALL (rob sez this all needs reviewing)
[?] NS MARK, CS MARK. Allow multiple marks. Combine into OS MARK? (AKA os_info)
[?] MS IGNORE. Make it take nick (accounts) or n!u@h masks. Fake success of memo send still, but send to opers?
[?] More "friendly" date displays of some things like registration time ("November 7th 2006 (2 years, 0 months, 0 days ago)")
[?] OS INJECT
[?] Drop CS SET ENTRYMSG, replace with a 'news' type system? (limited to a configured number of items, default 3)
-309
View File
@@ -1,309 +0,0 @@
Troubleshooting Guide for Anope 1.9
------------------------------------------------
NOTE:
An updated version of this guide can be found on our wiki:
http://wiki.anope.org/index.php/Troubleshooting
Table of Contents
-----------------
1) General
1.1) Anope complains in the logfile about being unable to load the default
language.
1.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
1.3) I selected a language other than English, but sometimes Anope sends
responses in English instead.
1.4) Anope always dies after about five minutes, saying "FATAL ERROR! Can't
back up nick.db".
1.5) Anope crashed with a segmentation fault.
1.6) I've found a bug that's not mentioned here or in the README or BUGS
files. What should I do?
1.7) My FreeBSD box complains about 'Shared object "nss_dns.so.1" not
found'
1.8) Anope and long (more then 30 character) nicknames.
2) Installation / Configuration
2.1) When I run "make", I get an error message like "missing separator",
"Unassociated shell command", "Unexpected end of line seen", etc.
2.2) I get an error like "Makefile.inc not found".
2.3) I typed "./services" at the command line, but nothing happened!
2.4) Whenever I start Anope, I get a message on my IRC server saying
"connection refused" or something similar, and Anope gives an error
message from the server saying "Closing Link: ...".
2.5) My IRC server is giving me messages like "Connection to
services.whatever.net[127.0.0.1] activated" and then "Access denied --
no N line". Why?
2.6) When I say "/connect services.*", it doesn't work!
2.7) Anope starts up okay, but if I try to register a nickname, it comes
back with "Sorry, registration failed."
2.8) Anope reports (via /stats u or /msg OperServ STATS) a different number
of users online than I get from doing /lusers.
3) BotServ
3.1) How do I add bots to BotServ?
3.2) Why do kick triggers and fantasy commands fail to work with my Bahamut
IRCd?
4) ChanServ
4.1) Anope's channel mode setting doesn't work. I can't set modes with
OperServ, and every time ChanServ tries to set a mode, my server
reverses the change.
4.2) Anope ignored the SET SUCCESSOR setting and deleted a channel when the
founder expired.
4.3) How to auto voice all those whom join my #channel?
4.4) Channel options like RESTRICTED or SECUREOPS don't work. What's wrong?
5) OperServ
5.1) Using the OperServ JUPE command results in server messages like
"Server juped.server introduced by non-hub server services.my.net".
5.2) When I add an AKILL, the users matching it don't get killed.
5.3) Trying to use OperServ gives me "Access denied".
5.4) I can't get /OS UMODES and /OS SVSNICK to work!
5.5) What is a Super-Admin? How does it work? Why might it not work?
-------------------------------------------------------------------------------
1) General
1.1) Anope complains in the logfile about being unable to load the default
language.
You forgot to run "make install".
1.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
See section 5 of the README file.
1.3) I selected a language other than English, but sometimes Anope sends
responses in English instead.
Some language files are not complete--in other words, they only have a
translation of some of the message Anope uses. In this case, the
missing messages will be displayed in English. You can either wait for
the primary translator to provide us with a translation, or do the
translation yourself and send us the messages translated into your
language.
1.4) Anope always dies after about five minutes, saying "FATAL ERROR! Can't
back up nick.db".
Make sure that the user Anope runs as has write access to the data
directory, and that the data directory actually exists (the latter
shouldn't be a problem if you ran the Config script). This means Anope
needs write and execute permission on the data directory itself and execute
permission on every parent directory of the data directory.
1.5) Anope crashed with a segmentation fault.
See if you can reproduce this by doing a certain sequence of things. If
so, please report it to us (see part 6 of README file). If not, you're
probably out of luck; if you like, you can report it to us anyway, but
chances are it won't get fixed if we don't have instructions on reproducing
it. If you do have such a problem, you may find the crontab utility useful
for dealing with it.
Also, see the DumpCore directive in the configuration file. It allows Anope
to dump its core whenever it's segfaulting, usually calling it core and
placing it into Anope's main directory. Open up gdb by issuing the
following command at your shell:
* gdb services core
(of course replacing 'core' with the name of the core if different) and
type 'bt' at the gdb prompt. After that, send us the output you got and
keep the core file in a safe place, in case we need it to dig deeper into
the problem.
1.6) I've found a bug that's not mentioned here or in the README or BUGS files.
What should I do?
See section 6 of the README file.
1.7) My FreeBSD box complains about 'Shared object "nss_dns.so.1" not found'
We haven't figured out the exact cause yet, but as a quickfix you can
delete the /etc/nsswitch.conf file. Please keep in mind that removing a
configuration file can be dangerous, so only do this if you know what you
are doing.
1.8) Anope and long (more then 30 character) nicknames.
By default, Anope only supports nicknames up to 30 characters (NICKLEN=30).
If your IRCd allows for longer nicknames or has been modified to do so
Anope will start logging a lot of ("NICK from nonexistent nick") messages.
This is because once a user uses a nick that is too long for Anope to handle,
Anope loses track of the user for the remainder of the session.
It is POSSIBLE but not NOT RECOMMENDED to extend the maximum length of nicknames
Anope can track, however this will also break database compatibility. DBs saved
with Anope set to allow for example 40 chars cannot be read by a clean Anope
installation and vice versa. So changing the maximum nick length is only possible
when starting with fresh databases and even then the consequences of this are
UNTESTED.
In order to change the maximum internal nick length, change the NICKMAX setting
in include/config.h, recompile anope and start without databases.
2) Installation / Configuration
2.1) When I run "make", I get an error message like "missing separator",
"Unassociated shell command", "Unexpected end of line seen", etc.
Your make program isn't compatible with the Makefile for Anope. The
Makefile was designed to work with GNU make, and as such may not work on
other systems' "make" programs. If you get an error from "make", obtain
GNU make from ftp://prep.ai.mit.edu/pub/gnu/make/ (or wherever you prefer) and
use it instead of your system's default "make". Note that GNU make may
already be installed on your system; try using the command "gmake" instead
of "make".
The make programs bundled with SunOS/Solaris and FreeBSD have been reported
not to work; you will need to use GNU make on these systems.
2.2) I get an error like "Makefile.inc not found".
You forgot to run the Config script first. See the INSTALL file for
compilation instructions.
2.3) I typed "./services" at the command line, but nothing happened!
Anope puts itself in the background when it starts, so you get your shell
prompt right back. Meanwhile, Anope will continue setting up, then connect
to the IRC server specified in services.conf (or on the command line). If
it doesn't connect, you probably specified the wrong IRCd or RemoteServer in
the configuration file. Check to make sure that you are actually running one of
the supported IRCds, also. A list of supported IRCds can be found in the README
file.
You can also check the log file (services.log by default) for error
messages. Starting services with the -support command line option
will prevent it from running in the background will output the
messages written to the log file to the console as well. Please note that this
will also prevent 3rd party modules from loading and will put Anope into
debug mode.
2.4) Whenever I start Anope, I get a message on my IRC server saying
"connection refused" or something similar, and Anope gives an error
message from the server saying "Closing Link: ...".
See section 3 of the INSTALL file.
2.5) My IRC server is giving me messages like "Connection to
services.whatever.net[127.0.0.1] activated" and then "Access denied -- no
N line". Why?
This is typically caused by including a port number in the C:line for
services, which tells your server to try to autoconnect to it (depending on
the class (Y:line) settings). This is not what you want, because Anope
will connect to the server itself, but does not listen for servers to
connect to it. The solution is to remove the port number from the C:line.
2.6) When I say "/connect services.*", it doesn't work!
You cannot /connect services. When you start Anope, it will attempt to
connect to the server you specified in services.conf. Please see the answer
above for more information.
2.7) Anope starts up okay, but if I try to register a nickname, it comes back
with "Sorry, registration failed."
Make sure you've selected the correct IRC server type in the configure
script; see section 3 of the INSTALL file for details.
2.8) Anope reports (via /stats u or /msg OperServ STATS) a different number of
users online than I get from doing /lusers.
Anope doesn't count its own pseudo-clients (NickServ, ChanServ, etc.) in
its user count, while the IRC server does.
3) BotServ
3.1) How do I add bots to BotServ?
Read /msg BotServ HELP and /msg BotServ HELP BOT. Note that you need to be
opered up and identified as a Services Administrator in Anope before you
can use the BOT command.
3.2) Why do kick triggers and fantasy commands fail to work with my Bahamut
IRCd?
Bahamut allows you to setup a server as 'serviceshub'. This will filter
certain data that services usually don't need to process. This option also
filters channel messages, because DALnet's services have no use for them.
Anope parses the channel messages for kick triggers and fantasy commands.
To make sure these work the server type of the hub they're linked to should
be simply 'hub' and not 'serviceshub'.
4) ChanServ
4.1) Anope's channel mode setting doesn't work. I can't set modes with
OperServ, and every time ChanServ tries to set a mode, my server reverses
the change.
Make sure EVERY server on your network has a U: line for Services in
ircd.conf, for example:
U:services.whatever.net:*:*
4.2) Anope ignored the SET SUCCESSOR setting and deleted a channel when the
founder expired.
Normally, this is because the successor had too many channels registered.
In this case, you will see an entry in the log file like the following:
[date] Successor (SuccessorNick) of channel #somechannel owns too many
channels, deleting channel #somechannel
If you don't get a message like this or you can verify that the successor
wasn't running into the channel limit, please report it using the
bug-reporting procedure in section 6 of the README file.
4.3) How to auto voice all those whom join my #channel?
Execute the following commands (/cs is an alias for /msg ChanServ):
/cs set #channel secure off
/cs set #channel xop off
/cs levels #channel set AUTOVOICE -1
4.4) Channel options like RESTRICTED or SECUREOPS don't work. What's wrong?
Make sure that you didn't put any of your normal IRCd's as a ULined server
in Anope. Some access checks for clients from ULined servers are skipped to
avoid fights between the ULined servers. This is usually only useful when
you have a statistics server connected to your network.
5) OperServ
5.1) Using the OperServ JUPE command results in server messages like "Server
juped.server introduced by non-hub server services.my.net".
Services' uplink must have an H: line for Services in the ircd.conf file,
which looks something like:
H:*::services.whatever.net
5.2) When I add an AKILL, the users matching it don't get killed.
Use the AkillOnAdd configuration directive.
5.3) Trying to use OperServ gives me "Access denied".
Check that you're opered on your IRCd (ie, moded +o)
Check that you're identified to a nickname listed within an opertype allowed to do the command you're trying.
Check whether you can use /msg operserv staff
5.4) I can't get /OS UMODES and /OS SVSNICK to work!
You need to be a SuperAdmin to be able to use these commands.
5.5) What is a Super-Admin? How does it work? Why might it not work?
SuperAdmin's have extra privileges, including being founder on all
channels. It must be activated on a per user basis and is only available to
Services Roots. It is set using OperServ and is not persistent. It only
works if SuperAdmin is not commented in the services configuration file,
which is commented out by default. Read /msg OperServ HELP SET SUPERADMIN
for further help.
+212 -223
View File
@@ -1,223 +1,212 @@
Anope for Windows
-----------------
1) Building the Source
2) Installation
3) Compiling Modules
4) Other compile options
5) Credits
1) Building the Source
NOTE: If you have downloaded one of the pre-compiled installers, you do
NOT need to complete this step, and you can proceed to step 2.
If you want to build Anope from source on a Win32 system, you will need
to follow this instructions:
1) Download the required files:
* Current Anope source:
http://sourceforge.net/project/showfiles.php?group_id=94081
* CMake:
http://www.cmake.org/cmake/resources/software.html
(NOTE: When installing, tell CMake to add itself to the PATH.)
If you have Visual C++ 6, 7 (.NET 2002/2003), 8 (2005), or 9 (2008) skip ahead to step 2, else you
need to download the following free components from Microsoft. Once
downloaded, install these packages.
* Microsoft Visual C++ 2008 Express Edition:
http://www.microsoft.com/express/vc/
or
* Microsoft Visual C++ 2005 Express Edition:
http://www.microsoft.com/downloads/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&displaylang=en
then download and install:
* Microsoft Windows 2008 SDK:
http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en
or (if you prefer a smaller download)
* Microsoft Windows 2003 Platform SDK: (Requires WGA validation)
http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en
(NOTE: Although they say for Windows Server 2003 or 2008, they do infact work on all supported
versions of Windows. When installing the 2003 SDK, you should select the Custom option, and only select
to have the Microsoft Windows Core SDK installed. When installing the 2008 SDK, you should select the
Custom option, and only select to have the Developer Tools installed, but also expand that and deselect
the Visual C++ Compilers as well as the Mobile Tools. Doing this will decrease the install time as well
as the space used by the SDK.)
If you chose to download the 2003 SDK, it will not work out-of-the-box on either Visual C++ 2005 Express or
Visual C++ 2008 Express. The 2008 SDK will work out-of-the-box with Visual C++ 2008 Express but not with
Visual C++ 2005 Express.
2) Unpack the Anope tarball with your favorite uncompression program
(WinZip or WinRAR, etc).
3) (Note before this step: If you fall under one of the situations at the end of Step 1 where it says that the
SDK will not work out of the box, do not bring up the Visual C++ Command Prompt by using the link in
the Windows Start Menu. Instead, edit vsvars32.bat in the directory where you unpacked the source code
in step 2, so the first line that says "@SET VSINSTALLDIR=<whatever>" has the directory where you installed
Visual C++ Express to, if different from the default. Save the file and then run it instead.)
Bring up the Visual C++ Command Prompt; This will launch a
DOS Command Prompt like window, which will set the environment
properties needed to make Anope.
Create a new directory, which will be used to hold the build files. You can make it
be a directory under the source directory unpacked in step 2, or somewhere else entirely.
Change directories to this new folder, by typing:
cd <path to build directory>
e.g.
cd c:\anope-build
4) You now need to configure Anope to your requirements. At the prompt type:
<path to source directory>\Config.bat
NOTE: If you run an Anti-Virus program such as McAfee or Norton, you may
be unable to run this command due to the protection in place. Some Anti-
Virus programs may detect the Anope Configuration Tool as a worm, however
this is not the case. If you are prompted to allow or deny execution of
the script, you should choose allow. If the script fails to run, and no
notice is displayed, please check your Anti-Virus settings before seeking
assistance.
An interactive configuration program should guide you through the install
options. You will be given a choice to use NMake or not. NMake will compile
inside the command prompt window you are in. If you want to build within
the Visual C++ IDE, say no to that option, and it'll create a Solution for
you to open up.
If you cannot find whats causing the error, please visit our forums or
our IRC Support channel for assistance.
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
at the prompt type:
nmake
Once you are back at the command prompt again, if there have been no
errors, you are ready to go.
If instead you decided to use the Visual C++ IDE, open up the Anope.sln
file. After the IDE has fully loaded, hit F7 to build everything.
Should you encounter errors with the installation process, check the
messages displayed for advice on resolving them. If you are unable to
resolve the issues yourself, seek assistance on our forums or in our
IRC Support channel.
6) Finally you will need to install Anope. If you said you wanted to use NMake
in step 4, at the prompt type:
nmake install
Otherwise, if you decided to use the Visual C++ IDE, find the project called
INSTALL within the Solution Explorer. Right-click on INSTALL and choose Build.
When you have done this, all the files will be installed to where they belong.
The only thing you need to do is rename "data/example.conf" to be "data/services.conf",
and then follow the steps to set up Anope.
You have now completed the building phase of Anope for Windows. You can
now move on to the next section, which is related to setting up Anope.
2) Installation
Since Anope for Windows does not use a visual interface, you must do the
configuration with a text editor before proceeding with running Anope
itself.
NOTE: You may need to open the configuration file with Wordpad, or a text
editor which supports UNIX line endings. Opening the configuration file in
Notepad will cause strange characters to appear, and you may not be able to
edit the file correctly.
Open services.conf, and read through it carefully and adjust the settings
you think you need to adjust. Pay special attention to these settings:
A) IRCDModule: This is the name of an IRCd Module that Anope will use
to communicate with your server. Anope supports 15 IRCds,
so ensure you set the right value here.
B) RemoteServer: This is the address to your ircd, along with the port
and password. You should consult your ircd
documentation on how to link ircds.
C) ServicesRoot: Remove the # and change the names to your nick so you
can take control of services once they are online.
D) UserKey1/2/3: Remove the # infront of the three UserKey settings, and
change the parameters to numbers; around 6-7 digits will
do.
If you are unsure of the settings, you can go to the dos command prompt
and run "anope.exe -nofork -debug" and watch the information as it
attempts to connect.
You can launch services in two ways. If you are sure that the entered
configuration information is correct, simply double clicking the Anope
executable will cause it to start; no window will pop up. If you'd rather
have a more textual output, you can start at the dos prompt and type in
"anope.exe". If services are successfully started up the dos prompt will
seem to hang; at this point you can safely close the dos window.
3) Compiling Modules
If you want to build other modules than the ones shipped by default, you
will need to modify the Makefile.inc.win32 file, in the src\modules folder.
A) Add modules; find the line stating "SRCS=" and add the name of the
file to the end of the line. So if you have two files:
SRCS=file.c file2.c
If you are compiling a folder of module components, such as the example
"catserv", you will need to add/change the "SUBS=" line. If you were
compiling the "catserv" example, the line would look like this:
SUBS=catserv
B) When you've done this, use the same command prompt you set up in part
1, change directories to the src\modules folder, and type:
nmake -f Makefile.win32
followed afterwards, by:
nmake -f Makefile.win32 install
C) You should now be able to load your modules on IRC via OperServ, or via
the services.conf file.
4) Other compile options
A) If you have trouble recompiling Anope, you should delete all files and folders
within the build folder you created in step 3 of section 1. Afterwards, follow
the directions from step 4 of section 1 down.
5) Credits
Anope is based on Epona and IRCServices. See CREDITS for more credits and
a complete list of all developers.
Anope's Windows-specific code is provided by:
* Dominick Meglio <codemastr@unrealircd.com>
* Trystan Scott Lee <trystan@nomadirc.net>
* Chris Hogben <heinz@anope.org>
Anope's Windows Installer was made using:
* NSIS 2.20 <http://nsis.sourceforge.net>
Anope for Windows
-----------------
1) Building the Source
2) Installation
3) Compiling Modules
4) Other compile options
5) Credits
1) Building the Source
NOTE: If you have downloaded one of the pre-compiled installers, you do
NOT need to complete this step, and you can proceed to step 2.
If you want to build Anope from source on a Win32 system, you will need
to follow this instructions:
1) Download the required files:
* Current Anope source:
http://sourceforge.net/project/showfiles.php?group_id=94081
If you have Visual C++ 6, 7 (.NET 2002/2003) or 8 (2005) skip ahead to step 2, else you
need to download the following free components from Microsoft. Once
downloaded, install these packages.
* Microsoft Visual C++ 2008 Express Edition:
http://www.microsoft.com/express/vc/
or
* Microsoft Visual C++ 2005 Express Edition:
http://msdn.microsoft.com/vstudio/express/visualc/download/
then download and install:
* Microsoft Windows PlatformSDK: (Requires WGA validation)
http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en
(NOTE: Although this says for Windows Server 2003, it does infact work on all supported
versions of Windows.)
When installing, you should select the Custom option, and ensure that the top option relating to
the registering of environment varibales, is enabled in addition to the default selections.
If you do not do this, you may run into problems with the PSDK not being found properly during install.
* MySQL for Windows (only needed if building with MySQL enabled):
http://dev.mysql.com/
(NOTE: Anope can be compiled against MySQL Version 3.23 and above)
2) Unpack the Anope tarball with your favorite uncompression program
(WinZip or WinRAR, etc).
3) Bring up the Visual C++ Command Prompt; This will launch a
DOS Command Prompt like window, which will set the environment
properties needed to make Anope.
Change directories to where you unpacked the source code in step 2, by typing:
cd <path to extracted source>
e.g.
cd c:\anope-trunk
4) You now need to configure Anope to your requirements. At the prompt type:
Config.bat
NOTE: If you run an Anti-Virus program such as McAfee or Norton, you may
be unable to run this command due to the protection in place. Some Anti-
Virus programs may detect the Anope Configuration Tool as a worm, however
this is not the case. If you are prompted to allow or deny execution of
the script, you should choose allow. If the script fails to run, and no
notice is displayed, please check your Anti-Virus settings before seeking
assistance.
An interactive configuration program should guide you through the install
options, and then detect your Microsoft Visual C++ Library files. If it
fails to detect them, you should check you have everything installed.
If you cannot find whats causing the error, please visit our forums or
our IRC Support channel for assistance.
5) You are now ready to compile. At the prompt type:
nmake -f Makefile.win32
Once you are back at the command prompt again, if there have been no
errors, you are ready to go.
Should you encounter errors with the installation process, check the
messages displayed for advice on resolving them. If you are unable to
resolve the issues yourself, seek assistance on our forums or in our
IRC Support channel.
6) Anope will install the files where they belong. The only thing you need
to do is rename "data/example.conf" to be "data/services.conf".
You have now completed the building phase of Anope for Windows. You can
now move on to the next section, which is related to setting up Anope.
2) Installation
Since Anope for Windows does not use a visual interface, you must do the
configuration with a text editor before proceeding with running Anope
itself.
NOTE: You may need to open the configuration file with Wordpad, or a text
editor which supports UNIX line endings. Opening the configuration file in
Notepad will cause strange characters to appear, and you may not be able to
edit the file correctly.
Open services.conf, and read through it carefully and adjust the settings
you think you need to adjust. Pay special attention to these settings:
A) IRCDModule: This is the name of an IRCd Module that Anope will use
to communicate with your server. Anope supports 15 IRCds,
so ensure you set the right value here.
B) RemoteServer: This is the address to your ircd, along with the port
and password. You should consult your ircd
documentation on how to link ircds.
C) ServicesRoot: Remove the # and change the names to your nick so you
can take control of services once they are online.
D) UserKey1/2/3: Remove the # infront of the three UserKey settings, and
change the parameters to numbers; around 6-7 digits will
do.
If you are unsure of the settings, you can go to the dos command prompt
and run "anope.exe -nofork -debug" and watch the information as it
attempts to connect.
You can launch services in two ways. If you are sure that the entered
configuration information is correct, simply double clicking the Anope
executable will cause it to start; no window will pop up. If you'd rather
have a more textual output, you can start at the dos prompt and type in
"anope.exe". If services are successfully started up the dos prompt will
seem to hang; at this point you can safely close the dos window.
3) Compiling Modules
If you want to build other modules than the ones shipped by default, you
will need to modify the Makefile.inc.win32 file, in the src\modules folder.
A) Add modules; find the line stating "SRCS=" and add the name of the
file to the end of the line. So if you have two files:
SRCS=file.c file2.c
If you are compiling a folder of module components, such as the example
"catserv", you will need to add/change the "SUBS=" line. If you were
compiling the "catserv" example, the line would look like this:
SUBS=catserv
B) When you've done this, use the same command prompt you set up in part
1, change directories to the src\modules folder, and type:
nmake -f Makefile.win32
followed afterwards, by:
nmake -f Makefile.win32 install
C) You should now be able to load your modules on IRC via OperServ, or via
the services.conf file.
4) Other compile options
A) If you have trouble recompiling Anope, you should try:
nmake -f Makefile.win32 distclean
This will clean up the source directory and allow for chages to be applied
to previously compiled files.
B) A list of valid options are:
install
distclean
clean
spotless
all
core
protocols
mypasql
languages
modules
The syntax for these options is:
nmake -f Makefile.win32 [option]
5) Credits
Anope is based on Epona and IRCServices. See CREDITS for more credits and
a complete list of all developers.
Anope's Windows-specific code is provided by:
* Dominick Meglio <codemastr@unrealircd.com>
* Trystan Scott Lee <trystan@nomadirc.net>
* Chris Hogben <heinz@anope.org>
Anope's Windows Installer was made using:
* NSIS 2.20 <http://nsis.sourceforge.net>
-30
View File
@@ -1,30 +0,0 @@
# If we are building for Visual Studio OR if the system we are on doesn't have sh (which would be odd on a *nix system...), we'll build a C++ program to create version.h
if(MSVC OR NOT SH)
# Set version.sh.c to use C++ as well as set it's compile flags
set_source_files_properties(version.sh.c PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
# Generate version_sh executable to create version.h from the contents of version.sh, setting it's linker flags as well
add_executable(version_sh version.sh.c)
set_target_properties(version_sh PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
# Generate version.h from the above executable and the version.log file from the main source directory, with dependencies to the given headers and all source files in the main Anope build
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h
COMMAND version_sh ${Anope_SOURCE_DIR}/version.log ${CMAKE_CURRENT_SOURCE_DIR}/version.sh ${CMAKE_CURRENT_BINARY_DIR}/version.h
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/version.sh DEPENDS version_sh ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${CMAKE_CURRENT_SOURCE_DIR}/pseudo.h ${CMAKE_CURRENT_SOURCE_DIR}/messages.h ${SRC_SRCS}
)
# Add version_sh to list of files for CPack to ignore
get_target_property(version_sh_BINARY version_sh LOCATION)
get_filename_component(version_sh_BINARY ${version_sh_BINARY} NAME)
add_to_cpack_ignored_files("${version_sh_BINARY}$" TRUE)
# For any non-Visual Studio platforms that do have sh, we will run version.h through the version.h shell script
else(MSVC OR NOT SH)
# Generate version.h from version.sh and the version.log file from the main source directory, with dependencies to the given headers and all source files in the main Anope build
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h
COMMAND ${SH} ${CMAKE_CURRENT_SOURCE_DIR}/version.sh ${Anope_SOURCE_DIR}/version.log ${CMAKE_CURRENT_BINARY_DIR}/version.h
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/version.sh DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${CMAKE_CURRENT_SOURCE_DIR}/pseudo.h ${CMAKE_CURRENT_SOURCE_DIR}/messages.h ${SRC_SRCS}
)
endif(MSVC OR NOT SH)
# Add version.h to the list of files for CPack to ignore
add_to_cpack_ignored_files("version.h$" TRUE)
# Add a custom target to the above file
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h)
+3 -3
View File
@@ -2,7 +2,7 @@
all: services.h extern.h pseudo.h version.h
version.h: Makefile version.sh services.h pseudo.h messages.h $(SRCS)
sh version.sh ../version.log $@
sh version.sh
services.h: sysconf.h config.h extern.h
touch $@
@@ -10,10 +10,10 @@ services.h: sysconf.h config.h extern.h
extern.h: slist.h
touch $@
pseudo.h: commands.h timers.h slist.h
pseudo.h: commands.h timeout.h encrypt.h datafiles.h slist.h
touch $@
clean:
clean:
(rm -f language.h)
distclean: clean
-218
View File
@@ -1,218 +0,0 @@
/* NickServ nickname structures. */
/** Flags set on NickAliases
*/
enum NickNameFlag
{
NS_BEGIN,
/* Nick may not be registered or used */
NS_FORBIDDEN,
/* Nick never expires */
NS_NO_EXPIRE,
/* This nick is being held after a kill by an enforcer client
* or is being SVSHeld. Used by ns_release to determin if something
* should be allowed to be released
*/
NS_HELD,
/* We are taking over this nick, either by SVSNICK or KILL.
* We are waiting for the confirmation of either of these actions to
* proceed. This is checked in NickAlias::OnCancel
*/
NS_COLLIDED,
NS_END
};
/** Flags set on NickCores
*/
enum NickCoreFlag
{
NI_BEGIN,
/* Kill others who take this nick */
NI_KILLPROTECT,
/* Dont recognize unless IDENTIFIED */
NI_SECURE,
/* Use PRIVMSG instead of NOTICE */
NI_MSG,
/* Don't allow user to change memo limit */
NI_MEMO_HARDMAX,
/* Notify of memos at signon and un-away */
NI_MEMO_SIGNON,
/* Notify of new memos when sent */
NI_MEMO_RECEIVE,
/* Don't show in LIST to non-servadmins */
NI_PRIVATE,
/* Don't show email in INFO */
NI_HIDE_EMAIL,
/* Don't show last seen address in INFO */
NI_HIDE_MASK,
/* Don't show last quit message in INFO */
NI_HIDE_QUIT,
/* Kill in 20 seconds instead of in 60 */
NI_KILL_QUICK,
/* Kill immediatly */
NI_KILL_IMMED,
/* User gets email on memo */
NI_MEMO_MAIL,
/* Don't show services access status */
NI_HIDE_STATUS,
/* Nickname is suspended */
NI_SUSPENDED,
/* Autoop nickname in channels */
NI_AUTOOP,
/* This nickcore is forbidden, which means the nickalias for it is aswell */
NI_FORBIDDEN,
NI_END
};
/** XXX: this really needs to die with fire and be merged with metadata into NickCore or something.
*/
class CoreExport NickRequest
{
public:
NickRequest(const std::string &nickname);
~NickRequest();
NickRequest *next, *prev;
char *nick;
std::string passcode;
std::string password;
char *email;
time_t requested;
time_t lastmail; /* Unsaved */
};
class NickCore;
class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag>
{
public:
/** Default constructor
* @param nickname The nick
* @param nickcore The nickcofe for this nick
*/
NickAlias(const std::string &nickname, NickCore *nickcore);
/** Default destructor
*/
~NickAlias();
NickAlias *next, *prev;
char *nick; /* Nickname */
char *last_quit; /* Last quit message */
char *last_realname; /* Last realname */
char *last_usermask; /* Last usermask */
time_t time_registered; /* When the nick was registered */
time_t last_seen; /* When it was seen online for the last time */
NickCore *nc; /* I'm an alias of this */
HostInfo hostinfo;
/** Release a nick
* See the comment in users.cpp
*/
void Release();
/** This function is called when a user on this nick either disconnects or changes nick.
* Note that the user isnt necessarially identified to this nick
* See the comment in users.cpp
* @param u The user
*/
void OnCancel(User *u);
};
class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag>
{
public:
/** Default constructor
* @param display The display nick
*/
NickCore(const std::string &nickdisplay);
/** Default destructor
*/
~NickCore();
NickCore *next, *prev;
std::list<User *> Users;
char *display; /* How the nick is displayed */
std::string pass; /* Password of the nicks */
char *email; /* E-mail associated to the nick */
char *greet; /* Greet associated to the nick */
uint32 icq; /* ICQ # associated to the nick */
char *url; /* URL associated to the nick */
uint16 language; /* Language selected by nickname owner (LANG_*) */
std::vector<std::string> access; /* Access list, vector of strings */
MemoInfo memos;
uint16 channelcount; /* Number of channels currently registered */
OperType *ot;
/* Unsaved data */
time_t lastmail; /* Last time this nick record got a mail */
SList aliases; /* List of aliases */
/** Check whether this opertype has access to run the given command string.
* @param cmdstr The string to check, e.g. botserv/set/private.
* @return True if this opertype may run the specified command, false otherwise.
*/
virtual bool HasCommand(const std::string &cmdstr) const;
/** Checks whether this account is a services oper or not.
* @return True if this account is a services oper, false otherwise.
*/
virtual bool IsServicesOper() const;
/** Check whether this opertype has access to the given special permission.
* @param privstr The priv to check for, e.g. users/auspex.
* @return True if this opertype has the specified priv, false otherwise.
*/
virtual bool HasPriv(const std::string &privstr) const;
/** Add an entry to the nick's access list
*
* @param entry The nick!ident@host entry to add to the access list
*
* Adds a new entry into the access list.
*/
void AddAccess(const std::string &entry);
/** Get an entry from the nick's access list by index
*
* @param entry Index in the access list vector to retrieve
* @return The access list entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
*
* Retrieves an entry from the access list corresponding to the given index.
*/
std::string GetAccess(unsigned entry);
/** Find an entry in the nick's access list
*
* @param entry The nick!ident@host entry to search for
* @return True if the entry is found in the access list, false otherwise
*
* Search for an entry within the access list.
*/
bool FindAccess(const std::string &entry);
/** Erase an entry from the nick's access list
*
* @param entry The nick!ident@host entry to remove
*
* Removes the specified access list entry from the access list.
*/
void EraseAccess(const std::string &entry);
/** Clears the entire nick's access list
*
* Deletes all the memory allocated in the access list vector and then clears the vector.
*/
void ClearAccess();
};
-87
View File
@@ -1,87 +0,0 @@
/*
* Copyright (C) 2008-2010 Robin Burchell <w00t@inspircd.org>
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*
* $Id$
*
*/
/** Flags settable on a bot
*/
enum BotFlag
{
BI_BEGIN,
/* This bot can only be assigned by IRCops */
BI_PRIVATE,
/* The following flags are used to determin what bot really is what.
* Since you *could* have ChanServ really named BotServ or something stupid,
* this keeps track of them and allows them to be renamed in the config
* at any time, even if they already exist in the database
*/
BI_CHANSERV,
BI_BOTSERV,
BI_HOSTSERV,
BI_OPERSERV,
BI_MEMOSERV,
BI_NICKSERV,
BI_GLOBAL,
BI_END
};
struct CommandHash;
class CoreExport BotInfo : public Extensible, public Flags<BotFlag>
{
public:
BotInfo *next, *prev;
std::string uid; /* required for UID supporting servers, as opposed to the shitty struct Uid. */
std::string nick; /* Nickname of the bot */
std::string user; /* Its user name */
std::string host; /* Its hostname */
std::string real; /* Its real name */
time_t created; /* Birth date ;) */
int16 chancount; /* Number of channels that use the bot. */
/* Dynamic data */
time_t lastmsg; /* Last time we said something */
CommandHash **cmdTable;
/** Create a new bot.
* @param nick The nickname to assign to the bot.
* @param user The ident to give the bot.
* @param host The hostname to give the bot.
* @param real The realname to give the bot.
*/
BotInfo(const std::string &nick, const std::string &user = "", const std::string &host = "", const std::string &real = "");
/** Destroy a bot, clearing up appropriately.
*/
virtual ~BotInfo();
/** Change the nickname set on a bot.
* @param newnick The nick to change to
*/
void ChangeNick(const char *newnick);
/** Rejoins all channels that this bot is assigned to.
* Used on /kill, rename, etc.
*/
void RejoinAll();
/** Assign this bot to a given channel, removing the existing assigned bot if one exists.
* @param u The user assigning the bot, or NULL
* @param ci The channel registration to assign the bot to.
*/
void Assign(User *u, ChannelInfo *ci);
/** Remove this bot from a given channel.
* @param u The user requesting the unassign, or NULL.
* @param ci The channel registration to remove the bot from.
*/
void UnAssign(User *u, ChannelInfo *ci);
};
-264
View File
@@ -1,264 +0,0 @@
/* Channel support
*
* (C) 2008-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* $Id$
*
*/
struct UserData
{
UserData()
{
lastline = NULL;
last_use = last_start = time(NULL);
lines = times = 0;
}
virtual ~UserData() { delete [] lastline; }
/* Data validity */
time_t last_use;
/* for flood kicker */
int16 lines;
time_t last_start;
/* for repeat kicker */
char *lastline;
int16 times;
};
struct UserContainer
{
User *user;
UserData ud;
Flags<ChannelModeName> *Status;
UserContainer(User *u) : user(u) { }
virtual ~UserContainer() { }
};
typedef std::list<UserContainer *> CUserList;
enum ChannelFlags
{
/* Channel still exists when emptied */
CH_PERSIST,
/* If set the channel is syncing users (channel was just created) and it should not be deleted */
CH_SYNCING
};
class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
{
private:
/** A map of channel modes with their parameters set on this channel
*/
std::map<ChannelModeName, std::string> Params;
/* Modes set on the channel */
std::bitset<128> modes;
public:
/** Default constructor
* @param name The channel name
* @param ts The time the channel was created
*/
Channel(const std::string &name, time_t ts = time(NULL));
/** Default destructor
*/
~Channel();
Channel *next, *prev;
std::string name; /* Channel name */
ChannelInfo *ci; /* Corresponding ChannelInfo */
time_t creation_time; /* When channel was created */
char *topic;
std::string topic_setter;
time_t topic_time; /* When topic was set */
EList *bans;
EList *excepts;
EList *invites;
/* List of users in the channel */
CUserList users;
BanData *bd;
time_t server_modetime; /* Time of last server MODE */
time_t chanserv_modetime; /* Time of last check_modes() */
int16 server_modecount; /* Number of server MODEs this second */
int16 chanserv_modecount; /* Number of check_mode()'s this sec */
int16 bouncy_modes; /* Did we fail to set modes here? */
int16 topic_sync; /* Is the topic in sync? */
/** Restore the channel topic, set mlock (key), set stickied bans, etc
*/
void Sync();
/** Join a user internally to the channel
* @param u The user
*/
void JoinUser(User *u);
/** Remove a user internally from the channel
* @param u The user
*/
void DeleteUser(User *u);
/** Check if the user is on the channel
* @param u The user
* @return A user container if found, else NULL
*/
UserContainer *FindUser(User *u);
/** Check if a user has a status on a channel
* @param u The user
* @param cms The status mode, or NULL to represent no status
* @return true or false
*/
bool HasUserStatus(User *u, ChannelModeStatus *cms);
/** Check if a user has a status on a channel
* Use the overloaded function for ChannelModeStatus* to check for no status
* @param u The user
* @param Name The Mode name, eg CMODE_OP, CMODE_VOICE
* @return true or false
*/
bool HasUserStatus(User *u, ChannelModeName Name);
/** See if the channel has any modes at all
* @return true or false
*/
inline const bool HasModes() const { return modes.count(); }
/** See if a channel has a mode
* @param Name The mode name
* @return true or false
*/
bool HasMode(ChannelModeName Name);
/** Set a mode internally on a channel, this is not sent out to the IRCd
* @param cm The mode
* @param param The param
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void SetModeInternal(ChannelMode *cm, const std::string &param = "", bool EnforceMLock = true);
/** Remove a mode internally on a channel, this is not sent out to the IRCd
* @param cm The mode
* @param param The param
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void RemoveModeInternal(ChannelMode *cm, const std::string &param = "", bool EnforceMLock = true);
/** Set a mode on a channel
* @param bi The client setting the modes
* @param cm The mode
* @param param Optional param arg for the mode
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void SetMode(BotInfo *bi, ChannelMode *cm, const std::string &param = "", bool EnforceMLock = true);
/**
* Set a mode on a channel
* @param bi The client setting the modes
* @param Name The mode name
* @param param Optional param arg for the mode
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void SetMode(BotInfo *bi, ChannelModeName Name, const std::string &param = "", bool EnforceMLock = true);
/**
* Set a mode on a channel
* @param bi The client setting the modes
* @param Mode The mode
* @param param Optional param arg for the mode
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void SetMode(BotInfo *bi, char Mode, const std::string &param = "", bool EnforceMLock = true);
/** Remove a mode from a channel
* @param bi The client setting the modes
* @param cm The mode
* @param param Optional param arg for the mode
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void RemoveMode(BotInfo *bi, ChannelMode *cm, const std::string &param = "", bool EnforceMLock = true);
/**
* Remove a mode from a channel
* @param bi The client setting the modes
* @param Name The mode name
* @param param Optional param arg for the mode
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void RemoveMode(BotInfo *bi, ChannelModeName Name, const std::string &param = "", bool EnforceMLock = true);
/**
* Remove a mode from a channel
* @param bi The client setting the modes
* @param Mode The mode
* @param param Optional param arg for the mode
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
*/
void RemoveMode(BotInfo *bi, char Mode, const std::string &param = "", bool EnforceMLock = true);
/** Clear all the modes from the channel
* @param bi The client unsetting the modes
*/
void ClearModes(BotInfo *bi = NULL);
/** Clear all the bans from the channel
* @param bi The client unsetting the modes
*/
void ClearBans(BotInfo *bi = NULL);
/** Clear all the excepts from the channel
* @param bi The client unsetting the modes
*/
void ClearExcepts(BotInfo *bi = NULL);
/** Clear all the invites from the channel
* @param bi The client unsetting the modes
*/
void ClearInvites(BotInfo *bi = NULL);
/** Get a param from the channel
* @param Name The mode
* @param Target a string to put the param into
* @return true on success
*/
const bool GetParam(ChannelModeName Name, std::string &Target);
/** Check if a mode is set and has a param
* @param Name The mode
*/
const bool HasParam(ChannelModeName Name);
/** Set a string of modes on the channel
* @param bi The client setting the modes
* @param EnforceMLock Should mlock be enforced on this mode change
* @param cmodes The modes to set
*/
void SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...);
/** Kick a user from a channel internally
* @param source The sender of the kick
* @param nick The nick being kicked
* @param reason The reason for the kick
*/
void KickInternal(const std::string &source, const std::string &nick, const std::string &reason);
/** Kick a user from the channel
* @param bi The sender, can be NULL for the service bot for this channel
* @param u The user being kicked
* @param reason The reason for the kick
* @return true if the kick was scucessful, false if a module blocked the kick
*/
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
};
+12 -6
View File
@@ -6,9 +6,9 @@
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* $Id$
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
@@ -21,8 +21,14 @@
*/
extern MDE Command *lookup_cmd(Command *list, char *name);
extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[], const char *cmd);
extern MDE void mod_run_cmd(const std::string &service, User *u, CommandHash *cmdTable[], const char *cmd);
//extern MDE void do_help_limited(char *service, User * u, Command * c);
extern void run_cmd(char *service, User *u, Command *list,
char *name);
extern void help_cmd(char *service, User *u, Command *list,
char *name);
extern void do_run_cmd(char *service, User * u, Command *c,const char *cmd);
extern MDE void do_help_limited(char *service, User * u, Command * c);
extern void do_help_cmd(char *service, User * u, Command *c,const char *cmd);
extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
extern MDE void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
/*************************************************************************/
+38 -2
View File
@@ -22,9 +22,24 @@
/******* General configuration *******/
/* Name of configuration file (in Services directory) */
#define SERVICES_CONF "services.conf"
/* Name of log file (in Services directory) */
#define LOG_FILENAME "services.log"
/* Maximum amount of data from/to the network to buffer (bytes). */
#define NET_BUFSIZE 65536
/******* OperServ configuration *******/
/* Define this to enable OperServ's svs commands (superadmin only). */
#define USE_OSSVS
/* Define this to enable OperServ's debugging commands (Services root
* only). These commands are undocumented; "use the source, Luke!" */
/* #define DEBUG_COMMANDS */
/******************* END OF USER-CONFIGURABLE SECTION ********************/
/* Size of input buffer (note: this is different from BUFSIZ)
@@ -32,8 +47,29 @@
* things will happen. */
#define BUFSIZE 1024
/* Maximum amount of data from/to the network to buffer (bytes). */
#define NET_BUFSIZE 65536
/* Extra warning: If you change CHANMAX, your ChanServ database will be
* unusable.
*/
/* Maximum length of a channel name, including the trailing null. Any
* channels with a length longer than (CHANMAX-1) including the leading #
* will not be usable with ChanServ. */
#define CHANMAX 64
/* Maximum length of a nickname, including the trailing null. This MUST be
* at least one greater than the maximum allowable nickname length on your
* network, or people will run into problems using Services! The default
* (32) works with all servers I know of. */
#define NICKMAX 32
/* Maximum length of a password */
#define PASSMAX 32
/* Maximum length of a username */
#define USERMAX 10
/* Maximum length of a domain */
#define HOSTMAX 64
/**************************************************************************/
-903
View File
@@ -1,903 +0,0 @@
#ifndef _CONFIGREADER_H_
#define _CONFIGREADER_H_
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <deque>
/** A configuration key and value pair
*/
typedef std::pair<std::string, std::string> KeyVal;
/** A list of related configuration keys and values
*/
typedef std::vector<KeyVal> KeyValList;
/** An entire config file, built up of KeyValLists
*/
typedef std::multimap<std::string, KeyValList> ConfigDataHash;
// Required forward definitions
class ServerConfig;
/** Types of data in the core config
*/
enum ConfigDataType {
DT_NOTHING, // No data
DT_INTEGER, // Integer
DT_UINTEGER, // Unsigned Integer
DT_LUINTEGER, // Long Unsigned Integer
DT_CHARPTR, // Char pointer
DT_STRING, // std::string
DT_BOOLEAN, // Boolean
DT_HOSTNAME, // Hostname syntax
DT_NOSPACES, // No spaces
DT_IPADDRESS, // IP address (v4, v6)
DT_TIME, // Time value
DT_NORELOAD = 32, // Item can't be reloaded after startup
DT_ALLOW_WILD = 64, // Allow wildcards/CIDR in DT_IPADDRESS
DT_ALLOW_NEWLINE = 128 // New line characters allowed in DT_CHARPTR
};
/** Holds a config value, either string, integer or boolean.
* Callback functions receive one or more of these, either on
* their own as a reference, or in a reference to a deque of them.
* The callback function can then alter the values of the ValueItem
* classes to validate the settings.
*/
class ValueItem
{
/** Actual data */
std::string v;
public:
/** Initialize with an int */
ValueItem(int);
/** Initialize with a bool */
ValueItem(bool);
/** Initialize with a char pointer */
ValueItem(const char *);
/** Initialize with an std::string */
ValueItem(const std::string &);
/** Initialize with a long */
ValueItem(long);
/** Change value to a char pointer */
//void Set(char *);
/** Change value to a const char pointer */
void Set(const char *);
/** Change value to an std::string */
void Set(const std::string &);
/** Change value to an int */
void Set(int);
/** Get value as an int */
int GetInteger();
/** Get value as a string */
const char *GetString() const;
/** Get value as a string */
inline const std::string &GetValue() const { return v; }
/** Get value as a bool */
bool GetBool();
};
/** The base class of the container 'ValueContainer'
* used internally by the core to hold core values.
*/
class ValueContainerBase
{
public:
/** Constructor */
ValueContainerBase() { }
/** Destructor */
virtual ~ValueContainerBase() { }
};
/** ValueContainer is used to contain pointers to different
* core values such as the server name, maximum number of
* clients etc.
* It is specialized to hold a data type, then pointed at
* a value in the ServerConfig class. When the value has been
* read and validated, the Set method is called to write the
* value safely in a type-safe manner.
*/
template<typename T> class ValueContainer : public ValueContainerBase
{
/** Contained item */
T val;
public:
/** Initialize with nothing */
ValueContainer() : ValueContainerBase(), val(NULL) { }
/** Initialize with a value of type T */
ValueContainer(T Val) : ValueContainerBase(), val(Val) { }
/** Initialize with a copy */
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
ValueContainer &operator=(const ValueContainer &Val)
{
val = Val.val;
return *this;
}
/** Change value to type T of size s */
void Set(const T newval, size_t s)
{
memcpy(val, newval, s);
}
};
/** This a specific version of ValueContainer to handle character arrays specially
*/
template<> class ValueContainer<char **> : public ValueContainerBase
{
/** Contained item */
char **val;
public:
/** Initialize with nothing */
ValueContainer() : ValueContainerBase(), val(NULL) { }
/** Initialize with a value of type T */
ValueContainer(char **Val) : ValueContainerBase(), val(Val) { }
/** Initialize with a copy */
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
ValueContainer &operator=(const ValueContainer &Val)
{
val = Val.val;
return *this;
}
/** Change value to type T of size s */
void Set(const char *newval, size_t s)
{
if (*val) delete [] *val;
if (!*newval) {
*val = NULL;
return;
}
*val = new char[s];
strlcpy(*val, newval, s);
}
};
/** This a specific version of ValueContainer to handle std::string specially
*/
template<> class ValueContainer<std::string *> : public ValueContainerBase
{
/** Contained item */
std::string *val;
public:
/** Initialize with nothing */
ValueContainer() : ValueContainerBase(), val(NULL) { }
/** Initialize with an std::string */
ValueContainer(std::string *Val) : ValueContainerBase(), val(Val) { }
/** Initialize with a copy */
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
ValueContainer &operator=(const ValueContainer &Val)
{
val = Val.val;
return *this;
}
/** Change value to given std::string */
void Set(const std::string &newval)
{
*val = newval;
}
/** Change value to given char pointer */
void Set(const char *newval)
{
*val = newval;
}
};
/** A specialization of ValueContainer to hold a pointer to a bool
*/
typedef ValueContainer<bool *> ValueContainerBool;
/** A specialization of ValueContainer to hold a pointer to
* an unsigned int
*/
typedef ValueContainer<unsigned *> ValueContainerUInt;
/** A specialization of ValueContainer to hold a pointer to
* a long unsigned int
*/
typedef ValueContainer<long unsigned *> ValueContainerLUInt;
/** A specialization of ValueContainer to hold a pointer to
* a char array.
*/
typedef ValueContainer<char **> ValueContainerChar;
/** A specialization of ValueContainer to hold a pointer to
* an int
*/
typedef ValueContainer<int *> ValueContainerInt;
/** A specialization of ValueContainer to hold a pointer to
* a time_t
*/
typedef ValueContainer<time_t *> ValueContainerTime;
/** A specialization of ValueContainer to hold a pointer to
* an std::string
*/
typedef ValueContainer<std::string *> ValueContainerString;
/** A set of ValueItems used by multi-value validator functions
*/
typedef std::deque<ValueItem> ValueList;
/** A callback for validating a single value
*/
typedef bool (*Validator)(ServerConfig *, const char *, const char *, ValueItem &);
/** A callback for validating multiple value entries
*/
typedef bool (*MultiValidator)(ServerConfig *, const char *, const char **, ValueList &, int *, bool);
/** A callback indicating the end of a group of entries
*/
typedef bool (*MultiNotify)(ServerConfig *, const char *, bool);
/** Holds a core configuration item and its callbacks
*/
struct InitialConfig
{
/** Tag name */
const char *tag;
/** Value name */
const char *value;
/** Default, if not defined */
const char *default_value;
/** Value containers */
ValueContainerBase *val;
/** Data types */
int datatype;
/** Validation function */
Validator validation_function;
};
/** Holds a core configuration item and its callbacks
* where there may be more than one item
*/
struct MultiConfig
{
/** Tag name */
const char *tag;
/** One or more items within tag */
const char *items[17];
/** One or more defaults for items within tags */
const char *items_default[17];
/** One or more data types */
int datatype[17];
/** Initialization function */
MultiNotify init_function;
/** Validation function */
MultiValidator validation_function;
/** Completion function */
MultiNotify finish_function;
};
/** This class holds the bulk of the runtime configuration for the ircd.
* It allows for reading new config values, accessing configuration files,
* and storage of the configuration data needed to run the ircd, such as
* the servername, connect classes, /ADMIN data, MOTDs and filenames etc.
*/
class ServerConfig
{
private:
/** This variable holds the names of all
* files included from the main one. This
* is used to make sure that no files are
* recursively included.
*/
std::vector<std::string> include_stack;
/** Check that there is only one of each configuration item
*/
bool CheckOnce(const char *);
public:
std::ostringstream errstr;
ConfigDataHash newconfig;
/** This holds all the information in the config file,
* it's indexed by tag name to a vector of key/values.
*/
ConfigDataHash config_data;
/** Construct a new ServerConfig
*/
ServerConfig();
/** Clears the include stack in preperation for a Read() call.
*/
void ClearStack();
/** Read the entire configuration into memory
* and initialize this class. All other methods
* should be used only by the core.
*/
int Read(bool);
/** Report a configuration error given in errormessage.
* @param bail If this is set to true, the error is sent to the console, and the program exits
* @param connection If this is set to a non-null value, and bail is false, the errors are spooled to
* this connection as SNOTICEs.
* If the parameter is NULL, the messages are spooled to all connections via WriteOpers as SNOTICEs.
*/
void ReportConfigError(const std::string &, bool);
/** Load 'filename' into 'target', with the new config parser everything is parsed into
* tag/key/value at load-time rather than at read-value time.
*/
bool LoadConf(ConfigDataHash &, const char *, std::ostringstream &);
/** Load 'filename' into 'target', with the new config parser everything is parsed into
* tag/key/value at load-time rather than at read-value time.
*/
bool LoadConf(ConfigDataHash &, const std::string &, std::ostringstream &);
// Both these return true if the value existed or false otherwise
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &, const char *, const char *, int, char *, int, bool = false);
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &, const char *, const char *, const char *, int, char *, int, bool = false);
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &, const std::string &, const std::string &, int, std::string &, bool = false);
/** Writes 'length' chars into 'result' as a string
*/
bool ConfValue(ConfigDataHash &, const std::string &, const std::string &, const std::string &, int, std::string &, bool = false);
/** Tries to convert the value to an integer and write it to 'result'
*/
bool ConfValueInteger(ConfigDataHash &, const char *, const char *, int, int &);
/** Tries to convert the value to an integer and write it to 'result'
*/
bool ConfValueInteger(ConfigDataHash &, const char *, const char *, const char *, int, int &);
/** Tries to convert the value to an integer and write it to 'result'
*/
bool ConfValueInteger(ConfigDataHash &, const std::string &, const std::string &, int, int &);
/** Tries to convert the value to an integer and write it to 'result'
*/
bool ConfValueInteger(ConfigDataHash &, const std::string &, const std::string &, const std::string &, int, int &);
/** Returns true if the value exists and has a true value, false otherwise
*/
bool ConfValueBool(ConfigDataHash &, const char *, const char *, int);
/** Returns true if the value exists and has a true value, false otherwise
*/
bool ConfValueBool(ConfigDataHash &, const char *, const char *, const char *, int);
/** Returns true if the value exists and has a true value, false otherwise
*/
bool ConfValueBool(ConfigDataHash &, const std::string &, const std::string &, int);
/** Returns true if the value exists and has a true value, false otherwise
*/
bool ConfValueBool(ConfigDataHash &, const std::string &, const std::string &, const std::string &, int);
/** Returns the number of occurences of tag in the config file
*/
int ConfValueEnum(ConfigDataHash &, const char *);
/** Returns the number of occurences of tag in the config file
*/
int ConfValueEnum(ConfigDataHash &, const std::string &);
/** Returns the numbers of vars inside the index'th 'tag in the config file
*/
int ConfVarEnum(ConfigDataHash &, const char *, int);
/** Returns the numbers of vars inside the index'th 'tag in the config file
*/
int ConfVarEnum(ConfigDataHash &, const std::string &, int);
void ValidateHostname(const char *, const std::string &, const std::string &);
void ValidateIP(const char *p, const std::string &, const std::string &, bool);
void ValidateNoSpaces(const char *, const std::string &, const std::string &);
/** Below here is a list of variables which contain the config files values
*/
/* IRCd module in use */
char *IRCDModule;
/* Host to connect to **/
char *LocalHost;
/* List of uplink servers to try and connect to */
std::list<Uplink *> Uplinks;
/* Our server name */
char *ServerName;
/* Our servers description */
char *ServerDesc;
/* The username/ident of services clients */
char *ServiceUser;
/* The hostname if services clients */
char *ServiceHost;
/* Help channel, ops here get usermode +h **/
char *HelpChannel;
/* Log channel */
char *LogChannel;
/* Name of the network were on */
char *NetworkName;
/* The max legnth of nicks */
unsigned NickLen;
/* Max length of idents */
unsigned UserLen;
/* Max lenght of hostnames */
unsigned HostLen;
/* Max length of passwords */
unsigned PassLen;
/* NickServ Name */
char *s_NickServ;
/* ChanServ Name */
char *s_ChanServ;
/* MemoServ Name */
char *s_MemoServ;
/* BotServ Name */
char *s_BotServ;
/* OperServ name */
char *s_OperServ;
/* Global name */
char *s_GlobalNoticer;
/* NickServs realname */
char *desc_NickServ;
/* ChanServ realname */
char *desc_ChanServ;
/* MemoServ relname */
char *desc_MemoServ;
/* BotServ realname */
char *desc_BotServ;
/* OperServ realname */
char *desc_OperServ;
/* Global realname */
char *desc_GlobalNoticer;
/* HostServ Name */
char *s_HostServ;
/* HostServ realname */
char *desc_HostServ;
/* Filename for the PID file */
char *PIDFilename;
/* MOTD filename */
char *MOTDFilename;
/* True if its ok to not be able to save backs */
bool NoBackupOkay;
/* Do password checking when new people register */
bool StrictPasswords;
/* How many times you're allowed to give a bad password before being killed */
unsigned BadPassLimit;
/* How long before bad passwords are forgotten */
time_t BadPassTimeout;
/* Delay between automatic database updates */
time_t UpdateTimeout;
/* Delay between checks for expired nicks and channels */
time_t ExpireTimeout;
/* How long to wait for something from the uplink, this is passed to select() */
time_t ReadTimeout;
/* How often to send program errors */
time_t WarningTimeout;
/* How long to process things such as timers to see if there is anything to calll */
time_t TimeoutCheck;
/* Num of days logfiles are kept */
int KeepLogs;
/* Number of days backups are kept */
int KeepBackups;
/* Forbidding requires a reason */
bool ForceForbidReason;
/* Services should use privmsgs instead of notices */
bool UsePrivmsg;
/* Services only respond to full PRIVMSG client@services.server.name messages */
bool UseStrictPrivMsg;
/* Dump a core file if we crash */
bool DumpCore;
/* Log users connecting/existing/changing nicks */
bool LogUsers;
/* Number of seconds between consecutive uses of the REGISTER command
* Not to be confused with NSRegDelay */
unsigned NickRegDelay;
/* Max number if news items allowed in the list */
unsigned NewsCount;
/* Default mlock modes */
std::string MLock;
/* Default botmodes on channels, defaults to ao */
std::string BotModes;
/* How many times to try and reconnect to the uplink before giving up */
unsigned MaxRetries;
/* How long to wait between connection attempts */
int RetryWait;
/* Services can use email */
bool UseMail;
/* Path to the sendmail executable */
char *SendMailPath;
/* Address to send from */
char *SendFrom;
/* Only opers can have services send mail */
bool RestrictMail;
/* Delay between sending mail */
time_t MailDelay;
/* Don't quote the To: address */
bool DontQuoteAddresses;
/* Prefix of guest nicks when a user gets forced off of a nick */
char *NSGuestNickPrefix;
/* Allow users to set kill immed on */
bool NSAllowKillImmed;
/* Don't allow nicks to use /ns group to regroup nicks */
bool NSNoGroupChange;
/* Default flags for newly registered nicks */
Flags<NickCoreFlag> NSDefFlags;
/* Default language used by services */
unsigned NSDefLanguage;
/* Users must be connected this long before they can register
* Not to be confused with NickRegDelay */
time_t NSRegDelay;
/* Time before the registering mail will be resent */
time_t NSResendDelay;
/* How long before nicks expir */
time_t NSExpire;
/* Time before NickRequests expire */
time_t NSRExpire;
/* Force email when registering */
bool NSForceEmail;
/* Max number of nicks in a group */
int NSMaxAliases;
/* Max number of allowed strings on the access list */
unsigned NSAccessMax;
/* Enforcer client user name */
char *NSEnforcerUser;
/* Enforcer client hostname */
char *NSEnforcerHost;
/* How long before recovered nicks are released */
time_t NSReleaseTimeout;
/* /nickserv list is oper only */
bool NSListOpersOnly;
/* Max number of entries that can be returned from the list command */
unsigned NSListMax;
/* Only allow usermode +a etc on real services admins */
bool NSSecureAdmins;
/* Services opers must be /operd on the ircd aswell */
bool NSStrictPrivileges;
/* Use email to verify new users registering */
bool NSEmailReg;
/* Set the proper channel modes on users when they identify */
bool NSModeOnID;
/* Add the users hostnask their access list when they register */
bool NSAddAccessOnReg;
/* Default flags for newly registered channels */
Flags<ChannelInfoFlag> CSDefFlags;
/* Max number of channels a user can own */
unsigned CSMaxReg;
/* Time before a channel expires */
time_t CSExpire;
/* Default ban type to use for channels */
int CSDefBantype;
/* Max number of entries allowed on channel access lists */
unsigned CSAccessMax;
/* Max number of entries allowed on autokick lists */
unsigned CSAutokickMax;
/* Default autokick reason */
char *CSAutokickReason;
/* Time ChanServ should stay in the channel to hold it to keep users from getting in */
time_t CSInhabit;
/* ChanServ's LIST command is oper only */
bool CSListOpersOnly;
/* Max number of entries allowed to be returned from the LIST command */
unsigned CSListMax;
/* true to make ChanServ oper only */
bool CSOpersOnly;
/* Max number of memos allowed */
unsigned MSMaxMemos;
/* Time you must wait between sending memos */
time_t MSSendDelay;
/* Notify all of the aliases of the core the memo was sent to */
bool MSNotifyAll;
/* Who can use memos reciepts */
unsigned MSMemoReceipt;
/* Defai;t BotServ flags */
Flags<BotServFlag> BSDefFlags;
/* How long before botserv forgets a user. This is used for flood kickers etc */
time_t BSKeepData;
/* Min number of users to have in the channel before the service bot joins */
unsigned BSMinUsers;
/* Max number of words allowed on the badwordslist */
unsigned BSBadWordsMax;
/* BotServ bot only joins if it would normally allowed to, abides by bans etc */
bool BSSmartJoin;
/* Dont tell users what badword they used */
bool BSGentleBWReason;
/* Case sensitive badwords matching */
bool BSCaseSensitive;
/* Char to use for the fantasy char, eg ! */
char *BSFantasyCharacter;
/* Only show /stats o to opers */
bool HideStatsO;
/* Send out a global when services shut down or restart */
bool GlobalOnCycle;
/* Don't include the opers name in globals */
bool AnonymousGlobal;
/* Dont allow users to register nicks with oper names in them */
bool RestrictOperNicks;
/* Message to send when shutting down */
char *GlobalOnCycleMessage;
/* Message to send when starting up */
char *GlobalOnCycleUP;
/* Super admin is allowed */
bool SuperAdmin;
/* Log things said through ACT/SAY */
bool LogBot;
/* Log when new user max is reached */
bool LogMaxUsers;
/* Default expiry time for akills */
time_t AutokillExpiry;
/* Default expiry time for chan kills */
time_t ChankillExpiry;
/* Default expiry time for SGLine Expire */
time_t SGLineExpiry;
/* Default expiry time for SQLines */
time_t SQLineExpiry;
/* Default expiry time for SZLine */
time_t SZLineExpiry;
/* Actually akill the user when the akill is added */
bool AkillOnAdd;
/* Kill users on SGline */
bool KillonSGline;
/* Kill users on SQline */
bool KillonSQline;
/* Send a WALLOPS/GLOBOPS when a user opers */
bool WallOper;
/* Send a WALLOPS/GLOBOPS when a nonoper tries to use OperServ */
bool WallBadOS;
/* Send a WALLOPS/GLOBOPS when someone uses the GLOBAL command */
bool WallOSGlobal;
/* Send a WALLOPS/GLOBOPS when someone uses the MODE command */
bool WallOSMode;
/* Send a WALLOPS/GLOBOPS when someone uses the CLEARMODES command */
bool WallOSClearmodes;
/* Send a WALLOPS/GLOBOPS when someone uses the KICK command */
bool WallOSKick;
/* Send a WALLOPS/GLOBOPS when someone uses the AKILL command */
bool WallOSAkill;
/* Send a WALLOPS/GLOBOPS when someone uses the SGLINE command */
bool WallOSSGLine;
/* Send a WALLOPS/GLOBOPS when someone uses the SQLINE command */
bool WallOSSQLine;
/* Send a WALLOPS/GLOBOPS when someone uses the SZLINE command */
bool WallOSSZLine;
/* Send a WALLOPS/GLOBOPS when someone uses the NOOP command */
bool WallOSNoOp;
/* Send a WALLOPS/GLOBOPS when when someone uses the JUPE command */
bool WallOSJupe;
/* Send a WALLOPS/GLOBOPS when an akill expires */
bool WallAkillExpire;
/* Send a WALLOPS/GLOBOPS when SGLines expire */
bool WallSGLineExpire;
/* Send a WALLOPS/GLOBOPS when SQLines expire */
bool WallSQLineExpire;
/* Send a WALLOPS/GLOBOPS when SZLines expire */
bool WallSZLineExpire;
/* Send a WALLOPS/GLOBOPS when exceptions expire */
bool WallExceptionExpire;
/* Send a WALLOPS/GLOBOPS when DROP is used */
bool WallDrop;
/* Send a WALLOPS/GLOBOPS when FORBID is used */
bool WallForbid;
/* Send a WALLOPS/GLOBOPS when GETPASS is used */
bool WallGetpass;
/* Send a WALLOPS/GLOBOPS when SETPASS is used */
bool WallSetpass;
/* Add the akillers nick to the akill reason */
bool AddAkiller;
/* Limit sessions */
bool LimitSessions;
/* The default session limit */
unsigned DefSessionLimit;
/* How long before exceptions expire */
time_t ExceptionExpiry;
/* How many times to kill before adding an KILL */
int MaxSessionKill;
/* Max limit that can be used for exceptions */
unsigned MaxSessionLimit;
/* How long session akills should last */
time_t SessionAutoKillExpiry;
/* Reason to use for session kills */
char *SessionLimitExceeded;
/* Optional second reason */
char *SessionLimitDetailsLoc;
/* OperServ requires you to be an operator */
bool OSOpersOnly;
/* List of modules to autoload */
std::list<std::string> ModulesAutoLoad;
/* Encryption modules */
std::list<std::string> EncModuleList;
/* Database modules */
std::list<std::string> DBModuleList;
/* HostServ Core Modules */
std::list<std::string> HostServCoreModules;
/* MemoServ Core Modules */
std::list<std::string> MemoServCoreModules;
/* BotServ Core Modules */
std::list<std::string> BotServCoreModules;
/* OperServ Core Modules */
std::list<std::string> OperServCoreModules;
/* NickServ Core Modules */
std::list<std::string> NickServCoreModules;
/* ChanServ Core Modules */
std::list<std::string> ChanServCoreModules;
/* Default defcon level */
int DefConLevel;
/* Timeout before defcon is reset */
time_t DefConTimeOut;
/* Session limiit to use when using defcon */
int DefConSessionLimit;
/* How long to add akills for defcon */
time_t DefConAKILL;
/* Chan modes for defcon */
char *DefConChanModes;
/* Should we global on defcon */
bool GlobalOnDefcon;
/* Should we send DefconMessage aswell? */
bool GlobalOnDefconMore;
/* Message to send when defcon is off */
char *DefConOffMessage;
/* Message to send when defcon is on*/
char *DefconMessage;
/* Reason to akill clients for defcon */
char *DefConAkillReason;
/* User keys to use for generating random hashes for pass codes etc */
long unsigned int UserKey1;
long unsigned int UserKey2;
long unsigned int UserKey3;
/* Numeric */
char *Numeric;
/* Array of ulined servers */
char **Ulines;
/* Number of ulines */
int NumUlines;
/* List of available opertypes */
std::list<OperType *> MyOperTypes;
/* List of pairs of opers and their opertype from the config */
std::list<std::pair<std::string, std::string> > Opers;
};
/** This class can be used on its own to represent an exception, or derived to represent a module-specific exception.
* When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or
* a class derived from ModuleException. If a module throws an exception during its constructor, the module will not
* be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user
* attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.
*/
class ConfigException : public CoreException
{
public:
/** Default constructor, just uses the error mesage 'Config threw an exception'.
*/
ConfigException() : CoreException("Config threw an exception", "Config Parser") {}
/** This constructor can be used to specify an error message before throwing.
*/
ConfigException(const std::string &message) : CoreException(message, "Config Parser") {}
/** This destructor solves world hunger, cancels the world debt, and causes the world to end.
* Actually no, it does nothing. Never mind.
* @throws Nothing!
*/
virtual ~ConfigException() throw() { }
};
#define CONF_NO_ERROR 0x000000
#define CONF_NOT_A_NUMBER 0x000010
#define CONF_INT_NEGATIVE 0x000080
#define CONF_VALUE_NOT_FOUND 0x000100
#define CONF_FILE_NOT_FOUND 0x000200
/** Allows reading of values from configuration files
* This class allows a module to read from either the main configuration file (inspircd.conf) or from
* a module-specified configuration file. It may either be instantiated with one parameter or none.
* Constructing the class using one parameter allows you to specify a path to your own configuration
* file, otherwise, inspircd.conf is read.
*/
class CoreExport ConfigReader
{
protected:
/** The contents of the configuration file
* This protected member should never be accessed by a module (and cannot be accessed unless the
* core is changed). It will contain a pointer to the configuration file data with unneeded data
* (such as comments) stripped from it.
*/
ConfigDataHash *data;
/** Used to store errors
*/
std::ostringstream *errorlog;
/** If we're using our own config data hash or not
*/
bool privatehash;
/** True if an error occured reading the config file
*/
bool readerror;
/** Error code
*/
long error;
public:
/** Default constructor.
* This constructor initialises the ConfigReader class to read services.conf.
*/
ConfigReader();
/** Overloaded constructor.
* This constructor initialises the ConfigReader class to read a user-specified config file
*/
ConfigReader(const std::string &);
/** Default destructor.
* This method destroys the ConfigReader class.
*/
~ConfigReader();
/** Retrieves a value from the config file.
* This method retrieves a value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve.
*/
std::string ReadValue(const std::string &, const std::string &, int, bool = false);
/** Retrieves a value from the config file.
* This method retrieves a value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. If the
* tag is not found the default value is returned instead.
*/
std::string ReadValue(const std::string &, const std::string &, const std::string &, int, bool = false);
/** Retrieves a boolean value from the config file.
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
*/
bool ReadFlag(const std::string &, const std::string &, int);
/** Retrieves a boolean value from the config file.
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
* If the tag is not found, the default value is used instead.
*/
bool ReadFlag(const std::string &, const std::string &, const std::string &, int);
/** Retrieves an integer value from the config file.
* This method retrieves an integer value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
* values in the tag will cause the objects error value to be set, and any call to GetError() will
* return CONF_INVALID_NUMBER to be returned. need_positive is set if the number must be non-negative.
* If a negative number is placed into a tag which is specified positive, 0 will be returned and GetError()
* will return CONF_INT_NEGATIVE. Note that need_positive is not suitable to get an unsigned int - you
* should cast the result to achieve that effect.
*/
int ReadInteger(const std::string &, const std::string &, int, bool);
/** Retrieves an integer value from the config file.
* This method retrieves an integer value from the config file. Where multiple copies of the tag
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
* values in the tag will cause the objects error value to be set, and any call to GetError() will
* return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned.
* If a signed number is placed into a tag which is specified unsigned, 0 will be returned and GetError()
* will return CONF_NOT_UNSIGNED. If the tag is not found, the default value is used instead.
*/
int ReadInteger(const std::string &, const std::string &, const std::string &, int, bool);
/** Returns the last error to occur.
* Valid errors can be found by looking in modules.h. Any nonzero value indicates an error condition.
* A call to GetError() resets the error flag back to 0.
*/
long GetError();
/** Counts the number of times a given tag appears in the config file.
* This method counts the number of times a tag appears in a config file, for use where
* there are several tags of the same kind, e.g. with opers and connect types. It can be
* used with the index value of ConfigReader::ReadValue to loop through all copies of a
* multiple instance tag.
*/
int Enumerate(const std::string &);
/** Returns true if a config file is valid.
* This method is partially implemented and will only return false if the config
* file does not exist or could not be opened.
*/
bool Verify();
/** Dumps the list of errors in a config file to an output location. If bail is true,
* then the program will abort. If bail is false and user points to a valid user
* record, the error report will be spooled to the given user by means of NOTICE.
* if bool is false AND user is false, the error report will be spooled to all opers
* by means of a NOTICE to all opers.
*/
void DumpErrors(bool);
/** Returns the number of items within a tag.
* For example if the tag was &lt;test tag="blah" data="foo"&gt; then this
* function would return 2. Spaces and newlines both qualify as valid seperators
* between values.
*/
int EnumerateValues(const std::string &, int);
};
#endif
+71
View File
@@ -0,0 +1,71 @@
/* Database file descriptor structure and file handling routine prototypes.
*
* (C) 2003-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
#ifndef DATAFILES_H
#define DATAFILES_H
#ifndef _WIN32
#include <sys/param.h>
#endif
/*************************************************************************/
typedef struct dbFILE_ dbFILE;
struct dbFILE_ {
int mode; /* 'r' for reading, 'w' for writing */
FILE *fp; /* The normal file descriptor */
FILE *backupfp; /* Open file pointer to a backup copy of
* the database file (if non-NULL) */
char filename[MAXPATHLEN]; /* Name of the database file */
char backupname[MAXPATHLEN]; /* Name of the backup file */
};
/*************************************************************************/
/* Prototypes and macros: */
E void check_file_version(dbFILE *f);
E int get_file_version(dbFILE *f);
E int write_file_version(dbFILE *f, uint32 version);
E dbFILE *open_db(const char *service, const char *filename, const char *mode, uint32 version);
E void restore_db(dbFILE *f); /* Restore to state before open_db() */
E void close_db(dbFILE *f);
E void backup_databases(void);
#define read_db(f,buf,len) (fread((buf),1,(len),(f)->fp))
#define write_db(f,buf,len) (fwrite((buf),1,(len),(f)->fp))
#define getc_db(f) (fgetc((f)->fp))
E int read_int16(uint16 *ret, dbFILE *f);
E int write_int16(uint16 val, dbFILE *f);
E int read_int32(uint32 *ret, dbFILE *f);
E int write_int32(uint32 val, dbFILE *f);
E int read_ptr(void **ret, dbFILE *f);
E int write_ptr(const void *ptr, dbFILE *f);
E int read_string(char **ret, dbFILE *f);
E int write_string(const char *s, dbFILE *f);
#define read_int8(ret,f) ((*(ret)=fgetc((f)->fp))==EOF ? -1 : 0)
#define write_int8(val,f) (fputc((val),(f)->fp)==EOF ? -1 : 0)
#define read_buffer(buf,f) (read_db((f),(buf),sizeof(buf)) == sizeof(buf))
#define write_buffer(buf,f) (write_db((f),(buf),sizeof(buf)) == sizeof(buf))
#define read_buflen(buf,len,f) (read_db((f),(buf),(len)) == (len))
#define write_buflen(buf,len,f) (write_db((f),(buf),(len)) == (len))
#define read_variable(var,f) (read_db((f),&(var),sizeof(var)) == sizeof(var))
#define write_variable(var,f) (write_db((f),&(var),sizeof(var)) == sizeof(var))
/*************************************************************************/
#endif /* DATAFILES_H */
+127
View File
@@ -0,0 +1,127 @@
/* depricated.h
*
* (C) 2003-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
*
*/
/*
All of these functions were replaced in 1.7.6, you should move your modules
to use the new functions
*/
#define change_user_mode(u, modes, arg) common_svsmode(u, modes, arg)
#define GetIdent(x) common_get_vident(x)
#define GetHost(x) common_get_vhost(x)
#define NEWNICK(nick,user,host,real,modes,qline) \
anope_cmd_bot_nick(nick,user,host,real,modes)
#define s_akill(user, host, who, when, expires, reason) \
anope_cmd_akill(user, host, who, when, expires, reason)
#define set_umode(user, ac, av) anope_set_umode(user, ac, av)
#define s_svsnoop(server, set) anope_cmd_svsnoop(server, set)
#define s_sqline(mask, reason) anope_cmd_sqline(mask, reason)
#define s_sgline(mask, reason) anope_cmd_sgline(mask, reason)
#define s_szline(mask, reason) anope_cmd_szline(mask, reason)
#define s_unsgline(mask) anope_cmd_unsgline(mask)
#define s_unsqline(mask) anope_cmd_unsqline(mask)
#define s_unszline(mask) anope_cmd_unszline(mask)
#define s_rakill(user, host) anope_cmd_remove_akill(user, host)
# define NICKSERV_MODE ircd->nickservmode
# define CHANSERV_MODE ircd->chanservmode
# define HOSTSERV_MODE ircd->hostservmode
# define MEMOSERV_MODE ircd->memoservmode
# define BOTSERV_MODE ircd->botservmode
# define HELPSERV_MODE ircd->helpservmode
# define OPERSERV_MODE ircd->oprservmode
# define DEVNULL_MODE ircd->devnullmode
# define GLOBAL_MODE ircd->globalmode
# define NICKSERV_ALIAS_MODE ircd->nickservaliasmode
# define CHANSERV_ALIAS_MODE ircd->chanservaliasmode
# define MEMOSERV_ALIAS_MODE ircd->memoservaliasmode
# define BOTSERV_ALIAS_MODE ircd->botservaliasmode
# define HELPSERV_ALIAS_MODE ircd->helpservaliasmode
# define OPERSERV_ALIAS_MODE ircd->operservaliasmode
# define DEVNULL_ALIAS_MODE ircd->devnullaliasmode
# define GLOBAL_ALIAS_MODE ircd->globalaliasmode
# define HOSTSERV_ALIAS_MODE ircd->hostservaliasmode
# define BOTSERV_BOTS_MODE ircd->botserv_bot_mode
#define CHAN_MAX_SYMBOL ircd->max_symbols
#define MODESTOREMOVE ircd->modestoremove
#ifdef IRC_HYBRID
# define HAS_HALFOP
# define HAS_EXCEPT
#endif
#ifdef IRC_VIAGRA
# define HAS_HALFOP
# define HAS_VHOST
# define HAS_VIDENT
# define HAS_EXCEPT
#endif
#ifdef IRC_BAHAMUT
# define HAS_NICKIP
# define HAS_EXCEPT
# define HAS_SVSHOLD
#endif
#ifdef IRC_RAGE2
# define HAS_HALFOP
# define HAS_EXCEPT
# define HAS_VHOST
# define HAS_NICKVHOST
#endif
#ifdef IRC_PTLINK
# define HAS_NICKVHOST
# define HAS_VHOST
# define HAS_FMODE
# define HAS_EXCEPT
#endif
#ifdef IRC_ULTIMATE2
# define IRC_ULTIMATE /* gotta do this for old mods */
# define HAS_FMODE
# define HAS_HALFOP
# define HAS_LMODE
# define HAS_VHOST
# define HAS_VIDENT
# define HAS_EXCEPT
#endif
#if defined(IRC_UNREAL31) || defined(IRC_UNREAL32)
# define IRC_UNREAL /* gotta do this for old mods */
# define HAS_FMODE
# define HAS_HALFOP
# define HAS_LMODE
# define HAS_NICKVHOST
# define HAS_VHOST
# define HAS_VIDENT
# define HAS_EXCEPT
#endif
#ifdef IRC_ULTIMATE3
# define HAS_HALFOP
# define HAS_VHOST
# define HAS_NICKVHOST
# define HAS_VIDENT
# define HAS_EXCEPT
#endif
+22
View File
@@ -0,0 +1,22 @@
/* Include file for high-level encryption routines.
*
* (C) 2003-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
typedef struct encryption_ {
int (*encrypt)(const char *src, int len, char *dest, int size);
int (*encrypt_in_place)(char *buf, int size);
int (*encrypt_check_len)(int passlen, int bufsize);
int (*decrypt)(const char *src, char *dest, int size);
int (*check_password)(const char *plaintext, const char *password);
} Encryption;
+64
View File
@@ -0,0 +1,64 @@
/* Prototypes and external variable declarations.
*
* (C) 2003-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
#define EVENT_START "start"
#define EVENT_STOP "stop"
#define EVENT_DB_SAVING "db_saving"
#define EVENT_DB_BACKUP "db_backup"
#define EVENT_NEWNICK "newnick"
#define EVENT_BOT_UNASSIGN "bot_unassign"
#define EVENT_BOT_JOIN "bot_join"
#define EVENT_BOT_CREATE "bot_create"
#define EVENT_BOT_CHANGE "bot_change"
#define EVENT_BOT_FANTASY "bot_command"
#define EVENT_BOT_FANTASY_NO_ACCESS "bot_command_no_access"
#define EVENT_BOT_DEL "bot_del"
#define EVENT_BOT_ASSIGN "bot_assign"
#define EVENT_BOT_KICK "bot_kick"
#define EVENT_BOT_BAN "bot_ban"
#define EVENT_TOPIC_UPDATED "chan_topic_updated"
#define EVENT_CHAN_EXPIRE "chan_expire"
#define EVENT_CHAN_REGISTERED "chan_registered"
#define EVENT_CHAN_DROP "chan_dropped"
#define EVENT_CHAN_FORBIDDEN "chan_forbidden"
#define EVENT_CHAN_SUSPENDED "chan_suspended"
#define EVENT_CHAN_UNSUSPEND "chan_unsuspend"
#define EVENT_CONNECT "connect"
#define EVENT_DB_EXPIRE "db_expire"
#define EVENT_RESTART "restart"
#define EVENT_RELOAD "reload"
#define EVENT_SHUTDOWN "shutdown"
#define EVENT_SIGNAL "signal"
#define EVENT_NICK_REGISTERED "nick_registered"
#define EVENT_NICK_DROPPED "nick_dropped"
#define EVENT_NICK_FORBIDDEN "nick_forbidden"
#define EVENT_NICK_EXPIRE "nick_expire"
#define EVENT_CHANGE_NICK "change_nick"
#define EVENT_USER_LOGOFF "user_logoff"
#define EVENT_GROUP "nick_group"
#define EVENT_NICK_IDENTIFY "nick_id"
#define EVENT_SERVER_SQUIT "server_squit"
#define EVENT_SERVER_CONNECT "server_connect"
#define EVENT_DEFCON_LEVEL "defcon_level"
#define EVENT_NICK_SUSPENDED "nick_suspended"
#define EVENT_NICK_UNSUSPEND "nick_unsuspend"
#define EVENT_JOIN_CHANNEL "join_channel"
#define EVENT_PART_CHANNEL "part_channel"
#define EVENT_ACCESS_ADD "access_add"
#define EVENT_ACCESS_CHANGE "access_change"
#define EVENT_ACCESS_DEL "access_del"
#define EVENT_ACCESS_CLEAR "access_clear"
#define EVENT_NICK_LOGOUT "nick_logout"
#define EVENT_CHAN_KICK "chan_kick"
-232
View File
@@ -1,232 +0,0 @@
/*
*
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*
* $Id$
*
*/
/** Dummy base class we use to cast everything to/from
*/
class ExtensibleItemBase
{
public:
ExtensibleItemBase() { }
virtual ~ExtensibleItemBase() { }
};
/** Class used to represent an extensible item that doesn't hold a pointer
*/
template<typename T> class ExtensibleItemRegular : public ExtensibleItemBase
{
protected:
T Item;
public:
ExtensibleItemRegular(T item) : Item(item) { }
virtual ~ExtensibleItemRegular() { }
T GetItem() const { return Item; }
};
/** Class used to represent an extensible item that holds a pointer
*/
template<typename T> class ExtensibleItemPointer : public ExtensibleItemBase
{
protected:
T *Item;
public:
ExtensibleItemPointer(T *item) : Item(item) { }
virtual ~ExtensibleItemPointer() { delete Item; }
T *GetItem() const { return Item; }
};
/** Class used to represent an extensible item that holds a pointer to an arrray
*/
template<typename T> class ExtensibleItemPointerArray : public ExtensibleItemBase
{
protected:
T *Item;
public:
ExtensibleItemPointerArray(T *item) : Item(item) { }
virtual ~ExtensibleItemPointerArray() { delete [] Item; }
T *GetItem() const { return Item; }
};
class CoreExport Extensible
{
private:
std::map<std::string, ExtensibleItemBase *> Extension_Items;
public:
/** Default constructor, does nothing
*/
Extensible() { }
/** Default destructor, deletes all of the extensible items in this object
* then clears the map
*/
virtual ~Extensible()
{
for (std::map<std::string, ExtensibleItemBase *>::iterator it = Extension_Items.begin(); it != Extension_Items.end(); ++it)
{
delete it->second;
}
Extension_Items.clear();
}
/** Extend an Extensible class.
*
* @param key The key parameter is an arbitary string which identifies the extension data
* @param p This parameter is a pointer to an ExtensibleItem or ExtensibleItemBase derived class
*
* You must provide a key to store the data as via the parameter 'key'.
* The data will be inserted into the map. If the data already exists, you may not insert it
* twice, Extensible::Extend will return false in this case.
*
* @return Returns true on success, false if otherwise
*/
bool Extend(const std::string &key, ExtensibleItemBase *p)
{
bool Ret = this->Extension_Items.insert(std::make_pair(key, p)).second;
if (!Ret)
delete p;
return Ret;
}
/** Extend an Extensible class.
*
* @param key The key parameter is an arbitary string which identifies the extension data
*
* You must provide a key to store the data as via the parameter 'key', this single-parameter
* version takes no 'data' parameter, this is used purely for boolean values.
* The key will be inserted into the map with a NULL 'data' pointer. If the key already exists
* then you may not insert it twice, Extensible::Extend will return false in this case.
*
* @return Returns true on success, false if otherwise
*/
bool Extend(const std::string &key)
{
/* This will only add an item if it doesnt already exist,
* the return value is a std::pair of an iterator to the
* element, and a bool saying if it was actually inserted.
*/
return this->Extend(key, new ExtensibleItemRegular<char *>(NULL));
}
/** Shrink an Extensible class.
*
* @param key The key parameter is an arbitary string which identifies the extension data
*
* You must provide a key name. The given key name will be removed from the classes data. If
* you provide a nonexistent key (case is important) then the function will return false.
* @return Returns true on success.
*/
bool Shrink(const std::string &key)
{
std::map<std::string, ExtensibleItemBase *>::iterator it = this->Extension_Items.find(key);
if (it != this->Extension_Items.end())
{
delete it->second;
/* map::size_type map::erase( const key_type& key );
* returns the number of elements removed, std::map
* is single-associative so this should only be 0 or 1
*/
return this->Extension_Items.erase(key);
}
return false;
}
/** Get an extension item that is not a pointer.
*
* @param key The key parameter is an arbitary string which identifies the extension data
* @param p If you provide a non-existent key, this value will be 0. Otherwise a copy to the item you requested will be placed in this templated parameter.
* @return Returns true if the item was found and false if it was nor, regardless of wether 'p' is NULL. This allows you to store NULL values in Extensible.
*/
template<typename T> bool GetExtRegular(const std::string &key, T &p)
{
std::map<std::string, ExtensibleItemBase *>::iterator it = this->Extension_Items.find(key);
if (it != this->Extension_Items.end())
{
p = dynamic_cast<ExtensibleItemRegular<T> *>(it->second)->GetItem();
return true;
}
return false;
}
/** Get an extension item that is a pointer.
*
* @param key The key parameter is an arbitary string which identifies the extension data
* * @param p If you provide a non-existent key, this value will be NULL. Otherwise a pointer to the item you requested will be placed in this templated parameter.
* @return Returns true if the item was found and false if it was nor, regardless of wether 'p' is NULL. This allows you to store NULL values in Extensible.
*/
template<typename T> bool GetExtPointer(const std::string &key, T *&p)
{
std::map<std::string, ExtensibleItemBase *>::iterator it = this->Extension_Items.find(key);
if (it != this->Extension_Items.end())
{
p = dynamic_cast<ExtensibleItemPointer<T> *>(it->second)->GetItem();
return true;
}
p = NULL;
return false;
}
/** Get an extension item that is a pointer to an array
*
* @param key The key parameter is an arbitary string which identifies the extension data
* @param p If you provide a non-existent key, this value will be NULL. Otherwise a pointer to the item you requested will be placed in this templated parameter.
* @return Returns true if the item was found and false if it was nor, regardless of wether 'p' is NULL. This allows you to store NULL values in Extensible.
*/
template<typename T> bool GetExtArray(const std::string &key, T *&p)
{
std::map<std::string, ExtensibleItemBase *>::iterator it = this->Extension_Items.find(key);
if (it != this->Extension_Items.end())
{
p = dynamic_cast<ExtensibleItemPointerArray<T> *>(it->second)->GetItem();
return true;
}
p = NULL;
return false;
}
/** Get an extension item.
*
* @param key The key parameter is an arbitary string which identifies the extension data
* @return Returns true if the item was found and false if it was not.
*
* This single-parameter version only checks if the key exists, it does nothing with
* the 'data' field and is probably only useful in conjunction with the single-parameter
* version of Extend().
*/
bool GetExt(const std::string &key)
{
return (this->Extension_Items.find(key) != this->Extension_Items.end());
}
/** Get a list of all extension items names.
* @param list A deque of strings to receive the list
* @return This function writes a list of all extension items stored
* in this object by name into the given deque and returns void.
*/
void GetExtList(std::deque<std::string> &list)
{
for (std::map<std::string, ExtensibleItemBase *>::iterator i = Extension_Items.begin(); i != Extension_Items.end(); ++i)
{
list.push_back(i->first);
}
}
};
+1048 -218
View File
File diff suppressed because it is too large Load Diff
-474
View File
@@ -1,474 +0,0 @@
/*
* Copyright (C) 2002-2010 InspIRCd Development Team
* Copyright (C) 2009-2010 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
* These classes have been copied from InspIRCd and modified
* for use in Anope.
*
* $Id$
*
*/
#ifndef _HASHCOMP_H_
#define _HASHCOMP_H_
#include <string>
/*******************************************************
* This file contains classes and templates that deal
* with the comparison and hashing of 'irc strings'.
* An 'irc string' is a string which compares in a
* case insensitive manner, and as per RFC 1459 will
* treat [ identical to {, ] identical to }, and \
* as identical to |.
*
* Our hashing functions are designed to accept
* std::string and compare/hash them as type irc::string
* by converting them internally. This makes them
* backwards compatible with other code which is not
* aware of irc::string.
*******************************************************/
#ifndef LOWERMAP
#define LOWERMAP
/** A mapping of uppercase to lowercase, including scandinavian
* 'oddities' as specified by RFC1459, e.g. { -> [, and | -> \
*/
unsigned const char rfc_case_insensitive_map[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */
60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 94, 95, 96, 97, 98, 99, /* 80-99 */
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */
120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */
140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */
180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */
200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */
220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */
};
/** Case insensitive map, ASCII rules.
* That is;
* [ != {, but A == a.
*/
unsigned const char ascii_case_insensitive_map[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */
60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, /* 80-99 */
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */
120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */
140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */
180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */
200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */
220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */
};
#endif
/** The irc namespace contains a number of helper classes.
*/
namespace irc
{
/** The irc_char_traits class is used for RFC-style comparison of strings.
* This class is used to implement irc::string, a case-insensitive, RFC-
* comparing string class.
*/
struct irc_char_traits : std::char_traits<char>
{
/** Check if two chars match.
* @param c1st First character
* @param c2nd Second character
* @return true if the characters are equal
*/
static bool eq(char c1st, char c2nd);
/** Check if two chars do NOT match.
* @param c1st First character
* @param c2nd Second character
* @return true if the characters are unequal
*/
static bool ne(char c1st, char c2nd);
/** Check if one char is less than another.
* @param c1st First character
* @param c2nd Second character
* @return true if c1st is less than c2nd
*/
static bool lt(char c1st, char c2nd);
/** Compare two strings of size n.
* @param str1 First string
* @param str2 Second string
* @param n Length to compare to
* @return similar to strcmp, zero for equal, less than zero for str1
* being less and greater than zero for str1 being greater than str2.
*/
static int compare(const char *str1, const char *str2, size_t n);
/** Find a char within a string up to position n.
* @param s1 String to find in
* @param n Position to search up to
* @param c Character to search for
* @return Pointer to the first occurance of c in s1
*/
static const char *find(const char *s1, int n, char c);
};
/** This typedef declares irc::string based upon irc_char_traits.
*/
typedef std::basic_string<char, irc_char_traits, std::allocator<char> > string;
}
/** The ci namespace contains a number of helper classes.
*/
namespace ci
{
/** The ci_char_traits class is used for ASCII-style comparison of strings.
* This class is used to implement ci::string, a case-insensitive, ASCII-
* comparing string class.
*/
struct CoreExport ci_char_traits : std::char_traits<char>
{
/** Check if two chars match.
* @param c1st First character
* @param c2nd Second character
* @return true if the characters are equal
*/
static bool eq(char c1st, char c2nd);
/** Check if two chars do NOT match.
* @param c1st First character
* @param c2nd Second character
* @return true if the characters are unequal
*/
static bool ne(char c1st, char c2nd);
/** Check if one char is less than another.
* @param c1st First character
* @param c2nd Second character
* @return true if c1st is less than c2nd
*/
static bool lt(char c1st, char c2nd);
/** Compare two strings of size n.
* @param str1 First string
* @param str2 Second string
* @param n Length to compare to
* @return similar to strcmp, zero for equal, less than zero for str1
* being less and greater than zero for str1 being greater than str2.
*/
static int compare(const char *str1, const char *str2, size_t n);
/** Find a char within a string up to position n.
* @param s1 String to find in
* @param n Position to search up to
* @param c Character to search for
* @return Pointer to the first occurance of c in s1
*/
static const char *find(const char *s1, int n, char c);
};
/** This typedef declares ci::string based upon ci_char_traits.
*/
typedef std::basic_string<char, ci_char_traits, std::allocator<char> > string;
}
/* Define operators for using >> and << with irc::string to an ostream on an istream. */
/* This was endless fun. No. Really. */
/* It was also the first core change Ommeh made, if anyone cares */
/** Operator << for irc::string
*/
inline std::ostream &operator<<(std::ostream &os, const irc::string &str) { return os << std::string(str.c_str()); }
/** Operator >> for irc::string
*/
inline std::istream &operator>>(std::istream &is, irc::string &str)
{
std::string tmp;
is >> tmp;
str = tmp.c_str();
return is;
}
/** Operator << for ci::string
*/
inline std::ostream &operator<<(std::ostream &os, const ci::string &str) { return os << std::string(str.c_str()); }
/** Operator >> for ci::string
*/
inline std::istream &operator>>(std::istream &is, ci::string &str)
{
std::string tmp;
is >> tmp;
str = tmp.c_str();
return is;
}
/* Define operators for + and == with irc::string to std::string for easy assignment
* and comparison
*
* Operator +
*/
inline std::string operator+(std::string &leftval, irc::string &rightval)
{
return leftval + std::string(rightval.c_str());
}
/* Define operators for + and == with irc::string to std::string for easy assignment
* and comparison
*
* Operator +
*/
inline irc::string operator+(irc::string &leftval, std::string &rightval)
{
return leftval + irc::string(rightval.c_str());
}
/* Define operators for + and == with ci::string to std::string for easy assignment
* and comparison
*
* Operator +
*/
inline std::string operator+(std::string &leftval, ci::string &rightval)
{
return leftval + std::string(rightval.c_str());
}
/* Define operators for + and == with ci::string to std::string for easy assignment
* and comparison
*
* Operator +
*/
inline ci::string operator+(ci::string &leftval, std::string &rightval)
{
return leftval + ci::string(rightval.c_str());
}
/* Define operators for + and == with irc::string to ci::string for easy assignment
* and comparison
*
* Operator +
*/
inline irc::string operator+(irc::string &leftval, ci::string &rightval)
{
return leftval + irc::string(rightval.c_str());
}
/* Define operators for + and == with irc::string to ci::string for easy assignment
* and comparison
*
* Operator +
*/
inline ci::string operator+(ci::string &leftval, irc::string &rightval)
{
return leftval + ci::string(rightval.c_str());
}
/* Define operators for + and == with irc::string to std::string for easy assignment
* and comparison
*
* Operator ==
*/
inline bool operator==(const std::string &leftval, const irc::string &rightval)
{
return leftval.c_str() == rightval;
}
/* Define operators for + and == with irc::string to std::string for easy assignment
* and comparison
*
* Operator ==
*/
inline bool operator==(const irc::string &leftval, const std::string &rightval)
{
return leftval == rightval.c_str();
}
/* Define operators for + and == with ci::string to std::string for easy assignment
* and comparison
*
* Operator ==
*/
inline bool operator==(const std::string &leftval, const ci::string &rightval)
{
return leftval.c_str() == rightval;
}
/* Define operators for + and == with ci::string to std::string for easy assignment
* and comparison
*
* Operator ==
*/
inline bool operator==(const ci::string &leftval, const std::string &rightval)
{
return leftval == rightval.c_str();
}
/* Define operators for + and == with irc::string to ci::string for easy assignment
* and comparison
*
* Operator ==
*/
inline bool operator==(const ci::string &leftval, const irc::string &rightval)
{
return leftval.c_str() == rightval;
}
/* Define operators for + and == with irc::string to ci::string for easy assignment
* and comparison
*
* Operator ==
*/
inline bool operator==(const irc::string &leftval, const ci::string &rightval)
{
return leftval == rightval.c_str();
}
/* Define operators != for irc::string to std::string for easy comparison
*/
inline bool operator!=(const irc::string &leftval, const std::string &rightval)
{
return !(leftval == rightval.c_str());
}
/* Define operators != for std::string to irc::string for easy comparison
*/
inline bool operator!=(const std::string &leftval, const irc::string &rightval)
{
return !(leftval.c_str() == rightval);
}
/* Define operators != for ci::string to std::string for easy comparison
*/
inline bool operator!=(const ci::string &leftval, const std::string &rightval)
{
return !(leftval == rightval.c_str());
}
/* Define operators != for ci::string to irc::string for easy comparison
*/
inline bool operator!=(const std::string &leftval, const ci::string &rightval)
{
return !(leftval.c_str() == rightval);
}
/* Define operators != for irc::string to ci::string for easy comparison
*/
inline bool operator!=(const irc::string &leftval, const ci::string &rightval)
{
return !(leftval == rightval.c_str());
}
/* Define operators != for irc::string to ci::string for easy comparison
*/
inline bool operator!=(const ci::string &leftval, const irc::string &rightval)
{
return !(leftval.c_str() == rightval);
}
/** Assign an irc::string to a std::string.
*/
//inline std::string assign(const irc::string &other) { return other.c_str(); }
/** Assign a std::string to an irc::string.
*/
//inline irc::string assign(const std::string &other) { return other.c_str(); }
/** Assign an ci::string to a std::string.
*/
//inline std::string assign(const ci::string &other) { return other.c_str(); }
/** Assign a std::string to an ci::string.
*/
//inline ci::string assign(const std::string &other) { return other.c_str(); }
/** Assign an irc::string to a ci::string.
*/
//inline ci::string assign(const irc::string &other) { return other.c_str(); }
/** Assign a ci::string to an irc::string.
*/
//inline irc::string assign(const ci::string &other) { return other.c_str(); }
/** sepstream allows for splitting token seperated lists.
* Each successive call to sepstream::GetToken() returns
* the next token, until none remain, at which point the method returns
* an empty string.
*/
class CoreExport sepstream
{
private:
/** Original string.
*/
std::string tokens;
/** Last position of a seperator token
*/
std::string::iterator last_starting_position;
/** Current string position
*/
std::string::iterator n;
/** Seperator value
*/
char sep;
public:
/** Create a sepstream and fill it with the provided data
*/
sepstream(const std::string &source, char seperator);
sepstream(const ci::string &source, char seperator);
sepstream(const char *source, char seperator);
virtual ~sepstream() { }
/** Fetch the next token from the stream
* @param token The next token from the stream is placed here
* @return True if tokens still remain, false if there are none left
*/
virtual bool GetToken(std::string &token);
virtual bool GetToken(ci::string &token);
/** Fetch the entire remaining stream, without tokenizing
* @return The remaining part of the stream
*/
virtual const std::string GetRemaining();
/** Returns true if the end of the stream has been reached
* @return True if the end of the stream has been reached, otherwise false
*/
virtual bool StreamEnd();
};
/** A derived form of sepstream, which seperates on commas
*/
class commasepstream : public sepstream
{
public:
/** Initialize with comma seperator
*/
commasepstream(const std::string &source) : sepstream(source, ',') { }
commasepstream(const ci::string &source) : sepstream(source, ',') { }
commasepstream(const char *source) : sepstream(source, ',') { }
};
/** A derived form of sepstream, which seperates on spaces
*/
class spacesepstream : public sepstream
{
public:
/** Initialize with space seperator
*/
spacesepstream(const std::string &source) : sepstream(source, ' ') { }
spacesepstream(const ci::string &source) : sepstream(source, ' ') { }
spacesepstream(const char *source) : sepstream(source, ' ') { }
};
#endif
+25
View File
@@ -0,0 +1,25 @@
# Make file for Win32
#
# (C) 2003-2010 Anope Team
# Contact us at team@anope.org
#
# Please read COPYING and README for further details.
#
# Based on the original code of Epona by Lara.
# Based on the original code of Services by Andy Church.
#
# $Id$
#
###########################################################################
clean:
-@erase language.h
spotless: clean
-@erase sysconf.h version.h
distclean: spotless
FRC:
+1 -1
View File
@@ -16,7 +16,7 @@
#include "modules.h"
extern Message messages[];
extern void moduleAddMsgs();
extern void moduleAddMsgs(void);
extern Message *find_message(const char *name);
-531
View File
@@ -1,531 +0,0 @@
/* Mode support
*
* Copyright (C) 2008-2010 Adam <Adam@anope.org>
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*
* $Id$
*
*/
/** All of the valid user mode names
*/
enum UserModeName
{
UMODE_BEGIN,
UMODE_SERV_ADMIN, UMODE_BOT, UMODE_CO_ADMIN, UMODE_FILTER, UMODE_HIDEOPER, UMODE_NETADMIN,
UMODE_REGPRIV, UMODE_PROTECTED, UMODE_NO_CTCP, UMODE_WEBTV, UMODE_WHOIS, UMODE_ADMIN, UMODE_DEAF,
UMODE_GLOBOPS, UMODE_HELPOP, UMODE_INVIS, UMODE_OPER, UMODE_PRIV, UMODE_GOD, UMODE_REGISTERED,
UMODE_SNOMASK, UMODE_VHOST, UMODE_WALLOPS, UMODE_CLOAK, UMODE_SSL, UMODE_CALLERID, UMODE_COMMONCHANS,
UMODE_HIDDEN, UMODE_STRIPCOLOR,
UMODE_END
};
/** All of the valid channel mode names
*/
enum ChannelModeName
{
CMODE_BEGIN,
/* Channel modes */
CMODE_BLOCKCOLOR, CMODE_FLOOD, CMODE_INVITE, CMODE_KEY, CMODE_LIMIT, CMODE_MODERATED, CMODE_NOEXTERNAL,
CMODE_PRIVATE, CMODE_REGISTERED, CMODE_SECRET, CMODE_TOPIC, CMODE_AUDITORIUM, CMODE_SSL, CMODE_ADMINONLY,
CMODE_NOCTCP, CMODE_FILTER, CMODE_NOKNOCK, CMODE_REDIRECT, CMODE_REGMODERATED, CMODE_NONICK, CMODE_OPERONLY,
CMODE_NOKICK, CMODE_REGISTEREDONLY, CMODE_STRIPCOLOR, CMODE_NONOTICE, CMODE_NOINVITE, CMODE_ALLINVITE,
CMODE_BLOCKCAPS, CMODE_PERM, CMODE_NICKFLOOD, CMODE_JOINFLOOD, CMODE_DELAYEDJOIN, CMODE_NOREJOIN,
/* b/e/I */
CMODE_BAN, CMODE_EXCEPT,
CMODE_INVITEOVERRIDE,
/* v/h/o/a/q */
CMODE_VOICE, CMODE_HALFOP, CMODE_OP,
CMODE_PROTECT, CMODE_OWNER,
CMODE_END
};
/** The different types of modes
*/
enum ModeType
{
/* Regular mode */
MODE_REGULAR,
/* b/e/I */
MODE_LIST,
/* k/l etc */
MODE_PARAM,
/* v/h/o/a/q */
MODE_STATUS
};
/* Classes of modes, Channel modes and User modes
*/
enum ModeClass
{
/* Channel mode */
MC_CHANNEL,
/* User mode */
MC_USER
};
/** This class is the basis of all modes in Anope
*/
class CoreExport Mode
{
public:
/* Class of mode this is */
ModeClass Class;
/* Mode char for this */
char ModeChar;
/* Type of mode this is */
ModeType Type;
/** Default constructor
* @param mClass The type of mode this is
* @param modeChar The mode char
* @param type The mode type
*/
Mode(ModeClass mClass, char modeChar, ModeType type);
/** Default destructor
*/
virtual ~Mode();
};
/** This class is a user mode, all user modes use this/inherit from this
*/
class CoreExport UserMode : public Mode
{
public:
/* Mode name */
UserModeName Name;
/** Default constructor
* @param nName The mode name
* @param modeChar The mode char
*/
UserMode(UserModeName mName, char modeChar);
/** Default destructor
*/
virtual ~UserMode();
};
class UserModeParam : public UserMode
{
public:
/** Default constructor
* @param mName The mode name
* @param modeChar The mode char
*/
UserModeParam(UserModeName mName, char modeChar);
/** Check if the param is valid
* @param value The param
* @return true or false
*/
virtual bool IsValid(const std::string &value) { return true; }
};
/** This class is a channel mode, all channel modes use this/inherit from this
*/
class CoreExport ChannelMode : public Mode
{
public:
/* Mode name */
ChannelModeName Name;
/** Default constructor
* @param mName The mode name
* @param modeChar The mode char
*/
ChannelMode(ChannelModeName mName, char modeChar);
/** Default destructor
*/
virtual ~ChannelMode();
/** Can a user set this mode, used for mlock
* NOTE: User CAN be NULL, this is for checking if it can be locked with defcon
* @param u The user, or NULL
*/
virtual bool CanSet(User *u) { return true; }
};
/** This is a mode for lists, eg b/e/I. These modes should inherit from this
*/
class CoreExport ChannelModeList : public ChannelMode
{
public:
/** Default constructor
* @param mName The mode name
* @param modeChar The mode char
*/
ChannelModeList(ChannelModeName mName, char modeChar);
/** Default destructor
*/
virtual ~ChannelModeList();
/** Is the mask valid
* @param mask The mask
* @return true for yes, false for no
*/
virtual bool IsValid(const std::string &mask) { return true; }
/** Add the mask to the channel, this should be overridden
* @param chan The channel
* @param mask The mask
*/
virtual void AddMask(Channel *chan, const char *mask) { }
/** Delete the mask from the channel, this should be overridden
* @param chan The channel
* @param mask The mask
*/
virtual void DelMask(Channel *chan, const char *mask) { }
};
/** This is a mode with a paramater, eg +k/l. These modes should use/inherit from this
*/
class CoreExport ChannelModeParam : public ChannelMode
{
public:
/** Default constructor
* @param mName The mode name
* @param modeChar The mode char
* @param MinusArg true if this mode sends no arg when unsetting
*/
ChannelModeParam(ChannelModeName mName, char modeChar, bool MinusArg = false);
/** Default destructor
*/
virtual ~ChannelModeParam();
/* Should we send an arg when unsetting this mode? */
bool MinusNoArg;
/** Is the param valid
* @param value The param
* @return true for yes, false for no
*/
virtual bool IsValid(const std::string &value) { return true; }
};
/** This is a mode that is a channel status, eg +v/h/o/a/q.
*/
class CoreExport ChannelModeStatus : public ChannelMode
{
public:
/* The symbol, eg @ % + */
char Symbol;
/** Default constructor
* @param mName The mode name
* @param modeChar The mode char
* @param mSymbol The symbol for the mode, eg @ % +
*/
ChannelModeStatus(ChannelModeName mName, char modeChar, char mSymbol);
/** Default destructor
*/
virtual ~ChannelModeStatus();
};
/** Channel mode +b
*/
class CoreExport ChannelModeBan : public ChannelModeList
{
public:
ChannelModeBan(char modeChar) : ChannelModeList(CMODE_BAN, modeChar) { }
void AddMask(Channel *chan, const char *mask);
void DelMask(Channel *chan, const char *mask);
};
/** Channel mode +e
*/
class CoreExport ChannelModeExcept : public ChannelModeList
{
public:
ChannelModeExcept(char modeChar) : ChannelModeList(CMODE_EXCEPT, modeChar) { }
void AddMask(Channel *chan, const char *mask);
void DelMask(Channel *chan, const char *mask);
};
/** Channel mode +I
*/
class CoreExport ChannelModeInvite : public ChannelModeList
{
public:
ChannelModeInvite(char modeChar) : ChannelModeList(CMODE_INVITEOVERRIDE, modeChar) { }
void AddMask(Channel *chan, const char *mask);
void DelMask(Channel *chan, const char *mask);
};
/** Channel mode +k (key)
*/
class CoreExport ChannelModeKey : public ChannelModeParam
{
public:
ChannelModeKey(char modeChar) : ChannelModeParam(CMODE_KEY, modeChar) { }
bool IsValid(const std::string &value);
};
/** Channel mode +f (flood)
*/
class ChannelModeFlood : public ChannelModeParam
{
public:
ChannelModeFlood(char modeChar, bool minusNoArg = false) : ChannelModeParam(CMODE_FLOOD, modeChar, minusNoArg) { }
bool IsValid(const std::string &value);
};
/** This class is used for channel mode +A (Admin only)
* Only opers can mlock it
*/
class CoreExport ChannelModeAdmin : public ChannelMode
{
public:
ChannelModeAdmin(char modeChar) : ChannelMode(CMODE_ADMINONLY, modeChar) { }
/* Opers only */
bool CanSet(User *u);
};
/** This class is used for channel mode +O (Opers only)
* Only opers can mlock it
*/
class CoreExport ChannelModeOper : public ChannelMode
{
public:
ChannelModeOper(char modeChar) : ChannelMode(CMODE_OPERONLY, modeChar) { }
/* Opers only */
bool CanSet(User *u);
};
/** This class is used for channel mode +r (registered channel)
* No one may mlock r
*/
class CoreExport ChannelModeRegistered : public ChannelMode
{
public:
ChannelModeRegistered(char modeChar) : ChannelMode(CMODE_REGISTERED, modeChar) { }
/* No one mlocks +r */
bool CanSet(User *u);
};
enum StackerType
{
ST_CHANNEL,
ST_USER
};
class StackerInfo
{
public:
/* Modes to be added */
std::list<std::pair<void *, std::string> > AddModes;
/* Modes to be deleted */
std::list<std::pair<void *, std::string> > DelModes;
/* The type of object this stacker info is for */
StackerType Type;
/* Bot this is sent from */
BotInfo *bi;
/** Add a mode to this object
* @param Mode The mode
* @param Set true if setting, false if unsetting
* @param Param The param for the mode
*/
void AddMode(void *Mode, bool Set, const std::string &Param);
};
/** This is mode manager
* It contains functions for adding modes to Anope so Anope can track them
* and do things such as MLOCK.
* This also contains a mode stacker that will combine multiple modes and set
* them on a channel all at once
*/
class CoreExport ModeManager
{
protected:
/* List of pairs of user/channels and their stacker info */
static std::list<std::pair<void *, StackerInfo *> > StackerObjects;
/** Get the stacker info for an item, if one doesnt exist it is created
* @param Item The user/channel etc
* @return The stacker info
*/
static StackerInfo *GetInfo(void *Item);
/** Build a list of mode strings to send to the IRCd from the mode stacker
* @param info The stacker info for a channel or user
* @return a list of strings
*/
static std::list<std::string> BuildModeStrings(StackerInfo *info);
/** Add a mode to the stacker, internal use only
* @param bi The client to set the modes from
* @param u The user
* @param um The user mode
* @param Set Adding or removing?
* @param Param A param, if there is one
*/
static void StackerAddInternal(BotInfo *bi, User *u, UserMode *um, bool Set, const std::string &Param);
/** Add a mode to the stacker, internal use only
* @param bi The client to set the modes from
* @param c The channel
* @param cm The channel mode
* @param Set Adding or removing?
* @param Param A param, if there is one
*/
static void StackerAddInternal(BotInfo *bi, Channel *c, ChannelMode *cm, bool Set, const std::string &Param);
/** Really add a mode to the stacker, internal use only
* @param bi The client to set the modes from
* @param Object The object, user/channel
* @param Mode The mode
* @param Set Adding or removing?
* @param Param A param, if there is one
* @param Type The type this is, user or channel
*/
static void StackerAddInternal(BotInfo *bi, void *Object, void *Mode, bool Set, const std::string &Param, StackerType Type);
public:
/* User modes */
static std::map<char, UserMode *> UserModesByChar;
static std::map<UserModeName, UserMode *> UserModesByName;
/* Channel modes */
static std::map<char, ChannelMode *> ChannelModesByChar;
static std::map<ChannelModeName, ChannelMode *> ChannelModesByName;
/* Although there are two different maps for UserModes and ChannelModes
* the pointers in each are the same. This is used to increase
* efficiency.
*/
/* List of all modes Anope knows about */
static std::list<Mode *> Modes;
/** Add a user mode to Anope
* @param um A UserMode or UserMode derived class
* @return true on success, false on error
*/
static bool AddUserMode(UserMode *um);
/** Add a channel mode to Anope
* @param cm A ChannelMode or ChannelMode derived class
* @return true on success, false on error
*/
static bool AddChannelMode(ChannelMode *cm);
/** Find a channel mode
* @param Mode The mode
* @return The mode class
*/
static ChannelMode *FindChannelModeByChar(char Mode);
/** Find a user mode
* @param Mode The mode
* @return The mode class
*/
static UserMode *FindUserModeByChar(char Mode);
/** Find a channel mode
* @param Mode The modename
* @return The mode class
*/
static ChannelMode *FindChannelModeByName(ChannelModeName Name);
/** Find a user mode
* @param Mode The modename
* @return The mode class
*/
static UserMode *FindUserModeByName(UserModeName Name);
/** Gets the channel mode char for a symbol (eg + returns v)
* @param Value The symbol
* @return The char
*/
static char GetStatusChar(char Value);
/** Add a mode to the stacker to be set on a channel
* @param bi The client to set the modes from
* @param c The channel
* @param cm The channel mode
* @param Set true for setting, false for removing
* @param Param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool Set, const std::string &Param = "");
/** Add a mode to the stacker to be set on a channel
* @param bi The client to set the modes from
* @param c The channel
* @param Name The channel mode name
* @param Set true for setting, false for removing
* @param Param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, Channel *c, ChannelModeName Name, bool Set, const std::string &Param = "");
/** Add a mode to the stacker to be set on a channel
* @param bi The client to set the modes from
* @param c The channel
* @param Mode The mode char
* @param Set true for setting, false for removing
* @param Param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, Channel *c, const char Mode, bool Set, const std::string &Param = "");
/** Add a mode to the stacker to be set on a user
* @param bi The client to set the modes from
* @param u The user
* @param um The user mode
* @param Set true for setting, false for removing
* @param param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool Set, const std::string &Param = "");
/** Add a mode to the stacker to be set on a user
* @param bi The client to set the modes from
* @param u The user
* @param Name The user mode name
* @param Set true for setting, false for removing
* @param Param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, User *u, UserModeName Name, bool Set, const std::string &Param = "");
/** Add a mode to the stacker to be set on a user
* @param bi The client to set the modes from
* @param u The user
* @param Mode The mode to be set
* @param Set true for setting, false for removing
* @param Param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, User *u, const char Mode, bool Set, const std::string &Param = "");
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
*/
static void ProcessModes();
};
+5
View File
@@ -5,7 +5,12 @@
#include "commands.h"
#include "language.h"
#include "modules.h"
#include "depricated.h"
#include "version.h"
#define MOD_UNIQUE 0
#define MOD_HEAD 1
#define MOD_TAIL 2
#endif
+263 -1255
View File
File diff suppressed because it is too large Load Diff
-66
View File
@@ -1,66 +0,0 @@
/*
* Copyright (C) 2008-2010 Robin Burchell <w00t@inspircd.org>
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*
* $Id$
*
*/
#include "hashcomp.h"
class CoreExport OperType
{
private:
/** The name of this opertype, e.g. "sra".
*/
ci::string name;
/** Privs that this opertype may use, e.g. 'users/auspex'.
* This *must* be std::list, see commands comment for details.
*/
std::list<std::string> privs;
/** Commands this user may execute, e.g:
* botserv/set/ *, botserv/set/private, botserv/ *
* et cetera.
*
* This *must* be std::list, not std::map, because
* we support full globbing here. This shouldn't be a problem
* as we don't invoke it often.
*/
std::list<std::string> commands;
public:
/** Create a new opertype of the given name.
* @param nname The opertype name, e.g. "sra".
*/
OperType(const ci::string &nname);
/** Check whether this opertype has access to run the given command string.
* @param cmdstr The string to check, e.g. botserv/set/private.
* @return True if this opertype may run the specified command, false otherwise.
*/
bool HasCommand(const std::string &cmdstr) const;
/** Check whether this opertype has access to the given special permission.
* @param privstr The priv to check for, e.g. users/auspex.
* @return True if this opertype has the specified priv, false otherwise.
*/
bool HasPriv(const std::string &privstr) const;
/** Add the specified command to this opertype.
* @param cmdstr The command mask to grant this opertype access to, e.g: nickserv/ *, chanserv/set/ *, botserv/set/private.
*/
void AddCommand(const std::string &cmdstr);
/** Add the specified priv mask to this opertype.
* @param privstr The specified mask of privs to grant this opertype access to, e.g. users/auspex, users/ *, etc.
*/
void AddPriv(const std::string &privstr);
/** Returns the name of this opertype.
*/
const ci::string &GetName() const;
};
+3 -1
View File
@@ -14,5 +14,7 @@
#include "commands.h"
#include "language.h"
#include "timers.h"
#include "timeout.h"
#include "encrypt.h"
#include "datafiles.h"
#include "slist.h"
-300
View File
@@ -1,300 +0,0 @@
/* Modular support
*
* (C) 2008-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* $Id$
*
*/
/** Flags used for the ChannelInfo class
*/
enum ChannelInfoFlag
{
CI_BEGIN,
/* ChanServ is currently holding the channel */
CI_INHABIT,
/* Retain the topic even after the channel is emptied */
CI_KEEPTOPIC,
/* Don't allow non-authorized users to be opped */
CI_SECUREOPS,
/* Hide channel from ChanServ LIST command */
CI_PRIVATE,
/* Topic can only be changed by SET TOPIC */
CI_TOPICLOCK,
/* Only users on the access list may join */
CI_RESTRICTED,
/* Don't allow ChanServ and BotServ commands to do bad things to users with higher access levels */
CI_PEACE,
/* Don't allow any privileges unless a user is IDENTIFIED with NickServ */
CI_SECURE,
/* Don't allow the channel to be registered or used */
CI_FORBIDDEN,
/* Channel does not expire */
CI_NO_EXPIRE,
/* Channel memo limit may not be changed */
CI_MEMO_HARDMAX,
/* Send notice to channel on use of OP/DEOP */
CI_OPNOTICE,
/* Stricter control of channel founder status */
CI_SECUREFOUNDER,
/* Sign kicks with the user who did the kick */
CI_SIGNKICK,
/* Sign kicks if level is < than the one defined by the SIGNKIGK level */
CI_SIGNKICK_LEVEL,
/* Uses XOP */
CI_XOP,
/* Channel is suspended */
CI_SUSPENDED,
/* Channel still exists when emptied, this can be caused by setting a perm
* channel mode (+P on InspIRCd) or /cs set #chan persist on.
* This keeps the service bot in the channel regardless if a +P type mode
* is set or not
*/
CI_PERSIST,
CI_END
};
class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag>
{
private:
std::map<ChannelModeName, std::string> Params; /* Map of parameters by mode name for mlock */
std::vector<ChanAccess *> access; /* List of authorized users */
std::vector<AutoKick *> akick; /* List of users to kickban */
std::vector<BadWord *> badwords; /* List of badwords */
std::bitset<128> mlock_on; /* Modes mlocked on */
std::bitset<128> mlock_off; /* Modes mlocked off */
public:
/** Default constructor
* @param chname The channel name
*/
ChannelInfo(const std::string &chname);
/** Default destructor
*/
~ChannelInfo();
ChannelInfo *next, *prev;
std::string name; /* Channel name */
NickCore *founder;
NickCore *successor; /* Who gets the channel if the founder
* nick is dropped or expires */
char *desc;
char *url;
char *email;
time_t time_registered;
time_t last_used;
char *last_topic; /* Last topic on the channel */
std::string last_topic_setter; /* Who set the last topic */
time_t last_topic_time; /* When the last topic was set */
char *forbidby;
char *forbidreason;
int16 bantype;
int16 *levels; /* Access levels for commands */
char *entry_message; /* Notice sent on entering channel */
MemoInfo memos;
Channel *c; /* Pointer to channel record (if *
* channel is currently in use) */
/* For BotServ */
BotInfo *bi; /* Bot used on this channel */
Flags<BotServFlag> botflags;
int16 *ttb; /* Times to ban for each kicker */
int16 capsmin, capspercent; /* For CAPS kicker */
int16 floodlines, floodsecs; /* For FLOOD kicker */
int16 repeattimes; /* For REPEAT kicker */
/** Add an entry to the channel access list
*
* @param nc The NickCore of the user that the access entry should be tied to
* @param level The channel access level the user has on the channel
* @param creator The user who added the access
* @param last_seen When the user was last seen within the channel
*
* Creates a new access list entry and inserts it into the access list.
*/
void AddAccess(NickCore *nc, int16 level, const std::string &creator, int32 last_seen = 0);
/** Get an entry from the channel access list by index
*
* @param index The index in the access list vector
* @return A ChanAccess struct corresponding to the index given, or NULL if outside the bounds
*
* Retrieves an entry from the access list that matches the given index.
*/
ChanAccess *GetAccess(unsigned index);
/** Get an entry from the channel access list by NickCore
*
* @param nc The NickCore to find within the access list vector
* @param level Optional channel access level to compare the access entries to
* @return A ChanAccess struct corresponding to the NickCore, or NULL if not found
*
* Retrieves an entry from the access list that matches the given NickCore, optionally also matching a certain level.
*/
ChanAccess *GetAccess(NickCore *nc, int16 level = 0);
/** Get the size of the accss vector for this channel
* @return The access vector size
*/
const unsigned GetAccessCount() const;
/** Erase an entry from the channel access list
*
* @param index The index in the access list vector
*
* Clears the memory used by the given access entry and removes it from the vector.
*/
void EraseAccess(unsigned index);
/** Cleans the channel access list
*
* Cleans up the access list so it no longer contains entries no longer in use.
*/
void CleanAccess();
/** Clear the entire channel access list
*
* Clears the entire access list by deleting every item and then clearing the vector.
*/
void ClearAccess();
/** Add an akick entry to the channel by NickCore
* @param user The user who added the akick
* @param akicknc The nickcore being akicked
* @param reason The reason for the akick
* @param t The time the akick was added, defaults to now
* @param lu The time the akick was last used, defaults to never
*/
AutoKick *AddAkick(const std::string &user, NickCore *akicknc, const std::string &reason, time_t t = time(NULL), time_t lu = 0);
/** Add an akick entry to the channel by reason
* @param user The user who added the akick
* @param mask The mask of the akick
* @param reason The reason for the akick
* @param t The time the akick was added, defaults to now
* @param lu The time the akick was last used, defaults to never
*/
AutoKick *AddAkick(const std::string &user, const std::string &mask, const std::string &reason, time_t t = time(NULL), time_t lu = 0);
/** Get an entry from the channel akick list
* @param index The index in the akick vector
* @return The akick structure, or NULL if not found
*/
AutoKick *GetAkick(unsigned index);
/** Get the size of the akick vector for this channel
* @return The akick vector size
*/
const unsigned GetAkickCount() const;
/** Erase an entry from the channel akick list
* @param akick The akick
*/
void EraseAkick(AutoKick *akick);
/** Clear the whole akick list
*/
void ClearAkick();
/** Clean all of the nonused entries from the akick list
*/
void CleanAkick();
/** Add a badword to the badword list
* @param word The badword
* @param type The type (SINGLE START END)
* @return The badword
*/
BadWord *AddBadWord(const std::string &word, BadWordType type);
/** Get a badword structure by index
* @param index The index
* @return The badword
*/
BadWord *GetBadWord(unsigned index);
/** Get how many badwords are on this channel
* @return The number of badwords in the vector
*/
const unsigned GetBadWordCount() const;
/** Remove a badword
* @param badword The badword
*/
void EraseBadWord(BadWord *badword);
/** Clear all badwords from the channel
*/
void ClearBadWords();
/** Clean all of the nonused entries from the badwords list
*/
void CleanBadWords();
/** Check if a mode is mlocked
* @param Name The mode
* @param status True to check mlock on, false for mlock off
* @return true on success, false on fail
*/
const bool HasMLock(ChannelModeName Name, bool status);
/** Set a mlock
* @param Name The mode
* @param status True for mlock on, false for mlock off
* @param param An optional param arg for + mlocked modes
* @return true on success, false on failure (module blocking)
*/
bool SetMLock(ChannelModeName Name, bool status, const std::string param = "");
/** Remove a mlock
* @param Name The mode
* @return true on success, false on failure (module blcoking)
*/
bool RemoveMLock(ChannelModeName Name);
/** Clear all mlocks on the channel
*/
void ClearMLock();
/** Get the number of mlocked modes for this channel
* @param status true for mlock on, false for mlock off
* @return The number of mlocked modes
*/
const size_t GetMLockCount(bool status) const;
/** Get a param from the channel
* @param Name The mode
* @param Target a string to put the param into
* @return true on success
*/
const bool GetParam(ChannelModeName Name, std::string &Target);
/** Check if a mode is set and has a param
* @param Name The mode
*/
const bool HasParam(ChannelModeName Name);
/** Clear all the params from the channel
*/
void ClearParams();
/** Check whether a user is permitted to be on this channel
* @param u The user
* @return true if they are allowed, false if they aren't and were kicked
*/
bool CheckKick(User *user);
};
+8 -8
View File
@@ -2,19 +2,19 @@
// Microsoft Developer Studio generated include file.
// Used by Win32GUI.rc
//
#define VER_ANOPE 1
#define MANIFEST_RESOURCE_ID 2
#define ICON_APP 129
#define VER_ANOPE 1
#define MANIFEST_RESOURCE_ID 2
#define ICON_APP 129
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 152
#define _APS_NEXT_COMMAND_VALUE 40061
#define _APS_NEXT_CONTROL_VALUE 1167
#define _APS_NEXT_SYMED_VALUE 104
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 152
#define _APS_NEXT_COMMAND_VALUE 40061
#define _APS_NEXT_CONTROL_VALUE 1167
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif
+1052 -879
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -32,7 +32,7 @@ struct slistopts_ {
int32 flags; /* Flags for the list. See below. */
int (*compareitem) (SList *slist, void *item1, void *item2); /* Called to compare two items */
int (*isequal) (SList *slist, void *item1, void *item2); /* Called by slist_indexof. item1 can be an arbitrary pointer. */
int (*isequal) (SList *slist, void *item1, void *item2); /* Called by slist_indexof. item1 can be an arbitrary pointer. */
void (*freeitem) (SList *slist, void *item); /* Called when an item is removed */
};
+26 -164
View File
@@ -15,171 +15,33 @@
#define SOCKETS_H
#ifdef _WIN32
#define CloseSocket closesocket
typedef SOCKET ano_socket_t;
#define ano_sockread(fd, buf, len) recv(fd, buf, len, 0)
#define ano_sockwrite(fd, buf, len) send(fd, buf, len, 0)
#define ano_sockclose(fd) closesocket(fd)
#define ano_sockgeterr() WSAGetLastError()
#define ano_sockseterr(err) WSASetLastError(err)
/* ano_sockstrerror in sockutil.c */
/* ano_socksetnonb in sockutil.c */
#define ano_sockerrnonb(err) (err == WSAEINPROGRESS || err == WSAEWOULDBLOCK)
#define SOCKERR_EBADF WSAENOTSOCK
#define SOCKERR_EINTR WSAEINTR
#define SOCKERR_EINVAL WSAEINVAL
#define SOCKERR_EINPROGRESS WSAEINPROGRESS
#else
#define CloseSocket close
typedef int ano_socket_t;
#define ano_sockread(fd, buf, len) read(fd, buf, len)
#define ano_sockwrite(fd, buf, len) write(fd, buf, len)
#define ano_sockclose(fd) close(fd)
#define ano_sockgeterr() errno
#define ano_sockseterr(err) errno = err
#define ano_sockstrerror(err) strerror(err)
#define ano_socksetnonb(fd) fcntl(fd, F_SETFL, O_NONBLOCK)
#define ano_sockerrnonb(err) (err == EINPROGRESS)
#define SOCKERR_EBADF EBADF
#define SOCKERR_EINTR EINTR
#define SOCKERR_EINVAL EINVAL
#define SOCKERR_EINPROGRESS EINPROGRESS
#endif
class SocketException : public CoreException
{
public:
/** Default constructor for socket exceptions
* @param message Error message
*/
SocketException(const std::string &message) : CoreException(message) { }
/** Default destructor
* @throws Nothing
*/
virtual ~SocketException() throw() { }
};
class CoreExport Socket
{
private:
/** Read from the socket
* @param buf Buffer to read to
* @param sz How much to read
* @return Number of bytes recieved
*/
virtual int RecvInternal(char *buf, size_t sz) const;
/** Write to the socket
* @param buf What to write
* @return Number of bytes sent, -1 on error
*/
virtual int SendInternal(const std::string &buf) const;
protected:
/* Socket FD */
int Sock;
/* Host this socket is connected to */
std::string TargetHost;
/* Port we're connected to */
int Port;
/* IP this socket is bound to */
std::string BindHost;
/* Is this an IPv6 socket? */
bool IPv6;
/* Messages to be written to the socket */
std::string WriteBuffer;
/* Part of a message not totally yet recieved */
std::string extrabuf;
/* How much data was recieved from the socket */
size_t RecvLen;
public:
/** Default constructor
* @param nTargetHost Hostname to connect to
* @param nPort Port to connect to
* @param nBindHos Host to bind to when connecting
* @param nIPv6 true to use IPv6
*/
Socket(const std::string &nTargetHost, int nPort, const std::string &nBindHost = "", bool nIPv6 = false);
/** Default destructor
*/
virtual ~Socket();
/** Get the socket FD for this socket
* @return The fd
*/
virtual int GetSock() const;
/** Check if this socket is IPv6
* @return true or false
*/
bool IsIPv6() const;
/** Called when there is something to be read from thie socket
* @return true on success, false to kill this socket
*/
virtual bool ProcessRead();
/** Called when this socket becomes writeable
* @return true on success, false to drop this socket
*/
virtual bool ProcessWrite();
/** Called when there is an error on this socket
*/
virtual void ProcessError();
/** Called with a message recieved from the socket
* @param buf The message
* @return true on success, false to kill this socket
*/
virtual bool Read(const std::string &buf);
/** Write to the socket
* @param message The message to write
*/
void Write(const char *message, ...);
void Write(std::string &message);
/** Get the length of the read buffer
* @return The length of the read buffer
*/
size_t ReadBufferLen() const;
/** Get the length of the write buffer
* @return The length of the write buffer
*/
size_t WriteBufferLen() const;
};
class CoreExport SocketEngine
{
private:
/* List of sockets that need to be deleted */
std::set<Socket *> OldSockets;
/* FDs to read */
fd_set ReadFDs;
/* FDs that want writing */
fd_set WriteFDs;
/* Max FD */
int MaxFD;
/** Unmark a socket as writeable
* @param s The socket
*/
void ClearWriteable(Socket *s);
public:
/* Set of sockets */
std::set<Socket *> Sockets;
/** Constructor
*/
SocketEngine();
/** Destructor
*/
virtual ~SocketEngine();
/** Add a socket to the socket engine
* @param s The socket
*/
void AddSocket(Socket *s);
/** Delete a socket from the socket engine
* @param s The socket
*/
void DelSocket(Socket *s);
/** Mark a socket as wanting to be written to
* @param s The socket
*/
void MarkWriteable(Socket *s);
/** Called to iterate through each socket and check for activity
*/
void Process();
/** Get the last socket error
* @return The error
*/
const std::string GetError() const;
};
#endif
-121
View File
@@ -1,121 +0,0 @@
#ifndef _SYSCONF_H_
#define _SYSCONF_H_
#cmakedefine DEFUMASK @DEFUMASK@
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDDEF_H 1
#cmakedefine HAVE_BACKTRACE 1
#cmakedefine HAVE_GETHOSTBYNAME 1
#cmakedefine HAVE_GETTIMEOFDAY 1
#cmakedefine HAVE_SETGRENT 1
#cmakedefine HAVE_STRCASECMP 1
#cmakedefine HAVE_STRICMP 1
#cmakedefine HAVE_STRINGS_H 1
#cmakedefine HAVE_STRLCAT 1
#cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_SYS_SELECT_H 1
#cmakedefine HAVE_UMASK 1
#cmakedefine RUNGROUP "@RUNGROUP@"
#cmakedefine SERVICES_BIN "@SERVICES_BIN@"
#cmakedefine HAVE_UINT8_T 1
#cmakedefine HAVE_U_INT8_T 1
#cmakedefine HAVE_INT16_T 1
#cmakedefine HAVE_UINT16_T 1
#cmakedefine HAVE_U_INT16_T 1
#cmakedefine HAVE_INT32_T 1
#cmakedefine HAVE_UINT32_T 1
#cmakedefine HAVE_U_INT32_T 1
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#ifdef HAVE_UINT8_T
typedef uint8_t uint8;
#else
# ifdef HAVE_U_INT8_T
typedef u_int8_t uint8;
# else
# ifdef _WIN32
typedef unsigned __int8 uint8;
# else
typedef unsigned short uint8;
# endif
# endif
#endif
#ifdef HAVE_INT16_T
typedef int16_t int16;
#else
# ifdef _WIN32
typedef signed __int16 int16;
# else
typedef int int16;
# endif
#endif
#ifdef HAVE_UINT16_T
typedef uint16_t uint16;
#else
# ifdef HAVE_U_INT16_T
typedef u_int16_t uint16;
# else
# ifdef _WIN32
typedef unsigned __int16 uint16;
# else
typedef unsigned int uint16;
# endif
# endif
#endif
#ifdef HAVE_INT32_T
typedef int32_t int32;
#else
# ifdef _WIN32
typedef signed __int32 int32;
# else
typedef long int32;
# endif
#endif
#ifdef HAVE_UINT32_T
typedef uint32_t uint32;
#else
# ifdef HAVE_U_INT32_T
typedef u_int32_t uint32;
# else
# ifdef _WIN32
typedef unsigned __int32 uint32;
# else
typedef unsigned long uint32;
# endif
# endif
#endif
#ifdef _WIN32
# ifdef MSVCPP
# define snprintf _snprintf
# endif
# define popen _popen
# define pclose _pclose
# define ftruncate _chsize
# ifdef MSVCPP
# define PATH_MAX MAX_PATH
# endif
# define MAXPATHLEN MAX_PATH
# define bzero(buf, size) memset(buf, 0, size)
# ifdef MSVCPP
# define strcasecmp stricmp
# endif
# define sleep(x) Sleep(x * 1000)
#endif
#endif
+202 -96
View File
@@ -1,121 +1,227 @@
#ifndef _SYSCONF_H_
#define _SYSCONF_H_
/* include/sysconf.h.in. Generated from configure.in by autoheader. */
/* "Default umask Permissions" */
#undef DEFUMASK
#undef HAVE_SYS_TYPES_H
#undef HAVE_STDINT_H
#undef HAVE_STDDEF_H
/* "No prefix needed for dlopen" */
#undef DL_PREFIX
/* "Has sys/types.h" */
#undef HAS_SYS_TYPES_H
/* "" */
#undef HAVE_BACKTRACE
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
/* Define to 1 if you have the `gethostbyname_r' function. */
#undef HAVE_GETHOSTBYNAME_R
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `setgrent' function. */
#undef HAVE_SETGRENT
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `stricmp' function. */
#undef HAVE_STRICMP
/* "" */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the `strsignal' function. */
#undef HAVE_STRSIGNAL
/* Define to 1 if you have the `strspn' function. */
#undef HAVE_STRSPN
/* Define to 1 if you have the `sys_errlist' function. */
#undef HAVE_SYS_ERRLIST
/* "" */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `umask' function. */
#undef HAVE_UMASK
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* va_list as array */
#undef HAVE_VA_LIST_AS_ARRAY
/* "Module dir" */
#undef MODULE_PATH
/* "Has mysql/mysql.h" */
#undef MYSQL_HEADER_PREFIX
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* "Run group" */
#undef RUNGROUP
#define SERVICES_BIN "services"
#undef HAVE_UINT8_T
#undef HAVE_U_INT8_T
#undef HAVE_INT16_T
#undef HAVE_UINT16_T
#undef HAVE_U_INT16_T
#undef HAVE_INT32_T
#undef HAVE_UINT32_T
#undef HAVE_U_INT32_T
/* "Binary Dir" */
#undef SERVICES_BIN
/* "services bin dir" */
#undef SERVICES_DIR
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* "modules not available" */
#undef STATIC_LINKING
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* "Modules available" */
#undef USE_MODULES
/* "Use Mysql" */
#undef USE_MYSQL
/* "Use RDB" */
#undef USE_RDB
/* Define to `short' if <sys/types.h> does not define. */
#undef int16_t
/* Define to `long' if <sys/types.h> does not define. */
#undef int32_t
/* Define to `unsigned short' if <sys/types.h> does not define. */
#undef u_int16_t
/* Define to `unsigned long' if <sys/types.h> does not define. */
#undef u_int32_t
/* Static config, copy from here to below before running autoheader! */
#ifndef BIG_ENDIAN
/* Big Endian system */
#undef BIG_ENDIAN
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#ifdef HAVE_UINT8_T
typedef uint8_t uint8;
#else
# ifdef HAVE_U_INT8_T
typedef u_int8_t uint8;
# else
# ifdef _WIN32
typedef unsigned __int8 uint8;
# else
typedef unsigned short uint8;
# endif
# endif
#ifndef LITTLE_ENDIAN
/* Little Endian system */
#undef LITTLE_ENDIAN
#endif
#ifdef HAVE_INT16_T
/**
* NOTE: BIG_ENDIAN and LITTLE_ENDIAN defines should not be left in
* by autoheader as they may be defined or may not be, as such we check
* if there defined before messing with them!
**/
#ifdef HAS_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef __STRICT_ANSI__
#include <stdarg.h>
#include <stdio.h>
/* We KNOW these are not ansi, we are defining them here to suppress the warning
* * s messages on a "make strict" compile */
#ifndef snprintf
int snprintf(char *str, size_t size, const char *format, ...);
#endif
#ifndef vprintf
int vprintf(const char *format, va_list ap);
#endif
#ifndef vfprintf
int vfprintf(FILE *stream, const char *format, va_list ap);
#endif
#ifndef vsprintf
int vsprintf(char *str, const char *format, va_list ap);
#endif
#ifndef vsnprintf
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
#endif
FILE *popen(const char *command, const char *type);
int pclose(FILE *stream);
FILE *fdopen(int fildes, const char *mode);
int ftruncate(int fd, off_t length);
#ifdef HAVE_STRSIGNAL
char *strsignal(int sig);
#endif
#endif
typedef int16_t int16;
#else
# ifdef _WIN32
typedef signed __int16 int16;
# else
typedef int int16;
# endif
#endif
#ifdef HAVE_UINT16_T
typedef uint16_t uint16;
#else
# ifdef HAVE_U_INT16_T
typedef u_int16_t uint16;
# else
# ifdef _WIN32
typedef unsigned __int16 uint16;
# else
typedef unsigned int uint16;
# endif
# endif
#endif
#ifdef HAVE_INT32_T
typedef int32_t int32;
#else
# ifdef _WIN32
typedef signed __int32 int32;
# else
typedef long int32;
# endif
#endif
#ifdef HAVE_UINT32_T
typedef uint32_t uint32;
#else
# ifdef HAVE_U_INT32_T
typedef u_int32_t uint32;
# else
# ifdef _WIN32
typedef unsigned __int32 uint32;
# else
typedef unsigned long uint32;
# endif
# endif
#endif
#ifdef _WIN32
# ifdef MSVCPP
# define snprintf _snprintf
# endif
# define popen _popen
# define pclose _pclose
# define ftruncate _chsize
# ifdef MSVCPP
# define PATH_MAX MAX_PATH
# endif
# define MAXPATHLEN MAX_PATH
# define bzero(buf, size) memset(buf, 0, size)
# ifdef MSVCPP
# define strcasecmp stricmp
# endif
# define sleep(x) Sleep(x * 1000)
#endif
#endif
+50
View File
@@ -0,0 +1,50 @@
#define SERVICES_DIR "data"
#define SERVICES_BIN "anope.exe"
typedef signed __int16 int16;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16;
typedef unsigned __int16 u_int16_t;
typedef signed __int32 int32;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32;
typedef unsigned __int32 u_int32_t;
typedef unsigned __int8 u_int8_t;
#define HAVE_STRINGS_H 0
#define HAVE_SYS_SELECT_H 0
#define HAVE_SYS_SYSPROTO_H 0
#define HAVE_STRERROR 1
#define HAVE_SYS_ERRLIST 0
#define HAVE_SNPRINTF 1
#define BAD_SNPRINTF 0
#define HAVE_STRICMP 1
#define HAVE_STRCASECMP 0
#define HAVE_STRDUP 1
#define HAVE_STRSPN 1
#define HAVE_STRSIGNAL 0
#define HAVE_GETTIMEOFDAY 0
#define HAVE_SETGRENT 0
#define HAVE_UMASK 0
#define HAVE_FORK 0
#define HAVE_GETHOSTBYNAME 1
#define HAVE_BACKTRACE 0
/* Enable Module support */
#define USE_MODULES
#define MODULE_PATH ".\\modules\\"
/* Windows/MSVC likes to name things differently */
#define snprintf _snprintf
#define popen _popen
#define pclose _pclose
#define ftruncate _chsize
#define PATH_MAX MAX_PATH
#define MAXPATHLEN MAX_PATH
#define bzero(buf, size) memset(buf, 0, size)
#define strcasecmp stricmp
#define sleep(x) Sleep(x*1000)
+50
View File
@@ -0,0 +1,50 @@
/* Time-delay routine include stuff.
*
* (C) 2003-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
#ifndef TIMEOUT_H
#define TIMEOUT_H
#include <time.h>
/* Definitions for timeouts: */
typedef struct timeout_ Timeout;
struct timeout_ {
Timeout *next, *prev;
time_t settime, timeout;
int repeat; /* Does this timeout repeat indefinitely? */
void (*code)(Timeout *); /* This structure is passed to the code */
void *data; /* Can be anything */
};
/* Check the timeout list for any pending actions. */
extern void check_timeouts(void);
/* Add a timeout to the list to be triggered in `delay' seconds. Any
* timeout added from within a timeout routine will not be checked during
* that run through the timeout list.
*/
extern Timeout *add_timeout(int delay, void (*code)(Timeout *), int repeat);
/* Remove a timeout from the list (if it's there). */
extern void del_timeout(Timeout *t);
#ifdef DEBUG_COMMANDS
/* Send the list of timeouts to the given user. */
extern int send_timeout_list(User *u);
#endif
#endif /* TIMEOUT_H */
-116
View File
@@ -1,116 +0,0 @@
/* Timer include stuff.
*
* (C) 2003-2010 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for furhter details.
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
#ifndef TIMERS_H
#define TIMERS_H
#include "services.h"
#include <time.h>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
class CoreExport Timer : public Extensible
{
private:
/** The time this was created
*/
time_t settime;
/** The triggering time
*/
time_t trigger;
/** Numer of seconds between triggers
*/
long secs;
/** True if this is a repeating timer
*/
bool repeat;
public:
/** Default constructor, initializes the triggering time
* @param time_from_now The number of seconds from now to trigger the timer
* @param now The time now
* @param repeating Repeat this timer every time_from_now if this is true
*/
Timer(long time_from_now, time_t now = time(NULL), bool repeating = false);
/** Default destructor, removes the timer from the list
*/
virtual ~Timer();
/** Set the trigger time to a new value
* @param t The new time
*/
void SetTimer(time_t t);
/** Retrieve the triggering time
* @return The trigger time
*/
const time_t GetTimer();
/** Returns true if the timer is set to repeat
* @return Returns true if the timer is set to repeat
*/
const bool GetRepeat();
/** Returns the interval between ticks
* @return The interval
*/
const long GetSecs();
/** Returns the time this timer was created
* @return The time this timer was created
*/
const time_t GetSetTime();
/** Called when the timer ticks
* This should be overridden with something useful
*/
virtual void Tick(time_t ctime) = 0;
};
/** This class manages sets of Timers, and triggers them at their defined times.
* This will ensure timers are not missed, as well as removing timers that have
* expired and allowing the addition of new ones.
*/
class CoreExport TimerManager : public Extensible
{
protected:
/** A list of timers
*/
static std::vector<Timer *> Timers;
public:
/** Add a timer to the list
* @param T A Timer derived class to add
*/
static void AddTimer(Timer *T);
/** Deletes a timer
* @param T A Timer derived class to delete
*/
static void DelTimer(Timer *T);
/** Tick all pending timers
* @param ctime The current time
*/
static void TickTimers(time_t ctime = time(NULL));
/** Compares two timers
*/
static bool TimerComparison(Timer *one, Timer *two);
};
#endif
-263
View File
@@ -1,263 +0,0 @@
/*
* Copyright (C) 2008-2010 Robin Burchell <w00t@inspircd.org>
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*
* $Id$
*
*/
struct ChannelContainer
{
Channel *chan;
Flags<ChannelModeName> *Status;
ChannelContainer(Channel *c) : chan(c) { }
virtual ~ChannelContainer() { }
};
typedef std::list<ChannelContainer *> UChannelList;
/* Online user and channel data. */
class CoreExport User : public Extensible
{
protected:
std::string vident;
std::string ident;
std::string uid;
bool OnAccess; /* If the user is on the access list of the nick theyre on */
std::bitset<128> modes; /* Bitset of mode names the user has set on them */
std::map<UserModeName, std::string> Params; /* Map of user modes and the params this user has */
NickCore *nc; /* NickCore account the user is currently loggged in as */
public: // XXX: exposing a tiny bit too much
User *next, *prev;
std::string nick; /* User's current nick */
char *host; /* User's real hostname */
char *hostip; /* User's IP number */
char *vhost; /* User's virtual hostname */
std::string chost; /* User's cloaked hostname */
char *realname; /* Realname */
Server *server; /* Server user is connected to */
time_t timestamp; /* Timestamp of the nick */
time_t my_signon; /* When did _we_ see the user? */
int isSuperAdmin; /* is SuperAdmin on or off? */
/* Channels the user is in */
UChannelList chans;
unsigned short invalid_pw_count; /* # of invalid password attempts */
time_t invalid_pw_time; /* Time of last invalid password */
time_t lastmemosend; /* Last time MS SEND command used */
time_t lastnickreg; /* Last time NS REGISTER cmd used */
time_t lastmail; /* Last time this user sent a mail */
/****************************************************************/
/** Create a new user object, initialising necessary fields and
* adds it to the hash
*
* @param nick The nickname of the user.
* @param uid The unique identifier of the user.
*/
User(const std::string &nick, const std::string &uid);
/** Destroy a user.
*/
~User();
/** Update the nickname of a user record accordingly, should be
* called from ircd protocol.
*/
virtual void SetNewNick(const std::string &newnick);
/** Update the displayed (vhost) of a user record.
* This is used (if set) instead of real host.
* @param host The new displayed host to give the user.
*/
void SetDisplayedHost(const std::string &host);
/** Get the displayed vhost of a user record.
* @return The displayed vhost of the user, where ircd-supported, or the user's real host.
*/
const std::string GetDisplayedHost() const;
/** Update the cloaked host of a user
* @param host The cloaked host
*/
void SetCloakedHost(const std::string &newhost);
/** Get the cloaked host of a user
* @return The cloaked host
*/
const std::string &GetCloakedHost() const;
/** Retrieves the UID of the user, where applicable, if set.
* This is not used on some IRCds, but is for a lot e.g. P10, TS6 protocols.
* @return The UID of the user.
*/
const std::string &GetUID() const;
/** Update the displayed ident (username) of a user record.
* @param ident The new ident to give this user.
*/
void SetVIdent(const std::string &ident);
/** Get the displayed ident (username) of this user.
* @return The displayed ident of this user.
*/
const std::string &GetVIdent() const;
/** Update the real ident (username) of a user record.
* @param ident The new ident to give this user.
* NOTE: Where possible, you should use the Get/SetVIdent() equivilants.
*/
void SetIdent(const std::string &ident);
/** Get the real ident (username) of this user.
* @return The displayed ident of this user.
* NOTE: Where possible, you should use the Get/SetVIdent() equivilants.
*/
const std::string &GetIdent() const;
/** Get the full mask ( nick!ident@realhost ) of a user
*/
const std::string GetMask();
/** Updates the realname of the user record.
*/
void SetRealname(const std::string &realname);
/**
* Send a message (notice or privmsg, depending on settings) to a user
* @param source Sender nick
* @param fmt Format of the Message
* @param ... any number of parameters
*/
virtual void SendMessage(const std::string &source, const char *fmt, ...);
virtual void SendMessage(const std::string &source, const std::string &msg);
/** Collide a nick
* See the comment in users.cpp
* @param na The nick
*/
void Collide(NickAlias *na);
/** Check if the user should become identified because
* their svid matches the one stored in their nickcore
* @param svid Services id
*/
void CheckAuthenticationToken(const char *svid);
/** Auto identify the user to the given accountname.
* @param account Display nick of account
*/
void AutoID(const std::string &account);
/** Login the user to a NickCore
* @param core The account the user is useing
*/
void Login(NickCore *core);
/** Logout the user
*/
void Logout();
/** Get the account the user is logged in using
* @reurn The account or NULL
*/
virtual NickCore *Account() const;
/** Check if the user is identified for their nick
* @param CheckNick True to check if the user is identified to the nickname they are on too
* @return true or false
*/
virtual const bool IsIdentified(bool CheckNick = false) const;
/** Check if the user is recognized for their nick (on the nicks access list)
* @return true or false
*/
virtual const bool IsRecognized() const;
/** Update the last usermask stored for a user, and check to see if they are recognized
*/
void UpdateHost();
/** Check if the user has a mode
* @param Name Mode name
* @return true or false
*/
const bool HasMode(UserModeName Name) const;
/** Set a mode internally on the user, the IRCd is not informed
* @param um The user mode
* @param Param The param, if there is one
*/
void SetModeInternal(UserMode *um, const std::string &Param = "");
/** Remove a mode internally on the user, the IRCd is not informed
* @param um The user mode
*/
void RemoveModeInternal(UserMode *um);
/** Set a mode on the user
* @param bi The client setting the mode
* @param um The user mode
* @param Param Optional param for the mode
*/
void SetMode(BotInfo *bi, UserMode *um, const std::string &Param = "");
/** Set a mode on the user
* @param bi The client setting the mode
* @param Name The mode name
* @param Param Optional param for the mode
*/
void SetMode(BotInfo *bi, UserModeName Name, const std::string &Param = "");
/* Set a mode on the user
* @param bi The client setting the mode
* @param ModeChar The mode char
* @param param Optional param for the mode
*/
void SetMode(BotInfo *bi, char ModeChar, const std::string &Param = "");
/** Remove a mode on the user
* @param bi The client setting the mode
* @param um The user mode
*/
void RemoveMode(BotInfo *bi, UserMode *um);
/** Remove a mode from the user
* @param bi The client setting the mode
* @param Name The mode name
*/
void RemoveMode(BotInfo *bi, UserModeName Name);
/** Remove a mode from the user
* @param bi The client setting the mode
* @param ModeChar The mode char
*/
void RemoveMode(BotInfo *bi, char ModeChar);
/** Set a string of modes on a user
* @param bi The client setting the mode
* @param modes The modes
*/
void SetModes(BotInfo *bi, const char *modes, ...);
/** Find the channel container for Channel c that the user is on
* This is preferred over using FindUser in Channel, as there are usually more users in a channel
* than channels a user is in
* @param c The channel
* @return The channel container, or NULL
*/
ChannelContainer *FindChannel(Channel *c);
};
+25 -12
View File
@@ -3,12 +3,8 @@
# Build version string and increment Services build number.
#
if [ $# -lt 2 ] ; then
echo "Syntax: $0 <version.log> <version.h>"
exit 1
fi
# Grab version information from the version control file.
CTRL="$1"
CTRL="../version.log"
if [ -f $CTRL ] ; then
. $CTRL
else
@@ -19,9 +15,8 @@ fi
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA} (${VERSION_BUILD})"
VERSIONDOTTED="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA}.${VERSION_BUILD}"
VERSIONH="$2"
if [ -f $VERSIONH ] ; then
BUILD=`fgrep '#define BUILD' $VERSIONH | cut -f2 -d\"`
if [ -f version.h ] ; then
BUILD=`fgrep '#define BUILD' version.h | sed 's/^#define BUILD.*\([0-9]*\).*$/\1/'`
BUILD=`expr $BUILD + 1 2>/dev/null`
else
BUILD=1
@@ -29,7 +24,7 @@ fi
if [ ! "$BUILD" ] ; then
BUILD=1
fi
cat >$VERSIONH <<EOF
cat >version.h <<EOF
/* Version information for Services.
*
* (C) 2003-2010 Anope Team
@@ -38,15 +33,15 @@ cat >$VERSIONH <<EOF
* Please read COPYING and CREDITS for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* Based on the original code of Services by Andy Church.
*
* This file is auto-generated by version.sh
*
*/
#ifndef VERSION_H
#define VERSION_H
#define VERSION_MAJOR $VERSION_MAJOR
#define VERSION_MINOR $VERSION_MINOR
#define VERSION_PATCH $VERSION_PATCH
@@ -57,6 +52,12 @@ cat >$VERSIONH <<EOF
#define VERSION_STRING "$VERSION"
#define VERSION_STRING_DOTTED "$VERSIONDOTTED"
#ifdef DEBUG_COMMANDS
# define VER_DEBUG "D"
#else
# define VER_DEBUG
#endif
#if defined(_WIN32)
# if _MSC_VER >= 1400
# define VER_OS "W"
@@ -67,6 +68,18 @@ cat >$VERSIONH <<EOF
# define VER_OS
#endif
#if defined(USE_MYSQL)
# define VER_MYSQL "Q"
#else
# define VER_MYSQL
#endif
#if defined(USE_MODULES)
# define VER_MODULE "M"
#else
# define VER_MODULE
#endif
#endif
EOF
+133 -147
View File
@@ -16,8 +16,8 @@
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <cctype>
#define CTRL "version.log"
long version_major, version_minor, version_patch, version_build, build;
char *version_extra = NULL;
@@ -30,209 +30,195 @@ long get_value(char *);
char *get_value_str(char *);
char *strip(char *);
void parse_version(FILE *);
void write_version(FILE *, const char *);
void write_version(FILE *);
void parse_line(FILE *, char *);
int main(int argc, char *argv[])
int main()
{
if (argc < 4) {
fprintf(stderr, "Syntax: %s <version.log> <version.sh> <version.h>\n", argv[0]);
exit(1);
}
FILE *fd = fopen(argv[1], "r");
FILE *fd = fopen(CTRL, "r");
if (!fd) {
fprintf(stderr, "Error: Unable to find control file: %s\n", argv[1]);
exit(0);
}
if (!fd) {
fprintf(stderr, "Error: Unable to find control file: " CTRL "\n");
exit(0);
}
load_ctrl(fd);
fclose(fd);
load_ctrl(fd);
fclose(fd);
_snprintf(version, 1024, "%ld.%ld.%ld%s (%ld)", version_major, version_minor,
version_patch, (version_extra ? version_extra : ""), version_build);
_snprintf(version, 1024, "%d.%d.%d%s (%d)", version_major, version_minor,
version_patch, (version_extra ? version_extra : ""), version_build);
_snprintf(version_dotted, 1024, "%ld.%ld.%ld%s.%ld", version_major, version_minor,
version_patch, (version_extra ? version_extra : ""), version_build);
_snprintf(version_dotted, 1024, "%d.%d.%d%s.%d", version_major, version_minor,
version_patch, (version_extra ? version_extra : ""), version_build);
fd = fopen(argv[3], "r");
fd = fopen("version.h", "r");
if (fd) {
parse_version(fd);
fclose(fd);
} else
build = 1;
if (fd) {
parse_version(fd);
fclose(fd);
} else
build = 1;
fd = fopen(argv[3], "w");
write_version(fd, argv[2]);
fclose(fd);
fd = fopen("version.h", "w");
write_version(fd);
fclose(fd);
if (version_extra)
free(version_extra);
}
void load_ctrl(FILE * fd)
{
char buf[512];
while (fgets(buf, 511, fd)) {
char *var;
char buf[512];
while (fgets(buf, 511, fd)) {
char *var;
strip(buf);
strip(buf);
var = strtok(buf, "=");
if (!var)
continue;
if (!strcmp(var, "VERSION_MAJOR"))
version_major = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_MINOR"))
version_minor = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_PATCH"))
version_patch = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_BUILD"))
version_build = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_EXTRA"))
version_extra = get_value_str(strtok(NULL, ""));
var = strtok(buf, "=");
if (!var)
continue;
if (!strcmp(var, "VERSION_MAJOR"))
version_major = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_MINOR"))
version_minor = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_PATCH"))
version_patch = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_BUILD"))
version_build = get_value(strtok(NULL, ""));
else if (!strcmp(var, "VERSION_EXTRA"))
version_extra = get_value_str(strtok(NULL, ""));
}
}
}
char *strip(char *str)
{
char *c;
if ((c = strchr(str, '\n')))
*c = 0;
if ((c = strchr(str, '\r')))
*c = 0;
return str;
char *c;
if ((c = strchr(str, '\n')))
*c = 0;
if ((c = strchr(str, '\r')))
*c = 0;
return str;
}
long get_value(char *string)
{
// XXX : if the fields in version.log are empty strtok returns a double quote, dont try to atol it then
if (string[1] != '"')
return atol(get_value_str(string));
else
return 0;
return atol(get_value_str(string));
}
char *get_value_str(char *string)
{
int len;
char *newstr;
int len;
if (*string == '"')
string++;
if (*string == '"')
string++;
len = strlen(string);
len = strlen(string);
if (string[len - 1] == '"')
string[len - 1] = 0;
if (!*string)
return NULL;
newstr = (char *)malloc(len + 1);
strcpy(newstr, string);
return newstr;
//return strdup(string);
if (string[len - 1] == '"')
string[len - 1] = 0;
if (!*string)
return NULL;
return strdup(string);
}
void parse_version(FILE * fd)
{
char buf[1024];
char buf[1024];
while (fgets(buf, 1023, fd)) {
char *para1;
while (fgets(buf, 1023, fd)) {
char *para1;
strip(buf);
para1 = strtok(buf, " \t");
strip(buf);
para1 = strtok(buf, " \t");
if (!para1)
continue;
if (!para1)
continue;
if (!strcmp(para1, "#define")) {
char *para2 = strtok(NULL, " \t");
if (!strcmp(para1, "#define")) {
char *para2 = strtok(NULL, " \t");
if (!para2)
continue;
if (!para2)
continue;
if (!strcmp(para2, "BUILD")) {
char *value = strtok(NULL, "");
build = get_value(value);
build++;
return;
}
}
}
build = 1;
if (!strcmp(para2, "BUILD")) {
char *value = strtok(NULL, "");
build = get_value(value);
build++;
return;
}
}
}
build = 1;
}
void write_version(FILE * fd, const char *input)
void write_version(FILE * fd)
{
FILE *fdin = fopen(input, "r");
char buf[1024];
short until_eof = 0;
FILE *fdin = fopen("include\\version.sh", "r");
char buf[1024];
short until_eof = 0;
while (fgets(buf, 1023, fdin)) {
strip(buf);
while (fgets(buf, 1023, fdin)) {
strip(buf);
if (until_eof)
{
if (!strcmp(buf, "EOF"))
break;
else
parse_line(fd, buf);
}
if (until_eof)
if (!strcmp(buf, "EOF"))
break;
else
parse_line(fd, buf);
if (!strcmp(buf, "cat >$VERSIONH <<EOF"))
until_eof = 1;
}
if (!strcmp(buf, "cat >version.h <<EOF"))
until_eof = 1;
}
}
void parse_line(FILE * fd, char *line)
{
char *c;
for (c = line; *c; c++) {
/* It's a variable, find out which */
if (*c == '$') {
char *var, *varbegin;
char *c;
for (c = line; *c; c++) {
/* It's a variable, find out which */
if (*c == '$') {
char *var, *varbegin;
if (*(c + 1))
c++;
else
continue;
for (var = varbegin = c; var; var++) {
if (!isalnum(*var) && *var != '_')
break;
}
if (var != varbegin) {
char tmp = *var;
if (*(c + 1))
c++;
else
continue;
for (var = varbegin = c; var; var++) {
if (!isalnum(*var) && *var != '_')
break;
}
if (var != varbegin) {
char tmp = *var;
*var = 0;
if (!strcmp(varbegin, "VERSION_MAJOR"))
fprintf(fd, "%ld", version_major);
else if (!strcmp(varbegin, "VERSION_MINOR"))
fprintf(fd, "%ld", version_minor);
else if (!strcmp(varbegin, "VERSION_PATCH"))
fprintf(fd, "%ld", version_patch);
else if (!strcmp(varbegin, "VERSION_EXTRA")) {
if (version_extra)
fprintf(fd, "%s", version_extra);
} else if (!strcmp(varbegin, "VERSION_BUILD"))
fprintf(fd, "%ld", version_build);
else if (!strcmp(varbegin, "BUILD"))
fprintf(fd, "%ld", build);
else if (!strcmp(varbegin, "VERSION"))
fprintf(fd, "%s", version);
else if (!strcmp(varbegin, "VERSIONDOTTED"))
fprintf(fd, "%s", version_dotted);
if (tmp) fputc(tmp, fd);
}
c = var;
} else
fputc(*c, fd);
}
*var = 0;
if (!strcmp(varbegin, "VERSION_MAJOR"))
fprintf(fd, "%d", version_major);
else if (!strcmp(varbegin, "VERSION_MINOR"))
fprintf(fd, "%d", version_minor);
else if (!strcmp(varbegin, "VERSION_PATCH"))
fprintf(fd, "%d", version_patch);
else if (!strcmp(varbegin, "VERSION_EXTRA")) {
if (version_extra)
fprintf(fd, "%s", version_extra);
} else if (!strcmp(varbegin, "VERSION_BUILD"))
fprintf(fd, "%d", version_build);
else if (!strcmp(varbegin, "BUILD"))
fprintf(fd, "%d", build);
else if (!strcmp(varbegin, "VERSION"))
fprintf(fd, "%s", version);
else if (!strcmp(varbegin, "VERSIONDOTTED"))
fprintf(fd, "%s", version_dotted);
fputc(tmp, fd);
}
c = var;
} else
fputc(*c, fd);
}
/* We only need \n here - we didn't open the file as binary -GD */
fprintf(fd, "\n");
fprintf(fd, "\n");
}
+548 -287
View File
@@ -15,296 +15,557 @@
var anopeVersion = "Unknown";
var vMaj, vMin, vPat, vBuild, vExtra;
var drivesToCheck = ['C', 'D', 'E', 'F', 'G', 'H'];
var installerResponses = new Array();
var softwareVersions = {
'Compiler' : false,
'MySQLDB' : false
};
var installerQuestions = [
{
'question' : [
'In what directory do you want Anope to be installed?'
],
'short' : 'Install directory:',
'default_answer' : '',
'store_answer' : function(answer) {
if (!answer)
{
WScript.Echo("You must give a directory!\n");
return false;
{
'question' : [
'Do you want to compile Anope with MySQL Support?',
'NOTE: You will need to have installed MySQL 3.23 or Above'
],
'short' : 'Enable MySQL Support?',
'options' : [
'yes',
'no'
],
'default_answer' : 'no',
'store_answer' : function (answer) {
if (answer == 'yes') {
if (!findMySQL()) {
WScript.Echo("\nERROR: Cannot find MySQL - See error messages above for details.\n");
return false;
}
}
installerResponses['MySQL DB Support'] = answer;
return true;
},
'commit_config' : function() {
if (installerResponses['MySQL DB Support'] == 'yes') {
f.WriteLine("USE_MYSQL=1");
f.WriteLine("MYSQL_LIB=\""+softwareVersions['MySQLDB'].installedDrive+":\\"+softwareVersions['MySQLDB'].libpaths[0]+"\"");
f.WriteLine("MYSQL_INC=\""+softwareVersions['MySQLDB'].installedDrive+":\\"+softwareVersions['MySQLDB'].incpaths[0]+"\"");
f.WriteLine("LIBS=$(LIBS) /LIBPATH:$(MYSQL_LIB)");
f.WriteLine("MYSQL_LIB_PATH=/LIBPATH:$(MYSQL_LIB)");
f.WriteLine("BASE_CFLAGS=$(BASE_CFLAGS) /I $(MYSQL_INC)");
f.WriteLine("MYSQL_INC_PATH=/I $(MYSQL_INC)");
f.WriteLine("RDB_C=rdb.c");
f.WriteLine("RDB_O=rdb.obj");
f.WriteLine("MYSQL_C=mysql.c");
f.WriteLine("MYSQL_O=mysql.obj");
f.WriteLine("BASE_CFLAGS=/D USE_MYSQL /D USE_RDB $(BASE_CFLAGS) /D HAVE_MYSQL_MYSQL_H");
f.WriteLine("MYPASQL_BUILD=$(CC) /LD $(MYSQL_INC_PATH) src\\mypasql.c /link $(MYSQL_LIB_PATH) $(LFLAGS) /DEF:src\mypasql.def libmysql.lib zlib.lib ws2_32.lib advapi32.lib /NODEFAULTLIB:LIBCMTD.lib");
f.WriteLine("LIBS=$(LIBS) libmysql.lib zlib.lib");
}
else {
f.WriteLine("USE_MYSQL=0");
}
}
},
];
var buildPackages = [
{
'name' : 'Microsoft Visual Studio 2008 (New PSDK)',
'libpaths' : [
'Program Files\\Microsoft Visual Studio 9.0\\VC\\Lib',
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Lib'
],
'incpaths' : [
'Program Files\\Microsoft Visual Studio 9.0\\VC\\Include',
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Include'
],
'nmake' : [
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Bin',
],
'additional_switches' : [ '/w' ],
'installedDrive' : 'C'
},
{
'name' : 'Microsoft Visual Studio 2008 (64bit) (New PSDK)',
'libpaths' : [
'Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\Lib',
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Lib'
],
'incpaths' : [
'Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\Include',
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Include'
],
'nmake' : [
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Bin',
],
'additional_switches' : [ '/w' ],
'installedDrive' : 'C'
},
{
'name' : 'Microsoft Visual Studio 2005 (New PSDK)',
'libpaths' : [
'Program Files\\Microsoft Visual Studio 8\\VC\\Lib',
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Lib'
],
'incpaths' : [
'Program Files\\Microsoft Visual Studio 8\\VC\\Include',
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Include'
],
'nmake' : [
'Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Bin',
''
],
'additional_switches' : [
'/w'
],
'installedDrive' : 'C'
},
{
'name' : 'Microsoft Visual Studio 2005 (Old PSDK)',
'libpaths' : [
'Program Files\\Microsoft Visual Studio 8\\VC\\Lib',
'Program Files\\Microsoft Platform SDK\\Lib'
],
'incpaths' : [
'Program Files\\Microsoft Visual Studio 8\\VC\\Include',
'Program Files\\Microsoft Platform SDK\\Include'
],
'nmake' : [
'Program Files\\Microsoft Platform SDK\\Bin',
''
],
'additional_switches' : [
'/w'
],
'installedDrive' : 'C'
},
{
'name' : 'Microsoft Visual Studio .NET 2003',
'libpaths' : [
'Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\Lib',
'Program Files\\Microsoft Visual Studio .NET 2003\\PlatformSDK\\Lib'
],
'incpaths' : [
'Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\Include',
'Program Files\\Microsoft Visual Studio .NET 2003\\PlatformSDK\\Include'
],
'nmake' : [
'Program Files\\Microsoft Visual Studio .NET 2003\\VC7\\Bin',
''
],
'additional_switches' : false,
'installedDrive' : 'C'
},
{
'name' : 'Microsoft Visual Studio 98',
'libpaths' : [
'Program Files\\Microsoft Visual Studio\\VC98\\Lib'
],
'incpaths' : [
'Program Files\\Microsoft Visual Studio\\VC98\\Include'
],
'nmake' : [
'Program Files\\Microsoft Visual Studio\\VC98\\Bin',
''
],
'additional_switches' : [
'/QIfist'
],
'installedDrive' : 'C'
}
];
var mysqlVersions = [
{
'name' : 'MySQL 5.1',
'libpaths' : [
'Program Files\\MySQL\\MySQL Server 5.1\\Lib\\opt'
],
'incpaths' : [
'Program Files\\MySQL\\MySQL Server 5.1\\Include'
],
'dllfile' : 'Program Files\\MySQL\\MySQL Server 5.1\\bin\\libmysql.dll',
'installedDrive' : 'C'
},
{
'name' : 'MySQL 5.0',
'libpaths' : [
'Program Files\\MySQL\\MySQL Server 5.0\\Lib\\opt'
],
'incpaths' : [
'Program Files\\MySQL\\MySQL Server 5.0\\Include'
],
'dllfile' : 'Program Files\\MySQL\\MySQL Server 5.0\\Bin\\libmysql.dll',
'installedDrive' : 'C'
},
{
'name' : 'MySQL 4.1',
'libpaths' : [
'Program Files\\MySQL\\MySQL Server 4.1\\Lib\\opt'
],
'incpaths' : [
'Program Files\\MySQL\\MySQL Server 4.1\\Include'
],
'dllfile' : 'Program Files\\MySQL\\MySQL Server 4.1\\Bin\\libmysql.dll',
'installedDrive' : 'C'
},
{
'name' : 'MySQL 4.0',
'libpaths' : [
'Program Files\\MySQL\\MySQL Server 4.0\\Lib\\opt'
],
'incpaths' : [
'Program Files\\MySQL\\MySQL Server 4.0\\Include'
],
'dllfile' : 'Program Files\\MySQL\\MySQL Server 4.0\\Bin\\libmysql.dll',
'installedDrive' : 'C'
},
{
'name' : 'MySQL 3.23 or older (or other default path)',
'libpaths' : [
'mysql\\lib\\opt'
],
'incpaths' : [
'mysql\\include'
],
'dllfile' : 'mysql\\Bin\\libmysql.dll',
'installedDrive' : 'C'
}
];
var bannerReplacements = [
{
'findtext' : /CURVER/g,
'replacement' : function() { FindAnopeVersion(); return anopeVersion; }
},
{
'findtext' : / For more options type .\/Config --help/g,
'replacement' : function() { return ''; }
}
];
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var x, y, z;
if (fso.FileExists('.BANNER')) {
var bannerStream = fso.OpenTextFile(".BANNER");
var bannerText = bannerStream.ReadAll();
bannerStream.close();
for (x in bannerReplacements) {
var thisReplacement = bannerReplacements[x];
bannerText = bannerText.replace(thisReplacement['findtext'], thisReplacement['replacement']);
}
WScript.Echo(bannerText+"\n");
}
else {
WScript.Echo("ERROR: Cannot find banner file!\n");
}
WScript.Echo("Press Enter to Begin...");
InstallerInput();
WScript.Echo("");
for (x in installerQuestions) {
var thisQuestion = installerQuestions[x];
var validResponse = false;
var validOpts = new Array();
while (!validResponse) {
for (y in thisQuestion.question) {
var qLine = thisQuestion.question[y];
WScript.Echo(qLine);
}
WScript.Echo('');
var choiceLine = '';
for (y in thisQuestion.options) {
choiceLine += thisQuestion.options[y] + ', ';
validOpts[thisQuestion.options[y]] = true;
}
choiceLine = choiceLine.substring(0, choiceLine.length - 2);
WScript.Echo("Available Options: "+choiceLine);
WScript.Echo("Default Answer: "+thisQuestion.default_answer+"\n");
WScript.Echo(thisQuestion.short);
var inputValue = InstallerInput().toLowerCase();
if (!inputValue) {
inputValue = thisQuestion.default_answer;
}
if (!validOpts[inputValue]) {
WScript.Echo("ERROR: Invalid option '"+inputValue+"'\n");
}
else if (thisQuestion.store_answer(inputValue)) {
validResponse = true;
}
}
WScript.Echo("");
}
if (!findCompiler()) {
WScript.Echo("\nERROR: No suitable build tools were found!");
WScript.Echo("Please ensure you have downloaded and installed a version of Visual C++ and/or PlatformSDK.\n");
WScript.Echo("For more information on the tools needed to build Anope on Windows, see:\nhttp://anope.info/wiki/Windows#Compiling\n");
}
else {
WScript.Echo("\nBuild tools were found successfully!\n");
WScript.Echo("\nAnope will be compiled with the following options:\n");
for (x in installerResponses) {
var thisResponse = installerResponses[x];
WScript.Echo("\t"+x+":\t\t["+thisResponse.toUpperCase()+"]");
}
for (x in softwareVersions) {
var thisVer = softwareVersions[x];
if (!thisVer) {
WScript.Echo("\t"+x+" Version:\t\tNot Enabled");
}
else {
WScript.Echo("\t"+x+" Version:\t\t"+thisVer.name);
}
}
WScript.Echo("\tAnope Version:\t\t\t"+anopeVersion);
WScript.Echo("\nTo continue, please press Enter...");
InstallerInput();
var f = fso.OpenTextFile("Makefile.inc.win32", 2);
f.WriteLine("#");
f.WriteLine("# Generated by install.js");
f.WriteLine("#");
if (typeof(softwareVersions['Compiler'].additional_switches) !== 'boolean') {
var switch_line = '';
for (x in softwareVersions['Compiler'].additional_switches) {
switch_line += softwareVersions['Compiler'].additional_switches[x]+" ";
}
f.WriteLine("VC6="+switch_line);
}
var path_line = '';
for (x in softwareVersions['Compiler'].libpaths) {
path_line += "/LIBPATH:\""+softwareVersions['Compiler'].installedDrive+":\\"+softwareVersions['Compiler'].libpaths[x]+"\" ";
}
f.WriteLine("LIBPATH="+path_line);
path_line = '';
var path_line_rc = '';
for (x in softwareVersions['Compiler'].incpaths) {
path_line += "/I \""+softwareVersions['Compiler'].installedDrive+":\\"+softwareVersions['Compiler'].incpaths[x]+"\" ";
path_line_rc += "/i \""+softwareVersions['Compiler'].installedDrive+":\\"+softwareVersions['Compiler'].incpaths[x]+"\" ";
}
f.WriteLine("INCFLAGS="+path_line);
f.WriteLine("VERSION="+anopeVersion);
f.WriteLine("PROGRAM=anope.exe");
f.WriteLine("DATDEST=data");
f.WriteLine("CC=cl");
f.WriteLine("RC=rc");
f.WriteLine("MAKE=nmake -f Makefile.win32");
f.WriteLine("BASE_CFLAGS=$(VC6) /O2 /MD $(INCFLAGS)");
f.WriteLine("RC_FLAGS="+path_line_rc);
f.WriteLine("LIBS=wsock32.lib advapi32.lib /NODEFAULTLIB:libcmtd.lib");
f.WriteLine("LFLAGS=$(LIBPATH)");
for (x in installerQuestions) {
var thisQuestion = installerQuestions[x];
thisQuestion.commit_config();
}
f.WriteLine("MORE_CFLAGS = /I\"../include\"");
f.WriteLine("CFLAGS = /nologo $(CDEFS) $(BASE_CFLAGS) $(MORE_CFLAGS)");
f.close();
generateRC();
WScript.Echo("\nConfiguration Complete!");
WScript.Echo("-----------------------\n");
WScript.Echo("Anope has been configured to your system. To compile, simply type:");
WScript.Echo("nmake -f Makefile.win32\n");
WScript.Echo("If you update Anope, you should run this script again to ensure\nall available options are set.\n");
}
// Fin.
// -----------------------------------------------------------------
// Functions
function FindAnopeVersion() {
if (!fso.FileExists('version.log')) {
anopeVersion = 'Unknown';
return;
}
var versionLog = fso.OpenTextFile("version.log");
while (!versionLog.atEndOfStream) {
var versionLine = versionLog.readline();
var thisMatch = versionLine.replace('\n', '');
while (thisMatch.match(/\"/g)) {
thisMatch = thisMatch.replace('"', '');
}
if (!fso.FolderExists(answer))
{
if (fso.FileExists(answer))
{
WScript.Echo(answer + " exists, but is not a directory!\n");
return false;
}
WScript.Echo(answer + " does not exist. Create it ([yes]/no)?\n");
var inputValue = InstallerInput().toLowerCase();
if (!inputValue)
inputValue = 'yes';
if (inputValue != 'no')
fso.CreateFolder(answer);
}
else if (fso.FileExists(answer + '\\include\\services.h'))
{
WScript.Echo("You cannot use the Anope source directory as a target directory.\n");
return false;
}
installerResponses['Install Directory'] = answer.replace(/\\/g, '/');
return true;
},
'cmake_argument' : function() {
return '-DINSTDIR:STRING="' + installerResponses['Install Directory'] + '"';
versionLine = thisMatch;
if (versionLine.match(/VERSION_MAJOR=/g)) {
vMaj = versionLine.replace('VERSION_MAJOR=', '');
continue;
}
if (versionLine.match(/VERSION_MINOR=/g)) {
vMin = versionLine.replace('VERSION_MINOR=', '');
continue;
}
if (versionLine.match(/VERSION_PATCH=/g)) {
vPat = versionLine.replace('VERSION_PATCH=', '');
continue;
}
if (versionLine.match(/VERSION_EXTRA=/g)) {
vExtra = versionLine.replace('VERSION_EXTRA=', '');
continue;
}
if (versionLine.match(/VERSION_BUILD=/g)) {
vBuild = versionLine.replace('VERSION_BUILD=', '');
continue;
}
}
versionLog.close();
anopeVersion = vMaj+"."+vMin+"."+vPat+"."+vBuild+vExtra;
return;
}
function InstallerInput() {
var input = WScript.StdIn.Readline();
return input;
}
function findMySQL() {
WScript.Echo("\nLooking for MySQL...\n");
var installedDrive = "";
for (x in mysqlVersions) {
var thisSQLVer = mysqlVersions[x];
WScript.Echo("Looking for: "+thisSQLVer.name+"...");
if (!(installedDrive = findFile("libmysql.lib", thisSQLVer.libpaths))) {
WScript.Echo("ERROR: Cannot find libmysql.lib - This version is probably not installed...\n");
continue;
}
if (!findFile("mysql.h", thisSQLVer.incpaths)) {
WScript.Echo("ERROR: Cannot find mysql.h - Half of this version of MySQL is installed (strange)...\n");
continue;
}
WScript.Echo("SUCCESS: "+thisSQLVer.name+" is installed, and is complete!\n");
thisSQLVer.installedDrive = installedDrive;
softwareVersions.MySQLDB = thisSQLVer;
return true;
}
return false;
}
function findCompiler() {
WScript.Echo("\nLooking for a suitable compiler...\n");
var noPSDK = false;
var installedDrive = "";
for (x in buildPackages) {
var thisPack = buildPackages[x];
WScript.Echo("Looking for: "+thisPack.name+"...");
if (!(installedDrive = findFile("MSVCRT.lib", thisPack.libpaths))) {
WScript.Echo("ERROR: Cannot find MSVCRT.lib - This version is probably not installed...\n");
continue;
}
if (!findFile("wsock32.lib", thisPack.libpaths)) {
WScript.Echo("ERROR: Cannot find wsock32.lib - Probably missing PlatformSDK...\n");
noPSDK = true;
continue;
}
if (!findFile("advapi32.lib", thisPack.libpaths)) {
WScript.Echo("ERROR: Cannot find advapi32.lib - Probably missing PlatformSDK...\n");
noPSDK = true;
continue;
}
if (!findFile("stdio.h", thisPack.incpaths)) {
WScript.Echo("ERROR: Cannot find stdio.h - Missing core header files...\n");
continue;
}
if (!findFile("windows.h", thisPack.incpaths)) {
WScript.Echo("ERROR: Cannot find windows.h - Probably missing PlatformSDK headers...\n");
noPSDK = true;
continue;
}
if (!findFile("nmake.exe", thisPack.nmake)) {
WScript.Echo("ERROR: Cannot find a copy of nmake.exe...\n");
WScript.Echo("In order to compile Anope, you need a working copy of nmake.exe on your system.");
WScript.Echo("A freely available copy can be downloaded from the url below.");
WScript.Echo("nmake.exe is also available in the PlatformSDK which can be freely downloaded from Microsoft.\n");
WScript.Echo("nmake.exe:\nhttp://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe\n");
break;
}
WScript.Echo("SUCCESS: "+thisPack.name+" was found, and is complete!");
thisPack.installedDrive = installedDrive;
softwareVersions.Compiler = thisPack;
return true;
}
if (noPSDK) {
WScript.Echo("Some of the build tools were detected on your computer, but the essential PlatformSDK components were missing.");
WScript.Echo("You will need to download the PlatformSDK from the URL below, ensuring that the Core Windows files, and Debugging Tools are installed.");
WScript.Echo("For more details on installing the PlatformSDK, visit http://anope.info/wiki/Windows#Compiling\n");
WScript.Echo("PSDK: http://download.microsoft.com/download/a/5/f/a5f0d781-e201-4ab6-8c6a-9bb4efed1e1a/PSDK-x86.exe\n");
}
return false;
}
function findFile(fileName, arrayOfPaths) {
for (z in arrayOfPaths) {
var thisPath = arrayOfPaths[z];
for (y in drivesToCheck) {
var thisDrive = drivesToCheck[y];
if (fso.FileExists(thisDrive+":\\"+thisPath+"\\"+fileName)) {
return thisDrive;
}
}
}
},
{
'question' : [
'Would you like to build using NMake instead of using Visual Studio?',
'NOTE: If you decide to use NMake, you must be in an environment where',
' NMake can function, such as the Visual Studio command line.',
' If you say yes to this while not in an environment that can run',
' NMake, it can cause the CMake configuration to enter an endless',
' loop.'
],
'short' : 'Use NMake?',
'options' : [
'yes',
'no'
],
'default_answer' : 'no',
'store_answer' : function(answer) {
installerResponses['Use NMake'] = answer;
return true;
},
'cmake_argument' : function() {
if (installerResponses['Use NMake'] == 'yes')
return '-G"NMake Makefiles"';
else
return '';
}
},
{
'question' : [
'Would you like to build a debug version of Anope?'
],
'short' : 'Build debug?',
'options' : [
'yes',
'no'
],
'default_answer' : 'no',
'store_answer' : function(answer) {
installerResponses['Debug'] = answer;
return true;
},
'cmake_argument' : function() {
if (installerResponses['Debug'] == 'msvc')
return '';
else if (installerResponses['Debug'] == 'yes')
return '-DCMAKE_BUILD_TYPE:STRING=DEBUG';
else
return '-DCMAKE_BUILD_TYPE:STRING=RELEASE';
}
},
{
'question' : [
'Are you using Visual Studio 2008? If you are, you need to answer yes',
'to this question, otherwise CMake will not function properly.'
],
'short' : 'Using Visual Studio 2008?',
'options' : [
'yes',
'no'
],
'default_answer' : 'no',
'store_answer' : function(answer) {
installerResponses['Visual Studio 2008'] = answer;
return true;
},
'cmake_argument' : function() {
if (installerResponses['Visual Studio 2008'] == 'yes')
return '-G"Visual Studio 9 2008"';
else
return '';
}
},
];
var bannerReplacements = [
{
'findtext' : /CURVER/g,
'replacement' : function() { FindAnopeVersion(); return anopeVersion; }
},
{
'findtext' : / For more options type SOURCE_DIR\/Config --help/g,
'replacement' : function() { return ''; }
}
];
var ScriptPath = WScript.ScriptFullName.substr(0, WScript.ScriptFullName.length - WScript.ScriptName.length);
var fso = WScript.CreateObject('Scripting.FileSystemObject');
var x, y, z;
if (fso.FileExists(ScriptPath + '.BANNER'))
{
var bannerStream = fso.OpenTextFile(ScriptPath + '.BANNER');
var bannerText = bannerStream.ReadAll();
bannerStream.close();
for (x in bannerReplacements)
{
var thisReplacement = bannerReplacements[x];
bannerText = bannerText.replace(thisReplacement['findtext'], thisReplacement['replacement']);
}
WScript.Echo(bannerText + "\n");
}
else
WScript.Echo("ERROR: Cannot find banner file!\n");
WScript.Echo('Press Enter to Begin...');
InstallerInput();
WScript.Echo('');
for (x in installerQuestions)
{
var thisQuestion = installerQuestions[x];
var validResponse = false;
var validOpts = new Array();
if (thisQuestion.short == 'Build debug?' && installerResponses['Use NMake'] == 'no')
{
installerResponses['Debug'] = 'msvc';
continue;
}
if (thisQuestion.short == 'Using Visual Studio 2008?' && installerResponses['Debug'] != 'msvc')
{
installerResponses['Visual Studio 2008'] = 'no';
continue;
}
while (!validResponse)
{
for (y in thisQuestion.question)
{
var qLine = thisQuestion.question[y];
WScript.Echo(qLine);
}
WScript.Echo('');
var choiceLine = '';
if (thisQuestion.options)
{
for (y in thisQuestion.options)
{
choiceLine += thisQuestion.options[y] + ', ';
validOpts[thisQuestion.options[y]] = true;
}
choiceLine = choiceLine.substring(0, choiceLine.length - 2);
WScript.Echo('Available Options: ' + choiceLine);
}
if (thisQuestion.default_answer)
WScript.Echo('Default Answer: ' + thisQuestion.default_answer + "\n");
WScript.Echo(thisQuestion.short);
var inputValue = InstallerInput().toLowerCase();
if (!inputValue)
inputValue = thisQuestion.default_answer;
if (choiceLine && !validOpts[inputValue])
WScript.Echo("ERROR: Invalid option '" + inputValue + "'\n");
else if (thisQuestion.store_answer(inputValue))
validResponse = true;
}
WScript.Echo('');
}
WScript.Echo("\nAnope will be compiled with the following options:\n");
for (x in installerResponses)
{
var thisResponse = installerResponses[x];
WScript.Echo("\t" + x + ":\t\t[" + thisResponse.toUpperCase() + "]");
}
WScript.Echo("\tAnope Version:\t\t\t" + anopeVersion);
WScript.Echo("\nTo continue, please press Enter...");
InstallerInput();
var cmake = 'cmake';
for (x in installerQuestions)
{
var thisQuestion = installerQuestions[x];
cmake += ' ' + thisQuestion.cmake_argument();
}
var fixedScriptPath = ScriptPath.replace(/\\/g, '/');
cmake += ' "' + fixedScriptPath + '"';
WScript.Echo(cmake + "\n");
var shell = WScript.CreateObject('WScript.Shell');
var cmake_shell = shell.exec('%comspec% /c ' + cmake);
while (!cmake_shell.Status)
{
if (!cmake_shell.StdOut.AtEndOfStream)
WScript.Echo(cmake_shell.StdOut.ReadLine());
else if (!cmake_shell.StdErr.AtEndOfStream)
WScript.Echo(cmake_shell.StdErr.ReadLine());
}
if (cmake_shell.ExitCode == 0)
{
if (installerResponses['Use NMake'] == 'yes') WScript.Echo("\nTo compile Anope, run 'nmake'. To install, run 'nmake install'.\n");
else WScript.Echo("\nTo compile Anope, open Anope.sln and build the solution. To install,\ndo a build on the INSTALL project.\n");
WScript.Echo("If you update Anope, you should run this script again to ensure\nall available options are set.\n");
}
else
WScript.Echo("\nThere was an error attempting to run CMake! Check the above error message,\nand contact the Anope team if you are unsure how to proceed.\n");
// -----------------------------------------------------------------
// Functions
function FindAnopeVersion() {
if (!fso.FileExists(ScriptPath + 'version.log'))
{
anopeVersion = 'Unknown';
return;
}
var versionLog = fso.OpenTextFile(ScriptPath + 'version.log');
while (!versionLog.atEndOfStream)
{
var versionLine = versionLog.readline();
var thisMatch = versionLine.replace('\n', '');
while (thisMatch.match(/\"/g))
thisMatch = thisMatch.replace('"', '');
versionLine = thisMatch;
if (versionLine.match(/VERSION_MAJOR=/g))
{
vMaj = versionLine.replace('VERSION_MAJOR=', '');
continue;
}
if (versionLine.match(/VERSION_MINOR=/g))
{
vMin = versionLine.replace('VERSION_MINOR=', '');
continue;
}
if (versionLine.match(/VERSION_PATCH=/g))
{
vPat = versionLine.replace('VERSION_PATCH=', '');
continue;
}
if (versionLine.match(/VERSION_EXTRA=/g))
{
vExtra = versionLine.replace('VERSION_EXTRA=', '');
continue;
}
if (versionLine.match(/VERSION_BUILD=/g))
{
vBuild = versionLine.replace('VERSION_BUILD=', '');
continue;
}
}
versionLog.close();
anopeVersion = vMaj + '.' + vMin + '.' + vPat + '.' + vBuild + vExtra;
return;
}
function InstallerInput() {
var input = WScript.StdIn.Readline();
return input;
}
return false;
}
function generateRC() {
var version_matches = [
{
'find' : /VERSION_COMMA/g,
'replacement' : vMaj+","+vMin+","+vPat+","+vBuild
},
{
'find' : /VERSION_FULL/g,
'replacement' : anopeVersion
},
{
'find' : /VERSION_DOTTED/g,
'replacement' : vMaj+"."+vMin+"."+vPat+"."+vBuild
}
];
var template = fso.OpenTextFile("src/win32.rc.template", 1);
var output = fso.OpenTextFile("src/win32.rc", 2, true);
if (!template) {
WScript.Echo("ERROR: Unable to generate win32.rc file - Couldn't open source file..");
}
if (!output) {
WScript.Echo("ERROR: Unable to generate win32.rc file - Couldn't open output file..");
}
var templateText = template.ReadAll();
template.close();
for (x in version_matches) {
var thisVerStr = version_matches[x];
while (templateText.match(thisVerStr.find)) {
templateText = templateText.replace(thisVerStr.find, thisVerStr.replacement);
}
}
output.WriteLine(templateText);
output.close();
}
View File
-113
View File
@@ -1,113 +0,0 @@
# Set the source file for langcomp to use C++ as well as set it's compile flags
set_source_files_properties(langcomp.c PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
# Generate langcomp and set it's linker flags
add_executable(langcomp langcomp.c)
set_target_properties(langcomp PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
# Get the location of the binary to use later
get_target_property(langcomp_BINARY langcomp LOCATION)
# Add the executable to the list of files for CPack to ignore
file(RELATIVE_PATH langcomp_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langcomp_BINARY})
add_to_cpack_ignored_files("${langcomp_BINARY_RELATIVE}$" TRUE)
# Determine if langtool should be built
if(MSVC)
set(BUILD_LANGTOOL TRUE)
else(MSVC)
if(NOT GREP OR NOT PERL)
set(BUILD_LANGTOOL TRUE)
else(NOT GREP OR NOT PERL)
set(BUILD_LANGTOOL FALSE)
endif(NOT GREP OR NOT PERL)
endif(MSVC)
# If grep or perl don't exist on the system, build langtool to generate index and language.h
if(BUILD_LANGTOOL)
# Set the source file for langtool to use C++ as well as set it's compile flags
set_source_files_properties(langtool.c PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
# Generate langtool and set it's linker flags
add_executable(langtool langtool.c)
set_target_properties(langtool PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
# Get the location of the binary to use later)
get_target_property(langtool_BINARY langtool LOCATION)
# Add the executable to the list of files for CPack to ignore
file(RELATIVE_PATH langtool_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langtool_BINARY})
add_to_cpack_ignored_files("${langtool_BINARY_RELATIVE}$" TRUE)
endif(BUILD_LANGTOOL)
# If grep exists (and we aren't using Visual Studio, it hates this), use it to generate the index file
if(NOT MSVC AND GREP)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/index
COMMAND ${GREP} '^[A-Z]' ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l > ${CMAKE_CURRENT_BINARY_DIR}/index
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l
)
# Otherwise, use langtool to generate the index file
else(NOT MSVC AND GREP)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/index
COMMAND ${langtool_BINARY} index ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l ${CMAKE_CURRENT_BINARY_DIR}/index
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l DEPENDS langtool
)
endif(NOT MSVC AND GREP)
# Add the index file to the list of files for CPack to ignore
file(RELATIVE_PATH index_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/index)
add_to_cpack_ignored_files("${index_RELATIVE}$")
# Find all the *.l files within the current source directory, and sort the list
file(GLOB LANG_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.l")
sort_list(LANG_SRCS)
# Iterate through the language files
foreach(LANG_L ${LANG_SRCS})
# Convert the language file's extension to have no extension
STRING(REGEX REPLACE "\\.l$" "" LANG ${LANG_L})
# Add the language file to the list of compiled language files
append_to_list(LANGS ${CMAKE_CURRENT_BINARY_DIR}/${LANG})
# Generate a compiled language file using langcomp, as well as having a dependency on the index file being generated
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${LANG}
COMMAND ${langcomp_BINARY} ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_L} ${CMAKE_CURRENT_BINARY_DIR}/${LANG}
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_L} DEPENDS langcomp ${CMAKE_CURRENT_BINARY_DIR}/index
)
# Add the language file to the list of files for CPack to ignore
file(RELATIVE_PATH LANG_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${LANG})
add_to_cpack_ignored_files("${LANG_RELATIVE}$")
endforeach(LANG_L)
# If perl exists (and we aren't using Visual Studio, it hates this), use it to generate language.h
if(NOT MSVC AND PERL)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/language.h
COMMAND ${PERL} -e < ${CMAKE_CURRENT_BINARY_DIR}/index > ${CMAKE_CURRENT_BINARY_DIR}/language.h 'print STDERR \"Generating language.h... \"\; $$i=0\; while \(<>\) { chop\; printf \"\#define %-32s %d\\n\", $$_, $$i++\; } print \"\\n\#define NUM_STRINGS $$i\\n\"\; print STDERR \"$$i strings\\n\"\;'
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/index
)
# Otherwise, use langtool to generate language.h
else(NOT MSVC AND PERL)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/language.h
COMMAND ${langtool_BINARY} language.h ${CMAKE_CURRENT_BINARY_DIR}/index ${CMAKE_CURRENT_BINARY_DIR}/language.h
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/index DEPENDS langtool
)
endif(NOT MSVC AND PERL)
# Add language.h to the list of files for CPack to ignore
add_to_cpack_ignored_files("language.h$" TRUE)
# Add a custom target to depend on the language files and language.h
add_custom_target(language DEPENDS ${LANGS} ${CMAKE_CURRENT_BINARY_DIR}/language.h)
# If RUNGROUP was set, make the permissions be to have owner read/write as well as group read/write
if(RUNGROUP)
set(PERMS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
# Otherwise, only make the permissions be owner read/write
else(RUNGROUP)
set(PERMS OWNER_READ OWNER_WRITE)
endif(RUNGROUP)
# Set the language files to be installed to the languages directory under the data directory
install(FILES ${LANGS}
DESTINATION data/languages
PERMISSIONS ${PERMS}
)
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the languages directory
if(NOT WIN32)
if(RUNGROUP)
install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"\${CMAKE_INSTALL_PREFIX}/data/languages\")")
else(RUNGROUP)
install(CODE "execute_process(COMMAND ${CHMOD} 0700 \"\${CMAKE_INSTALL_PREFIX}/data/languages\")")
endif(RUNGROUP)
endif(NOT WIN32)
+33 -33
View File
@@ -1,10 +1,10 @@
# Makefile for language module
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'LDFLAGS=${LDFLAGS}' 'BINDEST=${BINDEST}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' 'MAKEBIN=${MAKEBIN}'
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \
'RUNGROUP=${RUNGROUP}' 'USE_MODULES=${USE_MODULES}'
LANGOBJS = cat de en_us es fr gr hun it nl pl pt ru tr
LANGSRCS = cat.l de.l en_us.l es.l fr.l gr.l hun.l it.l nl.l pl.l pt.l ru.l tr.l
@@ -18,24 +18,24 @@ all: $(LANGOBJS)
distclean: clean spotless
install: all
test -d $(INSTDIR)/data/languages || mkdir $(INSTDIR)/data/languages
test -d $(DATDEST)/languages || mkdir $(DATDEST)/languages
@if [ "$(RUNGROUP)" ] ; then \
echo chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
echo chmod -R g+rw $(INSTDIR)/data/languages ; \
chmod -R g+rw $(INSTDIR)/data/languages ; \
$(CP) $(LANGOBJS) $(INSTDIR)/data/languages ; \
echo chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages/* ; \
echo chmod -R g+rw $(INSTDIR)/data/languages/* ; \
chmod -R g+rw $(INSTDIR)/data/languages/* ; \
echo chgrp -R $(RUNGROUP) $(DATDEST)/languages ; \
chgrp -R $(RUNGROUP) $(DATDEST)/languages ; \
echo chmod -R g+rw $(DATDEST)/languages ; \
chmod -R g+rw $(DATDEST)/languages ; \
$(CP) $(LANGOBJS) $(DATDEST)/languages ; \
echo chgrp -R $(RUNGROUP) $(DATDEST)/languages ; \
chgrp -R $(RUNGROUP) $(DATDEST)/languages/* ; \
echo chmod -R g+rw $(DATDEST)/languages/* ; \
chmod -R g+rw $(DATDEST)/languages/* ; \
fi
@if [ ! "$(RUNGROUP)" ] ; then \
chmod 700 $(INSTDIR)/data/languages/ ; \
$(CP) $(LANGOBJS) $(INSTDIR)/data/languages ; \
chmod 600 $(INSTDIR)/data/languages/* ; \
chmod 700 $(DATDEST)/languages/ ; \
$(CP) $(LANGOBJS) $(DATDEST)/languages ; \
chmod 600 $(DATDEST)/languages/* ; \
fi
clean:
rm -f $(LANGOBJS) langcomp language.h
@@ -44,39 +44,39 @@ spotless: clean
cat: cat.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
de: de.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
en_us: en_us.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
es: es.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
fr: fr.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
gr: gr.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
hun: hun.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
it: it.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
nl: nl.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
pl: pl.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
pt: pt.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
ru: ru.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
tr: tr.l langcomp index
@./langcomp $@.l $@
./langcomp $@.l
langcomp: langcomp.c
$(MAKEBIN) $(CC) $(CFLAGS) langcomp.c -o $@
$(CC) $(CFLAGS) langcomp.c -o $@
language.h: index Makefile
@perl -e <index >$@ 'print STDERR "Generating language.h... "; $$i=0; while (<>) { chop; printf "#define %-32s %d\n", $$_, $$i++; } print "\n#define NUM_STRINGS $$i\n"; print STDERR "$$i strings\n";'
@cp language.h ../include
cp language.h ../include
index: en_us.l
@grep '^[A-Z]' en_us.l >index
grep '^[A-Z]' en_us.l >index
+75
View File
@@ -0,0 +1,75 @@
# Makefile for language module
include ../Makefile.inc.win32
LANGOBJS = cat de en_us es fr hun gr nl pl pt tr it ru
LANGSRCS = cat de en_us.l es fr.l hun.l gr.l nl.l pl.l pt.l tr.l it.l ru.l
LANGCOMP = ./langcomp
#LANGCOMP = ./langcomp -w
all: $(LANGOBJS)
install: all
-copy cat ..\$(DATDEST)\languages
-copy en_us ..\$(DATDEST)\languages
-copy de ..\$(DATDEST)\languages
-copy es ..\$(DATDEST)\languages
-copy fr ..\$(DATDEST)\languages
-copy hun ..\$(DATDEST)\languages
-copy gr ..\$(DATDEST)\languages
-copy nl ..\$(DATDEST)\languages
-copy pl ..\$(DATDEST)\languages
-copy pt ..\$(DATDEST)\languages
-copy tr ..\$(DATDEST)\languages
-copy it ..\$(DATDEST)\languages
-copy ru ..\$(DATDEST)\languages
clean:
-@erase $(LANGOBJS) langcomp.exe langtool.exe *.obj index
spotless: clean
-@erase language.h
cat: cat.l langtool.exe langcomp.exe index
langcomp $@.l
de: de.l langtool.exe langcomp.exe index
langcomp $@.l
en_us: en_us.l langtool.exe langcomp.exe index
langcomp $@.l
es: es.l langtool.exe langcomp.exe index
langcomp $@.l
fr: fr.l langtool.exe langcomp.exe index
langcomp $@.l
hun: hun.l langtool.exe langcomp.exe index
langcomp $@.l
gr: gr.l langtool.exe langcomp.exe index
langcomp $@.l
nl: nl.l langtool.exe langcomp.exe index
langcomp $@.l
pl: pl.l langtool.exe langcomp.exe index
langcomp $@.l
pt: pt.l langtool.exe langcomp.exe index
langcomp $@.l
tr: tr.l langtool.exe langcomp.exe index
langcomp $@.l
it: it.l langtool.exe langcomp.exe index
langcomp $@.l
ru: ru.l langtool.exe langcomp.exe index
langcomp $@.l
langtool.exe: langtool.c
$(CC) $(CFLAGS) langtool.c -o $@ /link $(LFLAGS)
langcomp.exe: langcomp.c
$(CC) $(CFLAGS) langcomp.c -o $@ /link $(LFLAGS)
language.h: langtool.exe index
langtool language.h
index: langtool.exe en_us.l
langtool index
+597 -351
View File
File diff suppressed because it is too large Load Diff
+634 -415
View File
File diff suppressed because it is too large Load Diff
+522 -341
View File
File diff suppressed because it is too large Load Diff
+592 -347
View File
File diff suppressed because it is too large Load Diff
+2838 -2739
View File
File diff suppressed because it is too large Load Diff
+637 -387
View File
File diff suppressed because it is too large Load Diff
+585 -342
View File
File diff suppressed because it is too large Load Diff
+716 -389
View File
File diff suppressed because it is too large Load Diff
+161 -150
View File
@@ -7,7 +7,7 @@
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
*
* $Id$
*
*/
@@ -66,36 +66,36 @@ char *anopeStrDup(const char *src);
int read_index_file()
{
FILE *f;
char buf[256];
int i;
FILE *f;
char buf[256];
int i;
if (!(f = fopen("index", "rb"))) {
perror("fopen(index)");
return -1;
if (!(f = fopen("index", "rb"))) {
perror("fopen(index)");
return -1;
}
while (fgets(buf, sizeof(buf), f))
numstrings++;
if (!(stringnames = calloc(sizeof(char *), numstrings))) {
perror("calloc(stringnames)");
return -1;
}
if (!(strings = calloc(sizeof(char *), numstrings))) {
perror("calloc(strings)");
return -1;
}
fseek(f, 0, SEEK_SET);
i = 0;
while (fgets(buf, sizeof(buf), f)) {
if (buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = '\0';
if (!(stringnames[i++] = anopeStrDup(buf))) {
perror("strdup()");
return -1;
}
while (fgets(buf, sizeof(buf), f))
numstrings++;
if (!(stringnames = static_cast<char **>(calloc(sizeof(char *), numstrings)))) {
perror("calloc(stringnames)");
return -1;
}
if (!(strings = static_cast<char **>(calloc(sizeof(char *), numstrings)))) {
perror("calloc(strings)");
return -1;
}
fseek(f, 0, SEEK_SET);
i = 0;
while (fgets(buf, sizeof(buf), f)) {
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) -1] = '\0';
if (!(stringnames[i++] = anopeStrDup(buf))) {
perror("strdup()");
return -1;
}
}
fclose(f);
return 0;
}
fclose(f);
return 0;
}
/*************************************************************************/
@@ -104,13 +104,13 @@ int read_index_file()
int stringnum(const char *name)
{
int i;
int i;
for (i = 0; i < numstrings; i++) {
if (strcmp(stringnames[i], name) == 0)
return i;
}
return -1;
for (i = 0; i < numstrings; i++) {
if (strcmp(stringnames[i], name) == 0)
return i;
}
return -1;
}
/*************************************************************************/
@@ -120,18 +120,18 @@ int stringnum(const char *name)
char *ano_getline(FILE *f)
{
static char buf[1024];
char *s;
static char buf[1024];
char *s;
do {
if (!(fgets(buf, sizeof(buf), f)))
return NULL;
linenum++;
} while (*buf == '#' || *buf == '\n');
s = buf + strlen(buf) - 1;
if (*s == '\n')
*s = '\0';
return buf;
do {
if (!(fgets(buf, sizeof(buf), f)))
return NULL;
linenum++;
} while (*buf == '#' || *buf == '\n');
s = buf + strlen(buf)-1;
if (*s == '\n')
*s = '\0';
return buf;
}
/*************************************************************************/
@@ -140,125 +140,136 @@ char *ano_getline(FILE *f)
int fput32(int val, FILE *f)
{
if (fputc(val >> 24, f) < 0 ||
fputc(val >> 16, f) < 0 ||
fputc(val >> 8, f) < 0 ||
fputc(val, f) < 0
) {
return -1;
} else {
return 0;
}
if (fputc(val>>24, f) < 0 ||
fputc(val>>16, f) < 0 ||
fputc(val>> 8, f) < 0 ||
fputc(val , f) < 0
) {
return -1;
} else {
return 0;
}
}
/*************************************************************************/
char *anopeStrDup(const char *src)
{
char *ret=NULL;
if (src) {
if ((ret = static_cast<char *>(malloc(strlen(src) + 1)))) {
strcpy(ret,src);
}
}
return ret;
char *anopeStrDup(const char *src) {
char *ret=NULL;
if(src) {
if( (ret = (char *)malloc(strlen(src)+1)) ) {;
strcpy(ret,src);
}
}
return ret;
}
/*************************************************************************/
int main(int ac, char **av)
{
char *filename = NULL, *outfile;
FILE *in, *out;
int warn = 0;
int retval = 0;
int curstring = -2, i;
char *line;
int pos;
int maxerr = 50; /* Max errors before we bail out */
char *filename = NULL, *s;
char langname[254], outfile[256];
FILE *in, *out;
int warn = 0;
int retval = 0;
int curstring = -2, i;
char *line;
int pos;
int maxerr = 50; /* Max errors before we bail out */
if (ac >= 3 && strcmp(av[1], "-w") == 0) {
warn = 1;
av[1] = av[2];
av[2] = av[3];
ac--;
}
if (ac != 3) {
fprintf(stderr, "Usage: %s [-w] <lang-file> <out-file>\n", av[0]);
return 1;
}
filename = av[1];
outfile = av[2];
if (ac >= 2 && strcmp(av[1], "-w") == 0) {
warn = 1;
av[1] = av[2];
ac--;
}
if (ac != 2) {
fprintf(stderr, "Usage: %s [-w] <lang-file>\n", av[0]);
return 1;
}
filename = av[1];
s = strrchr(filename, '.');
if (!s)
s = filename + strlen(filename);
if (s-filename > sizeof(langname)-3)
s = filename + sizeof(langname)-1;
strncpy(langname, filename, s-filename);
langname[s-filename] = '\0';
snprintf(outfile, sizeof(outfile), "%s", langname);
if (read_index_file() < 0)
return 1;
if (!(in = fopen(filename, "rb"))) {
perror(filename);
return 1;
}
if (!(out = fopen(outfile, "wb"))) {
perror(outfile);
return 1;
}
if (read_index_file() < 0)
return 1;
if (!(in = fopen(filename, "rb"))) {
perror(filename);
return 1;
}
if (!(out = fopen(outfile, "wb"))) {
perror(outfile);
return 1;
}
while (maxerr > 0 && (line = ano_getline(in)) != NULL) {
if (*line == '\t') {
if (curstring == -2) {
fprintf(stderr, "%s:%d: Junk at beginning of file\n", filename, linenum);
retval = 1;
} else if (curstring >= 0) {
line++;
i = strings[curstring] ? strlen(strings[curstring]) : 0;
if (!(strings[curstring] = static_cast<char *>(realloc(strings[curstring], i + strlen(line) + 2)))) {
fprintf(stderr, "%s:%d: Out of memory!\n", filename, linenum);
return 2;
}
snprintf(strings[curstring] + i, strlen(line) + 2, "%s\n", line);
}
} else {
if ((curstring = stringnum(line)) < 0) {
fprintf(stderr, "%s:%d: Unknown string name `%s'\n", filename, linenum, line);
retval = 1;
maxerr--;
} else if (strings[curstring]) {
fprintf(stderr, "%s:%d: Duplicate occurrence of string `%s'\n", filename, linenum, line);
retval = 1;
maxerr--;
} else {
if (!(strings[curstring] = static_cast<char *>(malloc(1)))) {
fprintf(stderr, "%s:%d: Out of memory!\n", filename, linenum);
return 2;
}
*strings[curstring] = '\0';
}
if (maxerr == 0)
fprintf(stderr, "%s:%d: Too many errors!\n", filename, linenum);
while (maxerr > 0 && (line = ano_getline(in)) != NULL) {
if (*line == '\t') {
if (curstring == -2) {
fprintf(stderr, "%s:%d: Junk at beginning of file\n",
filename, linenum);
retval = 1;
} else if (curstring >= 0) {
line++;
i = strings[curstring] ? strlen(strings[curstring]) : 0;
if (!(strings[curstring] =
realloc(strings[curstring], i+strlen(line)+2))) {
fprintf(stderr, "%s:%d: Out of memory!\n",filename,linenum);
return 2;
}
}
sprintf(strings[curstring]+i, "%s\n", line);
}
} else {
fput32(numstrings, out);
pos = numstrings * 8 + 4;
for (i = 0; i < numstrings; i++) {
int len = strings[i] && *strings[i] ? strlen(strings[i]) - 1 : 0;
fput32(pos, out);
fput32(len, out);
pos += len;
}
for (i = 0; i < numstrings; i++) {
if (strings[i]) {
if (*strings[i])
strings[i][strlen(strings[i])-1] = '\0'; /* kill last \n */
if (*strings[i])
fputs(strings[i], out);
} else if (warn) {
fprintf(stderr, "%s: String `%s' missing\n", filename, stringnames[i]);
if ((curstring = stringnum(line)) < 0) {
fprintf(stderr, "%s:%d: Unknown string name `%s'\n",
filename, linenum, line);
retval = 1;
maxerr--;
} else if (strings[curstring]) {
fprintf(stderr, "%s:%d: Duplicate occurrence of string `%s'\n",
filename, linenum, line);
retval = 1;
maxerr--;
} else {
if (!(strings[curstring] = malloc(1))) {
fprintf(stderr, "%s:%d: Out of memory!\n",filename,linenum);
return 2;
}
}
*strings[curstring] = '\0';
}
fclose(in);
fclose(out);
return retval;
if (maxerr == 0)
fprintf(stderr, "%s:%d: Too many errors!\n", filename, linenum);
}
}
fput32(numstrings, out);
pos = numstrings * 8 + 4;
for (i = 0; i < numstrings; i++) {
int len = strings[i] && *strings[i] ? strlen(strings[i])-1 : 0;
fput32(pos, out);
fput32(len, out);
pos += len;
}
for (i = 0; i < numstrings; i++) {
if (strings[i]) {
if (*strings[i])
strings[i][strlen(strings[i])-1] = '\0'; /* kill last \n */
if (*strings[i])
fputs(strings[i], out);
} else if (warn) {
fprintf(stderr, "%s: String `%s' missing\n", filename,
stringnames[i]);
}
}
fclose(in);
fclose(out);
return retval;
}
/*************************************************************************/
+11 -13
View File
@@ -6,16 +6,14 @@
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* Based on the original code of Services by Andy Church.
*
* Written by Dominick Meglio <codemastr@unrealircd.com>
*
*/
#include <string.h>
#include <stdio.h>
#include <cstdlib>
#include <cctype>
char *strip(char *str)
{
@@ -29,14 +27,14 @@ char *strip(char *str)
int main(int argc, char *argv[])
{
if (argc < 4)
if (argc < 2)
exit(1);
/* Build the index file */
if (!strcmp(argv[1], "index"))
{
FILE *fd = fopen(argv[2], "rb");
FILE *fdout = fopen(argv[3], "wb");
FILE *fd = fopen("en_us.l", "rb");
FILE *fdout = fopen("index", "wb");
char buf[1024];
if (!fd || !fdout)
exit(2);
@@ -52,19 +50,19 @@ int main(int argc, char *argv[])
/* Build the language.h file */
else if (!strcmp(argv[1], "language.h"))
{
FILE *fd = fopen(argv[2], "r");
FILE *fdout = fopen(argv[3], "w");
FILE *fd = fopen("index", "r");
FILE *fdout = fopen("language.h", "w");
char buf[1024];
int i = 0;
int i = 0;
if (!fd || !fdout)
exit(2);
fprintf(stderr, "Generating language.h... ");
while (fgets(buf, 1023, fd)) {
while (fgets(buf, 1023, fd)) {
fprintf(fdout, "#define %-32s %d\n", strip(buf), i++);
}
}
fprintf(fdout, "#define NUM_STRINGS %d\n", i);
fprintf(stderr, "%d strings\n", i);
@@ -72,5 +70,5 @@ int main(int argc, char *argv[])
fclose(fdout);
}
return 0;
}
+565 -367
View File
File diff suppressed because it is too large Load Diff
+599 -327
View File
File diff suppressed because it is too large Load Diff
+648 -331
View File
File diff suppressed because it is too large Load Diff
+542 -339
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More