mirror of
https://github.com/anope/anope.git
synced 2026-06-12 18:54:47 +02:00
Compare commits
1618 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c02961b60 | |||
| 268d529078 | |||
| 4bc4b98ac7 | |||
| e8b42607e6 | |||
| e792865a04 | |||
| 2b5a1d8c8f | |||
| 7cf21342f4 | |||
| ba8a646a33 | |||
| fa50252c77 | |||
| 46bb2de866 | |||
| c2e9b8080b | |||
| c0cd76a0a5 | |||
| ab6cd3b26c | |||
| 275f2fd374 | |||
| c4d4107412 | |||
| ae5da11389 | |||
| e6544a06f4 | |||
| 1ab7d53649 | |||
| d709c819d2 | |||
| 2ad4a8667f | |||
| 6ff83c3407 | |||
| adbc5a0e65 | |||
| f9a4a0fbef | |||
| a282a5c9c4 | |||
| 3ddfa2fc1d | |||
| 50f430fb23 | |||
| 1b4d62e2bc | |||
| 43f608ff2b | |||
| f0313a45cb | |||
| 96af354ad5 | |||
| b5966cf99e | |||
| faab2c6793 | |||
| c6f85b9312 | |||
| 5e4d52ad47 | |||
| 6628e714c7 | |||
| 0f9e931fa6 | |||
| 1f6385c095 | |||
| be044c9d6e | |||
| 90aa576fb3 | |||
| 77e5744341 | |||
| e1264a5913 | |||
| 18f423226c | |||
| c967a4ce88 | |||
| 1542937d64 | |||
| 3b8f1cd59f | |||
| fbbdedf17e | |||
| b75faefea4 | |||
| 676db0ba6f | |||
| b2802d0beb | |||
| 826ae9b6c0 | |||
| 2c3e8a76c9 | |||
| 0bb23f3f4d | |||
| b36498149d | |||
| f6cf978d0c | |||
| aeebaed4b2 | |||
| faabff0261 | |||
| cba811bc6b | |||
| dcae3d7bda | |||
| fc69b68891 | |||
| 15e527fa70 | |||
| 3ccf26fda4 | |||
| c0b0ee1b39 | |||
| b353e1db79 | |||
| 3edce88698 | |||
| 9e1fb11f93 | |||
| 316c280a57 | |||
| cc2a999b4e | |||
| 51a9f64adb | |||
| 332fd23927 | |||
| 1aca2922af | |||
| b65fd34a39 | |||
| c9f4c2db1f | |||
| d1248d1249 | |||
| afc5c91a09 | |||
| aa6c3f3474 | |||
| 2a35151d12 | |||
| fa7cee9759 | |||
| 431b2e6768 | |||
| 853e926920 | |||
| 8267407a78 | |||
| a831e5d306 | |||
| b901dfee84 | |||
| 6e8d2bf09d | |||
| 70e9b20274 | |||
| 4ee9021adb | |||
| c8db362bca | |||
| c710625cd3 | |||
| ac2f8bf64d | |||
| 04e7fa493a | |||
| f7692ec77f | |||
| 4a1d32c5fd | |||
| 498da95205 | |||
| 710d4848bd | |||
| bd3bed2118 | |||
| fe31b0a666 | |||
| 1f97d6d879 | |||
| 4bd5649105 | |||
| b5af310f8a | |||
| 2cfc97053f | |||
| 6cde65a57f | |||
| 7cb35eeedf | |||
| f0318fdbe8 | |||
| 93a83da771 | |||
| 0ff1bb9d5b | |||
| c0dea5ef30 | |||
| fd4ac7f6fc | |||
| e635f547d6 | |||
| 7167cff703 | |||
| b844154857 | |||
| 5e56dfdb1a | |||
| e1d460e211 | |||
| 9ea6fb25b9 | |||
| 7755668679 | |||
| 569efbb66b | |||
| 696801430b | |||
| 1b08ba8f41 | |||
| 277f735505 | |||
| f63a2bdfb4 | |||
| feb412bdb1 | |||
| ab856683c7 | |||
| 97d7c21193 | |||
| e5b8435769 | |||
| e589080827 | |||
| 257b10ee91 | |||
| 353ee5cc93 | |||
| b094132c9d | |||
| 82006b868f | |||
| ba5a3f5f00 | |||
| 7b6c08b53a | |||
| 47b692f9ae | |||
| ed06609ae1 | |||
| 32a57150ec | |||
| 2a5e8f1890 | |||
| a04c320b4b | |||
| 4221a507cc | |||
| 44dd8d07d9 | |||
| f7aa69b596 | |||
| d5ecc39104 | |||
| 84a02d2709 | |||
| 4b059beb24 | |||
| b319fb089c | |||
| 17196887ad | |||
| 02d67f682a | |||
| b306108740 | |||
| 12a0311aaa | |||
| cf653fc084 | |||
| 5cc7fc0387 | |||
| 832bc35135 | |||
| 06c5914820 | |||
| bf67b9ee5c | |||
| 829c169063 | |||
| 4948120b69 | |||
| 994471f5a7 | |||
| 80c02740d0 | |||
| df3c0b7b52 | |||
| 45702992ac | |||
| 9756f96b85 | |||
| 6ac0364f74 | |||
| 4f820a7d41 | |||
| 5f7127dd92 | |||
| dcb3ff7d34 | |||
| 1107b92699 | |||
| 3b0b1bc80e | |||
| b60b23fd48 | |||
| 5aac6377c2 | |||
| 20856fb59c | |||
| 7545763cd4 | |||
| 1818b19eba | |||
| abc7e4b423 | |||
| e5ece18ee7 | |||
| 8641b995c4 | |||
| b880240d72 | |||
| 5ce90ba7d1 | |||
| 98bae827e1 | |||
| e3c05efe5e | |||
| 8cbaf7e990 | |||
| 339f41aebc | |||
| 55e4ef9d3a | |||
| f63e4ceebe | |||
| b005089f2f | |||
| 1b42e26642 | |||
| 4691351167 | |||
| 404debf789 | |||
| 752a5ca1b7 | |||
| e1a1cf0e6f | |||
| 3fabc2f831 | |||
| 59ea36c831 | |||
| fac880664c | |||
| 7f890ce98d | |||
| 50e1a3e96c | |||
| 6b79349e6c | |||
| 678f54903d | |||
| 714a4a3004 | |||
| 34826f71c7 | |||
| 847cceaba3 | |||
| 09046e3c99 | |||
| 00a19529c3 | |||
| 446b3a910d | |||
| 76f5d4b316 | |||
| 9b59925144 | |||
| 243d781e99 | |||
| 8be5f53f1f | |||
| cd49bb40c2 | |||
| ef3d115bae | |||
| 9f1178ec58 | |||
| 3bc2db561b | |||
| fad603e7a4 | |||
| 5f006bf139 | |||
| aaa12cc018 | |||
| 2238db8338 | |||
| 4d1492d444 | |||
| 5c4414e4a5 | |||
| 6f9b77e336 | |||
| 154fa25e8f | |||
| 9793062007 | |||
| f86dc247e5 | |||
| 2b1f75a313 | |||
| 5ac0c9a327 | |||
| e8763d5b3c | |||
| ce7a32a994 | |||
| 0c1cc08e28 | |||
| e12e4e6956 | |||
| 52535cf6fb | |||
| 121d0a6e5b | |||
| 34535814e4 | |||
| 8bcc6840ce | |||
| 08d113332c | |||
| 765943062e | |||
| 17cca42d48 | |||
| 760fdc4049 | |||
| ead4aa7ed9 | |||
| 65911dd1be | |||
| 4abfdcbb9c | |||
| de5c8c0d38 | |||
| 8e011bbb78 | |||
| f15a9749f9 | |||
| f1956b039d | |||
| 53d5b7c29e | |||
| 812cb04fde | |||
| 1314d5b4f1 | |||
| 490601de3a | |||
| c7aab50bff | |||
| c507c78d5a | |||
| 58c05687bf | |||
| f8cdcc65c6 | |||
| 10a918f9e1 | |||
| e4d1769a8b | |||
| 7cd80a2131 | |||
| 9d6f88de39 | |||
| b93d650b1f | |||
| c480695369 | |||
| 7f1b5552dc | |||
| 4865a8cfff | |||
| 1efd289488 | |||
| 83e4b183ea | |||
| 1e625b6837 | |||
| 402c624e45 | |||
| fde83f6564 | |||
| f0f43cf426 | |||
| 3dc64bac4d | |||
| 2450a64bf4 | |||
| b48293a632 | |||
| e908dc0dc7 | |||
| 378c9203df | |||
| 779f3788c9 | |||
| 604da89813 | |||
| e11abdc4f0 | |||
| 5aac04dffe | |||
| 7480fbda2b | |||
| 9629ccb374 | |||
| cb70d976ba | |||
| 6db0186947 | |||
| 492eac20a8 | |||
| c8511a625d | |||
| f6b915a169 | |||
| 02c1724d75 | |||
| 7e87bb69fc | |||
| aae522d72b | |||
| 0a821640bb | |||
| 37733dea65 | |||
| eabb9c0c11 | |||
| b103d16eb1 | |||
| e3b6ae3649 | |||
| 0ff48e1538 | |||
| 53038d83bf | |||
| 2ea594d677 | |||
| e957c7b2d2 | |||
| 9a4f27e0a3 | |||
| fccc4a4fa6 | |||
| 4325073524 | |||
| 55199f0a4c | |||
| 7edc76f7fb | |||
| 3fbdde5e18 | |||
| 9f8b4ac382 | |||
| 998925c90a | |||
| 7f971043bc | |||
| c2e1a8a3e2 | |||
| c62b3cb275 | |||
| 1a3d9a016d | |||
| 518182ac92 | |||
| 7d0e063300 | |||
| 5e36d848d5 | |||
| fee461f3d0 | |||
| 1773eef143 | |||
| 7704ee7107 | |||
| 5ac1e9175d | |||
| 5695c9e079 | |||
| f92b0d6ea0 | |||
| fc527b464a | |||
| a93b315bd3 | |||
| 5246424dc0 | |||
| 1316147a8c | |||
| 70319ab8be | |||
| 7dd358972a | |||
| d463ae3b1e | |||
| ebda113f44 | |||
| 6ab6eca0a6 | |||
| b1ba1ec8ac | |||
| 9956da18e3 | |||
| b56e71ab14 | |||
| 6f45d72497 | |||
| f5c01bf617 | |||
| 06bad31b18 | |||
| 576aaff3da | |||
| c5bc8fab32 | |||
| f6e2ebe145 | |||
| 37b3535543 | |||
| c21e8d9204 | |||
| 22658d63bd | |||
| f2dee1e1d6 | |||
| 968ef349d6 | |||
| d6640ed5ee | |||
| aabc217a6b | |||
| d82391e46d | |||
| 7aa02864d2 | |||
| 2a8202c832 | |||
| be4a39ceb6 | |||
| a3dc75c61c | |||
| 14dc142a92 | |||
| 51b7d53108 | |||
| 3253455792 | |||
| 879b310580 | |||
| 5ff3aa7209 | |||
| ca93122a68 | |||
| 2428264315 | |||
| cc4a14b0ba | |||
| 934b584374 | |||
| 4237d49d41 | |||
| 1c36de5ab1 | |||
| da948be089 | |||
| 9384a4f088 | |||
| 4d62c673fa | |||
| 7426b3b04a | |||
| 735e234c2c | |||
| 735f0ba6cf | |||
| 9ee7c825e1 | |||
| 912103ec13 | |||
| f843e7bd90 | |||
| d7e2ab688b | |||
| 5e7085130e | |||
| 9b07e163c0 | |||
| 6859decfb8 | |||
| e23baf4297 | |||
| c7f77b3b66 | |||
| 6578829fa6 | |||
| ef06226521 | |||
| 4c669b947f | |||
| 3fbb493d57 | |||
| 223aa65cfa | |||
| fe54dfb37f | |||
| 3f5f84c92c | |||
| 5b3f81ea78 | |||
| 3e8752fe66 | |||
| 57c2b65f08 | |||
| a118946e65 | |||
| ee2dcf11b8 | |||
| e91de41278 | |||
| 10b5b00db4 | |||
| 2044b4d3ad | |||
| 1d0bb9b26b | |||
| 781defb707 | |||
| 16c124d34e | |||
| f08dbced60 | |||
| baabc91ead | |||
| 81483ae5e7 | |||
| 003140bf60 | |||
| b405484fb9 | |||
| 9a45626379 | |||
| 10d10d057e | |||
| aa2844a3fc | |||
| 42c640a9b5 | |||
| 066fc5801b | |||
| 416eaa1e66 | |||
| ac19a5c24b | |||
| 6f9dd282d2 | |||
| c56d72ba84 | |||
| db4ed1cfaf | |||
| cb64d806c1 | |||
| 4f9b7874d6 | |||
| 207c46c871 | |||
| 957cb2bf93 | |||
| b244c74479 | |||
| b76b2e11c8 | |||
| b35665bb54 | |||
| c3eb5b885d | |||
| 6faf4e3823 | |||
| 325b018ed0 | |||
| 0a3d27a91f | |||
| bcd85ca682 | |||
| ac40c53fe4 | |||
| 2eae82da5c | |||
| 72493b7305 | |||
| 1a37e1c048 | |||
| fb7fef7a84 | |||
| 36602224b8 | |||
| ccecfdf445 | |||
| 32d1184c00 | |||
| 6a46a08a85 | |||
| 7a2e6aa5c2 | |||
| 34b5f9ce6e | |||
| f77eb0a282 | |||
| 302a409136 | |||
| 0b3b9fe128 | |||
| f71c7865fc | |||
| 4ecf20b3f5 | |||
| a5b8788014 | |||
| 3cc7950c4b | |||
| 854bc4db0c | |||
| dbc77279bf | |||
| c4ef566a65 | |||
| 66376335ab | |||
| 823bc01f66 | |||
| 947ad6f73a | |||
| 06c8a1ef50 | |||
| b3fd861b3e | |||
| 62262f4b0d | |||
| 6e0dc0e210 | |||
| 7e7556f064 | |||
| 111d6a9178 | |||
| d23817604c | |||
| 4694c7afb4 | |||
| a52293336f | |||
| f24e17f8b4 | |||
| 2b208de02f | |||
| 4eb5d153c0 | |||
| 0451dd3d0d | |||
| c3e4f1bf7e | |||
| f122f104c4 | |||
| deedb3bdd7 | |||
| d27aa03500 | |||
| dcffa5da6f | |||
| 221e79f50d | |||
| d5a453b663 | |||
| a2d69fa431 | |||
| 6a0e4418f4 | |||
| 68eeac67c9 | |||
| 731912f01e | |||
| 51963915ba | |||
| 810685cb73 | |||
| 1a0e6b0be3 | |||
| 81c89bb708 | |||
| 01620e849a | |||
| 4c74020a69 | |||
| b95b8f0aae | |||
| 1ff7a7c1f1 | |||
| 1d16629a6d | |||
| 72aa27ede5 | |||
| 05223dbe6d | |||
| 06d43baf93 | |||
| 5f74662100 | |||
| 2c68312d72 | |||
| ce094f4d01 | |||
| 178056096f | |||
| a32c897bf9 | |||
| 367b662c83 | |||
| 75999e05b9 | |||
| 45c02f8e4e | |||
| ae4421b8a2 | |||
| 2d309da0f6 | |||
| b9bbb3747b | |||
| 0b05eaa020 | |||
| 91ad9d22ca | |||
| 6aa9ad938a | |||
| 6808498ead | |||
| 8561941e22 | |||
| 5d4db2b854 | |||
| 501503b7a5 | |||
| a980e32581 | |||
| da2fea338a | |||
| 7cb70f5fa1 | |||
| d04db3d38b | |||
| 35c260877f | |||
| 8cf7ec9cfe | |||
| c67087d750 | |||
| 2336b4723c | |||
| da61734860 | |||
| a911354f24 | |||
| ae902443db | |||
| 5547c3ed24 | |||
| e844cdf4f6 | |||
| 2fa5cfa508 | |||
| 59792173e7 | |||
| ed68482b4e | |||
| 32592987c8 | |||
| a1f92638e3 | |||
| 7d50818ee1 | |||
| d0e1f3b66a | |||
| cb91f991a3 | |||
| a49d7b12cb | |||
| eda7b55bac | |||
| bcf99d5998 | |||
| 3ab6706993 | |||
| c40e9c3996 | |||
| 7be23b7e37 | |||
| d9c18a6072 | |||
| 73099b82e8 | |||
| fc1d7ea89b | |||
| 391f2822c8 | |||
| f0875c5d85 | |||
| f6ef706909 | |||
| 7656c25e38 | |||
| 5cf1edeb6e | |||
| 9e544a6443 | |||
| 225b7c38c1 | |||
| 994866461c | |||
| fc4b884d0e | |||
| 9b3ecfe777 | |||
| 20794981b3 | |||
| 01413dd3cc | |||
| 9d1fe6102c | |||
| 2472a41561 | |||
| 65fbdcfa87 | |||
| 25cec015e8 | |||
| 62e3c8c4f8 | |||
| 8902c1f038 | |||
| 6c43bcc3e0 | |||
| 15b37c1e38 | |||
| 29fcdc5f40 | |||
| 1075bb1dbc | |||
| dccb0ee313 | |||
| aea86906f4 | |||
| a62698a14a | |||
| 47af43c281 | |||
| ae2c82adbc | |||
| 594b1a136d | |||
| ae46cc7f73 | |||
| 6b2aad734e | |||
| 98ccbe2b06 | |||
| 5ae100fea2 | |||
| 0052dd29a7 | |||
| 50a42d2cbf | |||
| 49cb6a07a2 | |||
| ed7c4dc2e1 | |||
| c376fb0a2b | |||
| 76d9e58ae5 | |||
| 3769cc1a35 | |||
| 74ace7d4b9 | |||
| 647245a71f | |||
| a634c7be65 | |||
| f656e3195f | |||
| 8811545472 | |||
| cad3850f3d | |||
| 7de058ba35 | |||
| ddaa001daf | |||
| 51c049e1a7 | |||
| 93472f84bd | |||
| 678d27fdb7 | |||
| 369ca89c2e | |||
| 421db75528 | |||
| 846b56c724 | |||
| e62d2fe56e | |||
| bb3abab784 | |||
| da6543d17b | |||
| 29a018088e | |||
| 7e7fc757d5 | |||
| d3a6bdc68b | |||
| 402e42fd15 | |||
| 5007b72b28 | |||
| 9931ec2994 | |||
| 5f3dfc2960 | |||
| dc9e81a6fc | |||
| ed719c80e7 | |||
| 77dc2e4746 | |||
| c5f4c8d174 | |||
| 6ba49642d0 | |||
| 9a2ef9dc00 | |||
| 6ccf0a3428 | |||
| 23e303aaa2 | |||
| 098157dca8 | |||
| 827469600e | |||
| bf718e8698 | |||
| 326f1a9c8b | |||
| 793c438286 | |||
| 6b1f323bb5 | |||
| 761849083d | |||
| ae6ddf295a | |||
| b591e8cdc8 | |||
| 379b2ccf92 | |||
| 3fb4cf56b6 | |||
| fdc62daa8b | |||
| 05094b0da5 | |||
| 4ab8a70b21 | |||
| c88a3fffd5 | |||
| 7b1ae9602d | |||
| c7a22dff87 | |||
| 45ee7c12d0 | |||
| 392b591d09 | |||
| 556a4375e2 | |||
| eab583310d | |||
| 077ae27369 | |||
| d4e1c958e2 | |||
| 33ae442aa1 | |||
| 1285c7f0ca | |||
| 8c72892de1 | |||
| dc751bd2f1 | |||
| 0cde0aee34 | |||
| 503bda5b28 | |||
| a4d5c40d63 | |||
| 8e219bdd77 | |||
| 5acc93dd34 | |||
| 276247b463 | |||
| d277f49423 | |||
| 67bd2c6b2d | |||
| 784683a68d | |||
| 3b2094301d | |||
| 6572754c10 | |||
| f157ea3fdb | |||
| ddd7fe6f05 | |||
| 47a351acb2 | |||
| ff9f670871 | |||
| f33f7d98c4 | |||
| c49f03f985 | |||
| 6b5f583ff3 | |||
| 8e3ab0d10b | |||
| a049092526 | |||
| b6407afa06 | |||
| fbd3cda320 | |||
| 05341828b5 | |||
| 280ba89b26 | |||
| fe7fcc2dc3 | |||
| dcd34d3728 | |||
| dced01fc24 | |||
| cdec0a3f96 | |||
| 1075f3b457 | |||
| c1077faa28 | |||
| 76ba147c22 | |||
| 1c1a216df1 | |||
| 04f96a54b8 | |||
| 5f72d1fda5 | |||
| dfff54425b | |||
| 0edd26467e | |||
| e71c890cf5 | |||
| eada35df36 | |||
| 8d4a08ccc1 | |||
| 9dec093676 | |||
| f711dd3460 | |||
| 7a865b6b28 | |||
| faaaae365a | |||
| 705d1efeab | |||
| c0f60d56a1 | |||
| a4468dd56e | |||
| 337f361526 | |||
| 26a048e5c4 | |||
| ccd41e7efe | |||
| a1a5ba0723 | |||
| 8a6962fc36 | |||
| f23bad140b | |||
| 1bfafd9eb6 | |||
| 1bdb756b25 | |||
| 80c573eed7 | |||
| 78607ea60c | |||
| 0110214abc | |||
| 54d8695e70 | |||
| a2441fd326 | |||
| 831a1d15d5 | |||
| 6b5df8e62f | |||
| 0210cf2b17 | |||
| f0708340ef | |||
| a44bf31d27 | |||
| 002f00d7eb | |||
| ded89b0d49 | |||
| 36b1166cf6 | |||
| 0e7bd9f3ba | |||
| 7963534940 | |||
| d33a0f75a5 | |||
| 368d469631 | |||
| efd3c04f37 | |||
| 5fe6f0b2ec | |||
| 5d6fb2427e | |||
| ad3d1d381a | |||
| b51f60cc1e | |||
| 504232b388 | |||
| 8f36f65f39 | |||
| ff3e396e92 | |||
| 2fe387b4f0 | |||
| 9ec482b7c2 | |||
| 53e8cd18dc | |||
| ac57f41c87 | |||
| 8b78b6bb10 | |||
| 52fa66820c | |||
| 72eb2ccf50 | |||
| 4cfd468863 | |||
| 0cf8d73395 | |||
| 53b2bdfe5e | |||
| 27ab6a686c | |||
| 22c8297a03 | |||
| d22e86376b | |||
| fb56b3a53f | |||
| 0c47017046 | |||
| 792091b23c | |||
| b917361de8 | |||
| a0a54fdfe0 | |||
| d90d5d538b | |||
| c2ae76248e | |||
| 9aa71af1e5 | |||
| b64abebd24 | |||
| 90930619bc | |||
| 5b1c823019 | |||
| b2b4f21e39 | |||
| 22e55165c9 | |||
| 35c2256849 | |||
| 3a10fca75f | |||
| a39947cd3c | |||
| 1730bfb2bc | |||
| 26a4a13cdf | |||
| 36f357c354 | |||
| b07928eea9 | |||
| 1ef7480380 | |||
| e4c2dcc0c7 | |||
| 7bdad857e4 | |||
| c2a8ad26af | |||
| fedf235c83 | |||
| e88d2c2031 | |||
| 20e4685057 | |||
| ca55e15d44 | |||
| bb5e4127d7 | |||
| 30028a2404 | |||
| 6883309927 | |||
| 9c8570ac68 | |||
| 4dfc0f952f | |||
| d6e1b92059 | |||
| bb5f4555dc | |||
| 32d33ca8e5 | |||
| e1dcf24c98 | |||
| 3b24311db6 | |||
| 8fd3fc7c13 | |||
| 8d27b25bf8 | |||
| 727b35536f | |||
| bbe667dc74 | |||
| 3608d42ae9 | |||
| 8f33933dd8 | |||
| e5efe42ecb | |||
| 10e21bfeda | |||
| 00256fdba8 | |||
| 3b8fb7bb88 | |||
| 1057fa8421 | |||
| fca9ec085e | |||
| ef5c6684c7 | |||
| e0438e3a7e | |||
| 04632bd381 | |||
| 0b9db15efc | |||
| d5b2f9cfa7 | |||
| 727c3d5b75 | |||
| eddb7684c1 | |||
| 484baba6ad | |||
| 88f10a2c3c | |||
| ffa1c976f5 | |||
| 4fdc157f68 | |||
| 0a950669cb | |||
| 1232018332 | |||
| 6237613439 | |||
| 4424abd15d | |||
| 76a0471c29 | |||
| e08422a4ea | |||
| 757ff06011 | |||
| 06defe014b | |||
| 63bf134321 | |||
| 2113494274 | |||
| 912f068fe4 | |||
| 8f5d786f0e | |||
| 1dacc648a0 | |||
| 3af786d4c9 | |||
| e57b470e83 | |||
| b8b63ff115 | |||
| 959a3f3cca | |||
| 0a111c1976 | |||
| 4b68f0447c | |||
| 31914b200b | |||
| ebb3fca698 | |||
| 7f72b466ac | |||
| 4751c735ec | |||
| bda3b1fa3a | |||
| 4ec10d798b | |||
| 3dd21e4dcd | |||
| 682d76835e | |||
| 42aa367f16 | |||
| ec8a1bcc82 | |||
| 2d9541c4c8 | |||
| e747ba6c26 | |||
| 4431a34987 | |||
| 14d7de0cf3 | |||
| cd28fdc192 | |||
| 25fe9c7084 | |||
| 94fc2ba9c9 | |||
| 2f87b8e430 | |||
| eff61c7a97 | |||
| 7c96227cd3 | |||
| dcfae6332e | |||
| 69437bb324 | |||
| 7551245f57 | |||
| 47bc551485 | |||
| 87478187af | |||
| 7042223f2e | |||
| 93698f0d61 | |||
| f7aa837696 | |||
| e1d1d18288 | |||
| 20a6f82753 | |||
| aec6cac8ca | |||
| ffca6a762d | |||
| 2d2ab4fec4 | |||
| a434baed91 | |||
| f14a3dfb8a | |||
| b19a3af4db | |||
| 89428a9d10 | |||
| b937d6310d | |||
| ad37bc9639 | |||
| 56df1abdd8 | |||
| 0ea5e57298 | |||
| 3838eb1f05 | |||
| 9ba7196881 | |||
| 1e71303ffa | |||
| 74117a1e1e | |||
| 38ad523f91 | |||
| a71e2fb64e | |||
| 1b20ec8747 | |||
| d30e53ee2c | |||
| aa57ad6082 | |||
| 097893bfbf | |||
| 16019c9827 | |||
| f391100586 | |||
| c4a1e1bb0c | |||
| 7e3b5bed50 | |||
| c9c477ff9d | |||
| 4eb7db80a6 | |||
| 9d6626f70c | |||
| 5c07863ad5 | |||
| 3060375251 | |||
| 3c63e44d32 | |||
| 02d943bfb0 | |||
| 4c8fef264e | |||
| 082cf8ace8 | |||
| 1fd193840d | |||
| b1f8e910eb | |||
| 81cf9f0c71 | |||
| 3264669e03 | |||
| 271d723bbd | |||
| a0c4575122 | |||
| 1af64a9bbb | |||
| e3d5140dcc | |||
| f81d0113a2 | |||
| fde42899e7 | |||
| f7bf2fa960 | |||
| b894a569c9 | |||
| 48022c3ddf | |||
| 28aa981464 | |||
| 2b8a09bf55 | |||
| a12788e8f4 | |||
| 9b5f6d3c45 | |||
| af24dc6050 | |||
| f27560cc1e | |||
| 4b309b5044 | |||
| d8a99d619f | |||
| 2dec8e767a | |||
| ba53c7eb03 | |||
| 873d4287de | |||
| 3626fb246e | |||
| a661098ef2 | |||
| a4bf5ce609 | |||
| 437944d416 | |||
| db37b1c634 | |||
| 1e49e9b9dc | |||
| 2cbfbc98e9 | |||
| 38d5f20deb | |||
| 70fb5900a2 | |||
| bf7d1a55af | |||
| 1f73e27870 | |||
| 699087b2bf | |||
| ccd29085a9 | |||
| a883362c14 | |||
| ef88385d85 | |||
| 90b0283160 | |||
| 0a8d46b538 | |||
| a84226edf0 | |||
| 9370b063d0 | |||
| d5ffae0e46 | |||
| f89599726e | |||
| a81b3aaff1 | |||
| 820e4edc2b | |||
| 25586f3246 | |||
| b7149fc940 | |||
| 675b113c3e | |||
| c797987615 | |||
| eb0e07d564 | |||
| 1b5805eeb0 | |||
| 42e652cae7 | |||
| 62818abbf4 | |||
| 4d9a96e8df | |||
| e490a5461f | |||
| 5068483cb9 | |||
| 83ee20fc29 | |||
| b08aa4ed92 | |||
| 1081ecdae8 | |||
| 2370c16f1e | |||
| 3d84dc91f6 | |||
| 573e49a7ea | |||
| 63c639e108 | |||
| fc00406079 | |||
| b752c3a668 | |||
| 7372b457cc | |||
| deb5196101 | |||
| 9e1fda2a44 | |||
| 9d249ef96f | |||
| e03b73e8cd | |||
| 6b473f22bd | |||
| 05bb80c06c | |||
| e6edc6586e | |||
| cf3124c063 | |||
| 12a6a27b52 | |||
| 31a0e673b2 | |||
| 8d0b4a1bf5 | |||
| 1b0ebcadfa | |||
| 0d100ffacc | |||
| 88fd1da803 | |||
| a06934777c | |||
| a26f4b9a9a | |||
| 053d6a2247 | |||
| beae4775cf | |||
| cff91a532f | |||
| 92ed5d7208 | |||
| 7800375510 | |||
| ab25815694 | |||
| 8e0104363f | |||
| b7a6d518b0 | |||
| 4ed844ffd5 | |||
| 020467d472 | |||
| 141b87bd14 | |||
| a5b9e235ae | |||
| a78790eac4 | |||
| 07226feec4 | |||
| e73013830d | |||
| 2bc3bd3fcf | |||
| 83456f6040 | |||
| 601dc41baf | |||
| 2337b7717d | |||
| fde40dee7a | |||
| ba32aad4cb | |||
| 24811e5970 | |||
| f01aab5f9b | |||
| 3850b073dd | |||
| 81e50dd1f4 | |||
| bd31fbb9f0 | |||
| 000660608e | |||
| 826de43724 | |||
| b84e080463 | |||
| 0ba58d7d0e | |||
| 1536c5cf60 | |||
| f2ce9cd85c | |||
| ee5cd8493e | |||
| 41e8d27602 | |||
| e1f5fc6a0c | |||
| db59f1a70f | |||
| a9772cde21 | |||
| 086790d633 | |||
| 1bc8e2ab82 | |||
| 089c85b27e | |||
| 01194e3958 | |||
| f082530f89 | |||
| b906656caa | |||
| 378ae4c4f1 | |||
| ce2a0f72d4 | |||
| be5ba495f9 | |||
| b4f27da51c | |||
| d09a30295b | |||
| 0f909273e1 | |||
| 52eaa7d6d6 | |||
| e88e37c59b | |||
| f10f49d6fc | |||
| d06cdaab29 | |||
| fc20bd7b22 | |||
| b3d9412452 | |||
| 98feb1b76d | |||
| 94c302baf3 | |||
| cdb6bb8ec2 | |||
| a851f849df | |||
| a270a13010 | |||
| 964d63cdac | |||
| f38faedbda | |||
| c462a69b7d | |||
| 14a2c9cec0 | |||
| a52ed70ea0 | |||
| 7c03e60299 | |||
| 1e9d88af01 | |||
| 815e140ecf | |||
| f8245574dc | |||
| 830c5ca725 | |||
| 9e71394127 | |||
| dd64eac782 | |||
| 4204ece7a8 | |||
| 60a5cc1a61 | |||
| 20aa4e85ce | |||
| f1b05acf26 | |||
| a4bf770a49 | |||
| 150831c1a6 | |||
| 1a4157b7f4 | |||
| 3bcb285690 | |||
| 704dbe27bf | |||
| bbddf50c9d | |||
| e5851addd6 | |||
| 03119f2aa9 | |||
| 45fc3ce1c4 | |||
| d320c73f23 | |||
| ca8ce89de4 | |||
| c88a751eab | |||
| 9ea030d060 | |||
| ad14c8145b | |||
| 255a8da347 | |||
| 4211dcf6f9 | |||
| 3c5337fb8a | |||
| d2f788c61e | |||
| fa54d5acb7 | |||
| aeefe1650e | |||
| c80e7844b7 | |||
| 620c08bd7a | |||
| 23a92709c0 | |||
| cef3eb78df | |||
| 12d0a7302f | |||
| 0dd85f7761 | |||
| 51d6e8ebfb | |||
| 3f14882992 | |||
| 5a17b060fe | |||
| bf8e4ac714 | |||
| 781ed11ba8 | |||
| 6f8f7491db | |||
| c43cdf438f | |||
| 8374211239 | |||
| 69dfc729e9 | |||
| 5281282a61 | |||
| 503eb42e40 | |||
| 38d90c76e0 | |||
| 1356498320 | |||
| 9ed203c0cb | |||
| b5ff856f47 | |||
| 97b9055f92 | |||
| 5f0b9338dc | |||
| b3194a10c5 | |||
| d01f4ea3ce | |||
| a42cafbf69 | |||
| 066e5b3fc0 | |||
| 09dba47653 | |||
| ca33ac608d | |||
| 302989bed1 | |||
| 22b7d9fbee | |||
| 9dd71c427d | |||
| 655c1cc1f7 | |||
| d9333e02fa | |||
| 39ac438b8d | |||
| 0761a4a692 | |||
| 66ca256cfc | |||
| 961bb6e27e | |||
| b14f5ea884 | |||
| bf66336e2c | |||
| c79a575452 | |||
| 8334128680 | |||
| 7c62de1f27 | |||
| 377a7a968b | |||
| ccf29c0134 | |||
| d0513d6506 | |||
| f4a0bdd54d | |||
| 3e2ac3640d | |||
| c8b3809fc9 | |||
| ad2ef75cbe | |||
| 6ce9010324 | |||
| d0afc8c509 | |||
| 230b3bc884 | |||
| 1cfb630ede | |||
| d16f9620d5 | |||
| fc16746352 | |||
| eb5b5f97d1 | |||
| faea45245d | |||
| 2c614d5aab | |||
| 89b4be681d | |||
| 28ca0e1007 | |||
| 2504af7d0f | |||
| ddc3c2f38c | |||
| 53275c362c | |||
| f3f6727cdd | |||
| 4681e3a0ef | |||
| 80f4f317b2 | |||
| 9f3d735d9d | |||
| 0e012f73d4 | |||
| 9f850334a1 | |||
| af273e3da5 | |||
| 1f3e96f4ad | |||
| e7ba639beb | |||
| 1f2399de36 | |||
| 43201ead95 | |||
| 7dce64e540 | |||
| 1184eb59c5 | |||
| 4c2a4929ea | |||
| be77a7e27e | |||
| 934723faa5 | |||
| f07295cc78 | |||
| 26c1d67556 | |||
| 3d5889c308 | |||
| 213c1c4860 | |||
| 63cb8ca24c | |||
| dc5d1fa21c | |||
| 563d158e49 | |||
| 1478b5bbd7 | |||
| 19e0b87aa1 | |||
| 17ea4ed8f5 | |||
| feaef7cc4a | |||
| c6d3fbdfab | |||
| 700a585b1b | |||
| 62752db4c4 | |||
| f025d1b495 | |||
| 8c4417cad1 | |||
| d4db2b84f2 | |||
| bb8e04c835 | |||
| b504791bad | |||
| d5749c11f3 | |||
| f54ab5e2ca | |||
| 1e45019f8a | |||
| 2eb708e5ad | |||
| 4fcb371bc8 | |||
| 6401d93b8e | |||
| 8a9a39c065 | |||
| 13e8b26989 | |||
| 8a6d6577bd | |||
| 4a7ba7ef4c | |||
| 2b5d9f349f | |||
| 3a502f2189 | |||
| b6dad375a3 | |||
| 3cbad7f0df | |||
| b80a0a8d74 | |||
| f844b0a161 | |||
| 6bd31b0333 | |||
| 7de1a7a6d1 | |||
| 3815e7d61e | |||
| 30e6fc07d6 | |||
| fe1c5d41f9 | |||
| fa5ba63542 | |||
| 073db54354 | |||
| ef10b5a834 | |||
| 1c5ff92c93 | |||
| b24ea29bf5 | |||
| 5cf3ddb7b1 | |||
| 1e1a41f0e7 | |||
| 28e8190e6b | |||
| 670c928a9f | |||
| d07a69278d | |||
| bb52530eb2 | |||
| 309dfa36e7 | |||
| 5c57f5aa0b | |||
| a36e575500 | |||
| 8702031bcd | |||
| 1571508aac | |||
| 6dacec22a4 | |||
| fdbbea2609 | |||
| dffed5a259 | |||
| 5d681a74ad | |||
| d80e00f5d7 | |||
| 21a8bff011 | |||
| fb14f7706c | |||
| 2284c31f90 | |||
| b5b2c42242 | |||
| a2f92b642c | |||
| c996356fab | |||
| d71ae412bb | |||
| 68a125bf6e | |||
| 37c7ca8b87 | |||
| 4663970722 | |||
| a68d17c17e | |||
| fa3b74a5b4 | |||
| fd999b996f | |||
| b4f57247b8 | |||
| abdc69aa94 | |||
| 1b02216f2d | |||
| db340f96d6 | |||
| 0cdca534a8 | |||
| 71b9bbd1ac | |||
| 2f3969b4be | |||
| ff7479f437 | |||
| 487d828fa0 | |||
| f41081ba51 | |||
| ede910d655 | |||
| 0f4c9a43b3 | |||
| 9aa414b1f6 | |||
| 2d9ddb065f | |||
| 1f542e1e75 | |||
| 68e0d99f62 | |||
| f43287f43d | |||
| 2e7bd6498f | |||
| 786397f77d | |||
| 960c339a4c | |||
| fddb2304c6 | |||
| 1b8dc4d096 | |||
| fcc03f4ed8 | |||
| 78b8b30766 | |||
| 91d8cc4c5b | |||
| 11619be8b9 | |||
| e767ded69f | |||
| 83a579fb9a | |||
| 244f87917c | |||
| 6f0da68915 | |||
| af438527e9 | |||
| ad4c4e462b | |||
| ed33a4f75b | |||
| f3d7d4ee37 | |||
| bd4916ee84 | |||
| feee50e695 | |||
| 54710a782b | |||
| d44a1d0867 | |||
| c2780e1de4 | |||
| 4e1f54ff9c | |||
| 3755bf5bcd | |||
| 25d422d32b | |||
| 697bc8d8e8 | |||
| 4bdc9824a0 | |||
| ded98ed3de | |||
| 13bcc4ef14 | |||
| ce92c9b21b | |||
| b332fbd7a7 | |||
| eaf4e69cf1 | |||
| 2f67c704fe | |||
| 8348392af2 | |||
| 8116ad9b28 | |||
| cb7435982c | |||
| 776583a665 | |||
| 91c3363c15 | |||
| b7542fd6f2 | |||
| 0c860a77c0 | |||
| 2d591f7f59 | |||
| 9cb96f3bfb | |||
| 286a9edb1e | |||
| c4da496834 | |||
| ade92395a0 | |||
| c6741d3765 | |||
| 25e3408ff6 | |||
| 35588cc521 | |||
| 32bb63f047 | |||
| 27912e1e8f | |||
| b678aa64d8 | |||
| c3e9fc4a8d | |||
| 66ab59d163 | |||
| deb79e830d | |||
| a6dd65f916 | |||
| 0448e386de | |||
| 749de0054f | |||
| 7849667a19 | |||
| e03efdee97 | |||
| d6a8d27265 | |||
| 5e18a7292b | |||
| e66063e630 | |||
| 9ec18a3b02 | |||
| 773a1f3075 | |||
| b3f4ba0082 | |||
| 34da226bd9 | |||
| 16280f4f7f | |||
| 42f954ff7d | |||
| 09f5591aba | |||
| f690cd802e | |||
| d43e1fb800 | |||
| 41b40f6504 | |||
| f7adc0b35b | |||
| 710c02f3bd | |||
| 7f69d2b95f | |||
| a18e3f3380 | |||
| 63a4201d15 | |||
| b751800ff4 | |||
| f32149117a | |||
| 1cb11bba5d | |||
| f29c88bcd5 | |||
| f5e78d7c88 | |||
| 25c4985518 | |||
| cd4f6da735 | |||
| 6e032ded6e | |||
| e2b47e001f | |||
| b32c961c2e | |||
| 088337ea07 | |||
| e8c00b9e8b | |||
| 023d4b44ec | |||
| 87d2f4b8d7 | |||
| 39ca53cfcf | |||
| 46f2f3bd8f | |||
| cb56d50837 | |||
| b19dddb0f6 | |||
| acceabe3a8 | |||
| c3993b3123 | |||
| f277be0f26 | |||
| 1a2486d2ec | |||
| a735095965 | |||
| ef75e171bc | |||
| 5bf7dee559 | |||
| f858164dee | |||
| 924f6849fe | |||
| b5ec57a3f9 | |||
| 6d978486cd | |||
| d2832b1045 | |||
| 1a4fc39d7b | |||
| 97388abb99 | |||
| 57ec310512 | |||
| ffd5c045e4 | |||
| cc3c2b6999 | |||
| c549aa4e76 | |||
| 714831b249 | |||
| d6879c4a25 | |||
| 2caf5868d0 | |||
| c585964e60 | |||
| 936a50df23 | |||
| 3e9888092a | |||
| 821826a566 | |||
| 7ec803f610 | |||
| b1a075b462 | |||
| 3be75cbcb3 | |||
| 2667f9046e | |||
| 2601871391 | |||
| a3d0ab3d09 | |||
| a1b36ec0a5 | |||
| 48e995ddf2 | |||
| df971befb2 | |||
| 1cd65878db | |||
| 6148ffa669 | |||
| 717b4c3406 | |||
| 74361bec05 | |||
| a087e7f664 | |||
| 3ad93a31c9 | |||
| 184b346166 | |||
| b2c807dc8c | |||
| 60548aa00b | |||
| a45d1555d3 | |||
| 121ae0b189 | |||
| 8bf8832b70 | |||
| 4dd7e261f5 | |||
| f4329df11c | |||
| 98729a6c78 | |||
| 742ba970b0 | |||
| 115f94bfc2 | |||
| 7e5727288d | |||
| 13915d8b57 | |||
| 9962fae1a1 | |||
| 9fcbe293e2 | |||
| fd4b52ec38 | |||
| b59602abf8 | |||
| fd21c36725 | |||
| b999c6ca53 | |||
| 583954d3a1 | |||
| 8fb1604f64 | |||
| 284af258bf | |||
| e7887c1f01 | |||
| 076ebafa1b | |||
| 6922bd239c | |||
| 13aa58ce5d | |||
| c8c23158a4 | |||
| 1782ce260c | |||
| b28d3746f5 | |||
| 469a04e7e0 | |||
| 605b5d5717 | |||
| f7aa46fb33 | |||
| b4450294af | |||
| 57327a5e33 | |||
| 4a3c64291f | |||
| 036b3c9053 | |||
| 7da33344d1 | |||
| cbdb9f59f3 | |||
| 5d3d6bcead | |||
| 0cdc628db0 | |||
| 4a733c93d4 | |||
| 03d2378a9f | |||
| 5e027c196d | |||
| 3aeaef5b9a | |||
| 4d26070a92 | |||
| f601b04594 | |||
| ca169489b2 | |||
| 713c2eb704 | |||
| 660e0c78ac | |||
| 0862de6577 | |||
| 2cd511d3a3 | |||
| efe5fedde9 | |||
| c8c6845452 | |||
| bd62c4891e | |||
| 9535541f5a | |||
| 711a570d24 | |||
| cb9ccc443d | |||
| c681bdd2e3 | |||
| 74844c0f28 | |||
| 905207093b | |||
| 73a944fb74 | |||
| d1328d876a | |||
| faa85564fc | |||
| 8dec0c1f17 | |||
| 8098ed899a | |||
| 77c98f0750 | |||
| 8dbdfa9a44 | |||
| 685e99be02 | |||
| b14b7bd55e | |||
| 365769d14c | |||
| 01b901eba1 | |||
| 26de1d9f93 | |||
| 451fb82e54 | |||
| c02d51f523 | |||
| b95027ba28 | |||
| 5b476a2597 | |||
| bceeda8087 | |||
| ee9636bba2 | |||
| ddfb16de1a | |||
| 2555d0d637 | |||
| ed73d76751 | |||
| 4fe49af840 | |||
| beabbb3a20 | |||
| b4888c21ed | |||
| b75fa1c6ec | |||
| 3fbf39b25d | |||
| 15a833283b | |||
| 5a0d04bb81 | |||
| fbae3344ff | |||
| 95469fde30 | |||
| 9f46972f19 | |||
| 46a3afadb9 | |||
| 1b2f3bf369 | |||
| bb3b421385 | |||
| 1ee3d3d810 | |||
| 97c2e0957d | |||
| 09a5791bc6 | |||
| 8db5ecd736 | |||
| e9aa04a8f4 | |||
| 8eb23e7d48 | |||
| 093b3d258e | |||
| 48e6221cf0 | |||
| ef0c095712 | |||
| a0355dfd9d | |||
| 6fe2d8af97 | |||
| 90e5d0feaa | |||
| d79e22bfaa | |||
| a9fb6bab15 | |||
| dd968c07be | |||
| feb81c51d2 | |||
| aecf675e6b | |||
| bcaf406747 | |||
| f234a2bfab | |||
| 28d17a40ce | |||
| 7cfca37e2a | |||
| c38b6392c5 | |||
| ee38756982 | |||
| eea7d2eb77 | |||
| b15410fd3a | |||
| c83b2b73d7 | |||
| dfbb5264fa | |||
| f49a3e03c1 | |||
| 109d1744a0 | |||
| 470f8af97c | |||
| a1296a3b7c | |||
| f38fe242cd | |||
| 536ea2189a | |||
| ab0422b4d4 | |||
| 18bd33f9a4 | |||
| d436e4ca4a | |||
| 1372dc1953 | |||
| 9ef7352e69 | |||
| 2529ff6dae | |||
| 7bdf592f7e | |||
| f463b772b0 | |||
| eec897762c | |||
| f87c665b63 | |||
| 36d3fd1710 | |||
| d26a19b41d | |||
| a55b3742cb | |||
| 83556667fd | |||
| faf5f3128f | |||
| a53a797271 | |||
| 08583dc107 | |||
| c362a1e077 | |||
| 140208e5ee | |||
| 679d3c373f | |||
| 557eceeefc | |||
| 9704ccc8a6 | |||
| e62664138b | |||
| 3eadc1509f | |||
| 9910aa3cc6 | |||
| 2a53e5f80e | |||
| 2e8acfb98c | |||
| 48fa096943 | |||
| bf559d788f | |||
| 3bfc8e9a39 | |||
| a162f1d18e | |||
| a86873c93e | |||
| 05933e9f21 | |||
| ab2e34d817 | |||
| e7a8bcc30b | |||
| 34c6c664c9 | |||
| 4a3ee91c55 | |||
| 6f0d1af596 | |||
| 01feb5b489 | |||
| 8975b52cc3 | |||
| 7acbbbbf5b | |||
| 4fecafa612 | |||
| a4ded88e85 | |||
| 1b6aab0cd7 | |||
| c669820481 | |||
| ecc2fc6029 | |||
| e490202a1b | |||
| fd2412a5f6 | |||
| 07528ea8f2 | |||
| ce8a069eb5 | |||
| 2ba97aee6c | |||
| a674d81caf | |||
| efb61ed4a8 | |||
| 2e7d08c10b | |||
| 47b87e903b | |||
| ddeff72544 | |||
| 43995b4c6d | |||
| 512d23d60f | |||
| 0eb9152749 | |||
| 4403849126 | |||
| 9efebe5461 | |||
| 7198fa73d1 | |||
| 03ba592c48 | |||
| 57a06f72e2 | |||
| 3019ba6f43 | |||
| 2784cd17fc | |||
| 03cc9eb5c5 | |||
| 72b8f4609b | |||
| d36e53f702 | |||
| a36f14c1bf | |||
| 292e187524 | |||
| 16cab979da | |||
| fd7f542bd9 | |||
| 5ead326454 | |||
| a1c635b050 | |||
| d896bf9a1c | |||
| 49dd1c3409 | |||
| fce491e18c | |||
| 87d0fc8bb5 | |||
| f638d1078a | |||
| 8af2465a61 | |||
| 1b3f2567bc | |||
| 036d4514f0 | |||
| 80721d1873 | |||
| aa9e33cf74 | |||
| 86900175c8 | |||
| d5c1d6ebec | |||
| 35e328bcb6 | |||
| befb4b3644 | |||
| 4235df2b28 | |||
| a6c8a6a9f2 | |||
| 1a3ba00c24 | |||
| e8a2072792 | |||
| 4886b56edb | |||
| 15d29edae9 | |||
| 3009540a00 | |||
| a0ad3c4fef | |||
| 265006b691 | |||
| 11b3b8a5ff | |||
| 2783c82685 | |||
| 184e7b3f64 | |||
| 18377ac9fd | |||
| 184e14ea83 | |||
| 21125cf2cb | |||
| 0d20c47703 | |||
| 7f9a5e01c6 | |||
| eb9b12ed11 | |||
| 4a4c0886cc | |||
| 02476332ea | |||
| 49d3c97b67 | |||
| 97467cb2c8 | |||
| 6a43886807 | |||
| 5d56a2486e | |||
| eb138a02d6 | |||
| 2a4d0e3e89 | |||
| 9f7a2e4da2 | |||
| 25e995b0f5 | |||
| ad5da2a988 | |||
| 6ab7cf9689 | |||
| 099ead02a5 | |||
| f1d04a2f8e | |||
| aed53dbb47 | |||
| a507816701 | |||
| c41c828574 | |||
| 5fe41fb8a0 | |||
| 0ba566491e | |||
| 2a4d57a1ca | |||
| 71c433cc50 | |||
| 2b10cc84ea | |||
| cb6ef574e3 | |||
| 37e02a3594 | |||
| 7d1cfe9514 | |||
| 9870ee04dd | |||
| 1a286397e3 | |||
| 697dc89382 | |||
| 4d342d955d | |||
| c5eb349d41 | |||
| 7790a7f98c | |||
| 246f44b988 | |||
| a85112172d | |||
| 5f18cb018d | |||
| 872bc3fa5e | |||
| 1625a5af0c | |||
| 2e9a632e14 | |||
| 3c9d4e9daf | |||
| c792c7f62d | |||
| e512760364 | |||
| ac41137ce2 | |||
| 28aba58e25 | |||
| 4ec661c0bb | |||
| 87bdf73cb7 | |||
| 21c8e89671 | |||
| 8fbe36635c | |||
| 5cd4fefb4c |
@@ -1,4 +1,3 @@
|
||||
config.cache
|
||||
include/version.h
|
||||
include/sysconf.h
|
||||
build/
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
Adam <adam@anope.org> <adam-@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Adam <adam@anope.org> <adam@adam-laptop.(none)>
|
||||
Adam <adam@anope.org> <Adam@anope.org>
|
||||
Adam <adam@anope.org> <Adam@drink-coca-cola.info>
|
||||
Adam <adam@anope.org> <Adam@sigterm.info>
|
||||
Adam Kramer <ribosome@anope.org> <ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Alvaro Toledo <atoledo@keldon.org> <atoledo atoledo@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Björn Stiddien <keeper@anope.org> <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Charles Kingsley <chaz@anope.org>
|
||||
Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Fabio Scotoni <cculex@gmail.com>
|
||||
Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jan Milants <viper@anope.org>
|
||||
Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <anope@s15355730.onlinehome-server.info>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
|
||||
Jens Voss <dukepyrolator@anope.org> Jens Voß <jens@pyrobook.(none)>
|
||||
Lee Holmes <lethality@anope.org>
|
||||
Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
|
||||
Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robby <robby@chat.be>
|
||||
Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Sebastian V. <hal9000@denorastats.org>
|
||||
Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
(svnadmin) <svn@localhost> <svn svn@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
+71
-42
@@ -80,7 +80,7 @@ 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)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# 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: "
|
||||
@@ -132,6 +132,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
string(LENGTH ${LINE} LINE_LENGTH)
|
||||
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
|
||||
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
|
||||
# For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
|
||||
string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${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
|
||||
@@ -144,7 +146,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(DEFAULT_INCLUDE_DIRS)
|
||||
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
|
||||
endif(DEFAULT_INCLUDE_DIRS)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
# 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)
|
||||
@@ -160,12 +162,12 @@ if(MSVC)
|
||||
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")
|
||||
if(WSDK2003_PATH STREQUAL "/registry")
|
||||
# The SDK was never found, set the path to nothing
|
||||
set(WSDK_PATH "")
|
||||
else(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
else(WSDK2003_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2003_PATH}")
|
||||
endif(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
endif(WSDK2003_PATH STREQUAL "/registry")
|
||||
else(WSDK2008_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2008_PATH}")
|
||||
endif(WSDK2008_PATH STREQUAL "/registry")
|
||||
@@ -207,24 +209,33 @@ else(CMAKE244_OR_BETTER)
|
||||
include(TestCXXAcceptsFlag)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
|
||||
# If extra directories were specified, tell cmake about them.
|
||||
# If extra include directories were specified, tell cmake about them.
|
||||
if(EXTRA_INCLUDE)
|
||||
include_directories(${EXTRA_INCLUDE})
|
||||
link_directories(${EXTRA_INCLUDE})
|
||||
endif(EXTRA_INCLUDE)
|
||||
|
||||
# If extra library directories were specified, tell cmake about them.
|
||||
if(EXTRA_LIBS)
|
||||
link_directories(${EXTRA_LIBS})
|
||||
endif(EXTRA_LIBS)
|
||||
|
||||
# Find gettext
|
||||
find_package(Gettext)
|
||||
|
||||
# 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)
|
||||
option(USE_PCH "Use precompiled headers" OFF)
|
||||
|
||||
# Use the following directories as includes
|
||||
include_directories(${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/include ${Anope_BINARY_DIR}/lang)
|
||||
# Note that it is important the binary include directory comes before the
|
||||
# source include directory so the precompiled headers work correctly.
|
||||
include_directories(${Anope_BINARY_DIR}/include ${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/language ${Anope_SOURCE_DIR}/modules/pseudoclients)
|
||||
|
||||
# If using Windows, always add the _WIN32 define
|
||||
if(WIN32)
|
||||
add_definitions(-D_WIN32)
|
||||
# And include the windows specific folder for our anope_windows.h
|
||||
include_directories(${Anope_SOURCE_DIR}/src/win32)
|
||||
endif(WIN32)
|
||||
|
||||
# If using Visual Studio, set the C++ flags accordingly
|
||||
@@ -234,7 +245,7 @@ if(MSVC)
|
||||
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")
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS)
|
||||
# Otherwise, we're not using Visual Studio
|
||||
else(MSVC)
|
||||
@@ -242,9 +253,9 @@ else(MSVC)
|
||||
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 (only on GNU compiler)
|
||||
if(UNIX)
|
||||
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic")
|
||||
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic ${CMAKE_CXX_FLAGS}")
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(CXXFLAGS "${CXXFLAGS} -fno-leading-underscore")
|
||||
set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore")
|
||||
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# If we aren't on a *nix system, we are using MinGW
|
||||
else(UNIX)
|
||||
@@ -257,7 +268,7 @@ 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}")
|
||||
append_to_list(LINK_LIBS ${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
|
||||
@@ -293,17 +304,19 @@ if(NOT MSVC)
|
||||
# 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")
|
||||
append_to_list(LINK_LIBS socket)
|
||||
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")
|
||||
append_to_list(LINK_LIBS nsl)
|
||||
endif(HAVE_NSL_LIB)
|
||||
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
if(NOT APPLE)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
endif(NOT APPLE)
|
||||
else(HAVE_PTHREAD)
|
||||
message(FATAL_ERROR "The pthread library is required to build Anope")
|
||||
endif(HAVE_PTHREAD)
|
||||
@@ -325,31 +338,17 @@ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINF
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
|
||||
|
||||
# Check for the existance of the following include files
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(cstdint HAVE_CSTDINT)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(strings.h HAVE_STRINGS_H)
|
||||
check_include_file(sys/select.h HAVE_SYS_SELECT_H)
|
||||
check_include_file(sys/eventfd.h HAVE_SYS_EVENTFD_H)
|
||||
|
||||
# Check for the existance of the following functions
|
||||
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_function_exists(eventfd HAVE_EVENTFD)
|
||||
|
||||
# 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)
|
||||
check_function_exists(epoll_wait HAVE_EPOLL)
|
||||
check_function_exists(poll HAVE_POLL)
|
||||
check_function_exists(kqueue HAVE_KQUEUE)
|
||||
|
||||
# Strip the leading and trailing spaces from the compile flags
|
||||
if(CXXFLAGS)
|
||||
@@ -381,6 +380,29 @@ else(INSTDIR)
|
||||
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/services")
|
||||
endif(INSTDIR)
|
||||
|
||||
# Set default paths for various directories if not already defined
|
||||
if(NOT BIN_DIR)
|
||||
set(BIN_DIR "bin")
|
||||
endif(NOT BIN_DIR)
|
||||
if(NOT DB_DIR)
|
||||
set(DB_DIR "data")
|
||||
endif(NOT DB_DIR)
|
||||
if(NOT DOC_DIR)
|
||||
set(DOC_DIR "doc")
|
||||
endif(NOT DOC_DIR)
|
||||
if(NOT CONF_DIR)
|
||||
set(CONF_DIR "conf")
|
||||
endif(NOT CONF_DIR)
|
||||
if(NOT LIB_DIR)
|
||||
set(LIB_DIR "lib")
|
||||
endif(NOT LIB_DIR)
|
||||
if(NOT LOCALE_DIR)
|
||||
set(LOCALE_DIR "locale")
|
||||
endif(NOT LOCALE_DIR)
|
||||
if(NOT LOGS_DIR)
|
||||
set(LOGS_DIR "logs")
|
||||
endif(NOT LOGS_DIR)
|
||||
|
||||
# Version number processing
|
||||
# Find all lines in src/version.sh that start with VERSION_
|
||||
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
|
||||
@@ -449,7 +471,7 @@ 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(language)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(modules)
|
||||
add_subdirectory(include)
|
||||
@@ -459,23 +481,26 @@ 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\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
|
||||
if(WIN32)
|
||||
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
|
||||
endif(WIN32)
|
||||
# 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 ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
|
||||
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}/src/win32/anope.bat
|
||||
DESTINATION bin
|
||||
DESTINATION ${BIN_DIR}
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
|
||||
|
||||
# Only process the CPack section if we have CPack
|
||||
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
# Various options for CPack
|
||||
@@ -490,6 +515,10 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
#set(CPACK_RESOURCE_FILE_README "${Anope_SOURCE_DIR}/docs/README")
|
||||
# The following is primarily for NSIS
|
||||
if(WIN32)
|
||||
# By default, do not warn when built on machines using only VS Express:
|
||||
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||
# Also for Windows, include installing the MSVCRT library
|
||||
include(InstallRequiredSystemLibraries)
|
||||
set(CPACK_GENERATOR "NSIS")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Configuration script for Services.
|
||||
#
|
||||
# Anope (c) 2003-2010 Anope team
|
||||
# Anope (c) 2003-2011 Anope team
|
||||
# Contact us at team@anope.org
|
||||
#
|
||||
# This program is free but copyrighted software; see the file COPYING for
|
||||
@@ -40,7 +40,8 @@ Run_Build_System () {
|
||||
WITH_INST=""
|
||||
WITH_RUN=""
|
||||
WITH_PERM=""
|
||||
RUN_CC_PL=""
|
||||
EXTRA_INCLUDE=""
|
||||
EXTRA_LIBS=""
|
||||
GEN_TYPE=""
|
||||
|
||||
if [ "$INSTDIR" != "" ] ; then
|
||||
@@ -67,6 +68,20 @@ Run_Build_System () {
|
||||
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
|
||||
fi
|
||||
|
||||
if [ "$USE_PCH" = "yes" ] ; then
|
||||
PCH="-DUSE_PCH:BOOLEAN=ON"
|
||||
else
|
||||
PCH="-DUSE_PCH:BOOLEAN=OFF"
|
||||
fi
|
||||
|
||||
if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
|
||||
EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
|
||||
fi
|
||||
|
||||
if [ "$EXTRA_LIB_DIRS" != "" ] ; then
|
||||
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
||||
fi
|
||||
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
GEN_TYPE="-G\"MSYS Makefiles\""
|
||||
@@ -82,9 +97,9 @@ Run_Build_System () {
|
||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
||||
fi
|
||||
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $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
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
||||
|
||||
echo ""
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
@@ -115,8 +130,11 @@ export ECHO2 ECHO2SUF
|
||||
INSTDIR=$HOME/services
|
||||
RUNGROUP=
|
||||
UMASK=
|
||||
DEBUG="yes"
|
||||
DEBUG="no"
|
||||
USE_RUN_CC_PL="no"
|
||||
USE_PCH="no"
|
||||
EXTRA_INCLUDE_DIRS=
|
||||
EXTRA_LIB_DIRS=
|
||||
EXTRA_CONFIG_ARGS=
|
||||
CAN_QUICK="no"
|
||||
SOURCE_DIR=`dirname $0`
|
||||
@@ -151,6 +169,51 @@ while [ $# -ge 1 ] ; do
|
||||
shift 1
|
||||
done
|
||||
|
||||
###########################################################################
|
||||
# Check for CMake and (optionally) install it
|
||||
###########################################################################
|
||||
|
||||
which cmake > /dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
clear
|
||||
if exists "cmake-bin" ; then :
|
||||
else
|
||||
echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org"
|
||||
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
|
||||
|
||||
if [ `uname` = "Linux" ] ; then
|
||||
|
||||
echo ""
|
||||
echo "Config can attempt to install CMake for you now, which"
|
||||
echo "will take approximately 50 MB of disk space."
|
||||
echo "Would you like to install CMake now?"
|
||||
echo2 "[y] "
|
||||
read YN
|
||||
if [ "$YN" = "n" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Downloading CMake... this may take a minute or two."
|
||||
wget -q http://anope.org/cmake/linux-i386.php -O cmake-bin.tar.gz
|
||||
if [ $? -ne 0 ] ; then
|
||||
rm -f cmake-bin.tar.gz
|
||||
echo "Unable to download CMake"
|
||||
exit 0
|
||||
fi
|
||||
mkdir -p cmake-bin
|
||||
tar zxf cmake-bin.tar.gz -C cmake-bin
|
||||
rm -f cmake-bin.tar.gz
|
||||
echo "Done!"
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
CMAKE_BIN=`find cmake-bin -name cmake`
|
||||
CMAKE_BIN="`pwd`/`dirname $CMAKE_BIN`"
|
||||
PATH="$PATH:$CMAKE_BIN"
|
||||
fi
|
||||
|
||||
###########################################################################
|
||||
|
||||
if [ ! "$NO_INTRO" ] ; then
|
||||
@@ -164,17 +227,7 @@ if [ ! "$NO_INTRO" ] ; then
|
||||
;;
|
||||
esac
|
||||
. $SOURCE_DIR/src/version.sh
|
||||
if [ -d .git ] ; then
|
||||
VERSION=`git describe --tags`
|
||||
VERSION_BUILD=`echo "$VERSION" | cut -d'-' -f2`
|
||||
VERSION_EXTRA=`echo "$VERSION" | cut -d'-' -f3`
|
||||
if [ "$VERSION_BUILD" == "$VERSION_EXTRA" ] ; then
|
||||
VERSION_EXTRA=""
|
||||
fi
|
||||
echo "#define VERSION_BUILD $VERSION_BUILD" > include/version.h
|
||||
echo "#define VERSION_EXTRA \"$VERSION_EXTRA\"" >> include/version.h
|
||||
fi
|
||||
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
|
||||
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
@@ -198,7 +251,7 @@ export ok INPUT
|
||||
####
|
||||
|
||||
ok=0
|
||||
echo "In what directory do you want the binaries to be installed?"
|
||||
echo "In what directory should Anope be installed?"
|
||||
while [ $ok -eq 0 ] ; do
|
||||
echo2 "[$INSTDIR] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
@@ -325,14 +378,71 @@ echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra arguments you wish to pass to cmake?"
|
||||
echo "You may only need to do this if cmake is unable to locate"
|
||||
TEMP_YN="n"
|
||||
if [ "$USE_PCH" = "yes" ] ; then
|
||||
TEMP_YN="y"
|
||||
fi
|
||||
echo "Do you want to build using precompiled headers? This can speed up"
|
||||
echo "the build, but uses more disk space."
|
||||
echo2 "[$TEMP_YN] "
|
||||
read YN
|
||||
if [ "$YN" ] ; then
|
||||
if [ "$YN" = "y" ] ; then
|
||||
USE_PCH="yes"
|
||||
else
|
||||
USE_PCH="no"
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra include directories you wish to use?"
|
||||
echo "You may only need to do this if CMake is unable to locate"
|
||||
echo "missing dependencies without hints."
|
||||
echo "You can do this by: -DEXTRA_INCLUDE:STRING=/path/to/files;/path/to/more/files"
|
||||
echo "Separate directories with semicolons."
|
||||
echo "If you need no extra include directories, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_INCLUDE_DIRS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
EXTRA_INCLUDE_DIRS=""
|
||||
else
|
||||
EXTRA_INCLUDE_DIRS=$INPUT
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra library directories you wish to use?"
|
||||
echo "You may only need to do this if CMake is unable to locate"
|
||||
echo "missing dependencies without hints."
|
||||
echo "Separate directories with semicolons."
|
||||
echo "If you need no extra library directories, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_LIB_DIRS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
EXTRA_LIB_DIRS=""
|
||||
else
|
||||
EXTRA_LIB_DIRS=$INPUT
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra arguments you wish to pass to CMake?"
|
||||
echo "If you need no extra arugments to CMake, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
EXTRA_CONFIG_ARGS=$INPUT
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
EXTRA_CONFIG_ARGS=""
|
||||
else
|
||||
EXTRA_CONFIG_ARGS=$INPUT
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -350,6 +460,9 @@ RUNGROUP="$RUNGROUP"
|
||||
UMASK=$UMASK
|
||||
DEBUG="$DEBUG"
|
||||
USE_RUN_CC_PL="$USE_RUN_CC_PL"
|
||||
USE_PCH="$USE_PCH"
|
||||
EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
|
||||
EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
|
||||
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
|
||||
EOT
|
||||
echo "done."
|
||||
|
||||
BIN
Binary file not shown.
+47
-45
@@ -208,7 +208,7 @@ macro(read_from_file FILE REGEX STRINGS)
|
||||
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)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/cmake/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
|
||||
# Next we replace all newlines with semicolons
|
||||
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
||||
if(REGEX STREQUAL "")
|
||||
@@ -359,24 +359,22 @@ macro(find_includes SRC INCLUDES)
|
||||
endmacro(find_includes)
|
||||
|
||||
###############################################################################
|
||||
# calculate_depends(<source filename> <output variable set to TRUE on fail> [<optional output variable for 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 SKIP)
|
||||
# Temporarily set that we didn't get a 3nd argument before we actually check if we did get one or not
|
||||
macro(calculate_depends SRC)
|
||||
# Temporarily set that we didn't get a 3rd argument before we actually check if we did get one or not
|
||||
set(CHECK_ANGLE_INCLUDES FALSE)
|
||||
# Check for a third argument
|
||||
if(${ARGC} GREATER 2)
|
||||
if(${ARGC} GREATER 1)
|
||||
set(CHECK_ANGLE_INCLUDES TRUE)
|
||||
endif(${ARGC} GREATER 2)
|
||||
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)
|
||||
# Reset skip
|
||||
set(${SKIP} FALSE)
|
||||
# Iterate through the strings containing #include (if any)
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
@@ -392,16 +390,26 @@ macro(calculate_depends SRC SKIP)
|
||||
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)
|
||||
# This used to be find_in_list, but it was changed to this loop to do a find on each default include directory, this fixes Mac OS X trying to get it's framework directories in here
|
||||
set(FOUND_IN_DEFAULTS -1)
|
||||
foreach(DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIRS})
|
||||
string(REGEX REPLACE "\\+" "\\\\+" DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIR})
|
||||
string(REGEX MATCH ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT ${FOUND_${FILENAME}_INCLUDE})
|
||||
if(FOUND_DEFAULT)
|
||||
set(FOUND_IN_DEFAULTS 0)
|
||||
endif(FOUND_DEFAULT)
|
||||
endforeach(DEFAULT_INCLUDE_DIR)
|
||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
find_in_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
if(FOUND_IN_INCLUDES EQUAL -1)
|
||||
append_to_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}")
|
||||
append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}")
|
||||
endif(FOUND_IN_INCLUDES EQUAL -1)
|
||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
else(FOUND_${FILENAME}_INCLUDE)
|
||||
set(${SKIP} TRUE)
|
||||
message("${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.")
|
||||
# XXX
|
||||
if(NOT ${FILENAME} STREQUAL "libintl.h")
|
||||
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(NOT ${FILENAME} STREQUAL "libintl.h")
|
||||
endif(FOUND_${FILENAME}_INCLUDE)
|
||||
endif(CHECK_ANGLE_INCLUDES)
|
||||
endif(QUOTE_TYPE STREQUAL "angle brackets")
|
||||
@@ -409,12 +417,12 @@ macro(calculate_depends SRC SKIP)
|
||||
endmacro(calculate_depends)
|
||||
|
||||
###############################################################################
|
||||
# calculate_libraries(<source filename> <output variable set to TRUE on fail> <output variable for linker flags> <output variable for extra depends>)
|
||||
# calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
|
||||
#
|
||||
# This macro is used in most of the module (sub)directories to calculate the
|
||||
# library dependencies for the given source file.
|
||||
###############################################################################
|
||||
macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
# Set up a temporary LDFLAGS for this file
|
||||
set(THIS_LDFLAGS "${LDFLAGS}")
|
||||
# Reset extra dependencies
|
||||
@@ -423,8 +431,6 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
set(LIBRARY_PATHS)
|
||||
# Reset libraries
|
||||
set(LIBRARIES)
|
||||
# Default to not skipping this file
|
||||
set(${SKIP} FALSE)
|
||||
# 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
|
||||
@@ -437,9 +443,9 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
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 ${EXTRA_INCLUDE})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||
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)
|
||||
@@ -454,36 +460,32 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
append_to_list(LIBRARIES "${LIBRARY}")
|
||||
endif(MSVC)
|
||||
else(FOUND_${LIBRARY}_LIBRARY)
|
||||
# Skip this file
|
||||
set(${SKIP} TRUE)
|
||||
# In the case of the library not being found, we fatally error so CMake stops trying to generate
|
||||
message("${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
|
||||
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)
|
||||
if(NOT ${SKIP})
|
||||
# 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}")
|
||||
endif(NOT ${SKIP})
|
||||
# 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})
|
||||
append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}")
|
||||
endforeach(LIBRARY)
|
||||
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
|
||||
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
|
||||
endmacro(calculate_libraries)
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
# Find the header files, libs, and executables for gettext
|
||||
if(NOT WIN32)
|
||||
find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
|
||||
find_library(ICONV_LIBRARY iconv PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
|
||||
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
else(NOT WIN32)
|
||||
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
@@ -20,14 +21,14 @@ endif(NOT WIN32)
|
||||
|
||||
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use
|
||||
if(GETTEXT_FOUND)
|
||||
set(LIBINTL_INCLUDE "${GETTEXT_INCLUDE}/libintl.h")
|
||||
include_directories("${GETTEXT_INCLUDE}")
|
||||
set(GETTEXT_MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT})
|
||||
|
||||
if(WIN32)
|
||||
set(GETTEXT_LIBRARIES libiconv libintl libmingwex libgcc)
|
||||
else(WIN32)
|
||||
if(GETTEXT_LIBRARY)
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY} ${ICONV_LIBRARY})
|
||||
endif(GETTEXT_LIBRARY)
|
||||
endif(WIN32)
|
||||
endif(GETTEXT_FOUND)
|
||||
|
||||
@@ -525,7 +525,7 @@ FunctionEnd
|
||||
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt"
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.txt"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# 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 mysql/tables.sql)
|
||||
set(DATA example.chk botserv.example.conf example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
||||
install(FILES ${DATA}
|
||||
DESTINATION data
|
||||
DESTINATION ${CONF_DIR}
|
||||
)
|
||||
|
||||
@@ -0,0 +1,390 @@
|
||||
/*
|
||||
* Example configuration file for BotServ.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First, create the service.
|
||||
*/
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the BotServ client.
|
||||
* If you change this value, you probably want to change the client directive in the configuration for the botserv module too.
|
||||
*/
|
||||
nick = "BotServ"
|
||||
|
||||
/*
|
||||
* The username of the BotServ client.
|
||||
*/
|
||||
user = "services"
|
||||
|
||||
/*
|
||||
* The hostname of the BotServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
|
||||
/*
|
||||
* The realname of the BotServ client.
|
||||
*/
|
||||
gecos = "Bot Service"
|
||||
|
||||
/*
|
||||
* The modes this client should use.
|
||||
* Do not modify this unless you know what you are doing.
|
||||
*
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
|
||||
/*
|
||||
* An optional comma separated list of channels this service should join. Outside
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
|
||||
/*
|
||||
* Core BotServ module.
|
||||
*
|
||||
* Provides essential functionality for BotServ.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "botserv"
|
||||
|
||||
/*
|
||||
* The name of the client that should be BotServ.
|
||||
*/
|
||||
client = "BotServ"
|
||||
|
||||
/*
|
||||
* The default bot options for newly registered channels. Note that changing these options
|
||||
* will have no effect on channels which are already registered. The list must be separated
|
||||
* by spaces.
|
||||
*
|
||||
* The options are:
|
||||
* - dontkickops: Channel operators will be protected against BotServ kicks
|
||||
* - dontkickvoices: Voiced users will be protected against BotServ kicks
|
||||
* - greet: The channel's BotServ bot will greet incoming users that have set a greet
|
||||
* in their NickServ settings
|
||||
* - fantasy: Enables the use of BotServ fantasy commands in the channel
|
||||
*
|
||||
* This directive is optional, if left blank, there will be no defaults.
|
||||
*/
|
||||
defaults = "greet fantasy"
|
||||
|
||||
/*
|
||||
* The minimum number of users there must be in a channel before the bot joins it. The best
|
||||
* value for this setting is 1 or 2. This can be 0, the service bots will not part unless
|
||||
* specifically unassigned, and will keep the channel open.
|
||||
*/
|
||||
minusers = 1
|
||||
|
||||
/*
|
||||
* The bots are currently not affected by any modes or bans when they try to join a channel.
|
||||
* But some people may want to make it act like a real bot, that is, for example, remove all
|
||||
* the bans affecting the bot before joining the channel, remove a ban that affects the bot
|
||||
* set by a user when it is in the channel, and so on. Since it consumes a bit more CPU
|
||||
* time, you should not enable this on larger networks.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#smartjoin = yes
|
||||
|
||||
/*
|
||||
* Modes to set on service bots when they join channels, comment this out for no modes
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
botmodes = "ao"
|
||||
|
||||
/*
|
||||
* User modes to set on service bots. Read the comment about the service:modes directive
|
||||
* on why this can be a bad idea to set.
|
||||
*/
|
||||
#botumodes = "i"
|
||||
}
|
||||
|
||||
/*
|
||||
* Core BotServ commands.
|
||||
*
|
||||
* In Anope modules can provide (multiple) commands, each of which has a unique command name. Once these modules
|
||||
* are loaded you can then configure the commands to be added to any client you like with any name you like.
|
||||
*
|
||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "BotServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* bs_assign
|
||||
*
|
||||
* Provides the commands:
|
||||
* botserv/assign - Used to assign BotServ bots to channels
|
||||
* botserv/unassign - Used to unassign BotServ bots
|
||||
* botserv/set/nobot - Used to prohibit channels from being assigned BotServ bots.
|
||||
*
|
||||
* Used for assigning and unassigning bots to channels.
|
||||
*/
|
||||
module { name = "bs_assign" }
|
||||
command { service = "BotServ"; name = "ASSIGN"; command = "botserv/assign"; }
|
||||
command { service = "BotServ"; name = "UNASSIGN"; command = "botserv/unassign"; }
|
||||
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot"; }
|
||||
|
||||
/*
|
||||
* bs_autoassign
|
||||
*
|
||||
* Allows service bots to be automatically assigned to channels upon registration.
|
||||
*/
|
||||
#module { name = "bs_autoassign" }
|
||||
bs_autoassign
|
||||
{
|
||||
/*
|
||||
* Automatically assign ChanServ to channels upon registration.
|
||||
*/
|
||||
bot = "ChanServ"
|
||||
}
|
||||
|
||||
/*
|
||||
* bs_badwords
|
||||
*
|
||||
* Provides the command botserv/badwords.
|
||||
*
|
||||
* Used for controlling the channel badword list.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "bs_badwords"
|
||||
|
||||
/*
|
||||
* The maximum number of entries a single bad words list can have.
|
||||
*/
|
||||
badwordsmax = 32
|
||||
|
||||
/*
|
||||
* If set, BotServ will use case sensitive checking for badwords.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#casesensitive = yes
|
||||
}
|
||||
command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords"; }
|
||||
|
||||
/*
|
||||
* bs_bot
|
||||
*
|
||||
* Provides the command botserv/bot.
|
||||
*
|
||||
* Used for administrating BotServ bots.
|
||||
*/
|
||||
module { name = "bs_bot" }
|
||||
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; }
|
||||
|
||||
/*
|
||||
* bs_botlist
|
||||
*
|
||||
* Provides the command botserv/botlist.
|
||||
*
|
||||
* Used for listing all available bots.
|
||||
*/
|
||||
module { name = "bs_botlist" }
|
||||
command { service = "BotServ"; name = "BOTLIST"; command = "botserv/botlist"; }
|
||||
|
||||
/*
|
||||
* bs_control
|
||||
*
|
||||
* Provides the commands botserv/act and botserv/say.
|
||||
*
|
||||
* Used for making the bot message a channel.
|
||||
*/
|
||||
module { name = "bs_control" }
|
||||
command { service = "BotServ"; name = "ACT"; command = "botserv/act"; }
|
||||
command { service = "BotServ"; name = "SAY"; command = "botserv/say"; }
|
||||
|
||||
/*
|
||||
* bs_info
|
||||
*
|
||||
* Provides the command botserv/info.
|
||||
*
|
||||
* Used for getting information on bots or channels.
|
||||
*/
|
||||
module { name = "bs_info" }
|
||||
command { service = "BotServ"; name = "INFO"; command = "botserv/info"; }
|
||||
|
||||
/*
|
||||
* bs_kick
|
||||
*
|
||||
* Provides the commands:
|
||||
* botserv/kick - Dummy help wrapper for the KICK command.
|
||||
* botserv/kick/amsg - Configures BotServ's AMSG kicker.
|
||||
* botserv/kick/badwords - Configures BotServ's badwords kicker.
|
||||
* botserv/kick/bolds - Configures BotServ's bold text kiceker.
|
||||
* botserv/kick/caps - Configures BotServ's capital letters kicker.
|
||||
* botserv/kick/colors - Configures BotServ's color kicker.
|
||||
* botserv/kick/flood - Configures BotServ's flood kicker.
|
||||
* botserv/kick/italics - Configures BotServ's italics kicker.
|
||||
* botserv/kick/repeat - Configures BotServ's repeat kicker.
|
||||
* botserv/kick/reverses - Configures BotServ's reverse kicker.
|
||||
* botserv/kick/underlines - Configures BotServ's reverse kicker.
|
||||
* botserv/set/dontkickops - Used for preventing BotServ from kicking channel operators.
|
||||
* botserv/set/dontkickvoices - Used for preventing BotServ from kicking voices.
|
||||
*
|
||||
* Used for configuring what bots should kick for.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "bs_kick"
|
||||
|
||||
/*
|
||||
* The amount of time that data for a user is valid in BotServ. If the data exceeds this time,
|
||||
* it is reset or deleted depending on the case. Do not set it too high, otherwise your
|
||||
* resources will be slightly affected.
|
||||
*/
|
||||
keepdata = 10m
|
||||
|
||||
/*
|
||||
* If set, the bots will use a kick reason that does not state the word when it is kicking.
|
||||
* This is especially useful if you have young people on your network.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
gentlebadwordreason = yes
|
||||
}
|
||||
command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; }
|
||||
command { service = "BotServ"; name = "KICK AMSG"; command = "botserv/kick/amsg"; }
|
||||
command { service = "BotServ"; name = "KICK BADWORDS"; command = "botserv/kick/badwords"; }
|
||||
command { service = "BotServ"; name = "KICK BOLDS"; command = "botserv/kick/bolds"; }
|
||||
command { service = "BotServ"; name = "KICK CAPS"; command = "botserv/kick/caps"; }
|
||||
command { service = "BotServ"; name = "KICK COLORS"; command = "botserv/kick/colors"; }
|
||||
command { service = "BotServ"; name = "KICK FLOOD"; command = "botserv/kick/flood"; }
|
||||
command { service = "BotServ"; name = "KICK ITALICS"; command = "botserv/kick/italics"; }
|
||||
command { service = "BotServ"; name = "KICK REPEAT"; command = "botserv/kick/repeat"; }
|
||||
command { service = "BotServ"; name = "KICK REVERSES"; command = "botserv/kick/reverses"; }
|
||||
command { service = "BotServ"; name = "KICK UNDERLINES"; command = "botserv/kick/underlines"; }
|
||||
|
||||
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; }
|
||||
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
|
||||
|
||||
|
||||
/*
|
||||
* bs_set
|
||||
*
|
||||
* Provides the commands:
|
||||
* botserv/set/private - Used to prohibit specific BotServ bots from being assigned to channels.
|
||||
*/
|
||||
module { name = "bs_set" }
|
||||
command { service = "BotServ"; name = "SET"; command = "botserv/set"; }
|
||||
command { service = "BotServ"; name = "SET BANEXPIRE"; command = "botserv/set/banexpire"; }
|
||||
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private"; }
|
||||
|
||||
/*
|
||||
* greet
|
||||
*
|
||||
* Provides the commands:
|
||||
* botserv/set/greet - Used for enabling or disabling BotServ's greet messages in a channel.
|
||||
* nickserv/set/greet, nickserv/saset/greet - Used for changing a users greet message, which is displayed when they enter channels.
|
||||
*/
|
||||
module { name = "greet" }
|
||||
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
|
||||
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; }
|
||||
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; }
|
||||
|
||||
/*
|
||||
* GREET privilege.
|
||||
*
|
||||
* Used by 'greet'.
|
||||
*
|
||||
* Users with this privilege have their greet shown when they join channels.
|
||||
*/
|
||||
privilege
|
||||
{
|
||||
name = "GREET"
|
||||
rank = 40
|
||||
level = 5
|
||||
flag = "g"
|
||||
xop = "AOP"
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* fantasy
|
||||
*
|
||||
* Allows 'fantaisist' commands to be used in channels.
|
||||
*
|
||||
* Provides the commands:
|
||||
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "fantasy"
|
||||
|
||||
/*
|
||||
* Defines the prefixes for fantasy commands in channels. One of these characters will have to be prepended
|
||||
* to all fantasy commands. If you choose "!", for example, fantasy commands will be "!kick",
|
||||
* "!op", etc. This directive is optional, if left out, the default fantasy character is "!".
|
||||
*/
|
||||
#fantasycharacter = "!."
|
||||
}
|
||||
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
|
||||
|
||||
/*
|
||||
* Fantasy commands
|
||||
*
|
||||
* Fantasy commands can be executed in channels that have a BotServ bot by prefixing the
|
||||
* command with one of the fantasy characters configured in botserv's fantasycharacter
|
||||
* directive.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
fantasy { name = "ACCESS"; command = "chanserv/access"; }
|
||||
fantasy { name = "AKICK"; command = "chanserv/akick"; }
|
||||
fantasy { name = "AOP"; command = "chanserv/xop"; }
|
||||
fantasy { name = "BAN"; command = "chanserv/ban"; }
|
||||
fantasy { name = "CLONE"; command = "chanserv/clone"; }
|
||||
fantasy { name = "DEHALFOP"; command = "chanserv/modes"; }
|
||||
fantasy { name = "DEOP"; command = "chanserv/modes"; }
|
||||
fantasy { name = "DEOWNER"; command = "chanserv/modes"; }
|
||||
fantasy { name = "DEPROTECT"; command = "chanserv/modes"; }
|
||||
fantasy { name = "DEVOICE"; command = "chanserv/modes"; }
|
||||
fantasy { name = "DOWN"; command = "chanserv/down"; }
|
||||
fantasy { name = "ENFORCE"; command = "chanserv/enforce"; }
|
||||
fantasy { name = "ENTRYMSG"; command = "chanserv/entrymsg"; }
|
||||
fantasy { name = "FLAGS"; command = "chanserv/flags"; }
|
||||
fantasy { name = "HALFOP"; command = "chanserv/modes"; }
|
||||
fantasy { name = "HELP"; command = "generic/help"; prepend_channel = false; }
|
||||
fantasy { name = "HOP"; command = "chanserv/xop"; }
|
||||
fantasy { name = "INFO"; command = "chanserv/info"; prepend_channel = false; }
|
||||
fantasy { name = "INVITE"; command = "chanserv/invite"; }
|
||||
fantasy { name = "K"; command = "chanserv/kick"; }
|
||||
fantasy { name = "KB"; command = "chanserv/ban"; }
|
||||
fantasy { name = "KICK"; command = "chanserv/kick"; }
|
||||
fantasy { name = "LEVELS"; command = "chanserv/levels"; }
|
||||
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; }
|
||||
fantasy { name = "LOG"; command = "chanserv/log"; }
|
||||
fantasy { name = "MODE"; command = "chanserv/mode"; }
|
||||
fantasy { name = "OP"; command = "chanserv/modes"; }
|
||||
fantasy { name = "OWNER"; command = "chanserv/modes"; }
|
||||
fantasy { name = "PROTECT"; command = "chanserv/modes"; }
|
||||
fantasy { name = "QOP"; command = "chanserv/xop"; }
|
||||
fantasy { name = "SEEN"; command = "chanserv/seen"; prepend_channel = false; }
|
||||
fantasy { name = "SOP"; command = "chanserv/xop"; }
|
||||
fantasy { name = "STATUS"; command = "chanserv/status"; }
|
||||
fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; }
|
||||
fantasy { name = "SYNC"; command = "chanserv/sync"; }
|
||||
fantasy { name = "TOPIC"; command = "chanserv/topic"; }
|
||||
fantasy { name = "UNBAN"; command = "chanserv/unban"; }
|
||||
fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
|
||||
fantasy { name = "UP"; command = "chanserv/up"; }
|
||||
fantasy { name = "VOICE"; command = "chanserv/modes"; }
|
||||
fantasy { name = "VOP"; command = "chanserv/xop"; }
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Example configuration file for Chanstats.
|
||||
* Make sure BotServ, ChanServ and NickServ are running.
|
||||
*/
|
||||
|
||||
module
|
||||
{
|
||||
name = "m_chanstats"
|
||||
|
||||
/*
|
||||
* The name of this engine.
|
||||
* This must match with the name of an SQL engine block.
|
||||
*/
|
||||
|
||||
engine = "mysql/main"
|
||||
|
||||
/*
|
||||
* An optional prefix to prepended to the name of each created table.
|
||||
* Do not use the same prefix for other programs.
|
||||
*/
|
||||
prefix = "anope_"
|
||||
|
||||
smileyshappy = ":) :-) ;) ;-) :D :-D :P :-P"
|
||||
smileyssad = ":( :-( ;( ;-("
|
||||
smileysother = ":/ :-/"
|
||||
|
||||
/*
|
||||
* Enable Chanstats for newly registered nicks / channels.
|
||||
* Set it to 0 to disable it.
|
||||
*/
|
||||
NSDefChanstats = 1
|
||||
CSDefChanstats = 1
|
||||
}
|
||||
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
|
||||
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
|
||||
command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/saset/chanstats"; }
|
||||
|
||||
module { name = "cs_fantasy_stats" }
|
||||
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; }
|
||||
command { service = "ChanServ"; name = "GSTATS"; command = "chanserv/gstats"; }
|
||||
fantasy { name = "STATS"; command = "chanserv/stats"; }
|
||||
fantasy { name = "GSTATS"; command = "chanserv/gstats"; }
|
||||
|
||||
module { name = "cs_fantasy_top" }
|
||||
command { service = "ChanServ"; name = "TOP"; command = "chanserv/top"; }
|
||||
command { service = "ChanServ"; name = "TOP10"; command = "chanserv/top10"; }
|
||||
command { service = "ChanServ"; name = "GTOP"; command = "chanserv/gtop"; }
|
||||
command { service = "ChanServ"; name = "GTOP10"; command = "chanserv/gtop10"; }
|
||||
fantasy { name = "TOP"; command = "chanserv/top"; }
|
||||
fantasy { name = "TOP10"; command = "chanserv/top10"; }
|
||||
fantasy { name = "GTOP"; command = "chanserv/gtop"; }
|
||||
fantasy { name = "GTOP10"; command = "chanserv/gtop10"; }
|
||||
+711
-1247
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Example configuration file for Global.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First, create the service.
|
||||
*/
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the Global client.
|
||||
* If you change this value, you probably want to change the client directive in the configuration for the global module too.
|
||||
*/
|
||||
nick = "Global"
|
||||
|
||||
/*
|
||||
* The username of the Global client.
|
||||
*/
|
||||
user = "services"
|
||||
|
||||
/*
|
||||
* The hostname of the Global client.
|
||||
*/
|
||||
host = "services.host"
|
||||
|
||||
/*
|
||||
* The realname of the Global client.
|
||||
*/
|
||||
gecos = "Global Noticer"
|
||||
|
||||
/*
|
||||
* The modes this client should use.
|
||||
* Do not modify this unless you know what you are doing.
|
||||
*
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
|
||||
/*
|
||||
* An optional comma separated list of channels this service should join. Outside
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
|
||||
/*
|
||||
* Core Global module.
|
||||
*
|
||||
* Provides essential functionality for Global.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "global"
|
||||
|
||||
/*
|
||||
* The name of the client that should be Global.
|
||||
*/
|
||||
client = "Global"
|
||||
|
||||
/*
|
||||
* This is the global message that will be sent when Services are being
|
||||
* shutdown/restarted.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#globaloncycledown = "Services are restarting, they will be back shortly - please be good while we're gone"
|
||||
|
||||
/*
|
||||
* This is the global message that will be sent when Services (re)join the
|
||||
* network.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#globaloncycleup = "Services are now back online - have a nice day"
|
||||
|
||||
/*
|
||||
* If set, Services will hide the IRC Operator's nick in a global
|
||||
* message/notice.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#anonymousglobal = yes
|
||||
}
|
||||
|
||||
/*
|
||||
* Core Global commands.
|
||||
*
|
||||
* In Anope modules can provide (multiple) commands, each of which has a unique command name. Once these modules
|
||||
* are loaded you can then configure the commands to be added to any client you like with any name you like.
|
||||
*
|
||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* gl_global
|
||||
*
|
||||
* Provides the command global/global.
|
||||
*
|
||||
* Used for sending a message to every online user.
|
||||
*/
|
||||
module { name = "gl_global" }
|
||||
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Example configuration file for HostServ.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First, create the service.
|
||||
*/
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the HostServ client.
|
||||
* If you change this value, you probably want to change the client directive in the configuration for the hostserv module too.
|
||||
*/
|
||||
nick = "HostServ"
|
||||
|
||||
/*
|
||||
* The username of the HostServ client.
|
||||
*/
|
||||
user = "services"
|
||||
|
||||
/*
|
||||
* The hostname of the HostServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
|
||||
/*
|
||||
* The realname of the HostServ client.
|
||||
*/
|
||||
gecos = "vHost Service"
|
||||
|
||||
/*
|
||||
* The modes this client should use.
|
||||
* Do not modify this unless you know what you are doing.
|
||||
*
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
|
||||
/*
|
||||
* An optional comma separated list of channels this service should join. Outside
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
|
||||
/*
|
||||
* Core HostServ module.
|
||||
*
|
||||
* Provides essential functionality for HostServ.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "hostserv"
|
||||
|
||||
/*
|
||||
* The name of the client that should be HostServ.
|
||||
*/
|
||||
client = "HostServ"
|
||||
|
||||
/*
|
||||
* If enabled, vhosts are activated on users immediately when they are set.
|
||||
*/
|
||||
activate_on_set = false
|
||||
}
|
||||
|
||||
/*
|
||||
* Core HostServ commands.
|
||||
*
|
||||
* In Anope modules can provide (multiple) commands, each of which has a unique command name. Once these modules
|
||||
* are loaded you can then configure the commands to be added to any client you like with any name you like.
|
||||
*
|
||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "HostServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* hs_del
|
||||
*
|
||||
* Provides the commands hostserv/del and hostserv/delall.
|
||||
*
|
||||
* Used for removing users' vHosts.
|
||||
*/
|
||||
module { name = "hs_del" }
|
||||
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; permission = "hostserv/del"; }
|
||||
command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; permission = "hostserv/del"; }
|
||||
|
||||
/*
|
||||
* hs_group
|
||||
*
|
||||
* Provides the command hostserv/group.
|
||||
*
|
||||
* Used for grouping one vHost to many nicks.
|
||||
*/
|
||||
module { name = "hs_group" }
|
||||
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
|
||||
|
||||
/*
|
||||
* hs_list
|
||||
*
|
||||
* Provides the command hostserv/list.
|
||||
*
|
||||
* Used for listing actively set vHosts.
|
||||
*/
|
||||
module { name = "hs_list" }
|
||||
command { service = "HostServ"; name = "LIST"; command = "hostserv/list"; permission = "hostserv/list"; }
|
||||
|
||||
/*
|
||||
* hs_off
|
||||
*
|
||||
* Provides the command hostserv/off.
|
||||
*
|
||||
* Used for turning off your vHost.
|
||||
*/
|
||||
module { name = "hs_off" }
|
||||
command { service = "HostServ"; name = "OFF"; command = "hostserv/off"; }
|
||||
|
||||
/*
|
||||
* hs_on
|
||||
*
|
||||
* Provides the command hostserv/on.
|
||||
*
|
||||
* Used for turning on your vHost.
|
||||
*/
|
||||
module { name = "hs_on" }
|
||||
command { service = "HostServ"; name = "ON"; command = "hostserv/on"; }
|
||||
|
||||
/*
|
||||
* hs_request
|
||||
*
|
||||
* Provides the commands hostserv/request, hostserv/active, hostserv/reject, and hostserv/waiting.
|
||||
*
|
||||
* Used to manage vHosts requested by users.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "hs_request"
|
||||
|
||||
/*
|
||||
* If set, Services will send a memo to the user requesting a vHost when it's been
|
||||
* approved or rejected.
|
||||
*/
|
||||
#memouser = yes
|
||||
|
||||
/*
|
||||
* If set, Services will send a memo to all Services staff when a new vHost is requested.
|
||||
*/
|
||||
#memooper = yes
|
||||
}
|
||||
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request"; }
|
||||
command { service = "HostServ"; name = "ACTIVATE"; command = "hostserv/activate"; permission = "hostserv/set"; }
|
||||
command { service = "HostServ"; name = "REJECT"; command = "hostserv/reject"; permission = "hostserv/set"; }
|
||||
command { service = "HostServ"; name = "WAITING"; command = "hostserv/waiting"; permission = "hostserv/set"; }
|
||||
|
||||
/*
|
||||
* hs_set
|
||||
*
|
||||
* Provides the commands hostserv/set and hostserv/setall.
|
||||
*
|
||||
* Used for setting users' vHosts.
|
||||
*/
|
||||
module { name = "hs_set" }
|
||||
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; permission = "hostserv/set"; }
|
||||
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; permission = "hostserv/set"; }
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Example configuration file for the irc2sql gateway
|
||||
*
|
||||
*/
|
||||
|
||||
module
|
||||
{
|
||||
name = "irc2sql"
|
||||
|
||||
/*
|
||||
* The name of this engine.
|
||||
* This must match with the name in the mysql{ } block
|
||||
*/
|
||||
engine ="mysql/main"
|
||||
|
||||
/*
|
||||
* An optional prefix to prepended to the name of each created table.
|
||||
* Do not use the same prefix for other programs.
|
||||
*/
|
||||
|
||||
prefix = "anope_"
|
||||
|
||||
/*
|
||||
* GeoIP - Automagically add a users geoip to the user table.
|
||||
* Tables are created by irc2sql, you have to run the
|
||||
* geoipupdate script after you started anope to download
|
||||
* and import the actual geoip database
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Enable GeoIP Lookup
|
||||
*/
|
||||
GeoIPLookup = yes
|
||||
|
||||
/*
|
||||
* Chose between the smaller 'country' or the bigger 'city' database.
|
||||
*
|
||||
*/
|
||||
GeoIPDatabase = "country"
|
||||
|
||||
/*
|
||||
* The name of the client that should send the CTCP VERSION requests.
|
||||
* It must already exist or must be defined in the following service block.
|
||||
*/
|
||||
client = "StatServ"
|
||||
|
||||
/*
|
||||
* Get the CTCP version from users
|
||||
* The users connecting to the network will receive a CTCP VERSION
|
||||
* request from the above configured services client
|
||||
*/
|
||||
ctcpuser = "yes"
|
||||
|
||||
/*
|
||||
* Send out CTCP VERSION requests to users during burst.
|
||||
* Disable this if you restart Anope often and don't want to
|
||||
* annoy your users.
|
||||
*/
|
||||
ctcpeob = "yes"
|
||||
}
|
||||
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the StatServ client.
|
||||
*/
|
||||
nick = "StatServ"
|
||||
|
||||
/*
|
||||
* The username of the StatServ client.
|
||||
*/
|
||||
user = "StatServ"
|
||||
|
||||
/*
|
||||
* The hostname of the StatServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
|
||||
/*
|
||||
* The realname of the StatServ client.
|
||||
*/
|
||||
gecos = "Statistical Service"
|
||||
|
||||
/*
|
||||
* The modes this client should use.
|
||||
* Do not modify this unless you know what you are doing.
|
||||
*
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
|
||||
/*
|
||||
* An optional comma separated list of channels this service should join. Outside
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Example configuration file for MemoServ.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First, create the service.
|
||||
*/
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the MemoServ client.
|
||||
* If you change this value, you probably want to change the client directive in the configuration for the memoserv module too.
|
||||
*/
|
||||
nick = "MemoServ"
|
||||
|
||||
/*
|
||||
* The username of the MemoServ client.
|
||||
*/
|
||||
user = "services"
|
||||
|
||||
/*
|
||||
* The hostname of the MemoServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
|
||||
/*
|
||||
* The realname of the MemoServ client.
|
||||
*/
|
||||
gecos = "Memo Service"
|
||||
|
||||
/*
|
||||
* The modes this client should use.
|
||||
* Do not modify this unless you know what you are doing.
|
||||
*
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
|
||||
/*
|
||||
* An optional comma separated list of channels this service should join. Outside
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
|
||||
/*
|
||||
* Core MemoServ module.
|
||||
*
|
||||
* Provides essential functionality for MemoServ.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "memoserv"
|
||||
/*
|
||||
* The name of the client that should be MemoServ. Clients are configured
|
||||
* with the service blocks.
|
||||
*/
|
||||
client = "MemoServ"
|
||||
|
||||
/*
|
||||
* The maximum number of memos a user is allowed to keep by default. Normal users may set the
|
||||
* limit anywhere between 0 and this value. Services Admins can change it to any value or
|
||||
* disable it.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set, the limit is disabled
|
||||
* by default, and normal users can set any limit they want.
|
||||
*/
|
||||
maxmemos = 20
|
||||
|
||||
/*
|
||||
* The delay between consecutive uses of the MemoServ SEND command. This can help prevent spam
|
||||
* as well as denial-of-service attacks from sending large numbers of memos and filling up disk
|
||||
* space (and memory). The default 3-second wait means a maximum average of 150 bytes of memo
|
||||
* per second per user under the current IRC protocol.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
senddelay = 3s
|
||||
}
|
||||
|
||||
/*
|
||||
* Core MemoServ commands.
|
||||
*
|
||||
* In Anope modules can provide (multiple) commands, each of which has a unique command name. Once these modules
|
||||
* are loaded you can then configure the commands to be added to any client you like with any name you like.
|
||||
*
|
||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "MemoServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* ms_cancel
|
||||
*
|
||||
* Provides the command memoserv/cancel.
|
||||
*
|
||||
* Used to cancel memos already sent but not yet read.
|
||||
*/
|
||||
module { name = "ms_cancel" }
|
||||
command { service = "MemoServ"; name = "CANCEL"; command = "memoserv/cancel"; }
|
||||
|
||||
/*
|
||||
* ms_check
|
||||
*
|
||||
* Provides the command memoserv/check.
|
||||
*
|
||||
* Used to check if a sent memo has been read.
|
||||
*/
|
||||
module { name = "ms_check" }
|
||||
command { service = "MemoServ"; name = "CHECK"; command = "memoserv/check"; }
|
||||
|
||||
/*
|
||||
* ms_del
|
||||
*
|
||||
* Provides the command memoserv/del.
|
||||
*
|
||||
* Used to delete your memos.
|
||||
*/
|
||||
module { name = "ms_del" }
|
||||
command { service = "MemoServ"; name = "DEL"; command = "memoserv/del"; }
|
||||
|
||||
/*
|
||||
* ms_ignore
|
||||
*
|
||||
* Provides the command memoserv/ignore.
|
||||
*
|
||||
* Used to ignore memos from specific users.
|
||||
*/
|
||||
module { name = "ms_ignore" }
|
||||
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
|
||||
|
||||
/*
|
||||
* ms_info
|
||||
*
|
||||
* Provides the command memoserv/info.
|
||||
*
|
||||
* Used to show memo related information about an account or a channel.
|
||||
*/
|
||||
module { name = "ms_info" }
|
||||
command { service = "MemoServ"; name = "INFO"; command = "memoserv/info"; }
|
||||
|
||||
/*
|
||||
* ms_list
|
||||
*
|
||||
* Provides the command memoserv/list.
|
||||
*
|
||||
* Used to list your current memos.
|
||||
*/
|
||||
module { name = "ms_list" }
|
||||
command { service = "MemoServ"; name = "LIST"; command = "memoserv/list"; }
|
||||
|
||||
/*
|
||||
* ms_read
|
||||
*
|
||||
* Provides the command memoserv/read.
|
||||
*
|
||||
* Used to read your memos.
|
||||
*/
|
||||
module { name = "ms_read" }
|
||||
command { service = "MemoServ"; name = "READ"; command = "memoserv/read"; }
|
||||
|
||||
/*
|
||||
* ms_rsend
|
||||
*
|
||||
* Provides the command memoserv/rsend.
|
||||
*
|
||||
* Used to send a memo requiring a receipt be sent back once it is read.
|
||||
*
|
||||
* Requires configuring memoserv:memoreceipt.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "ms_rsend"
|
||||
|
||||
/*
|
||||
* Only allow Services Operators to use ms_rsend.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
operonly = false
|
||||
}
|
||||
#command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend"; }
|
||||
|
||||
/*
|
||||
* ms_send
|
||||
*
|
||||
* Provides the command memoserv/send.
|
||||
*
|
||||
* Used to send memos.
|
||||
*/
|
||||
module { name = "ms_send" }
|
||||
command { service = "MemoServ"; name = "SEND"; command = "memoserv/send"; }
|
||||
|
||||
/*
|
||||
* ms_sendall
|
||||
*
|
||||
* Provides the command memoserv/sendall.
|
||||
*
|
||||
* Used to send a mass memo to every registered user.
|
||||
*/
|
||||
module { name = "ms_sendall" }
|
||||
command { service = "MemoServ"; name = "SENDALL"; command = "memoserv/sendall"; permission = "memoserv/sendall"; }
|
||||
|
||||
/*
|
||||
* ms_set
|
||||
*
|
||||
* Provides the command memoserv/set.
|
||||
*
|
||||
* Used to set settings such as how you are notified of new memos, and your memo limit.
|
||||
*/
|
||||
module { name = "ms_set" }
|
||||
command { service = "MemoServ"; name = "SET"; command = "memoserv/set"; }
|
||||
|
||||
/*
|
||||
* ms_staff
|
||||
*
|
||||
* Provides the command memoserv/staff.
|
||||
*
|
||||
* Used to send a memo to all registered staff members.
|
||||
*/
|
||||
module { name = "ms_staff" }
|
||||
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; permission = "memoserv/staff"; }
|
||||
@@ -0,0 +1,678 @@
|
||||
/*
|
||||
* [OPTIONAL] Non-Core Modules
|
||||
*
|
||||
* The following blocks are used to load all non-core modules, including 3rd-party modules.
|
||||
* Modules can be prevented from loading by commenting out the line, other modules can be added by
|
||||
* adding a module block. These modules will be loaded prior to Services connecting to your network.
|
||||
*
|
||||
* Note that some of these modules are labeled EXTRA, and must be enabled prior to compiling by
|
||||
* running the 'extras' script on Linux and UNIX.
|
||||
*/
|
||||
|
||||
/*
|
||||
* help
|
||||
*
|
||||
* Provides the command generic/help.
|
||||
*
|
||||
* This is a generic help command that can be used with any client.
|
||||
*/
|
||||
module { name = "help" }
|
||||
|
||||
/*
|
||||
* m_dns
|
||||
*
|
||||
* Adds support for the DNS protocol. By itself this module does nothing useful,
|
||||
* but other modules such as m_dnsbl and os_dns require this.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_dns"
|
||||
|
||||
/*
|
||||
* The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file.
|
||||
* The below should work fine on all unix like systems. Windows users will have to find their nameservers
|
||||
* from ipconfig /all and put the IP here.
|
||||
*/
|
||||
nameserver = "/etc/resolv.conf"
|
||||
#nameserver = "127.0.0.1"
|
||||
|
||||
/*
|
||||
* How long to wait in seconds before a DNS query has timed out.
|
||||
*/
|
||||
timeout = 5
|
||||
|
||||
|
||||
/* Only edit below if you are expecting to use os_dns or otherwise answer DNS queries. */
|
||||
|
||||
/*
|
||||
* The IP and port services use to listen for DNS queries.
|
||||
* Note that ports less than 1024 are privileged on UNIX/Linux systems, and
|
||||
* require Anope to be started as root. If you do this, it is recommended you
|
||||
* set options:user and options:group so Anope can change users after binding
|
||||
* to this port.
|
||||
*/
|
||||
ip = "0.0.0.0"
|
||||
port = 53
|
||||
|
||||
|
||||
/*
|
||||
* SOA record information.
|
||||
*/
|
||||
|
||||
/* E-mail address of the DNS administrator. */
|
||||
admin = "admin@example.com"
|
||||
|
||||
/* This should be the names of the public facing nameservers serving the records. */
|
||||
nameservers = "ns1.example.com ns2.example.com"
|
||||
|
||||
/* The time slave servers are allowed to cache. This should be reasonably low
|
||||
* if you want your records to be updated without much delay.
|
||||
*/
|
||||
refresh = 3600
|
||||
|
||||
/* A notify block. There should probably be one per nameserver listed in 'nameservers'.
|
||||
*/
|
||||
notify
|
||||
{
|
||||
ip = "192.0.2.0"
|
||||
port = 53
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_dnsbl
|
||||
*
|
||||
* Allows configurable DNS blacklists to check connecting users against. If a user
|
||||
* is found on the blacklist they will be immediately banned. This is a crucial module
|
||||
* to prevent bot attacks.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_dnsbl"
|
||||
|
||||
/*
|
||||
* If set, Services will check clients against the DNSBLs when services connect to its uplink.
|
||||
* This is not recommended, and on large networks will open a very large amount of DNS queries.
|
||||
* Whilst services are not drastically affected by this, your nameserver/DNSBL might care.
|
||||
*/
|
||||
check_on_connect = no
|
||||
|
||||
/*
|
||||
* If set, Services will check clients when coming back from a netsplit. This can cause a large number
|
||||
* of DNS queries open at once. Whilst services are not drastically affected by this, your nameserver/DNSBL
|
||||
* might care.
|
||||
*/
|
||||
check_on_netburst = no
|
||||
|
||||
/*
|
||||
* If set, OperServ will add clients found in the DNSBL to the akill list. Without it, OperServ simply sends
|
||||
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
|
||||
*/
|
||||
add_to_akill = yes
|
||||
|
||||
blacklist
|
||||
{
|
||||
/* Name of the blacklist. */
|
||||
name = "rbl.efnetrbl.org"
|
||||
|
||||
/* How long to set the ban for. */
|
||||
time = 4h
|
||||
|
||||
/* Reason for akill.
|
||||
* %n is the nick of the user
|
||||
* %u is the ident/username of the user
|
||||
* %g is the realname of the user
|
||||
* %h is the hostname of the user
|
||||
* %i is the IP of the user
|
||||
* %r is the reason (configured below). Will be nothing if not configured.
|
||||
* %N is the network name set in networkinfo:networkname
|
||||
*/
|
||||
reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
|
||||
|
||||
/* Replies to ban and their reason. If this is totally omitted all replies get banned. */
|
||||
1 = "Open Proxy"
|
||||
/* Don't ban for result 2 or 3 */
|
||||
#2 = "spamtrap666"
|
||||
#3 = "spamtrap50"
|
||||
4 = "TOR"
|
||||
5 = "Drones / Flooding"
|
||||
}
|
||||
|
||||
blacklist
|
||||
{
|
||||
name = "dnsbl.dronebl.org"
|
||||
time = 4h
|
||||
reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded?ip=%i&network=%N"
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_helpchan
|
||||
*
|
||||
* Gives users who are op in the specified help channel usermode +h (helpop).
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_helpchan"
|
||||
|
||||
helpchannel = "#help"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_httpd [EXTRA]
|
||||
*
|
||||
* Allows services to serve web pages. By itself, this module does nothing useful.
|
||||
*
|
||||
* Note that using this will allow users to get the IP of your services.
|
||||
* To prevent this we recommend using a reverse proxy or a tunnel.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_httpd"
|
||||
|
||||
httpd
|
||||
{
|
||||
/* Name of this service. */
|
||||
name = "httpd/main"
|
||||
|
||||
/* IP to listen on. */
|
||||
ip = "0.0.0.0"
|
||||
|
||||
/* Port to listen on. */
|
||||
port = 8080
|
||||
|
||||
/* Time before connections to this server are timed out. */
|
||||
timeout = 30
|
||||
|
||||
/* Listen using SSL. Requires m_ssl. */
|
||||
#ssl = yes
|
||||
|
||||
/* If you are using a reverse proxy that sends one of the
|
||||
* extforward_headers set below, set this to its IP.
|
||||
* This allows services to obtain the real IP of users by
|
||||
* reading the forwarded-for HTTP header.
|
||||
*/
|
||||
#extforward_ip = "192.168.0.255"
|
||||
|
||||
/* The header to look for. These probably work as is. */
|
||||
extforward_header = "X-Forwarded-For Forwarded-For"
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ldap [EXTRA]
|
||||
*
|
||||
* This module allows other modules to use LDAP. By itself, this module does nothing useful.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ldap"
|
||||
|
||||
ldap
|
||||
{
|
||||
server = "ldap://127.0.0.1"
|
||||
port = 389
|
||||
|
||||
/*
|
||||
* Admin credentials used for performing searches and adding users.
|
||||
*/
|
||||
admin_binddn = "cn=Manager,dc=anope,dc=org"
|
||||
admin_password = "secret"
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ldap_authentication [EXTRA]
|
||||
*
|
||||
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
|
||||
* LDAP to authenticate users. Requires m_ldap.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ldap_authentication"
|
||||
|
||||
/*
|
||||
* The distinguished name used for searching for users's accounts.
|
||||
*/
|
||||
basedn = "ou=users,dc=anope,dc=org"
|
||||
|
||||
/*
|
||||
* The search filter used to look up users's accounts.
|
||||
* %account is replaced with the user's account.
|
||||
* %object_class is replaced with the object_class configured below.
|
||||
*/
|
||||
search_filter = "(&(uid=%account)(objectClass=%object_class))"
|
||||
|
||||
/*
|
||||
* The object class used by LDAP to store user account information.
|
||||
* This is used for adding new users to LDAP if registration is allowed.
|
||||
*/
|
||||
object_class = "anopeUser"
|
||||
|
||||
/*
|
||||
* The attribute value used for account names.
|
||||
*/
|
||||
username_attribute = "uid"
|
||||
|
||||
/*
|
||||
* The attribute value used for email addresses.
|
||||
* This directive is optional.
|
||||
*/
|
||||
email_attribute = "email"
|
||||
|
||||
/*
|
||||
* The attribute value used for passwords.
|
||||
* Used when registering new accounts in LDAP.
|
||||
*/
|
||||
password_attribute = "userPassword"
|
||||
|
||||
/*
|
||||
* If set, the reason to give the users who try to "/msg NickServ REGISTER".
|
||||
* If not set, then registration is not blocked.
|
||||
*/
|
||||
#disable_register_reason = "To register on this network visit http://some.misconfigured.site/register"
|
||||
|
||||
/*
|
||||
* If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
|
||||
* If not set, then email changing is not blocked.
|
||||
*/
|
||||
#disable_email_reason = "To change your email address visit http://some.misconfigured.site"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ldap_oper [EXTRA]
|
||||
*
|
||||
* This module dynamically ties users to Anope opertypes when they identify
|
||||
* via LDAP group membership. Requires m_ldap.
|
||||
*
|
||||
* Note that this doesn't give the user privileges on the IRCd, only in Services.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ldap_oper"
|
||||
|
||||
/*
|
||||
* An optional binddn to use when searching for groups.
|
||||
* %a is replaced with the account name of the user.
|
||||
*/
|
||||
#binddn = "cn=Manager,dc=anope,dc=org"
|
||||
|
||||
/*
|
||||
* An optional password to bind with.
|
||||
*/
|
||||
#password = "secret"
|
||||
|
||||
/*
|
||||
* The base DN where the groups are.
|
||||
*/
|
||||
basedn = "ou=groups,dc=anope,dc=org"
|
||||
|
||||
/*
|
||||
* The filter to use when searching for users.
|
||||
* %a is replaced with the account name of the user.
|
||||
*/
|
||||
filter = "(member=uid=%a,ou=users,dc=anope,dc=org)"
|
||||
|
||||
/*
|
||||
* The attribute of the group that is the name of the opertype.
|
||||
* The cn attribute should match a known opertype in the config.
|
||||
*/
|
||||
opertype_attribute = "cn"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_mysql [EXTRA]
|
||||
*
|
||||
* This module allows other modules to use MySQL.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_mysql"
|
||||
|
||||
mysql
|
||||
{
|
||||
/* The name of this service. */
|
||||
name = "mysql/main"
|
||||
database = "anope"
|
||||
server = "127.0.0.1"
|
||||
username = "anope"
|
||||
password = "mypassword"
|
||||
port = 3306
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_proxyscan [EXTRA]
|
||||
*
|
||||
* This module allows you to scan connecting clients for open proxies.
|
||||
* Note that using this will allow users to get the IP of your services.
|
||||
*
|
||||
* Currently the two supported proxy types are HTTP and SOCKS5.
|
||||
*
|
||||
* The proxy scanner works by attempting to connect to clients when they
|
||||
* connect to the network, and if they have a proxy running instruct it to connect
|
||||
* back to services. If services are able to connect through the proxy to itself
|
||||
* then it knows it is an insecure proxy, and will ban it.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_proxyscan"
|
||||
|
||||
/*
|
||||
* The target IP services tells the proxy to connect back to. This must be a publicly
|
||||
* available IP that remote proxies can connect to.
|
||||
*/
|
||||
#target_ip = "127.0.0.1"
|
||||
|
||||
/*
|
||||
* The port services tells the proxy to connect to.
|
||||
*/
|
||||
target_port = 7226
|
||||
|
||||
/*
|
||||
* The listen IP services listen on for incoming connections from suspected proxies.
|
||||
* This probably will be the same as target_ip, but may not be if you are behind a firewall (NAT).
|
||||
*/
|
||||
#listen_ip = "127.0.0.1"
|
||||
|
||||
/*
|
||||
* The port services should listen on for incoming connections from suspected proxies.
|
||||
* This most likely will be the same as target_port.
|
||||
*/
|
||||
listen_port = 7226
|
||||
|
||||
/*
|
||||
* An optional notice sent to clients upon connect.
|
||||
*/
|
||||
#connect_notice = "We will now scan your host for insecure proxies. If you do not consent to this scan please disconnect immediately."
|
||||
|
||||
/*
|
||||
* Who the notice should be sent from.
|
||||
*/
|
||||
#connect_source = "OperServ"
|
||||
|
||||
/*
|
||||
* If set, OperServ will add infected clients to the akill list. Without it, OperServ simply sends
|
||||
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being filled up by bots.
|
||||
*/
|
||||
add_to_akill = yes
|
||||
|
||||
/*
|
||||
* How long before connections should be timed out.
|
||||
*/
|
||||
timeout = 5
|
||||
|
||||
proxyscan
|
||||
{
|
||||
/* The type of proxy to check for. A comma separated list is allowed. */
|
||||
type = "HTTP"
|
||||
|
||||
/* The ports to check. */
|
||||
port = "80,8080"
|
||||
|
||||
/* How long to set the ban for. */
|
||||
time = 4h
|
||||
|
||||
/*
|
||||
* The reason to ban the user for.
|
||||
* %h is replaced with the type of proxy found.
|
||||
* %i is replaced with the IP of proxy found.
|
||||
* %p is replaced with the port.
|
||||
*/
|
||||
reason = "You have an open proxy running on your host (%t:%i:%p)"
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sql_authentication [EXTRA]
|
||||
*
|
||||
* This module allows authenticating users against an external SQL database using a custom
|
||||
* query.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_sql_authentication"
|
||||
|
||||
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||
engine = "mysql/main"
|
||||
|
||||
/* Query to execute to authenticate. A non empty result from this query is considered a success,
|
||||
* and the user will be authenticated.
|
||||
*
|
||||
* @a@ is replaced with the user's account name
|
||||
* @p@ is replaced with the user's password
|
||||
* @n@ is replaced with the user's nickname
|
||||
* @i@ is replaced with the user's IP
|
||||
*
|
||||
* Note that @n@ and @i@ may not always exist in the case of a user identifying outside of the normal
|
||||
* nickserv/identify command, such as through the web panel.
|
||||
*
|
||||
* Furthermore, if a field named email is returned from this query the user's email is
|
||||
* set to its value.
|
||||
*
|
||||
*
|
||||
* We've included some example queries for some popular website/forum systems.
|
||||
*
|
||||
* Drupal 6: "SELECT `mail` AS `email` FROM `users` WHERE `name` = @a@ AND `pass` = MD5(@p@) AND `status` = 1"
|
||||
* e107 cms: "SELECT `user_email` AS `email` FROM `e107_user` WHERE `user_loginname` = @a@ AND `user_password` = MD5(@p@)"
|
||||
* SMF Forum: "SELECT `email_address` AS `email` FROM `smf_members` WHERE `member_name` = @a@ AND `passwd` = SHA1(CONCAT(LOWER(@a@), @p@))"
|
||||
* vBulletin: "SELECT `email` FROM `user` WHERE `username` = @a@ AND `password` = MD5(CONCAT(MD5(@p@), `salt`))"
|
||||
* IP.Board: "SELECT `email` FROM `ibf_members` WHERE `name` = @a@ AND `members_pass_hash` = MD5(CONCAT(MD5(`members_pass_salt`), MD5(@p@)))"
|
||||
*/
|
||||
query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
|
||||
|
||||
/*
|
||||
* If set, the reason to give the users who try to "/msg NickServ REGISTER".
|
||||
* If not set, then registration is not blocked.
|
||||
*/
|
||||
#disable_reason = "To register on this network visit http://some.misconfigured.site/register"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sql_log
|
||||
*
|
||||
* This module adds an additional target option to log{} blocks
|
||||
* that allows logging Service's logs to SQL. To log to SQL, add
|
||||
* the SQL service name to log:targets prefixed by sql_log:. For
|
||||
* example:
|
||||
*
|
||||
* log
|
||||
* {
|
||||
* targets = "services.log sql_log:mysql/main"
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* By default this module logs to the table `logs`, and will create
|
||||
* it if it doesn't exist. This module does not create any indexes (keys)
|
||||
* on the table and it is recommended you add them yourself as necessary.
|
||||
*/
|
||||
#module { name = "m_sql_log" }
|
||||
|
||||
/*
|
||||
* m_sql_oper [EXTRA]
|
||||
*
|
||||
* This module allows granting users services operator privileges and possibly IRC Operator
|
||||
* privileges based on an external SQL database using a custom query.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_sql_oper"
|
||||
|
||||
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||
engine = "mysql/main"
|
||||
|
||||
/* Query to execute to determine if a user should have operator privileges.
|
||||
* A field named opertype must be returned in order to link the user to their oper type.
|
||||
* The oper types must be configured earlier in services.conf.
|
||||
*
|
||||
* If a field named modes is returned from this query then those modes are set on the user.
|
||||
* Without this, only a simple +o is sent.
|
||||
*
|
||||
* @a@ is replaced with the user's account name
|
||||
* @i@ is replaced with the user's IP
|
||||
*/
|
||||
query = "SELECT `opertype` FROM `my_users` WHERE `user_name` = @a@"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sqlite [EXTRA]
|
||||
*
|
||||
* This module allows other modules to use SQLite.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_sqlite"
|
||||
|
||||
/* A SQLite database */
|
||||
sqlite
|
||||
{
|
||||
/* The name of this service. */
|
||||
name = "sqlite/main"
|
||||
|
||||
/* The database name, it will be created if it does not exist. */
|
||||
database = "anope.db"
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_redis
|
||||
*
|
||||
* This module allows other modules to use Redis.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_redis"
|
||||
|
||||
/* A redis database */
|
||||
redis
|
||||
{
|
||||
/* The name of this service */
|
||||
name = "redis/main"
|
||||
|
||||
/*
|
||||
* The redis database to use. New connections default to 0.
|
||||
*/
|
||||
db = 0
|
||||
|
||||
ip = "127.0.0.1"
|
||||
port = 6379
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_regex_pcre [EXTRA]
|
||||
*
|
||||
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
|
||||
*/
|
||||
#module { name = "m_regex_pcre" }
|
||||
|
||||
/*
|
||||
* m_regex_posix [EXTRA]
|
||||
*
|
||||
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
|
||||
* This is likely the only regex module you will not need extra libraries for.
|
||||
*/
|
||||
#module { name = "m_regex_posix" }
|
||||
|
||||
/*
|
||||
* m_regex_tre [EXTRA]
|
||||
*
|
||||
* Provides the regex engine regex/tre, which uses the TRE regex library.
|
||||
*/
|
||||
#module { name = "m_regex_tre" }
|
||||
|
||||
/*
|
||||
* m_rewrite
|
||||
*
|
||||
* Allows rewriting commands sent to/from clients.
|
||||
*/
|
||||
#module { name = "m_rewrite" }
|
||||
#command
|
||||
{
|
||||
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
|
||||
|
||||
/* Enable m_rewrite. */
|
||||
rewrite = true
|
||||
|
||||
/* Source message to match. A $ can be used to match anything. */
|
||||
rewrite_source = "CLEAR $ USERS"
|
||||
|
||||
/*
|
||||
* Message to rewrite the source message to. A $ followed by a number, eg $0, gets
|
||||
* replaced by the number-th word from the source_message, starting from 0.
|
||||
*/
|
||||
rewrite_target = "KICK $1 *"
|
||||
|
||||
/*
|
||||
* The command description. This only shows up in HELP's output.
|
||||
* Comment this option to prevent the command from showing in the
|
||||
* HELP command.
|
||||
*/
|
||||
rewrite_description = "Clears all users from a channel"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ssl [EXTRA]
|
||||
*
|
||||
* This module uses SSL to connect to the uplink server(s).
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ssl"
|
||||
|
||||
/*
|
||||
* An optional certificate and key for m_ssl to give to the uplink.
|
||||
*
|
||||
* You can generate your own certificate and key pair by using:
|
||||
*
|
||||
* openssl genrsa -out anope.key 2048
|
||||
* openssl req -new -x509 -key anope.key -out anope.crt -days 1095
|
||||
*/
|
||||
cert = "data/anope.crt"
|
||||
key = "data/anope.key"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_xmlrpc [EXTRA]
|
||||
*
|
||||
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
|
||||
* By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_xmlrpc"
|
||||
|
||||
/* Web service to use. Requires m_httpd. */
|
||||
server = "httpd/main"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_xmlrpc_main [EXTRA]
|
||||
*
|
||||
* Adds the main XMLRPC core functions.
|
||||
* Requires m_xmlrpc.
|
||||
*/
|
||||
#module { name = "m_xmlrpc_main" }
|
||||
|
||||
/*
|
||||
* webcpanel [EXTRA]
|
||||
*
|
||||
* This module creates a web configuration panel that allows users and operators to perform any task
|
||||
* as they could over IRC. If you are using the default configuration you should be able to access
|
||||
* this panel by visiting http://127.0.0.1:8080 in your web browser from the machine Anope is running on.
|
||||
*
|
||||
* This module requires m_httpd.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "webcpanel"
|
||||
|
||||
/* Web server to use. */
|
||||
server = "httpd/main";
|
||||
|
||||
/* Template to use. */
|
||||
template = "default";
|
||||
|
||||
/* Page title. */
|
||||
title = "Anope IRC Services";
|
||||
}
|
||||
@@ -1,453 +0,0 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 3.3.5
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Oct 31, 2010 at 03:02 AM
|
||||
-- Server version: 5.1.50
|
||||
-- PHP Version: 5.3.3-pl1-gentoo
|
||||
|
||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||
|
||||
--
|
||||
-- Database: `anope`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_bs_badwords`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_bs_badwords` (
|
||||
`channel` varchar(255) NOT NULL DEFAULT '',
|
||||
`word` varchar(255) NOT NULL,
|
||||
`type` varchar(50) NOT NULL,
|
||||
UNIQUE KEY `channel` (`channel`,`word`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_bs_core`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_bs_core` (
|
||||
`nick` varchar(255) NOT NULL DEFAULT '',
|
||||
`user` varchar(255) NOT NULL DEFAULT '',
|
||||
`host` text NOT NULL,
|
||||
`rname` text NOT NULL,
|
||||
`flags` text NOT NULL,
|
||||
`created` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`chancount` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`nick`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_bs_info_metadata`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_bs_info_metadata` (
|
||||
`botname` varchar(255) NOT NULL DEFAULT '',
|
||||
`name` varchar(255) NOT NULL DEFAULT '',
|
||||
`value` text NOT NULL,
|
||||
KEY `FK_anope_bs_info_metadata_botname` (`botname`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_cs_access`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_cs_access` (
|
||||
`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` (`channel`,`display`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_cs_akick`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_cs_akick` (
|
||||
`channel` varchar(255) NOT NULL DEFAULT '',
|
||||
`flags` varchar(255) NOT NULL DEFAULT '',
|
||||
`mask` varchar(255) NOT NULL DEFAULT '',
|
||||
`reason` text NOT NULL,
|
||||
`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`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_cs_info`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_cs_info` (
|
||||
`name` varchar(255) NOT NULL DEFAULT '',
|
||||
`founder` text NOT NULL,
|
||||
`successor` text NOT NULL,
|
||||
`descr` text NOT NULL,
|
||||
`time_registered` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`last_used` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`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,
|
||||
`forbidby` text NOT NULL,
|
||||
`forbidreason` text NOT NULL,
|
||||
`bantype` smallint(6) NOT NULL DEFAULT '0',
|
||||
`mlock_on` text NOT NULL,
|
||||
`mlock_off` text NOT NULL,
|
||||
`mlock_params` 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,
|
||||
`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=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_cs_info_metadata`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_cs_info_metadata` (
|
||||
`channel` varchar(255) NOT NULL DEFAULT '',
|
||||
`name` varchar(255) NOT NULL DEFAULT '',
|
||||
`value` text NOT NULL,
|
||||
KEY `FK_anope_cs_info_metadata_channel` (`channel`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_cs_levels`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_cs_levels` (
|
||||
`channel` varchar(255) NOT NULL DEFAULT '',
|
||||
`position` int(11) NOT NULL DEFAULT '0',
|
||||
`level` int(11) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `channel` (`channel`,`position`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_cs_ttb`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_cs_ttb` (
|
||||
`channel` varchar(255) NOT NULL DEFAULT '',
|
||||
`ttb_id` int(11) NOT NULL DEFAULT '0',
|
||||
`value` int(11) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `channel` (`channel`,`ttb_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_extra`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_extra` (
|
||||
`data` text NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_hs_core`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_hs_core` (
|
||||
`nick` varchar(255) NOT NULL,
|
||||
`vident` varchar(64) NOT NULL,
|
||||
`vhost` varchar(255) NOT NULL,
|
||||
`creator` varchar(255) NOT NULL,
|
||||
`time` int(11) NOT NULL,
|
||||
KEY `FK_anope_hs_core_nick` (`nick`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_info`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_info` (
|
||||
`version` int(11) DEFAULT NULL,
|
||||
`date` datetime DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_ms_info`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_ms_info` (
|
||||
`receiver` varchar(255) NOT NULL,
|
||||
`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',
|
||||
KEY `FK_anope_ms_info_receiver` (`receiver`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_ns_access`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_ns_access` (
|
||||
`display` varchar(255) NOT NULL DEFAULT '',
|
||||
`access` varchar(160) NOT NULL,
|
||||
KEY `FK_anope_ns_access_display` (`display`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_ns_alias`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_ns_alias` (
|
||||
`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,
|
||||
`display` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`nick`),
|
||||
KEY `FK_anope_ns_alias_display` (`display`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_ns_alias_metadata`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_ns_alias_metadata` (
|
||||
`nick` varchar(255) NOT NULL DEFAULT '',
|
||||
`name` varchar(255) NOT NULL DEFAULT '',
|
||||
`value` text NOT NULL,
|
||||
KEY `FK_anope_ns_alias_metadata_nick` (`nick`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_ns_core`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_ns_core` (
|
||||
`display` varchar(255) NOT NULL DEFAULT '',
|
||||
`pass` text NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`greet` text NOT NULL,
|
||||
`flags` text NOT NULL,
|
||||
`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=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_ns_core_metadata`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_ns_core_metadata` (
|
||||
`nick` varchar(255) NOT NULL DEFAULT '',
|
||||
`name` varchar(255) NOT NULL DEFAULT '',
|
||||
`value` text NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_ns_request`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_os_akills`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_os_core`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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',
|
||||
`snlines_count` int(11) NOT NULL DEFAULT '0',
|
||||
`sqlines_count` int(11) NOT NULL DEFAULT '0',
|
||||
`szlines_count` int(11) NOT NULL DEFAULT '0'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_os_exceptions`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `anope_os_xlines`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_os_xlines` (
|
||||
`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=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_bs_badwords`
|
||||
--
|
||||
ALTER TABLE `anope_bs_badwords`
|
||||
ADD CONSTRAINT `FK_anope_bs_badwords_channel` FOREIGN KEY (`channel`) REFERENCES `anope_cs_info` (`name`) ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_bs_info_metadata`
|
||||
--
|
||||
ALTER TABLE `anope_bs_info_metadata`
|
||||
ADD CONSTRAINT `FK_anope_bs_info_metadata_botname` FOREIGN KEY (`botname`) REFERENCES `anope_bs_core` (`nick`) ON DELETE
|
||||
CASCADE ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_cs_access`
|
||||
--
|
||||
ALTER TABLE `anope_cs_access`
|
||||
ADD CONSTRAINT `FK_anope_cs_access_channel` FOREIGN KEY (`channel`) REFERENCES `anope_cs_info` (`name`) ON DELETE CASCADE ON
|
||||
UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_cs_akick`
|
||||
--
|
||||
ALTER TABLE `anope_cs_akick`
|
||||
ADD CONSTRAINT `FK_anope_cs_akick_channel` FOREIGN KEY (`channel`) REFERENCES `anope_cs_info` (`name`) ON DELETE CASCADE ON
|
||||
UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_cs_info_metadata`
|
||||
--
|
||||
ALTER TABLE `anope_cs_info_metadata`
|
||||
ADD CONSTRAINT `FK_anope_cs_info_metadata_channel` FOREIGN KEY (`channel`) REFERENCES `anope_cs_info` (`name`) ON DELETE
|
||||
CASCADE ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_cs_levels`
|
||||
--
|
||||
ALTER TABLE `anope_cs_levels`
|
||||
ADD CONSTRAINT `FK_anope_cs_levels_channel` FOREIGN KEY (`channel`) REFERENCES `anope_cs_info` (`name`) ON DELETE CASCADE ON
|
||||
UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_cs_ttb`
|
||||
--
|
||||
ALTER TABLE `anope_cs_ttb`
|
||||
ADD CONSTRAINT `FK_anope_cs_ttb_channel` FOREIGN KEY (`channel`) REFERENCES `anope_cs_info` (`name`) ON DELETE CASCADE ON
|
||||
UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_hs_core`
|
||||
--
|
||||
ALTER TABLE `anope_hs_core`
|
||||
ADD CONSTRAINT `FK_anope_hs_core_nick` FOREIGN KEY (`nick`) REFERENCES `anope_ns_alias` (`nick`) ON DELETE CASCADE ON UPDATE
|
||||
CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_ms_info`
|
||||
--
|
||||
ALTER TABLE `anope_ms_info`
|
||||
ADD CONSTRAINT `FK_anope_ms_info_receiver` FOREIGN KEY (`receiver`) REFERENCES `anope_ns_alias` (`nick`) ON DELETE CASCADE ON
|
||||
UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_ns_access`
|
||||
--
|
||||
ALTER TABLE `anope_ns_access`
|
||||
ADD CONSTRAINT `FK_anope_ns_access_display` FOREIGN KEY (`display`) REFERENCES `anope_ns_core` (`display`) ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_ns_alias`
|
||||
--
|
||||
ALTER TABLE `anope_ns_alias`
|
||||
ADD CONSTRAINT `FK_anope_ns_alias_display` FOREIGN KEY (`display`) REFERENCES `anope_ns_core` (`display`) ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `anope_ns_alias_metadata`
|
||||
--
|
||||
ALTER TABLE `anope_ns_alias_metadata`
|
||||
ADD CONSTRAINT `FK_anope_ns_alias_metadata_nick` FOREIGN KEY (`nick`) REFERENCES `anope_ns_alias` (`nick`) ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
||||
|
||||
@@ -0,0 +1,653 @@
|
||||
/*
|
||||
* Example configuration file for NickServ.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First, create the service.
|
||||
*/
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the NickServ client.
|
||||
* If you change this value, you probably want to change the client directive in the configuration for the nickserv module too.
|
||||
*/
|
||||
nick = "NickServ"
|
||||
|
||||
/*
|
||||
* The username of the NickServ client.
|
||||
*/
|
||||
user = "services"
|
||||
|
||||
/*
|
||||
* The hostname of the NickServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
|
||||
/*
|
||||
* The realname of the NickServ client.
|
||||
*/
|
||||
gecos = "Nickname Registration Service"
|
||||
|
||||
/*
|
||||
* The modes this client should use.
|
||||
* Do not modify this unless you know what you are doing.
|
||||
*
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
|
||||
/*
|
||||
* An optional comma separated list of channels this service should join. Outside
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
|
||||
/*
|
||||
* Core NickServ module.
|
||||
*
|
||||
* Provides essential functionality for NickServ.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "nickserv"
|
||||
|
||||
/*
|
||||
* The name of the client that should be NickServ.
|
||||
*/
|
||||
client = "NickServ"
|
||||
|
||||
/*
|
||||
* Force users to give an e-mail address when they register a nick.
|
||||
*
|
||||
* This directive defaults to "yes" and is recommended to be enabled. This is required if e-mail registration is enabled.
|
||||
*/
|
||||
forceemail = yes
|
||||
|
||||
/*
|
||||
* Require users who change their email address to confirm they
|
||||
* own their new email.
|
||||
*/
|
||||
confirmemailchanges = no
|
||||
|
||||
/*
|
||||
* A message sent to users on connect if they use an unregistered nick.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#unregistered_notice = "Your nickname is not registered. To register it, use: /msg NickServ REGISTER password email"
|
||||
|
||||
/*
|
||||
* The default options for newly registered nicks. Note that changing these options
|
||||
* will have no effect on nicks which are already registered. The list must be separated
|
||||
* by spaces.
|
||||
*
|
||||
* The options are:
|
||||
* - killprotect: Kill nick if not identified within 60 seconds
|
||||
* - kill_quick: Kill nick if not identified within 20 seconds, this one overrides the above
|
||||
* option and the above must be specified with this one
|
||||
* - ns_secure: Enable nickname security, requiring the nick's password before any operations
|
||||
* can be done on it
|
||||
* - ns_private: Hide the nick from NickServ's LIST command
|
||||
* - hide_email: Hide's the nick's e-mail address from NickServ's INFO command
|
||||
* - hide_mask: Hide's the nick's last or current user@host from NickServ's INFO command
|
||||
* - hide_quit: Hide's the nick's last quit message
|
||||
* - memo_signon: Notify user if they have a new memo when they sign into the nick
|
||||
* - memo_receive: Notify user if they have a new memo as soon as it's received
|
||||
* - autoop: User will be automatically opped in channels they enter and have access to
|
||||
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires
|
||||
* options:useprivmsg to be enabled as well
|
||||
* - ns_keepmodes: Enables keepmodes, which retains user modes across sessions
|
||||
*
|
||||
* This directive is optional, if left blank, the options will default to ns_secure, memo_signon, and
|
||||
* memo_receive. If you really want no defaults, use "none" by itself as the option.
|
||||
*/
|
||||
defaults = "ns_secure ns_private hide_email hide_mask memo_signon memo_receive autoop"
|
||||
|
||||
/*
|
||||
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
|
||||
* directive is optional, but recommended. If not set, this restriction will be disabled.
|
||||
*/
|
||||
regdelay = 30s
|
||||
|
||||
/*
|
||||
* The length of time before a nick's registration expires.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set, the default is 21 days.
|
||||
*/
|
||||
expire = 21d
|
||||
|
||||
/*
|
||||
* Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND,
|
||||
* GETPASS and SET PASSWORD commands by services operators on other services operators.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
secureadmins = yes
|
||||
|
||||
/*
|
||||
* If set, Services will set the channel modes a user has access to upon identifying, assuming
|
||||
* they are not already set.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
modeonid = yes
|
||||
|
||||
/*
|
||||
* If set, Services will set these user modes on any user who identifies.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#modesonid = "+R"
|
||||
|
||||
/*
|
||||
* If set, Services will not show netsplits in the last quit message field
|
||||
* of NickServ's INFO command.
|
||||
*/
|
||||
hidenetsplitquit = no
|
||||
|
||||
/*
|
||||
* If set, is the length of time NickServ's killquick and kill options wait before
|
||||
* forcing users off of protected nicknames.
|
||||
*/
|
||||
killquick = 20s
|
||||
kill = 60s
|
||||
|
||||
/*
|
||||
* If set, forbids the registration of nicks that contain an existing
|
||||
* nick with Services access. For example, if Tester is a Services Oper,
|
||||
* you can't register NewTester or Tester123 unless you are an IRC
|
||||
* Operator.
|
||||
*
|
||||
* NOTE: If you enable this, you will have to be logged in as an IRC
|
||||
* operator in order to register a Services Root nick when setting up
|
||||
* Anope for the first time.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#restrictopernicks = yes
|
||||
|
||||
/*
|
||||
* The username, and possibly hostname, used for fake users created when Services needs to
|
||||
* hold a nickname.
|
||||
*/
|
||||
enforceruser = "enforcer"
|
||||
enforcerhost = "services.host"
|
||||
|
||||
/*
|
||||
* The length of time Services hold nicknames.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set it defaults to 1 minute.
|
||||
*/
|
||||
releasetimeout = 1m
|
||||
|
||||
/*
|
||||
* When a user's nick is forcibly changed to enforce a "nick kill", their new nick will start
|
||||
* with this value. The rest will be made up of 6 or 7 digits.
|
||||
* Make sure this is a valid nick and Nicklen+7 is not longer than the allowed Nicklen on your ircd.
|
||||
*
|
||||
* This directive is optional. If not set it defaults to "Guest"
|
||||
*/
|
||||
guestnickprefix = "Guest"
|
||||
|
||||
/*
|
||||
* If set, Services do not allow ownership of nick names, only ownership of accounts.
|
||||
*/
|
||||
nonicknameownership = no
|
||||
|
||||
/*
|
||||
* The maximum length of passwords
|
||||
*
|
||||
* This directive is optional. If not set it defaults to 32.
|
||||
*/
|
||||
passlen = 32
|
||||
}
|
||||
|
||||
/*
|
||||
* Core NickServ commands.
|
||||
*
|
||||
* In Anope modules can provide (multiple) commands, each of which has a unique command name. Once these modules
|
||||
* are loaded you can then configure the commands to be added to any client you like with any name you like.
|
||||
*
|
||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Command group configuration for NickServ.
|
||||
*
|
||||
* Commands may optionally be placed into groups to make NickServ's HELP output easier to understand.
|
||||
* Remove the following groups to use the old behavior of simply listing all NickServ commands from HELP.
|
||||
*/
|
||||
command_group
|
||||
{
|
||||
name = "nickserv/admin"
|
||||
description = "Services Operator commands"
|
||||
}
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* ns_access
|
||||
*
|
||||
* Provides the command nickserv/access.
|
||||
*
|
||||
* Used for configuring what hosts have access to your account.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_access"
|
||||
|
||||
/*
|
||||
* The maximum number of entries allowed on a nickname's access list.
|
||||
* If not set, the default is 32. This number cannot be set to 0.
|
||||
*/
|
||||
accessmax = 32
|
||||
|
||||
/*
|
||||
* If set, Services will add the usermask of registering users to the access list of their
|
||||
* newly created account. If not set, users will always have to identify to NickServ before
|
||||
* being recognized, unless they manually add an address to the access list of their account.
|
||||
* This directive is optional.
|
||||
*/
|
||||
addaccessonreg = yes
|
||||
}
|
||||
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
|
||||
|
||||
/*
|
||||
* ns_ajoin
|
||||
*
|
||||
* Provides the command nickserv/ajoin.
|
||||
*
|
||||
* Used for configuring channels to join once you identify.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_ajoin"
|
||||
|
||||
/*
|
||||
* The maximum number of channels a user can have on NickServ's AJOIN command.
|
||||
*/
|
||||
ajoinmax = 10
|
||||
}
|
||||
command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
|
||||
|
||||
/*
|
||||
* ns_alist
|
||||
*
|
||||
* Provides the command nickserv/alist.
|
||||
*
|
||||
* Used for viewing what channels you have access to.
|
||||
*/
|
||||
module { name = "ns_alist" }
|
||||
command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
|
||||
|
||||
/*
|
||||
* ns_cert
|
||||
*
|
||||
* Provides the command nickserv/cert.
|
||||
*
|
||||
* Used for configuring your SSL certificate list, which can be used to automatically identify you.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_cert"
|
||||
|
||||
/*
|
||||
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
|
||||
* The default is 5. This number cannot be set to 0.
|
||||
*/
|
||||
accessmax = 5
|
||||
}
|
||||
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
|
||||
|
||||
/*
|
||||
* ns_drop
|
||||
*
|
||||
* Provides the command nickserv/drop.
|
||||
*
|
||||
* Used for unregistering names.
|
||||
*/
|
||||
module { name = "ns_drop" }
|
||||
command { service = "NickServ"; name = "DROP"; command = "nickserv/drop"; }
|
||||
|
||||
/*
|
||||
* ns_getemail
|
||||
*
|
||||
* Provides the command nickserv/getemail.
|
||||
*
|
||||
* Used for getting registered accounts by searching for emails.
|
||||
*/
|
||||
module { name = "ns_getemail" }
|
||||
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_getpass
|
||||
*
|
||||
* Provides the command nickserv/getpass.
|
||||
*
|
||||
* Used for getting users passwords.
|
||||
*
|
||||
* Requires no encryption is being used.
|
||||
*/
|
||||
#module { name = "ns_getpass" }
|
||||
#command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; permission = "nickserv/getpass"; }
|
||||
|
||||
/*
|
||||
* ns_group
|
||||
*
|
||||
* Provides the commands nickserv/group, nickserv/glist, and nickserv/ungroup.
|
||||
*
|
||||
* Used for controlling nick groups.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_group"
|
||||
|
||||
/*
|
||||
* The maximum number of nicks allowed in a group.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
|
||||
*/
|
||||
maxaliases = 16
|
||||
|
||||
/*
|
||||
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
|
||||
* prevent users from accidentally dropping their nicks, as it forces users to explicitly
|
||||
* drop their nicks before adding it to another group.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
nogroupchange = yes
|
||||
}
|
||||
command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist"; }
|
||||
command { service = "NickServ"; name = "GROUP"; command = "nickserv/group"; }
|
||||
command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup"; }
|
||||
|
||||
/*
|
||||
* ns_identify
|
||||
*
|
||||
* Provides the command nickserv/identify.
|
||||
*
|
||||
* Used for identifying to accounts.
|
||||
*/
|
||||
module { name = "ns_identify" }
|
||||
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; hide = true; }
|
||||
command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"; }
|
||||
|
||||
/*
|
||||
* ns_info
|
||||
*
|
||||
* Provides the commands:
|
||||
* nickserv/info. - Used for gathering information about an account.
|
||||
* nickserv/set/hide, nickserv/saset/hide - Used for configuring which options are publically shown in nickserv/info.
|
||||
*
|
||||
*/
|
||||
module { name = "ns_info" }
|
||||
command { service = "NickServ"; name = "INFO"; command = "nickserv/info"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
|
||||
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; }
|
||||
|
||||
|
||||
/*
|
||||
* ns_list
|
||||
*
|
||||
* Provides the commands:
|
||||
* nickserv/list - Used for retrieving and searching the registered account list.
|
||||
* nickserv/set/private, nickserv/saset/private - Used for configuring whether or a users account shows up in nickserv/list.
|
||||
*
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_list"
|
||||
|
||||
/*
|
||||
* The maximum number of nicks to be returned for a NickServ LIST command.
|
||||
*/
|
||||
listmax = 50
|
||||
}
|
||||
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
|
||||
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; }
|
||||
|
||||
|
||||
/*
|
||||
* ns_logout
|
||||
*
|
||||
* Provides the command nickserv/logout.
|
||||
*
|
||||
* Used for logging out of your account.
|
||||
*/
|
||||
module { name = "ns_logout" }
|
||||
command { service = "NickServ"; name = "LOGOUT"; command = "nickserv/logout"; }
|
||||
|
||||
/*
|
||||
* ns_recover
|
||||
*
|
||||
* Provides the command nickserv/recover.
|
||||
*
|
||||
* Used for recovering your nick from services or another user.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_recover"
|
||||
|
||||
/*
|
||||
* If set, Services will svsnick and svsjoin users who use the recover
|
||||
* command on an identified user to the nick and channels of the recovered user.
|
||||
*
|
||||
* This directive is opional.
|
||||
*/
|
||||
restoreonrecover = yes
|
||||
}
|
||||
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
|
||||
# Uncomment below to emulate 1.8's behavior of ghost and release.
|
||||
#command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; }
|
||||
#command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; }
|
||||
|
||||
/*
|
||||
* ns_register
|
||||
*
|
||||
* Provides the commands nickserv/confirm, nickserv/register, and nickserv/resend.
|
||||
*
|
||||
* Used for registering accounts.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_register"
|
||||
|
||||
/*
|
||||
* Registration confirmation setting. Set to "none" for no registration confirmation,
|
||||
* "mail" for email confirmation, and "admin" to have services operators manually confirm
|
||||
* every registration. Set to "disable" to completely disable all registrations.
|
||||
*/
|
||||
registration = "none"
|
||||
|
||||
/*
|
||||
* The minimum length of time between consecutive uses of NickServ's RESEND command.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set, this restriction will be disabled.
|
||||
*/
|
||||
resenddelay = 90s
|
||||
|
||||
/*
|
||||
* Prevents users from registering their nick if they are not connected
|
||||
* for at least the given number of seconds.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#nickregdelay = 30s
|
||||
|
||||
/*
|
||||
* The length of time a user using an unconfirmed account has
|
||||
* before the account will be released for general use again.
|
||||
*/
|
||||
#unconfirmedexpire = 1d
|
||||
}
|
||||
command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm"; }
|
||||
command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register"; }
|
||||
command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; }
|
||||
|
||||
/*
|
||||
* ns_resetpass
|
||||
*
|
||||
* Provides the command nickserv/resetpass.
|
||||
*
|
||||
* Used for resetting passwords by emailing users a temporary one.
|
||||
*/
|
||||
module { name = "ns_resetpass" }
|
||||
command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass"; }
|
||||
|
||||
/*
|
||||
* ns_set
|
||||
*
|
||||
* Provides the commands:
|
||||
* nickserv/set, nickserv/saset - Dummy help wrappers for the SET and SASET commands.
|
||||
* nickserv/set/autoop, nickserv/saset/autoop - Determines whether or not modes are automatically set users when joining a channel.
|
||||
* nickserv/set/display, nickserv/saset/display - Used for setting a users display name.
|
||||
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
|
||||
* nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
|
||||
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
|
||||
* nickserv/set/language, nickserv/saset/language - Used for configuring what language services use.
|
||||
* nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you.
|
||||
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
|
||||
* nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access.
|
||||
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_set"
|
||||
|
||||
/*
|
||||
* Allow the use of the IMMED option in the NickServ SET KILL command.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#allowkillimmed = yes
|
||||
}
|
||||
|
||||
command { service = "NickServ"; name = "SET"; command = "nickserv/set"; }
|
||||
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; }
|
||||
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; }
|
||||
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; }
|
||||
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET KEEPMODES"; command = "nickserv/set/keepmodes"; }
|
||||
command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/saset/keepmodes"; permission = "nickserv/saset/keepmodes"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
|
||||
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
|
||||
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
|
||||
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
|
||||
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
|
||||
|
||||
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
|
||||
|
||||
|
||||
/*
|
||||
* ns_set_misc
|
||||
*
|
||||
* Provides the command nickserv/set/misc.
|
||||
*
|
||||
* Allows you to create arbitrary commands to set data, and have that data show up in nickserv/info.
|
||||
* A field named misc_description may be given for use with help output.
|
||||
*/
|
||||
module { name = "ns_set_misc" }
|
||||
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; misc_description = _("Associate a URL with your account"); }
|
||||
command { service = "NickServ"; name = "SASET URL"; command = "nickserv/saset/misc"; misc_description = _("Associate a URL with this account"); permission = "nickserv/saset/url"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET ICQ"; command = "nickserv/set/misc"; misc_description = _("Associate an ICQ account with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET ICQ"; command = "nickserv/saset/misc"; misc_description = _("Associate an ICQ account with this account"); permission = "nickserv/saset/icq"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET TWITTER"; command = "nickserv/set/misc"; misc_description = _("Associate a Twitter account with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET TWITTER"; command = "nickserv/saset/misc"; misc_description = _("Associate a Twitter account with this account"); permission = "nickserv/saset/twitter"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET FACEBOOK"; command = "nickserv/set/misc"; misc_description = _("Associate a Facebook URL with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET FACEBOOK"; command = "nickserv/saset/misc"; misc_description = _("Associate a Facebook URL with this account"); permission = "nickserv/saset/facebook"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_status
|
||||
*
|
||||
* Provides the nickserv/status command.
|
||||
*
|
||||
* Used to determine if a user is recognized or identified by services.
|
||||
*/
|
||||
module { name = "ns_status" }
|
||||
command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
|
||||
|
||||
/*
|
||||
* ns_suspend
|
||||
*
|
||||
* Provides the commands nickserv/suspend and nickserv/unsuspend.
|
||||
*
|
||||
* Used to suspend and unsuspend nicknames. Suspended nicknames can not be used but their settings are preserved.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_suspend"
|
||||
|
||||
/*
|
||||
* The length of time before a suspended nick becomes unsuspended.
|
||||
*
|
||||
* This directive is optional. If not set, the default is never.
|
||||
*/
|
||||
#suspendexpire = 90d
|
||||
}
|
||||
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
|
||||
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_update
|
||||
*
|
||||
* Provides the command nickserv/update.
|
||||
*
|
||||
* Used to update your status on all channels, turn on your vHost, etc.
|
||||
*/
|
||||
module { name = "ns_update" }
|
||||
command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
|
||||
|
||||
|
||||
/*
|
||||
* Extra NickServ related modules.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ns_maxemail
|
||||
*
|
||||
* Limits how many times the same email address may be used in Anope
|
||||
* to register accounts.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_maxemail"
|
||||
|
||||
/*
|
||||
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
|
||||
* commented, there will be no limit enforced when registering new accounts or using
|
||||
* /msg NickServ SET EMAIL.
|
||||
*/
|
||||
#maxemails = 1
|
||||
}
|
||||
@@ -0,0 +1,700 @@
|
||||
/*
|
||||
* Example configuration file for OperServ.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First, create the service.
|
||||
*/
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the OperServ client.
|
||||
* If you change this value, you probably want to change the client directive in the configuration for the operserv module too.
|
||||
*/
|
||||
nick = "OperServ"
|
||||
|
||||
/*
|
||||
* The username of the OperServ client.
|
||||
*/
|
||||
user = "services"
|
||||
|
||||
/*
|
||||
* The hostname of the OperServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
|
||||
/*
|
||||
* The realname of the OperServ client.
|
||||
*/
|
||||
gecos = "Operator Service"
|
||||
|
||||
/*
|
||||
* The modes this client should use.
|
||||
* Do not modify this unless you know what you are doing.
|
||||
*
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
|
||||
/*
|
||||
* An optional comma separated list of channels this service should join. Outside
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
|
||||
/*
|
||||
* Core OperServ module.
|
||||
*
|
||||
* Provides essential functionality for OperServ.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "operserv"
|
||||
|
||||
/*
|
||||
* The name of the client that should be OperServ.
|
||||
*/
|
||||
client = "OperServ"
|
||||
|
||||
/*
|
||||
* These define the default expiration times for, respectively, AKILLs, CHANKILLs, SNLINEs,
|
||||
* and SQLINEs.
|
||||
*/
|
||||
autokillexpiry = 30d
|
||||
chankillexpiry = 30d
|
||||
snlineexpiry = 30d
|
||||
sqlineexpiry = 30d
|
||||
|
||||
/*
|
||||
* If set, this option will make Services send an AKILL command immediately after it has been
|
||||
* added with AKILL ADD. This eliminates the need for killing the user after the AKILL has
|
||||
* been added.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
akillonadd = yes
|
||||
|
||||
/*
|
||||
* If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD.
|
||||
* This eliminates the need for killing the user after the SNLINE has been added.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
killonsnline = yes
|
||||
|
||||
/*
|
||||
* If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD.
|
||||
* This eliminates the need for killing the user after the SQLINE has been added.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
killonsqline = yes
|
||||
|
||||
/*
|
||||
* Adds the nickname of the IRC Operator issuing an AKILL to the kill reason.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
addakiller = yes
|
||||
|
||||
/*
|
||||
* Adds akill IDs to akills. Akill IDs are given to users in their ban reason and can be used to easily view,
|
||||
* modify, or remove an akill from the ID.
|
||||
*/
|
||||
akillids = yes
|
||||
|
||||
/*
|
||||
* If set, only IRC Operators will be permitted to use OperServ, regardless of command access restrictions.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
opersonly = yes
|
||||
}
|
||||
|
||||
/*
|
||||
* Core OperServ commands.
|
||||
*
|
||||
* In Anope modules can provide (multiple) commands, each of which has a unique command name. Once these modules
|
||||
* are loaded you can then configure the commands to be added to any client you like with any name you like.
|
||||
*
|
||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "OperServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* os_akill
|
||||
*
|
||||
* Provides the command operserv/akill.
|
||||
*
|
||||
* Used to ban users from the network.
|
||||
*/
|
||||
module { name = "os_akill" }
|
||||
command { service = "OperServ"; name = "AKILL"; command = "operserv/akill"; permission = "operserv/akill"; }
|
||||
|
||||
/*
|
||||
* os_chankill
|
||||
*
|
||||
* Provides the command operserv/chankill.
|
||||
*
|
||||
* Used to akill users from an entire channel.
|
||||
*/
|
||||
module { name = "os_chankill" }
|
||||
command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"; permission = "operserv/chankill"; }
|
||||
|
||||
/*
|
||||
* os_defcon
|
||||
*
|
||||
* Provides the command operserv/defcon.
|
||||
*
|
||||
* Allows you to set services in defcon mode, which can be used to restrict services access
|
||||
* during bot attacks.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "os_defcon"
|
||||
|
||||
/*
|
||||
* Default DefCon level (1-5) to use when starting Services up. Level 5 constitutes normal operation
|
||||
* while level 1 constitutes the most restrictive operation. If this setting is left out or set to
|
||||
* 0, DefCon will be disabled and the rest of this block will be ignored.
|
||||
*/
|
||||
#defaultlevel = 5
|
||||
|
||||
/*
|
||||
* The following 4 directives define what operations will take place when DefCon is set to levels
|
||||
* 1 through 4. Each level is a list that must be separated by spaces.
|
||||
*
|
||||
* The following operations can be defined at each level:
|
||||
* - nonewchannels: Disables registering new channels
|
||||
* - nonewnicks: Disables registering new nicks
|
||||
* - nomlockchanges: Disables changing MLOCK on registered channels
|
||||
* - forcechanmodes: Forces all channels to have the modes given in the later chanmodes directive
|
||||
* - reducedsessions: Reduces the session limit to the value given in the later sessionlimit directive
|
||||
* - nonewclients: KILL any new clients trying to connect
|
||||
* - operonly: Services will ignore all non-IRCops
|
||||
* - silentoperonly: Services will silently ignore all non-IRCops
|
||||
* - akillnewclients: AKILL any new clients trying to connect
|
||||
* - nonewmemos: No new memos will be sent to block MemoServ attacks
|
||||
*/
|
||||
level4 = "nonewchannels nonewnicks nomlockchanges reducedsessions"
|
||||
level3 = "nonewchannels nonewnicks nomlockchanges forcechanmodes reducedsessions"
|
||||
level2 = "nonewchannels nonewnicks nomlockchanges forcechanmodes reducedsessions silentoperonly"
|
||||
level1 = "nonewchannels nonewnicks nomlockchanges forcechanmodes reducedsessions silentoperonly akillnewclients"
|
||||
|
||||
/*
|
||||
* New session limit to use when a DefCon level is using "reduced" session limiting.
|
||||
*/
|
||||
#sessionlimit = 2
|
||||
|
||||
/*
|
||||
* Length of time to add an AKILL for when DefCon is preventing new clients from connecting to the
|
||||
* network.
|
||||
*/
|
||||
#akillexpire = 5m
|
||||
|
||||
/*
|
||||
* The channel modes to set on all channels when the DefCon channel mode system is in use.
|
||||
*
|
||||
* Note 1: Choose these modes carefully, because when DefCon switches to a level which does NOT have
|
||||
* the mode setting selected, Services will set the reverse on all channels, e.g. if this setting
|
||||
* is +RN when DefCon is used, all channels will be set to +RN, when DefCon is removed, all
|
||||
* channels will be set to -RN. You don't want to set this to +k for example, because when DefCon
|
||||
* is removed, all channels are set -k, removing the key from previously keyed channels.
|
||||
*
|
||||
* Note 2: MLOCKed modes will not be lost.
|
||||
*/
|
||||
#chanmodes = "+R"
|
||||
|
||||
/*
|
||||
* This value can be used to automatically return the network to DefCon level 5 after the specified
|
||||
* time period, just in case any IRC Operator forgets to remove a DefCon setting.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#timeout = 15m
|
||||
|
||||
/*
|
||||
* If set, Services will send a global message on DefCon level changes.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#globalondefcon = yes
|
||||
|
||||
/*
|
||||
* If set, Services will send the global message defined in the message directive on DefCon level
|
||||
* changes.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#globalondefconmore = yes
|
||||
|
||||
/*
|
||||
* Defines the message that will be sent on DefCon level changes when globalondefconmore is set.
|
||||
*
|
||||
* This directive is required only when globalondefconmore is set.
|
||||
*/
|
||||
#message = "Put your message to send your users here. Don't forget to uncomment globalondefconmore"
|
||||
|
||||
/*
|
||||
* Defines the message that will be sent when DefCon is returned to level 5. This directive is optional,
|
||||
* and will also override globalondefcon and globalondefconmore when set.
|
||||
*/
|
||||
#offmessage = "Services are now back to normal, sorry for any inconvenience"
|
||||
|
||||
/*
|
||||
* Defines the reason to use when clients are KILLed or AKILLed from the network while the proper
|
||||
* DefCon operation is in effect.
|
||||
*/
|
||||
#akillreason = "This network is currently not accepting connections, please try again later."
|
||||
}
|
||||
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; }
|
||||
|
||||
/*
|
||||
* os_dns
|
||||
*
|
||||
* Provides the command operserv/dns.
|
||||
*
|
||||
* This module requires that m_dns is loaded.
|
||||
*
|
||||
* This module allows controlling a DNS zone. This is useful for
|
||||
* controlling what servers users are placed on for load balancing,
|
||||
* and to automatically remove split servers.
|
||||
*
|
||||
* To use this module you must set a nameserver record for services
|
||||
* so that DNS queries go to services.
|
||||
*
|
||||
* Alternatively, you may use a slave DNS server to hide service's IP,
|
||||
* provide query caching, and provide better fault tolerance.
|
||||
*
|
||||
* To do this using BIND, configure similar to:
|
||||
*
|
||||
* options { max-refresh-time 60; };
|
||||
* zone "irc.example.com" IN {
|
||||
* type slave;
|
||||
* masters { 127.0.0.1 port 5353; };
|
||||
* };
|
||||
*
|
||||
* Where 127.0.0.1:5353 is the IP and port services are listening on.
|
||||
* We recommend you externally firewall both UDP and TCP to the port
|
||||
* Anope is listening on.
|
||||
*
|
||||
* Finally set a NS record for irc.example.com. to BIND or services.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "os_dns"
|
||||
|
||||
/* TTL for records. This should be very low if your records change often. */
|
||||
ttl = 1m
|
||||
|
||||
/* If a server drops this many users the server is automatically removed from the DNS zone.
|
||||
* This directive is optional.
|
||||
*/
|
||||
user_drop_mark = 50
|
||||
|
||||
/* The time used for user_drop_mark. */
|
||||
user_drop_time = 1m
|
||||
|
||||
/* When a server is removed from the zone for dropping users, it is readded after this time.
|
||||
* This directive is optional.
|
||||
*/
|
||||
user_drop_readd_time = 5m
|
||||
|
||||
/* If set, when a server splits, it is automatically removed from the zone. */
|
||||
remove_split_servers = yes
|
||||
|
||||
/* If set, when a server connects to the network, it will be automatically added to
|
||||
* the zone if it is a known server.
|
||||
*/
|
||||
readd_connected_servers = no
|
||||
}
|
||||
#command { service = "OperServ"; name = "DNS"; command = "operserv/dns"; permission = "operserv/dns"; }
|
||||
|
||||
/*
|
||||
* os_config
|
||||
*
|
||||
* Provides the command operserv/config.
|
||||
*
|
||||
* Used to view and set configuration options while services are running.
|
||||
*/
|
||||
module { name = "os_config" }
|
||||
command { service = "OperServ"; name = "CONFIG"; command = "operserv/config"; permission = "operserv/config"; }
|
||||
|
||||
/*
|
||||
* os_forbid
|
||||
*
|
||||
* Provides the command operserv/forbid.
|
||||
*
|
||||
* Used to forbid specific nicks, channels, emails, etc. from being used.
|
||||
*/
|
||||
module { name = "os_forbid" }
|
||||
command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; permission = "operserv/forbid"; }
|
||||
|
||||
/*
|
||||
* os_ignore
|
||||
*
|
||||
* Provides the command operserv/ignore.
|
||||
*
|
||||
* Used to make Services ignore users.
|
||||
*/
|
||||
module { name = "os_ignore" }
|
||||
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
|
||||
|
||||
/*
|
||||
* os_info
|
||||
*
|
||||
* Provides the command operserv/info.
|
||||
*
|
||||
* Used to add oper only notes to users and channels.
|
||||
*/
|
||||
module { name = "os_info" }
|
||||
command { service = "OperServ"; name = "INFO"; command = "operserv/info"; permission = "operserv/info"; }
|
||||
|
||||
/*
|
||||
* os_jupe
|
||||
*
|
||||
* Provides the command operserv/jupe.
|
||||
*
|
||||
* Used to disconnect servers from the network and prevent them from relinking.
|
||||
*/
|
||||
module { name = "os_jupe" }
|
||||
command { service = "OperServ"; name = "JUPE"; command = "operserv/jupe"; permission = "operserv/jupe"; }
|
||||
|
||||
/*
|
||||
* os_kick
|
||||
*
|
||||
* Provides the command operserv/kick.
|
||||
*
|
||||
* Used to kick users from channels.
|
||||
*/
|
||||
module { name = "os_kick" }
|
||||
command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; permission = "operserv/kick"; }
|
||||
|
||||
/*
|
||||
* os_kill
|
||||
*
|
||||
* Provides the command operserv/kill.
|
||||
*
|
||||
* Used to forcibly disconnect users from the network.
|
||||
*/
|
||||
module { name = "os_kill" }
|
||||
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permission = "operserv/kill"; }
|
||||
|
||||
/*
|
||||
* os_list
|
||||
*
|
||||
* Provides the commands operserv/chanlist and operserv/userlist.
|
||||
*
|
||||
* Used to list and search the channels and users currently on the network.
|
||||
*/
|
||||
module { name = "os_list" }
|
||||
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; permission = "operserv/chanlist"; }
|
||||
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; permission = "operserv/userlist"; }
|
||||
|
||||
/*
|
||||
* os_login
|
||||
*
|
||||
* Provides the commands operserv/login and operserv/logout.
|
||||
*
|
||||
* Used to login to OperServ, only required if your oper block requires this.
|
||||
*/
|
||||
module { name = "os_login" }
|
||||
command { service = "OperServ"; name = "LOGIN"; command = "operserv/login"; }
|
||||
command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
|
||||
|
||||
/*
|
||||
* os_logsearch
|
||||
*
|
||||
* Provides the command operserv/logsearch.
|
||||
*
|
||||
* Used to search services log files.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "os_logsearch"
|
||||
|
||||
/* The log file name to search. There should be a log{} block configured to log
|
||||
* to a file of this name.
|
||||
*/
|
||||
logname = "services.log"
|
||||
}
|
||||
command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearch"; permission = "operserv/logsearch"; }
|
||||
|
||||
/*
|
||||
* os_mode
|
||||
*
|
||||
* Provides the commands operserv/mode and operserv/umode.
|
||||
*
|
||||
* Used to change user and channel modes.
|
||||
*/
|
||||
module { name = "os_mode" }
|
||||
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; permission = "operserv/umode"; }
|
||||
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode"; }
|
||||
|
||||
/*
|
||||
* os_modinfo
|
||||
*
|
||||
* Provides the commands operserv/modinfo and operserv/modlist.
|
||||
*
|
||||
* Used to show information about loaded modules.
|
||||
*/
|
||||
module { name = "os_modinfo" }
|
||||
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; permission = "operserv/modinfo"; }
|
||||
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modinfo"; }
|
||||
|
||||
/*
|
||||
* os_module
|
||||
*
|
||||
* Provides the commands operserv/modload, operserv/modreload, and operserv/modunload.
|
||||
*
|
||||
* Used to load, reload, and unload modules.
|
||||
*/
|
||||
module { name = "os_module" }
|
||||
command { service = "OperServ"; name = "MODLOAD"; command = "operserv/modload"; permission = "operserv/modload"; }
|
||||
command { service = "OperServ"; name = "MODRELOAD"; command = "operserv/modreload"; permission = "operserv/modload"; }
|
||||
command { service = "OperServ"; name = "MODUNLOAD"; command = "operserv/modunload"; permission = "operserv/modload"; }
|
||||
|
||||
/*
|
||||
* os_news
|
||||
*
|
||||
* Provides the commands operserv/logonnews, operserv/opernews, and operserv/randomnews.
|
||||
*
|
||||
* Used to configure news notices shown to users when they connect, and opers when they oper.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "os_news"
|
||||
|
||||
/*
|
||||
* The service bot names to use to send news to users on connection
|
||||
* and to opers when they oper.
|
||||
*/
|
||||
announcer = "Global"
|
||||
oper_announcer = "OperServ"
|
||||
|
||||
/*
|
||||
* The number of LOGON/OPER news items to display when a user logs on.
|
||||
*
|
||||
* This directive is optional, if not set it will default to 3.
|
||||
*/
|
||||
#newscount = 3
|
||||
}
|
||||
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; }
|
||||
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; }
|
||||
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news"; }
|
||||
|
||||
/*
|
||||
* os_noop
|
||||
*
|
||||
* Provides the command operserv/noop.
|
||||
*
|
||||
* Used to NOOP a server, which prevents users from opering on that server.
|
||||
*/
|
||||
module { name = "os_noop" }
|
||||
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop"; }
|
||||
|
||||
/*
|
||||
* os_oline
|
||||
*
|
||||
* Provides the command operserv/oline.
|
||||
*
|
||||
* Used to set oper flags on users, and is specific to UnrealIRCd.
|
||||
* See /helpop ?svso on your IRCd for more information.
|
||||
*/
|
||||
module { name = "os_oline" }
|
||||
command { service = "OperServ"; name = "OLINE"; command = "operserv/oline"; permission = "operserv/oline"; }
|
||||
|
||||
/*
|
||||
* os_oper
|
||||
*
|
||||
* Provides the command operserv/oper.
|
||||
*
|
||||
* Used to configure opers and show information about opertypes.
|
||||
*/
|
||||
module { name = "os_oper" }
|
||||
command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permission = "operserv/oper"; }
|
||||
|
||||
/*
|
||||
* os_reload
|
||||
*
|
||||
* Provides the command operserv/reload.
|
||||
*
|
||||
* Used to reload the services.conf configuration file.
|
||||
*/
|
||||
module { name = "os_reload" }
|
||||
command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; permission = "operserv/reload"; }
|
||||
|
||||
/*
|
||||
* os_session
|
||||
*
|
||||
* Provides the commands operserv/exception and operserv/session.
|
||||
*
|
||||
* This module enables session limiting. Session limiting prevents users from connecting more than a certain
|
||||
* number of times from the same IP 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 can be defined via the exception list.
|
||||
*
|
||||
* Used to manage the session limit exception list, and view currently active sessions.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "os_session"
|
||||
|
||||
/*
|
||||
* Default session limit per host. Once a host reaches its session limit, all clients attempting
|
||||
* to connect from that host will be killed.
|
||||
*
|
||||
* This directive is required if os_session is loaded.
|
||||
*/
|
||||
defaultsessionlimit = 3
|
||||
|
||||
/*
|
||||
* The maximum session limit that may be set for a host in an exception.
|
||||
*
|
||||
* This directive is required if os_session is loaded.
|
||||
*/
|
||||
maxsessionlimit = 100
|
||||
|
||||
/*
|
||||
* Sets the default expiry time for session exceptions.
|
||||
*
|
||||
* This directive is required if os_session is loaded.
|
||||
*/
|
||||
exceptionexpiry = 1d
|
||||
|
||||
/*
|
||||
* The message that will be NOTICE'd to a user just before they are removed from the network because
|
||||
* their host's session limit has been exceeded. It may be used to give a slightly more descriptive
|
||||
* reason for the impending kill as opposed to simply "Session limit exceeded".
|
||||
*
|
||||
* This directive is optional, if not set, nothing will be sent.
|
||||
*/
|
||||
sessionlimitexceeded = "The session limit for your IP %IP% has been exceeded."
|
||||
|
||||
/*
|
||||
* Same as above, but should be used to provide a website address where users can find out more
|
||||
* about session limits and how to go about applying for an exception.
|
||||
*
|
||||
* Note: This directive has been intentionally commented out in an effort to remind you to change
|
||||
* the URL it contains. It is recommended that you supply an address/URL where people can get help
|
||||
* regarding session limits.
|
||||
*
|
||||
* This directive is optional, if not set, nothing will be sent.
|
||||
*/
|
||||
#sessionlimitdetailsloc = "Please visit http://your.website.url/ for more information about session limits."
|
||||
|
||||
/*
|
||||
* If set and is not 0, this directive tells Services to add an AKILL if the number of subsequent kills
|
||||
* for the same host exceeds this value, preventing the network from experiencing KILL floods.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
maxsessionkill = 15
|
||||
|
||||
/*
|
||||
* Sets the expiry time for AKILLs set for hosts exceeding the maxsessionkill directive limit.
|
||||
*
|
||||
* This directive is optional, if not set, defaults to 30 minutes.
|
||||
*/
|
||||
sessionautokillexpiry = 30m
|
||||
|
||||
/*
|
||||
* Sets the CIDR value used to determine which IP addresses represent the same person.
|
||||
* By default this would limit 3 connections per IPv4 IP and 3 connections per IPv6 IP.
|
||||
* If you are receiving IPv6 clone attacks it may be useful to set session_ipv6_cidr to
|
||||
* 64 or 48.
|
||||
*/
|
||||
session_ipv4_cidr = 32
|
||||
session_ipv6_cidr = 128
|
||||
}
|
||||
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception"; }
|
||||
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session"; }
|
||||
|
||||
/*
|
||||
* os_set
|
||||
*
|
||||
* Provides the command operserv/set.
|
||||
*
|
||||
* Used to set various settings such as superadmin, debug mode, etc.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "os_set"
|
||||
|
||||
/*
|
||||
* If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant
|
||||
* them extra privileges such as being a founder on ALL channels.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#superadmin = yes
|
||||
}
|
||||
command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set"; }
|
||||
|
||||
/*
|
||||
* os_shutdown
|
||||
*
|
||||
* Provides the commands operserv/quit, operserv/restart, and operserv/shutdown.
|
||||
*
|
||||
* Used to quit, restart, or shutdown services.
|
||||
*/
|
||||
module { name = "os_shutdown" }
|
||||
command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; permission = "operserv/quit"; }
|
||||
command { service = "OperServ"; name = "RESTART"; command = "operserv/restart"; permission = "operserv/restart"; }
|
||||
command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"; permission = "operserv/shutdown"; }
|
||||
|
||||
/*
|
||||
* os_stats
|
||||
*
|
||||
* Provides the operserv/stats command.
|
||||
*
|
||||
* Used to show statistics about services.
|
||||
*/
|
||||
module { name = "os_stats" }
|
||||
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; permission = "operserv/stats"; }
|
||||
|
||||
/*
|
||||
* os_svs
|
||||
*
|
||||
* Provides the commands operserv/svsnick, operserv/svsjoin, and operserv/svspart.
|
||||
*
|
||||
* Used to force users to change nicks, join and part channels.
|
||||
*/
|
||||
module { name = "os_svs" }
|
||||
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svs"; }
|
||||
command { service = "OperServ"; name = "SVSJOIN"; command = "operserv/svsjoin"; permission = "operserv/svs"; }
|
||||
command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart"; permission = "operserv/svs"; }
|
||||
|
||||
/*
|
||||
* os_sxline
|
||||
*
|
||||
* Provides the operserv/snline and operserv/sqline commands.
|
||||
*
|
||||
* Used to ban real names, nick names, and possibly channels.
|
||||
*/
|
||||
module { name = "os_sxline" }
|
||||
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; }
|
||||
command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; permission = "operserv/sqline"; }
|
||||
|
||||
/*
|
||||
* os_update
|
||||
*
|
||||
* Provides the operserv/update command.
|
||||
*
|
||||
* Use to immediately update the databases.
|
||||
*/
|
||||
module { name = "os_update" }
|
||||
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update"; }
|
||||
@@ -0,0 +1,513 @@
|
||||
/*
|
||||
* Example configuration file for Services. After making the appropriate
|
||||
* changes to this file, place it in the Services conf directory (as
|
||||
* specified in the "configure" script, default /home/username/services/conf)
|
||||
* under the name "services.conf".
|
||||
*
|
||||
* The format of this file is fairly simple: three types of comments are supported:
|
||||
* - All text after a '#' on a line is ignored, as in shell scripting
|
||||
* - All text after '//' on a line is ignored, as in C++
|
||||
* - A block of text like this one is ignored, as in C
|
||||
*
|
||||
* Outside of comments, there are three structures: blocks, keys, and values.
|
||||
*
|
||||
* A block is a named container, which contains a number of key to value pairs
|
||||
* - you may think of this as an array.
|
||||
*
|
||||
* A block is created like so:
|
||||
* foobar
|
||||
* {
|
||||
* moo = "cow"
|
||||
* foo = bar
|
||||
* }
|
||||
*
|
||||
* Note that nameless blocks are allowed and are often used with comments to allow
|
||||
* easily commenting an entire block, for example:
|
||||
* #foobar
|
||||
* {
|
||||
* moo = "cow"
|
||||
* foo = bar
|
||||
* }
|
||||
* is an entirely commented block.
|
||||
*
|
||||
* Keys are case insensitive. Values depend on what key - generally, information is
|
||||
* given in the key comment. The quoting of values (and most other syntax) is quite
|
||||
* flexible, however, please do not forget to quote your strings:
|
||||
*
|
||||
* "This is a parameter string with spaces in it"
|
||||
*
|
||||
* If you need to include a double quote inside a quoted string, precede it
|
||||
* by a backslash:
|
||||
*
|
||||
* "This string has \"double quotes\" in it"
|
||||
*
|
||||
* Time parameters can be specified either as an integer representing a
|
||||
* number of seconds (e.g. "3600" = 1 hour), or as an integer with a unit
|
||||
* specifier: "s" = seconds, "m" = minutes, "h" = hours, "d" = days.
|
||||
* Combinations (such as "1h30m") are not permitted. Examples (all of which
|
||||
* represent the same length of time, one day):
|
||||
*
|
||||
* "86400", "86400s", "1440m", "24h", "1d"
|
||||
*
|
||||
* In the documentation for each directive, one of the following will be
|
||||
* included to indicate whether an option is required:
|
||||
*
|
||||
* [REQUIRED]
|
||||
* Indicates a directive which must be given. Without it, Services will
|
||||
* not start.
|
||||
*
|
||||
* [RECOMMENDED]
|
||||
* Indicates a directive which may be omitted, but omitting it may cause
|
||||
* undesirable side effects.
|
||||
*
|
||||
* [OPTIONAL]
|
||||
* Indicates a directive which is optional. If not given, the feature
|
||||
* will typically be disabled. If this is not the case, more
|
||||
* information will be given in the documentation.
|
||||
*
|
||||
* [DISCOURAGED]
|
||||
* Indicates a directive which may cause undesirable side effects if
|
||||
* specified.
|
||||
*
|
||||
* [DEPRECATED]
|
||||
* Indicates a directive which will disappear in a future version of
|
||||
* Services, usually because its functionality has been either
|
||||
* superseded by that of other directives or incorporated into the main
|
||||
* program.
|
||||
*/
|
||||
|
||||
/*
|
||||
* [OPTIONAL] Defines
|
||||
*
|
||||
* You can define values to other values, which can be used to easily change
|
||||
* many values in the configuration. at once.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The services.host define is used in multiple different locations throughout the
|
||||
* configuration for services clients hostnames.
|
||||
*/
|
||||
define
|
||||
{
|
||||
name = "services.host"
|
||||
value = "services.localhost.net"
|
||||
}
|
||||
|
||||
/*
|
||||
* [OPTIONAL] Additional Includes
|
||||
*
|
||||
* You can include additional configuration files here.
|
||||
* You may also include executable files, which will be executed and
|
||||
* the output from it will be included into your configuration.
|
||||
*/
|
||||
|
||||
#include
|
||||
{
|
||||
type = "file"
|
||||
name = "some.conf"
|
||||
}
|
||||
|
||||
#include
|
||||
{
|
||||
type = "executable"
|
||||
name = "/usr/bin/wget -q -O - http://some.misconfigured.network.com/services.conf"
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] IRCd Config
|
||||
*
|
||||
* This section is used to set up Anope to connect to your IRC network.
|
||||
* This section can be included multiple times, and Anope will attempt to
|
||||
* connect to each server until it finally connects.
|
||||
*
|
||||
* Each uplink IRCd should have a corresponding configuration to allow Services
|
||||
* to link to it.
|
||||
*
|
||||
* An example configuration for InspIRCd that is compatible with the below uplink
|
||||
* and serverinfo configuration would look like:
|
||||
*
|
||||
* <link name="services.localhost.net"
|
||||
* ipaddr="127.0.0.1"
|
||||
* port="7000"
|
||||
* sendpass="mypassword"
|
||||
* recvpass="mypassword">
|
||||
* <uline server="services.localhost.net" silent="yes">
|
||||
* <bind address="127.0.0.1" port="7000" type="servers">
|
||||
*
|
||||
* An example configuration for UnrealIRCd that is compatible with the below uplink
|
||||
* and serverinfo configuration would look like:
|
||||
*
|
||||
* link services.localhost.net
|
||||
* {
|
||||
* username *;
|
||||
* hostname *;
|
||||
* bind-ip "127.0.0.1";
|
||||
* port 7000;
|
||||
* hub *;
|
||||
* password-connect "mypassword";
|
||||
* password-receive "mypassword";
|
||||
* class servers;
|
||||
* };
|
||||
* ulines { services.localhost.net; };
|
||||
* listen 127.0.0.1:7000;
|
||||
*/
|
||||
uplink
|
||||
{
|
||||
/*
|
||||
* The IP or hostname of the IRC server you wish to connect Services to.
|
||||
* Usually, you will want to connect Services over 127.0.0.1 (aka localhost).
|
||||
*
|
||||
* NOTE: On some shell providers, this will not be an option.
|
||||
*/
|
||||
host = "127.0.0.1"
|
||||
|
||||
/*
|
||||
* Enable if Services should connect using IPv6.
|
||||
*/
|
||||
ipv6 = no
|
||||
|
||||
/*
|
||||
* Enable if Services should connect using SSL.
|
||||
* You must have m_ssl loaded for this to work.
|
||||
*/
|
||||
ssl = no
|
||||
|
||||
/*
|
||||
* The port to connect to.
|
||||
* The IRCd *MUST* be configured to listen on this port, and to accept
|
||||
* server connections.
|
||||
*
|
||||
* Refer to your IRCd documentation for how this is to be done.
|
||||
*/
|
||||
port = 7000
|
||||
|
||||
/*
|
||||
* The password to send to the IRC server for authentication.
|
||||
* This must match the link block on your IRCd.
|
||||
*
|
||||
* Refer to your IRCd documentation for more information on link blocks.
|
||||
*/
|
||||
password = "mypassword"
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] Server Information
|
||||
*
|
||||
* This section contains information about the Services server.
|
||||
*/
|
||||
serverinfo
|
||||
{
|
||||
/*
|
||||
* The hostname that Services will be seen as, it must have no conflicts with any
|
||||
* other server names on the rest of your IRC network. Note that it does not have
|
||||
* to be an existing hostname, just one that isn't on your network already.
|
||||
*/
|
||||
name = "stats.localhost.net"
|
||||
|
||||
/*
|
||||
* The text which should appear as the server's information in /whois and similar
|
||||
* queries.
|
||||
*/
|
||||
description = "Stats for IRC Networks"
|
||||
|
||||
/*
|
||||
* The local address that Services will bind to before connecting to the remote
|
||||
* server. This may be useful for multihomed hosts. If omitted, Services will let
|
||||
* the Operating System choose the local address. This directive is optional.
|
||||
*
|
||||
* If you don't know what this means or don't need to use it, just leave this
|
||||
* directive commented out.
|
||||
*/
|
||||
#localhost = "nowhere."
|
||||
|
||||
/*
|
||||
* What Server ID to use for this connection?
|
||||
* Note: This should *ONLY* be used for TS6/P10 IRCds. Refer to your IRCd documentation
|
||||
* to see if this is needed.
|
||||
*/
|
||||
#id = "00A"
|
||||
|
||||
/*
|
||||
* The filename containing the Services process ID. The path is relative to the
|
||||
* services root directory.
|
||||
*/
|
||||
pid = "data/services.pid"
|
||||
|
||||
/*
|
||||
* The filename containing the Message of the Day. The path is relative to the
|
||||
* services root directory.
|
||||
*/
|
||||
motd = "conf/services.motd"
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] Protocol module
|
||||
*
|
||||
* This directive tells Anope which IRCd Protocol to speak when connecting.
|
||||
* You MUST modify this to match the IRCd you run.
|
||||
*
|
||||
* Supported:
|
||||
* - bahamut
|
||||
* - charybdis
|
||||
* - hybrid
|
||||
* - inspircd12
|
||||
* - inspircd20
|
||||
* - ngircd
|
||||
* - plexus
|
||||
* - ratbox
|
||||
* - unreal
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "inspircd20"
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] Network Information
|
||||
*
|
||||
* This section contains information about the IRC network that Services will be
|
||||
* connecting to.
|
||||
*/
|
||||
networkinfo
|
||||
{
|
||||
/*
|
||||
* This is the name of the network that Services will be running on.
|
||||
*/
|
||||
networkname = "LocalNet"
|
||||
|
||||
/*
|
||||
* Set this to the maximum allowed nick length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Services being disconnected from the network.
|
||||
*/
|
||||
nicklen = 31
|
||||
|
||||
/* Set this to the maximum allowed ident length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Services being disconnected from the network.
|
||||
*/
|
||||
userlen = 10
|
||||
|
||||
/* Set this to the maximum allowed hostname length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Services being disconnected from the network.
|
||||
*/
|
||||
hostlen = 64
|
||||
|
||||
/* Set this to the maximum allowed channel length on your network.
|
||||
*/
|
||||
chanlen = 32
|
||||
|
||||
/* The maximum number of list modes settable on a channel (such as b, e, I).
|
||||
* Comment out or set to 0 to disable.
|
||||
*/
|
||||
modelistsize = 100
|
||||
|
||||
/*
|
||||
* The characters allowed in hostnames. This is used for validating hostnames given
|
||||
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
|
||||
* recommended unless you know for sure your IRCd supports whatever characters you are
|
||||
* wanting to use. Telling services to set a vHost containing characters your IRCd
|
||||
* disallows could potentially break the IRCd and/or Services.
|
||||
*
|
||||
* It is recommended you DON'T change this.
|
||||
*/
|
||||
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
|
||||
|
||||
/*
|
||||
* If set to true, allows vHosts to not contain dots (.).
|
||||
* Newer IRCds generally do not have a problem with this, but the same warning as
|
||||
* vhost_chars applies.
|
||||
*
|
||||
* It is recommended you DON'T change this.
|
||||
*/
|
||||
allow_undotted_vhosts = false
|
||||
|
||||
/*
|
||||
* The characters that are not allowed to be at the very beginning or very ending
|
||||
* of a vHost. The same warning as vhost_chars applies.
|
||||
*
|
||||
* It is recommended you DON'T change this.
|
||||
*/
|
||||
disallow_start_or_end = ".-"
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] Services Options
|
||||
*
|
||||
* This section contains various options which determine how Services will operate.
|
||||
*/
|
||||
options
|
||||
{
|
||||
/*
|
||||
* On Linux/UNIX systems Anope can setuid and setgid to this user and group
|
||||
* after starting up. This is useful if Anope has to bind to privileged ports
|
||||
*/
|
||||
#user = "anope"
|
||||
#group = "anope"
|
||||
|
||||
/*
|
||||
* The case mapping used by services. This must be set to a valid locale name
|
||||
* installed on your machine. Services use this case map to compare, with
|
||||
* case insensitivity, things such as nick names, channel names, etc.
|
||||
*
|
||||
* We provide two special casemaps shipped with Anope, ascii and rfc1459.
|
||||
*
|
||||
* This value should be set to what your IRCd uses, which is probably rfc1459,
|
||||
* however Anope has always used ascii for comparison, so the default is ascii.
|
||||
*
|
||||
* Changing this value once set is not recommended.
|
||||
*/
|
||||
casemap = "ascii"
|
||||
|
||||
/*
|
||||
* Sets the timeout period for reading from the uplink.
|
||||
*/
|
||||
readtimeout = 5s
|
||||
|
||||
/*
|
||||
* Sets the interval between sending warning messages for program errors via
|
||||
* WALLOPS/GLOBOPS.
|
||||
*/
|
||||
warningtimeout = 4h
|
||||
|
||||
/*
|
||||
* If set, Services will only show /stats o to IRC Operators. This directive
|
||||
* is optional.
|
||||
*/
|
||||
#hidestatso = yes
|
||||
|
||||
/*
|
||||
* A space-separated list of ulined servers on your network, it is assumed that
|
||||
* the servers in this list are allowed to set channel modes and Services will
|
||||
* not attempt to reverse their mode changes.
|
||||
*
|
||||
* WARNING: Do NOT put your normal IRC user servers in this directive.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#ulineservers = "services.your.network"
|
||||
|
||||
/*
|
||||
* How long to wait between connection retries with the uplink(s).
|
||||
*/
|
||||
retrywait = 60s
|
||||
}
|
||||
|
||||
/*
|
||||
* [RECOMMENDED] Logging Configuration
|
||||
*
|
||||
* This section is used for configuring what is logged and where it is logged to.
|
||||
* You may have multiple log blocks if you wish. Remember to properly secure any
|
||||
* channels you choose to have Anope log to!
|
||||
*/
|
||||
log
|
||||
{
|
||||
/*
|
||||
* Target(s) to log to, which may be one of the following:
|
||||
* - a channel name
|
||||
* - a filename
|
||||
* - globops
|
||||
*/
|
||||
target = "stats.log"
|
||||
|
||||
/* Log to both services.log and the channel #services
|
||||
*
|
||||
* Note that some older IRCds, such as Ratbox, require services to be in the
|
||||
* log channel to be able to message it. To do this, configure service:channels to
|
||||
* join your logging channel.
|
||||
*/
|
||||
#target = "stats.log #services"
|
||||
|
||||
/*
|
||||
* The source(s) to only accept log messages from. Leave commented to allow all sources.
|
||||
* This can be a users name, a channel name, one of our clients (eg, OperServ), or a server name.
|
||||
*/
|
||||
#source = ""
|
||||
|
||||
/*
|
||||
* The bot used to log generic messages which have no predefined sender if there
|
||||
* is a channel in the target directive.
|
||||
*/
|
||||
bot = "Global"
|
||||
|
||||
/*
|
||||
* The number of days to keep logfiles, only useful if you are logging to a file.
|
||||
* Set to 0 to never delete old logfiles.
|
||||
*
|
||||
* Note that Anope must run 24 hours a day for this feature to work correctly.
|
||||
*/
|
||||
logage = 7
|
||||
|
||||
/*
|
||||
* What types of log messages should be logged by this block. There are nine general categories:
|
||||
*
|
||||
* servers - Server actions, linking, squitting, etc.
|
||||
* channels - Actions in channels such as joins, parts, kicks, etc.
|
||||
* users - User actions such as connecting, disconnecting, changing name, etc.
|
||||
* other - All other messages without a category.
|
||||
* rawio - Logs raw input and output from services
|
||||
* debug - Debug messages (log files can become VERY large from this).
|
||||
*
|
||||
* These options determine what messages from the categories should be logged. Wildcards are accepted, and
|
||||
* you can also negate values with a ~. For example, "~operserv/akill operserv/*" would log all operserv
|
||||
* messages except for operserv/akill. Note that processing stops at the first matching option, which
|
||||
* means "* ~operserv/*" would log everything because * matches everything.
|
||||
*
|
||||
* Valid server options are:
|
||||
* connect, quit, sync, squit
|
||||
*
|
||||
* Valid channel options are:
|
||||
* create, destroy, join, part, kick, leave, mode
|
||||
*
|
||||
* Valid user options are:
|
||||
* connect, disconnect, quit, nick, ident, host, mode, maxusers, oper
|
||||
*
|
||||
* Rawio and debug are simple yes/no answers, there are no types for them.
|
||||
*
|
||||
* Note that modules may add their own values to these options.
|
||||
*/
|
||||
servers = "*"
|
||||
#channels = "~mode *"
|
||||
users = "connect disconnect nick"
|
||||
other = "*"
|
||||
rawio = no
|
||||
debug = no
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] MySQL Database configuration.
|
||||
*
|
||||
* m_mysql
|
||||
*
|
||||
* This module allows other modules to use MySQL.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "m_mysql"
|
||||
|
||||
mysql
|
||||
{
|
||||
/* The name of this service. */
|
||||
name = "mysql/main"
|
||||
database = "anope"
|
||||
server = "127.0.0.1"
|
||||
username = "anope"
|
||||
password = "mypassword"
|
||||
port = 3306
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* IRC2SQL Gateway
|
||||
* This module collects data about users, channels and servers. It doesn't build stats
|
||||
* itself, however, it gives you the database, it's up to you how you use it.
|
||||
*
|
||||
* Requires a MySQL Database and MySQL version 5.5 or higher
|
||||
*/
|
||||
include
|
||||
{
|
||||
type = "file"
|
||||
name = "irc2sql.example.conf"
|
||||
}
|
||||
|
||||
+1622
-2
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1 @@
|
||||
Reported Bugs from Bugzilla: http://bugs.anope.org/
|
||||
---------------------------------------------------
|
||||
|
||||
|
||||
For all bug reports / updates please see http://bugs.anope.org
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ if(WIN32)
|
||||
endif(IN_SOURCE)
|
||||
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES NEWS ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
|
||||
install(FILES ${DOCS}
|
||||
DESTINATION docs
|
||||
DESTINATION ${DOC_DIR}
|
||||
)
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/README.txt")
|
||||
endif(WIN32)
|
||||
|
||||
+209
-140
@@ -1,170 +1,239 @@
|
||||
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.
|
||||
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 */
|
||||
* Multi Line
|
||||
Multiple line comments should follow the C-style comment, for example:
|
||||
/*
|
||||
* This is a multiple line comment, huzzah..
|
||||
*/
|
||||
|
||||
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.
|
||||
* Single Line
|
||||
Single line comments should also be in the C style, for example:
|
||||
/* This is a boring one-line comment */
|
||||
|
||||
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>}
|
||||
}
|
||||
* 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.
|
||||
|
||||
|
||||
Separation
|
||||
Always put a space in between a keyword like if/while and the condition, for example:
|
||||
if (foo == bar)
|
||||
NOT
|
||||
if(foo == bar)
|
||||
2. Indentation
|
||||
|
||||
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;
|
||||
}
|
||||
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>}
|
||||
}
|
||||
|
||||
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.)
|
||||
3. Separation
|
||||
|
||||
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".
|
||||
Always put a space in between a keyword like if/while and the condition,
|
||||
for example:
|
||||
if (foo == bar)
|
||||
NOT
|
||||
if(foo == bar)
|
||||
|
||||
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.
|
||||
4. Braces
|
||||
|
||||
Use of STL
|
||||
For more information on use of STL in InspIRCd, please see the separate STL FAQ.
|
||||
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;
|
||||
}
|
||||
|
||||
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.
|
||||
and not:
|
||||
if (apples == "green") {
|
||||
cout << "Apples are green" << endl;
|
||||
}
|
||||
|
||||
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.
|
||||
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(); }
|
||||
};
|
||||
|
||||
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.
|
||||
5. Templates
|
||||
|
||||
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!
|
||||
Where possible, use templates rather than #defines. Avoid use of RTTI.
|
||||
|
||||
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.
|
||||
6. Structs
|
||||
|
||||
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.
|
||||
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;
|
||||
|
||||
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.
|
||||
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.)
|
||||
|
||||
|
||||
7. 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".
|
||||
|
||||
|
||||
8. 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'.
|
||||
|
||||
|
||||
9. 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.
|
||||
|
||||
|
||||
10. Use of STL
|
||||
|
||||
For more information on use of STL in InspIRCd, please see the separate
|
||||
STL FAQ.
|
||||
|
||||
|
||||
11. 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.
|
||||
|
||||
|
||||
12. 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.
|
||||
|
||||
|
||||
13. Linefeeds
|
||||
|
||||
Unix linefeeds only please. We do not like to see our screens covered in ^M.
|
||||
|
||||
|
||||
14. 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.
|
||||
|
||||
|
||||
15. 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.
|
||||
|
||||
|
||||
16. 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.
|
||||
|
||||
+260
-252
@@ -1,339 +1,347 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
|
||||
Preamble
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the entire
|
||||
whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years,
|
||||
to give any third party, for a charge no more than your cost of
|
||||
physically performing source distribution, a complete machine-readable
|
||||
copy of the corresponding source code, to be distributed under the terms
|
||||
of Sections 1 and 2 above on a medium customarily used for software
|
||||
interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is allowed
|
||||
only for noncommercial distribution and only if you received the program
|
||||
in object code or executable form with such an offer, in accord with
|
||||
Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent license
|
||||
would not permit royalty-free redistribution of the Program by all those
|
||||
who receive copies directly or indirectly through you, then the only way
|
||||
you could satisfy both it and this License would be to refrain entirely
|
||||
from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is implemented
|
||||
by public license practices. Many people have made generous contributions
|
||||
to the wide range of software distributed through that system in reliance
|
||||
on consistent application of that system; it is up to the author/donor to
|
||||
decide if he or she is willing to distribute software through any other
|
||||
system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
This section is intended to make thoroughly clear what is believed to be
|
||||
a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make
|
||||
it free software which everyone can redistribute and change under
|
||||
these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
<one line to give the program's name and an idea of what it does.>
|
||||
Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
|
||||
type `show w'. This is free software, and you are welcome
|
||||
to redistribute it under certain conditions; type `show c'
|
||||
for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,99 @@
|
||||
Anope Version 2.0.0
|
||||
-------------------
|
||||
Added irc2sql stats module
|
||||
|
||||
Anope Version 1.9.9
|
||||
--------------------
|
||||
A Added a better webpanel template, removed the old one
|
||||
A Added SQL logging support
|
||||
A Added Redis database support
|
||||
A Added ability to configure what privileges XOP commands give
|
||||
U Updated Dutch language file, from Robby <robby@chat.be>
|
||||
U Updated Spanish langauge file, from Isaac Fontal <i_fontal@hotmail.com>
|
||||
F Fix build on Solaris and OSX
|
||||
F Fixed setting BotServ's default settings in the config
|
||||
F Fixed some names of config items, including NickServ's kill protect
|
||||
|
||||
Anope Version 1.9.8
|
||||
--------------------
|
||||
A Ability to configure fantasy commands in the config
|
||||
A Add SVSJOIN and SVSPART commands
|
||||
F Fix "leave" channel log level from not logging
|
||||
F Fix users able to "resend" their registration mail with registration set to admin only
|
||||
F Fix build on OpenBSD
|
||||
F Fix not logging debug logs to the logfile when debug mode is enabled
|
||||
F Fix defcon timeout timer
|
||||
F Fix crash in os_forbid with expiring entries
|
||||
F Fix several issues with db_sql_live
|
||||
|
||||
Anope Version 1.9.7
|
||||
--------------------
|
||||
A Added ability for using regex as patterns for various commands
|
||||
A Extended ability of operserv/akill to also match against nick and realname
|
||||
A Added chanserv:require configuration option
|
||||
A Added nickserv:unregistered_notice and nickserv:registration configuration option
|
||||
A Added options:casemap configuration option
|
||||
A Added a web panel
|
||||
A db_sql_live now allows all tables to be "live", not just a select few
|
||||
|
||||
Anope Version 1.9.6
|
||||
--------------------
|
||||
A Added ability to configure emails sent by services
|
||||
A Added chanserv/up and chanserv/down
|
||||
A Added m_proxyscan
|
||||
A Added more configurability for what vhosts are valid
|
||||
A Added chanserv/log
|
||||
A Added ability to configure ChanServ privileges
|
||||
A Added a new database format
|
||||
A Added SQLite support
|
||||
A Added more verbose messages on startup
|
||||
A Added ability for chanserv/suspend and nickserv/suspend to take an expiry time
|
||||
A Added no nickname ownership config option
|
||||
A Added m_rewrite
|
||||
A Added akill IDs
|
||||
F Fixed crash in clearusers
|
||||
F Fixed crash in /os oper info
|
||||
F Fixed eventfd Config check to work properly on OpenVZ
|
||||
|
||||
Anope Version 1.9.5
|
||||
--------------------
|
||||
A Extended LDAP support
|
||||
A Added os_oper, os_kill, os_forbid, m_statusupdate, cs_sync, and bs_autoassign
|
||||
A Added a new configuration file format
|
||||
A Added a new commands system
|
||||
A Added a new access system, and cs_flags
|
||||
F Fixed not logging debug logs to file
|
||||
F Fixed the mail delay time
|
||||
F Fixed sending account data for unconfirmed nicks
|
||||
F Fixed poll() engine build on FreeBSD
|
||||
F Fixed really large HELP replies being truncated
|
||||
F Fixed sometimes appending !*@* to valid hosts on access lists
|
||||
F Fixed m_ssl sometimes failing connecting for no reason
|
||||
F Fixed crash in cs_entrymsg
|
||||
F Fixed setting -P on channels with only a botserv bot in it
|
||||
F Fixed modemanager complaining about prefixless modes on InspIRCd
|
||||
|
||||
Anope Version 1.9.4
|
||||
--------------------
|
||||
A Automatically set channel founder to the user with the highest access if there is no successor
|
||||
A /chanserv clone command to copy settings from one channel to another.
|
||||
A /chanserv mode command
|
||||
A Ability for users to delete their own access in channels
|
||||
A Added support for Plexus 3
|
||||
A Readded in support for /cs op/deop/etc to op/deop you in all channels
|
||||
A Added LDAP support
|
||||
A Added live SQL support
|
||||
A Added support for learning tracking/storing/locking all modes at runtime
|
||||
A Added m_alias
|
||||
A Added support for XMLRPC queries
|
||||
A Added /botserv set msg
|
||||
A Added /operserv config
|
||||
A Added /ns cert
|
||||
A Added /operserv login
|
||||
F Changed the GHOST command to not allow ghosting unidentified users if the RECOVER command exists
|
||||
F Some failed logic in /operserv exception that prevents proper exceptions from being added
|
||||
F Fixed the anope_os_sxlines MySQL table and code to work after restarting
|
||||
|
||||
Anope Version 1.9.3
|
||||
--------------------
|
||||
A Added italics BotServ kicks support
|
||||
|
||||
@@ -1,3 +1,70 @@
|
||||
Anope Version 2.0.0
|
||||
-------------------
|
||||
options:passlen, enforceruser, enforcerhost, releasetimeout, and guestnickprefix moved to nickserv's module configuration
|
||||
options:hideregisteredcommands added
|
||||
|
||||
Anope Version 1.9.9
|
||||
-------------------
|
||||
There is not many config changes betewen 1.9.8 and 1.9.9, however many of the
|
||||
options have been moved around to make more sense, too many to list here,
|
||||
so get a new config.
|
||||
|
||||
Anope Version 1.9.8
|
||||
-------------------
|
||||
networkinfo:chanlen added
|
||||
options:user and options:group added
|
||||
nickserv:modesonid added to set modes on everyone who identifies
|
||||
nickserv:kill and nickserv:killquick added to configure NickServ's kill timeout
|
||||
nickserv:restoreonrecover added to try to restore a user's session after a ghost
|
||||
command:group added
|
||||
fantasy block added
|
||||
dns block has been moved to modules.conf as a part of m_dns
|
||||
|
||||
Anope Version 1.9.7
|
||||
-------------------
|
||||
operserv:notifications removed in favor of log{} blocks
|
||||
options:regexengine added
|
||||
options:casemap added
|
||||
chanserv:require added
|
||||
nickserv:registration added, emailregistration removed.
|
||||
nickserv:unregistered_notice added
|
||||
|
||||
Anope Version 1.9.6
|
||||
-------------------
|
||||
service:channels added to join services to channels
|
||||
mail block modified to allow configuring of email messages
|
||||
oper:host and oper:vhost added
|
||||
oper:require_oper added
|
||||
options:nonicknameownership added
|
||||
operserv:akillids added
|
||||
nickserv/access oper privilege added
|
||||
|
||||
Anope Version 1.9.5
|
||||
-------------------
|
||||
Don't even try it, get a new config and start over.
|
||||
|
||||
Anope Version 1.9.4
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
memoserv:modules added ms_ignore
|
||||
chanserv:modules added cs_clone and cs_mode
|
||||
nickserv:suspendexpire and nickserv:forbidexpire added
|
||||
chanserv:suspendexpire and chanserv:forbidexpire added
|
||||
module added cs_entrymsg
|
||||
nickserv:modules added ns_ajoin, ns_cert
|
||||
options:nomlock added
|
||||
log:target added globops
|
||||
nickserv:confirmemailchanges added
|
||||
operserv:modules added os_config, os_login
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
operserv:notifications removed osglobal, osmode, oskick, osakill, ossnline, ossqline, osszline, osnoop, osjupe, getpass, setpass, forbid, drop
|
||||
renamed nickserv:preregexpire to nickserv:unconfirmedexpire
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
opertype:commands removed operserv/umode
|
||||
operserv:modules removed os_umode
|
||||
|
||||
Anope Version 1.9.3
|
||||
------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
+9
-12
@@ -31,10 +31,11 @@ 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
|
||||
section on your services.conf file for more information.
|
||||
The DefCon system has to be configured on your operserv.conf file to
|
||||
be enabled. Defcon will be disabled if "defaultlevel" in the defcon
|
||||
block is left commented, or set to 0. Look for the defcon block
|
||||
on your operserv.conf file for more information on enabling and
|
||||
configuring it.
|
||||
|
||||
Make sure you restart Anope after changing the DefCon configuration
|
||||
directives.
|
||||
@@ -45,7 +46,7 @@ Anope DefCon
|
||||
|
||||
No new channel registrations
|
||||
No New Nick Registrations
|
||||
No MLOCK changes
|
||||
No Mode Lock changes
|
||||
Force Chan Mode
|
||||
Use Reduced Session Limit
|
||||
KILL any new clients trying to connect
|
||||
@@ -55,7 +56,7 @@ Anope DefCon
|
||||
No new memos sent to block MemoServ attacks
|
||||
|
||||
Information regarding how to enable this for specific defcon levels can
|
||||
be found in services.conf
|
||||
be found in operserv.conf
|
||||
|
||||
4) Usage
|
||||
|
||||
@@ -70,22 +71,18 @@ Anope DefCon
|
||||
|
||||
/msg OperServ DEFCON 4
|
||||
|
||||
*** Global -- from OperServ: dengel Changed the DEFCON level to 4
|
||||
|
||||
-OperServ- Services are now at DEFCON 4
|
||||
-OperServ- * No new channel registrations
|
||||
-OperServ- * No new nick registrations
|
||||
-OperServ- * No MLOCK changes
|
||||
-OperServ- * No mode lock changes
|
||||
-OperServ- * Use the reduced session limit of 5
|
||||
|
||||
-Global- The Defcon Level is now at Level: 4
|
||||
-Global- The Defcon Level is now at: 4
|
||||
|
||||
Restore normal readiness:
|
||||
|
||||
/msg OperServ DEFCON 5
|
||||
|
||||
*** Global -- from OperServ: dengel Changed the DEFCON level to 5
|
||||
|
||||
-OperServ- Services are now at DEFCON 5
|
||||
|
||||
-Global- Services are now back to normal, sorry for any inconvenience
|
||||
|
||||
+14
-21
@@ -9,34 +9,27 @@ Anope 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.
|
||||
events such as the databases being saved.
|
||||
|
||||
Additionally there is a module included with the core
|
||||
which can provide some clue as to how to use the code in your modules.
|
||||
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
|
||||
|
||||
Anope is told about modules wanting to hook to events by the function
|
||||
ModuleManager::Attach(EventName, Module*);, eg:
|
||||
|
||||
ModuleManager::Attach(I_OnJoinChannel, this);
|
||||
|
||||
You can also specifcy an array of events:
|
||||
|
||||
Implementation i[] = { I_OnJoinChannel, I_OnPartChannel };
|
||||
ModuleManager::Attach(i, this, 2);
|
||||
Where 2 is the number of events in the list
|
||||
|
||||
You must then overload these functions in your main modules class.
|
||||
Each Event in Anope calls a function.
|
||||
You must override 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:
|
||||
case, you would be overriding OnJoinChannel() and OnPartChannel() like so:
|
||||
|
||||
void OnJoinChannel(User *u, Channel *c) { }
|
||||
void OnPartChannel(User *u, Channel *c) { }
|
||||
void OnJoinChannel(User *u, Channel *c) anope_override { }
|
||||
void OnPartChannel(User *u, Channel *c) anope_override { }
|
||||
|
||||
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).
|
||||
Some of these event overrides 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).
|
||||
|
||||
The "anope_override" identifier is for compatibility with C++11.
|
||||
Its usage is highly recommended.
|
||||
|
||||
|
||||
+14
-69
@@ -80,15 +80,6 @@ Note: You should also read the README and FAQ files!
|
||||
|
||||
2) Upgrading Anope
|
||||
|
||||
If you got a .diff file and want to patch the old Anope sources with it,
|
||||
do the following:
|
||||
|
||||
* Copy the .diff file into the root Anope sources directory.
|
||||
* Type patch -p1 <file.diff
|
||||
|
||||
Note that upgrading anope with a patchfile isn't recommended. You should
|
||||
download a new, clean source package, as this will give the best results.
|
||||
|
||||
To upgrade Anope, just follow the installation instructions described in
|
||||
section 1. There are however a few specific guidelines:
|
||||
|
||||
@@ -99,70 +90,26 @@ Note: You should also read the README and FAQ files!
|
||||
3) Setting up the IRCd
|
||||
|
||||
Services acts as an IRC server with pseudo-clients on it. To link them to
|
||||
your network, you'll need to add some lines in the ircd.conf of their hub
|
||||
server (as stated in the RemoteServer configuration directive).
|
||||
your network, you'll need to configure your IRCd to allow services to link.
|
||||
|
||||
For samples below we'll take services.localhost.net as the name of the
|
||||
Services (as stated in the ServerName configuration directive). Note that
|
||||
this samples are made to be as generic as possible, but there might be
|
||||
small variations, depending on your IRCd. For IRCd-specific help with
|
||||
configuration, read near the end of this section.
|
||||
The configuration varies depending on the IRCd, but you will probably need
|
||||
a link block (also called connect block, or C line), a U line (also called
|
||||
a shared block), and be sure that the IRCd is listneing on the given port
|
||||
in the link block.
|
||||
|
||||
First, the C/N lines, that allow Services to link. They also need a
|
||||
Y:line to work correctly.
|
||||
|
||||
Y:27:180:0:0:4000000
|
||||
C:127.0.0.1:mypass:services.localhost.net::30
|
||||
N:127.0.0.1:mypass:services.localhost.net::30
|
||||
|
||||
"mypass" is the same password you mentioned in the RemoteServer
|
||||
configuration directive. 127.0.0.1 is the IP from which Services connect
|
||||
from (linking in localhost is the most efficient way to run Services).
|
||||
|
||||
Then, you have to set-up an U:line, that will allow Services to change
|
||||
channel modes, topics, and much more without being opped in the channel.
|
||||
|
||||
U:services.localhost.net:*:*
|
||||
|
||||
NOTE: if you have more than one server in your network, this line MUST
|
||||
be added on ALL servers, or things won't work correctly.
|
||||
|
||||
Finally, you'll need to add an H:line, to make the OperServ JUPE command
|
||||
work correctly.
|
||||
|
||||
H:*::Services.LocalHost.Net
|
||||
Example link configurations can be found in example.conf for some of the
|
||||
popular IRCds.
|
||||
|
||||
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
|
||||
"readable" form of configuration. For those, use something like:
|
||||
|
||||
link services.localhost.net
|
||||
{
|
||||
username *;
|
||||
hostname localhost;
|
||||
bind-ip *;
|
||||
port 6667;
|
||||
hub *;
|
||||
password-connect "mypass";
|
||||
password-receive "mypass";
|
||||
class servers;
|
||||
};
|
||||
|
||||
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.
|
||||
|
||||
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:
|
||||
You may also try our interactive link maker, which is located at:
|
||||
|
||||
http://anope.org/ilm.php
|
||||
|
||||
4) Starting Anope
|
||||
|
||||
Go into the directory where binaries were installed (by default, this is
|
||||
~/services). Type ./services to launch Anope.
|
||||
~/services/bin). Type ./services to launch Anope.
|
||||
|
||||
If there are syntax errors in the configuration file they will be
|
||||
displayed on the screen. Correct them until there are no errors anymore.
|
||||
@@ -180,21 +127,19 @@ Note: You should also read the README and FAQ files!
|
||||
5) Setting up a crontab
|
||||
|
||||
A crontab entry will allow you to check periodically whether Anope is
|
||||
still running, and restart it if not. You'll need to have Anope binaries
|
||||
and data installed in the same directory for this to work without
|
||||
modification.
|
||||
still running, and restart it if not.
|
||||
|
||||
First rename the example.chk script that is in Anope path (by default,
|
||||
this is ~/services) to services.chk and edit it. You'll need to modify
|
||||
the CONFIGURATION part of the file. Then ensure that the file is marked
|
||||
as executable by typing chmod +x services.chk, and try to launch the
|
||||
this is ~/services/data) to services.chk and edit it. You'll need to
|
||||
modify the CONFIGURATION part of the file. Then ensure that the file is
|
||||
marked as executable by typing chmod +x services.chk, and try to launch the
|
||||
script to see if it works (Anope must not be running when you do this ;))
|
||||
|
||||
When this is done, you'll have to add the crontab entry. Type crontab -e.
|
||||
This will open the default text editor with the crontab file. Enter the
|
||||
following (with correct path):
|
||||
|
||||
*/5 * * * * /home/ircd/services/services.chk >/dev/null 2>&1
|
||||
*/5 * * * * /home/ircd/services/data/services.chk >/dev/null 2>&1
|
||||
|
||||
The */5 at the beginning means "check every 5 minutes". You may replace
|
||||
the 5 with other another number if you want (but less than 60). Consult
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
Instructions d'installation d'Anope
|
||||
------------------------------------
|
||||
|
||||
1) Installation d'Anope
|
||||
2) Mettre à jour Anope
|
||||
3) Configuration de l'IRCd
|
||||
4) Mettre en route Anope
|
||||
5) Mettre en place un crontab
|
||||
|
||||
Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
|
||||
1) Installation d'Anope
|
||||
|
||||
NOTE IMPORTANTE : il n'est pas recommandé d'utiliser (et même d'installer)
|
||||
Anope en tant que root. Utilisez un utilisateur non
|
||||
privilégié. Celui que vous utilisez pour l'IRCd ou un
|
||||
utilisateur dédié suffira.
|
||||
|
||||
La première chose que vous devez faire est d'obtenir le package Anope (si ce
|
||||
n'est déjà fait). Vous pouvez le trouver ici :
|
||||
|
||||
http://www.anope.org/
|
||||
|
||||
Anope peut être installé de deux façons. La méthode recommandée est
|
||||
d'utiliser CMake. Vous pouvez vérifier si CMake est déjà installé
|
||||
sur votre système en utilisant la commande :
|
||||
|
||||
cmake --version
|
||||
|
||||
Si CMake est installé, vous aurez une ligne qui dit quelque chose similaire
|
||||
à "cmake version 2.6 cmake-patch 1". Si la version est inférieure à 2.4 ou
|
||||
si vous obtenez une erreur disant que la commande n'a pas été trouvée,
|
||||
vous ne serez pas en mesure d'utiliser CMake, sauf si vous l'installez
|
||||
vous-même dans votre répertoire home. CMake peut être téléchargé ici :
|
||||
|
||||
http://www.cmake.org/cmake/resources/software.html
|
||||
|
||||
Si vous n'arrivez pas à l'installer (soit en raison du manque d'espace
|
||||
ou de restrictions par votre fournisseur d'hébergement), vous pouvez encore
|
||||
utiliser le script de configuration fourni. Cette option n'est pas
|
||||
recommandée et finira par être retirée, mais est fournie pour la
|
||||
compatibilité de ceux à qui il manque CMake.
|
||||
|
||||
Ensuite, décompressez le package dans votre répertoire home, et allez dans
|
||||
le répértoire qui vient d'être créé.
|
||||
|
||||
Maintenant, tapez ./Config pour lancer le script de configuration. Il va
|
||||
vous poser quelques questions, et compiler Anope sur votre système. Si vous
|
||||
ne savez pas répondre à une question, utilisez la valeur par défaut. La
|
||||
question d'utiliser CMake ou configure dépend de la décision que vous avez
|
||||
prise précedemment. Si vous avez CMake et que vous souhaitez l'utiliser,
|
||||
répondez avec cmake, sinon répondez avec configure.
|
||||
|
||||
Vous pouvez maintenant taper make pour compiler Anope. S'il y'a des erreurs
|
||||
dans le Makefile, *essayez d'utiliser* gmake à la place. Si cela ne
|
||||
fonctionne toujours pas, vous (ou votre administrateur système) devriez
|
||||
installer GNU make.
|
||||
Vous pouvez le trouver ici : ftp://prep.ai.mit.edu/pub/gnu/.
|
||||
|
||||
Maintenant, tapez make install (ou gmake install ; voir ci-dessus). Cela
|
||||
permet d'installer tous les fichiers nécessaires dans les chemins que vous
|
||||
avez spécifié au script configure, et de régler les permissions des fichiers.
|
||||
Vous devez vous assurer que le répertoire data n'est pas accessible par les
|
||||
autres utilisateurs, des utilisateurs malveillants pourraient causer des
|
||||
problèmes sur votre réseau, si les mots de passe ne sont pas chiffrés,
|
||||
ou lire les mémos de tout utilisateur.
|
||||
|
||||
Si vous voyez des erreurs lors de ce processus, merci de nous envoyer un
|
||||
e-mail avec la sortie d'erreur *complète* et n'oubliez pas de mentionner
|
||||
les versions de votre système, compilateur et bibliothèque C++.
|
||||
|
||||
Allez maintenant dans le répertoire de données (par défaut, ~/services/data).
|
||||
Copiez l'exemple de fichier de configuration (example.conf) en services.conf
|
||||
et ouvrez ce dernier avec votre éditeur de texte favori. Il contient toute
|
||||
les directives de configuration. Anope va l'utiliser au démarrage.
|
||||
Lisez attentivement les instructions contenues dans le fichier.
|
||||
L'utilisation des valeurs par défaut n'est pas recommendé et Anope ne
|
||||
fonctionnera probablement pas.
|
||||
|
||||
Si vous avez besoin d'aide, abonnez-vous à la liste de diffusion Anope
|
||||
et envoyez-y vos e-mails pour obtenir de l'aide de la part des autres
|
||||
utilisateurs. Voir le fichier README pour plus d'informations.
|
||||
|
||||
2) Mettre à jour Anope
|
||||
|
||||
Pour mettre à jour Anope, suivez simplement les instructions d'installation
|
||||
décrites dans la section 1. Il y a cependant une ligne de conduite
|
||||
spécifique :
|
||||
|
||||
* IMPORTANT : Sauvegardez vos anciennes bases de données !
|
||||
* Si vous mettez à jour vers une nouvelle version majeure, toujours
|
||||
redémarrer avec un fichier de configuration neuf depuis example.conf.
|
||||
|
||||
3) Configuration de l'IRCd
|
||||
|
||||
Les Services agissent comme un serveur IRC avec des pseudo-clients.
|
||||
Pour les relier à votre réseau, vous aurez besoin de configurer votre IRCd
|
||||
pour permettre aux services de linker.
|
||||
|
||||
La configuration varie selon les IRCd, mais vous aurez probablement besoin
|
||||
d'un block link (aussi appelé connect block, ou C line), un U line (aussi
|
||||
appelé shared block) et assurez-vous que l'IRCd écoute sur le port donné
|
||||
dans le block link.
|
||||
|
||||
Des exemples de configurations de link peuvent être trouvés dans le fichier
|
||||
example.conf pour certains des IRCd les plus populaires.
|
||||
|
||||
Souvenez-vous de /rehash votre IRCd pour appliquer les changements.
|
||||
|
||||
Vous pouvez également essayer notre créateur de link interactif situé ici :
|
||||
|
||||
http://anope.org/ilm.php
|
||||
|
||||
4) Mettre en route Anope
|
||||
|
||||
Allez dans le répertoire où les fichiers binaires ont été installés (par
|
||||
défaut, ~/services/bin). Tapez ./services pour lancer Anope.
|
||||
|
||||
S'il ya des erreurs de syntaxe dans le fichier de configuration, elles
|
||||
seront affichées sur l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait plus.
|
||||
Un démarrage réussi ne générera pas de message.
|
||||
|
||||
Donnez aux services au moins une minute pour se connecter à votre réseau.
|
||||
Certains IRCds sur certains systèmes peuvent être très lents pour le
|
||||
processus de liaison. Si rien n'arrive après environ une minute, il y a
|
||||
probablement un problème de configuration. Essayez de lancer Anope en mode
|
||||
debug ./services -debug -nofork pour voir toutes les erreurs rencontrées
|
||||
et essayez de les corriger.
|
||||
|
||||
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à vous
|
||||
abonner à la liste de diffusion Anope et d'y poser vos question.
|
||||
Voir le fichier README pour plus de détails.
|
||||
|
||||
5) Mettre en place un crontab
|
||||
|
||||
Une entrée crontab vous permettra de vérifier périodiquement si Anope est
|
||||
toujours en cours d'exécution et de le redémarrer s'il n'est pas.
|
||||
|
||||
D'abord renommez le script example.chk qui est dans le chemin d'Anope
|
||||
(par défaut, ~/services/data) en services.chk et modifiez-le. Vous aurez
|
||||
besoin de modifier la partie CONFIGURATION du fichier. Assurez-vous ensuite
|
||||
que le fichier est marqué comme exécutable en tapant chmod +x services.chk
|
||||
et essayez de lancer le script pour voir si cela fonctionne (Anope ne doit
|
||||
pas être en marche lorsque vous faites cela ;))
|
||||
|
||||
Lorsque c'est fait, vous devrez ajouter l'entrée crontab. Tapez crontab -e.
|
||||
Cela va ouvrir l'éditeur de texte par défaut avec le fichier crontab.
|
||||
Entrez la ligne suivante (avec le chemin correct) :
|
||||
|
||||
*/5 * * * * /home/ircd/services/data/services.chk > /dev/null 2>&1
|
||||
|
||||
Le */5 au début signifie "vérifier toutes les 5 minutes". Vous pouvez
|
||||
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
|
||||
Consultez pages de manuel de votre système pour plus de détails sur la
|
||||
syntaxe du fichier crontab. Les pages de manuel intéressantes sont
|
||||
crontab(5), crontab(1) et cron(8).
|
||||
|
||||
Sauvegardez, quittez et c'est installé.
|
||||
@@ -106,18 +106,10 @@ How To Add IRCd Support
|
||||
|
||||
23) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
|
||||
|
||||
24) 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.
|
||||
|
||||
25) Global TLD Prefix: Prefix used to send global messages, should probably
|
||||
24) Global TLD Prefix: Prefix used to send global messages, should probably
|
||||
be "$"
|
||||
|
||||
26) Max Modes: The max number of mode changes we can send in one line
|
||||
25) Max Modes: The max number of mode changes we can send in one line
|
||||
|
||||
3) Modes
|
||||
|
||||
@@ -155,12 +147,6 @@ How To Add IRCd Support
|
||||
|
||||
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 Anope::string &value) { }
|
||||
|
||||
4) Functions and Events
|
||||
|
||||
A brief word about functions and events. All events are captured by creating a Message struct
|
||||
@@ -183,74 +169,19 @@ How To Add IRCd Support
|
||||
|
||||
5) 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.
|
||||
Most IRCDs send a CAPAB or PROTOCTL line so that they can work out what
|
||||
the other end of the connection is capable of doing. The protocol module should
|
||||
handle all of these without the cores knowledge with the exception of the following:
|
||||
|
||||
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
|
||||
CAPAB_QS | Quitstorm - same as NOQUIT
|
||||
|
||||
2) Ensure that the CAPAB/PROTOCTL event his handled correctly.
|
||||
|
||||
A) In the function module constructor make sure that you have the
|
||||
following two lines:
|
||||
|
||||
Message message_capab("CAPAB", event_capab);
|
||||
|
||||
B) Add the function to handle the event
|
||||
|
||||
bool event_capab(const Anope::string &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
CapabParse(params);
|
||||
return true;
|
||||
}
|
||||
|
||||
This function should call the CapabParse function which parses
|
||||
the received CAPAB/PROTOCTL line.
|
||||
You can override the default OnCapab method in IRCdMessage if required.
|
||||
|
||||
6) IRCDProto Class
|
||||
|
||||
|
||||
+25
-9
@@ -7,9 +7,16 @@ Anope Mutli Language Support
|
||||
|
||||
1) Building Anope with gettext support
|
||||
|
||||
To build Anope with gettext support gettext and its devlopmental libraries must be installed on the system.
|
||||
Anope does not require locales to be installed or enabled on the system, but does require the locales-all
|
||||
package on Debian and Debian based systems.
|
||||
To build Anope with gettext support, gettext and its development libraries must be installed on the system.
|
||||
|
||||
On Debian install the locales-all package.
|
||||
|
||||
On Ubuntu run locale-gen for each language you want to enable.
|
||||
For example:
|
||||
locale-gen es_ES.UTF-8
|
||||
|
||||
Then execute:
|
||||
dpkg-reconfigure locales
|
||||
|
||||
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
||||
|
||||
@@ -27,11 +34,20 @@ Anope Mutli Language Support
|
||||
If you have finished a language file translation and you want others to 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.
|
||||
|
||||
NOTE: There is no guarantee we will use your work so please do not be offended if we say no thanks.
|
||||
|
||||
3) Using langages with modules
|
||||
|
||||
Module authors can easially add the ability to have their modules translated by adding _() around the strings they
|
||||
need translated (messages to the user, etc). See a few of the modules in /modules/extras (cs_appendtopic, hs_request)
|
||||
for examples of this. If you want to translate a module someone has made, first generate a .pot file if there is none.
|
||||
Run `xgettext -s -d modulename -o modulename.pot --from-code=utf-8 modulename.cpp`. Then, run msginit on the .pot file
|
||||
with `msginit -l language -o modulename.language.po -i modulename.pot`. Translate the new .po file, then place it in
|
||||
the lang folder and rerun ./Config; make && make install.
|
||||
Module authors can easily add the ability to have their modules translated by adding _() around the strings they
|
||||
want translated (messages to the user, etc).
|
||||
|
||||
If you want to translate a module someone has made, first generate a .pot file if there isn't one already using
|
||||
`xgettext -s -d modulename -o modulename.pot --from-code=utf-8 --keyword --keyword=_ modulename.cpp`.
|
||||
The .pot file is a template of all of the language strings extracted from the source file.
|
||||
|
||||
Next, run msginit on the .pot file with
|
||||
`msginit -l language -o modulename.language.po -i modulename.pot`.
|
||||
Translate the new .po file and rerun ./Config; make && make install.
|
||||
|
||||
All .po and .pot files should be placed in modules/third/language. Additionally an update script is provided there
|
||||
that will create .pot files and merge any changes to it with existing .po files.
|
||||
|
||||
+42
-38
@@ -22,16 +22,16 @@ Anope Modules
|
||||
1. If modules are supported by your system, they will be configured
|
||||
automatically when you run ./Config. The modules will be installed
|
||||
to the modules directory in your data path (by default this will
|
||||
be ~/services/modules).
|
||||
be ~/services/data/modules).
|
||||
|
||||
Note: you might need to run "make distclean" prior to running ./Config
|
||||
2. Compile Anope as usual using ./Config. The "make" process will now
|
||||
compile module support into Anope, and compile the default sample
|
||||
modules, and any other module located in the modules folder or any
|
||||
of its sub-directories, eg. modules/extra.
|
||||
|
||||
2. Compile Anope as usual. The (g)make process will now compile module
|
||||
support into Anope, and compile the default sample modules, and/or
|
||||
any other module located on the modules folder ("src/modules/").
|
||||
|
||||
3. Install Anope as usual. The install process will place the compiled
|
||||
modules in their runtime location, making them available for loading.
|
||||
3. Install Anope as usual. The "make install" process will place the
|
||||
compiled modules in their runtime location, making them available
|
||||
for loading.
|
||||
|
||||
4. Start or restart services to make use of the new Anope executable.
|
||||
Note that you do not need to restart to load new or changed modules,
|
||||
@@ -42,59 +42,64 @@ Anope Modules
|
||||
All module manipulation commands are done through OperServ. These are:
|
||||
|
||||
MODLOAD Load a module
|
||||
MODRELOAD Reload a module
|
||||
MODUNLOAD Un-Load a module
|
||||
MODLIST List loaded modules
|
||||
MODINFO Info about a loaded module
|
||||
|
||||
These commands available to Service Roots only.
|
||||
Access to the above commands require the operserv/modload and modlist
|
||||
permissions. Refer to operserv.example.conf.
|
||||
|
||||
You can also load (and pre-load) Modules automatically by loading them
|
||||
on startup. To do so, edit your services.conf file and change the values
|
||||
of "ModuleAutoload" and "ModuleDelayedAutoload" to include the modules
|
||||
you want to load every time Anope starts.
|
||||
on startup. To do so, edit any one of the configuration files (you may
|
||||
want to use modules.conf for third-party/extra modules, or a config
|
||||
file relevant to the *Serv your module operates on, eg. hostserv.conf),
|
||||
and use the following method to load a module on startup or reload:
|
||||
module { name="hs_modname" }
|
||||
|
||||
4) Usage Example
|
||||
|
||||
/msg OperServ modload hs_moo
|
||||
*** Global -- from OperServ: dengel loaded module hs_moo
|
||||
-OperServ- Module hs_moo loaded
|
||||
/msg OperServ modload ns_identify
|
||||
-OperServ- Module ns_identify loaded
|
||||
|
||||
/msg OperServ modinfo hs_moo
|
||||
-OperServ- Module: hs_moo Version: 1.1 Author: Anope loaded: Mar 21 10:54:37 2004 CLT
|
||||
-OperServ- Providing command: /msg HostServ moo
|
||||
/msg OperServ modinfo ns_identify
|
||||
-OperServ- Module: ns_identify Version: 1.9.7 Author: Anope loaded: Jun 17 18:43:08 2012 BST (2 minutes ago)
|
||||
-OperServ- Providing service: nickserv/identify
|
||||
-OperServ- Command ID on NickServ is linked to nickserv/identify
|
||||
-OperServ- Command IDENTIFY on NickServ is linked to nickserv/identify
|
||||
|
||||
/msg HostServ moo
|
||||
-HostServ- MOO! - This command was loaded via a module!
|
||||
/msg OperServ modreload ns_identify
|
||||
-OperServ- Module ns_identify reloaded
|
||||
|
||||
/msg OperServ modunload hs_moo
|
||||
*** Global -- from OperServ: dengel unloaded module hs_moo
|
||||
-OperServ- Module hs_moo unloaded
|
||||
/msg OperServ modunload ns_identify
|
||||
-OperServ- Module ns_identify unloaded
|
||||
|
||||
/msg HostServ moo
|
||||
-HostServ- Unknown command moo. "/msg HostServ HELP" for help.
|
||||
/msg NickServ IDENTIFY
|
||||
-NickServ- Unknown command identify. "/msg NickServ HELP" for help.
|
||||
NOTE: Doing the above, with the command still existing in a config file,
|
||||
will result in a log message, similar to the following:
|
||||
<@NickServ> Command IDENTIFY exists on me, but its service nickserv/identify was not found!
|
||||
|
||||
* Note that the name of the module file is "hs_moo.c", yet we load
|
||||
and reference the module as "hs_moo" only. By naming convention
|
||||
* Note that the name of the module source file is "ns_identify.cpp", yet we
|
||||
load and reference the module as "ns_identify" only. By naming convention
|
||||
modules have an abbreviated service name they attach to (hs_ for
|
||||
HostServ, cs_ for ChanServ, etc) followed by a descriptive keyword.
|
||||
|
||||
5) More Modules
|
||||
|
||||
Anope ships with three sample modules that only illustrates some of the
|
||||
implemented module capabilities. They don't really do much or anything
|
||||
useful.
|
||||
|
||||
You can download more useful modules from http://modules.anope.org/. Just
|
||||
grab the module file (usually with a .c extension). Place the module
|
||||
file in your modules (src/modules) folder; the same folder that contains
|
||||
both hs_moo.c and catserv.c module files.
|
||||
grab the module file (usually with a .cpp extension). Place the module
|
||||
file in your modules (anope-1.9.x/modules/third) folder; although any of
|
||||
the other folders within the modules directory will work.
|
||||
|
||||
The new modules need to be compiled and installed before you can make
|
||||
use of them:
|
||||
|
||||
|
||||
1. Make sure you're in the main source directory. (usually anope-1.X.XX/)
|
||||
2. Run `make modules` to compile any new or changed modules.
|
||||
3. Run `make install` to install the modules.
|
||||
2. Run ./Config to find and configure modules, then `cd build`.
|
||||
3. Run `make` to compile Anope, and any modules.
|
||||
4. Run `make install` to copy the compiled binaries to the ~/services/
|
||||
directory.
|
||||
|
||||
You can now use /msg OperServ MODLOAD to load the new modules.
|
||||
|
||||
@@ -115,7 +120,6 @@ Anope Modules
|
||||
|
||||
* http://wiki.anope.org/
|
||||
|
||||
|
||||
8) Modules Repository
|
||||
|
||||
You can find modules at http://modules.anope.org
|
||||
|
||||
+260
-321
@@ -1,321 +1,260 @@
|
||||
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.
|
||||
Any of the following command-line options can be specified to change
|
||||
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
|
||||
--nofork Do not fork after startup; log messages will be
|
||||
written to terminal
|
||||
--noexpire Expiration routines won't be run at all
|
||||
--version Display the version of Anope
|
||||
--nothird Do not load the non-core modules specified
|
||||
--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 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).
|
||||
|
||||
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 use --debug=<level>, 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 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.
|
||||
|
||||
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-2013 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>
|
||||
* Lee Holmes <lethality@anope.org>
|
||||
* Lucas Nussbaum <lucas@lucas-nussbaum.net>
|
||||
* Mark Summers <mark@goopler.net>
|
||||
* Matthew Beeching <jobe@invictachat.net>
|
||||
* Naram Qashat <cyberbotx@anope.org>
|
||||
* Phil Lavin <phil@anope.org>
|
||||
* Pieter Bootsma <geniusdex@anope.org>
|
||||
* Robin Burchell <w00t@inspircd.org>
|
||||
* Sean Roe <therock247uk@anope.org>
|
||||
* Sebastian V <hal9000@anope.org>
|
||||
* Thomas Juberg Stensås <ShadowMaster@Shadow-Realm.org>
|
||||
* Trystan .S Lee <trystan@nomadirc.net>
|
||||
* openglx <openglx@brasnerd.com.br>
|
||||
|
||||
Anope Translations:
|
||||
|
||||
* Robby <robby@chat.be> (nl_NL)
|
||||
* Kein <kein-of@yandex.ru> (ru_RU)
|
||||
* Maik Funke <Han@mefalcon.org> (de_DE)
|
||||
* Isaac Fontal <i_fontal@hotmail.com> (es_ES)
|
||||
* Janos Kapitany <sarkanyka@cjbchat.hu> (hu_HU)
|
||||
* Szymon S'wierkosz <szymek@adres.pl> (pl_PL)
|
||||
* Christopher N. <saka@epiknet.org> (fr_FR)
|
||||
* Yusuf Kurekci <ysfm.20@gmail.com> (tr_TR)
|
||||
|
||||
Anope Web panel:
|
||||
|
||||
* Denis M. (Phr33d0m) <god@politeia.in>
|
||||
|
||||
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.
|
||||
|
||||
Anope currently works with:
|
||||
|
||||
* Bahamut 1.4.27 or later (including 1.8)
|
||||
* Charybdis 3.4 or later
|
||||
* Hybrid 8.1 or later
|
||||
* InspIRCd 1.2 or 2.0
|
||||
* ngIRCd 19.2 or later
|
||||
* Plexus 3 or later
|
||||
* 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.
|
||||
Any of the following command-line options can be specified to change
|
||||
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
|
||||
--nofork Do not fork after startup; log messages will be
|
||||
written to terminal
|
||||
--noexpire Expiration routines won't be run at all
|
||||
--version Display the version of Anope
|
||||
--nothird Do not load the non-core modules specified
|
||||
--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 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).
|
||||
|
||||
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 use --debug=<level>, 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 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.
|
||||
|
||||
5) Messages Translations
|
||||
|
||||
Please see LANGUAGE for this information
|
||||
|
||||
6) Contact
|
||||
|
||||
For announcements and discussions about Anope, please visit our
|
||||
Portal and Forums at http://www.anope.org/ -- make sure you register
|
||||
yourself 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 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. :)
|
||||
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
Starting in Anope 1.9.9, Anope has Redis database support (http://redis.io/).
|
||||
This document explains the data structure used by Anope, and explains how
|
||||
keyspace notification works.
|
||||
|
||||
This is not a tutorial on how to use Redis, see http://redis.io/documentation
|
||||
for that.
|
||||
|
||||
Table of Contents
|
||||
-----------------
|
||||
1) Data structure
|
||||
2) Keyspace notifications
|
||||
3) Examples of modifying, deleting, and creating objects
|
||||
|
||||
1) Data structure
|
||||
|
||||
There are 4 key namespaces in Anope, they are:
|
||||
|
||||
id - The keys in id are used to atomically create object ids for new
|
||||
objects. For example, if I were to create a new BotInfo I would first:
|
||||
|
||||
redis 127.0.0.1:6379> INCR id:BotInfo
|
||||
|
||||
To get the object ID of the new object.
|
||||
|
||||
ids - The keys in ids contain a set of all object ids of the given type.
|
||||
For example:
|
||||
|
||||
redis 127.0.0.1:6379> SMEMBERS ids:BotInfo
|
||||
|
||||
Returns "1", "2", "3", "4", "5", "6", "7", "8" because I have 8 bots that
|
||||
have IDs 1, 2, 3, 4, 5, 6, 7, and 8, respectively.
|
||||
|
||||
hash - The keys in hash are the actual objects, stored as hashes. For
|
||||
example, if I had just looked up all BotInfo ids and wanted to iterate
|
||||
over all of them, I woulld start by:
|
||||
|
||||
redis 127.0.0.1:6379> HGETALL hash:BotInfo:1
|
||||
|
||||
Which gets all keys and values from the hash of type BotInfo with id 1.
|
||||
This may return:
|
||||
|
||||
"nick" -> "BotServ"
|
||||
"user" -> "services"
|
||||
"host" -> "services.anope.org"
|
||||
"created" -> "1368704765"
|
||||
|
||||
value - The keys in value only exist to aid looking up object IDs. They
|
||||
are sets of object IDs and are used to map key+value pairs to objects.
|
||||
For example:
|
||||
|
||||
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nick:Adam
|
||||
|
||||
Returns a set of object ids of NickAlias objects that have the key
|
||||
'nick' set to the value 'Adam' in its hash. Clearly this can only
|
||||
ever contain at most one object, since it is not possible to have
|
||||
more than one registered nick with the same name, but other keys
|
||||
will contain more than one, such as:
|
||||
|
||||
redis 127.0.0.1:6379> SMEMBERS value:NickCore:email:adam@anope.org
|
||||
|
||||
Which would return all accounts with the email "adam@anope.org".
|
||||
|
||||
redis 127.0.0.1:6379> SMEMBERS value:ChanAccess:mask:Adam
|
||||
|
||||
Which would return all access entries set on the account "Adam".
|
||||
|
||||
Behavior similar to SQL's AND, can be achieved using the
|
||||
SINTER command, which does set intersection on one or more sets.
|
||||
|
||||
2) Keyspace notifications
|
||||
|
||||
Redis 2.7 (unstable) and 2.8 (stable) and newer support keyspace notifications
|
||||
(http://redis.io/topics/notifications). This allows Redis to notify Anope of
|
||||
any external changes to objects in the database. Once notified, Anope will
|
||||
immediately update the object. Otherwise, Anope keeps all objects in memory
|
||||
and will not regularly read from the databaes once started.
|
||||
|
||||
You can use this to modify objects in Redis and have them immediately reflected
|
||||
back into Anope. Additionally you can use this feature to run multiple Anope
|
||||
instances simultaneously from the same database (see also, Redis database
|
||||
replication).
|
||||
|
||||
To use keyspace notifications you MUST execute
|
||||
|
||||
redis 127.0.0.1:6379> CONFIG SET notify-keyspace-events KA
|
||||
OK
|
||||
|
||||
or set notify-keyspace-events in redis.conf properly. Anope always executes
|
||||
CONFIG SET when it first connects.
|
||||
|
||||
If you do not enable keyspace events properly Anope will be UNABLE to see any
|
||||
object modifications you do.
|
||||
|
||||
The key space ids and value are managed entirely by Anope, you do
|
||||
not (and should not) modify them. Once you modify the object (hash), Anope will
|
||||
update them for you to correctly refelect any changes made to the object.
|
||||
|
||||
Finally, always use atomic operations. If you are inserting a new object with
|
||||
multiple commands, or inserting multiple objects at once, specifically if the
|
||||
objects depend on each other, you MUST use a transaction.
|
||||
|
||||
3) Examples of modifying, deleting, and creating objects
|
||||
|
||||
These examples will ONLY work if you meet the criteria in section 2.
|
||||
|
||||
If I want to change the email account 'Adam' to 'Adam@anope.org', I would execute the following:
|
||||
|
||||
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
|
||||
|
||||
Which returns a value of "1", which is the object id I want to modify.
|
||||
Now to change the email:
|
||||
|
||||
redis 127.0.0.1:6379> HSET hash:NickCore:1 email Adam@anope.org
|
||||
|
||||
You can now see this in NickServ's INFO command:
|
||||
-NickServ- Email address: Adam@anope.org
|
||||
|
||||
If I want to drop the account "Adam", I would execute the following:
|
||||
|
||||
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
|
||||
|
||||
Which returns a value of "1". I would then check:
|
||||
|
||||
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nc:Adam
|
||||
|
||||
To see what nicknames depend on this account to exist, as I will
|
||||
have to remove those too. This returns the values "2", and "3".
|
||||
|
||||
Finally, I can drop the nick using a transaction via:
|
||||
|
||||
redis 127.0.0.1:6379> MULTI
|
||||
OK
|
||||
redis 127.0.0.1:6379> DEL hash:NickAlias:2
|
||||
QUEUED
|
||||
redis 127.0.0.1:6379> DEL hash:NickAlias:3
|
||||
QUEUED
|
||||
redis 127.0.0.1:6379> DEL hash:NickCore:1
|
||||
QUEUED
|
||||
redis 127.0.0.1:6379> EXEC
|
||||
|
||||
Or alternatively simply:
|
||||
|
||||
redis 127.0.0.1:6379> DEL hash:NickAlias:2 hash:NickAlias:3 hash:NickCore:1
|
||||
|
||||
If I wanted to create a BotServ bot, I would execute the following:
|
||||
|
||||
redis 127.0.0.1:6379> INCR id:BotInfo
|
||||
|
||||
Which returns a new object ID for me, in this example it will be "8".
|
||||
Now I can create the object:
|
||||
|
||||
HMSET hash:BotInfo:8 nick redis user redis host services.anope.org realname "Services for IRC Networks"
|
||||
|
||||
Note if you are using HSET instead of HMSET you will need to use a transaction, as shown in the above example.
|
||||
If you are watching your services logs you will immediatly see:
|
||||
|
||||
USERS: redis!redis@services.anope.org (Services for IRC Networks) connected to the network (services.anope.org)
|
||||
|
||||
And the bot redis will be in BotServ's bot list.
|
||||
Notice how ids:BotInfo and the value keys are updated automatically.
|
||||
@@ -1,58 +0,0 @@
|
||||
Legend:
|
||||
x = done
|
||||
? = unsure
|
||||
+ = in progress
|
||||
|
||||
1.9.3
|
||||
-----
|
||||
[x] Add in a subcommand system, ns_set, cs_set, etc.
|
||||
[x] Threading
|
||||
[x] Mail sending needs to be threaded
|
||||
[x] process_numlist needs to die
|
||||
[x] SList needs to die
|
||||
[x] SSL
|
||||
[x] Command handling system needs to die, strtok() needs to die more
|
||||
[x] Asynchronous DNS
|
||||
[x] Hashing system for storing just about everything needs to die
|
||||
[x] Add support for +k, +q, etc type umodes
|
||||
[x] Language system is disgusting, it must die.
|
||||
[x] Modules should also have a way to add strings programatically
|
||||
[x] Should be able to add many strings by dropping a file in a set location.
|
||||
[x] Config bailing on /os reload needs to be non fatal
|
||||
[x] AutoID needs to be able to live through /os restart, current system is just annoying.
|
||||
[x] SQL tables need to changed to have references etc
|
||||
[x] Merge NS INFO blah ALL with NS INFO blah, if you're requesting info, you really want the info anyway.
|
||||
[x] More "friendly" date displays of some things like registration time ("November 7th 2006 (2 years, 0 months, 0 days ago)")
|
||||
[?] Remote identification
|
||||
[x] Move a (lot) of stuff to class members as a defined interface rather than copypasta everywhere (ns_set, ns_saset!)
|
||||
[x] Store vhosts in SQL.
|
||||
|
||||
Future
|
||||
------
|
||||
[+] Method to store listmodes (more generically than AKICK, too) for e.g. +beI and extbans, etc.
|
||||
[ ] XMLRPC to execute commands and get data from Anope
|
||||
[ ] 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
|
||||
[ ] 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)
|
||||
[ ] MS IGNORE. Make it take nick (accounts) or n!u@h masks. Fake success of memo send still, but send to opers?
|
||||
[ ] Allow channel founders to change the fantasy trigger for their channel.
|
||||
[ ] CIDR Akills, session exceptions, etc
|
||||
[ ] Language charset stuff, including collation (1.9.1? phoenix?)
|
||||
[ ] 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
|
||||
[ ] Useful/common "third party" modules to core distro
|
||||
[ ] NS AJOIN
|
||||
[ ] CS ENTRYMSG
|
||||
[?] Don't allow soper accounts to expire
|
||||
[?] Reason for CS SET RESTRICTED
|
||||
[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)
|
||||
[?] Drop CS SET ENTRYMSG, replace with a 'news' type system? (limited to a configured number of items, default 3)
|
||||
+4
-5
@@ -10,15 +10,14 @@ Anope Bundled Tools
|
||||
options. To use the SMTP client instead of sendmail, find the line in your
|
||||
services configuration file (services.conf) that defines sendmailpath. On
|
||||
that line, change the path to your services installation directory, then
|
||||
followed by "tools/anopesmtp" and the IP address of a valid SMTP server. It
|
||||
followed by "bin/anopesmtp" and the IP address of a valid SMTP server. It
|
||||
should look like this:
|
||||
|
||||
sendmailpath = "/home/anope/services/tools/anopesmtp 127.0.0.1"
|
||||
sendmailpath = "/home/anope/services/bin/anopesmtp 127.0.0.1"
|
||||
|
||||
If the SMTP client doesn't send mail, or if there's an other problem with
|
||||
it, you can compile it in debug mode. To do this, open anopesmtp.cpp, and look
|
||||
for "smtp_debug" near the top. Change this from 0 to 1 and recompile
|
||||
the code. This should generate a log file of what happened when it tried
|
||||
it, you can enable debug mode by passing the --debug flag after the server
|
||||
address. This should generate a log file of what happened when it tried
|
||||
to connect to the SMTP server.
|
||||
|
||||
Credits:
|
||||
|
||||
@@ -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.
|
||||
+7
-30
@@ -25,37 +25,16 @@ Anope for Windows
|
||||
|
||||
(NOTE: When installing, tell CMake to add itself to the PATH.)
|
||||
|
||||
If you have Visual C++ 10 (2010) skip ahead to step 2, else you
|
||||
need to download the following free components from Microsoft. Once
|
||||
downloaded, install these packages.
|
||||
If you have Visual C++ 10 or 11 (2010/2012) skip ahead to step 2, else you
|
||||
need to download and install the following free component from Microsoft.
|
||||
|
||||
* Microsoft Visual C++ 2010 Express Edition:
|
||||
http://www.microsoft.com/express/vc/
|
||||
|
||||
or
|
||||
|
||||
then download and install:
|
||||
|
||||
* Microsoft Windows 2008 SDK:
|
||||
http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&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.)
|
||||
http://www.microsoft.com/visualstudio/eng/downloads#d-2010-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
|
||||
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.
|
||||
|
||||
@@ -96,15 +75,13 @@ Anope for Windows
|
||||
will probably not find them and should be told where they are by passing
|
||||
additional search paths to the last question in Config, such as:
|
||||
|
||||
-DEXTRA_INCLUDES:STRING=c:/openssl/include;c:/openssl/lib
|
||||
|
||||
Which would have cmake search both C:\openssl\include and
|
||||
C:\openssl\lib.
|
||||
-DEXTRA_INCLUDE:STRING=c:/openssl/include;c:/mysql/include
|
||||
-DEXTRA_LIBS:STRING=c:/openssl/lib;c:/mysql/lib
|
||||
|
||||
Building Anope with gettext requires libintl, libiconv, libgcc and
|
||||
libmingex. We have precompiled these libraries for you that you may
|
||||
use if you want. They are avaiable at http://anope.org/downloads/anope-extra.zip
|
||||
The OpenSSL and MySQL header files and libraries are also included in
|
||||
The OpenSSL, MySQL, and OpenLDAP header files and libraries are also included in
|
||||
this package. Once downloaded and extracted, you should run install.bat
|
||||
then give Config the path to the new 'installed' directory.
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
Starting with Anope 1.9.4 XMLRPC using PHP's xmlrpc_encode_request and xmlrpc_decode functions is supported.
|
||||
This allows external applications, such as websites, to execute remote procedure calls to Anope in real time.
|
||||
|
||||
Currently there are 5 supported XMLRPC calls, provided by m_xmlrpc_main:
|
||||
|
||||
checkAuthetication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password
|
||||
is correct for the account name, useful for making login pages on websites.
|
||||
|
||||
command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command
|
||||
to execute. This will execute a the given command to Anope using the given service name. If the user given is online, the
|
||||
command reply will go to them, if not it is returned by XMLRPC.
|
||||
|
||||
stats - Takes no parameters, returns miscellaneous stats that can be found in the /operserv stats command.
|
||||
|
||||
channel - Takes one parameter, a channel name, and returns real time information regarding that channel, such as users, modes
|
||||
(ban lists and such), topic etc.
|
||||
|
||||
user - Takes one parameter, a user name, and returns real time information regarding that user.
|
||||
|
||||
XMLRPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL
|
||||
database, such as accounts and registered channel information. It is instead used for pulling realtime data such
|
||||
as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/XMLRPC.
|
||||
|
||||
Also note that the parameter named "id" is reserved for query ID. If you pass a query to Anope containing a value for id. it will
|
||||
be stored by Anope and the same id will be passed back in the result.
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/* XMLRPC Functions
|
||||
*
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
*/
|
||||
|
||||
class AnopeXMLRPC
|
||||
{
|
||||
private $Host;
|
||||
|
||||
function __construct($Host)
|
||||
{
|
||||
$this->Host = $Host;
|
||||
}
|
||||
|
||||
/** Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
|
||||
* $this->RunXMLRPC("checkAuthentication", array("adam", "qwerty"));
|
||||
* If successful returns back an array of useful information.
|
||||
*
|
||||
* Note that $params["id"] is reserved for query ID, you may set it to something if you wish.
|
||||
* If you do, the same ID will be passed back with the reply from Anope.
|
||||
*/
|
||||
function RunXMLRPC($name, $params)
|
||||
{
|
||||
$xmlquery = xmlrpc_encode_request($name, $params);
|
||||
$context = stream_context_create(array("http" => array(
|
||||
"method" => "POST",
|
||||
"header" => "Content-Type: text/xml",
|
||||
"content" => $xmlquery)));
|
||||
|
||||
$inbuf = file_get_contents($this->Host, false, $context);
|
||||
$response = xmlrpc_decode($inbuf);
|
||||
|
||||
if (isset($response[0]))
|
||||
return $response[0];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Do Command on Service as User, eg:
|
||||
* $anope->DoCommand("ChanServ", "Adam", "REGISTER #adam");
|
||||
* Returns an array of information regarding the command execution, if
|
||||
* If 'online' is set to yes, then the reply to the command was sent to the user on IRC.
|
||||
* If 'online' is set to no, then the reply to the command is in the array member 'return'
|
||||
*/
|
||||
function DoCommand($Service, $User, $Command)
|
||||
{
|
||||
return $this->RunXMLRPC("command", array($Service, $User, $Command));
|
||||
}
|
||||
|
||||
/** Check an account/nick name and password to see if they are valid
|
||||
* Returns the account display name if valid
|
||||
*/
|
||||
function CheckAuthentication($Account, $Pass)
|
||||
{
|
||||
$ret = $this->RunXMLRPC("checkAuthentication", array($Account, $Pass));
|
||||
|
||||
if ($ret && $ret["result"] == "Success")
|
||||
return $ret["account"];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Returns an array of misc stats regarding Anope
|
||||
*/
|
||||
function DoStats()
|
||||
{
|
||||
return $this->RunXMLRPC("stats", NULL);
|
||||
}
|
||||
|
||||
/* Look up data for a channel
|
||||
* Returns an array containing channel information, or an array of size one
|
||||
* (just containing the name) if the channel does not exist
|
||||
*/
|
||||
function DoChannel($Channel)
|
||||
{
|
||||
return $this->RunXMLRPC("channel", NULL);
|
||||
}
|
||||
|
||||
/* Like DoChannel(), but different.
|
||||
*/
|
||||
function DoUser($User)
|
||||
{
|
||||
return $this->RunXMLRPC("user", array($User));
|
||||
}
|
||||
}
|
||||
|
||||
$anopexmlrpc = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,168 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
#
|
||||
# Script taken from InspIRCd, www.inspircd.org
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
BEGIN { require 5.8.0; }
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => qw(all);
|
||||
|
||||
use File::Copy ();
|
||||
use Cwd;
|
||||
|
||||
sub list_extras ();
|
||||
sub enable_extras (@);
|
||||
sub disable_extras (@);
|
||||
|
||||
# Routine to list out the extra/ modules that have been enabled.
|
||||
# Note: when getting any filenames out and comparing, it's important to lc it if the
|
||||
# file system is not case-sensitive (== Epoc, MacOS, OS/2 (incl DOS/DJGPP), VMS, Win32
|
||||
# (incl NetWare, Symbian)). Cygwin may or may not be case-sensitive, depending on
|
||||
# configuration, however, File::Spec does not currently tell us (it assumes Unix behavior).
|
||||
sub list_extras () {
|
||||
use File::Spec;
|
||||
# @_ not used
|
||||
my $srcdir = File::Spec->catdir("modules");
|
||||
my $abs_srcdir = File::Spec->rel2abs($srcdir);
|
||||
local $_;
|
||||
my $dd;
|
||||
opendir $dd, File::Spec->catdir($abs_srcdir, "extra") or die (File::Spec->catdir($abs_srcdir, "extra") . ": $!\n");
|
||||
my @extras = map { File::Spec->case_tolerant() ? lc($_) : $_ } (readdir($dd));
|
||||
closedir $dd;
|
||||
undef $dd;
|
||||
opendir $dd, $abs_srcdir or die "$abs_srcdir: $!\n";
|
||||
my @sources = map { File::Spec->case_tolerant() ? lc($_) : $_ } (readdir($dd));
|
||||
closedir $dd;
|
||||
undef $dd;
|
||||
my $maxlen = (sort { $b <=> $a } (map {length($_)} (@extras)))[0];
|
||||
my %extras = ();
|
||||
EXTRA: for my $extra (@extras) {
|
||||
next if (File::Spec->curdir() eq $extra || File::Spec->updir() eq $extra);
|
||||
my $abs_extra = File::Spec->catfile($abs_srcdir, "extra", $extra);
|
||||
my $abs_source = File::Spec->catfile($abs_srcdir, $extra);
|
||||
next unless ($extra =~ m/\.(cpp|h)$/ || (-d $abs_extra)); # C++ Source/Header, or directory
|
||||
if (-l $abs_source) {
|
||||
# Symlink, is it in the right place?
|
||||
my $targ = readlink($abs_source);
|
||||
my $abs_targ = File::Spec->rel2abs($targ, $abs_srcdir);
|
||||
if ($abs_targ eq $abs_extra) {
|
||||
$extras{$extra} = "\e[32;1menabled\e[0m";
|
||||
} else {
|
||||
$extras{$extra} = sprintf("\e[31;1mwrong symlink target (%s)\e[0m", $abs_targ);
|
||||
}
|
||||
} elsif (-e $abs_source) {
|
||||
my ($devext, $inoext) = stat($abs_extra);
|
||||
my ($devsrc, $inosrc, undef, $lnksrc) = stat($abs_source);
|
||||
if ($lnksrc > 1) {
|
||||
if ($devsrc == $devext && $inosrc == $inoext) {
|
||||
$extras{$extra} = "\e[32;1menabled\e[0m";
|
||||
} else {
|
||||
$extras{$extra} = sprintf("\e[31;1mwrong hardlink target (%d:%d)\e[0m", $devsrc, $inosrc);
|
||||
}
|
||||
} else {
|
||||
open my $extfd, "<", $abs_extra;
|
||||
open my $srcfd, "<", $abs_source;
|
||||
local $/ = undef;
|
||||
if (scalar(<$extfd>) eq scalar(<$srcfd>)) {
|
||||
$extras{$extra} = "\e[32;1menabled\e[0m";
|
||||
} else {
|
||||
$extras{$extra} = sprintf("\e[31;1mout of synch (re-copy)\e[0m");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$extras{$extra} = "\e[33;1mdisabled\e[0m";
|
||||
}
|
||||
}
|
||||
|
||||
for my $extra (sort {$a cmp $b} keys(%extras)) {
|
||||
my $text = $extras{$extra};
|
||||
if ($text =~ m/needed by/ && $text !~ m/enabled/) {
|
||||
printf "\e[31;1;5m%-*s = %s%s\e[0m\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? ")" : "");
|
||||
} else {
|
||||
printf "%-*s = %s%s\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? "\e[0m)" : "");
|
||||
}
|
||||
}
|
||||
return keys(%extras) if wantarray; # Can be used by manage_extras.
|
||||
}
|
||||
|
||||
sub enable_extras (@) {
|
||||
my (@extras) = @_;
|
||||
for my $extra (@extras) {
|
||||
my $extrapath = "modules/extra/$extra";
|
||||
if (!-e $extrapath) {
|
||||
print STDERR "Cannot enable \e[32;1m$extra\e[0m : No such file or directory in modules/extra\n";
|
||||
next;
|
||||
}
|
||||
my $source = "modules/$extra";
|
||||
if (-e $source) {
|
||||
print STDERR "Cannot enable \e[32;1m$extra\e[0m : destination in modules exists (might already be enabled?)\n";
|
||||
next;
|
||||
}
|
||||
print "Enabling $extra ... \n";
|
||||
symlink "extra/$extra", $source or print STDERR "$source: Cannot link to 'extra/$extra': $!\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub disable_extras (@)
|
||||
{
|
||||
opendir my $dd, "modules/extra/";
|
||||
my @files = readdir($dd);
|
||||
closedir $dd;
|
||||
my (@extras) = @_;
|
||||
EXTRA: for my $extra (@extras) {
|
||||
my $extrapath = "modules/extra/$extra";
|
||||
my $source = "modules/$extra";
|
||||
if (!-e $extrapath) {
|
||||
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Is not an extra\n";
|
||||
next;
|
||||
}
|
||||
if ((! -l $source) || readlink($source) ne "extra/$extra") {
|
||||
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Source is not a link or doesn't refer to the right file. Remove manually if this is in error.\n";
|
||||
next;
|
||||
}
|
||||
# Now remove.
|
||||
print "Disabling $extra ... \n";
|
||||
unlink "modules/$extra" or print STDERR "Cannot disable \e[32;1m$extra\e[0m : $!\n";
|
||||
}
|
||||
}
|
||||
|
||||
my $clearscreen = `clear`;
|
||||
print $clearscreen;
|
||||
while (1)
|
||||
{
|
||||
list_extras; # print the module list
|
||||
print "\nPlease enter the name of the module or type 'q' to quit.: ";
|
||||
my $input = <STDIN>;
|
||||
chop($input); # remove the trailing \n from the user input
|
||||
|
||||
if ($input eq "q") {
|
||||
if (-e "build") {
|
||||
system("cmake", "build/.");
|
||||
print "\nNow cd build, then run make to build Anope.\n\n";
|
||||
} else {
|
||||
print "\nBuild directory not found. You should run ./Config now.\n\n"
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
print $clearscreen;
|
||||
if ($input eq "") {
|
||||
next;
|
||||
}
|
||||
|
||||
if (-e "modules/$input") {
|
||||
disable_extras($input)
|
||||
} else {
|
||||
enable_extras($input)
|
||||
}
|
||||
}
|
||||
+47
-4
@@ -4,9 +4,10 @@ set_source_files_properties(version.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "$
|
||||
add_executable(version version.cpp)
|
||||
set_target_properties(version PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
|
||||
get_target_property(version_BINARY version LOCATION)
|
||||
# Modify version.h from the above executable, with dependencies to the given headers, version.cpp, and all source files in the main Anope build
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR}/src/version.sh ${CMAKE_CURRENT_SOURCE_DIR}/version.h
|
||||
# Modify version.h from the above executable, with dependencies to version.cpp
|
||||
# and all of the source files in the main build
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build
|
||||
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
DEPENDS version ${SRC_SRCS}
|
||||
)
|
||||
# Add version to list of files for CPack to ignore
|
||||
@@ -16,5 +17,47 @@ if(NOT WIN32)
|
||||
add_to_cpack_ignored_files("version.h$" TRUE)
|
||||
endif(NOT WIN32)
|
||||
|
||||
set(PCH_SOURCES_GCH "")
|
||||
if(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
string(REPLACE " " ";" PCH_CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
file(GLOB PCH_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
|
||||
sort_list(PCH_SOURCES)
|
||||
|
||||
foreach(PCH_SOURCE ${PCH_SOURCES})
|
||||
find_includes(${PCH_SOURCE} INCLUDES)
|
||||
set(INCLUDES_LIST)
|
||||
append_to_list(INCLUDES_LIST ${PCH_SOURCE})
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
|
||||
if(QUOTE_TYPE STREQUAL "quotes")
|
||||
find_in_list(PCH_SOURCES "${FILENAME}" FOUND)
|
||||
if(NOT FOUND EQUAL -1)
|
||||
append_to_list(INCLUDES_LIST ${FILENAME})
|
||||
endif(NOT FOUND EQUAL -1)
|
||||
endif(QUOTE_TYPE STREQUAL "quotes")
|
||||
endforeach(INCLUDE)
|
||||
|
||||
set(PCH_EXTRAFLAGS "")
|
||||
if(DEBUG_BUILD)
|
||||
set(PCH_EXTRAFLAGS "-g")
|
||||
endif(DEBUG_BUILD)
|
||||
if(PCH_SOURCE STREQUAL "module.h")
|
||||
set(PCH_EXTRAFLAGS ${PCH_EXTRAFLAGS} -fPIC)
|
||||
endif(PCH_SOURCE STREQUAL "module.h")
|
||||
if(GETTEXT_INCLUDE)
|
||||
set(PCH_GETTEXT_INCLUDE "-I${GETTEXT_INCLUDE}")
|
||||
endif(GETTEXT_INCLUDE)
|
||||
|
||||
set(PCH_SOURCES_GCH "${PCH_SOURCES_GCH};${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch")
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ARGS ${PCH_CXXFLAGS} ${PCH_EXTRAFLAGS}
|
||||
${PCH_GETTEXT_INCLUDE} -I${CMAKE_CURRENT_BINARY_DIR} -I${Anope_SOURCE_DIR}/modules/pseudoclients ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
|
||||
DEPENDS ${INCLUDES_LIST} VERBATIM
|
||||
)
|
||||
endforeach(PCH_SOURCE ${PCH_SOURCES})
|
||||
endif(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# Add a custom target to the above file
|
||||
add_custom_target(headers DEPENDS version ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||
add_custom_target(headers DEPENDS version ${CMAKE_CURRENT_BINARY_DIR}/version_build ${PCH_SOURCES_GCH})
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ACCESS_H
|
||||
#define ACCESS_H
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
#include "service.h"
|
||||
|
||||
enum
|
||||
{
|
||||
ACCESS_INVALID = -10000,
|
||||
ACCESS_FOUNDER = 10001
|
||||
};
|
||||
|
||||
/* A privilege, probably configured using a privilege{} block. Most
|
||||
* commands require specific privileges to be executed. The AccessProvider
|
||||
* backing each ChanAccess determines whether that ChanAccess has a given
|
||||
* privilege.
|
||||
*/
|
||||
struct CoreExport Privilege
|
||||
{
|
||||
Anope::string name;
|
||||
Anope::string desc;
|
||||
/* Rank relative to other privileges */
|
||||
int rank;
|
||||
|
||||
Privilege(const Anope::string &name, const Anope::string &desc, int rank);
|
||||
bool operator==(const Privilege &other) const;
|
||||
};
|
||||
|
||||
class CoreExport PrivilegeManager
|
||||
{
|
||||
static std::vector<Privilege> Privileges;
|
||||
public:
|
||||
static void AddPrivilege(Privilege p);
|
||||
static void RemovePrivilege(Privilege &p);
|
||||
static Privilege *FindPrivilege(const Anope::string &name);
|
||||
static std::vector<Privilege> &GetPrivileges();
|
||||
static void ClearPrivileges();
|
||||
};
|
||||
|
||||
/* A provider of access. Only used for creating ChanAccesses, as
|
||||
* they contain pure virtual functions.
|
||||
*/
|
||||
class CoreExport AccessProvider : public Service
|
||||
{
|
||||
public:
|
||||
AccessProvider(Module *owner, const Anope::string &name);
|
||||
virtual ~AccessProvider();
|
||||
|
||||
/** Creates a new ChanAccess entry using this provider.
|
||||
* @return The new entry
|
||||
*/
|
||||
virtual ChanAccess *Create() = 0;
|
||||
|
||||
private:
|
||||
static std::list<AccessProvider *> Providers;
|
||||
public:
|
||||
static const std::list<AccessProvider *>& GetProviders();
|
||||
};
|
||||
|
||||
/* Represents one entry of an access list on a channel. */
|
||||
class CoreExport ChanAccess : public Serializable
|
||||
{
|
||||
public:
|
||||
typedef std::multimap<const ChanAccess *, const ChanAccess *> Set;
|
||||
/* shows the 'path' taken to determine if an access entry matches a user
|
||||
* .first are access entries checked
|
||||
* .second are access entries which match
|
||||
*/
|
||||
typedef std::pair<Set, Set> Path;
|
||||
|
||||
/* The provider that created this access entry */
|
||||
AccessProvider *provider;
|
||||
/* Channel this access entry is on */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
/* account this access entry is for, if any */
|
||||
Serialize::Reference<NickCore> nc;
|
||||
Anope::string mask;
|
||||
Anope::string creator;
|
||||
time_t last_seen;
|
||||
time_t created;
|
||||
|
||||
ChanAccess(AccessProvider *p);
|
||||
virtual ~ChanAccess();
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Check if this access entry matches the given user or account
|
||||
* @param u The user
|
||||
* @param nc The account
|
||||
* @param p The path to the access object which matches will be put here
|
||||
*/
|
||||
virtual bool Matches(const User *u, const NickCore *nc, Path &p) const;
|
||||
|
||||
/** Check if this access entry has the given privilege.
|
||||
* @param name The privilege name
|
||||
*/
|
||||
virtual bool HasPriv(const Anope::string &name) const = 0;
|
||||
|
||||
/** Serialize the access given by this access entry into a human
|
||||
* readable form. chanserv/access will return a number, chanserv/xop
|
||||
* will be AOP, SOP, etc.
|
||||
*/
|
||||
virtual Anope::string AccessSerialize() const = 0;
|
||||
|
||||
/** Unserialize this access entry from the given data. This data
|
||||
* will be fetched from AccessSerialize.
|
||||
*/
|
||||
virtual void AccessUnserialize(const Anope::string &data) = 0;
|
||||
|
||||
/* Comparison operators to other Access entries */
|
||||
virtual bool operator>(const ChanAccess &other) const;
|
||||
virtual bool operator<(const ChanAccess &other) const;
|
||||
bool operator>=(const ChanAccess &other) const;
|
||||
bool operator<=(const ChanAccess &other) const;
|
||||
};
|
||||
|
||||
/* A group of access entries. This is used commonly, for example with ChannelInfo::AccessFor,
|
||||
* to show what access a user has on a channel because users can match multiple access entries.
|
||||
*/
|
||||
class CoreExport AccessGroup : public std::vector<ChanAccess *>
|
||||
{
|
||||
public:
|
||||
/* Channel these access entries are on */
|
||||
const ChannelInfo *ci;
|
||||
/* Path from these entries to other entries that they depend on */
|
||||
ChanAccess::Path path;
|
||||
/* Account these entries affect, if any */
|
||||
const NickCore *nc;
|
||||
/* super_admin always gets all privs. founder is a special case where ci->founder == nc */
|
||||
bool super_admin, founder;
|
||||
|
||||
AccessGroup();
|
||||
|
||||
/** Check if this access group has a certain privilege. Eg, it
|
||||
* will check every ChanAccess entry of this group for any that
|
||||
* has the given privilege.
|
||||
* @param priv The privilege
|
||||
* @return true if any entry has the given privilege
|
||||
*/
|
||||
bool HasPriv(const Anope::string &priv) const;
|
||||
|
||||
/** Get the "highest" access entry from this group of entries.
|
||||
* The highest entry is determined by the entry that has the privilege
|
||||
* with the highest rank (see Privilege::rank).
|
||||
* @return The "highest" entry
|
||||
*/
|
||||
const ChanAccess *Highest() const;
|
||||
|
||||
/* Comparison operators to other AccessGroups */
|
||||
bool operator>(const AccessGroup &other) const;
|
||||
bool operator<(const AccessGroup &other) const;
|
||||
bool operator>=(const AccessGroup &other) const;
|
||||
bool operator<=(const AccessGroup &other) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+187
-179
@@ -1,188 +1,163 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ACCOUNT_H
|
||||
#define ACCOUNT_H
|
||||
|
||||
#include "extensible.h"
|
||||
#include "serialize.h"
|
||||
#include "anope.h"
|
||||
#include "memo.h"
|
||||
#include "base.h"
|
||||
|
||||
class NickAlias;
|
||||
class NickCore;
|
||||
class NickRequest;
|
||||
typedef Anope::hash_map<NickAlias *> nickalias_map;
|
||||
typedef Anope::hash_map<NickCore *> nickcore_map;
|
||||
|
||||
typedef unordered_map_namespace::unordered_map<Anope::string, NickAlias *, ci::hash, std::equal_to<ci::string> > nickalias_map;
|
||||
typedef unordered_map_namespace::unordered_map<Anope::string, NickCore *, ci::hash, std::equal_to<ci::string> > nickcore_map;
|
||||
typedef unordered_map_namespace::unordered_map<Anope::string, NickRequest *, ci::hash, std::equal_to<ci::string> > nickrequest_map;
|
||||
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
|
||||
extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
|
||||
|
||||
extern CoreExport nickalias_map NickAliasList;
|
||||
extern CoreExport nickcore_map NickCoreList;
|
||||
extern CoreExport nickrequest_map NickRequestList;
|
||||
|
||||
/* NickServ nickname structures. */
|
||||
|
||||
/** Flags set on NickAliases
|
||||
/* A registered nickname.
|
||||
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*/
|
||||
enum NickNameFlag
|
||||
class CoreExport NickAlias : public Serializable, public Extensible
|
||||
{
|
||||
NS_BEGIN,
|
||||
Anope::string vhost_ident, vhost_host, vhost_creator;
|
||||
time_t vhost_created;
|
||||
|
||||
/* 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
|
||||
};
|
||||
|
||||
class CoreExport NickRequest : public Extensible
|
||||
{
|
||||
public:
|
||||
NickRequest(const Anope::string &nickname);
|
||||
|
||||
~NickRequest();
|
||||
|
||||
Anope::string nick;
|
||||
Anope::string passcode;
|
||||
Anope::string password;
|
||||
Anope::string email;
|
||||
time_t requested;
|
||||
time_t lastmail; /* Unsaved */
|
||||
};
|
||||
Anope::string last_quit;
|
||||
Anope::string last_realname;
|
||||
/* Last usermask this nick was seen on, eg user@host */
|
||||
Anope::string last_usermask;
|
||||
/* Last uncloaked usermask, requires nickserv/auspex to see */
|
||||
Anope::string last_realhost;
|
||||
time_t time_registered;
|
||||
time_t last_seen;
|
||||
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
|
||||
Serialize::Reference<NickCore> nc;
|
||||
|
||||
class NickCore;
|
||||
|
||||
class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_END>
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
/** Constructor
|
||||
* @param nickname The nick
|
||||
* @param nickcore The nickcofe for this nick
|
||||
* @param nickcore The nickcore for this nick
|
||||
*/
|
||||
NickAlias(const Anope::string &nickname, NickCore *nickcore);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~NickAlias();
|
||||
|
||||
Anope::string nick; /* Nickname */
|
||||
Anope::string last_quit; /* Last quit message */
|
||||
Anope::string last_realname; /* Last realname */
|
||||
Anope::string 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;
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Release a nick
|
||||
* See the comment in users.cpp
|
||||
/** Set a vhost for the user
|
||||
* @param ident The ident
|
||||
* @param host The host
|
||||
* @param creator Who created the vhost
|
||||
* @param time When the vhost was craated
|
||||
*/
|
||||
void Release();
|
||||
void SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
|
||||
|
||||
/** 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
|
||||
/** Remove a users vhost
|
||||
**/
|
||||
void RemoveVhost();
|
||||
|
||||
/** Check if the user has a vhost
|
||||
* @return true or false
|
||||
*/
|
||||
void OnCancel(User *u);
|
||||
bool HasVhost() const;
|
||||
|
||||
/** Retrieve the vhost ident
|
||||
* @return the ident
|
||||
*/
|
||||
const Anope::string &GetVhostIdent() const;
|
||||
|
||||
/** Retrieve the vhost host
|
||||
* @return the host
|
||||
*/
|
||||
const Anope::string &GetVhostHost() const;
|
||||
|
||||
/** Retrieve the vhost creator
|
||||
* @return the creator
|
||||
*/
|
||||
const Anope::string &GetVhostCreator() const;
|
||||
|
||||
/** Retrieve when the vhost was created
|
||||
* @return the time it was created
|
||||
*/
|
||||
time_t GetVhostCreated() const;
|
||||
|
||||
/** Finds a registered nick
|
||||
* @param nick The nick to lookup
|
||||
* @return the nick, if found
|
||||
*/
|
||||
static NickAlias *Find(const Anope::string &nick);
|
||||
};
|
||||
|
||||
class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END>
|
||||
/* A registered account. Each account must have a NickAlias with the same nick as the
|
||||
* account's display.
|
||||
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*/
|
||||
class CoreExport NickCore : public Serializable, public Extensible
|
||||
{
|
||||
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
|
||||
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
|
||||
public:
|
||||
/** Default constructor
|
||||
/* Name of the account. Find(display)->nc == this. */
|
||||
Anope::string display;
|
||||
/* User password in form of hashm:data */
|
||||
Anope::string pass;
|
||||
Anope::string email;
|
||||
/* Locale name of the language of the user. Empty means default language */
|
||||
Anope::string language;
|
||||
/* Access list, contains user@host masks of users who get certain privileges based
|
||||
* on if NI_SECURE is set and what (if any) kill protection is enabled. */
|
||||
std::vector<Anope::string> access;
|
||||
MemoInfo memos;
|
||||
std::map<Anope::string, Anope::string> last_modes;
|
||||
|
||||
/* Nicknames registered that are grouped to this account.
|
||||
* for n in aliases, n->nc == this.
|
||||
*/
|
||||
Serialize::Checker<std::vector<NickAlias *> > aliases;
|
||||
|
||||
/* Set if this user is a services operattor. o->ot must exist. */
|
||||
Oper *o;
|
||||
|
||||
/* Unsaved data */
|
||||
|
||||
/* Number of channels registered by this account */
|
||||
uint16_t channelcount;
|
||||
/* Last time an email was sent to this user */
|
||||
time_t lastmail;
|
||||
/* Users online now logged into this account */
|
||||
std::list<User *> users;
|
||||
|
||||
/** Constructor
|
||||
* @param display The display nick
|
||||
*/
|
||||
NickCore(const Anope::string &nickdisplay);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~NickCore();
|
||||
|
||||
std::list<User *> Users;
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
Anope::string display; /* How the nick is displayed */
|
||||
Anope::string pass; /* Password of the nicks */
|
||||
Anope::string email; /* E-mail associated to the nick */
|
||||
Anope::string greet; /* Greet associated to the nick */
|
||||
Anope::string language; /* Language name */
|
||||
std::vector<Anope::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 */
|
||||
std::list<NickAlias *> 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 Anope::string &cmdstr) const;
|
||||
/** Changes the display for this account
|
||||
* @param na The new display, must be grouped to this account.
|
||||
*/
|
||||
void SetDisplay(const NickAlias *na);
|
||||
|
||||
/** 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 Anope::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
|
||||
@@ -200,6 +175,10 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END
|
||||
*/
|
||||
Anope::string GetAccess(unsigned entry) const;
|
||||
|
||||
/** Get the number of entries on the access list for this account.
|
||||
*/
|
||||
unsigned GetAccessCount() const;
|
||||
|
||||
/** Find an entry in the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to search for
|
||||
@@ -222,53 +201,82 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END
|
||||
* Deletes all the memory allocated in the access list vector and then clears the vector.
|
||||
*/
|
||||
void ClearAccess();
|
||||
|
||||
/** Is the given user on this accounts access list?
|
||||
*
|
||||
* @param u The user
|
||||
*
|
||||
* @return true if the user is on the access list
|
||||
*/
|
||||
bool IsOnAccess(const User *u) const;
|
||||
|
||||
/** Finds an account
|
||||
* @param nick The account name to find
|
||||
* @return The account, if it exists
|
||||
*/
|
||||
static NickCore* Find(const Anope::string &nick);
|
||||
|
||||
void AddChannelReference(ChannelInfo *ci);
|
||||
void RemoveChannelReference(ChannelInfo *ci);
|
||||
void GetChannelReferences(std::deque<ChannelInfo *> &queue);
|
||||
};
|
||||
|
||||
/** Timer for colliding nicks to force people off of nicknames
|
||||
/* A request to check if an account/password is valid. These can exist for
|
||||
* extended periods due to the time some authentication modules take.
|
||||
*/
|
||||
class NickServCollide : public Timer
|
||||
class CoreExport IdentifyRequest
|
||||
{
|
||||
dynamic_reference<User> u;
|
||||
Anope::string nick;
|
||||
/* Owner of this request, used to cleanup requests if a module is unloaded
|
||||
* while a reqyest us pending */
|
||||
Module *owner;
|
||||
Anope::string account;
|
||||
Anope::string password;
|
||||
|
||||
std::set<Module *> holds;
|
||||
bool dispatched;
|
||||
bool success;
|
||||
|
||||
static std::set<IdentifyRequest *> Requests;
|
||||
|
||||
protected:
|
||||
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass);
|
||||
virtual ~IdentifyRequest();
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param nick The nick we're colliding
|
||||
* @param delay How long to delay before kicking the user off the nick
|
||||
*/
|
||||
NickServCollide(User *user, time_t delay);
|
||||
/* One of these is called when the request goes through */
|
||||
virtual void OnSuccess() = 0;
|
||||
virtual void OnFail() = 0;
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~NickServCollide();
|
||||
const Anope::string &GetAccount() const { return account; }
|
||||
const Anope::string &GetPassword() const { return password; }
|
||||
|
||||
/** Called when the delay is up
|
||||
* @param t The current time
|
||||
/* Holds this request. When a request is held it must be Released later
|
||||
* for the request to complete. Multiple modules may hold a request at any time,
|
||||
* but the request is not complete until every module has released it. If you do not
|
||||
* require holding this (eg, your password check is done in this thread and immediately)
|
||||
* then you don't need to hold the request before Successing it.
|
||||
* @param m The module holding this request
|
||||
*/
|
||||
void Tick(time_t t);
|
||||
};
|
||||
void Hold(Module *m);
|
||||
|
||||
/** Timers for releasing nicks to be available for use
|
||||
*/
|
||||
class NickServRelease : public User, public Timer
|
||||
{
|
||||
Anope::string nick;
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param na The nick
|
||||
* @param delay The delay before the nick is released
|
||||
/** Releases a held request
|
||||
* @param m The module releaseing the hold
|
||||
*/
|
||||
NickServRelease(NickAlias *na, time_t delay);
|
||||
void Release(Module *m);
|
||||
|
||||
/** Default destructor
|
||||
/** Called by modules when this IdentifyRequest has successeded successfully.
|
||||
* If this request is behind held it must still be Released after calling this.
|
||||
* @param m The module confirming authentication
|
||||
*/
|
||||
virtual ~NickServRelease();
|
||||
void Success(Module *m);
|
||||
|
||||
/** Called when the delay is up
|
||||
* @param t The current time
|
||||
/** Used to either finalize this request or marks
|
||||
* it as dispatched and begins waiting for the module(s)
|
||||
* that have holds to finish.
|
||||
*/
|
||||
void Tick(time_t t);
|
||||
void Dispatch();
|
||||
|
||||
static void ModuleUnload(Module *m);
|
||||
};
|
||||
|
||||
#endif // ACCOUNT_H
|
||||
|
||||
+450
-149
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* (C) 2003-2010 Anope Team
|
||||
*
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ANOPE_H
|
||||
#define ANOPE_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include "hashcomp.h"
|
||||
#include <signal.h>
|
||||
|
||||
class Message;
|
||||
#include "hashcomp.h"
|
||||
|
||||
namespace Anope
|
||||
{
|
||||
@@ -25,12 +24,12 @@ namespace Anope
|
||||
* allow us to only require one type of string everywhere that can be converted
|
||||
* at any time to a specific type of string.
|
||||
*/
|
||||
class string
|
||||
class CoreExport string
|
||||
{
|
||||
private:
|
||||
/**
|
||||
* The actual string is stored in an std::string as it can be converted to
|
||||
* ci::string, irc::string, or a C-style string at any time.
|
||||
* ci::string, or a C-style string at any time.
|
||||
*/
|
||||
std::string _string;
|
||||
public:
|
||||
@@ -51,10 +50,10 @@ namespace Anope
|
||||
string(char chr) : _string() { _string = chr; }
|
||||
string(size_type n, char chr) : _string(n, chr) { }
|
||||
string(const char *_str) : _string(_str) { }
|
||||
string(const char *_str, size_type n) : _string(_str, n) { }
|
||||
string(const std::string &_str) : _string(_str) { }
|
||||
string(const ci::string &_str) : _string(_str.c_str()) { }
|
||||
string(const irc::string &_str) : _string(_str.c_str()) { }
|
||||
string(const string &_str, size_type pos = 0, size_type n = npos) : _string(_str._string, pos, n) { }
|
||||
string(const string &_str, size_type pos, size_type n = npos) : _string(_str._string, pos, n) { }
|
||||
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
|
||||
|
||||
/**
|
||||
@@ -63,8 +62,6 @@ namespace Anope
|
||||
inline string &operator=(char chr) { this->_string = chr; return *this; }
|
||||
inline string &operator=(const char *_str) { this->_string = _str; return *this; }
|
||||
inline string &operator=(const std::string &_str) { this->_string = _str; return *this; }
|
||||
inline string &operator=(const ci::string &_str) { this->_string = _str.c_str(); return *this; }
|
||||
inline string &operator=(const irc::string &_str) { this->_string = _str.c_str(); return *this; }
|
||||
inline string &operator=(const string &_str) { if (this != &_str) this->_string = _str._string; return *this; }
|
||||
|
||||
/**
|
||||
@@ -72,35 +69,21 @@ namespace Anope
|
||||
*/
|
||||
inline bool operator==(const char *_str) const { return this->_string == _str; }
|
||||
inline bool operator==(const std::string &_str) const { return this->_string == _str; }
|
||||
inline bool operator==(const ci::string &_str) const { return ci::string(this->_string.c_str()) == _str; }
|
||||
inline bool operator==(const irc::string &_str) const { return irc::string(this->_string.c_str()) == _str; }
|
||||
inline bool operator==(const string &_str) const { return this->_string == _str._string; }
|
||||
|
||||
inline bool equals_cs(const char *_str) const { return this->_string == _str; }
|
||||
inline bool equals_cs(const std::string &_str) const { return this->_string == _str; }
|
||||
inline bool equals_cs(const ci::string &_str) const { return this->_string == _str.c_str(); }
|
||||
inline bool equals_cs(const irc::string &_str) const { return this->_string == _str.c_str(); }
|
||||
inline bool equals_cs(const string &_str) const { return this->_string == _str._string; }
|
||||
|
||||
inline bool equals_ci(const char *_str) const { return ci::string(this->_string.c_str()) == _str; }
|
||||
inline bool equals_ci(const std::string &_str) const { return ci::string(this->_string.c_str()) == _str.c_str(); }
|
||||
inline bool equals_ci(const ci::string &_str) const { return _str == this->_string.c_str(); }
|
||||
inline bool equals_ci(const irc::string &_str) const { return ci::string(this->_string.c_str()) == _str.c_str(); }
|
||||
inline bool equals_ci(const string &_str) const { return ci::string(this->_string.c_str()) == _str._string.c_str(); }
|
||||
|
||||
inline bool equals_irc(const char *_str) const { return irc::string(this->_string.c_str()) == _str; }
|
||||
inline bool equals_irc(const std::string &_str) const { return irc::string(this->_string.c_str()) == _str.c_str(); }
|
||||
inline bool equals_irc(const ci::string &_str) const { return irc::string(this->_string.c_str()) == _str.c_str(); }
|
||||
inline bool equals_irc(const irc::string &_str) const { return _str == this->_string.c_str(); }
|
||||
inline bool equals_irc(const string &_str) const { return irc::string(this->_string.c_str()) == _str._string.c_str(); }
|
||||
|
||||
/**
|
||||
* Inequality operators, exact opposites of the above.
|
||||
*/
|
||||
inline bool operator!=(const char *_str) const { return !operator==(_str); }
|
||||
inline bool operator!=(const std::string &_str) const { return !operator==(_str); }
|
||||
inline bool operator!=(const ci::string &_str) const { return !operator==(_str); }
|
||||
inline bool operator!=(const irc::string &_str) const { return !operator==(_str); }
|
||||
inline bool operator!=(const string &_str) const { return !operator==(_str); }
|
||||
|
||||
/**
|
||||
@@ -109,8 +92,6 @@ namespace Anope
|
||||
inline string &operator+=(char chr) { this->_string += chr; return *this; }
|
||||
inline string &operator+=(const char *_str) { this->_string += _str; return *this; }
|
||||
inline string &operator+=(const std::string &_str) { this->_string += _str; return *this; }
|
||||
inline string &operator+=(const ci::string &_str) { this->_string += _str.c_str(); return *this; }
|
||||
inline string &operator+=(const irc::string &_str) { this->_string += _str.c_str(); return *this; }
|
||||
inline string &operator+=(const string &_str) { if (this != &_str) this->_string += _str._string; return *this; }
|
||||
|
||||
/**
|
||||
@@ -119,15 +100,11 @@ namespace Anope
|
||||
inline const string operator+(char chr) const { return string(*this) += chr; }
|
||||
inline const string operator+(const char *_str) const { return string(*this) += _str; }
|
||||
inline const string operator+(const std::string &_str) const { return string(*this) += _str; }
|
||||
inline const string operator+(const ci::string &_str) const { return string(*this) += _str; }
|
||||
inline const string operator+(const irc::string &_str) const { return string(*this) += _str; }
|
||||
inline const string operator+(const string &_str) const { return string(*this) += _str; }
|
||||
|
||||
friend const string operator+(char chr, const string &str);
|
||||
friend const string operator+(const char *_str, const string &str);
|
||||
friend const string operator+(const std::string &_str, const string &str);
|
||||
friend const string operator+(const ci::string &_str, const string &str);
|
||||
friend const string operator+(const irc::string &_str, const string &str);
|
||||
|
||||
/**
|
||||
* Less-than operator.
|
||||
@@ -141,7 +118,6 @@ namespace Anope
|
||||
inline std::string &str() { return this->_string; }
|
||||
inline const std::string &str() const { return this->_string; }
|
||||
inline ci::string ci_str() const { return ci::string(this->_string.c_str()); }
|
||||
inline irc::string irc_str() const { return irc::string(this->_string.c_str()); }
|
||||
|
||||
/**
|
||||
* Returns if the string is empty or not.
|
||||
@@ -153,6 +129,20 @@ namespace Anope
|
||||
*/
|
||||
inline size_type length() const { return this->_string.length(); }
|
||||
|
||||
/**
|
||||
* Returns the size of the currently allocated storage space in the string object.
|
||||
* This can be equal or greater than the length of the string.
|
||||
*/
|
||||
inline size_type capacity() const { return this->_string.capacity(); }
|
||||
|
||||
/**
|
||||
* Add a char to the end of the string.
|
||||
*/
|
||||
inline void push_back(char c) { return this->_string.push_back(c); }
|
||||
|
||||
inline string& append(const string &s) { this->_string.append(s.str()); return *this; }
|
||||
inline string& append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||
|
||||
/**
|
||||
* Resizes the string content to n characters.
|
||||
*/
|
||||
@@ -165,6 +155,31 @@ namespace Anope
|
||||
inline iterator erase(const iterator &first, const iterator &last) { return this->_string.erase(first, last); }
|
||||
inline void erase(size_type pos = 0, size_type n = std::string::npos) { this->_string.erase(pos, n); }
|
||||
|
||||
/**
|
||||
* Trim leading and trailing white spaces from the string.
|
||||
*/
|
||||
|
||||
inline string& ltrim()
|
||||
{
|
||||
while (!this->_string.empty() && isspace(this->_string[0]))
|
||||
this->_string.erase(this->_string.begin());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& rtrim()
|
||||
{
|
||||
while (!this->_string.empty() && isspace(this->_string[this->_string.length() - 1]))
|
||||
this->_string.erase(this->_string.length() - 1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& trim()
|
||||
{
|
||||
this->ltrim();
|
||||
this->rtrim();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the string.
|
||||
*/
|
||||
@@ -210,7 +225,7 @@ namespace Anope
|
||||
inline string replace(iterator first, iterator last, const string &_str) { return string(this->_string.replace(first, last, _str._string)); }
|
||||
inline string replace(iterator first, iterator last, size_type n, char chr) { return string(this->_string.replace(first, last, n, chr)); }
|
||||
template <class InputIterator> inline string replace(iterator first, iterator last, InputIterator f, InputIterator l) { return string(this->_string.replace(first, last, f, l)); }
|
||||
inline string replace_all_cs(const string &_orig, const string &_repl)
|
||||
inline string replace_all_cs(const string &_orig, const string &_repl) const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
size_type pos = new_string.find(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
||||
@@ -221,7 +236,7 @@ namespace Anope
|
||||
}
|
||||
return new_string;
|
||||
}
|
||||
inline string replace_all_ci(const string &_orig, const string &_repl)
|
||||
inline string replace_all_ci(const string &_orig, const string &_repl) const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
size_type pos = new_string.find_ci(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
||||
@@ -233,6 +248,28 @@ namespace Anope
|
||||
return new_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the string in lowercase.
|
||||
*/
|
||||
inline string lower() const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
for (size_type i = 0; i < new_string.length(); ++i)
|
||||
new_string[i] = Anope::tolower(new_string[i]);
|
||||
return new_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the string in uppercase.
|
||||
*/
|
||||
inline string upper() const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
for (size_type i = 0; i < new_string.length(); ++i)
|
||||
new_string[i] = Anope::toupper(new_string[i]);
|
||||
return new_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a substring of the string.
|
||||
*/
|
||||
@@ -260,55 +297,136 @@ namespace Anope
|
||||
* Stream insertion operator, must be friend because they cannot be inside the class.
|
||||
*/
|
||||
friend std::ostream &operator<<(std::ostream &os, const string &_str);
|
||||
};
|
||||
|
||||
/** Hash an Anope::string for unorderd_map, passed as the third template arg to unordered_map
|
||||
*/
|
||||
struct hash
|
||||
{
|
||||
/* VS 2008 specific code */
|
||||
enum { bucket_size = 4, min_buckets = 8 };
|
||||
bool operator()(const string &s1, const string &s2) const;
|
||||
/* End of 2008 specific code */
|
||||
|
||||
/** Hash an Anope::string for unordered_map
|
||||
* @param s The string
|
||||
* @return A hash value for the string
|
||||
*/
|
||||
bool operator()(const string &s) const;
|
||||
friend std::istream &operator>>(std::istream &is, string &_str);
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &os, const string &_str) { return os << _str._string; }
|
||||
/* This is not standard to make operator>> behave like operator<< in that it will allow extracting a whole line, not just one word */
|
||||
inline std::istream &operator>>(std::istream &is, string &_str) { return std::getline(is, _str._string); }
|
||||
|
||||
inline const string operator+(char chr, const string &str) { string tmp(chr); tmp += str; return tmp; }
|
||||
inline const string operator+(const char *_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||
inline const string operator+(const std::string &_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||
inline const string operator+(const ci::string &_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||
inline const string operator+(const irc::string &_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||
|
||||
struct hash_ci
|
||||
{
|
||||
inline size_t operator()(const string &s) const
|
||||
{
|
||||
return TR1NS::hash<std::string>()(s.lower().str());
|
||||
}
|
||||
};
|
||||
|
||||
struct hash_cs
|
||||
{
|
||||
inline size_t operator()(const string &s) const
|
||||
{
|
||||
return TR1NS::hash<std::string>()(s.str());
|
||||
}
|
||||
};
|
||||
|
||||
struct compare
|
||||
{
|
||||
inline bool operator()(const string &s1, const string &s2) const
|
||||
{
|
||||
return s1.equals_ci(s2);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> class map : public std::map<string, T, ci::less> { };
|
||||
template<typename T> class multimap : public std::multimap<string, T, ci::less> { };
|
||||
template<typename T> class hash_map : public TR1NS::unordered_map<string, T, hash_ci, compare> { };
|
||||
|
||||
static const char *const compiled = __TIME__ " " __DATE__;
|
||||
|
||||
/** The time Anope started.
|
||||
*/
|
||||
extern CoreExport time_t StartTime;
|
||||
|
||||
/** The value to return from main()
|
||||
*/
|
||||
extern int ReturnValue;
|
||||
|
||||
extern sig_atomic_t Signal;
|
||||
extern CoreExport bool Quitting;
|
||||
extern CoreExport bool Restarting;
|
||||
extern CoreExport Anope::string QuitReason;
|
||||
|
||||
/** The current system time, which is pretty close to being accurate.
|
||||
* Use this unless you need very specific time checks
|
||||
*/
|
||||
extern CoreExport time_t CurTime;
|
||||
|
||||
extern CoreExport string Version();
|
||||
/** The debug level we are running at.
|
||||
*/
|
||||
extern CoreExport int Debug;
|
||||
|
||||
extern CoreExport string Build();
|
||||
/** Other comand line options.
|
||||
*/
|
||||
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
|
||||
|
||||
/** The root of the services installation. Usually ~/services
|
||||
*/
|
||||
extern CoreExport Anope::string ServicesDir;
|
||||
|
||||
/** Services binary name (eg services)
|
||||
*/
|
||||
extern CoreExport Anope::string ServicesBin;
|
||||
|
||||
/** Various directory paths. These can be set at runtime by command line args
|
||||
*/
|
||||
extern CoreExport Anope::string ConfigDir;
|
||||
extern CoreExport Anope::string DataDir;
|
||||
extern CoreExport Anope::string ModuleDir;
|
||||
extern CoreExport Anope::string LocaleDir;
|
||||
extern CoreExport Anope::string LogDir;
|
||||
|
||||
/** The uplink we are currently connected to
|
||||
*/
|
||||
extern CoreExport int CurrentUplink;
|
||||
|
||||
/** Various methods to determine the Anope version running
|
||||
*/
|
||||
extern CoreExport string Version();
|
||||
extern CoreExport string VersionShort();
|
||||
extern CoreExport string VersionBuildString();
|
||||
extern CoreExport int VersionMajor();
|
||||
extern CoreExport int VersionMinor();
|
||||
extern CoreExport int VersionPatch();
|
||||
|
||||
/** Determines if we are still attached to the terminal, and can print
|
||||
* messages to the user via stderr/stdout.
|
||||
* @return true if still attached
|
||||
*/
|
||||
extern bool AtTerm();
|
||||
|
||||
/** Used to "fork" the process and go into the background during initial startup
|
||||
* while we are AtTerm(). The actual fork is not done here, but earlier, and this
|
||||
* simply notifys the parent via kill() to exit().
|
||||
*/
|
||||
extern void Fork();
|
||||
|
||||
/** Does something with the signal in Anope::Signal
|
||||
*/
|
||||
extern void HandleSignal();
|
||||
|
||||
/** One of the first functions called, does general initialization such as reading
|
||||
* command line args, loading the configuration, doing the initial fork() if necessary,
|
||||
* initializating language support, loading modules, and loading databases.
|
||||
* @throws CoreException if something bad went wrong
|
||||
*/
|
||||
extern void Init(int ac, char **av);
|
||||
|
||||
/** Calls the save database event
|
||||
*/
|
||||
extern CoreExport void SaveDatabases();
|
||||
|
||||
/** Check whether two strings match.
|
||||
* @param str The string to check against the pattern (e.g. foobar)
|
||||
* @param mask The pattern to check (e.g. foo*bar)
|
||||
* @param case_sensitive Whether or not the match is case sensitive, default false.
|
||||
* @param use_regex Whether or not to try regex. case_sensitive is not used in regex.
|
||||
*/
|
||||
extern CoreExport bool Match(const Anope::string &str, const Anope::string &mask, bool case_sensitive = false);
|
||||
|
||||
/** Returns a list of pointers to message handlers
|
||||
* @param The message name as sent by the IRCd
|
||||
* @return a vector with pointers to the messagehandlers (you can bind more than one handler to a message)
|
||||
*/
|
||||
extern CoreExport std::vector<Message *> FindMessage(const string &name);
|
||||
extern CoreExport bool Match(const string &str, const string &mask, bool case_sensitive = false, bool use_regex = false);
|
||||
|
||||
/** Converts a string to hex
|
||||
* @param the data to be converted
|
||||
@@ -321,13 +439,107 @@ namespace Anope
|
||||
* @param src The data to be converted
|
||||
* @param dest The destination string
|
||||
*/
|
||||
extern CoreExport void Unhex(const Anope::string &src, Anope::string &dest);
|
||||
extern CoreExport void Unhex(const Anope::string &src, char *dest);
|
||||
extern CoreExport void Unhex(const string &src, string &dest);
|
||||
extern CoreExport void Unhex(const string &src, char *dest, size_t sz);
|
||||
|
||||
/** Base 64 encode a string
|
||||
* @param src The string to encode
|
||||
* @param target Where the encoded string is placed
|
||||
*/
|
||||
extern CoreExport void B64Encode(const string &src, string &target);
|
||||
|
||||
/** Base 64 decode a string
|
||||
* @param src The base64 encoded string
|
||||
* @param target The plain text result
|
||||
*/
|
||||
extern CoreExport void B64Decode(const string &src, string &target);
|
||||
|
||||
/** Return the last error, uses errno/GetLastError() to determin this
|
||||
/** Encrypts what is in 'src' to 'dest'
|
||||
* @param src The source string to encrypt
|
||||
* @param dest The destination where the encrypted string is placed
|
||||
*/
|
||||
extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/** Decrypts what is in 'src' to 'dest'.
|
||||
* @param src The source string to decrypt
|
||||
* @param dest The destination where the decrypted string is placed
|
||||
* @return true if decryption was successful. This is usually not the case
|
||||
* as most encryption methods we use are one way.
|
||||
*/
|
||||
extern CoreExport bool Decrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/** Returns a sequence of data formatted as the format argument specifies.
|
||||
** After the format parameter, the function expects at least as many
|
||||
** additional arguments as specified in format.
|
||||
* @param fmt Format of the Message
|
||||
* @param ... any number of parameters
|
||||
* @return a Anope::string
|
||||
*/
|
||||
extern CoreExport string printf(const char *fmt, ...);
|
||||
|
||||
/** Return the last error code
|
||||
* @return The error code
|
||||
*/
|
||||
extern CoreExport int LastErrorCode();
|
||||
|
||||
/** Return the last error, uses errno/GetLastError() to determine this
|
||||
* @return An error message
|
||||
*/
|
||||
extern CoreExport const Anope::string LastError();
|
||||
extern CoreExport const string LastError();
|
||||
|
||||
/** Determines if a path is a file
|
||||
*/
|
||||
extern CoreExport bool IsFile(const Anope::string &file);
|
||||
|
||||
/** Converts a string into seconds
|
||||
* @param s The string, eg 3d
|
||||
* @return The time represented by the string, eg 259,200
|
||||
*/
|
||||
extern CoreExport time_t DoTime(const Anope::string &s);
|
||||
|
||||
/** Retrieves a human readable string representing the time in seconds
|
||||
* @param seconds The time on seconds, eg 60
|
||||
* @param nc The account to use language settings for to translate this string, if applicable
|
||||
* @return A human readable string, eg "1 minute"
|
||||
*/
|
||||
extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = NULL);
|
||||
|
||||
/** Generates a human readable string of type "expires in ..."
|
||||
* @param expires time in seconds
|
||||
* @param nc The account to use language settings for to translate this string, if applicable
|
||||
* @return A human readable string, eg "expires in 5 days"
|
||||
*/
|
||||
extern CoreExport Anope::string Expires(time_t seconds, const NickCore *nc = NULL);
|
||||
|
||||
/** Converts a time in seconds (epoch) to a human readable format.
|
||||
* @param t The time
|
||||
* @param nc The account to use language settings for to translate this string, if applicable
|
||||
* @param short_output If true, the output is just a date (eg, "Apr 12 20:18:22 2009 MSD"), else it includes the date and how long ago/from now that date is, (eg "Apr 12 20:18:22 2009 MSD (1313 days, 9 hours, 32 minutes ago)"
|
||||
*/
|
||||
extern CoreExport Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false);
|
||||
|
||||
/** Normalize buffer, stripping control characters and colors
|
||||
* @param A string to be parsed for control and color codes
|
||||
* @return A string stripped of control and color codes
|
||||
*/
|
||||
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
|
||||
|
||||
/** Main processing routine. Parses the message and takes the appropriate action.
|
||||
* @param Raw message from the uplink
|
||||
*/
|
||||
extern void Process(const Anope::string &);
|
||||
|
||||
/** Does a blocking dns query and returns the first IP.
|
||||
* @param host host to look up
|
||||
* @param type inet addr type
|
||||
* @return the IP if it was found, else the host
|
||||
*/
|
||||
extern Anope::string Resolve(const Anope::string &host, int type);
|
||||
|
||||
/** Generate a string of random letters and numbers
|
||||
* @param len The length of the string returned
|
||||
*/
|
||||
extern CoreExport Anope::string Random(size_t len);
|
||||
}
|
||||
|
||||
/** sepstream allows for splitting token seperated lists.
|
||||
@@ -341,36 +553,65 @@ class CoreExport sepstream
|
||||
/** Original string.
|
||||
*/
|
||||
Anope::string tokens;
|
||||
/** Last position of a seperator token
|
||||
*/
|
||||
Anope::string::iterator last_starting_position;
|
||||
/** Current string position
|
||||
*/
|
||||
Anope::string::iterator n;
|
||||
/** Seperator value
|
||||
*/
|
||||
char sep;
|
||||
/** Current string position
|
||||
*/
|
||||
size_t pos;
|
||||
/** If set then GetToken() can return an empty string
|
||||
*/
|
||||
bool allow_empty;
|
||||
public:
|
||||
/** Create a sepstream and fill it with the provided data
|
||||
*/
|
||||
sepstream(const Anope::string &source, char seperator);
|
||||
virtual ~sepstream() { }
|
||||
sepstream(const Anope::string &source, char seperator, bool allowempty = false);
|
||||
|
||||
/** 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(Anope::string &token);
|
||||
bool GetToken(Anope::string &token);
|
||||
|
||||
/** Gets token number 'num' from the stream
|
||||
* @param token The token is placed here
|
||||
* @param num The token number to featch
|
||||
* @return True if the token was able to be fetched
|
||||
*/
|
||||
bool GetToken(Anope::string &token, int num);
|
||||
|
||||
/** Gets every token from this stream
|
||||
* @param token Tokens are pushed back here
|
||||
*/
|
||||
template<typename T> void GetTokens(T& token)
|
||||
{
|
||||
token.clear();
|
||||
Anope::string t;
|
||||
while (this->GetToken(t))
|
||||
token.push_back(t);
|
||||
}
|
||||
|
||||
/** Gets token number 'num' from the stream and all remaining tokens.
|
||||
* @param token The token is placed here
|
||||
* @param num The token number to featch
|
||||
* @return True if the token was able to be fetched
|
||||
*/
|
||||
bool GetTokenRemainder(Anope::string &token, int num);
|
||||
|
||||
/** Determines the number of tokens in this stream.
|
||||
* @return The number of tokens in this stream
|
||||
*/
|
||||
int NumTokens();
|
||||
|
||||
/** Fetch the entire remaining stream, without tokenizing
|
||||
* @return The remaining part of the stream
|
||||
*/
|
||||
virtual const Anope::string GetRemaining();
|
||||
const Anope::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();
|
||||
bool StreamEnd();
|
||||
};
|
||||
|
||||
/** A derived form of sepstream, which seperates on commas
|
||||
@@ -393,86 +634,146 @@ class spacesepstream : public sepstream
|
||||
spacesepstream(const Anope::string &source) : sepstream(source, ' ') { }
|
||||
};
|
||||
|
||||
/** The base class that most classes in Anope inherit from
|
||||
/** 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 dynamic_reference_base;
|
||||
class CoreExport Base
|
||||
{
|
||||
/* References to this base class */
|
||||
std::set<dynamic_reference_base *> References;
|
||||
public:
|
||||
Base();
|
||||
virtual ~Base();
|
||||
void AddReference(dynamic_reference_base *r);
|
||||
void DelReference(dynamic_reference_base *r);
|
||||
};
|
||||
|
||||
class dynamic_reference_base : public Base
|
||||
class CoreException : public std::exception
|
||||
{
|
||||
protected:
|
||||
bool invalid;
|
||||
/** Holds the error message to be displayed
|
||||
*/
|
||||
Anope::string err;
|
||||
/** Source of the exception
|
||||
*/
|
||||
Anope::string source;
|
||||
public:
|
||||
dynamic_reference_base() : invalid(false) { }
|
||||
virtual ~dynamic_reference_base() { }
|
||||
inline void Invalidate() { this->invalid = true; }
|
||||
/** Default constructor, just uses the error mesage 'Core threw an exception'.
|
||||
*/
|
||||
CoreException() : err("Core threw an exception"), source("The core") { }
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
CoreException(const Anope::string &message) : err(message), source("The core") { }
|
||||
/** This constructor can be used to specify an error message before throwing,
|
||||
* and to specify the source of the exception.
|
||||
*/
|
||||
CoreException(const Anope::string &message, const Anope::string &src) : err(message), source(src) { }
|
||||
/** 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 ~CoreException() throw() { }
|
||||
/** Returns the reason for the exception.
|
||||
* The module should probably put something informative here as the user will see this upon failure.
|
||||
*/
|
||||
virtual const Anope::string &GetReason() const
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
virtual const Anope::string &GetSource() const
|
||||
{
|
||||
return source;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class dynamic_reference : public dynamic_reference_base
|
||||
class ModuleException : public CoreException
|
||||
{
|
||||
protected:
|
||||
T *ref;
|
||||
public:
|
||||
dynamic_reference(T *obj) : ref(obj)
|
||||
{
|
||||
if (ref)
|
||||
ref->AddReference(this);
|
||||
}
|
||||
/** Default constructor, just uses the error mesage 'Module threw an exception'.
|
||||
*/
|
||||
ModuleException() : CoreException("Module threw an exception", "A Module") { }
|
||||
|
||||
virtual ~dynamic_reference()
|
||||
{
|
||||
if (this->invalid)
|
||||
{
|
||||
this->invalid = false;
|
||||
this->ref = NULL;
|
||||
}
|
||||
else if (ref)
|
||||
ref->DelReference(this);
|
||||
}
|
||||
|
||||
virtual operator bool()
|
||||
{
|
||||
if (this->invalid)
|
||||
{
|
||||
this->invalid = false;
|
||||
this->ref = NULL;
|
||||
}
|
||||
return this->ref;
|
||||
}
|
||||
|
||||
virtual inline void operator=(T *newref)
|
||||
{
|
||||
if (this->invalid)
|
||||
{
|
||||
this->invalid = false;
|
||||
this->ref = NULL;
|
||||
}
|
||||
else if (this->ref)
|
||||
this->ref->DelReference(this);
|
||||
this->ref = newref;
|
||||
if (this->ref)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
|
||||
virtual inline T *operator->()
|
||||
{
|
||||
return this->ref;
|
||||
}
|
||||
|
||||
virtual inline T *operator*()
|
||||
{
|
||||
return this->ref;
|
||||
}
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
ModuleException(const Anope::string &message) : CoreException(message, "A Module") { }
|
||||
/** 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 ~ModuleException() throw() { }
|
||||
};
|
||||
|
||||
class ConvertException : public CoreException
|
||||
{
|
||||
public:
|
||||
ConvertException(const Anope::string &reason = "") : CoreException(reason) { }
|
||||
|
||||
virtual ~ConvertException() throw() { }
|
||||
};
|
||||
|
||||
/** Convert something to a string
|
||||
*/
|
||||
template<typename T> inline Anope::string stringify(const T &x)
|
||||
{
|
||||
std::ostringstream stream;
|
||||
|
||||
if (!(stream << x))
|
||||
throw ConvertException("Stringify fail");
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
template<typename T> inline void convert(const Anope::string &s, T &x, Anope::string &leftover, bool failIfLeftoverChars = true)
|
||||
{
|
||||
leftover.clear();
|
||||
std::istringstream i(s.str());
|
||||
char c;
|
||||
if (!(i >> x))
|
||||
throw ConvertException("Convert fail");
|
||||
if (failIfLeftoverChars)
|
||||
{
|
||||
if (i.get(c))
|
||||
throw ConvertException("Convert fail");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string left;
|
||||
getline(i, left);
|
||||
leftover = left;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T> inline void convert(const Anope::string &s, T &x, bool failIfLeftoverChars = true)
|
||||
{
|
||||
Anope::string Unused;
|
||||
convert(s, x, Unused, failIfLeftoverChars);
|
||||
}
|
||||
|
||||
template<typename T> inline T convertTo(const Anope::string &s, Anope::string &leftover, bool failIfLeftoverChars = true)
|
||||
{
|
||||
T x;
|
||||
convert(s, x, leftover, failIfLeftoverChars);
|
||||
return x;
|
||||
}
|
||||
|
||||
template<typename T> inline T convertTo(const Anope::string &s, bool failIfLeftoverChars = true)
|
||||
{
|
||||
T x;
|
||||
convert(s, x, failIfLeftoverChars);
|
||||
return x;
|
||||
}
|
||||
|
||||
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
|
||||
* for debug builds and static_cast on releass builds
|
||||
* to speed up the program because dynamic_cast relies on RTTI.
|
||||
*/
|
||||
#ifdef DEBUG_BUILD
|
||||
# include <typeinfo>
|
||||
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
||||
{
|
||||
T ret = dynamic_cast<T>(ptr);
|
||||
if (ptr != NULL && ret == NULL)
|
||||
throw CoreException(Anope::string("anope_dynamic_static_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
||||
{
|
||||
return static_cast<T>(ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ANOPE_H
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BASE_H
|
||||
#define BASE_H
|
||||
|
||||
#include "services.h"
|
||||
|
||||
/** The base class that most classes in Anope inherit from
|
||||
*/
|
||||
class CoreExport Base
|
||||
{
|
||||
/* References to this base class */
|
||||
std::set<ReferenceBase *> *references;
|
||||
public:
|
||||
Base();
|
||||
virtual ~Base();
|
||||
|
||||
/** Adds a reference to this object. Eg, when a Reference
|
||||
* is created referring to this object this is called. It is used to
|
||||
* cleanup references when this object is destructed.
|
||||
*/
|
||||
void AddReference(ReferenceBase *r);
|
||||
|
||||
void DelReference(ReferenceBase *r);
|
||||
};
|
||||
|
||||
class ReferenceBase
|
||||
{
|
||||
protected:
|
||||
bool invalid;
|
||||
public:
|
||||
ReferenceBase() : invalid(false) { }
|
||||
ReferenceBase(const ReferenceBase &other) : invalid(other.invalid) { }
|
||||
virtual ~ReferenceBase() { }
|
||||
inline void Invalidate() { this->invalid = true; }
|
||||
};
|
||||
|
||||
/** Used to hold pointers to objects that may be deleted. A Reference will
|
||||
* no longer be valid once the object it refers is destructed.
|
||||
*/
|
||||
template<typename T>
|
||||
class Reference : public ReferenceBase
|
||||
{
|
||||
protected:
|
||||
T *ref;
|
||||
public:
|
||||
Reference() : ref(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
Reference(T *obj) : ref(obj)
|
||||
{
|
||||
if (ref)
|
||||
ref->AddReference(this);
|
||||
}
|
||||
|
||||
Reference(const Reference<T> &other) : ReferenceBase(other), ref(other.ref)
|
||||
{
|
||||
if (operator bool())
|
||||
ref->AddReference(this);
|
||||
}
|
||||
|
||||
virtual ~Reference()
|
||||
{
|
||||
if (operator bool())
|
||||
ref->DelReference(this);
|
||||
}
|
||||
|
||||
inline Reference<T>& operator=(const Reference<T> &other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
if (*this)
|
||||
this->ref->DelReference(this);
|
||||
|
||||
this->ref = other.ref;
|
||||
this->invalid = other.invalid;
|
||||
|
||||
if (*this)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* We explicitly call operator bool here in several places to prevent other
|
||||
* operators, such operator T*, from being called instead, which will mess
|
||||
* with any class inheriting from this that overloads this operator.
|
||||
*/
|
||||
virtual operator bool()
|
||||
{
|
||||
if (!this->invalid)
|
||||
return this->ref != NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline operator T*()
|
||||
{
|
||||
if (operator bool())
|
||||
return this->ref;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator->()
|
||||
{
|
||||
if (operator bool())
|
||||
return this->ref;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator*()
|
||||
{
|
||||
if (operator bool())
|
||||
return this->ref;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Note that we can't have an operator< that returns this->ref < other.ref
|
||||
* because this function is used to sort objects in containers (such as set
|
||||
* or map), and if the references themselves can change if the object they
|
||||
* refer to is invalidated or changed, then this screws with the order that
|
||||
* the objects would be in the container without properly adjusting the
|
||||
* container, resulting in weird stuff.
|
||||
*
|
||||
* As such, we don't allow storing references in containers that require
|
||||
* operator<, because they would not be able to compare what the references
|
||||
* actually referred to.
|
||||
*/
|
||||
|
||||
inline bool operator==(const Reference<T> &other)
|
||||
{
|
||||
if (!this->invalid)
|
||||
return this->ref == other;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // BASE_H
|
||||
|
||||
+73
-34
@@ -1,65 +1,73 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2010 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
|
||||
*
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BOTS_H
|
||||
#define BOTS_H
|
||||
|
||||
#include "users.h"
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
#include "commands.h"
|
||||
|
||||
class BotInfo;
|
||||
|
||||
typedef unordered_map_namespace::unordered_map<Anope::string, BotInfo *, ci::hash, std::equal_to<ci::string> > botinfo_map;
|
||||
typedef unordered_map_namespace::unordered_map<Anope::string, BotInfo *, Anope::hash> botinfo_uid_map;
|
||||
extern CoreExport botinfo_map BotListByNick;
|
||||
extern CoreExport botinfo_uid_map BotListByUID;
|
||||
typedef Anope::map<BotInfo *> botinfo_map;
|
||||
|
||||
/** Flags settable on a bot
|
||||
*/
|
||||
enum BotFlag
|
||||
{
|
||||
BI_BEGIN,
|
||||
|
||||
/* This bot is a core bot. NickServ, ChanServ, etc */
|
||||
BI_CORE,
|
||||
/* This bot can only be assigned by IRCops */
|
||||
BI_PRIVATE,
|
||||
|
||||
BI_END
|
||||
};
|
||||
|
||||
class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
|
||||
extern CoreExport Serialize::Checker<botinfo_map> BotListByNick, BotListByUID;
|
||||
|
||||
/* A service bot (NickServ, ChanServ, a BotServ bot, etc). */
|
||||
class CoreExport BotInfo : public User, public Serializable
|
||||
{
|
||||
/* Channels this bot is assigned to */
|
||||
Serialize::Checker<std::set<ChannelInfo *> > channels;
|
||||
public:
|
||||
uint32 chancount;
|
||||
time_t created; /* Birth date ;) */
|
||||
time_t lastmsg; /* Last time we said something */
|
||||
CommandMap Commands; /* Commands on this bot */
|
||||
time_t created;
|
||||
/* Last time this bot said something (via privmsg) */
|
||||
time_t lastmsg;
|
||||
/* Map of actual command names -> service name/permission required */
|
||||
CommandInfo::map commands;
|
||||
/* Modes the bot should have as configured in service:modes */
|
||||
Anope::string botmodes;
|
||||
/* Channels the bot should be in as configured in service:channels */
|
||||
std::vector<Anope::string> botchannels;
|
||||
/* Whether or not this bot is introduced to the network */
|
||||
bool introduced;
|
||||
/* Bot can only be assigned by irc ops */
|
||||
bool oper_only;
|
||||
/* Bot is defined in the configuration file */
|
||||
bool conf;
|
||||
|
||||
/** 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.
|
||||
* @param bmodes The modes to give the bot.
|
||||
*/
|
||||
BotInfo(const Anope::string &nick, const Anope::string &user = "", const Anope::string &host = "", const Anope::string &real = "");
|
||||
BotInfo(const Anope::string &nick, const Anope::string &user = "", const Anope::string &host = "", const Anope::string &real = "", const Anope::string &bmodes = "");
|
||||
|
||||
/** Destroy a bot, clearing up appropriately.
|
||||
*/
|
||||
virtual ~BotInfo();
|
||||
|
||||
void Serialize(Serialize::Data &data) const;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
void GenerateUID();
|
||||
|
||||
/** Change the nickname for the bot.
|
||||
* @param newnick The nick to change to
|
||||
*/
|
||||
void SetNewNick(const Anope::string &newnick);
|
||||
|
||||
/** Rejoins all channels that this bot is assigned to.
|
||||
* Used on /kill, rename, etc.
|
||||
/** Return the channels this bot is assigned to
|
||||
*/
|
||||
void RejoinAll();
|
||||
const std::set<ChannelInfo *> &GetChannels() const;
|
||||
|
||||
/** Assign this bot to a given channel, removing the existing assigned bot if one exists.
|
||||
* @param u The user assigning the bot, or NULL
|
||||
@@ -73,23 +81,54 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
|
||||
*/
|
||||
void UnAssign(User *u, ChannelInfo *ci);
|
||||
|
||||
/** Get the number of channels this bot is assigned to
|
||||
*/
|
||||
unsigned GetChannelCount() const;
|
||||
|
||||
/** Join this bot to a channel
|
||||
* @param c The channel
|
||||
* @param update_ts Assume we're updating the TS for this channel
|
||||
* @param status The status the bot should have on the channel
|
||||
*/
|
||||
void Join(Channel *c, bool update_ts = false);
|
||||
void Join(Channel *c, ChannelStatus *status = NULL);
|
||||
|
||||
/** Join this bot to a channel
|
||||
* @param chname The channel name
|
||||
* @param update_ts Assume we're updating the TS for this channel
|
||||
* @param status The status the bot should have on the channel
|
||||
*/
|
||||
void Join(const Anope::string &chname, bool update_ts = false);
|
||||
void Join(const Anope::string &chname, ChannelStatus *status = NULL);
|
||||
|
||||
/** Part this bot from a channel
|
||||
* @param c The channel
|
||||
* @param reason The reason we're parting
|
||||
*/
|
||||
void Part(Channel *c, const Anope::string &reason = "");
|
||||
|
||||
/** Called when a user messages this bot
|
||||
* @param u The user
|
||||
* @param message The users' message
|
||||
*/
|
||||
virtual void OnMessage(User *u, const Anope::string &message);
|
||||
|
||||
/** Link a command name to a command in services
|
||||
* @param cname The command name
|
||||
* @param sname The service name
|
||||
* @param permission Permission required to execute the command, if any
|
||||
* @return The commandinfo for the newly created command
|
||||
*/
|
||||
CommandInfo& SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
|
||||
|
||||
/** Get command info for a command
|
||||
* @param cname The command name
|
||||
* @return A struct containing service name and permission
|
||||
*/
|
||||
CommandInfo *GetCommand(const Anope::string &cname);
|
||||
|
||||
/** Find a bot by nick
|
||||
* @param nick The nick
|
||||
* @param nick_only True to only look by nick, and not by UID
|
||||
* @return The bot, if it exists
|
||||
*/
|
||||
static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
|
||||
};
|
||||
|
||||
#endif // BOTS_H
|
||||
|
||||
+154
-145
@@ -1,111 +1,90 @@
|
||||
/* Channel support
|
||||
*
|
||||
* (C) 2008-2010 Anope Team
|
||||
* (C) 2008-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CHANNELS_H
|
||||
#define CHANNELS_H
|
||||
|
||||
typedef unordered_map_namespace::unordered_map<Anope::string, Channel *, ci::hash, std::equal_to<ci::string> > channel_map;
|
||||
#include "anope.h"
|
||||
#include "extensible.h"
|
||||
#include "modes.h"
|
||||
#include "serialize.h"
|
||||
|
||||
typedef Anope::hash_map<Channel *> channel_map;
|
||||
|
||||
extern CoreExport channel_map ChannelList;
|
||||
|
||||
struct UserData
|
||||
{
|
||||
UserData()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
virtual ~UserData() { }
|
||||
|
||||
void Clear()
|
||||
{
|
||||
last_use = last_start = Anope::CurTime;
|
||||
lines = times = 0;
|
||||
lastline.clear();
|
||||
}
|
||||
|
||||
/* Data validity */
|
||||
time_t last_use;
|
||||
|
||||
/* for flood kicker */
|
||||
int16 lines;
|
||||
time_t last_start;
|
||||
|
||||
/* for repeat kicker */
|
||||
Anope::string lastline;
|
||||
int16 times;
|
||||
};
|
||||
|
||||
struct UserContainer
|
||||
/* A user container, there is one of these per user per channel. */
|
||||
struct ChanUserContainer : public Extensible
|
||||
{
|
||||
User *user;
|
||||
UserData ud;
|
||||
ChannelStatus *Status;
|
||||
Channel *chan;
|
||||
/* Status the user has in the channel */
|
||||
ChannelStatus status;
|
||||
|
||||
UserContainer(User *u) : user(u) { }
|
||||
virtual ~UserContainer() { }
|
||||
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
|
||||
};
|
||||
|
||||
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,
|
||||
/* Is a services log channel */
|
||||
CH_LOGCHAN
|
||||
};
|
||||
|
||||
class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
|
||||
class CoreExport Channel : public Base, public Extensible
|
||||
{
|
||||
public:
|
||||
typedef std::multimap<Anope::string, Anope::string> ModeList;
|
||||
private:
|
||||
/** A map of channel modes with their parameters set on this channel
|
||||
*/
|
||||
std::map<ChannelModeName, Anope::string> Params;
|
||||
ModeList modes;
|
||||
|
||||
/* Modes set on the channel */
|
||||
Flags<ChannelModeName, CMODE_END * 2> modes;
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
/* Channel name */
|
||||
Anope::string name;
|
||||
/* Set if this channel is registered. ci->c == this. Contains information relevant to the registered channel */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
/* When the channel was created */
|
||||
time_t creation_time;
|
||||
/* If the channel has just been created in a netjoin */
|
||||
bool syncing;
|
||||
/* Is configured in the conf as a channel bots should be in */
|
||||
bool botchannel;
|
||||
|
||||
/* Users in the channel */
|
||||
typedef std::map<User *, ChanUserContainer *> ChanUserList;
|
||||
ChanUserList users;
|
||||
|
||||
/* Current topic of the channel */
|
||||
Anope::string topic;
|
||||
/* Who set the topic */
|
||||
Anope::string topic_setter;
|
||||
/* The timestamp associated with the topic. Not necessarually anywhere close to Anope::CurTime.
|
||||
* This is the time the topic was *originally set*. When we restore the topic we want to change the TS back
|
||||
* to this, but we can only do this on certain IRCds.
|
||||
*/
|
||||
time_t topic_ts;
|
||||
/* The actual time the topic was set, probably close to Anope::CurTime */
|
||||
time_t topic_time;
|
||||
|
||||
time_t server_modetime; /* Time of last server MODE */
|
||||
time_t chanserv_modetime; /* Time of last check_modes() */
|
||||
int16_t server_modecount; /* Number of server MODEs this second */
|
||||
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
|
||||
int16_t bouncy_modes; /* Did we fail to set modes here? */
|
||||
|
||||
private:
|
||||
/** Constructor
|
||||
* @param name The channel name
|
||||
* @param ts The time the channel was created
|
||||
*/
|
||||
Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
|
||||
|
||||
/** Default destructor
|
||||
public:
|
||||
/** Destructor
|
||||
*/
|
||||
~Channel();
|
||||
|
||||
Anope::string name; /* Channel name */
|
||||
ChannelInfo *ci; /* Corresponding ChannelInfo */
|
||||
time_t creation_time; /* When channel was created */
|
||||
|
||||
EList *bans;
|
||||
EList *excepts;
|
||||
EList *invites;
|
||||
|
||||
/* List of users in the channel */
|
||||
CUserList users;
|
||||
|
||||
Anope::string topic; /* Current topic of the channel */
|
||||
Anope::string topic_setter; /* Who set the topic */
|
||||
time_t topic_time; /* When the topic was set*/
|
||||
|
||||
std::list<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? */
|
||||
|
||||
/** Call if we need to unset all modes and clear all user status (internally).
|
||||
* Only useful if we get a SJOIN with a TS older than what we have here
|
||||
*/
|
||||
@@ -115,10 +94,20 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
|
||||
*/
|
||||
void Sync();
|
||||
|
||||
/** Check if a channels modes are correct.
|
||||
*/
|
||||
void CheckModes();
|
||||
|
||||
/** Check if this channel should be deleted
|
||||
*/
|
||||
bool CheckDelete();
|
||||
|
||||
/** Join a user internally to the channel
|
||||
* @param u The user
|
||||
* @param status The status to give the user, if any
|
||||
* @return The UserContainer for the user
|
||||
*/
|
||||
void JoinUser(User *u);
|
||||
ChanUserContainer* JoinUser(User *u, const ChannelStatus *status);
|
||||
|
||||
/** Remove a user internally from the channel
|
||||
* @param u The user
|
||||
@@ -129,138 +118,114 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
|
||||
* @param u The user
|
||||
* @return A user container if found, else NULL
|
||||
*/
|
||||
UserContainer *FindUser(User *u);
|
||||
ChanUserContainer *FindUser(User *u) const;
|
||||
|
||||
/** 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) const;
|
||||
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
|
||||
* @param name The mode name, eg CMODE_OP, CMODE_VOICE
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasUserStatus(User *u, ChannelModeName Name) const;
|
||||
|
||||
/** See if the channel has any modes at all
|
||||
* @return true or false
|
||||
*/
|
||||
inline bool HasModes() const { return modes.FlagCount(); }
|
||||
bool HasUserStatus(User *u, const Anope::string &name);
|
||||
|
||||
/** See if a channel has a mode
|
||||
* @param Name The mode name
|
||||
* @return true or false
|
||||
* @param name The mode name
|
||||
* @return The number of modes set
|
||||
* @param param The optional mode param
|
||||
*/
|
||||
bool HasMode(ChannelModeName Name) const;
|
||||
size_t HasMode(const Anope::string &name, const Anope::string ¶m = "");
|
||||
|
||||
/** Set a mode internally on a channel, this is not sent out to the IRCd
|
||||
* @param setter The setter
|
||||
* @param cm The mode
|
||||
* @param param The param
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetModeInternal(ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void SetModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/** Remove a mode internally on a channel, this is not sent out to the IRCd
|
||||
* @param setter The Setter
|
||||
* @param cm The mode
|
||||
* @param param The param
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveModeInternal(ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void RemoveModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = 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
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/**
|
||||
* Set a mode on a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param Name The mode name
|
||||
* @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
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void SetMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "", bool enforce_mlock = 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
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/**
|
||||
* Remove a mode from a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param Name The mode name
|
||||
* @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
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/** Clear all the modes from the channel
|
||||
* @param bi The client unsetting the modes
|
||||
* @param internal Only remove the modes internally
|
||||
/** Get a modes parameter for the channel
|
||||
* @param name The mode
|
||||
* @param target a string to put the param into
|
||||
* @return true if the parameter was fetched, false if on error (mode not set) etc.
|
||||
*/
|
||||
void ClearModes(BotInfo *bi = NULL, bool internal = false);
|
||||
|
||||
/** Clear all the bans from the channel
|
||||
* @param bi The client unsetting the modes
|
||||
* @param internal Only remove the modes internally
|
||||
*/
|
||||
void ClearBans(BotInfo *bi = NULL, bool internal = false);
|
||||
|
||||
/** Clear all the excepts from the channel
|
||||
* @param bi The client unsetting the modes
|
||||
* @param internal Only remove the modes internally
|
||||
*/
|
||||
void ClearExcepts(BotInfo *bi = NULL, bool internal = false);
|
||||
|
||||
/** Clear all the invites from the channel
|
||||
* @param bi The client unsetting the modes
|
||||
* @param internal Only remove the modes internally
|
||||
*/
|
||||
void ClearInvites(BotInfo *bi = NULL, bool internal = false);
|
||||
|
||||
/** Get a param from the channel
|
||||
* @param Name The mode
|
||||
* @param Target a string to put the param into
|
||||
* @return true on success
|
||||
*/
|
||||
bool GetParam(ChannelModeName Name, Anope::string &Target) const;
|
||||
|
||||
/** Check if a mode is set and has a param
|
||||
* @param Name The mode
|
||||
*/
|
||||
bool HasParam(ChannelModeName Name) const;
|
||||
bool GetParam(const Anope::string &name, Anope::string &target) const;
|
||||
|
||||
/** 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 enforce_mlock Should mlock be enforced on this mode change
|
||||
* @param cmodes The modes to set
|
||||
*/
|
||||
void SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...);
|
||||
void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...);
|
||||
|
||||
/** Set a string of modes internally on a channel
|
||||
* @param setter the setter (if it is a user)
|
||||
* @param source The setter
|
||||
* @param mode the modes
|
||||
* @param EnforceMLock true to enforce mlock
|
||||
* @param enforce_mlock true to enforce mlock
|
||||
*/
|
||||
void SetModesInternal(User *setter, const Anope::string &mode, bool EnforceMLock = true);
|
||||
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts = 0, bool enforce_mlock = true);
|
||||
|
||||
/** Does the given user match the given list? (CMODE_BAN, CMODE_EXCEPT, etc, a list mode)
|
||||
* @param u The user
|
||||
* @param list The mode of the list to check (eg CMODE_BAN)
|
||||
* @return true if the user matches the list
|
||||
*/
|
||||
bool MatchesList(User *u, const Anope::string &list);
|
||||
|
||||
/** 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 Anope::string &source, const Anope::string &nick, const Anope::string &reason);
|
||||
void KickInternal(const MessageSource &source, const Anope::string &nick, const Anope::string &reason);
|
||||
|
||||
/** Kick a user from the channel
|
||||
* @param bi The sender, can be NULL for the service bot for this channel
|
||||
@@ -270,6 +235,17 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
|
||||
*/
|
||||
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
|
||||
|
||||
/** Get all modes set on this channel, excluding status modes.
|
||||
* @return a map of modes and their optional parameters.
|
||||
*/
|
||||
const ModeList &GetModes() const;
|
||||
|
||||
/** Get a list of modes on a channel
|
||||
* @param name A mode name to get the list of
|
||||
* @return a pair of iterators for the beginning and end of the list
|
||||
*/
|
||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(const Anope::string &name);
|
||||
|
||||
/** Get a string of the modes set on this channel
|
||||
* @param complete Include mode parameters
|
||||
* @param plus If set to false (with complete), mode parameters will not be given for modes requring no parameters to be unset
|
||||
@@ -278,7 +254,7 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
|
||||
Anope::string GetModes(bool complete, bool plus);
|
||||
|
||||
/** Update the topic of the channel internally, and reset it if topiclock etc says to
|
||||
* @param user THe user setting the new topic
|
||||
* @param user The user setting the new topic
|
||||
* @param newtopic The new topic
|
||||
* @param ts The time the new topic is being set
|
||||
*/
|
||||
@@ -290,6 +266,39 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
|
||||
* @param ts The time when the new topic is being set
|
||||
*/
|
||||
void ChangeTopic(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
|
||||
|
||||
/** Set the correct modes, or remove the ones granted without permission,
|
||||
* for the specified user.
|
||||
* @param user The user to give/remove modes to/from
|
||||
* @param give_modes if true modes may be given to the user
|
||||
*/
|
||||
void SetCorrectModes(User *u, bool give_modes);
|
||||
|
||||
/** Unbans a user from this channel.
|
||||
* @param u The user to unban
|
||||
* @param full Whether or not to match using the user's real host and IP
|
||||
* @return whether or not a ban was removed
|
||||
*/
|
||||
bool Unban(User *u, bool full = false);
|
||||
|
||||
/** 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);
|
||||
|
||||
/** Finds a channel
|
||||
* @param name The channel to find
|
||||
* @return The channel, if found
|
||||
*/
|
||||
static Channel* Find(const Anope::string &name);
|
||||
|
||||
/** Finds or creates a channel
|
||||
* @param name The channel name
|
||||
* @param created Set to true if the channel was just created
|
||||
* @param ts The time the channel was created
|
||||
*/
|
||||
static Channel *FindOrCreate(const Anope::string &name, bool &created, time_t ts = Anope::CurTime);
|
||||
};
|
||||
|
||||
#endif // CHANNELS_H
|
||||
|
||||
+125
-62
@@ -1,9 +1,9 @@
|
||||
/* Declarations for command data.
|
||||
*
|
||||
* (C) 2003-2010 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
* 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.
|
||||
@@ -12,109 +12,172 @@
|
||||
#ifndef COMMAND_H
|
||||
#define COMMAND_H
|
||||
|
||||
#include "services.h"
|
||||
#include "service.h"
|
||||
#include "anope.h"
|
||||
#include "channels.h"
|
||||
|
||||
class Module;
|
||||
class BotInfo;
|
||||
class Command;
|
||||
|
||||
typedef std::map<Anope::string, Command *, std::less<ci::string> > CommandMap;
|
||||
|
||||
/** The return value from commands.
|
||||
*/
|
||||
enum CommandReturn
|
||||
struct CommandGroup
|
||||
{
|
||||
MOD_CONT,
|
||||
MOD_STOP
|
||||
Anope::string name, description;
|
||||
};
|
||||
|
||||
extern CoreExport Command *FindCommand(BotInfo *bi, const Anope::string &cmd);
|
||||
extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, const Anope::string &cmd);
|
||||
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &message);
|
||||
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, const Anope::string &message);
|
||||
|
||||
enum CommandFlag
|
||||
/* Used in BotInfo::commands */
|
||||
struct CommandInfo
|
||||
{
|
||||
CFLAG_ALLOW_UNREGISTERED,
|
||||
CFLAG_ALLOW_FORBIDDEN,
|
||||
CFLAG_ALLOW_SUSPENDED,
|
||||
CFLAG_ALLOW_UNREGISTEREDCHANNEL,
|
||||
CFLAG_STRIP_CHANNEL,
|
||||
CFLAG_DISABLE_FANTASY
|
||||
typedef Anope::map<CommandInfo> map;
|
||||
|
||||
CommandInfo() : hide(false), prepend_channel(false) { }
|
||||
|
||||
/* Service name of the command */
|
||||
Anope::string name;
|
||||
/* Permission required to execute the command */
|
||||
Anope::string permission;
|
||||
/* Group this command is in */
|
||||
Anope::string group;
|
||||
/* whether or not to hide this command in help output */
|
||||
bool hide;
|
||||
/* Only used with fantasy */
|
||||
bool prepend_channel;
|
||||
};
|
||||
|
||||
/* Where the replies from commands go to. User inheits from this and is the normal
|
||||
* source of a CommandReply
|
||||
*/
|
||||
struct CoreExport CommandReply
|
||||
{
|
||||
virtual ~CommandReply() { }
|
||||
virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
|
||||
};
|
||||
|
||||
/* The source for a command */
|
||||
class CoreExport CommandSource
|
||||
{
|
||||
/* The nick executing the command */
|
||||
Anope::string nick;
|
||||
/* User executing the command, may be NULL */
|
||||
Reference<User> u;
|
||||
public:
|
||||
/* The account executing the command */
|
||||
Reference<NickCore> nc;
|
||||
/* Where the reply should go */
|
||||
CommandReply *reply;
|
||||
/* Channel the command was executed on (fantasy) */
|
||||
Reference<Channel> c;
|
||||
/* The service this command is on */
|
||||
Reference<BotInfo> service;
|
||||
/* The actual name of the command being executed */
|
||||
Anope::string command;
|
||||
/* The permission of the command being executed */
|
||||
Anope::string permission;
|
||||
|
||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi);
|
||||
|
||||
const Anope::string &GetNick() const;
|
||||
User *GetUser();
|
||||
NickCore *GetAccount();
|
||||
AccessGroup AccessFor(ChannelInfo *ci);
|
||||
bool IsFounder(ChannelInfo *ci);
|
||||
|
||||
void Reply(const char *message, ...);
|
||||
void Reply(const Anope::string &message);
|
||||
|
||||
bool HasCommand(const Anope::string &cmd);
|
||||
bool HasPriv(const Anope::string &cmd);
|
||||
bool IsServicesOper();
|
||||
bool IsOper();
|
||||
};
|
||||
|
||||
/** Every services command is a class, inheriting from Command.
|
||||
*/
|
||||
class CoreExport Command : public Flags<CommandFlag>
|
||||
class CoreExport Command : public Service
|
||||
{
|
||||
Anope::string desc;
|
||||
std::vector<Anope::string> syntax;
|
||||
/* Allow unregistered users to use this command */
|
||||
bool allow_unregistered;
|
||||
/* Command requires that a user is executing it */
|
||||
bool require_user;
|
||||
|
||||
public:
|
||||
/* Maximum paramaters accepted by this command */
|
||||
size_t MaxParams;
|
||||
size_t max_params;
|
||||
/* Minimum parameters required to use this command */
|
||||
size_t MinParams;
|
||||
/* Command name */
|
||||
Anope::string name;
|
||||
/* Permission needed to use this comand */
|
||||
Anope::string permission;
|
||||
size_t min_params;
|
||||
|
||||
/* Module which owns us */
|
||||
Module *module;
|
||||
/* Service this command is on */
|
||||
BotInfo *service;
|
||||
|
||||
protected:
|
||||
/** Create a new command.
|
||||
* @param owner The owner of the command
|
||||
* @param sname The command name
|
||||
* @param min_params The minimum number of parameters the parser will require to execute this command
|
||||
* @param max_params The maximum number of parameters the parser will create, after max_params, all will be combined into the last argument.
|
||||
* NOTE: If max_params is not set (default), there is no limit to the max number of params.
|
||||
*/
|
||||
Command(const Anope::string &sname, size_t min_params, size_t max_params = 0, const Anope::string &spermission = "");
|
||||
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
|
||||
|
||||
public:
|
||||
virtual ~Command();
|
||||
|
||||
/** Execute this command.
|
||||
* @param u The user executing the command.
|
||||
protected:
|
||||
void SetDesc(const Anope::string &d);
|
||||
|
||||
void ClearSyntax();
|
||||
void SetSyntax(const Anope::string &s);
|
||||
void SendSyntax(CommandSource &);
|
||||
|
||||
void AllowUnregistered(bool b);
|
||||
void RequireUser(bool b);
|
||||
|
||||
public:
|
||||
bool AllowUnregistered() const;
|
||||
bool RequireUser() const;
|
||||
|
||||
/** Get the command description
|
||||
* @param source The source wanting the command description
|
||||
* @return The commands description
|
||||
*/
|
||||
virtual CommandReturn Execute(User *u, const std::vector<Anope::string> &);
|
||||
virtual const Anope::string GetDesc(CommandSource &source) const;
|
||||
|
||||
/** Execute this command.
|
||||
* @param source The source
|
||||
* @param params Command parameters
|
||||
*/
|
||||
virtual void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) = 0;
|
||||
|
||||
/** Called when HELP is requsted for the client this command is on.
|
||||
* @param u The user requesting help
|
||||
* @param source The source
|
||||
*/
|
||||
virtual void OnServHelp(User *u);
|
||||
virtual void OnServHelp(CommandSource &source);
|
||||
|
||||
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
|
||||
* @param u The user requesting help
|
||||
* @param source The source
|
||||
* @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of "FOO BAR LOL")
|
||||
* @return true if help was provided to the user, false otherwise.
|
||||
*/
|
||||
virtual bool OnHelp(User *u, const Anope::string &subcommand);
|
||||
virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand);
|
||||
|
||||
/** Requested when the user provides bad syntax to this command (not enough params, etc).
|
||||
* @param u The user executing the command.
|
||||
* @param source The source
|
||||
* @param subcommand The subcommand the user tried to use
|
||||
*/
|
||||
virtual void OnSyntaxError(User *u, const Anope::string &subcommand);
|
||||
virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand);
|
||||
|
||||
/** Set which command permission (e.g. chanserv/forbid) is required for this command.
|
||||
* @param reststr The permission required to successfully execute this command
|
||||
/** Runs a command
|
||||
* @param source The source of the command
|
||||
* @param message The full message to run, the command is at the beginning of the message
|
||||
*/
|
||||
void SetPermission(const Anope::string &reststr);
|
||||
static void Run(CommandSource &source, const Anope::string &message);
|
||||
|
||||
/** Add a subcommand to this command
|
||||
* @param c The command
|
||||
/** Looks up a command name from the service name.
|
||||
* Note that if the same command exists multiple places this will return the first one encountered
|
||||
* @param command_service The command service to lookup, eg, nickserv/register
|
||||
* @param bot If found, is set to the bot the command is on, eg NickServ
|
||||
* @param name If found, is set to the comand name, eg REGISTER
|
||||
* @return true if the given command service exists
|
||||
*/
|
||||
virtual bool AddSubcommand(Command *c);
|
||||
|
||||
/** Delete a subcommand from this command
|
||||
* @param c The command
|
||||
*/
|
||||
virtual bool DelSubcommand(Command *c);
|
||||
|
||||
/** Find a subcommand
|
||||
* @param name The subcommand name
|
||||
* @return The subcommand
|
||||
*/
|
||||
virtual Command *FindSubcommand(const Anope::string &subcommand);
|
||||
static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name);
|
||||
};
|
||||
|
||||
#endif // COMMANDS_H
|
||||
|
||||
+141
-914
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class AccessGroup;
|
||||
class AutoKick;
|
||||
class BotInfo;
|
||||
class CallBack;
|
||||
class ChanAccess;
|
||||
class Channel;
|
||||
class ChannelInfo;
|
||||
class ChannelStatus;
|
||||
struct ChanUserContainer;
|
||||
class ClientSocket;
|
||||
class Command;
|
||||
class CommandSource;
|
||||
namespace Configuration { struct Conf; }
|
||||
class ConnectionSocket;
|
||||
namespace DNS { struct Query; }
|
||||
class Entry;
|
||||
class IdentifyRequest;
|
||||
class InfoFormatter;
|
||||
class IRCDProto;
|
||||
class ListenSocket;
|
||||
class Log;
|
||||
class Memo;
|
||||
class MessageSource;
|
||||
class Module;
|
||||
class NickAlias;
|
||||
class NickCore;
|
||||
class OperType;
|
||||
class ReferenceBase;
|
||||
class Regex;
|
||||
class Serializable;
|
||||
class Server;
|
||||
class Socket;
|
||||
class Thread;
|
||||
class User;
|
||||
class XLine;
|
||||
class XLineManager;
|
||||
struct BadWord;
|
||||
struct Exception;
|
||||
struct MemoInfo;
|
||||
struct ModeLock;
|
||||
struct Oper;
|
||||
|
||||
-197
@@ -1,197 +0,0 @@
|
||||
#ifndef DNS_H
|
||||
#define DNS_H
|
||||
|
||||
/** Valid query types
|
||||
*/
|
||||
enum QueryType
|
||||
{
|
||||
/* Nothing */
|
||||
DNS_QUERY_NONE,
|
||||
/* A simple A lookup */
|
||||
DNS_QUERY_A = 1,
|
||||
/* A CNAME lookup */
|
||||
DNS_QUERY_CNAME = 5,
|
||||
/* Reverse DNS lookup */
|
||||
DNS_QUERY_PTR = 12,
|
||||
/* IPv6 AAAA lookup */
|
||||
DNS_QUERY_AAAA = 28
|
||||
};
|
||||
|
||||
/** Flags that can be AND'd into DNSPacket::flags to receive certain values
|
||||
*/
|
||||
enum QueryFlags
|
||||
{
|
||||
DNS_QUERYFLAGS_QR = 0x8000,
|
||||
DNS_QUERYFLAGS_OPCODE = 0x7800,
|
||||
DNS_QUERYFLAGS_AA = 0x400,
|
||||
DBS_QUERYFLAGS_TC = 0x200,
|
||||
DNS_QUERYFLAGS_RD = 0x100,
|
||||
DNS_QUERYFLAGS_RA = 0x80,
|
||||
DNS_QUERYFLAGS_Z = 0x70,
|
||||
DNS_QUERYFLAGS_RCODE = 0xF
|
||||
};
|
||||
|
||||
enum DNSError
|
||||
{
|
||||
DNS_ERROR_NONE,
|
||||
DNS_ERROR_UNKNOWN,
|
||||
DNS_ERROR_UNLOADED,
|
||||
DNS_ERROR_TIMEOUT,
|
||||
DNS_ERROR_NOT_AN_ANSWER,
|
||||
DNS_ERROR_NONSTANDARD_QUERY,
|
||||
DNS_ERROR_FORMAT_ERROR,
|
||||
DNS_ERROR_SERVER_FAILURE,
|
||||
DNS_ERROR_DOMAIN_NOT_FOUND,
|
||||
DNS_ERROR_NOT_IMPLEMENTED,
|
||||
DNS_ERROR_REFUSED,
|
||||
DNS_ERROR_NO_RECORDS,
|
||||
DNS_ERROR_INVALIDTYPE
|
||||
};
|
||||
|
||||
class DNSRequestTimeout; // Forward declarations
|
||||
struct DNSRecord;
|
||||
class Module;
|
||||
|
||||
/** The request
|
||||
*/
|
||||
class CoreExport DNSRequest
|
||||
{
|
||||
/* Timeout timer for this request */
|
||||
DNSRequestTimeout *timeout;
|
||||
/* Use result cache if available */
|
||||
bool use_cache;
|
||||
|
||||
public:
|
||||
/* Request id */
|
||||
unsigned short id;
|
||||
/* Creator of this request */
|
||||
Module *creator;
|
||||
|
||||
/* Address we're looking up */
|
||||
Anope::string address;
|
||||
/* QueryType, A, AAAA, PTR etc */
|
||||
QueryType QT;
|
||||
|
||||
DNSRequest(const Anope::string &addr, QueryType qt, bool cache = false, Module *c = NULL);
|
||||
|
||||
virtual ~DNSRequest();
|
||||
|
||||
void Process();
|
||||
|
||||
virtual void OnLookupComplete(const DNSRecord *r) = 0;
|
||||
|
||||
virtual void OnError(const DNSRecord *r);
|
||||
};
|
||||
|
||||
/** A full packet sent to the nameserver, may contain multiple queries
|
||||
*/
|
||||
struct DNSPacket
|
||||
{
|
||||
/* Our 16-bit id for this header */
|
||||
unsigned short id;
|
||||
/* Flags on the query */
|
||||
unsigned short flags;
|
||||
/* Number of queries */
|
||||
unsigned short qdcount;
|
||||
/* Number of resource records in answer */
|
||||
unsigned short ancount;
|
||||
/* Number of NS resource records in authority records section */
|
||||
unsigned short nscount;
|
||||
/* Number of resource records in the additional records section */
|
||||
unsigned short arcount;
|
||||
/* How many of the bytes of the payload are in use */
|
||||
unsigned short payload_count;
|
||||
/* The queries, at most can be 512 bytes */
|
||||
unsigned char payload[512];
|
||||
|
||||
inline DNSPacket();
|
||||
|
||||
bool AddQuestion(const Anope::string &address, QueryType qt);
|
||||
|
||||
inline void FillPacket(const unsigned char *input, const size_t length);
|
||||
|
||||
inline void FillBuffer(unsigned char *buffer);
|
||||
};
|
||||
|
||||
struct DNSRecord
|
||||
{
|
||||
/* Name of the initial lookup */
|
||||
Anope::string name;
|
||||
/* Result of the lookup */
|
||||
Anope::string result;
|
||||
/* Type of query this was */
|
||||
QueryType type;
|
||||
/* Error, if there was one */
|
||||
DNSError error;
|
||||
/* Record class, should always be 1 */
|
||||
unsigned short record_class;
|
||||
/* Time to live */
|
||||
time_t ttl;
|
||||
/* Record length */
|
||||
unsigned short rdlength;
|
||||
|
||||
inline DNSRecord(const Anope::string &n);
|
||||
/* When this record was created in our cache */
|
||||
time_t created;
|
||||
};
|
||||
|
||||
/** The socket used to talk to the nameserver, uses UDP
|
||||
*/
|
||||
class DNSSocket : public ConnectionSocket
|
||||
{
|
||||
private:
|
||||
int SendTo(const unsigned char *buf, size_t len) const;
|
||||
int RecvFrom(char *buf, size_t size, sockaddrs &addrs) const;
|
||||
|
||||
public:
|
||||
DNSSocket();
|
||||
virtual ~DNSSocket();
|
||||
|
||||
bool ProcessRead();
|
||||
|
||||
bool ProcessWrite();
|
||||
};
|
||||
|
||||
/** DNS manager, manages the connection and all requests
|
||||
*/
|
||||
class DNSManager : public Timer
|
||||
{
|
||||
std::multimap<Anope::string, DNSRecord *> cache;
|
||||
public:
|
||||
DNSSocket *sock;
|
||||
|
||||
std::deque<DNSPacket *> packets;
|
||||
std::map<short, DNSRequest *> requests;
|
||||
|
||||
static const int DNSPort = 53;
|
||||
|
||||
DNSManager();
|
||||
|
||||
~DNSManager();
|
||||
|
||||
void AddCache(DNSRecord *rr);
|
||||
bool CheckCache(DNSRequest *request);
|
||||
void Tick(time_t now);
|
||||
|
||||
void Cleanup(Module *mod);
|
||||
};
|
||||
|
||||
/** A DNS timeout, one is made for every DNS request to detect timeouts
|
||||
*/
|
||||
class DNSRequestTimeout : public Timer
|
||||
{
|
||||
DNSRequest *request;
|
||||
public:
|
||||
bool done;
|
||||
|
||||
DNSRequestTimeout(DNSRequest *r, time_t timeout);
|
||||
|
||||
~DNSRequestTimeout();
|
||||
|
||||
void Tick(time_t);
|
||||
};
|
||||
|
||||
extern DNSManager *DNSEngine;
|
||||
|
||||
#endif // DNS_H
|
||||
|
||||
+220
-185
@@ -1,223 +1,258 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
|
||||
*
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EXTENSIBLE_H
|
||||
#define EXTENSIBLE_H
|
||||
|
||||
#include "hashcomp.h"
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
#include "service.h"
|
||||
#include "logger.h"
|
||||
|
||||
/** Dummy base class we use to cast everything to/from
|
||||
*/
|
||||
class ExtensibleItemBase
|
||||
{
|
||||
public:
|
||||
ExtensibleItemBase() { }
|
||||
virtual ~ExtensibleItemBase() { }
|
||||
};
|
||||
class Extensible;
|
||||
|
||||
/** Class used to represent an extensible item that doesn't hold a pointer
|
||||
*/
|
||||
template<typename T> class ExtensibleItemRegular : public ExtensibleItemBase
|
||||
class CoreExport ExtensibleBase : public Service
|
||||
{
|
||||
protected:
|
||||
T Item;
|
||||
std::map<Extensible *, void *> items;
|
||||
|
||||
ExtensibleBase(Module *m, const Anope::string &n);
|
||||
~ExtensibleBase();
|
||||
|
||||
public:
|
||||
ExtensibleItemRegular(T item) : Item(item) { }
|
||||
virtual ~ExtensibleItemRegular() { }
|
||||
T GetItem() const { return Item; }
|
||||
virtual void Unset(Extensible *obj) = 0;
|
||||
|
||||
/* called when an object we are keep track of is serializing */
|
||||
virtual void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &) const { }
|
||||
virtual void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &) { }
|
||||
};
|
||||
|
||||
/** Class used to represent an extensible item that holds a pointer
|
||||
*/
|
||||
template<typename T> class ExtensibleItemPointer : public ExtensibleItemBase
|
||||
class CoreExport Extensible
|
||||
{
|
||||
public:
|
||||
std::set<ExtensibleBase *> extension_items;
|
||||
|
||||
virtual ~Extensible();
|
||||
|
||||
template<typename T> T* GetExt(const Anope::string &name) const;
|
||||
bool HasExt(const Anope::string &name) const;
|
||||
|
||||
template<typename T> T* Extend(const Anope::string &name, const T &what);
|
||||
template<typename T> T* Extend(const Anope::string &name);
|
||||
template<typename T> T* Require(const Anope::string &name);
|
||||
template<typename T> void Shrink(const Anope::string &name);
|
||||
|
||||
static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
|
||||
static void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &data);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class BaseExtensibleItem : public ExtensibleBase
|
||||
{
|
||||
protected:
|
||||
T *Item;
|
||||
virtual T *Create(Extensible *) = 0;
|
||||
|
||||
public:
|
||||
ExtensibleItemPointer(T *item) : Item(item) { }
|
||||
virtual ~ExtensibleItemPointer() { delete Item; }
|
||||
T *GetItem() const { return Item; }
|
||||
BaseExtensibleItem(Module *m, const Anope::string &n) : ExtensibleBase(m, n) { }
|
||||
|
||||
~BaseExtensibleItem()
|
||||
{
|
||||
while (!items.empty())
|
||||
{
|
||||
std::map<Extensible *, void *>::iterator it = items.begin();
|
||||
Extensible *obj = it->first;
|
||||
T *value = static_cast<T *>(it->second);
|
||||
|
||||
obj->extension_items.erase(this);
|
||||
items.erase(it);
|
||||
delete value;
|
||||
}
|
||||
}
|
||||
|
||||
T* Set(Extensible *obj, const T &value)
|
||||
{
|
||||
T* t = Set(obj);
|
||||
if (t)
|
||||
*t = value;
|
||||
return t;
|
||||
}
|
||||
|
||||
T* Set(Extensible *obj)
|
||||
{
|
||||
T* t = Create(obj);
|
||||
Unset(obj);
|
||||
items[obj] = t;
|
||||
obj->extension_items.insert(this);
|
||||
return t;
|
||||
}
|
||||
|
||||
void Unset(Extensible *obj) anope_override
|
||||
{
|
||||
T *value = Get(obj);
|
||||
items.erase(obj);
|
||||
obj->extension_items.erase(this);
|
||||
delete value;
|
||||
}
|
||||
|
||||
T* Get(const Extensible *obj) const
|
||||
{
|
||||
std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
|
||||
if (it != items.end())
|
||||
return static_cast<T *>(it->second);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool HasExt(const Extensible *obj) const
|
||||
{
|
||||
return items.find(const_cast<Extensible *>(obj)) != items.end();
|
||||
}
|
||||
|
||||
T* Require(Extensible *obj)
|
||||
{
|
||||
T* t = Get(obj);
|
||||
if (t)
|
||||
return t;
|
||||
|
||||
return Set(obj);
|
||||
}
|
||||
};
|
||||
|
||||
/** Class used to represent an extensible item that holds a pointer to an arrray
|
||||
*/
|
||||
template<typename T> class ExtensibleItemPointerArray : public ExtensibleItemBase
|
||||
template<typename T>
|
||||
class ExtensibleItem : public BaseExtensibleItem<T>
|
||||
{
|
||||
protected:
|
||||
T *Item;
|
||||
|
||||
T* Create(Extensible *obj) anope_override
|
||||
{
|
||||
return new T(obj);
|
||||
}
|
||||
public:
|
||||
ExtensibleItemPointerArray(T *item) : Item(item) { }
|
||||
virtual ~ExtensibleItemPointerArray() { delete [] Item; }
|
||||
T *GetItem() const { return Item; }
|
||||
ExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
|
||||
};
|
||||
|
||||
class CoreExport Extensible : public Base
|
||||
template<typename T>
|
||||
class PrimitiveExtensibleItem : public BaseExtensibleItem<T>
|
||||
{
|
||||
private:
|
||||
typedef std::map<Anope::string, ExtensibleItemBase *> extensible_map;
|
||||
extensible_map Extension_Items;
|
||||
|
||||
protected:
|
||||
T* Create(Extensible *obj) anope_override
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
public:
|
||||
/** Default constructor, does nothing
|
||||
*/
|
||||
Extensible() { }
|
||||
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
|
||||
};
|
||||
|
||||
/** Default destructor, deletes all of the extensible items in this object
|
||||
* then clears the map
|
||||
*/
|
||||
virtual ~Extensible()
|
||||
template<>
|
||||
class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool>
|
||||
{
|
||||
protected:
|
||||
bool* Create(Extensible *) anope_override
|
||||
{
|
||||
for (extensible_map::iterator it = Extension_Items.begin(), it_end = Extension_Items.end(); it != it_end; ++it)
|
||||
delete it->second;
|
||||
Extension_Items.clear();
|
||||
return NULL;
|
||||
}
|
||||
public:
|
||||
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<bool>(m, n) { }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
|
||||
{
|
||||
public:
|
||||
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<T>(m, n) { }
|
||||
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
|
||||
{
|
||||
T* t = this->Get(e);
|
||||
data[this->name] << *t;
|
||||
}
|
||||
|
||||
/** 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
|
||||
*/
|
||||
void Extend(const Anope::string &key, ExtensibleItemBase *p)
|
||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
|
||||
{
|
||||
this->Shrink(key);
|
||||
this->Extension_Items.insert(std::make_pair(key, p));
|
||||
}
|
||||
|
||||
/** 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
|
||||
*/
|
||||
void Extend(const Anope::string &key)
|
||||
{
|
||||
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 Anope::string &key)
|
||||
{
|
||||
extensible_map::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 Anope::string &key, T &p)
|
||||
{
|
||||
extensible_map::iterator it = this->Extension_Items.find(key);
|
||||
|
||||
if (it != this->Extension_Items.end())
|
||||
{
|
||||
p = debug_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 Anope::string &key, T *&p)
|
||||
{
|
||||
extensible_map::iterator it = this->Extension_Items.find(key);
|
||||
|
||||
if (it != this->Extension_Items.end())
|
||||
{
|
||||
p = debug_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 Anope::string &key, T *&p)
|
||||
{
|
||||
extensible_map::iterator it = this->Extension_Items.find(key);
|
||||
|
||||
if (it != this->Extension_Items.end())
|
||||
{
|
||||
p = debug_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 Anope::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<Anope::string> &list)
|
||||
{
|
||||
for (extensible_map::iterator it = Extension_Items.begin(), it_end = Extension_Items.end(); it != it_end; ++it)
|
||||
list.push_back(it->first);
|
||||
T t;
|
||||
if (data[this->name] >> t)
|
||||
this->Set(e, t);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool>
|
||||
{
|
||||
public:
|
||||
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<bool>(m, n) { }
|
||||
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
|
||||
{
|
||||
data[this->name] << true;
|
||||
}
|
||||
|
||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
|
||||
{
|
||||
bool b = false;
|
||||
data[this->name] >> b;
|
||||
if (b)
|
||||
this->Set(e);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct ExtensibleRef : ServiceReference<BaseExtensibleItem<T> >
|
||||
{
|
||||
ExtensibleRef(const Anope::string &n) : ServiceReference<BaseExtensibleItem<T> >("Extensible", n) { }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::GetExt(const Anope::string &name) const
|
||||
{
|
||||
ExtensibleRef<T> ref(name);
|
||||
if (ref)
|
||||
return ref->Get(this);
|
||||
|
||||
Log(LOG_DEBUG) << "GetExt for nonexistent type " << name << " on " << static_cast<const void *>(this);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Extend(const Anope::string &name, const T &what)
|
||||
{
|
||||
T* t = Extend<T>(name);
|
||||
if (t)
|
||||
*t = what;
|
||||
return t;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Extend(const Anope::string &name)
|
||||
{
|
||||
ExtensibleRef<T> ref(name);
|
||||
if (ref)
|
||||
return ref->Set(this);
|
||||
|
||||
Log(LOG_DEBUG) << "Extend for nonexistent type " << name << " on " << static_cast<void *>(this);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Require(const Anope::string &name)
|
||||
{
|
||||
if (HasExt(name))
|
||||
return GetExt<T>(name);
|
||||
else
|
||||
return Extend<T>(name);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Extensible::Shrink(const Anope::string &name)
|
||||
{
|
||||
ExtensibleRef<T> ref(name);
|
||||
if (ref)
|
||||
ref->Unset(this);
|
||||
else
|
||||
Log(LOG_DEBUG) << "Shrink for nonexistent type " << name << " on " << static_cast<void *>(this);
|
||||
}
|
||||
|
||||
#endif // EXTENSIBLE_H
|
||||
|
||||
@@ -1,379 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef EXTERN_H
|
||||
#define EXTERN_H
|
||||
|
||||
#define E extern CoreExport
|
||||
#define EI extern DllExport
|
||||
|
||||
#include "hashcomp.h"
|
||||
|
||||
E void ModuleRunTimeDirCleanUp();
|
||||
|
||||
/* IRC Variables */
|
||||
|
||||
E IRCDVar *ircd;
|
||||
E IRCDProto *ircdproto;
|
||||
|
||||
/**** actions.c ****/
|
||||
|
||||
E void kill_user(const Anope::string &source, const Anope::string &user, const Anope::string &reason);
|
||||
E bool bad_password(User *u);
|
||||
E void common_unban(ChannelInfo *ci, const Anope::string &nick);
|
||||
|
||||
E BotInfo *BotServ;
|
||||
E BotInfo *ChanServ;
|
||||
E BotInfo *Global;
|
||||
E BotInfo *HostServ;
|
||||
E BotInfo *MemoServ;
|
||||
E BotInfo *NickServ;
|
||||
E BotInfo *OperServ;
|
||||
|
||||
/**** botserv.c ****/
|
||||
|
||||
E void get_botserv_stats(long *nrec, long *memuse);
|
||||
E void bs_init();
|
||||
E void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf);
|
||||
E BotInfo *findbot(const Anope::string &nick);
|
||||
|
||||
/** Finds a pseudoclient, given a UID. Useful for TS6 protocol modules.
|
||||
* @param uid The UID to search for
|
||||
* @return The pseudoclient structure, or NULL if one could not be found
|
||||
*/
|
||||
E Anope::string normalizeBuffer(const Anope::string &);
|
||||
|
||||
E void bot_raw_ban(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
|
||||
E void bot_raw_kick(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
|
||||
E void bot_raw_mode(User *requester, ChannelInfo *ci, const Anope::string &mode, const Anope::string &nick);
|
||||
|
||||
/**** channels.c ****/
|
||||
|
||||
E void get_channel_stats(long *nrec, long *memuse);
|
||||
|
||||
E Channel *findchan(const Anope::string &chan);
|
||||
|
||||
E User *nc_on_chan(Channel *c, const NickCore *nc);
|
||||
|
||||
E int get_access_level(ChannelInfo *ci, NickAlias *na);
|
||||
E int get_access_level(ChannelInfo *ci, NickCore *nc);
|
||||
E Anope::string get_xop_level(int level);
|
||||
|
||||
E void do_cmode(const Anope::string &source, const Anope::string &channel, const Anope::string &modes, const Anope::string &ts);
|
||||
E void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts);
|
||||
E void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason);
|
||||
E void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason);
|
||||
E void MassChannelModes(BotInfo *bi, const Anope::string &modes);
|
||||
|
||||
E void chan_set_correct_modes(User *user, Channel *c, int give_modes);
|
||||
|
||||
E Entry *entry_create(const Anope::string &mask);
|
||||
E Entry *entry_add(EList *list, const Anope::string &mask);
|
||||
E void entry_delete(EList *list, Entry *e);
|
||||
E EList *list_create();
|
||||
E int entry_match(Entry *e, const Anope::string &nick, const Anope::string &user, const Anope::string &host, uint32 ip);
|
||||
E int entry_match_mask(Entry *e, const Anope::string &mask, uint32 ip);
|
||||
E Entry *elist_match(EList *list, const Anope::string &nick, const Anope::string &user, const Anope::string &host, uint32 ip);
|
||||
E Entry *elist_match_mask(EList *list, const Anope::string &mask, uint32 ip);
|
||||
E Entry *elist_match_user(EList *list, User *u);
|
||||
E Entry *elist_find_mask(EList *list, const Anope::string &mask);
|
||||
E long get_memuse(EList *list);
|
||||
|
||||
inline BotInfo *whosends(ChannelInfo *ci)
|
||||
{
|
||||
if (!ci || !ci->bi || !ci->c || !ci->botflags.HasFlag(BS_SYMBIOSIS) || !ci->c->FindUser(ci->bi))
|
||||
return ChanServ ? ChanServ : NickServ;
|
||||
return ci->bi;
|
||||
}
|
||||
|
||||
/**** chanserv.c ****/
|
||||
|
||||
E LevelInfo levelinfo[];
|
||||
|
||||
E void get_chanserv_stats(long *nrec, long *memuse);
|
||||
|
||||
E void reset_levels(ChannelInfo *ci);
|
||||
E void cs_init();
|
||||
E void expire_chans();
|
||||
E void cs_remove_nick(const NickCore *nc);
|
||||
|
||||
E void check_modes(Channel *c);
|
||||
E int check_valid_admin(User *user, Channel *chan, int servermode);
|
||||
E int check_valid_op(User *user, Channel *chan, int servermode);
|
||||
|
||||
E ChannelInfo *cs_findchan(const Anope::string &chan);
|
||||
E int check_access(User *user, ChannelInfo *ci, int what);
|
||||
E bool IsFounder(User *user, ChannelInfo *ci);
|
||||
E int get_access(User *user, ChannelInfo *ci);
|
||||
E void update_cs_lastseen(User *user, ChannelInfo *ci);
|
||||
E int get_idealban(ChannelInfo *ci, User *u, Anope::string &ret);
|
||||
E AutoKick *is_stuck(ChannelInfo *ci, const Anope::string &mask);
|
||||
E void stick_mask(ChannelInfo *ci, AutoKick *akick);
|
||||
E void stick_all(ChannelInfo *ci);
|
||||
|
||||
E int levelinfo_maxwidth;
|
||||
E Anope::string get_mlock_modes(ChannelInfo *ci, int complete);
|
||||
|
||||
/**** config.c ****/
|
||||
|
||||
E Anope::string services_conf;
|
||||
E ServerConfig *Config;
|
||||
|
||||
/* hostserv.c */
|
||||
E void do_on_id(User *u);
|
||||
E void HostServSyncVhosts(NickAlias *na);
|
||||
|
||||
/**** encrypt.c ****/
|
||||
E int enc_encrypt(const Anope::string &src, Anope::string &dest);
|
||||
E int enc_decrypt(const Anope::string &src, Anope::string &dest);
|
||||
E int enc_check_password(Anope::string &plaintext, Anope::string &password);
|
||||
|
||||
/**** hostserv.c ****/
|
||||
E void get_hostserv_stats(long *nrec, long *memuse);
|
||||
E void hostserv_init();
|
||||
|
||||
/**** init.c ****/
|
||||
|
||||
E void introduce_user(const Anope::string &user);
|
||||
E bool GetCommandLineArgument(const Anope::string &name, char shortname = 0);
|
||||
E bool GetCommandLineArgument(const Anope::string &name, char shortname, Anope::string ¶m);
|
||||
E void Init(int ac, char **av);
|
||||
E Uplink *uplink_server;
|
||||
|
||||
/**** ircd.c ****/
|
||||
E void pmodule_ircd_proto(IRCDProto *);
|
||||
E void pmodule_ircd_var(IRCDVar *ircdvar);
|
||||
|
||||
/**** language.cpp ****/
|
||||
E std::vector<Anope::string> languages;
|
||||
E void InitLanguages();
|
||||
E const Anope::string GetString(const Anope::string &language, LanguageString string);
|
||||
E const Anope::string GetString(LanguageString string);
|
||||
E const Anope::string GetString(const NickCore *nc, LanguageString string);
|
||||
E const Anope::string GetString(const User *u, LanguageString string);
|
||||
E const Anope::string GetString(const char *domain, Anope::string language, const Anope::string &string);
|
||||
E Anope::string language_strings[LANG_STRING_COUNT];
|
||||
E void SyntaxError(BotInfo *bi, User *u, const Anope::string &command, LanguageString message);
|
||||
|
||||
/*** logger.cpp ***/
|
||||
E void InitLogChannels(ServerConfig *);
|
||||
|
||||
/**** main.c ****/
|
||||
|
||||
E Anope::string services_dir;
|
||||
E Anope::string services_bin;
|
||||
E int debug;
|
||||
E bool readonly;
|
||||
E bool nofork;
|
||||
E bool nothird;
|
||||
E bool noexpire;
|
||||
E bool protocoldebug;
|
||||
|
||||
E bool quitting;
|
||||
E bool shutting_down;
|
||||
E Anope::string quitmsg;
|
||||
E bool save_data;
|
||||
E time_t start_time;
|
||||
|
||||
E ConnectionSocket *UplinkSock;
|
||||
|
||||
E void save_databases();
|
||||
E void expire_all();
|
||||
E void sighandler(int signum);
|
||||
E void do_restart_services();
|
||||
|
||||
/* The socket to our uplink */
|
||||
class CoreExport UplinkSocket : public ConnectionSocket
|
||||
{
|
||||
public:
|
||||
UplinkSocket(bool ipv6 = false);
|
||||
|
||||
virtual ~UplinkSocket();
|
||||
|
||||
bool Read(const Anope::string &buf);
|
||||
};
|
||||
|
||||
/**** memoserv.c ****/
|
||||
|
||||
E void ms_init();
|
||||
E void rsend_notify(User *u, Memo *m, const Anope::string &chan);
|
||||
E void check_memos(User *u);
|
||||
E MemoInfo *getmemoinfo(const Anope::string &name, bool &ischan, bool &isforbid);
|
||||
E void memo_send(User *u, const Anope::string &name, const Anope::string &text, int z);
|
||||
|
||||
/**** messages.c ****/
|
||||
|
||||
E int m_nickcoll(const Anope::string &user);
|
||||
E int m_away(const Anope::string &source, const Anope::string &msg);
|
||||
E int m_kill(const Anope::string &nick, const Anope::string &msg);
|
||||
E int m_motd(const Anope::string &source);
|
||||
E int m_privmsg(const Anope::string &source, const Anope::string &receiver, const Anope::string &message);
|
||||
E bool m_stats(const Anope::string &source, const std::vector<Anope::string> &);
|
||||
E int m_whois(const Anope::string &source, const Anope::string &who);
|
||||
E bool m_time(const Anope::string &source, const std::vector<Anope::string> &);
|
||||
E bool m_version(const Anope::string &source, const std::vector<Anope::string> &);
|
||||
E void init_core_messages();
|
||||
|
||||
/**** misc.c ****/
|
||||
|
||||
E bool IsFile(const Anope::string &filename);
|
||||
E int toupper(char);
|
||||
E int tolower(char);
|
||||
E char *strscpy(char *d, const char *s, size_t len);
|
||||
#ifndef HAVE_STRLCPY
|
||||
E size_t strlcpy(char *, const char *, size_t);
|
||||
#endif
|
||||
#ifndef HAVE_STRLCAT
|
||||
E size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
E char *strnrepl(char *s, int32 size, const char *old, const char *nstr);
|
||||
E const char *merge_args(int argc, char **argv);
|
||||
E const char *merge_args(int argc, const char **argv);
|
||||
|
||||
E time_t dotime(const Anope::string &s);
|
||||
E Anope::string duration(const NickCore *nc, time_t seconds);
|
||||
E Anope::string expire_left(const NickCore *nc, time_t expires);
|
||||
E Anope::string do_strftime(const time_t &t);
|
||||
E bool doValidHost(const Anope::string &host, int type);
|
||||
|
||||
E bool isValidHost(const Anope::string &host, int type);
|
||||
E bool isvalidchar(char c);
|
||||
|
||||
E Anope::string myStrGetToken(const Anope::string &str, char dilim, int token_number);
|
||||
E Anope::string myStrGetTokenRemainder(const Anope::string &str, char dilim, int token_number);
|
||||
E int myNumToken(const Anope::string &str, char dilim);
|
||||
E void EnforceQlinedNick(const Anope::string &nick, const Anope::string &killer);
|
||||
E bool nickIsServices(const Anope::string &nick, bool bot);
|
||||
|
||||
E void add_entropy_userkeys();
|
||||
E void rand_init();
|
||||
E unsigned char getrandom8();
|
||||
E uint16 getrandom16();
|
||||
E uint32 getrandom32();
|
||||
|
||||
E char *str_signed(unsigned char *str);
|
||||
|
||||
E std::list<Anope::string> BuildStringList(const Anope::string &, char = ' ');
|
||||
E std::vector<Anope::string> BuildStringVector(const Anope::string &, char = ' ');
|
||||
|
||||
E uint32 cidr_to_netmask(uint16 cidr);
|
||||
E uint16 netmask_to_cidr(uint32 mask);
|
||||
|
||||
E bool str_is_wildcard(const Anope::string &str);
|
||||
E bool str_is_pure_wildcard(const Anope::string &str);
|
||||
|
||||
E bool str_is_cidr(const Anope::string &str, uint32 &ip, uint32 &mask, Anope::string &host);
|
||||
|
||||
/**** modes.cpp ****/
|
||||
/* Number of generic modes we support */
|
||||
E unsigned GenericChannelModes, GenericUserModes;
|
||||
E Flags<ChannelModeName, CMODE_END * 2> DefMLockOn;
|
||||
E Flags<ChannelModeName, CMODE_END * 2> DefMLockOff;
|
||||
E std::map<ChannelModeName, Anope::string> DefMLockParams;
|
||||
E void SetDefaultMLock(ServerConfig *config);
|
||||
|
||||
/**** nickserv.c ****/
|
||||
|
||||
E NickRequest *findrequestnick(const Anope::string &nick);
|
||||
E void get_aliases_stats(long &count, long &mem);
|
||||
E void get_core_stats(long &count, long &mem);
|
||||
E void change_core_display(NickCore *nc);
|
||||
E void change_core_display(NickCore *nc, const Anope::string &newdisplay);
|
||||
E int do_setmodes(User *u);
|
||||
|
||||
E void ns_init();
|
||||
E int validate_user(User *u);
|
||||
E void expire_nicks();
|
||||
E void expire_requests();
|
||||
E NickAlias *findnick(const Anope::string &nick);
|
||||
E NickCore *findcore(const Anope::string &nick);
|
||||
E bool is_on_access(const User *u, const NickCore *nc);
|
||||
|
||||
/**** process.c ****/
|
||||
|
||||
E int allow_ignore;
|
||||
E std::list<IgnoreData *> ignore;
|
||||
|
||||
E void add_ignore(const Anope::string &nick, time_t delta);
|
||||
E IgnoreData *get_ignore(const Anope::string &nick);
|
||||
E int delete_ignore(const Anope::string &nick);
|
||||
E int clear_ignores();
|
||||
|
||||
E void process(const Anope::string &buf);
|
||||
|
||||
/**** send.c ****/
|
||||
|
||||
E void send_cmd(const Anope::string &source, const char *fmt, ...) FORMAT(printf, 2, 3);
|
||||
|
||||
E void notice_server(const Anope::string &source, const Server *s, const char *fmt, ...) FORMAT(printf, 3, 4);
|
||||
|
||||
/**** sessions.c ****/
|
||||
|
||||
E std::vector<Exception *> exceptions;
|
||||
|
||||
E void get_session_stats(long &count, long &mem);
|
||||
E void get_exception_stats(long &count, long &mem);
|
||||
|
||||
E void add_session(const Anope::string &nick, const Anope::string &host, const Anope::string &hostip);
|
||||
E void del_session(const Anope::string &host);
|
||||
|
||||
E void expire_exceptions();
|
||||
|
||||
E Session *findsession(const Anope::string &host);
|
||||
|
||||
E Exception *find_host_exception(const Anope::string &host);
|
||||
E Exception *find_hostip_exception(const Anope::string &host, const Anope::string &hostip);
|
||||
E int exception_add(User *u, const Anope::string &mask, unsigned limit, const Anope::string &reason, const Anope::string &who, time_t expires);
|
||||
|
||||
/**** sockets.cpp ****/
|
||||
|
||||
E SocketEngineBase *SocketEngine;
|
||||
E int32 TotalRead;
|
||||
E int32 TotalWritten;
|
||||
E SocketIO normalSocketIO;
|
||||
|
||||
/**** users.c ****/
|
||||
|
||||
E int32 opcnt;
|
||||
E uint32 maxusercnt, usercnt;
|
||||
E time_t maxusertime;
|
||||
|
||||
E void get_user_stats(long &count, long &mem);
|
||||
|
||||
E User *finduser(const Anope::string &nick);
|
||||
|
||||
E Anope::string TS6SID;
|
||||
|
||||
E User *do_nick(const Anope::string &source, const Anope::string &nick, const Anope::string &username, const Anope::string &host, const Anope::string &server, const Anope::string &realname, time_t ts, const Anope::string &ip, const Anope::string &vhost, const Anope::string &uid, const Anope::string &modes);
|
||||
|
||||
E void do_umode(const Anope::string &, const Anope::string &user, const Anope::string &modes);
|
||||
E void do_quit(const Anope::string &source, const Anope::string &reason);
|
||||
E void do_kill(const Anope::string &source, const Anope::string &reason);
|
||||
|
||||
E bool is_oper(User *user);
|
||||
|
||||
E bool is_excepted(ChannelInfo *ci, User *user);
|
||||
E bool is_excepted_mask(ChannelInfo *ci, const Anope::string &mask);
|
||||
|
||||
E bool match_usermask(const Anope::string &mask, User *user);
|
||||
E Anope::string create_mask(User *u);
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
E void b64_encode(const Anope::string &src, Anope::string &target);
|
||||
E void b64_decode(const Anope::string &src, Anope::string &target);
|
||||
|
||||
#ifdef _WIN32
|
||||
E Anope::string GetWindowsVersion();
|
||||
E bool SupportedWindowsVersion();
|
||||
#endif
|
||||
|
||||
#endif /* EXTERN_H */
|
||||
+56
-361
@@ -1,192 +1,85 @@
|
||||
/*
|
||||
* Copyright (C) 2002-2010 InspIRCd Development Team
|
||||
* Copyright (C) 2009-2010 Anope Team <team@anope.org>
|
||||
*
|
||||
* Copyright (C) 2002-2011 InspIRCd Development Team
|
||||
* Copyright (C) 2009-2013 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.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HASHCOMP_H
|
||||
#define HASHCOMP_H
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef MODULE_COMPILE
|
||||
# define CoreExport __declspec(dllimport)
|
||||
# define DllExport __declspec(dllexport)
|
||||
# else
|
||||
# define CoreExport __declspec(dllexport)
|
||||
# define DllExport __declspec(dllimport)
|
||||
# endif
|
||||
#include <string>
|
||||
#include <locale>
|
||||
|
||||
#if defined _LIBCPP_VERSION || defined _WIN32
|
||||
#include <unordered_map>
|
||||
#define TR1NS std
|
||||
#else
|
||||
# define CoreExport
|
||||
# define DllExport
|
||||
#include <tr1/unordered_map>
|
||||
#define TR1NS std::tr1
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include "services.h"
|
||||
|
||||
namespace Anope
|
||||
{
|
||||
class string;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
# if defined(__GNUC__) && __GNUC__ >= 4
|
||||
/* GCC4+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. */
|
||||
# include <tr1/unordered_map>
|
||||
# define unordered_map_namespace std::tr1
|
||||
# else /* GCC ver < 4 */
|
||||
# include <ext/hash_map>
|
||||
/* Oddball linux namespace for hash_map */
|
||||
# define unordered_map_namespace __gnu_cxx
|
||||
# define unordered_map hash_map
|
||||
# endif
|
||||
#else
|
||||
# if _MSC_VER >= 1600
|
||||
/* MSVC 2010+ has tr1. Though MSVC and GCC use different includes! */
|
||||
# include <unordered_map>
|
||||
# define unordered_map_namespace std::tr1
|
||||
# else
|
||||
# include <hash_map>
|
||||
# define unordered_map_namespace
|
||||
template<typename Key, typename Type, typename Compare, typename Unused = void>
|
||||
class unordered_map : public stdext::hash_map<Key, Type, Compare>
|
||||
{
|
||||
public:
|
||||
unordered_map() : hash_map() { }
|
||||
};
|
||||
# endif
|
||||
#endif
|
||||
/* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */
|
||||
extern std::locale casemap;
|
||||
|
||||
/*******************************************************
|
||||
* 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.
|
||||
*******************************************************/
|
||||
extern void CaseMapRebuild();
|
||||
extern unsigned char tolower(unsigned char);
|
||||
extern unsigned char toupper(unsigned char);
|
||||
|
||||
/** 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 */
|
||||
};
|
||||
|
||||
/** 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>
|
||||
/* ASCII case insensitive ctype. */
|
||||
template<typename char_type>
|
||||
class ascii_ctype : public std::ctype<char_type>
|
||||
{
|
||||
/** 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);
|
||||
public:
|
||||
char_type do_toupper(char_type c) const anope_override
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
return c - 32;
|
||||
else
|
||||
return c;
|
||||
}
|
||||
|
||||
/** 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);
|
||||
char_type do_tolower(char_type c) const anope_override
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return c + 32;
|
||||
else
|
||||
return c;
|
||||
}
|
||||
};
|
||||
|
||||
/** This typedef declares irc::string based upon irc_char_traits.
|
||||
*/
|
||||
typedef std::basic_string<char, irc_char_traits, std::allocator<char> > string;
|
||||
|
||||
/** Used to hash irc::strings for unordered_map
|
||||
*/
|
||||
struct hash
|
||||
/* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */
|
||||
template<typename char_type>
|
||||
class rfc1459_ctype : public ascii_ctype<char_type>
|
||||
{
|
||||
/* VS 2008 specific code */
|
||||
enum { bucket_size = 4, min_buckets = 8 };
|
||||
bool operator()(const Anope::string &s1, const Anope::string &s2) const;
|
||||
/* End VS 2008 specific code */
|
||||
public:
|
||||
char_type do_toupper(char_type c) const anope_override
|
||||
{
|
||||
if (c == '{' || c == '}' || c == '|')
|
||||
return c - 32;
|
||||
else
|
||||
return ascii_ctype<char_type>::do_toupper(c);
|
||||
}
|
||||
|
||||
/** Hash an irc::string for unordered_map
|
||||
* @param s The string
|
||||
* @return A hash value for the string
|
||||
*/
|
||||
size_t operator()(const irc::string &s) const;
|
||||
size_t operator()(const Anope::string &s) const;
|
||||
char_type do_tolower(char_type c) const anope_override
|
||||
{
|
||||
if (c == '[' || c == ']' || c == '\\')
|
||||
return c + 32;
|
||||
else
|
||||
return ascii_ctype<char_type>::do_tolower(c);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** The ci namespace contains a number of helper classes.
|
||||
/** The ci namespace contains a number of helper classes relevant to case insensitive strings.
|
||||
*/
|
||||
namespace ci
|
||||
{
|
||||
@@ -239,60 +132,8 @@ namespace ci
|
||||
*/
|
||||
typedef std::basic_string<char, ci_char_traits, std::allocator<char> > string;
|
||||
|
||||
/** Used to hash ci::strings for unordered_map
|
||||
*/
|
||||
struct hash
|
||||
struct CoreExport less
|
||||
{
|
||||
/* VS 2008 specific code */
|
||||
enum { bucket_size = 4, min_buckets = 8 };
|
||||
bool operator()(const Anope::string &s1, const Anope::string &s2) const;
|
||||
/* End VS 2008 specific code */
|
||||
|
||||
/** Hash a ci::string for unordered_map
|
||||
* @param s The string
|
||||
* @return A hash value for the string
|
||||
*/
|
||||
size_t operator()(const ci::string &s) const;
|
||||
size_t operator()(const Anope::string &s) const;
|
||||
};
|
||||
}
|
||||
|
||||
namespace std
|
||||
{
|
||||
/** An overload for std::equal_to<ci::string> that uses Anope::string, passed for the fourth temmplate
|
||||
* argument for unordered_map
|
||||
*/
|
||||
template<> struct CoreExport equal_to<ci::string>
|
||||
{
|
||||
public:
|
||||
/** Compare two Anope::strings as ci::strings
|
||||
* @paarm s1 The first string
|
||||
* @param s2 The second string
|
||||
* @return true if they are equal
|
||||
*/
|
||||
bool operator()(const Anope::string &s1, const Anope::string &s2) const;
|
||||
};
|
||||
|
||||
/** An overload for std::equal_to<irc::string> that uses Anope::string, passed for the fourth template
|
||||
* argument for unorderd_map
|
||||
*/
|
||||
template<> struct CoreExport equal_to<irc::string>
|
||||
{
|
||||
public:
|
||||
/** Compare two Anope::strings as irc::strings
|
||||
* @param s1 The first string
|
||||
* @param s2 The second string
|
||||
* @return true if they are equal
|
||||
*/
|
||||
bool operator()(const Anope::string &s1, const Anope::string &s2) const;
|
||||
};
|
||||
|
||||
/** An overload for std::less<ci::string> that uses Anope::string, passed for the third template argument
|
||||
* to std::map and std::multimap
|
||||
*/
|
||||
template<> struct CoreExport less<ci::string>
|
||||
{
|
||||
public:
|
||||
/** Compare two Anope::strings as ci::strings and find which one is less
|
||||
* @param s1 The first string
|
||||
* @param s2 The second string
|
||||
@@ -300,64 +141,6 @@ namespace std
|
||||
*/
|
||||
bool operator()(const Anope::string &s1, const Anope::string &s2) const;
|
||||
};
|
||||
|
||||
/** An overload for std;:less<irc::string> that uses Anope::string, passed for the third tempalte argument
|
||||
* to std::map and std::multimap
|
||||
*/
|
||||
template<> struct CoreExport less<irc::string>
|
||||
{
|
||||
public:
|
||||
/** Compare two Anope::strings as irc::strings and find which one is less
|
||||
* @param s1 The first string
|
||||
* @param s2 The second string
|
||||
* @return true if s1 < s2, else false
|
||||
*/
|
||||
bool operator()(const Anope::string &s1, const Anope::string &s2) const;
|
||||
};
|
||||
}
|
||||
|
||||
/* 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::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::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
|
||||
@@ -380,46 +163,6 @@ 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
|
||||
*
|
||||
@@ -440,40 +183,6 @@ 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)
|
||||
@@ -481,25 +190,11 @@ 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
|
||||
/* Define operators != for std::string to ci::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);
|
||||
}
|
||||
|
||||
#endif // HASHCOMP_H
|
||||
|
||||
+128
-1550
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LISTS_H
|
||||
#define LISTS_H
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
|
||||
/** A class to process numbered lists (passed to most DEL/LIST/VIEW commands).
|
||||
* The function HandleNumber is called for every number in the list. Note that
|
||||
* if descending is true it gets called in descending order. This is so deleting
|
||||
* the index passed to the function from an array will not cause the other indexes
|
||||
* passed to the function to be incorrect. This keeps us from having to have an
|
||||
* 'in use' flag on everything.
|
||||
*/
|
||||
class CoreExport NumberList
|
||||
{
|
||||
private:
|
||||
bool is_valid;
|
||||
|
||||
std::set<unsigned> numbers;
|
||||
|
||||
bool desc;
|
||||
public:
|
||||
/** Processes a numbered list
|
||||
* @param list The list
|
||||
* @param descending True to make HandleNumber get called with numbers in descending order
|
||||
*/
|
||||
NumberList(const Anope::string &list, bool descending);
|
||||
|
||||
/** Destructor, does nothing
|
||||
*/
|
||||
virtual ~NumberList();
|
||||
|
||||
/** Should be called after the constructors are done running. This calls the callbacks.
|
||||
*/
|
||||
void Process();
|
||||
|
||||
/** Called with a number from the list
|
||||
* @param number The number
|
||||
*/
|
||||
virtual void HandleNumber(unsigned number);
|
||||
|
||||
/** Called when there is an error with the numbered list
|
||||
* Return false to immediatly stop processing the list and return
|
||||
* This is all done before we start calling HandleNumber, so no numbers will have been processed yet
|
||||
* @param list The list
|
||||
* @return false to stop processing
|
||||
*/
|
||||
virtual bool InvalidRange(const Anope::string &list);
|
||||
};
|
||||
|
||||
/** This class handles formatting LIST/VIEW replies.
|
||||
*/
|
||||
class CoreExport ListFormatter
|
||||
{
|
||||
public:
|
||||
typedef std::map<Anope::string, Anope::string> ListEntry;
|
||||
private:
|
||||
NickCore *nc;
|
||||
std::vector<Anope::string> columns;
|
||||
std::vector<ListEntry> entries;
|
||||
public:
|
||||
ListFormatter(NickCore *nc);
|
||||
ListFormatter &AddColumn(const Anope::string &name);
|
||||
void AddEntry(const ListEntry &entry);
|
||||
bool IsEmpty() const;
|
||||
void Process(std::vector<Anope::string> &);
|
||||
};
|
||||
|
||||
/** This class handles formatting INFO replies
|
||||
*/
|
||||
class CoreExport InfoFormatter
|
||||
{
|
||||
NickCore *nc;
|
||||
std::vector<std::pair<Anope::string, Anope::string> > replies;
|
||||
unsigned longest;
|
||||
public:
|
||||
InfoFormatter(NickCore *nc);
|
||||
void Process(std::vector<Anope::string> &);
|
||||
Anope::string &operator[](const Anope::string &key);
|
||||
void AddOption(const Anope::string &opt);
|
||||
};
|
||||
|
||||
#endif // LISTS_H
|
||||
|
||||
+71
-31
@@ -1,14 +1,35 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
|
||||
#include "anope.h"
|
||||
#include "defs.h"
|
||||
|
||||
enum LogType
|
||||
{
|
||||
/* Used whenever an administrator uses an administrative comand */
|
||||
LOG_ADMIN,
|
||||
/* Used whenever an administrator overides something, such as adding
|
||||
* access to a channel where they don't have permission to.
|
||||
*/
|
||||
LOG_OVERRIDE,
|
||||
/* Any other command usage */
|
||||
LOG_COMMAND,
|
||||
LOG_SERVER,
|
||||
LOG_CHANNEL,
|
||||
LOG_USER,
|
||||
LOG_MODULE,
|
||||
LOG_NORMAL,
|
||||
LOG_TERMINAL,
|
||||
LOG_RAWIO,
|
||||
@@ -21,42 +42,62 @@ enum LogType
|
||||
struct LogFile
|
||||
{
|
||||
Anope::string filename;
|
||||
|
||||
public:
|
||||
std::ofstream stream;
|
||||
|
||||
LogFile(const Anope::string &name);
|
||||
Anope::string GetName() const;
|
||||
~LogFile();
|
||||
const Anope::string &GetName() const;
|
||||
};
|
||||
|
||||
/* Represents a single log message */
|
||||
class CoreExport Log
|
||||
{
|
||||
public:
|
||||
/* Bot that should log this message */
|
||||
BotInfo *bi;
|
||||
LogType Type;
|
||||
Anope::string Category;
|
||||
std::list<Anope::string> Sources;
|
||||
/* For commands, the user executing the command, but might not always exist */
|
||||
User *u;
|
||||
/* For commands, the account executing the command, but will not always exist */
|
||||
NickCore *nc;
|
||||
/* For commands, the command being executed */
|
||||
Command *c;
|
||||
/* For commands, the command source */
|
||||
CommandSource *source;
|
||||
/* Used for LOG_CHANNEL */
|
||||
Channel *chan;
|
||||
/* For commands, the channel the command was executed on, will not always exist */
|
||||
const ChannelInfo *ci;
|
||||
/* For LOG_SERVER */
|
||||
Server *s;
|
||||
/* For LOG_MODULE */
|
||||
Module *m;
|
||||
LogType type;
|
||||
Anope::string category;
|
||||
|
||||
std::stringstream buf;
|
||||
|
||||
Log(LogType type = LOG_NORMAL, const Anope::string &category = "", BotInfo *bi = Global);
|
||||
Log(LogType type = LOG_NORMAL, const Anope::string &category = "", BotInfo *bi = NULL);
|
||||
|
||||
/* LOG_COMMAND/OVERRIDE/ADMIN */
|
||||
Log(LogType type, User *u, Command *c, ChannelInfo *ci = NULL);
|
||||
Log(LogType type, CommandSource &source, Command *c, ChannelInfo *ci = NULL);
|
||||
|
||||
/* LOG_CHANNEL */
|
||||
Log(User *u, Channel *c, const Anope::string &category = "");
|
||||
|
||||
/* LOG_USER */
|
||||
explicit Log(User *u, const Anope::string &category = "");
|
||||
Log(User *u, const Anope::string &category = "", BotInfo *bi = NULL);
|
||||
|
||||
/* LOG_SERVER */
|
||||
Log(Server *s, const Anope::string &category = "");
|
||||
Log(Server *s, const Anope::string &category = "", BotInfo *bi = NULL);
|
||||
|
||||
Log(BotInfo *b, const Anope::string &category = "");
|
||||
|
||||
Log(Module *m, const Anope::string &category = "");
|
||||
|
||||
~Log();
|
||||
|
||||
Anope::string BuildPrefix() const;
|
||||
|
||||
template<typename T> Log &operator<<(T val)
|
||||
{
|
||||
this->buf << val;
|
||||
@@ -64,36 +105,35 @@ class CoreExport Log
|
||||
}
|
||||
};
|
||||
|
||||
/* Configured in the configuration file, actually does the message logging */
|
||||
class CoreExport LogInfo
|
||||
{
|
||||
public:
|
||||
std::list<Anope::string> Targets;
|
||||
std::map<Anope::string, LogFile *> Logfiles;
|
||||
std::list<Anope::string> Sources;
|
||||
int LogAge;
|
||||
bool Inhabit;
|
||||
std::list<Anope::string> Admin;
|
||||
std::list<Anope::string> Override;
|
||||
std::list<Anope::string> Commands;
|
||||
std::list<Anope::string> Servers;
|
||||
std::list<Anope::string> Users;
|
||||
std::list<Anope::string> Channels;
|
||||
std::list<Anope::string> Normal;
|
||||
bool RawIO;
|
||||
bool Debug;
|
||||
BotInfo *bot;
|
||||
std::vector<Anope::string> targets;
|
||||
std::vector<LogFile *> logfiles;
|
||||
int last_day;
|
||||
std::vector<Anope::string> sources;
|
||||
int log_age;
|
||||
std::vector<Anope::string> admin;
|
||||
std::vector<Anope::string> override;
|
||||
std::vector<Anope::string> commands;
|
||||
std::vector<Anope::string> servers;
|
||||
std::vector<Anope::string> users;
|
||||
std::vector<Anope::string> channels;
|
||||
std::vector<Anope::string> normal;
|
||||
bool raw_io;
|
||||
bool debug;
|
||||
|
||||
LogInfo(int logage, bool inhabit, bool rawio, bool debug);
|
||||
LogInfo(int logage, bool rawio, bool debug);
|
||||
|
||||
~LogInfo();
|
||||
|
||||
void AddType(std::list<Anope::string> &list, const Anope::string &type);
|
||||
void OpenLogFiles();
|
||||
|
||||
bool HasType(std::list<Anope::string> &list, const Anope::string &type) const;
|
||||
|
||||
std::list<Anope::string> &GetList(LogType type);
|
||||
|
||||
bool HasType(LogType Type);
|
||||
bool HasType(LogType ltype, const Anope::string &type) const;
|
||||
|
||||
/* Logs the message l if configured to */
|
||||
void ProcessMessage(const Log *l);
|
||||
};
|
||||
|
||||
|
||||
+47
-18
@@ -1,29 +1,58 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MAIL_H
|
||||
#define MAIL_H
|
||||
|
||||
#include "anope.h"
|
||||
#include "threadengine.h"
|
||||
#include "serialize.h"
|
||||
|
||||
extern CoreExport bool Mail(User *u, NickRequest *nr, BotInfo *service, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool Mail(User *u, NickCore *nc, BotInfo *service, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool Mail(NickCore *nc, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool MailValidate(const Anope::string &email);
|
||||
|
||||
class MailThread : public Thread
|
||||
namespace Mail
|
||||
{
|
||||
private:
|
||||
Anope::string MailTo;
|
||||
Anope::string Addr;
|
||||
Anope::string Subject;
|
||||
Anope::string Message;
|
||||
bool DontQuoteAddresses;
|
||||
extern CoreExport bool Send(User *from, NickCore *to, BotInfo *service, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool Send(NickCore *to, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool Validate(const Anope::string &email);
|
||||
|
||||
bool Success;
|
||||
public:
|
||||
MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message);
|
||||
/* A email message being sent */
|
||||
class Message : public Thread
|
||||
{
|
||||
private:
|
||||
Anope::string sendmail_path;
|
||||
Anope::string send_from;
|
||||
Anope::string mail_to;
|
||||
Anope::string addr;
|
||||
Anope::string subject;
|
||||
Anope::string message;
|
||||
bool dont_quote_addresses;
|
||||
|
||||
~MailThread();
|
||||
bool success;
|
||||
public:
|
||||
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
|
||||
* @param sf Config->SendFrom
|
||||
* @param mailto Name of person being mailed (u->nick, nc->display, etc)
|
||||
* @param addr Destination address to mail
|
||||
* @param subject Message subject
|
||||
* @param message The actual message
|
||||
*/
|
||||
Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message);
|
||||
|
||||
void Run();
|
||||
};
|
||||
~Message();
|
||||
|
||||
/* Called from within the thread to actually send the mail */
|
||||
void Run() anope_override;
|
||||
};
|
||||
|
||||
} // namespace Mail
|
||||
|
||||
#endif // MAIL_H
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEMO_H
|
||||
#define MEMO_H
|
||||
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
|
||||
class CoreExport Memo : public Serializable
|
||||
{
|
||||
public:
|
||||
bool unread;
|
||||
bool receipt;
|
||||
Memo();
|
||||
~Memo();
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
Anope::string owner;
|
||||
/* When it was sent */
|
||||
time_t time;
|
||||
Anope::string sender;
|
||||
Anope::string text;
|
||||
};
|
||||
|
||||
/* Memo info structures. Since both nicknames and channels can have memos,
|
||||
* we encapsulate memo data in a MemoInfo to make it easier to handle.
|
||||
*/
|
||||
struct CoreExport MemoInfo
|
||||
{
|
||||
int16_t memomax;
|
||||
Serialize::Checker<std::vector<Memo *> > memos;
|
||||
std::vector<Anope::string> ignores;
|
||||
|
||||
MemoInfo();
|
||||
Memo *GetMemo(unsigned index) const;
|
||||
unsigned GetIndex(Memo *m) const;
|
||||
void Del(unsigned index);
|
||||
bool HasIgnore(User *u);
|
||||
|
||||
static MemoInfo *GetMemoInfo(const Anope::string &targ, bool &is_chan);
|
||||
};
|
||||
|
||||
#endif // MEMO_H
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "protocol.h"
|
||||
|
||||
/* Common IRCD messages.
|
||||
* Protocol modules may chose to include some, none, or all of these handlers
|
||||
* as they see fit.
|
||||
*/
|
||||
|
||||
namespace Message
|
||||
{
|
||||
|
||||
struct CoreExport Away : IRCDMessage
|
||||
{
|
||||
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Capab : IRCDMessage
|
||||
{
|
||||
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Error : IRCDMessage
|
||||
{
|
||||
Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Invite : IRCDMessage
|
||||
{
|
||||
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Join : IRCDMessage
|
||||
{
|
||||
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
|
||||
typedef std::pair<ChannelStatus, User *> SJoinUser;
|
||||
|
||||
/** Handle a SJOIN.
|
||||
* @param source The source of the SJOIN
|
||||
* @param chan The channel the users are joining to
|
||||
* @param ts The TS for the channel
|
||||
* @param modes The modes sent with the SJOIN, if any
|
||||
* @param users The users and their status, if any
|
||||
*/
|
||||
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
|
||||
};
|
||||
|
||||
struct CoreExport Kick : IRCDMessage
|
||||
{
|
||||
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Kill : IRCDMessage
|
||||
{
|
||||
Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Mode : IRCDMessage
|
||||
{
|
||||
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport MOTD : IRCDMessage
|
||||
{
|
||||
MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Notice : IRCDMessage
|
||||
{
|
||||
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Part : IRCDMessage
|
||||
{
|
||||
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Ping : IRCDMessage
|
||||
{
|
||||
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Privmsg : IRCDMessage
|
||||
{
|
||||
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Quit : IRCDMessage
|
||||
{
|
||||
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport SQuit : IRCDMessage
|
||||
{
|
||||
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Stats : IRCDMessage
|
||||
{
|
||||
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Time : IRCDMessage
|
||||
{
|
||||
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Topic : IRCDMessage
|
||||
{
|
||||
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Version : IRCDMessage
|
||||
{
|
||||
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Whois : IRCDMessage
|
||||
{
|
||||
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
} // namespace Message
|
||||
|
||||
+173
-278
@@ -1,7 +1,7 @@
|
||||
/* Mode support
|
||||
*
|
||||
* Copyright (C) 2008-2010 Adam <Adam@anope.org>
|
||||
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
@@ -9,44 +9,8 @@
|
||||
#ifndef MODES_H
|
||||
#define MODES_H
|
||||
|
||||
/** 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_INVISIBLE_OPER,
|
||||
|
||||
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
|
||||
};
|
||||
#include "anope.h"
|
||||
#include "base.h"
|
||||
|
||||
/** The different types of modes
|
||||
*/
|
||||
@@ -66,9 +30,7 @@ enum ModeType
|
||||
*/
|
||||
enum ModeClass
|
||||
{
|
||||
/* Channel mode */
|
||||
MC_CHANNEL,
|
||||
/* User mode */
|
||||
MC_USER
|
||||
};
|
||||
|
||||
@@ -77,26 +39,28 @@ enum ModeClass
|
||||
class CoreExport Mode : public Base
|
||||
{
|
||||
public:
|
||||
/* Class of mode this is */
|
||||
ModeClass Class;
|
||||
/* The mode name, as a string */
|
||||
Anope::string NameAsString;
|
||||
/* Mode char for this */
|
||||
char ModeChar;
|
||||
/* Type of mode this is */
|
||||
ModeType Type;
|
||||
/* Mode name */
|
||||
Anope::string name;
|
||||
/* Class of mode this is (user/channel) */
|
||||
ModeClass mclass;
|
||||
/* Mode char for this, eg 'b' */
|
||||
char mchar;
|
||||
/* Type of mode this is, eg MODE_LIST */
|
||||
ModeType type;
|
||||
|
||||
/** Default constructor
|
||||
* @param mClass The type of mode this is
|
||||
* @param mNameAsString The mode name as a string
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param mname The mode name
|
||||
* @param mclass The type of mode this is
|
||||
* @param mc The mode char
|
||||
* @param type The mode type
|
||||
*/
|
||||
Mode(ModeClass mClass, const Anope::string &mNameAsString, char modeChar, ModeType type);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type);
|
||||
virtual ~Mode();
|
||||
|
||||
/** Can a user set this mode, used for mlock
|
||||
* @param u The user
|
||||
*/
|
||||
virtual bool CanSet(User *u) const;
|
||||
};
|
||||
|
||||
/** This class is a user mode, all user modes use this/inherit from this
|
||||
@@ -104,30 +68,21 @@ class CoreExport Mode : public Base
|
||||
class CoreExport UserMode : public Mode
|
||||
{
|
||||
public:
|
||||
/* Mode name */
|
||||
UserModeName Name;
|
||||
|
||||
/** Default constructor
|
||||
* @param nName The mode name
|
||||
* @param mNameAsString The mode name as a string
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
UserMode(UserModeName mName, const Anope::string &mNameAsString, char modeChar);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~UserMode();
|
||||
UserMode(const Anope::string &name, char mc);
|
||||
};
|
||||
|
||||
class CoreExport UserModeParam : public UserMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param mNameAsString The mode name as a string
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
UserModeParam(UserModeName mName, const Anope::string &mNameAsString, char modeChar);
|
||||
UserModeParam(const Anope::string &name, char mc);
|
||||
|
||||
/** Check if the param is valid
|
||||
* @param value The param
|
||||
@@ -141,43 +96,25 @@ class CoreExport UserModeParam : public UserMode
|
||||
class CoreExport ChannelMode : public Mode
|
||||
{
|
||||
public:
|
||||
/* Mode name */
|
||||
ChannelModeName Name;
|
||||
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param mNameAsString The mode name as a string
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
ChannelMode(ChannelModeName mName, const Anope::string &mNameAsString, char modeChar);
|
||||
ChannelMode(const Anope::string &name, char mc);
|
||||
|
||||
/** 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) const { return true; }
|
||||
bool CanSet(User *u) const anope_override;
|
||||
};
|
||||
|
||||
|
||||
/** 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 mNameAsString The mode name as a string
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
ChannelModeList(ChannelModeName mName, const Anope::string &mNameAsString, char modeChar);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~ChannelModeList();
|
||||
ChannelModeList(const Anope::string &name, char mc);
|
||||
|
||||
/** Is the mask valid
|
||||
* @param mask The mask
|
||||
@@ -185,18 +122,25 @@ class CoreExport ChannelModeList : public ChannelMode
|
||||
*/
|
||||
virtual bool IsValid(const Anope::string &mask) const { return true; }
|
||||
|
||||
/** Add the mask to the channel, this should be overridden
|
||||
/** Checks if mask affects user
|
||||
* Should only be used for extbans or other weird ircd-specific things.
|
||||
* @param u The user
|
||||
* @param e The entry to match against
|
||||
* @return true on match
|
||||
*/
|
||||
virtual bool Matches(User *u, const Entry *e) { return false; }
|
||||
|
||||
/** Called when a mask is added to a channel
|
||||
* @param chan The channel
|
||||
* @param mask The mask
|
||||
*/
|
||||
virtual void AddMask(Channel *chan, const Anope::string &mask) { }
|
||||
virtual void OnAdd(Channel *chan, const Anope::string &mask) { }
|
||||
|
||||
/** Delete the mask from the channel, this should be overridden
|
||||
/** Called when a mask is removed from a channel
|
||||
* @param chan The channel
|
||||
* @param mask The mask
|
||||
*/
|
||||
virtual void DelMask(Channel *chan, const Anope::string &mask) { }
|
||||
|
||||
virtual void OnDel(Channel *chan, const Anope::string &mask) { }
|
||||
};
|
||||
|
||||
/** This is a mode with a paramater, eg +k/l. These modes should use/inherit from this
|
||||
@@ -204,20 +148,15 @@ class CoreExport ChannelModeList : public ChannelMode
|
||||
class CoreExport ChannelModeParam : public ChannelMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param mNameAsString The mode name as a string
|
||||
* @param modeChar The mode char
|
||||
* @param MinusArg true if this mode sends no arg when unsetting
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
* @param minus_no_arg true if this mode sends no arg when unsetting
|
||||
*/
|
||||
ChannelModeParam(ChannelModeName mName, const Anope::string &mNameAsString, char modeChar, bool MinusArg = false);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~ChannelModeParam();
|
||||
ChannelModeParam(const Anope::string &name, char mc, bool minus_no_arg = false);
|
||||
|
||||
/* Should we send an arg when unsetting this mode? */
|
||||
bool MinusNoArg;
|
||||
bool minus_no_arg;
|
||||
|
||||
/** Is the param valid
|
||||
* @param value The param
|
||||
@@ -232,187 +171,104 @@ class CoreExport ChannelModeStatus : public ChannelMode
|
||||
{
|
||||
public:
|
||||
/* The symbol, eg @ % + */
|
||||
char Symbol;
|
||||
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param mNameAsString The mode name as a string
|
||||
* @param modeChar The mode char
|
||||
* @param mSymbol The symbol for the mode, eg @ % +
|
||||
char symbol;
|
||||
/* The "level" of the mode, used to compare with other modes.
|
||||
* Used so we know op > halfop > voice etc.
|
||||
*/
|
||||
ChannelModeStatus(ChannelModeName mName, const Anope::string &mNameAsString, char modeChar, char mSymbol);
|
||||
short level;
|
||||
|
||||
/** Default destructor
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
* @param msymbol The symbol for the mode, eg @ %
|
||||
* @param mlevel A level for the mode, which is usually determined by the PREFIX capab
|
||||
*/
|
||||
virtual ~ChannelModeStatus();
|
||||
ChannelModeStatus(const Anope::string &name, char mc, char msymbol, short mlevel);
|
||||
};
|
||||
|
||||
/** Channel mode +b
|
||||
*/
|
||||
class CoreExport ChannelModeBan : public ChannelModeList
|
||||
/* The status a user has on a channel (+v, +h, +o) etc */
|
||||
class CoreExport ChannelStatus
|
||||
{
|
||||
Anope::string modes;
|
||||
public:
|
||||
ChannelStatus();
|
||||
ChannelStatus(const Anope::string &modes);
|
||||
void AddMode(char c);
|
||||
void DelMode(char c);
|
||||
bool HasMode(char c) const;
|
||||
bool Empty() const;
|
||||
void Clear();
|
||||
const Anope::string &Modes() const;
|
||||
Anope::string BuildModePrefixList() const;
|
||||
};
|
||||
|
||||
class CoreExport UserModeOperOnly : public UserMode
|
||||
{
|
||||
public:
|
||||
ChannelModeBan(char modeChar) : ChannelModeList(CMODE_BAN, "CMODE_BAN", modeChar) { }
|
||||
UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { }
|
||||
|
||||
void AddMask(Channel *chan, const Anope::string &mask);
|
||||
|
||||
void DelMask(Channel *chan, const Anope::string &mask);
|
||||
bool CanSet(User *u) const anope_override;
|
||||
};
|
||||
|
||||
/** Channel mode +e
|
||||
*/
|
||||
class CoreExport ChannelModeExcept : public ChannelModeList
|
||||
class CoreExport UserModeNoone : public UserMode
|
||||
{
|
||||
public:
|
||||
ChannelModeExcept(char modeChar) : ChannelModeList(CMODE_EXCEPT, "CMODE_EXCEPT", modeChar) { }
|
||||
UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { }
|
||||
|
||||
void AddMask(Channel *chan, const Anope::string &mask);
|
||||
|
||||
void DelMask(Channel *chan, const Anope::string &mask);
|
||||
bool CanSet(User *u) const anope_override;
|
||||
};
|
||||
|
||||
/** Channel mode +I
|
||||
*/
|
||||
class CoreExport ChannelModeInvex : public ChannelModeList
|
||||
{
|
||||
public:
|
||||
ChannelModeInvex(char modeChar) : ChannelModeList(CMODE_INVITEOVERRIDE, "CMODE_INVITEOVERRIDE", modeChar) { }
|
||||
|
||||
void AddMask(Channel *chan, const Anope::string &mask);
|
||||
|
||||
void DelMask(Channel *chan, const Anope::string &mask);
|
||||
};
|
||||
|
||||
|
||||
/** Channel mode +k (key)
|
||||
*/
|
||||
class CoreExport ChannelModeKey : public ChannelModeParam
|
||||
{
|
||||
public:
|
||||
ChannelModeKey(char modeChar) : ChannelModeParam(CMODE_KEY, "CMODE_KEY", modeChar) { }
|
||||
ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { }
|
||||
|
||||
bool IsValid(const Anope::string &value) const;
|
||||
bool IsValid(const Anope::string &value) const anope_override;
|
||||
};
|
||||
|
||||
/** Channel mode +f (flood)
|
||||
/** This class is used for oper only channel modes
|
||||
*/
|
||||
class ChannelModeFlood : public ChannelModeParam
|
||||
class CoreExport ChannelModeOperOnly : public ChannelMode
|
||||
{
|
||||
public:
|
||||
ChannelModeFlood(char modeChar, bool minusNoArg = false) : ChannelModeParam(CMODE_FLOOD, "CMODE_FLOOD", modeChar, minusNoArg) { }
|
||||
|
||||
bool IsValid(const Anope::string &value) const;
|
||||
};
|
||||
|
||||
/** 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, "CMODE_ADMINONLY", modeChar) { }
|
||||
ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
|
||||
|
||||
/* Opers only */
|
||||
bool CanSet(User *u) const;
|
||||
bool CanSet(User *u) const anope_override;
|
||||
};
|
||||
|
||||
/** This class is used for channel mode +O (Opers only)
|
||||
* Only opers can mlock it
|
||||
/** This class is used for channel modes only servers may set
|
||||
*/
|
||||
class CoreExport ChannelModeOper : public ChannelMode
|
||||
class CoreExport ChannelModeNoone : public ChannelMode
|
||||
{
|
||||
public:
|
||||
ChannelModeOper(char modeChar) : ChannelMode(CMODE_OPERONLY, "CMODE_OPERONLY", modeChar) { }
|
||||
ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
|
||||
|
||||
/* Opers only */
|
||||
bool CanSet(User *u) const;
|
||||
bool CanSet(User *u) const anope_override;
|
||||
};
|
||||
|
||||
/** 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, "CMODE_REGISTERED", modeChar) { }
|
||||
|
||||
/* No one mlocks +r */
|
||||
bool CanSet(User *u) const;
|
||||
};
|
||||
|
||||
enum StackerType
|
||||
{
|
||||
ST_CHANNEL,
|
||||
ST_USER
|
||||
};
|
||||
|
||||
class StackerInfo
|
||||
{
|
||||
public:
|
||||
/* Modes to be added */
|
||||
std::list<std::pair<Base *, Anope::string> > AddModes;
|
||||
/* Modes to be deleted */
|
||||
std::list<std::pair<Base *, Anope::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(Mode *mode, bool Set, const Anope::string &Param);
|
||||
};
|
||||
|
||||
/** This is mode manager
|
||||
/** This is the 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
|
||||
* them on a channel or user at once
|
||||
*/
|
||||
class CoreExport ModeManager
|
||||
{
|
||||
protected:
|
||||
/* List of pairs of user/channels and their stacker info */
|
||||
static std::list<std::pair<Base *, 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
|
||||
/* Array of all modes Anope knows about. Modes are in this array at position
|
||||
* modechar. Additionally, status modes are in this array (again) at statuschar.
|
||||
*/
|
||||
static StackerInfo *GetInfo(Base *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<Anope::string> BuildModeStrings(StackerInfo *info);
|
||||
|
||||
/** 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, Base *Object, Mode *mode, bool Set, const Anope::string &Param, StackerType Type);
|
||||
static std::vector<ChannelMode *> ChannelModes;
|
||||
static std::vector<UserMode *> UserModes;
|
||||
|
||||
public:
|
||||
/* List of all modes Anope knows about */
|
||||
static std::map<Anope::string, Mode *> Modes;
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
/* Number of generic channel and user modes we are tracking */
|
||||
static unsigned GenericChannelModes;
|
||||
static unsigned GenericUserModes;
|
||||
|
||||
/** Add a user mode to Anope
|
||||
* @param um A UserMode or UserMode derived class
|
||||
@@ -426,68 +282,107 @@ class CoreExport ModeManager
|
||||
*/
|
||||
static bool AddChannelMode(ChannelMode *cm);
|
||||
|
||||
/** Find a channel mode
|
||||
* @param Mode The mode
|
||||
* @return The mode class
|
||||
/** Remove a user mode from Anope
|
||||
* @param um A UserMode to remove
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByChar(char Mode);
|
||||
static void RemoveUserMode(UserMode *um);
|
||||
|
||||
/** Find a user mode
|
||||
* @param Mode The mode
|
||||
* @return The mode class
|
||||
/** Remove a channel mode from Anope
|
||||
* @param um A ChanneMode to remove
|
||||
*/
|
||||
static UserMode *FindUserModeByChar(char Mode);
|
||||
static void RemoveChannelMode(ChannelMode *cm);
|
||||
|
||||
/** Find a channel mode
|
||||
* @param Mode The modename
|
||||
* @param mode The mode
|
||||
* @return The mode class
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByName(ChannelModeName Name);
|
||||
static ChannelMode *FindChannelModeByChar(char mode);
|
||||
|
||||
/** Find a user mode
|
||||
* @param Mode The modename
|
||||
* @param mode The mode
|
||||
* @return The mode class
|
||||
*/
|
||||
static UserMode *FindUserModeByName(UserModeName Name);
|
||||
static UserMode *FindUserModeByChar(char mode);
|
||||
|
||||
/** Find a mode by name
|
||||
* @param name The mode name
|
||||
* @return The mode
|
||||
/** Find a channel mode
|
||||
* @param name The modename
|
||||
* @return The mode class
|
||||
*/
|
||||
static Mode *FindModeByName(const Anope::string &name);
|
||||
static ChannelMode *FindChannelModeByName(const Anope::string &name);
|
||||
|
||||
/** Find a user mode
|
||||
* @param name The modename
|
||||
* @return The mode class
|
||||
*/
|
||||
static UserMode *FindUserModeByName(const Anope::string &name);
|
||||
|
||||
/** Gets the channel mode char for a symbol (eg + returns v)
|
||||
* @param Value The symbol
|
||||
* @param symbol The symbol
|
||||
* @return The char
|
||||
*/
|
||||
static char GetStatusChar(char Value);
|
||||
static char GetStatusChar(char symbol);
|
||||
|
||||
static const std::vector<ChannelMode *> &GetChannelModes();
|
||||
static const std::vector<UserMode *> &GetUserModes();
|
||||
static const std::vector<ChannelModeStatus *> &GetStatusChannelModesByRank();
|
||||
static void RebuildStatusModes();
|
||||
|
||||
/** 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
|
||||
* @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 Anope::string &Param = "");
|
||||
static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string ¶m = "");
|
||||
|
||||
/** 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 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 Anope::string &Param = "");
|
||||
static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string ¶m = "");
|
||||
|
||||
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
|
||||
*/
|
||||
static void ProcessModes();
|
||||
|
||||
/** Delete a user or channel from the stacker
|
||||
* @param b The user/channel
|
||||
/** Delete a user, channel, or mode from the stacker
|
||||
*/
|
||||
static void StackerDel(Base *b);
|
||||
static void StackerDel(User *u);
|
||||
static void StackerDel(Channel *c);
|
||||
static void StackerDel(Mode *m);
|
||||
};
|
||||
|
||||
/** Represents a mask set on a channel (b/e/I)
|
||||
*/
|
||||
class CoreExport Entry
|
||||
{
|
||||
Anope::string name;
|
||||
Anope::string mask;
|
||||
public:
|
||||
unsigned short cidr_len;
|
||||
Anope::string nick, user, host, real;
|
||||
|
||||
/** Constructor
|
||||
* @param mode What mode this host is for, can be empty for unknown/no mode
|
||||
* @param host A full or poartial nick!ident@host/cidr#real name mask
|
||||
*/
|
||||
Entry(const Anope::string &mode, const Anope::string &host);
|
||||
|
||||
/** Get the banned mask for this entry
|
||||
* @return The mask
|
||||
*/
|
||||
const Anope::string GetMask() const;
|
||||
|
||||
/** Check if this entry matches a user
|
||||
* @param u The user
|
||||
* @param full True to match against a users real host and IP
|
||||
* @return true on match
|
||||
*/
|
||||
bool Matches(User *u, bool full = false) const;
|
||||
};
|
||||
|
||||
#endif // MODES_H
|
||||
|
||||
+47
-2
@@ -1,9 +1,54 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*/
|
||||
|
||||
#ifndef MODULE_H
|
||||
#define MODULE_H
|
||||
|
||||
#include "services.h"
|
||||
#include "access.h"
|
||||
#include "account.h"
|
||||
#include "anope.h"
|
||||
#include "base.h"
|
||||
#include "bots.h"
|
||||
#include "channels.h"
|
||||
#include "commands.h"
|
||||
#include "config.h"
|
||||
#include "extensible.h"
|
||||
#include "hashcomp.h"
|
||||
#include "language.h"
|
||||
#include "lists.h"
|
||||
#include "logger.h"
|
||||
#include "mail.h"
|
||||
#include "memo.h"
|
||||
#include "messages.h"
|
||||
#include "modes.h"
|
||||
#include "modules.h"
|
||||
#define _(x) x
|
||||
#include "opertype.h"
|
||||
#include "protocol.h"
|
||||
#include "regexpr.h"
|
||||
#include "regchannel.h"
|
||||
#include "serialize.h"
|
||||
#include "servers.h"
|
||||
#include "service.h"
|
||||
#include "services.h"
|
||||
#include "socketengine.h"
|
||||
#include "sockets.h"
|
||||
#include "threadengine.h"
|
||||
#include "timers.h"
|
||||
#include "uplink.h"
|
||||
#include "users.h"
|
||||
#include "xline.h"
|
||||
|
||||
#include "modules/pseudoclients/chanserv.h"
|
||||
#include "modules/pseudoclients/global.h"
|
||||
#include "modules/pseudoclients/memoserv.h"
|
||||
#include "modules/pseudoclients/nickserv.h"
|
||||
|
||||
#endif // MODULE_H
|
||||
|
||||
+627
-701
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/** Flags for badwords
|
||||
*/
|
||||
enum BadWordType
|
||||
{
|
||||
/* Always kicks if the word is said */
|
||||
BW_ANY,
|
||||
/* User must way the entire word */
|
||||
BW_SINGLE,
|
||||
/* The word has to start with the badword */
|
||||
BW_START,
|
||||
/* The word has to end with the badword */
|
||||
BW_END
|
||||
};
|
||||
|
||||
/* Structure used to contain bad words. */
|
||||
struct BadWord
|
||||
{
|
||||
Anope::string chan;
|
||||
Anope::string word;
|
||||
BadWordType type;
|
||||
|
||||
virtual ~BadWord() { }
|
||||
protected:
|
||||
BadWord() { }
|
||||
};
|
||||
|
||||
struct BadWords
|
||||
{
|
||||
virtual ~BadWords() { }
|
||||
|
||||
/** Add a badword to the badword list
|
||||
* @param word The badword
|
||||
* @param type The type (SINGLE START END)
|
||||
* @return The badword
|
||||
*/
|
||||
virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0;
|
||||
|
||||
/** Get a badword structure by index
|
||||
* @param index The index
|
||||
* @return The badword
|
||||
*/
|
||||
virtual BadWord* GetBadWord(unsigned index) const = 0;
|
||||
|
||||
/** Get how many badwords are on this channel
|
||||
* @return The number of badwords in the vector
|
||||
*/
|
||||
virtual unsigned GetBadWordCount() const = 0;
|
||||
|
||||
/** Remove a badword
|
||||
* @param index The index of the badword
|
||||
*/
|
||||
virtual void EraseBadWord(unsigned index) = 0;
|
||||
|
||||
/** Clear all badwords from the channel
|
||||
*/
|
||||
virtual void ClearBadWords() = 0;
|
||||
|
||||
virtual void Check() = 0;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* Indices for TTB (Times To Ban) */
|
||||
enum
|
||||
{
|
||||
TTB_BOLDS,
|
||||
TTB_COLORS,
|
||||
TTB_REVERSES,
|
||||
TTB_UNDERLINES,
|
||||
TTB_BADWORDS,
|
||||
TTB_CAPS,
|
||||
TTB_FLOOD,
|
||||
TTB_REPEAT,
|
||||
TTB_ITALICS,
|
||||
TTB_AMSGS,
|
||||
TTB_SIZE
|
||||
};
|
||||
|
||||
struct KickerData
|
||||
{
|
||||
bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines;
|
||||
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
|
||||
int16_t capsmin, capspercent; /* For CAPS kicker */
|
||||
int16_t floodlines, floodsecs; /* For FLOOD kicker */
|
||||
int16_t repeattimes; /* For REPEAT kicker */
|
||||
|
||||
bool dontkickops, dontkickvoices;
|
||||
|
||||
protected:
|
||||
KickerData() { }
|
||||
|
||||
public:
|
||||
virtual ~KickerData() { }
|
||||
virtual void Check(ChannelInfo *ci) = 0;
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
/* ChanServ core functions
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*/
|
||||
|
||||
struct LogSetting
|
||||
{
|
||||
Anope::string chan;
|
||||
/* Our service name of the command */
|
||||
Anope::string service_name;
|
||||
/* The name of the client the command is on */
|
||||
Anope::string command_service;
|
||||
/* Name of the command to the user, can have spaces */
|
||||
Anope::string command_name;
|
||||
Anope::string method, extra;
|
||||
Anope::string creator;
|
||||
time_t created;
|
||||
|
||||
virtual ~LogSetting() { }
|
||||
protected:
|
||||
LogSetting() { }
|
||||
};
|
||||
|
||||
struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
|
||||
{
|
||||
typedef std::vector<LogSetting *>::iterator iterator;
|
||||
|
||||
protected:
|
||||
LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting")
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~LogSettings() { }
|
||||
virtual LogSetting *Create() = 0;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/* ChanServ core functions
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*/
|
||||
|
||||
struct ModeLock
|
||||
{
|
||||
Anope::string ci;
|
||||
bool set;
|
||||
Anope::string name;
|
||||
Anope::string param;
|
||||
Anope::string setter;
|
||||
time_t created;
|
||||
|
||||
virtual ~ModeLock() { }
|
||||
protected:
|
||||
ModeLock() { }
|
||||
};
|
||||
|
||||
struct ModeLocks
|
||||
{
|
||||
typedef std::vector<ModeLock *> ModeList;
|
||||
|
||||
virtual ~ModeLocks() { }
|
||||
|
||||
/** Check if a mode is mlocked
|
||||
* @param mode The mode
|
||||
* @param An optional param
|
||||
* @param status True to check mlock on, false for mlock off
|
||||
* @return true on success, false on fail
|
||||
*/
|
||||
virtual bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const = 0;
|
||||
|
||||
/** Set a mlock
|
||||
* @param mode The mode
|
||||
* @param status True for mlock on, false for mlock off
|
||||
* @param param An optional param arg for + mlocked modes
|
||||
* @param setter Who is setting the mlock
|
||||
* @param created When the mlock was created
|
||||
* @return true on success, false on failure (module blocking)
|
||||
*/
|
||||
virtual bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "", Anope::string setter = "", time_t created = Anope::CurTime) = 0;
|
||||
|
||||
/** Remove a mlock
|
||||
* @param mode The mode
|
||||
* @param status True for mlock on, false for mlock off
|
||||
* @param param The param of the mode, required if it is a list or status mode
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
virtual bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "") = 0;
|
||||
|
||||
virtual void RemoveMLock(ModeLock *mlock) = 0;
|
||||
|
||||
/** Clear all mlocks on the channel
|
||||
*/
|
||||
virtual void ClearMLock() = 0;
|
||||
|
||||
/** Get all of the mlocks for this channel
|
||||
* @return The mlocks
|
||||
*/
|
||||
virtual const ModeList &GetMLock() const = 0;
|
||||
|
||||
/** Get a list of mode locks on a channel
|
||||
* @param name The mode name to get a list of
|
||||
* @return a list of mlocks for the given mode
|
||||
*/
|
||||
virtual std::list<ModeLock *> GetModeLockList(const Anope::string &name) = 0;
|
||||
|
||||
/** Get details for a specific mlock
|
||||
* @param mname The mode name
|
||||
* @param An optional param to match with
|
||||
* @return The MLock, if any
|
||||
*/
|
||||
virtual const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") = 0;
|
||||
|
||||
/** Get the current mode locks as a string
|
||||
* @param complete True to show mlock parameters aswell
|
||||
* @return A string of mode locks, eg: +nrt
|
||||
*/
|
||||
virtual Anope::string GetMLockAsString(bool complete) const = 0;
|
||||
|
||||
virtual void Check() = 0;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/* ChanServ core functions
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*/
|
||||
|
||||
struct CSSuspendInfo
|
||||
{
|
||||
Anope::string chan, by, reason;
|
||||
time_t time, expires;
|
||||
|
||||
virtual ~CSSuspendInfo() { }
|
||||
protected:
|
||||
CSSuspendInfo() { }
|
||||
};
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DNS_H
|
||||
#define DNS_H
|
||||
|
||||
namespace DNS
|
||||
{
|
||||
/** Valid query types
|
||||
*/
|
||||
enum QueryType
|
||||
{
|
||||
/* Nothing */
|
||||
QUERY_NONE,
|
||||
/* A simple A lookup */
|
||||
QUERY_A = 1,
|
||||
/* An authoritative name server */
|
||||
QUERY_NS = 2,
|
||||
/* A CNAME lookup */
|
||||
QUERY_CNAME = 5,
|
||||
/* Start of a zone of authority */
|
||||
QUERY_SOA = 6,
|
||||
/* Reverse DNS lookup */
|
||||
QUERY_PTR = 12,
|
||||
/* IPv6 AAAA lookup */
|
||||
QUERY_AAAA = 28,
|
||||
/* Zone transfer */
|
||||
QUERY_AXFR = 252,
|
||||
/* A lookup for any record */
|
||||
QUERY_ANY = 255
|
||||
};
|
||||
|
||||
/** Flags that can be AND'd into DNSPacket::flags to receive certain values
|
||||
*/
|
||||
enum
|
||||
{
|
||||
QUERYFLAGS_QR = 0x8000,
|
||||
QUERYFLAGS_OPCODE = 0x7800,
|
||||
QUERYFLAGS_OPCODE_NOTIFY = 0x2000,
|
||||
QUERYFLAGS_AA = 0x400,
|
||||
QUERYFLAGS_TC = 0x200,
|
||||
QUERYFLAGS_RD = 0x100,
|
||||
QUERYFLAGS_RA = 0x80,
|
||||
QUERYFLAGS_Z = 0x70,
|
||||
QUERYFLAGS_RCODE = 0xF
|
||||
};
|
||||
|
||||
enum Error
|
||||
{
|
||||
ERROR_NONE,
|
||||
ERROR_UNKNOWN,
|
||||
ERROR_UNLOADED,
|
||||
ERROR_TIMEDOUT,
|
||||
ERROR_NOT_AN_ANSWER,
|
||||
ERROR_NONSTANDARD_QUERY,
|
||||
ERROR_FORMAT_ERROR,
|
||||
ERROR_SERVER_FAILURE,
|
||||
ERROR_DOMAIN_NOT_FOUND,
|
||||
ERROR_NOT_IMPLEMENTED,
|
||||
ERROR_REFUSED,
|
||||
ERROR_NO_RECORDS,
|
||||
ERROR_INVALIDTYPE
|
||||
};
|
||||
|
||||
struct Question
|
||||
{
|
||||
Anope::string name;
|
||||
QueryType type;
|
||||
unsigned short qclass;
|
||||
|
||||
Question() : type(QUERY_NONE), qclass(0) { }
|
||||
Question(const Anope::string &n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { }
|
||||
inline bool operator==(const Question & other) const { return name == other.name && type == other.type && qclass == other.qclass; }
|
||||
|
||||
struct hash
|
||||
{
|
||||
size_t operator()(const Question &q) const
|
||||
{
|
||||
return Anope::hash_ci()(q.name);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
struct ResourceRecord : Question
|
||||
{
|
||||
unsigned int ttl;
|
||||
Anope::string rdata;
|
||||
time_t created;
|
||||
|
||||
ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), ttl(0), created(Anope::CurTime) { }
|
||||
ResourceRecord(const Question &q) : Question(q), ttl(0), created(Anope::CurTime) { }
|
||||
};
|
||||
|
||||
struct Query
|
||||
{
|
||||
std::vector<Question> questions;
|
||||
std::vector<ResourceRecord> answers, authorities, additional;
|
||||
Error error;
|
||||
|
||||
Query() : error(ERROR_NONE) { }
|
||||
Query(const Question &q) : error(ERROR_NONE) { questions.push_back(q); }
|
||||
};
|
||||
|
||||
class ReplySocket;
|
||||
class Request;
|
||||
|
||||
/** DNS manager
|
||||
*/
|
||||
class Manager : public Service
|
||||
{
|
||||
public:
|
||||
Manager(Module *creator) : Service(creator, "DNS::Manager", "dns/manager") { }
|
||||
virtual ~Manager() { }
|
||||
|
||||
virtual void Process(Request *req) = 0;
|
||||
virtual void RemoveRequest(Request *req) = 0;
|
||||
|
||||
virtual bool HandlePacket(ReplySocket *s, const unsigned char *const data, int len, sockaddrs *from) = 0;
|
||||
|
||||
virtual void UpdateSerial() = 0;
|
||||
virtual void Notify(const Anope::string &zone) = 0;
|
||||
virtual uint32_t GetSerial() const = 0;
|
||||
};
|
||||
|
||||
/** A DNS query.
|
||||
*/
|
||||
class Request : public Timer, public Question
|
||||
{
|
||||
Manager *manager;
|
||||
public:
|
||||
/* Use result cache if available */
|
||||
bool use_cache;
|
||||
/* Request id */
|
||||
unsigned short id;
|
||||
/* Creator of this request */
|
||||
Module *creator;
|
||||
|
||||
Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false) : Timer(0), Question(addr, qt), manager(mgr),
|
||||
use_cache(cache), id(0), creator(c) { }
|
||||
|
||||
virtual ~Request()
|
||||
{
|
||||
manager->RemoveRequest(this);
|
||||
}
|
||||
|
||||
/** Called when this request succeeds
|
||||
* @param r The query sent back from the nameserver
|
||||
*/
|
||||
virtual void OnLookupComplete(const Query *r) = 0;
|
||||
|
||||
/** Called when this request fails or times out.
|
||||
* @param r The query sent back from the nameserver, check the error code.
|
||||
*/
|
||||
virtual void OnError(const Query *r) { }
|
||||
|
||||
/** Used to time out the query, xalls OnError and lets the TimerManager
|
||||
* delete this request.
|
||||
*/
|
||||
void Tick(time_t) anope_override
|
||||
{
|
||||
Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name;
|
||||
Query rr(*this);
|
||||
rr.error = ERROR_TIMEDOUT;
|
||||
this->OnError(&rr);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace DNS
|
||||
|
||||
#endif // DNS_H
|
||||
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
#ifndef ANOPE_HTTPD_H
|
||||
#define ANOPE_HTTPD_H
|
||||
|
||||
enum HTTPError
|
||||
{
|
||||
HTTP_ERROR_OK = 200,
|
||||
HTTP_FOUND = 302,
|
||||
HTTP_BAD_REQUEST = 400,
|
||||
HTTP_PAGE_NOT_FOUND = 404,
|
||||
HTTP_NOT_SUPPORTED = 505
|
||||
};
|
||||
|
||||
/* A message to someone */
|
||||
struct HTTPReply
|
||||
{
|
||||
HTTPError error;
|
||||
Anope::string content_type;
|
||||
std::map<Anope::string, Anope::string> headers;
|
||||
typedef std::list<std::pair<Anope::string, Anope::string> > cookie;
|
||||
std::vector<cookie> cookies;
|
||||
|
||||
HTTPReply() : error(HTTP_ERROR_OK), length(0) { }
|
||||
|
||||
HTTPReply(const HTTPReply& other) : error(other.error), length(other.length)
|
||||
{
|
||||
content_type = other.content_type;
|
||||
headers = other.headers;
|
||||
cookies = other.cookies;
|
||||
|
||||
for (unsigned i = 0; i < other.out.size(); ++i)
|
||||
out.push_back(new Data(other.out[i]->buf, other.out[i]->len));
|
||||
}
|
||||
|
||||
~HTTPReply()
|
||||
{
|
||||
for (unsigned i = 0; i < out.size(); ++i)
|
||||
delete out[i];
|
||||
out.clear();
|
||||
}
|
||||
|
||||
struct Data
|
||||
{
|
||||
char *buf;
|
||||
size_t len;
|
||||
|
||||
Data(const char *b, size_t l)
|
||||
{
|
||||
this->buf = new char[l];
|
||||
memcpy(this->buf, b, l);
|
||||
this->len = l;
|
||||
}
|
||||
|
||||
~Data()
|
||||
{
|
||||
delete [] buf;
|
||||
}
|
||||
};
|
||||
|
||||
std::deque<Data *> out;
|
||||
size_t length;
|
||||
|
||||
void Write(const Anope::string &message)
|
||||
{
|
||||
this->out.push_back(new Data(message.c_str(), message.length()));
|
||||
this->length += message.length();
|
||||
}
|
||||
|
||||
void Write(const char *b, size_t l)
|
||||
{
|
||||
this->out.push_back(new Data(b, l));
|
||||
this->length += l;
|
||||
}
|
||||
};
|
||||
|
||||
/* A message from soneone */
|
||||
struct HTTPMessage
|
||||
{
|
||||
std::map<Anope::string, Anope::string> headers;
|
||||
std::map<Anope::string, Anope::string> cookies;
|
||||
std::map<Anope::string, Anope::string> get_data;
|
||||
std::map<Anope::string, Anope::string> post_data;
|
||||
Anope::string content;
|
||||
};
|
||||
|
||||
class HTTPClient;
|
||||
class HTTPProvider;
|
||||
|
||||
class HTTPPage : public Base
|
||||
{
|
||||
Anope::string url;
|
||||
Anope::string content_type;
|
||||
|
||||
public:
|
||||
HTTPPage(const Anope::string &u, const Anope::string &ct = "text/html") : url(u), content_type(ct) { }
|
||||
|
||||
const Anope::string &GetURL() const { return this->url; }
|
||||
|
||||
const Anope::string &GetContentType() const { return this->content_type; }
|
||||
|
||||
/** Called when this page is requested
|
||||
* @param The server this page is on
|
||||
* @param The page name
|
||||
* @param The client requesting the page
|
||||
* @param The HTTP header sent from the client to request the page
|
||||
* @param The HTTP header that will be sent back to the client
|
||||
*/
|
||||
virtual bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0;
|
||||
};
|
||||
|
||||
class HTTPClient : public ClientSocket, public BinarySocket, public Base
|
||||
{
|
||||
protected:
|
||||
void WriteClient(const Anope::string &message)
|
||||
{
|
||||
BinarySocket::Write(message + "\r\n");
|
||||
}
|
||||
|
||||
public:
|
||||
HTTPClient(ListenSocket *l, int f, const sockaddrs &a) : ClientSocket(l, a), BinarySocket() { }
|
||||
|
||||
virtual const Anope::string GetIP()
|
||||
{
|
||||
return this->clientaddr.addr();
|
||||
}
|
||||
|
||||
virtual void SendError(HTTPError err, const Anope::string &msg) = 0;
|
||||
virtual void SendReply(HTTPReply *) = 0;
|
||||
};
|
||||
|
||||
class HTTPProvider : public ListenSocket, public Service
|
||||
{
|
||||
Anope::string ip;
|
||||
unsigned short port;
|
||||
bool ssl;
|
||||
public:
|
||||
Anope::string ext_ip;
|
||||
std::vector<Anope::string> ext_headers;
|
||||
|
||||
HTTPProvider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p, bool s) : ListenSocket(i, p, i.find(':') != Anope::string::npos), Service(c, "HTTPProvider", n), ip(i), port(p), ssl(s) { }
|
||||
|
||||
const Anope::string &GetIP() const
|
||||
{
|
||||
return this->ip;
|
||||
}
|
||||
|
||||
unsigned short GetPort() const
|
||||
{
|
||||
return this->port;
|
||||
}
|
||||
|
||||
bool IsSSL() const
|
||||
{
|
||||
return this->ssl;
|
||||
}
|
||||
|
||||
virtual bool RegisterPage(HTTPPage *page) = 0;
|
||||
virtual void UnregisterPage(HTTPPage *page) = 0;
|
||||
virtual HTTPPage* FindPage(const Anope::string &name) = 0;
|
||||
};
|
||||
|
||||
namespace HTTPUtils
|
||||
{
|
||||
inline Anope::string URLDecode(const Anope::string &url)
|
||||
{
|
||||
Anope::string decoded;
|
||||
|
||||
for (unsigned i = 0; i < url.length(); ++i)
|
||||
{
|
||||
const char& c = url[i];
|
||||
|
||||
if (c == '%' && i + 2 < url.length())
|
||||
{
|
||||
Anope::string dest;
|
||||
Anope::Unhex(url.substr(i + 1, 2), dest);
|
||||
decoded += dest;
|
||||
i += 2;
|
||||
}
|
||||
else if (c == '+')
|
||||
decoded += ' ';
|
||||
else
|
||||
decoded += c;
|
||||
}
|
||||
|
||||
return decoded;
|
||||
}
|
||||
|
||||
inline Anope::string URLEncode(const Anope::string &url)
|
||||
{
|
||||
Anope::string encoded;
|
||||
|
||||
for (unsigned i = 0; i < url.length(); ++i)
|
||||
{
|
||||
const char& c = url[i];
|
||||
|
||||
if (isalnum(c) || c == '.' || c == '-' || c == '*' || c == '_')
|
||||
encoded += c;
|
||||
else if (c == ' ')
|
||||
encoded += '+';
|
||||
else
|
||||
encoded += "%" + Anope::Hex(c);
|
||||
}
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
inline Anope::string Escape(const Anope::string &src)
|
||||
{
|
||||
Anope::string dst;
|
||||
|
||||
for (unsigned i = 0; i < src.length(); ++i)
|
||||
{
|
||||
switch (src[i])
|
||||
{
|
||||
case '<':
|
||||
dst += "<";
|
||||
break;
|
||||
case '>':
|
||||
dst += ">";
|
||||
break;
|
||||
case '"':
|
||||
dst += """;
|
||||
break;
|
||||
default:
|
||||
dst += src[i];
|
||||
}
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ANOPE_HTTPD_H
|
||||
@@ -0,0 +1,173 @@
|
||||
#ifndef ANOPE_LDAP_H
|
||||
#define ANOPE_LDAP_H
|
||||
|
||||
typedef int LDAPQuery;
|
||||
|
||||
class LDAPException : public ModuleException
|
||||
{
|
||||
public:
|
||||
LDAPException(const Anope::string &reason) : ModuleException(reason) { }
|
||||
|
||||
virtual ~LDAPException() throw() { }
|
||||
};
|
||||
|
||||
struct LDAPModification
|
||||
{
|
||||
enum LDAPOperation
|
||||
{
|
||||
LDAP_ADD,
|
||||
LDAP_DEL,
|
||||
LDAP_REPLACE
|
||||
};
|
||||
|
||||
LDAPOperation op;
|
||||
Anope::string name;
|
||||
std::vector<Anope::string> values;
|
||||
};
|
||||
typedef std::vector<LDAPModification> LDAPMods;
|
||||
|
||||
struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string> >
|
||||
{
|
||||
size_t size(const Anope::string &attr) const
|
||||
{
|
||||
const std::vector<Anope::string>& array = this->getArray(attr);
|
||||
return array.size();
|
||||
}
|
||||
|
||||
const std::vector<Anope::string> keys() const
|
||||
{
|
||||
std::vector<Anope::string> k;
|
||||
for (const_iterator it = this->begin(), it_end = this->end(); it != it_end; ++it)
|
||||
k.push_back(it->first);
|
||||
return k;
|
||||
}
|
||||
|
||||
const Anope::string &get(const Anope::string &attr) const
|
||||
{
|
||||
const std::vector<Anope::string>& array = this->getArray(attr);
|
||||
if (array.empty())
|
||||
throw LDAPException("Empty attribute " + attr + " in LDAPResult::get");
|
||||
return array[0];
|
||||
}
|
||||
|
||||
const std::vector<Anope::string>& getArray(const Anope::string &attr) const
|
||||
{
|
||||
const_iterator it = this->find(attr);
|
||||
if (it == this->end())
|
||||
throw LDAPException("Unknown attribute " + attr + " in LDAPResult::getArray");
|
||||
return it->second;
|
||||
}
|
||||
};
|
||||
|
||||
struct LDAPResult
|
||||
{
|
||||
std::vector<LDAPAttributes> messages;
|
||||
Anope::string error;
|
||||
|
||||
enum QueryType
|
||||
{
|
||||
QUERY_UNKNOWN,
|
||||
QUERY_BIND,
|
||||
QUERY_SEARCH,
|
||||
QUERY_ADD,
|
||||
QUERY_DELETE,
|
||||
QUERY_MODIFY
|
||||
};
|
||||
|
||||
QueryType type;
|
||||
LDAPQuery id;
|
||||
|
||||
LDAPResult()
|
||||
{
|
||||
this->type = QUERY_UNKNOWN;
|
||||
this->id = -1;
|
||||
}
|
||||
|
||||
size_t size() const
|
||||
{
|
||||
return this->messages.size();
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return this->messages.empty();
|
||||
}
|
||||
|
||||
const LDAPAttributes &get(size_t sz) const
|
||||
{
|
||||
if (sz >= this->messages.size())
|
||||
throw LDAPException("Index out of range");
|
||||
return this->messages[sz];
|
||||
}
|
||||
|
||||
const Anope::string &getError() const
|
||||
{
|
||||
return this->error;
|
||||
}
|
||||
};
|
||||
|
||||
class LDAPInterface
|
||||
{
|
||||
public:
|
||||
Module *owner;
|
||||
|
||||
LDAPInterface(Module *m) : owner(m) { }
|
||||
virtual ~LDAPInterface() { }
|
||||
|
||||
virtual void OnResult(const LDAPResult &r) = 0;
|
||||
virtual void OnError(const LDAPResult &err) = 0;
|
||||
virtual void OnDelete() { }
|
||||
};
|
||||
|
||||
class LDAPProvider : public Service
|
||||
{
|
||||
public:
|
||||
LDAPProvider(Module *c, const Anope::string &n) : Service(c, "LDAPProvider", n) { }
|
||||
|
||||
/** Attempt to bind to the LDAP server as an admin
|
||||
* @param i The LDAPInterface the result is sent to
|
||||
* @return The query ID
|
||||
*/
|
||||
virtual LDAPQuery BindAsAdmin(LDAPInterface *i) = 0;
|
||||
|
||||
/** Bind to LDAP
|
||||
* @param i The LDAPInterface the result is sent to
|
||||
* @param who The binddn
|
||||
* @param pass The password
|
||||
* @return The query ID
|
||||
*/
|
||||
virtual LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0;
|
||||
|
||||
/** Search ldap for the specified filter
|
||||
* @param i The LDAPInterface the result is sent to
|
||||
* @param base The base DN to search
|
||||
* @param filter The filter to apply
|
||||
* @return The query ID
|
||||
*/
|
||||
virtual LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0;
|
||||
|
||||
/** Add an entry to LDAP
|
||||
* @param i The LDAPInterface the result is sent to
|
||||
* @param dn The dn of the entry to add
|
||||
* @param attributes The attributes
|
||||
* @return The query ID
|
||||
*/
|
||||
virtual LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0;
|
||||
|
||||
/** Delete an entry from LDAP
|
||||
* @param i The LDAPInterface the result is sent to
|
||||
* @param dn The dn of the entry to delete
|
||||
* @return The query ID
|
||||
*/
|
||||
virtual LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) = 0;
|
||||
|
||||
/** Modify an existing entry in LDAP
|
||||
* @param i The LDAPInterface the result is sent to
|
||||
* @param base The base DN to modify
|
||||
* @param attributes The attributes to modify
|
||||
* @return The query ID
|
||||
*/
|
||||
virtual LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
|
||||
};
|
||||
|
||||
#endif // ANOPE_LDAP_H
|
||||
@@ -0,0 +1,62 @@
|
||||
/* NickServ core functions
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*/
|
||||
|
||||
struct NSCertList
|
||||
{
|
||||
protected:
|
||||
NSCertList() { }
|
||||
public:
|
||||
virtual ~NSCertList() { }
|
||||
|
||||
/** Add an entry to the nick's certificate list
|
||||
*
|
||||
* @param entry The fingerprint to add to the cert list
|
||||
*
|
||||
* Adds a new entry into the cert list.
|
||||
*/
|
||||
virtual void AddCert(const Anope::string &entry) = 0;
|
||||
|
||||
/** Get an entry from the nick's cert list by index
|
||||
*
|
||||
* @param entry Index in the certificaate list vector to retrieve
|
||||
* @return The fingerprint 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 certificate list corresponding to the given index.
|
||||
*/
|
||||
virtual Anope::string GetCert(unsigned entry) const = 0;
|
||||
|
||||
virtual unsigned GetCertCount() const = 0;
|
||||
|
||||
/** Find an entry in the nick's cert list
|
||||
*
|
||||
* @param entry The fingerprint to search for
|
||||
* @return True if the fingerprint is found in the cert list, false otherwise
|
||||
*
|
||||
* Search for an fingerprint within the cert list.
|
||||
*/
|
||||
virtual bool FindCert(const Anope::string &entry) const = 0;
|
||||
|
||||
/** Erase a fingerprint from the nick's certificate list
|
||||
*
|
||||
* @param entry The fingerprint to remove
|
||||
*
|
||||
* Removes the specified fingerprint from the cert list.
|
||||
*/
|
||||
virtual void EraseCert(const Anope::string &entry) = 0;
|
||||
|
||||
/** Clears the entire nick's cert list
|
||||
*
|
||||
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
||||
*/
|
||||
virtual void ClearCert() = 0;
|
||||
|
||||
virtual void Check() = 0;
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
/* NickServ core functions
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*/
|
||||
|
||||
struct NSSuspendInfo
|
||||
{
|
||||
Anope::string nick, by, reason;
|
||||
time_t when, expires;
|
||||
|
||||
virtual ~NSSuspendInfo() { }
|
||||
protected:
|
||||
NSSuspendInfo() { }
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
#ifndef OS_FORBID_H
|
||||
#define OS_FORBID_H
|
||||
|
||||
enum ForbidType
|
||||
{
|
||||
FT_NICK = 1,
|
||||
FT_CHAN,
|
||||
FT_EMAIL,
|
||||
FT_REGISTER,
|
||||
FT_SIZE
|
||||
};
|
||||
|
||||
struct ForbidData : Serializable
|
||||
{
|
||||
Anope::string mask;
|
||||
Anope::string creator;
|
||||
Anope::string reason;
|
||||
time_t created;
|
||||
time_t expires;
|
||||
ForbidType type;
|
||||
|
||||
ForbidData() : Serializable("ForbidData") { }
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
class ForbidService : public Service
|
||||
{
|
||||
public:
|
||||
ForbidService(Module *m) : Service(m, "ForbidService", "forbid") { }
|
||||
|
||||
virtual void AddForbid(ForbidData *d) = 0;
|
||||
|
||||
virtual void RemoveForbid(ForbidData *d) = 0;
|
||||
|
||||
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
|
||||
|
||||
virtual std::vector<ForbidData *> GetForbids() = 0;
|
||||
};
|
||||
|
||||
static ServiceReference<ForbidService> forbid_service("ForbidService", "forbid");
|
||||
|
||||
void ForbidData::Serialize(Serialize::Data &data) const
|
||||
{
|
||||
data["mask"] << this->mask;
|
||||
data["creator"] << this->creator;
|
||||
data["reason"] << this->reason;
|
||||
data["created"] << this->created;
|
||||
data["expires"] << this->expires;
|
||||
data["type"] << this->type;
|
||||
}
|
||||
|
||||
Serializable* ForbidData::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
if (!forbid_service)
|
||||
return NULL;
|
||||
|
||||
ForbidData *fb;
|
||||
if (obj)
|
||||
fb = anope_dynamic_static_cast<ForbidData *>(obj);
|
||||
else
|
||||
fb = new ForbidData;
|
||||
|
||||
data["mask"] >> fb->mask;
|
||||
data["creator"] >> fb->creator;
|
||||
data["reason"] >> fb->reason;
|
||||
data["created"] >> fb->created;
|
||||
data["expires"] >> fb->expires;
|
||||
unsigned int t;
|
||||
data["type"] >> t;
|
||||
fb->type = static_cast<ForbidType>(t);
|
||||
|
||||
if (t > FT_SIZE - 1)
|
||||
return NULL;
|
||||
|
||||
if (!obj)
|
||||
forbid_service->AddForbid(fb);
|
||||
return fb;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/* OperServ ignore interface
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*/
|
||||
|
||||
|
||||
struct IgnoreData : Serializable
|
||||
{
|
||||
Anope::string mask;
|
||||
Anope::string creator;
|
||||
Anope::string reason;
|
||||
time_t time; /* When do we stop ignoring them? */
|
||||
|
||||
IgnoreData() : Serializable("IgnoreData") { }
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
class IgnoreService : public Service
|
||||
{
|
||||
protected:
|
||||
std::list<IgnoreData> ignores;
|
||||
|
||||
IgnoreService(Module *c) : Service(c, "IgnoreService", "ignore") { }
|
||||
|
||||
public:
|
||||
virtual IgnoreData* AddIgnore(const Anope::string &mask, const Anope::string &creator, const Anope::string &reason, time_t delta = Anope::CurTime) = 0;
|
||||
|
||||
virtual bool DelIgnore(const Anope::string &mask) = 0;
|
||||
|
||||
inline void ClearIgnores() { this->ignores.clear(); }
|
||||
|
||||
virtual IgnoreData *Find(const Anope::string &mask) = 0;
|
||||
|
||||
inline std::list<IgnoreData> &GetIgnores() { return this->ignores; }
|
||||
};
|
||||
|
||||
static ServiceReference<IgnoreService> ignore_service("IgnoreService", "ignore");
|
||||
|
||||
void IgnoreData::Serialize(Serialize::Data &data) const
|
||||
{
|
||||
data["mask"] << this->mask;
|
||||
data["creator"] << this->creator;
|
||||
data["reason"] << this->reason;
|
||||
data["time"] << this->time;
|
||||
}
|
||||
|
||||
Serializable* IgnoreData::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
if (!ignore_service)
|
||||
return NULL;
|
||||
|
||||
if (obj)
|
||||
{
|
||||
IgnoreData *ign = anope_dynamic_static_cast<IgnoreData *>(obj);
|
||||
data["mask"] >> ign->mask;
|
||||
data["creator"] >> ign->creator;
|
||||
data["reason"] >> ign->reason;
|
||||
data["time"] >> ign->time;
|
||||
return ign;
|
||||
}
|
||||
|
||||
Anope::string smask, screator, sreason;
|
||||
time_t t;
|
||||
|
||||
data["mask"] >> smask;
|
||||
data["creator"] >> screator;
|
||||
data["reason"] >> sreason;
|
||||
data["time"] >> t;
|
||||
|
||||
return ignore_service->AddIgnore(smask, screator, sreason, t);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
#ifndef OS_NEWS
|
||||
#define OS_NEWS
|
||||
|
||||
enum NewsType
|
||||
{
|
||||
NEWS_LOGON,
|
||||
NEWS_RANDOM,
|
||||
NEWS_OPER
|
||||
};
|
||||
|
||||
struct NewsMessages
|
||||
{
|
||||
NewsType type;
|
||||
Anope::string name;
|
||||
const char *msgs[10];
|
||||
};
|
||||
|
||||
struct NewsItem : Serializable
|
||||
{
|
||||
NewsType type;
|
||||
Anope::string text;
|
||||
Anope::string who;
|
||||
time_t time;
|
||||
|
||||
NewsItem() : Serializable("NewsItem") { }
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
class NewsService : public Service
|
||||
{
|
||||
public:
|
||||
NewsService(Module *m) : Service(m, "NewsService", "news") { }
|
||||
|
||||
virtual void AddNewsItem(NewsItem *n) = 0;
|
||||
|
||||
virtual void DelNewsItem(NewsItem *n) = 0;
|
||||
|
||||
virtual std::vector<NewsItem *> &GetNewsList(NewsType t) = 0;
|
||||
};
|
||||
|
||||
static ServiceReference<NewsService> news_service("NewsService", "news");
|
||||
|
||||
void NewsItem::Serialize(Serialize::Data &data) const
|
||||
{
|
||||
data["type"] << this->type;
|
||||
data["text"] << this->text;
|
||||
data["who"] << this->who;
|
||||
data["time"] << this->time;
|
||||
}
|
||||
|
||||
Serializable* NewsItem::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
if (!news_service)
|
||||
return NULL;
|
||||
|
||||
NewsItem *ni;
|
||||
if (obj)
|
||||
ni = anope_dynamic_static_cast<NewsItem *>(obj);
|
||||
else
|
||||
ni = new NewsItem();
|
||||
|
||||
unsigned int t;
|
||||
data["type"] >> t;
|
||||
ni->type = static_cast<NewsType>(t);
|
||||
data["text"] >> ni->text;
|
||||
data["who"] >> ni->who;
|
||||
data["time"] >> ni->time;
|
||||
|
||||
if (!obj)
|
||||
news_service->AddNewsItem(ni);
|
||||
return ni;
|
||||
}
|
||||
|
||||
#endif // OS_NEWS
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#ifndef OS_SESSION_H
|
||||
#define OS_SESSION_H
|
||||
|
||||
struct Session
|
||||
{
|
||||
cidr addr; /* A cidr (sockaddrs + len) representing this session */
|
||||
unsigned count; /* Number of clients with this host */
|
||||
unsigned hits; /* Number of subsequent kills for a host */
|
||||
|
||||
Session(const Anope::string &ip, int len) : addr(ip, len), count(1), hits(0) { }
|
||||
};
|
||||
|
||||
struct Exception : Serializable
|
||||
{
|
||||
Anope::string mask; /* Hosts to which this exception applies */
|
||||
unsigned limit; /* Session limit for exception */
|
||||
Anope::string who; /* Nick of person who added the exception */
|
||||
Anope::string reason; /* Reason for exception's addition */
|
||||
time_t time; /* When this exception was added */
|
||||
time_t expires; /* Time when it expires. 0 == no expiry */
|
||||
|
||||
Exception() : Serializable("Exception") { }
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
class SessionService : public Service
|
||||
{
|
||||
public:
|
||||
typedef TR1NS::unordered_map<cidr, Session *, cidr::hash> SessionMap;
|
||||
typedef std::vector<Exception *> ExceptionVector;
|
||||
|
||||
SessionService(Module *m) : Service(m, "SessionService", "session") { }
|
||||
|
||||
virtual Exception *CreateException() = 0;
|
||||
|
||||
virtual void AddException(Exception *e) = 0;
|
||||
|
||||
virtual void DelException(Exception *e) = 0;
|
||||
|
||||
virtual Exception *FindException(User *u) = 0;
|
||||
|
||||
virtual Exception *FindException(const Anope::string &host) = 0;
|
||||
|
||||
virtual ExceptionVector &GetExceptions() = 0;
|
||||
|
||||
virtual Session *FindSession(const Anope::string &ip) = 0;
|
||||
|
||||
virtual SessionMap &GetSessions() = 0;
|
||||
};
|
||||
|
||||
static ServiceReference<SessionService> session_service("SessionService", "session");
|
||||
|
||||
void Exception::Serialize(Serialize::Data &data) const
|
||||
{
|
||||
data["mask"] << this->mask;
|
||||
data["limit"] << this->limit;
|
||||
data["who"] << this->who;
|
||||
data["reason"] << this->reason;
|
||||
data["time"] << this->time;
|
||||
data["expires"] << this->expires;
|
||||
}
|
||||
|
||||
Serializable* Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
if (!session_service)
|
||||
return NULL;
|
||||
|
||||
Exception *ex;
|
||||
if (obj)
|
||||
ex = anope_dynamic_static_cast<Exception *>(obj);
|
||||
else
|
||||
ex = new Exception;
|
||||
data["mask"] >> ex->mask;
|
||||
data["limit"] >> ex->limit;
|
||||
data["who"] >> ex->who;
|
||||
data["reason"] >> ex->reason;
|
||||
data["time"] >> ex->time;
|
||||
data["expires"] >> ex->expires;
|
||||
|
||||
if (!obj)
|
||||
session_service->AddException(ex);
|
||||
return ex;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef CHANSERV_H
|
||||
#define CHANSERV_H
|
||||
|
||||
class ChanServService : public Service
|
||||
{
|
||||
public:
|
||||
ChanServService(Module *m) : Service(m, "ChanServService", "ChanServ")
|
||||
{
|
||||
}
|
||||
|
||||
/* Have ChanServ hold the channel, that is, join and set +nsti and wait
|
||||
* for a few minutes so no one can join or rejoin.
|
||||
*/
|
||||
virtual void Hold(Channel *c) = 0;
|
||||
};
|
||||
|
||||
#endif // CHANSERV_H
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef GLOBAL_H
|
||||
#define GLOBAL_H
|
||||
|
||||
class GlobalService : public Service
|
||||
{
|
||||
public:
|
||||
GlobalService(Module *m) : Service(m, "GlobalService", "Global")
|
||||
{
|
||||
}
|
||||
|
||||
/** Send out a global message to all users
|
||||
* @param sender Our client which should send the global
|
||||
* @param source The sender of the global
|
||||
* @param message The message
|
||||
*/
|
||||
virtual void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0;
|
||||
};
|
||||
|
||||
#endif // GLOBAL_H
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef MEMOSERV_H
|
||||
#define MEMOSERV_H
|
||||
|
||||
class MemoServService : public Service
|
||||
{
|
||||
public:
|
||||
enum MemoResult
|
||||
{
|
||||
MEMO_SUCCESS,
|
||||
MEMO_INVALID_TARGET,
|
||||
MEMO_TOO_FAST,
|
||||
MEMO_TARGET_FULL
|
||||
};
|
||||
|
||||
MemoServService(Module *m) : Service(m, "MemoServService", "MemoServ")
|
||||
{
|
||||
}
|
||||
|
||||
/** Sends a memo.
|
||||
* @param source The source of the memo, can be anythin.
|
||||
* @param target The target of the memo, nick or channel.
|
||||
* @param message Memo text
|
||||
* @param force true to force the memo, restrictions/delays etc are not checked
|
||||
*/
|
||||
virtual MemoResult Send(const Anope::string &source, const Anope::string &target, const Anope::string &message, bool force = false) = 0;
|
||||
|
||||
/** Check for new memos and notify the user if there are any
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void Check(User *u) = 0;
|
||||
};
|
||||
|
||||
#endif // MEMOSERV_H
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef NICKSERV_H
|
||||
#define NICKSERV_H
|
||||
|
||||
class NickServService : public Service
|
||||
{
|
||||
public:
|
||||
NickServService(Module *m) : Service(m, "NickServService", "NickServ")
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Validate(User *u) = 0;
|
||||
virtual void Collide(User *u, NickAlias *na) = 0;
|
||||
virtual void Release(NickAlias *na) = 0;
|
||||
};
|
||||
|
||||
#endif // NICKSERV_H
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Redis
|
||||
{
|
||||
struct Reply
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
NOT_PARSED,
|
||||
NOT_OK,
|
||||
OK,
|
||||
INT,
|
||||
BULK,
|
||||
MULTI_BULK
|
||||
}
|
||||
type;
|
||||
|
||||
Reply() { Clear(); }
|
||||
~Reply() { Clear(); }
|
||||
|
||||
void Clear()
|
||||
{
|
||||
type = NOT_PARSED;
|
||||
i = 0;
|
||||
bulk.clear();
|
||||
multi_bulk_size = 0;
|
||||
for (unsigned j = 0; j < multi_bulk.size(); ++j)
|
||||
delete multi_bulk[j];
|
||||
multi_bulk.clear();
|
||||
}
|
||||
|
||||
int64_t i;
|
||||
Anope::string bulk;
|
||||
int multi_bulk_size;
|
||||
std::deque<Reply *> multi_bulk;
|
||||
};
|
||||
|
||||
class Interface
|
||||
{
|
||||
public:
|
||||
Module *owner;
|
||||
|
||||
Interface(Module *m) : owner(m) { }
|
||||
virtual ~Interface() { }
|
||||
|
||||
virtual void OnResult(const Reply &r) = 0;
|
||||
virtual void OnError(const Anope::string &error) { Log(owner) << error; }
|
||||
};
|
||||
|
||||
class Provider : public Service
|
||||
{
|
||||
public:
|
||||
Provider(Module *c, const Anope::string &n) : Service(c, "Redis::Provider", n) { }
|
||||
|
||||
virtual void SendCommand(Interface *i, const std::vector<Anope::string> &cmds) = 0;
|
||||
virtual void SendCommand(Interface *i, const Anope::string &str) = 0;
|
||||
|
||||
virtual bool BlockAndProcess() = 0;
|
||||
|
||||
virtual void Subscribe(Interface *i, const Anope::string &pattern) = 0;
|
||||
virtual void Unsubscribe(const Anope::string &pattern) = 0;
|
||||
|
||||
virtual void StartTransaction() = 0;
|
||||
virtual void CommitTransaction() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
namespace SQL
|
||||
{
|
||||
|
||||
class Data : public Serialize::Data
|
||||
{
|
||||
public:
|
||||
typedef std::map<Anope::string, std::stringstream *> Map;
|
||||
Map data;
|
||||
std::map<Anope::string, Type> types;
|
||||
|
||||
~Data()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
std::iostream& operator[](const Anope::string &key) anope_override
|
||||
{
|
||||
std::stringstream *&ss = data[key];
|
||||
if (!ss)
|
||||
ss = new std::stringstream();
|
||||
return *ss;
|
||||
}
|
||||
|
||||
std::set<Anope::string> KeySet() const anope_override
|
||||
{
|
||||
std::set<Anope::string> keys;
|
||||
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||
keys.insert(it->first);
|
||||
return keys;
|
||||
}
|
||||
|
||||
size_t Hash() const anope_override
|
||||
{
|
||||
size_t hash = 0;
|
||||
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||
if (!it->second->str().empty())
|
||||
hash ^= Anope::hash_cs()(it->second->str());
|
||||
return hash;
|
||||
}
|
||||
|
||||
std::map<Anope::string, std::iostream *> GetData() const
|
||||
{
|
||||
std::map<Anope::string, std::iostream *> d;
|
||||
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||
d[it->first] = it->second;
|
||||
return d;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||
delete it->second;
|
||||
this->data.clear();
|
||||
}
|
||||
|
||||
void SetType(const Anope::string &key, Type t) anope_override
|
||||
{
|
||||
this->types[key] = t;
|
||||
}
|
||||
|
||||
Type GetType(const Anope::string &key) const anope_override
|
||||
{
|
||||
std::map<Anope::string, Type>::const_iterator it = this->types.find(key);
|
||||
if (it != this->types.end())
|
||||
return it->second;
|
||||
return DT_TEXT;
|
||||
}
|
||||
};
|
||||
|
||||
/** A SQL exception, can be thrown at various points
|
||||
*/
|
||||
class Exception : public ModuleException
|
||||
{
|
||||
public:
|
||||
Exception(const Anope::string &reason) : ModuleException(reason) { }
|
||||
|
||||
virtual ~Exception() throw() { }
|
||||
};
|
||||
|
||||
/** A SQL query
|
||||
*/
|
||||
|
||||
struct QueryData
|
||||
{
|
||||
Anope::string data;
|
||||
bool escape;
|
||||
};
|
||||
|
||||
struct Query
|
||||
{
|
||||
Anope::string query;
|
||||
std::map<Anope::string, QueryData> parameters;
|
||||
|
||||
Query() { }
|
||||
Query(const Anope::string &q) : query(q) { }
|
||||
|
||||
Query& operator=(const Anope::string &q)
|
||||
{
|
||||
this->query = q;
|
||||
this->parameters.clear();
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const Query &other) const
|
||||
{
|
||||
return this->query == other.query;
|
||||
}
|
||||
|
||||
inline bool operator!=(const Query &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
template<typename T> void SetValue(const Anope::string &key, const T& value, bool escape = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
Anope::string string_value = stringify(value);
|
||||
this->parameters[key].data = string_value;
|
||||
this->parameters[key].escape = escape;
|
||||
}
|
||||
catch (const ConvertException &ex) { }
|
||||
}
|
||||
};
|
||||
|
||||
/** A result from a SQL query
|
||||
*/
|
||||
class Result
|
||||
{
|
||||
protected:
|
||||
/* Rows, column, item */
|
||||
std::vector<std::map<Anope::string, Anope::string> > entries;
|
||||
Query query;
|
||||
Anope::string error;
|
||||
public:
|
||||
unsigned int id;
|
||||
Anope::string finished_query;
|
||||
|
||||
Result() : id(0) { }
|
||||
Result(unsigned int i, const Query &q, const Anope::string &fq, const Anope::string &err = "") : query(q), error(err), id(i), finished_query(fq) { }
|
||||
|
||||
inline operator bool() const { return this->error.empty(); }
|
||||
|
||||
inline const unsigned int GetID() const { return this->id; }
|
||||
inline const Query &GetQuery() const { return this->query; }
|
||||
inline const Anope::string &GetError() const { return this->error; }
|
||||
|
||||
int Rows() const { return this->entries.size(); }
|
||||
|
||||
const std::map<Anope::string, Anope::string> &Row(size_t index) const
|
||||
{
|
||||
try
|
||||
{
|
||||
return this->entries.at(index);
|
||||
}
|
||||
catch (const std::out_of_range &)
|
||||
{
|
||||
throw Exception("Out of bounds access to SQLResult");
|
||||
}
|
||||
}
|
||||
|
||||
const Anope::string Get(size_t index, const Anope::string &col) const
|
||||
{
|
||||
const std::map<Anope::string, Anope::string> rows = this->Row(index);
|
||||
|
||||
std::map<Anope::string, Anope::string>::const_iterator it = rows.find(col);
|
||||
if (it == rows.end())
|
||||
throw Exception("Unknown column name in SQLResult: " + col);
|
||||
|
||||
return it->second;
|
||||
}
|
||||
};
|
||||
|
||||
/* An interface used by modules to retrieve the results
|
||||
*/
|
||||
class Interface
|
||||
{
|
||||
public:
|
||||
Module *owner;
|
||||
|
||||
Interface(Module *m) : owner(m) { }
|
||||
virtual ~Interface() { }
|
||||
|
||||
virtual void OnResult(const Result &r) = 0;
|
||||
virtual void OnError(const Result &r) = 0;
|
||||
};
|
||||
|
||||
/** Class providing the SQL service, modules call this to execute queries
|
||||
*/
|
||||
class Provider : public Service
|
||||
{
|
||||
public:
|
||||
Provider(Module *c, const Anope::string &n) : Service(c, "SQL::Provider", n) { }
|
||||
|
||||
virtual void Run(Interface *i, const Query &query) = 0;
|
||||
|
||||
virtual Result RunQuery(const Query &query) = 0;
|
||||
|
||||
virtual std::vector<Query> CreateTable(const Anope::string &table, const Data &data) = 0;
|
||||
|
||||
virtual Query BuildInsert(const Anope::string &table, unsigned int id, Data &data) = 0;
|
||||
|
||||
virtual Query GetTables(const Anope::string &prefix) = 0;
|
||||
|
||||
virtual Anope::string FromUnixtime(time_t) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
class SSLService : public Service
|
||||
{
|
||||
public:
|
||||
SSLService(Module *o, const Anope::string &n) : Service(o, n) { }
|
||||
SSLService(Module *o, const Anope::string &n) : Service(o, "SSLService", n) { }
|
||||
|
||||
virtual void Init(Socket *s) = 0;
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
#include "httpd.h"
|
||||
|
||||
class XMLRPCRequest
|
||||
{
|
||||
std::map<Anope::string, Anope::string> replies;
|
||||
|
||||
public:
|
||||
Anope::string name;
|
||||
Anope::string id;
|
||||
std::deque<Anope::string> data;
|
||||
HTTPReply& r;
|
||||
|
||||
XMLRPCRequest(HTTPReply &_r) : r(_r) { }
|
||||
inline void reply(const Anope::string &dname, const Anope::string &ddata) { this->replies.insert(std::make_pair(dname, ddata)); }
|
||||
inline const std::map<Anope::string, Anope::string> &get_replies() { return this->replies; }
|
||||
};
|
||||
|
||||
class XMLRPCServiceInterface;
|
||||
|
||||
class XMLRPCEvent
|
||||
{
|
||||
public:
|
||||
virtual ~XMLRPCEvent() { }
|
||||
virtual bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) = 0;
|
||||
};
|
||||
|
||||
class XMLRPCServiceInterface : public Service
|
||||
{
|
||||
public:
|
||||
XMLRPCServiceInterface(Module *creator, const Anope::string &sname) : Service(creator, "XMLRPCServiceInterface", sname) { }
|
||||
|
||||
virtual void Register(XMLRPCEvent *event) = 0;
|
||||
|
||||
virtual void Unregister(XMLRPCEvent *event) = 0;
|
||||
|
||||
virtual Anope::string Sanitize(const Anope::string &string) = 0;
|
||||
|
||||
virtual void Reply(XMLRPCRequest &request) = 0;
|
||||
};
|
||||
|
||||
@@ -1,232 +0,0 @@
|
||||
/* OperServ support
|
||||
*
|
||||
* (C) 2008-2010 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef OPERSERV_H
|
||||
#define OPERSERV_H
|
||||
|
||||
extern CoreExport std::vector<NewsItem *> News;
|
||||
extern CoreExport std::vector<std::bitset<32> > DefCon;
|
||||
extern CoreExport bool DefConModesSet;
|
||||
extern CoreExport Flags<ChannelModeName, CMODE_END * 2> DefConModesOn;
|
||||
extern CoreExport Flags<ChannelModeName, CMODE_END * 2> DefConModesOff;
|
||||
extern CoreExport std::map<ChannelModeName, Anope::string> DefConModesOnParams;
|
||||
|
||||
class XLineManager;
|
||||
extern CoreExport XLineManager *SGLine;
|
||||
extern CoreExport XLineManager *SZLine;
|
||||
extern CoreExport XLineManager *SQLine;
|
||||
extern CoreExport XLineManager *SNLine;
|
||||
|
||||
extern CoreExport bool SetDefConParam(ChannelModeName, const Anope::string &);
|
||||
extern CoreExport bool GetDefConParam(ChannelModeName, Anope::string &);
|
||||
extern CoreExport void UnsetDefConParam(ChannelModeName);
|
||||
extern CoreExport bool CheckDefCon(DefconLevel Level);
|
||||
extern CoreExport bool CheckDefCon(int level, DefconLevel Level);
|
||||
extern CoreExport void AddDefCon(int level, DefconLevel Level);
|
||||
extern CoreExport void DelDefCon(int level, DefconLevel Level);
|
||||
|
||||
extern CoreExport void os_init();
|
||||
|
||||
extern CoreExport void oper_global(const Anope::string &nick, const char *fmt, ...);
|
||||
extern CoreExport void server_global(const Server *s, const Anope::string &message);
|
||||
|
||||
enum XLineType
|
||||
{
|
||||
X_SNLINE,
|
||||
X_SQLINE,
|
||||
X_SZLINE
|
||||
};
|
||||
|
||||
class CoreExport XLine
|
||||
{
|
||||
public:
|
||||
Anope::string Mask;
|
||||
Anope::string By;
|
||||
time_t Created;
|
||||
time_t Expires;
|
||||
Anope::string Reason;
|
||||
|
||||
XLine(const Anope::string &mask, const Anope::string &reason = "");
|
||||
|
||||
XLine(const Anope::string &mask, const Anope::string &by, const time_t expires, const Anope::string &reason);
|
||||
|
||||
Anope::string GetNick() const;
|
||||
Anope::string GetUser() const;
|
||||
Anope::string GetHost() const;
|
||||
};
|
||||
|
||||
class CoreExport XLineManager
|
||||
{
|
||||
private:
|
||||
/* List of XLine managers we check users against in XLineManager::CheckAll */
|
||||
static std::list<XLineManager *> XLineManagers;
|
||||
|
||||
protected:
|
||||
/* List of XLines in this XLineManager */
|
||||
std::vector<XLine *> XLines;
|
||||
public:
|
||||
/** Constructor
|
||||
*/
|
||||
XLineManager();
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
virtual ~XLineManager();
|
||||
|
||||
/** Register a XLineManager, places it in XLineManagers for use in XLineManager::CheckAll
|
||||
* It is important XLineManagers are registered in the proper order. Eg, if you had one akilling
|
||||
* clients and one handing them free olines, you would want the akilling one first. This way if a client
|
||||
* matches an entry on both of the XLineManagers, they would be akilled.
|
||||
* @param xlm THe XLineManager
|
||||
*/
|
||||
static void RegisterXLineManager(XLineManager *xlm);
|
||||
|
||||
/** Unregister a XLineManager
|
||||
* @param xlm The XLineManager
|
||||
*/
|
||||
static void UnregisterXLineManager(XLineManager *xlm);
|
||||
|
||||
/** Check a user against all known XLineManagers
|
||||
* Wparam u The user
|
||||
* @return A pair of the XLineManager the user was found in and the XLine they matched, both may be NULL for no match
|
||||
*/
|
||||
static std::pair<XLineManager *, XLine *> CheckAll(User *u);
|
||||
|
||||
/** Get the number of XLines in this XLineManager
|
||||
* @return The number of XLines
|
||||
*/
|
||||
size_t GetCount() const;
|
||||
|
||||
/** Get the XLine vector
|
||||
* @return The vector
|
||||
*/
|
||||
const std::vector<XLine *> &GetList() const;
|
||||
|
||||
/** Add an entry to this XLineManager
|
||||
* @param x The entry
|
||||
*/
|
||||
void AddXLine(XLine *x);
|
||||
|
||||
/** Delete an entry from this XLineManager
|
||||
* @param x The entry
|
||||
* @return true if the entry was found and deleted, else false
|
||||
*/
|
||||
bool DelXLine(XLine *x);
|
||||
|
||||
/** Gets an entry by index
|
||||
* @param index The index
|
||||
* @return The XLine, or NULL if the index is out of bounds
|
||||
*/
|
||||
XLine *GetEntry(unsigned index);
|
||||
|
||||
/** Clear the XLine vector
|
||||
*/
|
||||
void Clear();
|
||||
|
||||
/** Add an entry to this XLine Manager
|
||||
* @param bi The bot error replies should be sent from
|
||||
* @param u The user adding the XLine
|
||||
* @param mask The mask of the XLine
|
||||
* @param expires When this should expire
|
||||
* @param reaosn The reason
|
||||
* @return A pointer to the XLine
|
||||
*/
|
||||
virtual XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
|
||||
|
||||
/** Delete an XLine, eg, remove it from the IRCd.
|
||||
* @param x The xline
|
||||
*/
|
||||
virtual void Del(XLine *x);
|
||||
|
||||
/** Checks if a mask can/should be added to the XLineManager
|
||||
* @param mask The mask
|
||||
* @param expires When the mask would expire
|
||||
* @return A pair of int and XLine*.
|
||||
* 1 - Mask already exists
|
||||
* 2 - Mask already exists, but the expiry time was changed
|
||||
* 3 - Mask is already covered by another mask
|
||||
* In each case the XLine it matches/is covered by is returned in XLine*
|
||||
*/
|
||||
std::pair<int, XLine *> CanAdd(const Anope::string &mask, time_t expires);
|
||||
|
||||
/** Checks if this list has an entry
|
||||
* @param mask The mask
|
||||
* @return The XLine the user matches, or NULL
|
||||
*/
|
||||
XLine *HasEntry(const Anope::string &mask);
|
||||
|
||||
/** Check a user against all of the xlines in this XLineManager
|
||||
* @param u The user
|
||||
* @return The xline the user marches, if any. Also calls OnMatch()
|
||||
*/
|
||||
virtual XLine *Check(User *u);
|
||||
|
||||
/** Called when a user matches a xline in this XLineManager
|
||||
* @param u The user
|
||||
* @param x The XLine they match
|
||||
*/
|
||||
virtual void OnMatch(User *u, XLine *x);
|
||||
|
||||
/** Called when an XLine expires
|
||||
* @param x The xline
|
||||
*/
|
||||
virtual void OnExpire(XLine *x);
|
||||
};
|
||||
|
||||
/* This is for AKILLS */
|
||||
class SGLineManager : public XLineManager
|
||||
{
|
||||
public:
|
||||
XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
|
||||
|
||||
void Del(XLine *x);
|
||||
|
||||
void OnMatch(User *u, XLine *x);
|
||||
|
||||
void OnExpire(XLine *x);
|
||||
};
|
||||
|
||||
class SNLineManager : public XLineManager
|
||||
{
|
||||
public:
|
||||
XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
|
||||
|
||||
void Del(XLine *x);
|
||||
|
||||
void OnMatch(User *u, XLine *x);
|
||||
|
||||
void OnExpire(XLine *x);
|
||||
};
|
||||
|
||||
class SQLineManager : public XLineManager
|
||||
{
|
||||
public:
|
||||
XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
|
||||
|
||||
void Del(XLine *x);
|
||||
|
||||
void OnMatch(User *u, XLine *x);
|
||||
|
||||
void OnExpire(XLine *x);
|
||||
|
||||
static bool Check(Channel *c);
|
||||
};
|
||||
|
||||
class SZLineManager : public XLineManager
|
||||
{
|
||||
public:
|
||||
XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
|
||||
|
||||
void Del(XLine *x);
|
||||
|
||||
void OnMatch(User *u, XLine *x);
|
||||
|
||||
void OnExpire(XLine *x);
|
||||
};
|
||||
|
||||
#endif // OPERSERV_H
|
||||
+54
-3
@@ -1,14 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2010 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OPERTYPE_H
|
||||
#define OPERTYPE_H
|
||||
|
||||
#include "hashcomp.h"
|
||||
#include "services.h"
|
||||
#include "account.h"
|
||||
|
||||
/* A services operator. Usually made by the configuration file, but not always.
|
||||
* NickAlias::Find(name)->nc->o == this
|
||||
*/
|
||||
struct CoreExport Oper
|
||||
{
|
||||
/* The oper's nick */
|
||||
Anope::string name;
|
||||
/* The type of operator this operator is */
|
||||
OperType *ot;
|
||||
/* Whether the user must be an IRC operator (umode +o) to be considered a services operator */
|
||||
bool require_oper;
|
||||
Anope::string password;
|
||||
Anope::string certfp;
|
||||
/* Hosts allowed to use this operator block */
|
||||
std::vector<Anope::string> hosts;
|
||||
Anope::string vhost;
|
||||
|
||||
Oper(const Anope::string &n, OperType *o);
|
||||
virtual ~Oper();
|
||||
|
||||
static std::vector<Oper *> opers;
|
||||
|
||||
/** Find an oper block by name
|
||||
* @param name The name
|
||||
* @return the oper block
|
||||
*/
|
||||
static Oper *Find(const Anope::string &name);
|
||||
};
|
||||
|
||||
class CoreExport OperType
|
||||
{
|
||||
@@ -36,6 +67,16 @@ class CoreExport OperType
|
||||
*/
|
||||
std::set<OperType *> inheritances;
|
||||
public:
|
||||
/** Modes to set when someone identifys using this opertype
|
||||
*/
|
||||
Anope::string modes;
|
||||
|
||||
/** Find an oper type by name
|
||||
* @param name The name
|
||||
* @return The oper type
|
||||
*/
|
||||
static OperType *Find(const Anope::string &name);
|
||||
|
||||
/** Create a new opertype of the given name.
|
||||
* @param nname The opertype name, e.g. "sra".
|
||||
*/
|
||||
@@ -71,6 +112,16 @@ class CoreExport OperType
|
||||
* @param ot The opertype to inherit from
|
||||
*/
|
||||
void Inherits(OperType *ot);
|
||||
|
||||
/** Gets the icommands for this opertype
|
||||
* @return A list of commands
|
||||
*/
|
||||
const std::list<Anope::string> GetCommands() const;
|
||||
|
||||
/** Gets the privileges for this opertype
|
||||
* @return A list of privileges
|
||||
*/
|
||||
const std::list<Anope::string> GetPrivs() const;
|
||||
};
|
||||
|
||||
#endif // OPERTYPE_H
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PROTOCOL_H
|
||||
#define PROTOCOL_H
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
#include "service.h"
|
||||
|
||||
/* Encapsultes the IRCd protocol we are speaking. */
|
||||
class CoreExport IRCDProto : public Service
|
||||
{
|
||||
Anope::string proto_name;
|
||||
|
||||
protected:
|
||||
IRCDProto(Module *creator, const Anope::string &proto_name);
|
||||
public:
|
||||
virtual ~IRCDProto();
|
||||
|
||||
virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &);
|
||||
virtual void SendModeInternal(const MessageSource &, const Channel *, const Anope::string &);
|
||||
virtual void SendModeInternal(const MessageSource &, User *, const Anope::string &);
|
||||
virtual void SendKickInternal(const MessageSource &, const Channel *, User *, const Anope::string &);
|
||||
virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg);
|
||||
virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
||||
virtual void SendQuitInternal(User *, const Anope::string &buf);
|
||||
virtual void SendPartInternal(User *, const Channel *chan, const Anope::string &buf);
|
||||
virtual void SendGlobopsInternal(const MessageSource &, const Anope::string &buf);
|
||||
virtual void SendCTCPInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
||||
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf);
|
||||
|
||||
const Anope::string &GetProtocolName();
|
||||
/* Modes used by default by our clients */
|
||||
Anope::string DefaultPseudoclientModes;
|
||||
/* Can we force change a users's nick? */
|
||||
bool CanSVSNick;
|
||||
/* Can we force join or part users? */
|
||||
bool CanSVSJoin;
|
||||
/* Can we set vhosts/vidents on users? */
|
||||
bool CanSetVHost, CanSetVIdent;
|
||||
/* Can we ban specific gecos from being used? */
|
||||
bool CanSNLine;
|
||||
/* Can we ban specific nicknames from being used? */
|
||||
bool CanSQLine;
|
||||
/* Can we ban sepcific channel names from being used? */
|
||||
bool CanSQLineChannel;
|
||||
/* Can we ban by IP? */
|
||||
bool CanSZLine;
|
||||
/* Can we place temporary holds on specific nicknames? */
|
||||
bool CanSVSHold;
|
||||
/* See os_oline */
|
||||
bool CanSVSO;
|
||||
/* See ns_cert */
|
||||
bool CanCertFP;
|
||||
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
|
||||
bool RequiresID;
|
||||
/* The maximum number of modes we are allowed to set with one MODE command */
|
||||
unsigned MaxModes;
|
||||
/* The maximum number of bytes a line may have */
|
||||
unsigned MaxLine;
|
||||
|
||||
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
|
||||
* will be able to oper on the server.
|
||||
* @param s The server
|
||||
* @param mode Whether to turn NOOP on or off
|
||||
*/
|
||||
virtual void SendSVSNOOP(const Server *s, bool mode) { }
|
||||
|
||||
/** Sets the topic on a channel
|
||||
* @param bi The bot to set the topic from
|
||||
* @param c The channel to set the topic on. The topic being set is Channel::topic
|
||||
*/
|
||||
virtual void SendTopic(const MessageSource &, Channel *);
|
||||
|
||||
/** Sets a vhost on a user.
|
||||
* @param u The user
|
||||
* @param vident The ident to set
|
||||
* @param vhost The vhost to set
|
||||
*/
|
||||
virtual void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) { }
|
||||
virtual void SendVhostDel(User *) { }
|
||||
|
||||
/** Sets an akill. This is a recursive function that can be called multiple times
|
||||
* for the same xline, but for different users, if the xline is not one that can be
|
||||
* enforced by the IRCd, such as a nick/user/host/realname combination ban.
|
||||
* @param u The user affected by the akill, if known
|
||||
* @param x The akill
|
||||
*/
|
||||
virtual void SendAkill(User *, XLine *) = 0;
|
||||
virtual void SendAkillDel(const XLine *) = 0;
|
||||
|
||||
/* Realname ban */
|
||||
virtual void SendSGLine(User *, const XLine *) { }
|
||||
virtual void SendSGLineDel(const XLine *) { }
|
||||
|
||||
/* IP ban */
|
||||
virtual void SendSZLine(User *u, const XLine *) { }
|
||||
virtual void SendSZLineDel(const XLine *) { }
|
||||
|
||||
/* Nick ban (and sometimes channel) */
|
||||
virtual void SendSQLine(User *, const XLine *x) { }
|
||||
virtual void SendSQLineDel(const XLine *x) { }
|
||||
|
||||
/** Kills a user
|
||||
* @param source Who is doing the kill
|
||||
* @param user The user to be killed
|
||||
* @param fmt Kill reason
|
||||
*/
|
||||
virtual void SendSVSKill(const MessageSource &source, User *user, const char *fmt, ...);
|
||||
|
||||
virtual void SendMode(const MessageSource &source, const Channel *dest, const char *fmt, ...);
|
||||
virtual void SendMode(const MessageSource &source, User *u, const char *fmt, ...);
|
||||
|
||||
/** Introduces a client to the rest of the network
|
||||
* @param u The client to introduce
|
||||
*/
|
||||
virtual void SendClientIntroduction(User *u) = 0;
|
||||
|
||||
virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const char *fmt, ...);
|
||||
|
||||
virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||
|
||||
virtual void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) = 0;
|
||||
virtual void SendGlobalPrivmsg(BotInfo *bi, const Server *desc, const Anope::string &msg) = 0;
|
||||
|
||||
virtual void SendQuit(User *u, const char *fmt, ...);
|
||||
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
|
||||
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
|
||||
|
||||
/** Joins one of our users to a channel.
|
||||
* @param u The user to join
|
||||
* @param c The channel to join the user to
|
||||
* @param status The status to set on the user after joining. This may or may not already internally
|
||||
* be set on the user. This may include the modes in the join, but will usually place them on the mode
|
||||
* stacker to be set "soon".
|
||||
*/
|
||||
virtual void SendJoin(User *u, Channel *c, const ChannelStatus *status) = 0;
|
||||
virtual void SendPart(User *u, const Channel *chan, const char *fmt, ...);
|
||||
|
||||
/** Force joins a user that isn't ours to a channel.
|
||||
* @param bi The source of the message
|
||||
* @param u The user to join
|
||||
* @param chan The channel to join the user to
|
||||
* @param param Channel key?
|
||||
*/
|
||||
virtual void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
||||
|
||||
/** Force parts a user that isn't ours from a channel.
|
||||
* @param source The source of the message
|
||||
* @param u The user to part
|
||||
* @param chan The channel to part the user from
|
||||
* @param param part reason, some IRCds don't support this
|
||||
*/
|
||||
virtual void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
||||
|
||||
virtual void SendInvite(const MessageSource &source, const Channel *c, User *u);
|
||||
virtual void SendGlobops(const MessageSource &source, const char *fmt, ...);
|
||||
|
||||
/** Sets oper flags on a user, currently only supported by Unreal
|
||||
*/
|
||||
virtual void SendSVSO(BotInfo *, const Anope::string &, const Anope::string &) { }
|
||||
|
||||
/** Sends a nick change of one of our clients.
|
||||
*/
|
||||
virtual void SendNickChange(User *u, const Anope::string &newnick);
|
||||
|
||||
/** Forces a nick change of a user that isn't ours (SVSNICK)
|
||||
*/
|
||||
virtual void SendForceNickChange(User *u, const Anope::string &newnick, time_t when);
|
||||
|
||||
/** Used to introduce ourselves to our uplink. Usually will SendServer(Me) and any other
|
||||
* initial handshake requirements.
|
||||
*/
|
||||
virtual void SendConnect() = 0;
|
||||
|
||||
/** Called right before we begin our burst, after we have handshaked successfully with the uplink/
|
||||
* At this point none of our servesr, users, or channels exist on the uplink
|
||||
*/
|
||||
virtual void SendBOB() { }
|
||||
virtual void SendEOB() { }
|
||||
|
||||
virtual void SendSVSHold(const Anope::string &, time_t) { }
|
||||
virtual void SendSVSHoldDel(const Anope::string &) { }
|
||||
|
||||
virtual void SendSWhois(const MessageSource &, const Anope::string &, const Anope::string &) { }
|
||||
|
||||
/** Introduces a server to the uplink
|
||||
*/
|
||||
virtual void SendServer(const Server *) = 0;
|
||||
virtual void SendSquit(Server *, const Anope::string &message);
|
||||
|
||||
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...);
|
||||
|
||||
virtual void SendLogin(User *u) = 0;
|
||||
virtual void SendLogout(User *u) = 0;
|
||||
|
||||
/** Send a channel creation message to the uplink.
|
||||
* On most TS6 IRCds this is a SJOIN with no nick
|
||||
*/
|
||||
virtual void SendChannel(Channel *c) { }
|
||||
|
||||
/** Make the user an IRC operator
|
||||
* Normally this is a simple +o, though some IRCds require us to send the oper type
|
||||
*/
|
||||
virtual void SendOper(User *u);
|
||||
|
||||
virtual bool IsNickValid(const Anope::string &);
|
||||
virtual bool IsChannelValid(const Anope::string &);
|
||||
virtual bool IsIdentValid(const Anope::string &);
|
||||
virtual bool IsHostValid(const Anope::string &);
|
||||
virtual bool IsExtbanValid(const Anope::string &) { return false; }
|
||||
|
||||
/** Retrieve the maximum number of list modes settable on this channel
|
||||
* Defaults to Config->ListSize
|
||||
*/
|
||||
virtual unsigned GetMaxListFor(Channel *c);
|
||||
};
|
||||
|
||||
class CoreExport MessageSource
|
||||
{
|
||||
Anope::string source;
|
||||
User *u;
|
||||
Server *s;
|
||||
|
||||
public:
|
||||
MessageSource(const Anope::string &);
|
||||
MessageSource(User *u);
|
||||
MessageSource(Server *s);
|
||||
const Anope::string &GetName() const;
|
||||
const Anope::string &GetSource() const;
|
||||
User *GetUser() const;
|
||||
BotInfo *GetBot() const;
|
||||
Server *GetServer() const;
|
||||
};
|
||||
|
||||
enum IRCDMessageFlag
|
||||
{
|
||||
IRCDMESSAGE_SOFT_LIMIT,
|
||||
IRCDMESSAGE_REQUIRE_SERVER,
|
||||
IRCDMESSAGE_REQUIRE_USER
|
||||
};
|
||||
|
||||
class CoreExport IRCDMessage : public Service
|
||||
{
|
||||
Anope::string name;
|
||||
unsigned param_count;
|
||||
std::set<IRCDMessageFlag> flags;
|
||||
public:
|
||||
IRCDMessage(Module *owner, const Anope::string &n, unsigned p = 0);
|
||||
unsigned GetParamCount() const;
|
||||
virtual void Run(MessageSource &, const std::vector<Anope::string> ¶ms) = 0;
|
||||
|
||||
void SetFlag(IRCDMessageFlag f) { flags.insert(f); }
|
||||
bool HasFlag(IRCDMessageFlag f) const { return flags.count(f); }
|
||||
};
|
||||
|
||||
extern CoreExport IRCDProto *IRCD;
|
||||
|
||||
#endif // PROTOCOL_H
|
||||
@@ -0,0 +1,800 @@
|
||||
/* A portable stdint.h
|
||||
****************************************************************************
|
||||
* BSD License:
|
||||
****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2005-2011 Paul Hsieh
|
||||
* 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 BY THE AUTHOR ``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.
|
||||
*
|
||||
****************************************************************************
|
||||
*
|
||||
* Version 0.1.12
|
||||
*
|
||||
* The ANSI C standard committee, for the C99 standard, specified the
|
||||
* inclusion of a new standard include file called stdint.h. This is
|
||||
* a very useful and long desired include file which contains several
|
||||
* very precise definitions for integer scalar types that is
|
||||
* critically important for making portable several classes of
|
||||
* applications including cryptography, hashing, variable length
|
||||
* integer libraries and so on. But for most developers its likely
|
||||
* useful just for programming sanity.
|
||||
*
|
||||
* The problem is that most compiler vendors have decided not to
|
||||
* implement the C99 standard, and the next C++ language standard
|
||||
* (which has a lot more mindshare these days) will be a long time in
|
||||
* coming and its unknown whether or not it will include stdint.h or
|
||||
* how much adoption it will have. Either way, it will be a long time
|
||||
* before all compilers come with a stdint.h and it also does nothing
|
||||
* for the extremely large number of compilers available today which
|
||||
* do not include this file, or anything comparable to it.
|
||||
*
|
||||
* So that's what this file is all about. Its an attempt to build a
|
||||
* single universal include file that works on as many platforms as
|
||||
* possible to deliver what stdint.h is supposed to. A few things
|
||||
* that should be noted about this file:
|
||||
*
|
||||
* 1) It is not guaranteed to be portable and/or present an identical
|
||||
* interface on all platforms. The extreme variability of the
|
||||
* ANSI C standard makes this an impossibility right from the
|
||||
* very get go. Its really only meant to be useful for the vast
|
||||
* majority of platforms that possess the capability of
|
||||
* implementing usefully and precisely defined, standard sized
|
||||
* integer scalars. Systems which are not intrinsically 2s
|
||||
* complement may produce invalid constants.
|
||||
*
|
||||
* 2) There is an unavoidable use of non-reserved symbols.
|
||||
*
|
||||
* 3) Other standard include files are invoked.
|
||||
*
|
||||
* 4) This file may come in conflict with future platforms that do
|
||||
* include stdint.h. The hope is that one or the other can be
|
||||
* used with no real difference.
|
||||
*
|
||||
* 5) In the current verison, if your platform can't represent
|
||||
* int32_t, int16_t and int8_t, it just dumps out with a compiler
|
||||
* error.
|
||||
*
|
||||
* 6) 64 bit integers may or may not be defined. Test for their
|
||||
* presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
|
||||
* Note that this is different from the C99 specification which
|
||||
* requires the existence of 64 bit support in the compiler. If
|
||||
* this is not defined for your platform, yet it is capable of
|
||||
* dealing with 64 bits then it is because this file has not yet
|
||||
* been extended to cover all of your system's capabilities.
|
||||
*
|
||||
* 7) (u)intptr_t may or may not be defined. Test for its presence
|
||||
* with the test: #ifdef PTRDIFF_MAX. If this is not defined
|
||||
* for your platform, then it is because this file has not yet
|
||||
* been extended to cover all of your system's capabilities, not
|
||||
* because its optional.
|
||||
*
|
||||
* 8) The following might not been defined even if your platform is
|
||||
* capable of defining it:
|
||||
*
|
||||
* WCHAR_MIN
|
||||
* WCHAR_MAX
|
||||
* (u)int64_t
|
||||
* PTRDIFF_MIN
|
||||
* PTRDIFF_MAX
|
||||
* (u)intptr_t
|
||||
*
|
||||
* 9) The following have not been defined:
|
||||
*
|
||||
* WINT_MIN
|
||||
* WINT_MAX
|
||||
*
|
||||
* 10) The criteria for defining (u)int_least(*)_t isn't clear,
|
||||
* except for systems which don't have a type that precisely
|
||||
* defined 8, 16, or 32 bit types (which this include file does
|
||||
* not support anyways). Default definitions have been given.
|
||||
*
|
||||
* 11) The criteria for defining (u)int_fast(*)_t isn't something I
|
||||
* would trust to any particular compiler vendor or the ANSI C
|
||||
* committee. It is well known that "compatible systems" are
|
||||
* commonly created that have very different performance
|
||||
* characteristics from the systems they are compatible with,
|
||||
* especially those whose vendors make both the compiler and the
|
||||
* system. Default definitions have been given, but its strongly
|
||||
* recommended that users never use these definitions for any
|
||||
* reason (they do *NOT* deliver any serious guarantee of
|
||||
* improved performance -- not in this file, nor any vendor's
|
||||
* stdint.h).
|
||||
*
|
||||
* 12) The following macros:
|
||||
*
|
||||
* PRINTF_INTMAX_MODIFIER
|
||||
* PRINTF_INT64_MODIFIER
|
||||
* PRINTF_INT32_MODIFIER
|
||||
* PRINTF_INT16_MODIFIER
|
||||
* PRINTF_LEAST64_MODIFIER
|
||||
* PRINTF_LEAST32_MODIFIER
|
||||
* PRINTF_LEAST16_MODIFIER
|
||||
* PRINTF_INTPTR_MODIFIER
|
||||
*
|
||||
* are strings which have been defined as the modifiers required
|
||||
* for the "d", "u" and "x" printf formats to correctly output
|
||||
* (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
|
||||
* (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
|
||||
* PRINTF_INTPTR_MODIFIER is not defined for some systems which
|
||||
* provide their own stdint.h. PRINTF_INT64_MODIFIER is not
|
||||
* defined if INT64_MAX is not defined. These are an extension
|
||||
* beyond what C99 specifies must be in stdint.h.
|
||||
*
|
||||
* In addition, the following macros are defined:
|
||||
*
|
||||
* PRINTF_INTMAX_HEX_WIDTH
|
||||
* PRINTF_INT64_HEX_WIDTH
|
||||
* PRINTF_INT32_HEX_WIDTH
|
||||
* PRINTF_INT16_HEX_WIDTH
|
||||
* PRINTF_INT8_HEX_WIDTH
|
||||
* PRINTF_INTMAX_DEC_WIDTH
|
||||
* PRINTF_INT64_DEC_WIDTH
|
||||
* PRINTF_INT32_DEC_WIDTH
|
||||
* PRINTF_INT16_DEC_WIDTH
|
||||
* PRINTF_INT8_DEC_WIDTH
|
||||
*
|
||||
* Which specifies the maximum number of characters required to
|
||||
* print the number of that type in either hexadecimal or decimal.
|
||||
* These are an extension beyond what C99 specifies must be in
|
||||
* stdint.h.
|
||||
*
|
||||
* Compilers tested (all with 0 warnings at their highest respective
|
||||
* settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
|
||||
* bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
|
||||
* .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
|
||||
*
|
||||
* This file should be considered a work in progress. Suggestions for
|
||||
* improvements, especially those which increase coverage are strongly
|
||||
* encouraged.
|
||||
*
|
||||
* Acknowledgements
|
||||
*
|
||||
* The following people have made significant contributions to the
|
||||
* development and testing of this file:
|
||||
*
|
||||
* Chris Howie
|
||||
* John Steele Scott
|
||||
* Dave Thorup
|
||||
* John Dill
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
|
||||
/*
|
||||
* For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
|
||||
* do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
|
||||
*/
|
||||
|
||||
#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED)
|
||||
#include <stdint.h>
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INT64_HEX_WIDTH "16"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_HEX_WIDTH
|
||||
# define PRINTF_INT32_HEX_WIDTH "8"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_HEX_WIDTH
|
||||
# define PRINTF_INT16_HEX_WIDTH "4"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
# endif
|
||||
# ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "20"
|
||||
# endif
|
||||
# ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
# endif
|
||||
# ifndef PRINTF_INT16_DEC_WIDTH
|
||||
# define PRINTF_INT16_DEC_WIDTH "5"
|
||||
# endif
|
||||
# ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Something really weird is going on with Open Watcom. Just pull some of
|
||||
* these duplicated definitions from Open Watcom's stdint.h file for now.
|
||||
*/
|
||||
|
||||
# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
|
||||
# if !defined (INT64_C)
|
||||
# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
|
||||
# endif
|
||||
# if !defined (UINT64_C)
|
||||
# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
|
||||
# endif
|
||||
# if !defined (INT32_C)
|
||||
# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
|
||||
# endif
|
||||
# if !defined (UINT32_C)
|
||||
# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
|
||||
# endif
|
||||
# if !defined (INT16_C)
|
||||
# define INT16_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT16_C)
|
||||
# define UINT16_C(x) (x)
|
||||
# endif
|
||||
# if !defined (INT8_C)
|
||||
# define INT8_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT8_C)
|
||||
# define UINT8_C(x) (x)
|
||||
# endif
|
||||
# if !defined (UINT64_MAX)
|
||||
# define UINT64_MAX 18446744073709551615ULL
|
||||
# endif
|
||||
# if !defined (INT64_MAX)
|
||||
# define INT64_MAX 9223372036854775807LL
|
||||
# endif
|
||||
# if !defined (UINT32_MAX)
|
||||
# define UINT32_MAX 4294967295UL
|
||||
# endif
|
||||
# if !defined (INT32_MAX)
|
||||
# define INT32_MAX 2147483647L
|
||||
# endif
|
||||
# if !defined (INTMAX_MAX)
|
||||
# define INTMAX_MAX INT64_MAX
|
||||
# endif
|
||||
# if !defined (INTMAX_MIN)
|
||||
# define INTMAX_MIN INT64_MIN
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef _PSTDINT_H_INCLUDED
|
||||
#define _PSTDINT_H_INCLUDED
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX (~(size_t)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Deduce the type assignments from limits.h under the assumption that
|
||||
* integer sizes in bits are powers of 2, and follow the ANSI
|
||||
* definitions.
|
||||
*/
|
||||
|
||||
#ifndef UINT8_MAX
|
||||
# define UINT8_MAX 0xff
|
||||
#endif
|
||||
#ifndef uint8_t
|
||||
# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned char uint8_t;
|
||||
# define UINT8_C(v) ((uint8_t) v)
|
||||
# else
|
||||
# error "Platform not supported"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef INT8_MAX
|
||||
# define INT8_MAX 0x7f
|
||||
#endif
|
||||
#ifndef INT8_MIN
|
||||
# define INT8_MIN INT8_C(0x80)
|
||||
#endif
|
||||
#ifndef int8_t
|
||||
# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed char int8_t;
|
||||
# define INT8_C(v) ((int8_t) v)
|
||||
# else
|
||||
# error "Platform not supported"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_MAX
|
||||
# define UINT16_MAX 0xffff
|
||||
#endif
|
||||
#ifndef uint16_t
|
||||
#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned int uint16_t;
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER ""
|
||||
# endif
|
||||
# define UINT16_C(v) ((uint16_t) (v))
|
||||
#elif (USHRT_MAX == UINT16_MAX)
|
||||
typedef unsigned short uint16_t;
|
||||
# define UINT16_C(v) ((uint16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT16_MAX
|
||||
# define INT16_MAX 0x7fff
|
||||
#endif
|
||||
#ifndef INT16_MIN
|
||||
# define INT16_MIN INT16_C(0x8000)
|
||||
#endif
|
||||
#ifndef int16_t
|
||||
#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed int int16_t;
|
||||
# define INT16_C(v) ((int16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER ""
|
||||
# endif
|
||||
#elif (SHRT_MAX == INT16_MAX)
|
||||
typedef signed short int16_t;
|
||||
# define INT16_C(v) ((int16_t) (v))
|
||||
# ifndef PRINTF_INT16_MODIFIER
|
||||
# define PRINTF_INT16_MODIFIER "h"
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
# define UINT32_MAX (0xffffffffUL)
|
||||
#endif
|
||||
#ifndef uint32_t
|
||||
#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef unsigned long uint32_t;
|
||||
# define UINT32_C(v) v ## UL
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
#elif (UINT_MAX == UINT32_MAX)
|
||||
typedef unsigned int uint32_t;
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
# define UINT32_C(v) v ## U
|
||||
#elif (USHRT_MAX == UINT32_MAX)
|
||||
typedef unsigned short uint32_t;
|
||||
# define UINT32_C(v) ((unsigned short) (v))
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef INT32_MAX
|
||||
# define INT32_MAX (0x7fffffffL)
|
||||
#endif
|
||||
#ifndef INT32_MIN
|
||||
# define INT32_MIN INT32_C(0x80000000)
|
||||
#endif
|
||||
#ifndef int32_t
|
||||
#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
|
||||
typedef signed long int32_t;
|
||||
# define INT32_C(v) v ## L
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER "l"
|
||||
# endif
|
||||
#elif (INT_MAX == INT32_MAX)
|
||||
typedef signed int int32_t;
|
||||
# define INT32_C(v) v
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#elif (SHRT_MAX == INT32_MAX)
|
||||
typedef signed short int32_t;
|
||||
# define INT32_C(v) ((short) (v))
|
||||
# ifndef PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_INT32_MODIFIER ""
|
||||
# endif
|
||||
#else
|
||||
#error "Platform not supported"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The macro stdint_int64_defined is temporarily used to record
|
||||
* whether or not 64 integer support is available. It must be
|
||||
* defined for any 64 integer extensions for new platforms that are
|
||||
* added.
|
||||
*/
|
||||
|
||||
#undef stdint_int64_defined
|
||||
#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
|
||||
# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S)
|
||||
# define stdint_int64_defined
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined (stdint_int64_defined)
|
||||
# if defined(__GNUC__)
|
||||
# define stdint_int64_defined
|
||||
__extension__ typedef long long int64_t;
|
||||
__extension__ typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
|
||||
# define stdint_int64_defined
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# define UINT64_C(v) v ## ULL
|
||||
# define INT64_C(v) v ## LL
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "ll"
|
||||
# endif
|
||||
# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
|
||||
# define stdint_int64_defined
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
# define UINT64_C(v) v ## UI64
|
||||
# define INT64_C(v) v ## I64
|
||||
# ifndef PRINTF_INT64_MODIFIER
|
||||
# define PRINTF_INT64_MODIFIER "I64"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined (LONG_LONG_MAX) && defined (INT64_C)
|
||||
# define LONG_LONG_MAX INT64_C (9223372036854775807)
|
||||
#endif
|
||||
#ifndef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
|
||||
#endif
|
||||
|
||||
#if !defined (INT64_MAX) && defined (INT64_C)
|
||||
# define INT64_MAX INT64_C (9223372036854775807)
|
||||
#endif
|
||||
#if !defined (INT64_MIN) && defined (INT64_C)
|
||||
# define INT64_MIN INT64_C (-9223372036854775808)
|
||||
#endif
|
||||
#if !defined (UINT64_MAX) && defined (INT64_C)
|
||||
# define UINT64_MAX UINT64_C (18446744073709551615)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Width of hexadecimal for number field.
|
||||
*/
|
||||
|
||||
#ifndef PRINTF_INT64_HEX_WIDTH
|
||||
# define PRINTF_INT64_HEX_WIDTH "16"
|
||||
#endif
|
||||
#ifndef PRINTF_INT32_HEX_WIDTH
|
||||
# define PRINTF_INT32_HEX_WIDTH "8"
|
||||
#endif
|
||||
#ifndef PRINTF_INT16_HEX_WIDTH
|
||||
# define PRINTF_INT16_HEX_WIDTH "4"
|
||||
#endif
|
||||
#ifndef PRINTF_INT8_HEX_WIDTH
|
||||
# define PRINTF_INT8_HEX_WIDTH "2"
|
||||
#endif
|
||||
|
||||
#ifndef PRINTF_INT64_DEC_WIDTH
|
||||
# define PRINTF_INT64_DEC_WIDTH "20"
|
||||
#endif
|
||||
#ifndef PRINTF_INT32_DEC_WIDTH
|
||||
# define PRINTF_INT32_DEC_WIDTH "10"
|
||||
#endif
|
||||
#ifndef PRINTF_INT16_DEC_WIDTH
|
||||
# define PRINTF_INT16_DEC_WIDTH "5"
|
||||
#endif
|
||||
#ifndef PRINTF_INT8_DEC_WIDTH
|
||||
# define PRINTF_INT8_DEC_WIDTH "3"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ok, lets not worry about 128 bit integers for now. Moore's law says
|
||||
* we don't need to worry about that until about 2040 at which point
|
||||
* we'll have bigger things to worry about.
|
||||
*/
|
||||
|
||||
#ifdef stdint_int64_defined
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
# define INTMAX_MAX INT64_MAX
|
||||
# define INTMAX_MIN INT64_MIN
|
||||
# define UINTMAX_MAX UINT64_MAX
|
||||
# define UINTMAX_C(v) UINT64_C(v)
|
||||
# define INTMAX_C(v) INT64_C(v)
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
|
||||
# endif
|
||||
#else
|
||||
typedef int32_t intmax_t;
|
||||
typedef uint32_t uintmax_t;
|
||||
# define INTMAX_MAX INT32_MAX
|
||||
# define UINTMAX_MAX UINT32_MAX
|
||||
# define UINTMAX_C(v) UINT32_C(v)
|
||||
# define INTMAX_C(v) INT32_C(v)
|
||||
# ifndef PRINTF_INTMAX_MODIFIER
|
||||
# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_HEX_WIDTH
|
||||
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
|
||||
# endif
|
||||
# ifndef PRINTF_INTMAX_DEC_WIDTH
|
||||
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Because this file currently only supports platforms which have
|
||||
* precise powers of 2 as bit sizes for the default integers, the
|
||||
* least definitions are all trivial. Its possible that a future
|
||||
* version of this file could have different definitions.
|
||||
*/
|
||||
|
||||
#ifndef stdint_least_defined
|
||||
typedef int8_t int_least8_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
|
||||
# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
|
||||
# define UINT_LEAST8_MAX UINT8_MAX
|
||||
# define INT_LEAST8_MAX INT8_MAX
|
||||
# define UINT_LEAST16_MAX UINT16_MAX
|
||||
# define INT_LEAST16_MAX INT16_MAX
|
||||
# define UINT_LEAST32_MAX UINT32_MAX
|
||||
# define INT_LEAST32_MAX INT32_MAX
|
||||
# define INT_LEAST8_MIN INT8_MIN
|
||||
# define INT_LEAST16_MIN INT16_MIN
|
||||
# define INT_LEAST32_MIN INT32_MIN
|
||||
# ifdef stdint_int64_defined
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
|
||||
# define UINT_LEAST64_MAX UINT64_MAX
|
||||
# define INT_LEAST64_MAX INT64_MAX
|
||||
# define INT_LEAST64_MIN INT64_MIN
|
||||
# endif
|
||||
#endif
|
||||
#undef stdint_least_defined
|
||||
|
||||
/*
|
||||
* The ANSI C committee pretending to know or specify anything about
|
||||
* performance is the epitome of misguided arrogance. The mandate of
|
||||
* this file is to *ONLY* ever support that absolute minimum
|
||||
* definition of the fast integer types, for compatibility purposes.
|
||||
* No extensions, and no attempt to suggest what may or may not be a
|
||||
* faster integer type will ever be made in this file. Developers are
|
||||
* warned to stay away from these types when using this or any other
|
||||
* stdint.h.
|
||||
*/
|
||||
|
||||
typedef int_least8_t int_fast8_t;
|
||||
typedef uint_least8_t uint_fast8_t;
|
||||
typedef int_least16_t int_fast16_t;
|
||||
typedef uint_least16_t uint_fast16_t;
|
||||
typedef int_least32_t int_fast32_t;
|
||||
typedef uint_least32_t uint_fast32_t;
|
||||
#define UINT_FAST8_MAX UINT_LEAST8_MAX
|
||||
#define INT_FAST8_MAX INT_LEAST8_MAX
|
||||
#define UINT_FAST16_MAX UINT_LEAST16_MAX
|
||||
#define INT_FAST16_MAX INT_LEAST16_MAX
|
||||
#define UINT_FAST32_MAX UINT_LEAST32_MAX
|
||||
#define INT_FAST32_MAX INT_LEAST32_MAX
|
||||
#define INT_FAST8_MIN INT_LEAST8_MIN
|
||||
#define INT_FAST16_MIN INT_LEAST16_MIN
|
||||
#define INT_FAST32_MIN INT_LEAST32_MIN
|
||||
#ifdef stdint_int64_defined
|
||||
typedef int_least64_t int_fast64_t;
|
||||
typedef uint_least64_t uint_fast64_t;
|
||||
# define UINT_FAST64_MAX UINT_LEAST64_MAX
|
||||
# define INT_FAST64_MAX INT_LEAST64_MAX
|
||||
# define INT_FAST64_MIN INT_LEAST64_MIN
|
||||
#endif
|
||||
|
||||
#undef stdint_int64_defined
|
||||
|
||||
/*
|
||||
* Whatever piecemeal, per compiler thing we can do about the wchar_t
|
||||
* type limits.
|
||||
*/
|
||||
|
||||
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__)
|
||||
# include <wchar.h>
|
||||
# ifndef WCHAR_MIN
|
||||
# define WCHAR_MIN 0
|
||||
# endif
|
||||
# ifndef WCHAR_MAX
|
||||
# define WCHAR_MAX ((wchar_t)-1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Whatever piecemeal, per compiler/platform thing we can do about the
|
||||
* (u)intptr_t types and limits.
|
||||
*/
|
||||
|
||||
#if defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)
|
||||
# define STDINT_H_UINTPTR_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef STDINT_H_UINTPTR_T_DEFINED
|
||||
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64)
|
||||
# define stdint_intptr_bits 64
|
||||
# elif defined (__WATCOMC__) || defined (__TURBOC__)
|
||||
# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
|
||||
# define stdint_intptr_bits 16
|
||||
# else
|
||||
# define stdint_intptr_bits 32
|
||||
# endif
|
||||
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32)
|
||||
# define stdint_intptr_bits 32
|
||||
# elif defined (__INTEL_COMPILER)
|
||||
/* TODO -- what did Intel do about x86-64? */
|
||||
# endif
|
||||
|
||||
# ifdef stdint_intptr_bits
|
||||
# define stdint_intptr_glue3_i(a,b,c) a##b##c
|
||||
# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
|
||||
# ifndef PRINTF_INTPTR_MODIFIER
|
||||
# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
|
||||
# endif
|
||||
# ifndef PTRDIFF_MAX
|
||||
# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef PTRDIFF_MIN
|
||||
# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
|
||||
# endif
|
||||
# ifndef UINTPTR_MAX
|
||||
# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef INTPTR_MAX
|
||||
# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
|
||||
# endif
|
||||
# ifndef INTPTR_MIN
|
||||
# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
|
||||
# endif
|
||||
# ifndef INTPTR_C
|
||||
# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
|
||||
# endif
|
||||
# ifndef UINTPTR_C
|
||||
# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
|
||||
# endif
|
||||
typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
|
||||
typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
|
||||
# else
|
||||
/* TODO -- This following is likely wrong for some platforms, and does
|
||||
nothing for the definition of uintptr_t. */
|
||||
typedef ptrdiff_t intptr_t;
|
||||
# endif
|
||||
# define STDINT_H_UINTPTR_T_DEFINED
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Assumes sig_atomic_t is signed and we have a 2s complement machine.
|
||||
*/
|
||||
|
||||
#ifndef SIG_ATOMIC_MAX
|
||||
# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
|
||||
|
||||
/*
|
||||
* Please compile with the maximum warning settings to make sure macros are not
|
||||
* defined more than once.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define glue3_aux(x,y,z) x ## y ## z
|
||||
#define glue3(x,y,z) glue3_aux(x,y,z)
|
||||
|
||||
#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,=) glue3(UINT,bits,_C) (0);
|
||||
#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,=) glue3(INT,bits,_C) (0);
|
||||
|
||||
#define DECL(us,bits) glue3(DECL,us,) (bits)
|
||||
|
||||
#define TESTUMAX(bits) glue3(u,bits,=) glue3(~,u,bits); if (glue3(UINT,bits,_MAX) glue3(!=,u,bits)) printf ("Something wrong with UINT%d_MAX\n", bits)
|
||||
|
||||
int main () {
|
||||
DECL(I,8)
|
||||
DECL(U,8)
|
||||
DECL(I,16)
|
||||
DECL(U,16)
|
||||
DECL(I,32)
|
||||
DECL(U,32)
|
||||
#ifdef INT64_MAX
|
||||
DECL(I,64)
|
||||
DECL(U,64)
|
||||
#endif
|
||||
intmax_t imax = INTMAX_C(0);
|
||||
uintmax_t umax = UINTMAX_C(0);
|
||||
char str0[256], str1[256];
|
||||
|
||||
sprintf (str0, "%d %x\n", 0, ~0);
|
||||
|
||||
sprintf (str1, "%d %x\n", i8, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with i8 : %s\n", str1);
|
||||
sprintf (str1, "%u %x\n", u8, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with u8 : %s\n", str1);
|
||||
sprintf (str1, "%d %x\n", i16, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with i16 : %s\n", str1);
|
||||
sprintf (str1, "%u %x\n", u16, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : %s\n", str1);
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with i32 : %s\n", str1);
|
||||
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with u32 : %s\n", str1);
|
||||
#ifdef INT64_MAX
|
||||
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with i64 : %s\n", str1);
|
||||
#endif
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with imax : %s\n", str1);
|
||||
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
|
||||
if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : %s\n", str1);
|
||||
|
||||
TESTUMAX(8);
|
||||
TESTUMAX(16);
|
||||
TESTUMAX(32);
|
||||
#ifdef INT64_MAX
|
||||
TESTUMAX(64);
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
+131
-207
@@ -1,131 +1,125 @@
|
||||
/* Modular support
|
||||
/*
|
||||
*
|
||||
* (C) 2008-2010 Anope Team
|
||||
* (C) 2008-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef REGCHANNEL_H
|
||||
#define REGCHANNEL_H
|
||||
|
||||
typedef unordered_map_namespace::unordered_map<Anope::string, ChannelInfo *, ci::hash, std::equal_to<ci::string> > registered_channel_map;
|
||||
extern CoreExport registered_channel_map RegisteredChannelList;
|
||||
#include "memo.h"
|
||||
#include "modes.h"
|
||||
#include "extensible.h"
|
||||
#include "logger.h"
|
||||
#include "modules.h"
|
||||
#include "serialize.h"
|
||||
#include "bots.h"
|
||||
|
||||
/** Flags used for the ChannelInfo class
|
||||
*/
|
||||
enum ChannelInfoFlag
|
||||
typedef Anope::hash_map<ChannelInfo *> registered_channel_map;
|
||||
|
||||
extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList;
|
||||
|
||||
/* AutoKick data. */
|
||||
class CoreExport AutoKick : public Serializable
|
||||
{
|
||||
CI_BEGIN,
|
||||
public:
|
||||
/* Channel this autokick is on */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
|
||||
/* 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,
|
||||
Anope::string mask;
|
||||
Serialize::Reference<NickCore> nc;
|
||||
|
||||
CI_END
|
||||
Anope::string reason;
|
||||
Anope::string creator;
|
||||
time_t addtime;
|
||||
time_t last_used;
|
||||
|
||||
AutoKick();
|
||||
~AutoKick();
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
};
|
||||
|
||||
class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, CI_END>
|
||||
/* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*/
|
||||
class CoreExport ChannelInfo : public Serializable, public Extensible
|
||||
{
|
||||
/* channels who reference this one */
|
||||
Anope::map<int> references;
|
||||
private:
|
||||
std::map<ChannelModeName, Anope::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 */
|
||||
Flags<ChannelModeName, CMODE_END * 2> mlock_on; /* Modes mlocked on */
|
||||
Flags<ChannelModeName, CMODE_END * 2> mlock_off; /* Modes mlocked off */
|
||||
Serialize::Reference<NickCore> founder; /* Channel founder */
|
||||
Serialize::Reference<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */
|
||||
Serialize::Checker<std::vector<ChanAccess *> > access; /* List of authorized users */
|
||||
Serialize::Checker<std::vector<AutoKick *> > akick; /* List of users to kickban */
|
||||
Anope::map<int16_t> levels;
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param chname The channel name
|
||||
*/
|
||||
ChannelInfo(const Anope::string &chname);
|
||||
friend class ChanAccess;
|
||||
friend class AutoKick;
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~ChannelInfo();
|
||||
|
||||
Anope::string name; /* Channel name */
|
||||
NickCore *founder;
|
||||
NickCore *successor; /* Who gets the channel if the founder nick is dropped or expires */
|
||||
Anope::string name; /* Channel name */
|
||||
Anope::string desc;
|
||||
|
||||
time_t time_registered;
|
||||
time_t last_used;
|
||||
|
||||
Anope::string last_topic; /* The last topic that was set on this channel */
|
||||
Anope::string last_topic_setter; /* Setter */
|
||||
time_t last_topic_time; /* Time */
|
||||
Anope::string last_topic; /* The last topic that was set on this channel */
|
||||
Anope::string last_topic_setter; /* Setter */
|
||||
time_t last_topic_time; /* Time */
|
||||
|
||||
Anope::string forbidby;
|
||||
Anope::string forbidreason;
|
||||
Channel::ModeList last_modes; /* The last modes set on this channel */
|
||||
|
||||
int16 bantype;
|
||||
int16 *levels; /* Access levels for commands */
|
||||
|
||||
Anope::string entry_message; /* Notice sent on entering channel */
|
||||
int16_t bantype;
|
||||
|
||||
MemoInfo memos;
|
||||
|
||||
Channel *c; /* Pointer to channel record (if channel is currently in use) */
|
||||
Channel *c; /* Pointer to channel, if the channel exists */
|
||||
|
||||
/* For BotServ */
|
||||
Serialize::Reference<BotInfo> bi; /* Bot used on this channel */
|
||||
|
||||
BotInfo *bi; /* Bot used on this channel */
|
||||
Flags<BotServFlag> botflags;
|
||||
int16 *ttb; /* Times to ban for each kicker */
|
||||
time_t banexpire; /* Time bans expire in */
|
||||
|
||||
int16 capsmin, capspercent; /* For CAPS kicker */
|
||||
int16 floodlines, floodsecs; /* For FLOOD kicker */
|
||||
int16 repeattimes; /* For REPEAT kicker */
|
||||
/** Constructor
|
||||
* @param chname The channel name
|
||||
*/
|
||||
ChannelInfo(const Anope::string &chname);
|
||||
|
||||
/** Copy constructor
|
||||
* @param ci The ChannelInfo to copy settings from
|
||||
*/
|
||||
ChannelInfo(const ChannelInfo &ci);
|
||||
|
||||
~ChannelInfo();
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Change the founder of the channek
|
||||
* @params nc The new founder
|
||||
*/
|
||||
void SetFounder(NickCore *nc);
|
||||
|
||||
/** Get the founder of the channel
|
||||
* @return The founder
|
||||
*/
|
||||
NickCore *GetFounder() const;
|
||||
|
||||
void SetSuccessor(NickCore *nc);
|
||||
NickCore *GetSuccessor() const;
|
||||
|
||||
/** Find which bot should send mode/topic/etc changes for this channel
|
||||
* @return The bot
|
||||
*/
|
||||
BotInfo *WhoSends() const;
|
||||
|
||||
/** 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.
|
||||
* @param access The entry
|
||||
*/
|
||||
void AddAccess(NickCore *nc, int16 level, const Anope::string &creator, int32 last_seen = 0);
|
||||
void AddAccess(ChanAccess *access);
|
||||
|
||||
/** Get an entry from the channel access list by index
|
||||
*
|
||||
@@ -134,30 +128,31 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
*
|
||||
* Retrieves an entry from the access list that matches the given index.
|
||||
*/
|
||||
ChanAccess *GetAccess(unsigned index);
|
||||
ChanAccess *GetAccess(unsigned index) const;
|
||||
|
||||
/** 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.
|
||||
/** Retrieve the access for a user or group in the form of a vector of access entries
|
||||
* (as multiple entries can affect a single user).
|
||||
*/
|
||||
ChanAccess *GetAccess(const NickCore *nc, int16 level = 0);
|
||||
AccessGroup AccessFor(const User *u);
|
||||
AccessGroup AccessFor(const NickCore *nc);
|
||||
|
||||
/** Get the size of the accss vector for this channel
|
||||
* @return The access vector size
|
||||
*/
|
||||
unsigned GetAccessCount() const;
|
||||
|
||||
/** Get the number of access entries for this channel,
|
||||
* including those that are on other channels.
|
||||
*/
|
||||
unsigned GetDeepAccessCount() 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.
|
||||
* @return The erased entry
|
||||
*/
|
||||
void EraseAccess(unsigned index);
|
||||
ChanAccess *EraseAccess(unsigned index);
|
||||
|
||||
/** Clear the entire channel access list
|
||||
*
|
||||
@@ -172,7 +167,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
* @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 Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0);
|
||||
AutoKick* AddAkick(const Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0);
|
||||
|
||||
/** Add an akick entry to the channel by reason
|
||||
* @param user The user who added the akick
|
||||
@@ -181,13 +176,13 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
* @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 Anope::string &user, const Anope::string &mask, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0);
|
||||
AutoKick* AddAkick(const Anope::string &user, const Anope::string &mask, const Anope::string &reason, time_t t = Anope::CurTime, 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);
|
||||
AutoKick* GetAkick(unsigned index) const;
|
||||
|
||||
/** Get the size of the akick vector for this channel
|
||||
* @return The akick vector size
|
||||
@@ -203,122 +198,51 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
*/
|
||||
void ClearAkick();
|
||||
|
||||
/** Add a badword to the badword list
|
||||
* @param word The badword
|
||||
* @param type The type (SINGLE START END)
|
||||
* @return The badword
|
||||
/** Get the level for a privilege
|
||||
* @param priv The privilege name
|
||||
* @return the level
|
||||
* @throws CoreException if priv is not a valid privilege
|
||||
*/
|
||||
BadWord *AddBadWord(const Anope::string &word, BadWordType type);
|
||||
int16_t GetLevel(const Anope::string &priv) const;
|
||||
|
||||
/** Get a badword structure by index
|
||||
* @param index The index
|
||||
* @return The badword
|
||||
/** Set the level for a privilege
|
||||
* @param priv The privilege priv
|
||||
* @param level The new level
|
||||
*/
|
||||
BadWord *GetBadWord(unsigned index);
|
||||
void SetLevel(const Anope::string &priv, int16_t level);
|
||||
|
||||
/** Get how many badwords are on this channel
|
||||
* @return The number of badwords in the vector
|
||||
/** Remove a privilege from the channel
|
||||
* @param priv The privilege
|
||||
*/
|
||||
unsigned GetBadWordCount() const;
|
||||
void RemoveLevel(const Anope::string &priv);
|
||||
|
||||
/** Remove a badword
|
||||
* @param index The index of the badword
|
||||
/** Clear all privileges from the channel
|
||||
*/
|
||||
void EraseBadWord(unsigned index);
|
||||
void ClearLevels();
|
||||
|
||||
/** Clear all badwords from the channel
|
||||
*/
|
||||
void ClearBadWords();
|
||||
|
||||
/** Loads MLocked modes from extensible. This is used from database loading because Anope doesn't know what modes exist
|
||||
* until after it connects to the IRCd.
|
||||
*/
|
||||
void LoadMLock();
|
||||
|
||||
/** 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
|
||||
*/
|
||||
bool HasMLock(ChannelModeName Name, bool status) const;
|
||||
|
||||
/** 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 Anope::string ¶m = "");
|
||||
|
||||
/** 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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
bool GetParam(ChannelModeName Name, Anope::string &Target) const;
|
||||
|
||||
/** Check if a mode is set and has a param
|
||||
* @param Name The mode
|
||||
*/
|
||||
bool HasParam(ChannelModeName Name) const;
|
||||
|
||||
/** Clear all the params from the channel
|
||||
*/
|
||||
void ClearParams();
|
||||
|
||||
/** Check whether a user is permitted to be on this channel
|
||||
/** Gets a ban mask for the given user based on the bantype
|
||||
* of the channel.
|
||||
* @param u The user
|
||||
* @return true if they are allowed, false if they aren't and were kicked
|
||||
* @return A ban mask that affects the user
|
||||
*/
|
||||
bool CheckKick(User *user);
|
||||
Anope::string GetIdealBan(User *u) const;
|
||||
|
||||
/** Check the channel topic
|
||||
* If topic lock is enabled will change the topic back, else it records
|
||||
* the new topic in the ChannelInfo
|
||||
/** Finds a ChannelInfo
|
||||
* @param name channel name to lookup
|
||||
* @return the ChannelInfo associated with the channel
|
||||
*/
|
||||
void CheckTopic();
|
||||
|
||||
/** Restore the channel topic, used on channel creation when not syncing with the uplink
|
||||
* and after uplink sync
|
||||
*/
|
||||
void RestoreTopic();
|
||||
static ChannelInfo* Find(const Anope::string &name);
|
||||
|
||||
void AddChannelReference(const Anope::string &what);
|
||||
void RemoveChannelReference(const Anope::string &what);
|
||||
void GetChannelReferences(std::deque<Anope::string> &chans);
|
||||
};
|
||||
|
||||
/** A timer used to keep the BotServ bot/ChanServ in the channel
|
||||
* after kicking the last user in a channel
|
||||
/** Is the user the real founder?
|
||||
* @param user The user
|
||||
* @param ci The channel
|
||||
* @return true or false
|
||||
*/
|
||||
class ChanServTimer : public Timer
|
||||
{
|
||||
private:
|
||||
dynamic_reference<Channel> c;
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param chan The channel
|
||||
*/
|
||||
ChanServTimer(Channel *chan);
|
||||
|
||||
/** Called when the delay is up
|
||||
* @param The current time
|
||||
*/
|
||||
void Tick(time_t);
|
||||
};
|
||||
|
||||
extern CoreExport bool IsFounder(const User *user, const ChannelInfo *ci);
|
||||
|
||||
#endif // REGCHANNEL_H
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef REGEXPR_H
|
||||
#define REGEXPR_H
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
#include "service.h"
|
||||
|
||||
class RegexException : public CoreException
|
||||
{
|
||||
public:
|
||||
RegexException(const Anope::string &reason = "") : CoreException(reason) { }
|
||||
|
||||
virtual ~RegexException() throw() { }
|
||||
};
|
||||
|
||||
class CoreExport Regex
|
||||
{
|
||||
Anope::string expression;
|
||||
protected:
|
||||
Regex(const Anope::string &expr) : expression(expr) { }
|
||||
public:
|
||||
virtual ~Regex() { }
|
||||
const Anope::string &GetExpression() { return expression; }
|
||||
virtual bool Matches(const Anope::string &str) = 0;
|
||||
};
|
||||
|
||||
class CoreExport RegexProvider : public Service
|
||||
{
|
||||
public:
|
||||
RegexProvider(Module *o, const Anope::string &n) : Service(o, "Regex", n) { }
|
||||
virtual Regex *Compile(const Anope::string &) = 0;
|
||||
};
|
||||
|
||||
#endif // REGEXPR_H
|
||||
|
||||
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SERIALIZE_H
|
||||
#define SERIALIZE_H
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "anope.h"
|
||||
#include "base.h"
|
||||
|
||||
namespace Serialize
|
||||
{
|
||||
class Data
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
DT_TEXT,
|
||||
DT_INT
|
||||
};
|
||||
|
||||
virtual ~Data() { }
|
||||
|
||||
virtual std::iostream& operator[](const Anope::string &key) = 0;
|
||||
virtual std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); }
|
||||
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
||||
|
||||
virtual void SetType(const Anope::string &key, Type t) { }
|
||||
virtual Type GetType(const Anope::string &key) const { return DT_TEXT; }
|
||||
};
|
||||
|
||||
extern void RegisterTypes();
|
||||
extern void CheckTypes();
|
||||
|
||||
class Type;
|
||||
template<typename T> class Checker;
|
||||
template<typename T> class Reference;
|
||||
}
|
||||
|
||||
/** A serialziable object. Serializable objects can be serialized into
|
||||
* abstract data types (Serialize::Data), and then reconstructed or
|
||||
* updated later at any time.
|
||||
*/
|
||||
class CoreExport Serializable : public virtual Base
|
||||
{
|
||||
private:
|
||||
/* A list of every serializable item in Anope.
|
||||
* Some of these are static and constructed at runtime,
|
||||
* so this list must be on the heap, as it is not always
|
||||
* constructed before other objects are if it isn't.
|
||||
*/
|
||||
static std::list<Serializable *> *SerializableItems;
|
||||
/* The type of item this object is */
|
||||
Serialize::Type *s_type;
|
||||
private:
|
||||
/* Iterator into serializable_items */
|
||||
std::list<Serializable *>::iterator s_iter;
|
||||
/* The hash of the last serialized form of this object commited to the database */
|
||||
size_t last_commit;
|
||||
/* The last time this object was commited to the database */
|
||||
time_t last_commit_time;
|
||||
|
||||
protected:
|
||||
Serializable(const Anope::string &serialize_type);
|
||||
Serializable(const Serializable &);
|
||||
|
||||
Serializable &operator=(const Serializable &);
|
||||
|
||||
public:
|
||||
virtual ~Serializable();
|
||||
|
||||
/* Unique ID (per type, not globally) for this object */
|
||||
uint64_t id;
|
||||
|
||||
/* Only used by redis, to ignore updates */
|
||||
unsigned short redis_ignore;
|
||||
|
||||
/** Marks the object as potentially being updated "soon".
|
||||
*/
|
||||
void QueueUpdate();
|
||||
|
||||
bool IsCached(Serialize::Data &);
|
||||
void UpdateCache(Serialize::Data &);
|
||||
|
||||
bool IsTSCached();
|
||||
void UpdateTS();
|
||||
|
||||
/** Get the type of serializable object this is
|
||||
* @return The serializable object type
|
||||
*/
|
||||
Serialize::Type* GetSerializableType() const { return this->s_type; }
|
||||
|
||||
virtual void Serialize(Serialize::Data &data) const = 0;
|
||||
|
||||
static const std::list<Serializable *> &GetItems();
|
||||
};
|
||||
|
||||
/* A serializable type. There should be one of these classes for each type
|
||||
* of class that inherits from Serialiable. Used for unserializing objects
|
||||
* of this type, as it requires a function pointer to a static member function.
|
||||
*/
|
||||
class CoreExport Serialize::Type
|
||||
{
|
||||
typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &);
|
||||
|
||||
static std::vector<Anope::string> TypeOrder;
|
||||
static std::map<Anope::string, Serialize::Type *> Types;
|
||||
|
||||
/* The name of this type, should be a class name */
|
||||
Anope::string name;
|
||||
unserialize_func unserialize;
|
||||
/* Owner of this type. Used for placing objects of this type in separate databases
|
||||
* based on what module, if any, owns it.
|
||||
*/
|
||||
Module *owner;
|
||||
|
||||
/* The timesatmp for this type. All objects of this type are as up to date as
|
||||
* this timestamp. if curtime == timestamp then we have the most up to date
|
||||
* version of every object of this type.
|
||||
*/
|
||||
time_t timestamp;
|
||||
|
||||
public:
|
||||
/* Map of Serializable::id to Serializable objects */
|
||||
std::map<uint64_t, Serializable *> objects;
|
||||
|
||||
/** Creates a new serializable type
|
||||
* @param n Type name
|
||||
* @param f Func to unserialize objects
|
||||
* @param owner Owner of this type. Leave NULL for the core.
|
||||
*/
|
||||
Type(const Anope::string &n, unserialize_func f, Module *owner = NULL);
|
||||
~Type();
|
||||
|
||||
/** Gets the name for this type
|
||||
* @return The name, eg "NickAlias"
|
||||
*/
|
||||
const Anope::string &GetName() { return this->name; }
|
||||
|
||||
/** Unserialized an object.
|
||||
* @param obj NULL if this object doesn't yet exist. If this isn't NULL, instead
|
||||
* update the contents of this object.
|
||||
* @param data The data to unserialize
|
||||
* @return The unserialized object. If obj != NULL this should be obj.
|
||||
*/
|
||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
|
||||
/** Check if this object type has any pending changes and update them.
|
||||
*/
|
||||
void Check();
|
||||
|
||||
/** Gets the timestamp for the object type. That is, the time we know
|
||||
* all objects of this type are updated at least to.
|
||||
*/
|
||||
time_t GetTimestamp() const;
|
||||
|
||||
/** Bumps object type timestamp to current time
|
||||
*/
|
||||
void UpdateTimestamp();
|
||||
|
||||
Module* GetOwner() const { return this->owner; }
|
||||
|
||||
static Serialize::Type *Find(const Anope::string &name);
|
||||
|
||||
static const std::vector<Anope::string> &GetTypeOrder();
|
||||
|
||||
static const std::map<Anope::string, Serialize::Type *>& GetTypes();
|
||||
};
|
||||
|
||||
/** Should be used to hold lists and other objects of a specific type,
|
||||
* but not a specific object. Used for ensuring that any access to
|
||||
* this object type is always up to date. These are usually constructed
|
||||
* at run time, before main is called, so no types are registered. This
|
||||
* is why there are static Serialize::Type* variables in every function.
|
||||
*/
|
||||
template<typename T>
|
||||
class Serialize::Checker
|
||||
{
|
||||
Anope::string name;
|
||||
T obj;
|
||||
mutable Serialize::Type *type;
|
||||
|
||||
inline void Check() const
|
||||
{
|
||||
if (!type)
|
||||
type = Serialize::Type::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
}
|
||||
|
||||
public:
|
||||
Checker(const Anope::string &n) : name(n), type(NULL) { }
|
||||
|
||||
inline const T* operator->() const
|
||||
{
|
||||
this->Check();
|
||||
return &this->obj;
|
||||
}
|
||||
inline T* operator->()
|
||||
{
|
||||
this->Check();
|
||||
return &this->obj;
|
||||
}
|
||||
|
||||
inline const T& operator*() const
|
||||
{
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
inline T& operator*()
|
||||
{
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
|
||||
inline operator const T&() const
|
||||
{
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
inline operator T&()
|
||||
{
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
};
|
||||
|
||||
/** Used to hold references to serializable objects. Reference should always be
|
||||
* used when holding references to serializable objects for extended periods of time
|
||||
* to ensure that the object it refers to it always up to date. This also behaves like
|
||||
* Reference in that it will invalidate itself if the object it refers to is
|
||||
* destructed.
|
||||
*/
|
||||
template<typename T>
|
||||
class Serialize::Reference : public ReferenceBase
|
||||
{
|
||||
protected:
|
||||
T *ref;
|
||||
|
||||
public:
|
||||
Reference() : ref(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
Reference(T *obj) : ref(obj)
|
||||
{
|
||||
if (obj)
|
||||
obj->AddReference(this);
|
||||
}
|
||||
|
||||
Reference(const Reference<T> &other) : ReferenceBase(other), ref(other.ref)
|
||||
{
|
||||
if (ref && !invalid)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
|
||||
~Reference()
|
||||
{
|
||||
if (ref && !invalid)
|
||||
this->ref->DelReference(this);
|
||||
}
|
||||
|
||||
inline Reference<T>& operator=(const Reference<T> &other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
if (ref && !invalid)
|
||||
this->ref->DelReference(this);
|
||||
|
||||
this->ref = other.ref;
|
||||
this->invalid = other.invalid;
|
||||
|
||||
if (ref && !invalid)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline operator bool() const
|
||||
{
|
||||
if (!this->invalid)
|
||||
return this->ref != NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline operator T*() const
|
||||
{
|
||||
if (!this->invalid)
|
||||
{
|
||||
if (this->ref)
|
||||
// This can invalidate me
|
||||
this->ref->QueueUpdate();
|
||||
if (!this->invalid)
|
||||
return this->ref;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator*() const
|
||||
{
|
||||
if (!this->invalid)
|
||||
{
|
||||
if (this->ref)
|
||||
// This can invalidate me
|
||||
this->ref->QueueUpdate();
|
||||
if (!this->invalid)
|
||||
return this->ref;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator->() const
|
||||
{
|
||||
if (!this->invalid)
|
||||
{
|
||||
if (this->ref)
|
||||
// This can invalidate me
|
||||
this->ref->QueueUpdate();
|
||||
if (!this->invalid)
|
||||
return this->ref;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SERIALIZE_H
|
||||
+88
-85
@@ -1,98 +1,71 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SERVERS_H
|
||||
#define SERVERS_H
|
||||
|
||||
/* Anope */
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
#include "extensible.h"
|
||||
|
||||
/* Anope. We are at the top of the server tree, our uplink is
|
||||
* almost always me->GetLinks()[0]. We never have an uplink. */
|
||||
extern CoreExport Server *Me;
|
||||
|
||||
extern CoreExport void CapabParse(const std::vector<Anope::string> ¶ms);
|
||||
|
||||
extern CoreExport void do_server(const Anope::string &source, const Anope::string &servername, unsigned int hops, const Anope::string &descript, const Anope::string &numeric);
|
||||
extern CoreExport void do_squit(const Anope::string &source, const Anope::string &server);
|
||||
|
||||
extern CoreExport const char *ts6_uid_retrieve();
|
||||
extern CoreExport const char *ts6_sid_retrieve();
|
||||
|
||||
/* Types of capab
|
||||
*/
|
||||
enum CapabType
|
||||
namespace Servers
|
||||
{
|
||||
CAPAB_BEGIN,
|
||||
/* Retrieves the next free TS6 UID or SID */
|
||||
extern CoreExport const Anope::string TS6_UID_Retrieve();
|
||||
extern CoreExport const Anope::string TS6_SID_Retrieve();
|
||||
|
||||
CAPAB_NOQUIT,
|
||||
CAPAB_TSMODE,
|
||||
CAPAB_UNCONNECT,
|
||||
CAPAB_NICKIP,
|
||||
CAPAB_NSJOIN,
|
||||
CAPAB_ZIP,
|
||||
CAPAB_BURST,
|
||||
CAPAB_TS3,
|
||||
CAPAB_TS5,
|
||||
CAPAB_DKEY,
|
||||
CAPAB_DOZIP,
|
||||
CAPAB_DODKEY,
|
||||
CAPAB_QS,
|
||||
CAPAB_SCS,
|
||||
CAPAB_PT4,
|
||||
CAPAB_UID,
|
||||
CAPAB_KNOCK,
|
||||
CAPAB_CLIENT,
|
||||
CAPAB_IPV6,
|
||||
CAPAB_SSJ5,
|
||||
CAPAB_SN2,
|
||||
CAPAB_VHOST,
|
||||
CAPAB_TOKEN,
|
||||
CAPAB_SSJ3,
|
||||
CAPAB_NICK2,
|
||||
CAPAB_VL,
|
||||
CAPAB_TLKEXT,
|
||||
CAPAB_CHANMODE,
|
||||
CAPAB_SJB64,
|
||||
CAPAB_NICKCHARS,
|
||||
/* Gets our uplink. Note we don't actually have an "uplink", this is just
|
||||
* the only server whose uplink *is* Me that is not a juped server.
|
||||
* @return Our uplink, or NULL if not uplinked to anything
|
||||
*/
|
||||
extern CoreExport Server* GetUplink();
|
||||
|
||||
CAPAB_END
|
||||
};
|
||||
/* Server maps by name and id */
|
||||
extern CoreExport Anope::map<Server *> ByName;
|
||||
extern CoreExport Anope::map<Server *> ByID;
|
||||
|
||||
/* CAPAB stuffs */
|
||||
struct CapabInfo
|
||||
{
|
||||
Anope::string Token;
|
||||
CapabType Flag;
|
||||
};
|
||||
|
||||
extern CoreExport Flags<CapabType, CAPAB_END> Capab;
|
||||
extern CoreExport CapabInfo Capab_Info[];
|
||||
|
||||
/** Flags set on servers
|
||||
*/
|
||||
enum ServerFlag
|
||||
{
|
||||
SERVER_NONE,
|
||||
/* Server is syncing */
|
||||
SERVER_SYNCING,
|
||||
/* This server was juped */
|
||||
SERVER_JUPED
|
||||
};
|
||||
/* CAPAB/PROTOCTL given by the uplink */
|
||||
extern CoreExport std::set<Anope::string> Capab;
|
||||
}
|
||||
|
||||
/** Class representing a server
|
||||
*/
|
||||
class CoreExport Server : public Flags<ServerFlag>
|
||||
class CoreExport Server : public Extensible
|
||||
{
|
||||
private:
|
||||
/* Server name */
|
||||
Anope::string Name;
|
||||
Anope::string name;
|
||||
/* Hops between services and server */
|
||||
unsigned int Hops;
|
||||
unsigned int hops;
|
||||
/* Server description */
|
||||
Anope::string Description;
|
||||
Anope::string description;
|
||||
/* Server ID */
|
||||
Anope::string SID;
|
||||
Anope::string sid;
|
||||
/* Links for this server */
|
||||
std::vector<Server *> Links;
|
||||
std::vector<Server *> links;
|
||||
/* Uplink for this server */
|
||||
Server *UplinkServer;
|
||||
|
||||
Server *uplink;
|
||||
/* Server is syncing */
|
||||
bool syncing;
|
||||
/* The server is juped */
|
||||
bool juped;
|
||||
/* The server is about to quit */
|
||||
bool quitting;
|
||||
/* Reason this server was quit */
|
||||
Anope::string QReason;
|
||||
Anope::string quit_reason;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
@@ -101,14 +74,19 @@ class CoreExport Server : public Flags<ServerFlag>
|
||||
* @param hops Hops from services server
|
||||
* @param description Server rdescription
|
||||
* @param sid Server sid/numeric
|
||||
* @param flag An optional server flag
|
||||
* @param jupe If the server is juped
|
||||
*/
|
||||
Server(Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid, ServerFlag flag = SERVER_NONE);
|
||||
Server(Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid = "", bool jupe = false);
|
||||
|
||||
private:
|
||||
/** Destructor
|
||||
*/
|
||||
~Server();
|
||||
|
||||
public:
|
||||
/* Number of users on the server */
|
||||
unsigned users;
|
||||
|
||||
/** Delete this server with a reason
|
||||
* @param reason The reason
|
||||
*/
|
||||
@@ -134,11 +112,20 @@ class CoreExport Server : public Flags<ServerFlag>
|
||||
*/
|
||||
const Anope::string &GetDescription() const;
|
||||
|
||||
/** Get the server numeric/SID
|
||||
/** Change this servers SID
|
||||
* @param sid The new SID
|
||||
*/
|
||||
void SetSID(const Anope::string &sid);
|
||||
|
||||
/** Get the server numeric/SID, else the server name
|
||||
* @return The numeric/SID
|
||||
*/
|
||||
const Anope::string &GetSID() const;
|
||||
|
||||
/** Retrieves the reason this server is quitting
|
||||
*/
|
||||
const Anope::string &GetQuitReason() const;
|
||||
|
||||
/** Get the list of links this server has, or NULL if it has none
|
||||
* @return A list of servers
|
||||
*/
|
||||
@@ -159,31 +146,47 @@ class CoreExport Server : public Flags<ServerFlag>
|
||||
*/
|
||||
void DelLink(Server *s);
|
||||
|
||||
/** Remove all links from this server
|
||||
*/
|
||||
void ClearLinks();
|
||||
|
||||
/** Finish syncing this server and optionally all links to it
|
||||
* @param SyncLinks True to sync the links for this server too (if any)
|
||||
* @param sync_links True to sync the links for this server too (if any)
|
||||
*/
|
||||
void Sync(bool SyncLinks);
|
||||
void Sync(bool sync_links);
|
||||
|
||||
/** Check if this server is synced
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsSynced() const;
|
||||
|
||||
/** Unsync the server. Only used for Me->Unsync()
|
||||
*/
|
||||
void Unsync();
|
||||
|
||||
/** Check if this server is ULined
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsULined() const;
|
||||
|
||||
/** Check if this server is juped (a pseudoserver other than us)
|
||||
* @return true if this server is a juped server
|
||||
*/
|
||||
bool IsJuped() const;
|
||||
|
||||
/** Check if the server is quitting
|
||||
* @return true if this server is quitting.
|
||||
*/
|
||||
bool IsQuitting() const;
|
||||
|
||||
/** Send a message to alll users on this server
|
||||
* @param source The source of the message
|
||||
* @param message The message
|
||||
*/
|
||||
void Notice(BotInfo *source, const Anope::string &message);
|
||||
|
||||
/** Find a server
|
||||
* @param name The name or SID/numeric
|
||||
* @param s The server list to search for this server on, defaults to our Uplink
|
||||
* @param name_only set to true to only look up by name, not SID
|
||||
* @return The server
|
||||
*/
|
||||
static Server *Find(const Anope::string &name, Server *s = NULL);
|
||||
static Server *Find(const Anope::string &name, bool name_only = false);
|
||||
};
|
||||
|
||||
#endif // SERVERS_H
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SERVICE_H
|
||||
#define SERVICE_H
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
#include "base.h"
|
||||
|
||||
/** Anything that inherits from this class can be referred to
|
||||
* using ServiceReference. Any interfaces provided by modules,
|
||||
* such as commands, use this. This is also used for modules
|
||||
* that publish a service (m_ssl, etc).
|
||||
*/
|
||||
class CoreExport Service : public virtual Base
|
||||
{
|
||||
static std::map<Anope::string, std::map<Anope::string, Service *> > Services;
|
||||
static std::map<Anope::string, std::map<Anope::string, Anope::string> > Aliases;
|
||||
|
||||
static Service *FindService(const std::map<Anope::string, Service *> &services, const std::map<Anope::string, Anope::string> *aliases, const Anope::string &n)
|
||||
{
|
||||
std::map<Anope::string, Service *>::const_iterator it = services.find(n);
|
||||
if (it != services.end())
|
||||
return it->second;
|
||||
|
||||
if (aliases != NULL)
|
||||
{
|
||||
std::map<Anope::string, Anope::string>::const_iterator it2 = aliases->find(n);
|
||||
if (it2 != aliases->end())
|
||||
return FindService(services, aliases, it2->second);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public:
|
||||
static Service *FindService(const Anope::string &t, const Anope::string &n)
|
||||
{
|
||||
std::map<Anope::string, std::map<Anope::string, Service *> >::const_iterator it = Services.find(t);
|
||||
if (it == Services.end())
|
||||
return NULL;
|
||||
|
||||
std::map<Anope::string, std::map<Anope::string, Anope::string> >::const_iterator it2 = Aliases.find(t);
|
||||
if (it2 != Aliases.end())
|
||||
return FindService(it->second, &it2->second, n);
|
||||
|
||||
return FindService(it->second, NULL, n);
|
||||
}
|
||||
|
||||
static std::vector<Anope::string> GetServiceKeys(const Anope::string &t)
|
||||
{
|
||||
std::vector<Anope::string> keys;
|
||||
std::map<Anope::string, std::map<Anope::string, Service *> >::iterator it = Services.find(t);
|
||||
if (it != Services.end())
|
||||
for (std::map<Anope::string, Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
|
||||
keys.push_back(it2->first);
|
||||
return keys;
|
||||
}
|
||||
|
||||
static void AddAlias(const Anope::string &t, const Anope::string &n, const Anope::string &v)
|
||||
{
|
||||
std::map<Anope::string, Anope::string> &smap = Aliases[t];
|
||||
smap[n] = v;
|
||||
}
|
||||
|
||||
static void DelAlias(const Anope::string &t, const Anope::string &n)
|
||||
{
|
||||
std::map<Anope::string, Anope::string> &smap = Aliases[t];
|
||||
smap.erase(n);
|
||||
if (smap.empty())
|
||||
Aliases.erase(t);
|
||||
}
|
||||
|
||||
Module *owner;
|
||||
/* Service type, which should be the class name (eg "Command") */
|
||||
Anope::string type;
|
||||
/* Service name, commands are usually named service/command */
|
||||
Anope::string name;
|
||||
|
||||
Service(Module *o, const Anope::string &t, const Anope::string &n) : owner(o), type(t), name(n)
|
||||
{
|
||||
this->Register();
|
||||
}
|
||||
|
||||
virtual ~Service()
|
||||
{
|
||||
this->Unregister();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
std::map<Anope::string, Service *> &smap = Services[this->type];
|
||||
if (smap.find(this->name) != smap.end())
|
||||
throw ModuleException("Service " + this->type + " with name " + this->name + " already exists");
|
||||
smap[this->name] = this;
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
std::map<Anope::string, Service *> &smap = Services[this->type];
|
||||
smap.erase(this->name);
|
||||
if (smap.empty())
|
||||
Services.erase(this->type);
|
||||
}
|
||||
};
|
||||
|
||||
/** Like Reference, but used to refer to Services.
|
||||
*/
|
||||
template<typename T>
|
||||
class ServiceReference : public Reference<T>
|
||||
{
|
||||
Anope::string type;
|
||||
Anope::string name;
|
||||
|
||||
public:
|
||||
ServiceReference() { }
|
||||
|
||||
ServiceReference(const Anope::string &t, const Anope::string &n) : type(t), name(n)
|
||||
{
|
||||
}
|
||||
|
||||
inline void operator=(const Anope::string &n)
|
||||
{
|
||||
this->name = n;
|
||||
this->invalid = true;
|
||||
}
|
||||
|
||||
operator bool() anope_override
|
||||
{
|
||||
if (this->invalid)
|
||||
{
|
||||
this->invalid = false;
|
||||
this->ref = NULL;
|
||||
}
|
||||
if (!this->ref)
|
||||
{
|
||||
/* This really could be dynamic_cast in every case, except for when a module
|
||||
* creates its own service type (that other modules must include the header file
|
||||
* for), as the core is not compiled with it so there is no RTTI for it.
|
||||
*/
|
||||
this->ref = static_cast<T *>(Service::FindService(this->type, this->name));
|
||||
if (this->ref)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
return this->ref;
|
||||
}
|
||||
};
|
||||
|
||||
class ServiceAlias
|
||||
{
|
||||
Anope::string t, f;
|
||||
public:
|
||||
ServiceAlias(const Anope::string &type, const Anope::string &from, const Anope::string &to) : t(type), f(from)
|
||||
{
|
||||
Service::AddAlias(type, from, to);
|
||||
}
|
||||
|
||||
~ServiceAlias()
|
||||
{
|
||||
Service::DelAlias(t, f);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SERVICE_H
|
||||
|
||||
+26
-1004
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
Reference in New Issue
Block a user