mirror of
https://github.com/anope/anope.git
synced 2026-06-15 12:24:47 +02:00
Compare commits
1449 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 82e588a790 | |||
| 7b7301eeff | |||
| 70d65376b7 | |||
| af8cf445b8 | |||
| be4ec3c0c4 | |||
| 587e5d9421 | |||
| 35f03811e8 | |||
| 14e396baf7 | |||
| ba01e7a3bb | |||
| 52d9ed428f | |||
| 8f825821e0 | |||
| d1ba920729 | |||
| 56b269e6b3 | |||
| 7e03427272 | |||
| 72ab27af76 | |||
| 3445f4d680 | |||
| aab915f2e9 | |||
| 27652144ec | |||
| 4f8dfc2132 | |||
| 4415a779a3 | |||
| 8662b0989e | |||
| 12c5314863 | |||
| 0d2db1f9f9 | |||
| fe6d7913ce | |||
| dc1252597a | |||
| 721ef7d345 | |||
| 5209e73995 | |||
| 07e2ec0fa7 | |||
| f5d20579ee | |||
| cbd0f52eff | |||
| 4fb4858952 | |||
| 477ff30cec | |||
| daa97f0343 | |||
| 3edc6d70b9 | |||
| 9db85375ee | |||
| e3f368f67b | |||
| 2170823059 | |||
| 011582ff3c | |||
| 98bdd9749a | |||
| cd21bd758c | |||
| fb9f41b3e5 | |||
| a7e5d51616 | |||
| b8df88a1bc | |||
| 257fb256e9 | |||
| 8ff0b0ed99 | |||
| 180aa6b67b | |||
| a26f119bc8 | |||
| a79da4bba1 | |||
| 09160d1289 | |||
| 1d931401cd | |||
| bd7b6b16ec | |||
| ec5fa9e63e | |||
| 7e47b97740 | |||
| 1bd975b90e | |||
| eb8f3a799c | |||
| 791c2b89a5 | |||
| 4f317a2421 | |||
| f3c2933542 | |||
| 4ddb469864 | |||
| d24e810262 | |||
| bc812eeb03 | |||
| 5e9db23883 | |||
| c4075c032e | |||
| dc0c07b408 | |||
| afb55a1842 | |||
| d7aa5f6a3a | |||
| 717c123441 | |||
| 0ac77d0e42 | |||
| 5ca2df1edb | |||
| b3dd5668f6 | |||
| 63b1f9ce88 | |||
| d5e6bd8391 | |||
| 7e62fcf4b3 | |||
| 21a61f162e | |||
| 7df71750cb | |||
| b4f675adcf | |||
| 5298107ae8 | |||
| 7f4362138a | |||
| 4da258ff78 | |||
| 9ab50eedf2 | |||
| 64a3bda235 | |||
| acec166702 | |||
| 00ed18b421 | |||
| 10833f9d3f | |||
| 592060ac75 | |||
| 92338c13b8 | |||
| 3fa2659309 | |||
| 58a3e2bbb7 | |||
| ab5ebc2245 | |||
| cf98cd3e06 | |||
| 632f8df76b | |||
| 663a8b9a1c | |||
| 90f0a7c92a | |||
| 0d684191e9 | |||
| 3499edc427 | |||
| 8a0cf62d70 | |||
| 59f35732f6 | |||
| 76b10625d9 | |||
| b0070bbd3b | |||
| 0a8bb88085 | |||
| a62d824cb4 | |||
| e3afb119b9 | |||
| d44f7971b1 | |||
| 70056dd468 | |||
| 5d9df2bdc1 | |||
| 9d2ef3f130 | |||
| 6ca09be663 | |||
| 7db5e19f74 | |||
| f3840ed110 | |||
| 7d5893a1c8 | |||
| d646d455e2 | |||
| 05e6815d91 | |||
| 3459206980 | |||
| 6f707920ff | |||
| ce69f294a1 | |||
| f8ee95ef98 | |||
| 1e3d2f3739 | |||
| aa9ab7c6db | |||
| 22f2b25f97 | |||
| ebd2997b79 | |||
| 06faf6affc | |||
| 5ec605e424 | |||
| 227909e2cf | |||
| f71fb6e813 | |||
| 74566d869a | |||
| 61e7564633 | |||
| 86c1dab286 | |||
| cd1e9f3181 | |||
| ccc6109879 | |||
| 8131851058 | |||
| 6239b5a053 | |||
| e7ac33fd62 | |||
| 630f3815ce | |||
| 4da2af64ec | |||
| 22b9da7f1d | |||
| 47872e53ed | |||
| e30370af10 | |||
| 89c5b203c3 | |||
| f00e76d30a | |||
| 9eb7562bee | |||
| 46813ccb8c | |||
| fdd196e50b | |||
| 7a522d1c34 | |||
| f276927365 | |||
| d70f1a43bc | |||
| 4319319f97 | |||
| e820e1af0d | |||
| 26ba944d55 | |||
| 4cc6604326 | |||
| 5fbe0c845c | |||
| 2aac8b05ef | |||
| 10d901084f | |||
| 334e5a4ef9 | |||
| 56045afda2 | |||
| c2ddecc2b1 | |||
| 73fb94c553 | |||
| ea9b945830 | |||
| 2803190255 | |||
| f20512c849 | |||
| ada65a3baf | |||
| 8a4c6ae618 | |||
| 88d3338fdd | |||
| 32c31f25ec | |||
| 6608f16b7d | |||
| fb551f0d5d | |||
| 931b0777fb | |||
| b180d5f975 | |||
| fa7684b3a3 | |||
| e65d8b2f3d | |||
| 2575008baa | |||
| 5fb10d27de | |||
| de8eeab2d9 | |||
| c2a97d9f3f | |||
| a950ed8cab | |||
| 4d0a1aaabd | |||
| c24ec06861 | |||
| d4c7f67b58 | |||
| d05afb3ca3 | |||
| bbff5ae4d3 | |||
| de7643a14f | |||
| 46e88e3595 | |||
| f78243b6b1 | |||
| 9da927889f | |||
| 8703afe116 | |||
| 9696118ff5 | |||
| 263f69a40e | |||
| a659f82814 | |||
| 44387a2587 | |||
| 59ee16c7cb | |||
| 7b27a4e491 | |||
| 4ffdd7ca6b | |||
| 503215f39c | |||
| ddb886aa99 | |||
| 48d58d9b88 | |||
| 15a0f998a7 | |||
| ca26c4d9ca | |||
| 80f0351a8b | |||
| 5258549305 | |||
| 94371e69a9 | |||
| f887b37453 | |||
| fd31d4aa29 | |||
| 4fe1c9233c | |||
| 90976b6672 | |||
| e8d6524411 | |||
| d59c1b95e1 | |||
| 2f6c0e435c | |||
| cb3a18e524 | |||
| 5b68782133 | |||
| 084766069c | |||
| 1175ef320e | |||
| a65e9df8dc | |||
| bfd94136c6 | |||
| 11663765e2 | |||
| c770c47e18 | |||
| 9d0d44d738 | |||
| 602d2378f5 | |||
| afb3782aa3 | |||
| ef651b667e | |||
| 7a7b8933bb | |||
| a68e215bad | |||
| 174cc58a8d | |||
| 527304ed2c | |||
| 0cacbf30d2 | |||
| 8e6fe99181 | |||
| e353b15df8 | |||
| 5ed69ed678 | |||
| abfc9926db | |||
| cc64903179 | |||
| 04200cc838 | |||
| 06cb137fde | |||
| 971df4825c | |||
| aa9610a56f | |||
| 4700c96268 | |||
| a2573a2c30 | |||
| 4b870cc5f9 | |||
| 66c0e280ee | |||
| 92edce8ef9 | |||
| 502c985072 | |||
| 1144744c85 | |||
| d4048134af | |||
| 57bb759305 | |||
| 6e6b6b46aa | |||
| 8ea033dd35 | |||
| aa2c1009ee | |||
| 707268f30b | |||
| ae38212c1c | |||
| 15d7f0f6fe | |||
| 5cd986e82b | |||
| 2328c3e7ec | |||
| b218d52a31 | |||
| b899a5c269 | |||
| f9cd3f4238 | |||
| a22f8d3b2d | |||
| 43b1e43afb | |||
| 63d7142465 | |||
| a495213026 | |||
| fa622aae38 | |||
| 07ec79e881 | |||
| 4b1e76c3bb | |||
| 166d6f5d09 | |||
| 7e20659522 | |||
| 1cf4ebb231 | |||
| 8f8b1e46d6 | |||
| f71d5b4d3a | |||
| de1bf10690 | |||
| 950cfcd31e | |||
| 1037a469d3 | |||
| d99ee2d9a4 | |||
| f1cb4b86b7 | |||
| 4502038e3d | |||
| 85b07a94d7 | |||
| 2e4099e9f2 | |||
| 00aa4a0ad4 | |||
| 28e12bc24a | |||
| 051ebe3eea | |||
| f17c4d4d04 | |||
| 0eb007a1b3 | |||
| 1e53c2d50a | |||
| ccc92376be | |||
| 8cf8faf529 | |||
| 6e1fa85cbc | |||
| 9269d20a70 | |||
| 57caa0b53f | |||
| d49aee6cf8 | |||
| e51d6e2fe1 | |||
| 36c646c7d2 | |||
| 4e31757f14 | |||
| 6dc3af5db4 | |||
| c7cb8897b4 | |||
| d5ee411aca | |||
| 03fbc7d281 | |||
| cbcead4e89 | |||
| e447933c02 | |||
| 7bb90e1922 | |||
| c4233e9f9a | |||
| 959a1a69a5 | |||
| 7e872db956 | |||
| 980a2feff8 | |||
| e8d7c65ecf | |||
| 6a8c359b4f | |||
| 1e20877e2f | |||
| fb16ce72a0 | |||
| 36bf5fcb26 | |||
| 16854ae793 | |||
| 17040c088a | |||
| 0d2d7e9968 | |||
| 63d7bee2a6 | |||
| 381c9c8870 | |||
| e8a1570ed9 | |||
| 968e4d0bdd | |||
| 7b7e2a6150 | |||
| 448eadd747 | |||
| 68b54f3fb5 | |||
| 7530c030a9 | |||
| 2528dc80bd | |||
| 52058fe87b | |||
| 43e951aed5 | |||
| c2ae11dd92 | |||
| 87ac831206 | |||
| f74f82619d | |||
| 03dcccc461 | |||
| 35a1c2c1bf | |||
| a2131b7da6 | |||
| c0ea25fb94 | |||
| e05919a1a5 | |||
| d5fd2f5d57 | |||
| 31acdea1aa | |||
| 7b1f345284 | |||
| df9d291bcb | |||
| 7c4a9cf979 | |||
| e6447fa2c4 | |||
| 6cd8849466 | |||
| b8f9116b19 | |||
| 435c9116e9 | |||
| c43666e344 | |||
| 1394c96173 | |||
| f0a44ba894 | |||
| 4a2b9ebcf3 | |||
| 2fba686904 | |||
| 3a2c2a916a | |||
| 0358ae062b | |||
| cab6fcc82d | |||
| 17ab410400 | |||
| 2a22d9c2fd | |||
| c477360dbf | |||
| ee57f57193 | |||
| c966d7ec17 | |||
| f049124905 | |||
| 81a45520a7 | |||
| e6263dba84 | |||
| 631d11d6a8 | |||
| 4e1286ca10 | |||
| 4149afd45d | |||
| 6db15e1783 | |||
| e78a055c2b | |||
| af805e5b45 | |||
| b775c84402 | |||
| ebfff71599 | |||
| 9439cac6b1 | |||
| a93be9ff1c | |||
| 5d437d9ab5 | |||
| 031bc4a8b0 | |||
| 503958aa77 | |||
| c1d161dec4 | |||
| 73e93305c1 | |||
| fa82890696 | |||
| 2ba89de64d | |||
| c4b725b2e1 | |||
| 428d930e2b | |||
| cc3104fc3f | |||
| 1c7c4708d0 | |||
| bc86550c2c | |||
| ad45dbacbb | |||
| 116e5c7479 | |||
| 2d7e5c07d0 | |||
| 184b96946a | |||
| a8b6e44c69 | |||
| 3a2eb6307f | |||
| 4e6ede0e18 | |||
| 883d22d4da | |||
| b766b3a597 | |||
| 475f5afafc | |||
| 834f4d1bf0 | |||
| ab4533e58a | |||
| 4ba8c2ba74 | |||
| 2cc4cd0165 | |||
| 9abdb4e2e9 | |||
| f43f6c3864 | |||
| 6d87e0eb72 | |||
| 1c89004245 | |||
| 8cc71ee794 | |||
| e4189822bc | |||
| a5ddbb0217 | |||
| 3d396f245b | |||
| 0018f790ed | |||
| 6674797c7d | |||
| 1e2e80bf75 | |||
| dc3744a71c | |||
| a36e536a4d | |||
| 7f4afc22fa | |||
| 6e7479170e | |||
| 543e0d770a | |||
| d5f0360175 | |||
| fae2710ba7 | |||
| 8e39d5f219 | |||
| 0a91d582c9 | |||
| 9b06dc5046 | |||
| 6fb5ca2315 | |||
| 3860856dd2 | |||
| 2b4d834f8c | |||
| 79c3a70ed7 | |||
| f9c4baf8fc | |||
| a0ff4cfed5 | |||
| 5993a65b87 | |||
| 116a4b2bea | |||
| 29619eb206 | |||
| 78240c5790 | |||
| da277ad2c9 | |||
| b88b98e627 | |||
| 0ab5111bda | |||
| 6c56c23837 | |||
| bd2fda42cf | |||
| baa119f2e2 | |||
| 5351fb4e4a | |||
| 2f3da52c3c | |||
| 80969ad89a | |||
| 7b6d1e1b52 | |||
| 0a371aec7b | |||
| 011e426845 | |||
| 75f39dec7a | |||
| 3ebaa46c99 | |||
| 196567ce68 | |||
| 2e03670256 | |||
| 845cca2722 | |||
| 1b7749f108 | |||
| 7ffaa93865 | |||
| 6bd04bc936 | |||
| 8c1afc307a | |||
| d002ea1952 | |||
| 05eb3fd2d6 | |||
| 9fc99cdfbb | |||
| 0f45f286eb | |||
| f07adb2b25 | |||
| ab7e430170 | |||
| 8aa7fbe0ea | |||
| 7fc9b4f943 | |||
| 3d367e9bde | |||
| 582212b361 | |||
| 1528727cc8 | |||
| 492b543c7e | |||
| 0bfe09ba5d | |||
| 76534583db | |||
| b8674ee3fb | |||
| 9f47e2b137 | |||
| aff1d04bab | |||
| 01b0ad461a | |||
| 80c9c4903e | |||
| 757c7ad973 | |||
| 531cba9251 | |||
| 752e87a9f0 | |||
| 508996215f | |||
| f87398b532 | |||
| a6cc0a305e | |||
| bf84e48549 | |||
| 99559d1acd | |||
| 12a4aa4dba | |||
| a53719d91e | |||
| 5a6ec7cf86 | |||
| e84db77a2c | |||
| 34f10d78fc | |||
| 5d3491e72f | |||
| 1e9de0c7f1 | |||
| 626afff37d | |||
| aa677072e0 | |||
| c424dce517 | |||
| 91f6b2e29d | |||
| 7d3138a4cc | |||
| c4f40ed3a7 | |||
| a1c49c827f | |||
| 1f738f0ad4 | |||
| af45426be5 | |||
| 278314f8be | |||
| 4e594d3acd | |||
| 89120afeba | |||
| 1a3a4b275f | |||
| a840ef8ae8 | |||
| 2c79273205 | |||
| ac19ba79d1 | |||
| a40c22a729 | |||
| 911eeea867 | |||
| 1ec931a93a | |||
| 93949b8b96 | |||
| 6a70b5385b | |||
| f483ab87c6 | |||
| 973ecb7058 | |||
| e1ff14e0c4 | |||
| b2380300ff | |||
| 2404bb74c5 | |||
| b1c34faf49 | |||
| b55ac06019 | |||
| eaf211d59c | |||
| 94822c99c0 | |||
| a3347b59a1 | |||
| 3c4b3f0407 | |||
| f4bcf833ec | |||
| aa90411f3a | |||
| 7e8e6e849b | |||
| 3ffd917926 | |||
| 14fc57d24b | |||
| 9302af51a3 | |||
| 287169d6e8 | |||
| fc05827621 | |||
| 04bf65525a | |||
| 872a00242e | |||
| d70948d81e | |||
| 3e77eaa218 | |||
| 28ccf79adf | |||
| 6ebc85b900 | |||
| 51351aac2b | |||
| ba4c7d8138 | |||
| 2871c4701b | |||
| f62eb16176 | |||
| b7477fc4d0 | |||
| faed18f6e8 | |||
| ce79b5023f | |||
| 27364ac890 | |||
| dd7d2d4cf0 | |||
| 023c2188f8 | |||
| ab1f8e01fa | |||
| 3f80e1cad0 | |||
| 393b5ab26e | |||
| 9edede4f3a | |||
| 235c4ae95c | |||
| 54a60add71 | |||
| a06e674305 | |||
| 84ecd1866c | |||
| 2eb2cb7650 | |||
| fcc08f61bc | |||
| 512b5bdaf3 | |||
| f4db8c5360 | |||
| 6b2f9e25cd | |||
| 4099944013 | |||
| 87b62c433d | |||
| de99f89894 | |||
| 308070e019 | |||
| 3d4cf39940 | |||
| 122dcd082a | |||
| aa4b3e2563 | |||
| 47504c9de5 | |||
| 0ed0fa4af6 | |||
| 15817208aa | |||
| ff13d00eb5 | |||
| aaf1cefd1c | |||
| c4c1242ac7 | |||
| f432789853 | |||
| 1cf1f044fb | |||
| 525dfe12e6 | |||
| 0d6fa568ec | |||
| fadc61f89e | |||
| 711787b54d | |||
| f2c44c67b5 | |||
| 0a61c06860 | |||
| ef442c3dc8 | |||
| 420b11a235 | |||
| 5ad60b70ee | |||
| b73210e538 | |||
| 01d43e7db5 | |||
| 20b5056315 | |||
| d66e928529 | |||
| 4ae43c7dd2 | |||
| 5e62e8f22e | |||
| a4b015b39d | |||
| 0761d4f74b | |||
| e34448092e | |||
| 9124a3be53 | |||
| b462814760 | |||
| 2708eea5d1 | |||
| f58026749b | |||
| ed568f4750 | |||
| de824a599a | |||
| a819cb0cc0 | |||
| 3617d79788 | |||
| 657e1deb59 | |||
| c595e6755d | |||
| 4fd169b184 | |||
| 7665af27cd | |||
| df107dac1f | |||
| bfd252b517 | |||
| 90a500ffd6 | |||
| 80cbac3769 | |||
| f82640af7c | |||
| 77f0cd0c46 | |||
| 7a7f1f8390 | |||
| 861fe9e7b3 | |||
| 453963eeae | |||
| aad1a4ca8d | |||
| c6e3324b30 | |||
| 98aa38d800 | |||
| f1c975c89f | |||
| 3beac16030 | |||
| 511c4b73d2 | |||
| 6f5bc22584 | |||
| 744d6d4030 | |||
| d4af97a7a7 | |||
| 710355fd2c | |||
| 46c0d40009 | |||
| a7ac6a0ac7 | |||
| 3a956c51be | |||
| 280dcc7597 | |||
| 37de1286fa | |||
| 4630ae454a | |||
| 42b8cfe404 | |||
| 935c1974e8 | |||
| f913188991 | |||
| eadf52caf2 | |||
| 661755a199 | |||
| 17a4789c1c | |||
| 180ac9e4d2 | |||
| d4b595fdb8 | |||
| f9cd8c200c | |||
| 0557f090fb | |||
| 23b3382347 | |||
| a08b3ec592 | |||
| f6b823ade8 | |||
| 4fac8d6a91 | |||
| 4f550d29aa | |||
| 68ef593292 | |||
| 24f7ffcf18 | |||
| c3529b6129 | |||
| c7893e471f | |||
| e514a3793d | |||
| 68381e69d9 | |||
| aa421772e0 | |||
| 5179a0a40f | |||
| da8a1c7b60 | |||
| e10fe1cd76 | |||
| 88330c07ad | |||
| 88c0edc8f8 | |||
| d82771900e | |||
| 7eadde9911 | |||
| 8e8a1d96e4 | |||
| 842b5609dc | |||
| 960968b8cd | |||
| 9c6576f78e | |||
| 65628dfdec | |||
| 848c0aaa21 | |||
| d16f4930f4 | |||
| 30b7e50a43 | |||
| 0264072b53 | |||
| 0bd3141407 | |||
| b9190ebc16 | |||
| 86e43f1f14 | |||
| 9d37cf1d5a | |||
| 458be36a32 | |||
| 38ad96c57c | |||
| 1c1312624d | |||
| 608b63d979 | |||
| 9047b0347d | |||
| 029f39964b | |||
| 2ec83162d6 | |||
| 3317f406d2 | |||
| 95a017db9f | |||
| 187868def9 | |||
| 154b0ded37 | |||
| 3125c632b5 | |||
| 921ddbd517 | |||
| 65deeaf1e6 | |||
| a1fe864c7f | |||
| 9a0b1efc24 | |||
| d2362719b2 | |||
| 987f371c0b | |||
| 6a9fa9f4d2 | |||
| 5fc268b750 | |||
| 5b62682223 | |||
| 0b64cbc1d2 | |||
| fa622b4e9f | |||
| 52593ef71b | |||
| 9e48e683e7 | |||
| c64c2b6fd0 | |||
| a491eed3ff | |||
| a43424dbb9 | |||
| 13f92e03be | |||
| 6e3aa36876 | |||
| 7a429517af | |||
| 0e8de37778 | |||
| 338cb38ee8 | |||
| 8330009373 | |||
| 5ab705b6fe | |||
| a6c5207859 | |||
| 2361cb8d40 | |||
| d08461907c | |||
| fb997c5057 | |||
| 6de7cb6eed | |||
| 624c5ba5b6 | |||
| 0b3824c86a | |||
| 0d3ec454de | |||
| 12ac162d9e | |||
| d935d3d1b8 | |||
| b705f7eda6 | |||
| 00494c9020 | |||
| bbea1b5679 | |||
| 72fed4d9bb | |||
| 63f55fa78b | |||
| 11709eade6 | |||
| 3806cd8440 | |||
| f6510291aa | |||
| de917994f8 | |||
| d3d64c27b1 | |||
| 1fd6685132 | |||
| 5a1bc6abb4 | |||
| 0d88137738 | |||
| 5bcb780c6d | |||
| c79d189e89 | |||
| 777c6cf073 | |||
| f06eed9809 | |||
| 5bfc23a07e | |||
| 2896b388d7 | |||
| ba62e7be62 | |||
| 193ab9605b | |||
| 5d25bf4ac3 | |||
| dd3cce64c3 | |||
| fb5356ccbc | |||
| 6ac61a1852 | |||
| 70918d2a01 | |||
| f553583f36 | |||
| b22091e8fa | |||
| 651aacd3e9 | |||
| d02f03a7a8 | |||
| dc4b9afebb | |||
| 85b409df85 | |||
| 383629d718 | |||
| f572827157 | |||
| 9d87b0f923 | |||
| 5695a8b595 | |||
| 897f11e517 | |||
| f17c36c031 | |||
| 39960787de | |||
| 43f85bf4f2 | |||
| 8011cd4f0b | |||
| d8bd3afd76 | |||
| 927d2717a9 | |||
| de7b668ad1 | |||
| 396cee7d0d | |||
| fcf104f0ca | |||
| 09b92517d0 | |||
| e16a512699 | |||
| 68592b0445 | |||
| 2ee049d7d8 | |||
| b88a12f8e5 | |||
| f4cc123f16 | |||
| e3486a3e4b | |||
| 5971c272be | |||
| cc64a00216 | |||
| 7ea66a37d5 | |||
| 46030bbc7e | |||
| 887c18a6bf | |||
| 2f93b4225f | |||
| 004d9c7b18 | |||
| 1f6eff371d | |||
| a63502ff55 | |||
| 1f2206159e | |||
| 9900f83d94 | |||
| 1b4aec7bda | |||
| 586c8a70f4 | |||
| 0a6d617073 | |||
| 1348ef100e | |||
| bcffb94eaa | |||
| 7161edab00 | |||
| 03d3216cfe | |||
| 56a6cea0d5 | |||
| 3b7174319a | |||
| 1242eb5dc9 | |||
| b0caa94985 | |||
| 4a91b12221 | |||
| c15707a018 | |||
| 4bf22fa2e6 | |||
| bcf9852eec | |||
| a17d3dc27e | |||
| 0f3110e271 | |||
| 6ce5c90619 | |||
| 6c62e39680 | |||
| 7916c7f393 | |||
| 8d247130d4 | |||
| 89e05fb880 | |||
| ece55718e7 | |||
| b9bf72c457 | |||
| 577870bb45 | |||
| 6b8728428b | |||
| 4d52274432 | |||
| 9464b59137 | |||
| d5cf78e6f7 | |||
| eeb7c9c36d | |||
| 862011a3ee | |||
| 4e76d13428 | |||
| 51d869db57 | |||
| 64132f67c0 | |||
| 43d72713c5 | |||
| 8df2076024 | |||
| ec398f6a55 | |||
| b6deabc55a | |||
| dc261d9291 | |||
| 712b4a16be | |||
| c31e267403 | |||
| 0abb809226 | |||
| 3d2621349c | |||
| 8d621a71c9 | |||
| 761d90e1d7 | |||
| c72a70ffaf | |||
| 05942ff9bc | |||
| 20b3c6437b | |||
| 24a5bdf0e7 | |||
| f28fa07f3b | |||
| 1cc976960b | |||
| a4bbe9908d | |||
| 1fc8b1dd60 | |||
| 85515696e3 | |||
| 0b92ee8d30 | |||
| 0fef23470c | |||
| 03f03a91ae | |||
| 1c33521c69 | |||
| 52f55ef9a0 | |||
| 06c26d468c | |||
| 45a35e61eb | |||
| 9801065683 | |||
| ce664a160b | |||
| 0d7e0274a4 | |||
| b8b891cc25 | |||
| bec179c197 | |||
| 10be3e9bb5 | |||
| b2a57b0974 | |||
| 443654f15b | |||
| 99fe46de55 | |||
| 6a975740b3 | |||
| f8efdbf822 | |||
| 55d4d6084e | |||
| cbec05c428 | |||
| 906580a463 | |||
| e0828bf69b | |||
| 49f1b9bc49 | |||
| 81d05eb8a7 | |||
| 17a09abb6d | |||
| 57e66618e7 | |||
| 23c654519c | |||
| e669382cab | |||
| 4c244b5e06 | |||
| 9a9d93e9f0 | |||
| 1d53afee3f | |||
| d75238496b | |||
| 4d19a783bd | |||
| bd6a593b6c | |||
| d68b3c3b6d | |||
| e8c63b5f43 | |||
| da8ccdad19 | |||
| d81068abc4 | |||
| 5a9dd79ae8 | |||
| 6609f829f4 | |||
| 8dc849d8de | |||
| 8c82d30112 | |||
| 77ad2c101c | |||
| 7cf236ef51 | |||
| 670f87a22a | |||
| 15687a7c9e | |||
| 712cbb540c | |||
| 108cf5e60d | |||
| 6b9c0fe4d9 | |||
| 6b5786aa37 | |||
| dc8f7923f4 | |||
| 59c1a509b4 | |||
| dc65eca3d8 | |||
| 01b831c4c6 | |||
| 28d77b7ebe | |||
| b81d902a2e | |||
| 9eea1444fa | |||
| 1ee6c20e1e | |||
| 157dfbd5c6 | |||
| 2cc4ace60b | |||
| fc78e51452 | |||
| 8fa6752858 | |||
| a68b5efe27 | |||
| 695644d0c4 | |||
| c8c89c7af0 | |||
| 9ff6ed2430 | |||
| 2eae738083 | |||
| 6bed75b41f | |||
| 426f72117b | |||
| affc29aca5 | |||
| 3bd357725a | |||
| 08b3ef7d4e | |||
| deeec4fbf1 | |||
| 7e8a7fc598 | |||
| c1bc7cbafc | |||
| 3fa978c958 | |||
| 1f48897042 | |||
| feab2cb854 | |||
| 2d050edb4e | |||
| dc102049b0 | |||
| 845b15ddd9 | |||
| b9d2e9c092 | |||
| 49512f902c | |||
| 3a6a3330ac | |||
| 086ae2c6ce | |||
| 3e9bd7583c | |||
| fc4f89e079 | |||
| 723e3f2ce0 | |||
| 89883ac325 | |||
| 89850c85a9 | |||
| d8e1f104a4 | |||
| 76e83f613b | |||
| 22b53ec9cd | |||
| dccb56a496 | |||
| 1787a8ac27 | |||
| a2b1284aac | |||
| 7b6a109100 | |||
| 56464bbdd8 | |||
| 87ecbec79d | |||
| 578da38d30 | |||
| fbb1ab9246 | |||
| cd034d6935 | |||
| af85de47c7 | |||
| 178def8291 | |||
| 9f20b2f7dd | |||
| df627065ac | |||
| ad77b5ee2d | |||
| 146ecc2fbb | |||
| 36f523249a | |||
| b0b8e70442 | |||
| 2dba060c6a | |||
| a7316c1770 | |||
| a6f0b5e8d4 | |||
| 821c6ac90b | |||
| aab6dad14f | |||
| 6280432bc7 | |||
| 6d97b7f8f9 | |||
| c6ef1e0390 | |||
| 48ef6617ac | |||
| ef400fa6dc | |||
| 93baed333f | |||
| e9e5ccc891 | |||
| d37f569188 | |||
| a39137e271 | |||
| 25050df434 | |||
| b79c68d829 | |||
| 6712748378 | |||
| 3cdca9e47a | |||
| e57feb4ef6 | |||
| 4ef30a4de9 | |||
| 76755725e5 | |||
| 8a01e21a48 | |||
| ab9c1e4651 | |||
| fdfc12f398 | |||
| ba8f609eb0 | |||
| 114b2d4989 | |||
| 2d270cd0bf | |||
| 89c2c02904 | |||
| 6245821dfe | |||
| 0430fbf861 | |||
| 007b73e5a9 | |||
| 7ec6b68e84 | |||
| 7a92feb474 | |||
| 601c546957 | |||
| 3f57c91613 | |||
| 3d4fb90353 | |||
| 5c325b5d12 | |||
| 60b18508e0 | |||
| 8fc031fb84 | |||
| d8c4e705a2 | |||
| 3495e8a575 | |||
| b7a995c1f1 | |||
| 807770c40a | |||
| b3eeb815b6 | |||
| da43e02228 | |||
| ca28b7c1b3 | |||
| da4ce1788f | |||
| 190a3de3b9 | |||
| ce09914e1d | |||
| 656cc9973e | |||
| a9ced70eed | |||
| 5b988a5e17 | |||
| 5fe4d0f43d | |||
| 96f98ebbb6 | |||
| d6522b5220 | |||
| 3ff8e96e14 | |||
| 5d56ed0158 | |||
| 497aa0c012 | |||
| a7189482f5 | |||
| 26e09b3b7f | |||
| e78066213a | |||
| 610dbf5c92 | |||
| 0892ef1361 | |||
| adca908bce | |||
| d93c79358e | |||
| 7d0b69b94b | |||
| 8cc5b194d4 | |||
| 89e63ed395 | |||
| c01cd051c3 | |||
| b6c2d8b52e | |||
| 68ff62f6e3 | |||
| 4f4b42562a | |||
| 0a2b6b9573 | |||
| 6ac077e2cb | |||
| d2fd84d41f | |||
| ea5245f416 | |||
| 40005c5029 | |||
| 8974008304 | |||
| 29b9577bd2 | |||
| 174bb94648 | |||
| 3b634c3770 | |||
| 4184b7df44 | |||
| 4ddc1cebd1 | |||
| 54762245b8 | |||
| 63e8a8f6c2 | |||
| 16bd616604 | |||
| 9a97a0b3cf | |||
| 7a1217e97c | |||
| efcd7636dc | |||
| c6f4b95131 | |||
| 6794273f7d | |||
| e8ce6e0b10 | |||
| a07fd592cb | |||
| bd7f4f8c49 | |||
| 090107db5f | |||
| f2fb7ef53f | |||
| 36de15de5e | |||
| ab6ee16aa2 | |||
| 48560524a3 | |||
| a5206c33b9 | |||
| 419b4c8002 | |||
| 9123489c32 | |||
| fa0d664063 | |||
| c3f28223f8 | |||
| 8d05e8510f | |||
| 1707cf3dd3 | |||
| bb666ab902 | |||
| 7723437a81 | |||
| 805253de36 | |||
| 40680e2535 | |||
| c917ca5a34 | |||
| 23f5e9de79 | |||
| 6c1d764c4f | |||
| 2b0914ae36 | |||
| d20e4eb6ee | |||
| e11b5b5ace | |||
| 12cc633457 | |||
| bcb857f118 | |||
| 187c45059a | |||
| 3fe5aa037a | |||
| 7af9e42d21 | |||
| abd083b1e3 | |||
| d07de70fc3 | |||
| c1c9e17d79 | |||
| ce3a04f0a8 | |||
| f756f2b394 | |||
| 7ea34be0b8 | |||
| 6bd851a4d0 | |||
| 8d90a23689 | |||
| ea45d96968 | |||
| 771eb5cf1f | |||
| e1f80a1833 | |||
| 0374d53d28 | |||
| 578755d627 | |||
| 89ab54f0d7 | |||
| 80de50711e | |||
| 43bad5d4ae | |||
| 0d86da4f5d | |||
| caeebbfa6f | |||
| 549e9446d8 | |||
| 14c2617e41 | |||
| 6112d479f9 | |||
| 04fe8e623c | |||
| c8422a6029 | |||
| 010c774bc2 | |||
| 22e8e87a00 | |||
| 15a2e1d4e4 | |||
| c5a376cbc8 | |||
| 629422ed86 | |||
| d1611b640b | |||
| 0e5b71923b | |||
| ba47bf2f6f | |||
| 330d9ee9e7 | |||
| d84701deec | |||
| 38711cded6 | |||
| 550e371f10 | |||
| c8aae1c6ee | |||
| 92170818ff | |||
| 0c985ee709 | |||
| f74036dc58 | |||
| d121c4bd37 | |||
| 02452a0375 | |||
| 8324379346 | |||
| 855847f428 | |||
| f07229a9ee | |||
| f92bf30f15 | |||
| b10305ef3b | |||
| e1828057c3 | |||
| bce21304f7 | |||
| 2e75a5c4a4 | |||
| 09dedba379 | |||
| 602b468efd | |||
| 84d789c72b | |||
| 6d835a6e49 | |||
| 2c9f2eb991 | |||
| 0717d63c75 | |||
| bf020d8dfd | |||
| 77174a7b4d | |||
| 214f6712fe | |||
| 71870e6667 | |||
| 0e991f0e72 | |||
| 99967932a4 | |||
| b167c89ca6 | |||
| 4b291b12f8 | |||
| 1344bc5728 | |||
| 4587546330 | |||
| 4e5c094033 | |||
| 7633d9e248 | |||
| a7855fd0ba | |||
| 8d0aa3b589 | |||
| e616889a78 | |||
| 4310c712c3 | |||
| 45b4074e0d | |||
| 2b0646a148 | |||
| b9a80f28f7 | |||
| c78784ac28 | |||
| 61cf1f325f | |||
| b75fadf73d | |||
| b0535c7760 | |||
| c9120ca031 | |||
| 0e0ee67b81 | |||
| baaed4b764 | |||
| 2e5b573192 | |||
| 58b0279f7f | |||
| a512f7cdd7 | |||
| 30b3d92d94 | |||
| 4836d9548d | |||
| 394d3b9325 | |||
| 9ed99ed5f4 | |||
| cdec4027a8 | |||
| badcd21abb | |||
| 136ea16ed8 | |||
| 3cc5bf39f5 | |||
| b0e41b4811 | |||
| 56633e894d | |||
| 0701b7df9f | |||
| 94916b32cb | |||
| b0edff488a | |||
| 0a5ae7e6d8 | |||
| f4cdea8348 | |||
| 429da2b886 | |||
| 87ce2aa25d | |||
| 87c8744724 | |||
| 6f9f2617e7 | |||
| 8c2430d02d | |||
| e2f6064f10 | |||
| 87065c514a | |||
| 0c17078092 | |||
| f9e7760a23 | |||
| 53e79c2155 | |||
| fe78ca1399 | |||
| e1bdc807a8 | |||
| 88186bfd2c | |||
| 2e08b60cf7 | |||
| 7d58ed17c7 | |||
| 79f09ed157 | |||
| b1ee732713 | |||
| ef9f97fa05 | |||
| 7a4b0418bc | |||
| 3d8245a5a6 | |||
| d01df85cd1 | |||
| 1ed7d17b5d | |||
| b48c18b011 | |||
| b496e60eb0 | |||
| 2bf017a0e1 | |||
| 5fa7167181 | |||
| fe39b96db7 | |||
| e225e7e628 | |||
| b15c46d795 | |||
| e7a1572317 | |||
| 1fd0249076 | |||
| e7a6661baa | |||
| 018f1a50b2 | |||
| 4d89b91ed3 | |||
| 24dbf4e00c | |||
| 28a0108e0b | |||
| 87dc82f3e9 | |||
| 0a06ce6490 | |||
| d931ce8096 | |||
| fc0deb2181 | |||
| de6a85bdf5 | |||
| 0ab4571106 | |||
| 8c815bedeb | |||
| d684f3c556 | |||
| 3fe6a25236 | |||
| 8c5a7e7aea | |||
| e7228b6289 | |||
| 72b86bcf72 | |||
| eec4e00b16 | |||
| ff6477e6dd | |||
| d7d01bdc5c |
+3
-4
@@ -1,5 +1,4 @@
|
||||
/autom4te.cache
|
||||
Makefile
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
include/version.h
|
||||
include/sysconf.h
|
||||
build/
|
||||
|
||||
+238
-304
@@ -9,31 +9,177 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN3
|
||||
message(FATAL_ERROR "You can not use CMake to build Anope from the root of it's source tree! Remove the CMakeCache.txt file from this directory, then create a separate directory (either below this directory or elsewhere), and then re-run CMake from there.")
|
||||
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
|
||||
|
||||
# Set the project as C++ primarily, but have C enabled for the checks required later
|
||||
project(Anope CXX)
|
||||
enable_language(C)
|
||||
|
||||
# Detect the version of CMake for the later conditional checks
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --version OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "cmake version 2\\.(.*)" "\\1" ONLY_VERSION "${VERSION}")
|
||||
string(REGEX MATCH "-patch .*$" HAS_PATCH "${ONLY_VERSION}")
|
||||
if(HAS_PATCH)
|
||||
string(REGEX REPLACE "(.*)-patch .*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
string(REGEX REPLACE ".*-patch (.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
|
||||
else(HAS_PATCH)
|
||||
string(REGEX MATCH "\\." HAS_DOT "${ONLY_VERSION}")
|
||||
if(HAS_DOT)
|
||||
string(REGEX REPLACE "(.*)\\..*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
string(REGEX REPLACE ".*\\.(.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
|
||||
else(HAS_DOT)
|
||||
string(REGEX REPLACE "(.*)-beta" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
if(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(PATCH_VERSION 1)
|
||||
else(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(PATCH_VERSION 0)
|
||||
endif(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(MINOR_VERSION 4)
|
||||
endif(HAS_DOT)
|
||||
endif(HAS_PATCH)
|
||||
|
||||
# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does
|
||||
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||
if(MINOR_VERSION GREATER 5)
|
||||
set(CMAKE26_OR_BETTER TRUE)
|
||||
set(CMAKE248_OR_BETTER TRUE)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||
else(MINOR_VERSION GREATER 5)
|
||||
set(CMAKE26_OR_BETTER FALSE)
|
||||
# Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module is non-existant in earlier versions
|
||||
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.3)
|
||||
# Also detect if we are using CMake 2.4.8 or better, the FIND sub-command of list() is non-existant in earlier versions
|
||||
if(PATCH_VERSION GREATER 7)
|
||||
set(CMAKE248_OR_BETTER TRUE)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.3)
|
||||
set(CMAKE244_OR_BETTER FALSE)
|
||||
# ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is non-existant in earlier versions
|
||||
if(CMAKE_PATCH_VERSION GREATER 1)
|
||||
else(PATCH_VERSION GREATER 7)
|
||||
set(CMAKE248_OR_BETTER FALSE)
|
||||
# Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module and SORT sub-command of list() are non-existant in earlier versions
|
||||
if(PATCH_VERSION GREATER 3)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(CMAKE_PATCH_VERSION GREATER 1)
|
||||
set(CMAKE242_OR_BETTER FALSE)
|
||||
endif(CMAKE_PATCH_VERSION GREATER 1)
|
||||
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.3)
|
||||
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||
else(PATCH_VERSION GREATER 3)
|
||||
set(CMAKE244_OR_BETTER FALSE)
|
||||
# ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is non-existant in earlier versions
|
||||
if(PATCH_VERSION GREATER 1)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(PATCH_VERSION GREATER 1)
|
||||
set(CMAKE242_OR_BETTER FALSE)
|
||||
endif(PATCH_VERSION GREATER 1)
|
||||
endif(PATCH_VERSION GREATER 3)
|
||||
endif(PATCH_VERSION GREATER 7)
|
||||
endif(MINOR_VERSION GREATER 5)
|
||||
|
||||
# Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template
|
||||
set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR}/cmake)
|
||||
|
||||
include(Anope)
|
||||
|
||||
# Force the locale to C for later uses of things like gcc so the messages come up in English, not the user's default language
|
||||
set(ENV{LC_ALL} C)
|
||||
|
||||
# Start with empty defaults for library and include directories, to be used by GNU compilers only
|
||||
set(DEFAULT_LIBRARY_DIRS)
|
||||
set(DEFAULT_INCLUDE_DIRS)
|
||||
|
||||
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# First look for the compiler's default library directories
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# Find only the part after "libraries: "
|
||||
string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
|
||||
# Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line
|
||||
if(NOT MINGW)
|
||||
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
|
||||
else(NOT MINGW)
|
||||
set(LIBRARIES "${LINE}")
|
||||
endif(NOT MINGW)
|
||||
# Iterate through the libraries
|
||||
foreach(LIBRARY ${LIBRARIES})
|
||||
# Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
|
||||
string(SUBSTRING ${LIBRARY} 0 1 FIRST_CHAR)
|
||||
if(NOT FIRST_CHAR STREQUAL "=")
|
||||
# If the directory had no = in front of it, make sure it's absolute and add it to the list of default library directories
|
||||
get_filename_component(LIBRARY ${LIBRARY} ABSOLUTE)
|
||||
append_to_list(DEFAULT_LIBRARY_DIRS ${LIBRARY})
|
||||
endif(NOT FIRST_CHAR STREQUAL "=")
|
||||
endforeach(LIBRARY)
|
||||
# Remove duplicate entries from the list
|
||||
if(DEFAULT_LIBRARY_DIRS)
|
||||
remove_list_duplicates(DEFAULT_LIBRARY_DIRS)
|
||||
endif(DEFAULT_LIBRARY_DIRS)
|
||||
# Create a temporary file to test for the default include directories
|
||||
FILE(WRITE empty.cpp "")
|
||||
# Next, we look for the compiler's default include directories
|
||||
# Run the command to find the default include directories
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
# Remove the empty file, it is no longer needed
|
||||
FILE(REMOVE empty.cpp)
|
||||
# Convert the new lines to semicolons
|
||||
string(REGEX REPLACE "\n" ";" LINES ${LINES})
|
||||
# Temporary variable saying if we are in the search list or not
|
||||
set(IN_SEARCH_LIST FALSE)
|
||||
# Iterate through the lines
|
||||
foreach(LINE ${LINES})
|
||||
# If the line has the following on it, the next lines will contain directory names
|
||||
if(LINE STREQUAL "#include <...> search starts here:")
|
||||
set(IN_SEARCH TRUE)
|
||||
else(LINE STREQUAL "#include <...> search starts here:")
|
||||
# If the line has the following on it, we hit the end of the list
|
||||
if(LINE STREQUAL "End of search list.")
|
||||
set(IN_SEARCH FALSE)
|
||||
else(LINE STREQUAL "End of search list.")
|
||||
# If we are within the block between the above two lines...
|
||||
if(IN_SEARCH)
|
||||
# Get everything but the first character of the line
|
||||
string(LENGTH ${LINE} LINE_LENGTH)
|
||||
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
|
||||
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
|
||||
# Convert the path to an absolute one, just in case it wasn't
|
||||
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
|
||||
# Add that directory to the list of default include directories
|
||||
append_to_list(DEFAULT_INCLUDE_DIRS ${INCLUDE})
|
||||
endif(IN_SEARCH)
|
||||
endif(LINE STREQUAL "End of search list.")
|
||||
endif(LINE STREQUAL "#include <...> search starts here:")
|
||||
endforeach(LINE)
|
||||
# Remove duplicate entries from the list
|
||||
if(DEFAULT_INCLUDE_DIRS)
|
||||
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
|
||||
endif(DEFAULT_INCLUDE_DIRS)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
|
||||
if(MSVC)
|
||||
# If the path comes up as "/registry" from any of these, the path wasn't found, otherwise, we'll set WSDK_PATH to the corresponding path
|
||||
# Look for the 2008 SDK under HKLM first
|
||||
get_filename_component(WSDK2008_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
|
||||
if(WSDK2008_PATH STREQUAL "/registry")
|
||||
# If not found, look for the 2003 SDK under HKLM
|
||||
get_filename_component(WSDK2003_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
|
||||
if(WSDK2003_PATH STREQUAL "/registry")
|
||||
# If not found, look for the 2008 SDK under HKCU
|
||||
get_filename_component(WSDK2008_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
|
||||
if(WSDK2008_PATH STREQUAL "/registry")
|
||||
# If not found, look for the 2003 SDK under HKCU
|
||||
get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
|
||||
if(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
# The SDK was never found, set the path to nothing
|
||||
set(WSDK_PATH "")
|
||||
else(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
set(WSDK_PATH "${WSDK2003_PATH}")
|
||||
endif(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
else(WSDK2008_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2008_PATH}")
|
||||
endif(WSDK2008_PATH STREQUAL "/registry")
|
||||
else(WSDK2003_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2003_PATH}")
|
||||
endif(WSDK2003_PATH STREQUAL "/registry")
|
||||
else(WSDK2008_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2008_PATH}")
|
||||
endif(WSDK2008_PATH STREQUAL "/registry")
|
||||
endif(MSVC)
|
||||
|
||||
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition
|
||||
# and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE
|
||||
# to Debug prior to calling PROJECT()
|
||||
# to Debug
|
||||
# Only do this if not using Visual Studio
|
||||
if(NOT MSVC)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
@@ -43,10 +189,6 @@ if(NOT MSVC)
|
||||
endif(CMAKE_BUILD_TYPE)
|
||||
endif(NOT MSVC)
|
||||
|
||||
# Set the project as C++ primarily, but have C enabled for the checks required later
|
||||
project(Anope CXX)
|
||||
enable_language(C)
|
||||
|
||||
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
|
||||
if(MINGW)
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
@@ -65,15 +207,28 @@ else(CMAKE244_OR_BETTER)
|
||||
include(TestCXXAcceptsFlag)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
|
||||
# If extra directories were specified, tell cmake about them.
|
||||
if(EXTRA_INCLUDE)
|
||||
include_directories(${EXTRA_INCLUDE})
|
||||
link_directories(${EXTRA_INCLUDE})
|
||||
endif(EXTRA_INCLUDE)
|
||||
|
||||
# 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)
|
||||
|
||||
# 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)
|
||||
|
||||
# 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
|
||||
@@ -83,17 +238,18 @@ 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 /wd4251 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4251 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS)
|
||||
# Otherwise, we're not using Visual Studio
|
||||
else(MSVC)
|
||||
# Set the compile flags to have all warnings on (including shadowed variables)
|
||||
set(CXXFLAGS "${CXXFLAGS} -Wall -Wshadow")
|
||||
# If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols
|
||||
# If 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 -fno-leading-underscore")
|
||||
# Set the module-specific compile flags to the same setting as the compile flags
|
||||
set(MODULE_CXXFLAGS "${CXXFLAGS}")
|
||||
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic")
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(CXXFLAGS "${CXXFLAGS} -fno-leading-underscore")
|
||||
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# If we aren't on a *nix system, we are using MinGW
|
||||
else(UNIX)
|
||||
# Also, if we are building under MinGW, add another define for MinGW
|
||||
@@ -143,6 +299,18 @@ if(NOT MSVC)
|
||||
if(HAVE_SOCKET_LIB)
|
||||
set(LDFLAGS "${LDFLAGS} -lsocket")
|
||||
endif(HAVE_SOCKET_LIB)
|
||||
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
|
||||
if(HAVE_NSL_LIB)
|
||||
set(LDFLAGS "${LDFLAGS} -lnsl")
|
||||
endif(HAVE_NSL_LIB)
|
||||
# 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")
|
||||
else(HAVE_PTHREAD)
|
||||
message(FATAL_ERROR "The pthread library is required to build Anope")
|
||||
endif(HAVE_PTHREAD)
|
||||
endif(NOT WIN32)
|
||||
endif(NOT MSVC)
|
||||
|
||||
@@ -155,14 +323,17 @@ if(NOT DEFUMASK)
|
||||
endif(RUNGROUP)
|
||||
endif(NOT DEFUMASK)
|
||||
|
||||
# Set the DEBUG_BUILD for sysconf.h
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
|
||||
set(DEBUG_BUILD TRUE)
|
||||
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(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(gethostbyname HAVE_GETHOSTBYNAME)
|
||||
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
|
||||
check_function_exists(setgrent HAVE_SETGRENT)
|
||||
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
||||
check_function_exists(stricmp HAVE_STRICMP)
|
||||
@@ -170,6 +341,7 @@ 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)
|
||||
@@ -181,98 +353,14 @@ check_type_size(int32_t INT32_T)
|
||||
check_type_size(uint32_t UINT32_T)
|
||||
check_type_size(u_int32_t U_INT32_T)
|
||||
|
||||
# Only CMake 2.6.x and later contain the STRIP sub-command for string()
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# Strip the leading and trailing spaces from the compile flags
|
||||
if(CXXFLAGS)
|
||||
string(STRIP ${CXXFLAGS} CXXFLAGS)
|
||||
endif(CXXFLAGS)
|
||||
# Strip the leading and trailing spaces from the linker flags
|
||||
if(LDFLAGS)
|
||||
string(STRIP ${LDFLAGS} LDFLAGS)
|
||||
endif(LDFLAGS)
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
|
||||
# A macro to handle appending to lists
|
||||
macro(append_to_list LIST)
|
||||
if(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.2 or better, we can just use the APPEND sub-command of list()
|
||||
list(APPEND ${LIST} ${ARGN})
|
||||
else(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.2, we have to do this manually use set() instead
|
||||
set(${LIST} ${${LIST}} ${ARGN})
|
||||
endif(CMAKE242_OR_BETTER)
|
||||
endmacro(append_to_list)
|
||||
|
||||
# A macro to handle reading specific lines from a file
|
||||
macro(read_from_file FILE REGEX STRINGS)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, we can just use this function to get the lines that match the given regular expression
|
||||
file(STRINGS ${FILE} RESULT REGEX ${REGEX})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we need to do this manually, firsly we read the file in
|
||||
file(READ ${FILE} ALL_STRINGS)
|
||||
# Next we replace all newlines with semicolons
|
||||
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
||||
# Clear the result list
|
||||
set(RESULT)
|
||||
# Iterate through all the lines of the file
|
||||
foreach(STRING ${ALL_STRINGS})
|
||||
# Check for a match against the given regular expression
|
||||
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
|
||||
# If we had a match, append the match to the list
|
||||
if(STRING_MATCH)
|
||||
append_to_list(RESULT ${STRING})
|
||||
endif(STRING_MATCH)
|
||||
endforeach(STRING)
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
# Set the given STRINGS variable to the result
|
||||
set(${STRINGS} ${RESULT})
|
||||
endmacro(read_from_file)
|
||||
|
||||
# A macro to handle searching within a list
|
||||
macro(find_in_list LIST ITEM_TO_FIND FOUND)
|
||||
if(CMAKE26_OR_BETTER OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.7)
|
||||
# For CMake 2.6.x or better (as well as CMake 2.4.8 or better), we can use the FIND sub-command of list()
|
||||
list(FIND ${LIST} ${ITEM_TO_FIND} ITEM_FOUND)
|
||||
else(CMAKE26_OR_BETTER OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.7)
|
||||
# For CMake 2.4.x before 2.4.8, we have to do this ourselves (NOTE: This is very slow due to a lack of break() as well), firstly we set that we a temporary boolean
|
||||
set(ITEM_FOUND -1)
|
||||
set(POS 0)
|
||||
# Iterate through the list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# If the item we are looking at is the item we are trying to find, set that we've found the item
|
||||
if(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
set(ITEM_FOUND ${POS})
|
||||
endif(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
math(EXPR POS "${POS} + 1")
|
||||
endforeach(ITEM)
|
||||
endif(CMAKE26_OR_BETTER OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.7)
|
||||
# Set the given FOUND variable to the result
|
||||
set(${FOUND} ${ITEM_FOUND})
|
||||
endmacro(find_in_list)
|
||||
|
||||
# A macro to handle removing duplicates from a list
|
||||
macro(remove_list_duplicates LIST)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, this can be done automatically
|
||||
list(REMOVE_DUPLICATES ${LIST})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we have to do this ourselves, firstly we'll clear a temporary list
|
||||
set(NEW_LIST)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# Check if the item is in the new list
|
||||
find_in_list(NEW_LIST ${ITEM} FOUND_ITEM)
|
||||
if(FOUND_ITEM EQUAL -1)
|
||||
# If the item was not found, append it to the list
|
||||
append_to_list(NEW_LIST ${ITEM})
|
||||
endif(FOUND_ITEM EQUAL -1)
|
||||
endforeach(ITEM)
|
||||
# replace the old list with the new list
|
||||
set(${LIST} ${NEW_LIST})
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
endmacro(remove_list_duplicates)
|
||||
# Strip the leading and trailing spaces from the compile flags
|
||||
if(CXXFLAGS)
|
||||
strip_string(${CXXFLAGS} CXXFLAGS)
|
||||
endif(CXXFLAGS)
|
||||
# Strip the leading and trailing spaces from the linker flags
|
||||
if(LDFLAGS)
|
||||
strip_string(${LDFLAGS} LDFLAGS)
|
||||
endif(LDFLAGS)
|
||||
|
||||
# Search for the following programs
|
||||
find_program(GREP grep)
|
||||
@@ -296,8 +384,8 @@ else(INSTDIR)
|
||||
endif(INSTDIR)
|
||||
|
||||
# Version number processing
|
||||
# Find all lines in version.log that start with VERSION_
|
||||
read_from_file(${Anope_SOURCE_DIR}/version.log "^VERSION_" VERSIONS)
|
||||
# Find all lines in src/version.sh that start with VERSION_
|
||||
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
|
||||
# Iterate through the strings found
|
||||
foreach(VERSION_STR ${VERSIONS})
|
||||
# Get the length of the string
|
||||
@@ -312,6 +400,25 @@ foreach(VERSION_STR ${VERSIONS})
|
||||
set(VERSION_${VERSION_TYPE} ${VERSION})
|
||||
endforeach(VERSION_STR ${VERSIONS})
|
||||
|
||||
# Default build version to 0
|
||||
set(VERSION_BUILD 0)
|
||||
|
||||
# Only change the build number if version.h exists
|
||||
if(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
|
||||
# Attempt to read the build number from include/version.h
|
||||
read_from_file(${Anope_SOURCE_DIR}/include/version.h "^#define VERSION_BUILD" VERSIONS)
|
||||
foreach(VERSION_STR ${VERSIONS})
|
||||
# Get the length of the string
|
||||
string(LENGTH ${VERSION_STR} VERSION_LEN)
|
||||
# Subtract 22 from the string's length
|
||||
math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - 22")
|
||||
# Extract the value from the string
|
||||
string(SUBSTRING ${VERSION_STR} 22 ${VERSION_NUM_LEN} VERSION)
|
||||
# Set VERSION_BUILD correctly
|
||||
set(VERSION_BUILD ${VERSION})
|
||||
endforeach(VERSION_STR ${VERSIONS})
|
||||
endif(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
|
||||
|
||||
# Set the version variables based on what was found above
|
||||
set(VERSION_COMMA "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_BUILD}")
|
||||
set(VERSION_DOTTED_NOBUILD "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
||||
@@ -322,181 +429,11 @@ set(VERSION_FULL_NOBUILD "${VERSION_DOTTED_NOBUILD}${VERSION_EXTRA}")
|
||||
# Only do the following for Windows
|
||||
if(WIN32)
|
||||
# Generate the win32.rc file using the above variables
|
||||
configure_file(${Anope_SOURCE_DIR}/src/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32.rc)
|
||||
configure_file(${Anope_SOURCE_DIR}/src/win32/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32/win32.rc)
|
||||
endif(WIN32)
|
||||
|
||||
# Calculate dependencies for each header
|
||||
# I would've done this inside the CMakeLists.txt for the include directory, but since it's added AFTER everything else, it won't help...
|
||||
|
||||
# Firstly, find all the header files
|
||||
file(GLOB_RECURSE ALL_HEADERS "*.h")
|
||||
# Iterate through the headers
|
||||
foreach(HEADER ${ALL_HEADERS})
|
||||
# Don't process the file if it's in an obsolete directory
|
||||
if(NOT HEADER MATCHES ".*obsolete.*")
|
||||
append_to_list(TMP_HEADERS ${HEADER})
|
||||
# In addition, also set up a variable to store the fullpath of the header, in a variable prefixed with just the header's filename for easy access later
|
||||
get_filename_component(HEADER_FILENAME ${HEADER} NAME)
|
||||
set(${HEADER_FILENAME}_FULLPATH ${HEADER})
|
||||
endif(NOT HEADER MATCHES ".*obsolete.*")
|
||||
endforeach(HEADER)
|
||||
# Set the list of headers to be all the non-obsolete ones, then sort the list
|
||||
set(ALL_HEADERS ${TMP_HEADERS})
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT ALL_HEADERS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
|
||||
# This function will take a #include line and extract the filename minus the quotes
|
||||
macro(extract_include_filename INCLUDE FILENAME)
|
||||
# Detect if there is any trailing whitespace (basically see if the last character is a space or a tab)
|
||||
string(LENGTH ${INCLUDE} INCLUDE_LEN)
|
||||
math(EXPR LAST_CHAR_POS "${INCLUDE_LEN} - 1")
|
||||
string(SUBSTRING ${INCLUDE} ${LAST_CHAR_POS} 1 LAST_CHAR)
|
||||
# Only strip if the last character was a space or a tab
|
||||
if(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
# Strip away trailing whitespace from the line
|
||||
string(REGEX REPLACE "[ \t]*$" "" INCLUDE_STRIPPED ${INCLUDE})
|
||||
else(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
# Just copy INCLUDE to INCLUDE_STRIPPED so the below code doesn't complain about a lack of INCLUDE_STRIPPED
|
||||
set(INCLUDE_STRIPPED ${INCLUDE})
|
||||
endif(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
# Find the filename including the quotes, it should be at the end of the line after whitespace was stripped
|
||||
string(REGEX MATCH "\".*\"$" FILE ${INCLUDE_STRIPPED})
|
||||
# Get the length of the filename with quotes
|
||||
string(LENGTH ${FILE} FILENAME_LEN)
|
||||
# Subtract 2 from this length, for the quotes
|
||||
math(EXPR FILENAME_LEN "${FILENAME_LEN} - 2")
|
||||
# Overwrite the filename with a version sans quotes
|
||||
string(SUBSTRING ${FILE} 1 ${FILENAME_LEN} FILE)
|
||||
# Set the filename to the the given variable
|
||||
set(${FILENAME} "${FILE}")
|
||||
endmacro(extract_include_filename)
|
||||
|
||||
# Preparse step 1: get filenames sans paths
|
||||
# Iterate through the headers
|
||||
foreach(HEADER ${ALL_HEADERS})
|
||||
# Find all the lines in the current header that have any form of #include on them, regardless of whitespace
|
||||
read_from_file(${HEADER} "^[ \t]*#[ \t]*include[ \t]*\".*\"[ \t]*$" INCLUDES)
|
||||
# Get the filename only of the header we just checked
|
||||
get_filename_component(HEADER_FILENAME ${HEADER} NAME)
|
||||
# Iterate through the strings containing #include (if any)
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
extract_include_filename(${INCLUDE} FILENAME)
|
||||
# Append this filename to the list of headers for the header we are checking
|
||||
append_to_list(${HEADER_FILENAME}_HEADERS ${FILENAME})
|
||||
endforeach(INCLUDE)
|
||||
endforeach(HEADER)
|
||||
|
||||
# Preparse step 2: for every header from above that had includes, recursively find the headers each header relies on
|
||||
# Iterate through the headers (again)
|
||||
foreach(HEADER ${ALL_HEADERS})
|
||||
# Get the filename only of the current header
|
||||
get_filename_component(HEADER_FILENAME ${HEADER} NAME)
|
||||
# If there were any include, we'll be checking them
|
||||
if(${HEADER_FILENAME}_HEADERS)
|
||||
# Set the variables, old for all previously found headers, new for all newly found headers
|
||||
set(OLD_HEADERS)
|
||||
set(HEADERS ${${HEADER_FILENAME}_HEADERS})
|
||||
set(NEW_HEADERS)
|
||||
# Loop as long as there are still headers to be parsed
|
||||
while(HEADERS)
|
||||
# Iterate through the list of the current headers
|
||||
foreach(CURR_HEADER ${HEADERS})
|
||||
# If that header has headers it relies on, we'll add them to the list of new headers
|
||||
if(${CURR_HEADER}_HEADERS)
|
||||
foreach(CURR_HEADERS_HEADER ${${CURR_HEADER}_HEADERS})
|
||||
append_to_list(NEW_HEADERS ${CURR_HEADERS_HEADER})
|
||||
endforeach(CURR_HEADERS_HEADER)
|
||||
endif(${CURR_HEADER}_HEADERS)
|
||||
endforeach(CURR_HEADER)
|
||||
# Append the headers we checked to the old headers
|
||||
append_to_list(OLD_HEADERS ${HEADERS})
|
||||
# Set the headers to check to the new headers (it may be empty and that'll exit the loop)
|
||||
set(HEADERS ${NEW_HEADERS})
|
||||
# Erase the new headers
|
||||
set(NEW_HEADERS)
|
||||
endwhile(HEADERS)
|
||||
# OLD_HEADERS will now contain all headers that the current header relies on, remove duplicate headers from the list and sort the list
|
||||
remove_list_duplicates(OLD_HEADERS)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT OLD_HEADERS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
# Set the current header's list of headers to the cleaned up list from above
|
||||
set(${HEADER_FILENAME}_HEADERS ${OLD_HEADERS})
|
||||
endif(${HEADER_FILENAME}_HEADERS)
|
||||
endforeach(HEADER)
|
||||
|
||||
# The following headers are generated from CMake rules and won't be found with the above
|
||||
append_to_list(ALL_HEADERS ${Anope_BINARY_DIR}/lang/language.h ${Anope_BINARY_DIR}/include/sysconf.h ${Anope_BINARY_DIR}/include/version.h)
|
||||
set(language.h_FULLPATH ${Anope_BINARY_DIR}/lang/language.h)
|
||||
set(sysconf.h_FULLPATH ${Anope_BINARY_DIR}/include/sysconf.h)
|
||||
set(version.h_FULLPATH ${Anope_BINARY_DIR}/include/version.h)
|
||||
|
||||
# This function is used in most of the src (sub)directories to calculate the header file dependencies for the given source file
|
||||
macro(calculate_depends SRC)
|
||||
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace
|
||||
read_from_file(${SRC} "^[ \t]*#[ \t]*include[ \t]*\".*\"[ \t]*$" INCLUDES)
|
||||
# Reset the list of headers to empty
|
||||
set(HEADERS)
|
||||
# Iterate through the strings containing #include (if any)
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
extract_include_filename(${INCLUDE} FILENAME)
|
||||
# Append the filename to the list of headers
|
||||
append_to_list(HEADERS ${FILENAME})
|
||||
endforeach(INCLUDE)
|
||||
# Set the list of new headers to empty (this will store all the headers that the above list depends on)
|
||||
set(NEW_HEADERS)
|
||||
# Iterate through the list of headers
|
||||
foreach(HEADER ${HEADERS})
|
||||
# If the current header has it's own headers to depend on, append those to the list of new headers
|
||||
if(${HEADER}_HEADERS)
|
||||
append_to_list(NEW_HEADERS ${${HEADER}_HEADERS})
|
||||
endif(${HEADER}_HEADERS)
|
||||
endforeach(HEADER)
|
||||
# If there were new headers, append them to the list of headers
|
||||
if(NEW_HEADERS)
|
||||
append_to_list(HEADERS ${NEW_HEADERS})
|
||||
endif(NEW_HEADERS)
|
||||
# If after all the above there is a list of header, we'll process them, converting them to full paths
|
||||
if(HEADERS)
|
||||
# Remove duplicate headers from the list and sort the list
|
||||
remove_list_duplicates(HEADERS)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT HEADERS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
# Set the list of full path headers to empty
|
||||
set(HEADERS_FULL)
|
||||
# Iterate through the list of headers
|
||||
foreach(HEADER ${HEADERS})
|
||||
# Append the full path of the header to the full path headers list
|
||||
append_to_list(HEADERS_FULL ${${HEADER}_FULLPATH})
|
||||
endforeach(HEADER)
|
||||
# Set the given source file to depend on the headers given
|
||||
set_source_files_properties(${SRC} PROPERTIES OBJECT_DEPENDS "${HEADERS_FULL}")
|
||||
endif(HEADERS)
|
||||
endmacro(calculate_depends)
|
||||
|
||||
# A macro to update the environment variable CPACK_IGNORED_FILES which contains a list of files for CPack to ignore
|
||||
macro(add_to_cpack_ignored_files ITEM)
|
||||
# Temporary copy of the orignal item
|
||||
set(REAL_ITEM "${ITEM}")
|
||||
# If we have 2+ arguments, assume that the second one was something like TRUE (doesn't matter really) and convert periods so they will be \\. for CPack
|
||||
if(${ARGC} GREATER 1)
|
||||
string(REPLACE "." "\\\\." REAL_ITEM ${REAL_ITEM})
|
||||
endif(${ARGC} GREATER 1)
|
||||
# If the environment variable is already defined, just tack the item to the end
|
||||
if(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "$ENV{CPACK_IGNORED_FILES};${REAL_ITEM}")
|
||||
# Otherwise set the environment variable to the item
|
||||
else(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
|
||||
endif(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
endmacro(add_to_cpack_ignored_files)
|
||||
|
||||
# Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source
|
||||
add_to_cpack_ignored_files(".git\;config.cache\;.svn\;CMakeFiles\;sysconf.h$\;Makefile.inc$\;config.log\;config.status" TRUE)
|
||||
add_to_cpack_ignored_files(".git\;config.cache\;CMakeFiles\;sysconf.h$\;build" TRUE)
|
||||
# Add the files we don't want the periods converted for
|
||||
add_to_cpack_ignored_files(".\\\\\\\\.so$;.\\\\\\\\.o$;.\\\\\\\\.s$;${Anope_SOURCE_DIR}/Makefile$")
|
||||
# If the two directories are the same, we are building in-source, thus we need to ignore more files from the build
|
||||
@@ -514,8 +451,9 @@ 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)
|
||||
|
||||
# Get the filename of the Anope binary, to use later
|
||||
@@ -535,18 +473,13 @@ if(NOT WIN32 AND RUNGROUP)
|
||||
endif(NOT WIN32 AND RUNGROUP)
|
||||
# On Windows platforms, install extra files
|
||||
if(WIN32)
|
||||
install(FILES ${Anope_SOURCE_DIR}/anope.bat
|
||||
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
|
||||
DESTINATION bin
|
||||
)
|
||||
install(FILES ${Anope_SOURCE_DIR}/Changes ${Anope_SOURCE_DIR}/Changes.conf ${Anope_SOURCE_DIR}/Changes.lang
|
||||
DESTINATION .
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
# Only process the CPack section if we have CPack
|
||||
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
# Override the module include path to include our directory, as we are using our own version of the NSIS template
|
||||
set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR})
|
||||
# Various options for CPack
|
||||
set(CPACK_PACKAGE_NAME "Anope IRC Services")
|
||||
set(CPACK_PACKAGE_VENDOR "Anope Team")
|
||||
@@ -569,17 +502,18 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
"bin\\\\anope.bat\\\" \\\"-debug -nofork" "Anope IRC Services (Debug and Window Logging)"
|
||||
"bin\\\\anope.bat\\\" \\\"-nofork" "Anope IRC Services (Window Logging)"
|
||||
"bin\\\\anope.bat\\\" \\\"-nothird" "Anope IRC Services (No Third Party Modules)"
|
||||
"http://www.anope.org" "Anope Web Site"
|
||||
"http://www.anope.org/" "Anope Web Site"
|
||||
)
|
||||
# The following doesn't work, but a bug report has been filed about it
|
||||
#set(CPACK_CREATE_DESKTOP_LINK_${SERVICES_BINARY} TRUE)
|
||||
set(CPACK_NSIS_MUI_ICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico")
|
||||
set(CPACK_NSIS_MUI_ICON "${Anope_SOURCE_DIR}/src\\\\win32\\\\anope-icon.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "${Anope_SOURCE_DIR}/src\\\\win32\\\\anope-icon.ico")
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${SERVICES_BINARY}")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.anope.org")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.anope.org/")
|
||||
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
|
||||
endif(WIN32)
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}-source")
|
||||
set(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
set(CPACK_SOURCE_IGNORE_FILES "$ENV{CPACK_IGNORED_FILES}")
|
||||
set(CPACK_MONOLITHIC_INSTALL TRUE)
|
||||
include(CPack)
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
Orginally pulled from: http://www.inspircd.org/wiki/Coding_Guidelines
|
||||
Yes, I'm aware the formatting of this document is ugly. It'll be fixed when someone cares. Read the wiki page if you want pretty for now.
|
||||
|
||||
---
|
||||
|
||||
|
||||
InspIRCd Coding Guidelines
|
||||
|
||||
The following are a set of guidelines for writing patches to InspIRCd, or for creating modules for distribution with the official package. These
|
||||
guidelines were written a time after InspIRCd development started, and so not all code yet follows these. This will be rectified with time.
|
||||
|
||||
|
||||
1. Comments
|
||||
Multi Line
|
||||
Multiple line comments should follow the C-style comment, for example:
|
||||
/*
|
||||
* This is a multiple line comment, huzzah..
|
||||
*/
|
||||
|
||||
Single Line
|
||||
Single line comments should also be in the C style, for example:
|
||||
/* This is a boring one-line comment */
|
||||
|
||||
Doxygen commenting
|
||||
If you wish your comment to show in doxygen, the comment should be directly above the item you are documenting (a class, function, enum, etc)
|
||||
and the first line should be "/**". For example:
|
||||
/** This is a doxygen multiline comment.
|
||||
* Description of thingymebob here.
|
||||
*/
|
||||
The first line after the "**" is used as the short description of the item (up to the full stop) and everything afterwards as the detailed
|
||||
description.
|
||||
|
||||
Indentation
|
||||
Tabs. Tabs. ONLY TABS. Use a single tab for each level of indentation, for example:
|
||||
int main()
|
||||
{
|
||||
<tab>if (condition)
|
||||
<tab>{
|
||||
<tab><tab>code
|
||||
<tab>}
|
||||
}
|
||||
|
||||
|
||||
Separation
|
||||
Always put a space in between a keyword like if/while and the condition, for example:
|
||||
if (foo == bar)
|
||||
NOT
|
||||
if(foo == bar)
|
||||
|
||||
Braces
|
||||
Always put braces opening and closing blocks on separate lines, see the identation example. For example, place braces like this:
|
||||
if (apples == "green")
|
||||
{
|
||||
cout << "Apples are green" << endl;
|
||||
}
|
||||
|
||||
and not:
|
||||
if (apples == "green") {
|
||||
cout << "Apples are green" << endl;
|
||||
}
|
||||
The one exception to this is if you are declaring a class method which is only one line long, in that case the following is acceptable in most cases:
|
||||
class foo : public bar
|
||||
{
|
||||
foo() { }
|
||||
getrandomfoo() { return rand(); }
|
||||
};
|
||||
|
||||
Templates
|
||||
Where possible, use templates rather than #defines. Avoid use of RTTI.
|
||||
Structs
|
||||
Structs should be declared in the following fashion:
|
||||
struct BodyPartBasket
|
||||
{
|
||||
int arms;
|
||||
int legs;
|
||||
int scrotalsacs;
|
||||
};
|
||||
and not like this:
|
||||
typedef struct
|
||||
{
|
||||
int arms;
|
||||
int legs;
|
||||
int scrotalsacs;
|
||||
} BodyPartBasket;
|
||||
The second way is not required in C++ to be able to do this:
|
||||
BodyPartBasket mybasket;
|
||||
Plus, placing the name at the bottom of the declaration makes readability more difficult (as you have to scroll down to the bottom of the
|
||||
struct to find its name).
|
||||
(where possible, call them classes rather than structs.)
|
||||
|
||||
Variable naming
|
||||
Class and struct names should be in camel case with a leading capital letter, for example "MyBagOfBones" and not "my_bag_of_bones" or
|
||||
"mybagofbones". Variable names can be in either camel case with a leading capital letter or alternatively all lower case, so long as the same
|
||||
naming convention is adhered to throughout the class. No classes or variables should be named in capitals unless this makes sense for the
|
||||
name (for example "class DNS"). Constants and enum values should always be completely in CAPITALS and underscores may be used, for example:
|
||||
enum DecayState
|
||||
{
|
||||
DECAYED_MOULDY = 0,
|
||||
DECAYED_SMELLY = 1,
|
||||
DECAYED_MAGGOTS = 2
|
||||
};
|
||||
All value names in an enum should be started with the same text which should be related in some way to the enum's use. For example "DNS_CNAME,
|
||||
DNS_A, DNS_AAAA".
|
||||
|
||||
Use of references
|
||||
Wherever possible, when dealing with any complex class, pass a const reference rather than a copy of the class. For example:
|
||||
MyThingy::MyThingy(const std::string &thingyvalue)
|
||||
{
|
||||
}
|
||||
Of course, if you intended to change the string you can just omit the 'const'.
|
||||
|
||||
Use of char pointers
|
||||
Whenever you use char pointers (char*, char**) try to use const equivalents. This is much safer and avoids ugly and dangerous casts. For example:
|
||||
MyThingy::Thingify(const char* const* wotsits)
|
||||
{
|
||||
}
|
||||
If it is possible without performance loss, consider avoiding char pointers altogether and using std::string instead.
|
||||
|
||||
Use of STL
|
||||
For more information on use of STL in InspIRCd, please see the separate STL FAQ.
|
||||
|
||||
Making copies of data
|
||||
Never ever make a copy of a piece of data unless it is absolutely necessary. For example, don't use strlcpy() to make a copy of the const char* string
|
||||
returned by std::string::c_str(), if the change can be done to the std::string itself. The same goes for unnecessary variable assignments, especially
|
||||
those which assign large classes.
|
||||
|
||||
namespace std
|
||||
Avoid the following:
|
||||
using namespace std;
|
||||
It might take a bit more typing, but things work better if you don't set (then later assume) the namespace -- specify it explicitly when you want to
|
||||
use it.
|
||||
|
||||
Linefeeds
|
||||
Unix linefeeds only please. We do not like to see our screens covered in ^M. :-)
|
||||
|
||||
Portability
|
||||
Always make sure your code is portable to all supported operating systems, remember of course that as of 1.1.8 this includes windows. Don't write code
|
||||
that only works on windows, or only works on Linux. Test your code on all platforms or ask for help from other developers who have the platforms you
|
||||
want to test on.
|
||||
|
||||
new() and delete(), malloc() and free()
|
||||
Apart from the fact that using malloc() and free() is bad practice in C++ code, you must never use malloc() or free() in InspIRCd, within its modules
|
||||
or within the core. This is because if you use malloc() or free() in windows, the memory is claimed from the program's local heap. In windows, each
|
||||
shared object (module, dll) has its own heap, which is protected from other dlls and executables. To get around this issue and allow more posix-like
|
||||
memory access from other dlls in the program (other modules), InspIRCd overrides the operators new and delete to ensure that memory allocated by them
|
||||
comes from the windows global heap. If you use malloc() and free() for this, the ircd will segfault when another module tries to access the memory you
|
||||
have allocated!
|
||||
|
||||
strdup()
|
||||
As with malloc(), above, strdup() should be avoided. Where strdup() is absolutely necessary, use strnewdup() which is our strdup() implementation that
|
||||
calls operator new instead of using malloc(). char arrays allocated by strnewdup() should be deleted with operator delete[].
|
||||
|
||||
CoreExport and DllImport
|
||||
Prefix all types you want to import or export to other modules with CoreExport and DllImport macros. These do nothing in POSIX operating systems,
|
||||
however in windows these are expanded to the instructions __declspec(dllimport) and __declspec(dllexport) respectively depending on where they are
|
||||
used and how.
|
||||
|
||||
External Dependencies
|
||||
If a module is compiled as standard, or the code is part of the core, you must not use any dependencies that are not available as standard on all
|
||||
supported operating systems beyond libstdc++, libc, and whatever else is currently required to build the core. Modules which use nonstandard
|
||||
dependencies belong in the modules/extra directory.
|
||||
|
||||
Profiling and Performance
|
||||
It is one thing to assume that code performs bad, it is another thing to prove that it actually is. A lot of experienced programmers talk about
|
||||
'premature optimisation', and here is what it means: if you have a piece of code called once on startup that takes 10 seconds instead of one second to
|
||||
run, and a piece of code that takes 0.05 seconds to run when it should take 0.01, and it is called once per second, the second piece of code is the
|
||||
priority.
|
||||
In other words, make sure that what you think is slow, and a performance problem in Insp actually is.
|
||||
To do this, use the callgrind tool from Valgrind (valgrind --tool=cachegrind bin/inspircd -nofork -debug), and kcachegrind (or similar) to view the
|
||||
output files.
|
||||
@@ -1,12 +0,0 @@
|
||||
Anope Version 1.9.0
|
||||
--------------------
|
||||
09/27 F Modified compile to use g++
|
||||
10/01 F Improve protocol modules support (classes, virtual methods, etc)
|
||||
10/11 F Move core services to use BotInfo
|
||||
10/12 F Move BotInfo and related methods into a class
|
||||
11/01 F Move modules into a class
|
||||
11/15 F Fixed ns resending of passcode issue
|
||||
11/15 F Modules now delete themselves
|
||||
|
||||
Provided by mooncup <mooncup@anonnet.org> - 2009
|
||||
02/04 F Automatically reapply vhost on hs off for unreal32. [ #00]
|
||||
-782
@@ -1,782 +0,0 @@
|
||||
Anope Version 1.8.0
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
|
||||
Anope Version 1.7.24
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.23b
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.23
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
# OSIgnoreDBName [OPTIONAL]
|
||||
# Module: os_ignore_db
|
||||
#
|
||||
# Use the given filename as database for services ignores.
|
||||
# If not given, the default of "os_ignore.db" will be used.
|
||||
#
|
||||
#OSIgnoreDBName "os_ignore.db"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.22
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
# BotCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of BotServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
BotCoreModules "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot bs_fantasy bs_fantasy_kick bs_fantasy_kickban bs_fantasy_owner bs_fantasy_seen"
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.21
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.20
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.19
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.18
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
###########################################################################
|
||||
#
|
||||
# Encryption settings
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# EncModule <module_name> [REQUIRED]
|
||||
# The encryption module to use when dealing with passwords.
|
||||
# This determines how the passwords are stored in the databases,
|
||||
# and does not add any security as far as transmitting passwords over
|
||||
# the network goes.
|
||||
# enc_none provides no password encryption, storing the password in
|
||||
# plain text, this is the most versiatle as passwords can easily be
|
||||
# recovered.
|
||||
#
|
||||
# NOTE: users of anope's previous (broken) md5 implementation should
|
||||
# select the enc_old option, or things may break.
|
||||
#
|
||||
# NOTE2: Some of these encryption methods are one-way (md5, sha1, old)
|
||||
# meaning that you can NOT retrive the passwords in plain text once
|
||||
# encrypted.
|
||||
#
|
||||
# Plain Text - enc_none
|
||||
# Previous (broken) MD5 - enc_old
|
||||
# MD5 - enc_md5
|
||||
# SHA1 - enc_sha1
|
||||
#
|
||||
|
||||
EncModule "enc_none"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.17
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.16
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.15
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
# UseStrictPrivMsg [OPTIONAL]
|
||||
# Using this directive will force services to only respond to privmsgs
|
||||
# addressed to Nick@ServerName - e.g. NickServ@localhost.net.
|
||||
# This should be used on conjunction with ircd aliases.
|
||||
#
|
||||
|
||||
#UseStrictPrivMsg
|
||||
|
||||
# NSResendDelay <time> [RECOMMENDED]
|
||||
# Sets the minimum length of time between consecutive uses of the
|
||||
# RESEND command. If not given, this restriction is disabled (note
|
||||
# that this allows "resend flooding" or "mail bombing").
|
||||
|
||||
NSResendDelay 90s
|
||||
|
||||
NSDefAutoop
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
ModuleDelayedAutoload "cs_appendtopic cs_enforce ns_maxemail os_info hs_request"
|
||||
|
||||
# LimitSessions [OPTIONAL]
|
||||
# Enables session limiting. Session limiting prevents users from
|
||||
# connecting more than a certain number of times from the same host at the
|
||||
# same time - thus preventing most types of cloning. Once a host reaches
|
||||
# it's session limit, all clients attempting to connect from that host
|
||||
# will be killed. Exceptions to the default session limit, which are based
|
||||
# on host names, can be defined via the exception list. It should be noted
|
||||
# that session limiting, along with a large exception list, can degrade
|
||||
# services' performance. See the source and comments in sessions.c and the
|
||||
# online help for more information about session limiting.
|
||||
#
|
||||
# NOTE: This option is not available when STREAMLINED is defined in
|
||||
# the Makefile.
|
||||
|
||||
LimitSessions
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
# NSAutoOPDBName [OPTIONAL]
|
||||
# Module: ns_noop
|
||||
#
|
||||
# Use the given filename as database for the autoop list. If not given,
|
||||
# the default of "autoop.db" will be used.
|
||||
#
|
||||
#NSAutoOPDBName "autoop.db"
|
||||
|
||||
# KillClonesAkillExpire <time> [REQUIRED]
|
||||
# Sets the expiry time for autokills added for hosts that have been
|
||||
# killed using the KILLCLONES command.
|
||||
|
||||
KillClonesAkillExpire 30m
|
||||
|
||||
# CheckClones <minusers> <maxdelay> <warningdelay> [DEPRECATED]
|
||||
# Causes Services to try and detect "clones" connecting to the network.
|
||||
# A WALLOPS (or GOPER, if supported on the IRC server) will be sent if
|
||||
# Services thinks it has found clones.
|
||||
#
|
||||
# This feature has been superseded by Session Limiting.
|
||||
#
|
||||
# <minusers> sets the minimum number of users which must successively
|
||||
# connect to the network before Services will send a clone warning.
|
||||
#
|
||||
# <maxdelay> sets the maximum time that can elapse between successive
|
||||
# users before Services decides they are not clones.
|
||||
#
|
||||
# <warningdelay> sets the minimum time between clone warnings for
|
||||
# clones from the same host.
|
||||
#
|
||||
# NOTE: This option is not available when STREAMLINED is defined in
|
||||
# the Makefile.
|
||||
|
||||
# CheckClones 5 10s 30s
|
||||
|
||||
# KillClones [DISCOURAGED] [DEPRECATED]
|
||||
# Causes Services to kill users which trigger the clone warnings. (If
|
||||
# CheckClones is disabled, this will have no effect.)
|
||||
#
|
||||
# This feature has been superceded by Session Limiting.
|
||||
#
|
||||
# BEWARE! The clone checking code is easily fooled; it can be
|
||||
# triggered falsely under many conditions, for example:
|
||||
#
|
||||
# - Multiple users connecting from a shell machine.
|
||||
#
|
||||
# - A single user repeatedly connecting and disconnecting.
|
||||
#
|
||||
# Be very sure you know what you're doing before you even think about
|
||||
# enabling this option, and remember that Services comes with no
|
||||
# warranty.
|
||||
#
|
||||
# If that wasn't enough discouragement:
|
||||
#
|
||||
# ***** DO NOT ENABLE THIS OPTION! *****
|
||||
#
|
||||
# NOTE: This option is not available when STREAMLINED is defined in
|
||||
# the Makefile.
|
||||
|
||||
#KillClones
|
||||
|
||||
Anope Version 1.7.13
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.12
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# BSFantasyCharacter [REQUIRED]
|
||||
# This option allows you to change the default prefix for fantasy
|
||||
# commands in channels. This character will have to be prepended to all
|
||||
# fantasy commands. If you choose "!" (the default), fantasy commands
|
||||
# will, for example, be "!kick", "!op", etc.
|
||||
|
||||
BSFantasyCharacter "!"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.11
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NickLen [REQUIRED]
|
||||
# Set this to the maximum allowed nick length on your network. Anope does
|
||||
# not support values larger than 31, so setting them makes no sense. Be
|
||||
# sure to set this correctly, as setting this wrong can result in services
|
||||
# being disconnected from the network.
|
||||
|
||||
NickLen 31
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
# UserKey1|2|3 <value> [RECOMMENDED]
|
||||
#
|
||||
# These keys are required to initiate the random number generator. These
|
||||
# numbers MUST be random as you want your passcodes to be random. Don't
|
||||
# give these keys to anyone! Keep them private!
|
||||
#
|
||||
# *** NOTE ***
|
||||
# If you don't enable these, or keep their default values, any talented
|
||||
# programmer would be able to easily "guess" random strings used to mask
|
||||
# information. Be safe, and come up with three different 7 digit numbers
|
||||
|
||||
#UserKey1 9866235
|
||||
#UserKey2 8362013
|
||||
#UserKey3 2362899
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.10
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.9
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
# IRCDModule <module_name> [REQUIRED]
|
||||
# The ircd protocol module should be used when connecting anope to your
|
||||
# chosen IRCD. This should be one of the following options, or a file
|
||||
# provided by your IRCD author.
|
||||
#
|
||||
# Bahamut 1.4.27 [or later] - "bahamut"
|
||||
# DreamForge 4.6.7 - "dreamforge"
|
||||
# Hybrid IRCd 7.0 [experimental] - "hybrid"
|
||||
# InspIRCd 1.0 Beta 5 - "inspircd"
|
||||
# InspIRCd module is provided by Brain <brain@inspircd.org>
|
||||
# Plexus 2.0 [or later] - "plexus"
|
||||
# PTLink 6.15.0 [experimental] - "ptlink"
|
||||
# RageIRCd 2.0.0 [beta-6 of later] - "rageircd"
|
||||
# Ratbox 2.0.6 [or later] - "ratbox"
|
||||
# ShadowIRCD 4.0x [beta 7 or later] - "shadowircd"
|
||||
# Solid IRCD 3.4.x [3.4.6 or later] - "solidircd"
|
||||
# UltimateIRCd 3.0.0 [or later] - "ultimate3"
|
||||
# UltimateIRCd 2.8.2 [or later] - "ultimate2"
|
||||
# Unreal 3.2 [beta-19 or later] - "unreal32"
|
||||
# Unreal 3.1.1 [or later] - "unreal31"
|
||||
# ViagraIRCd 1.3.x [or later] - "viagra"
|
||||
#
|
||||
|
||||
#IRCDModule "unreal32"
|
||||
|
||||
# HostCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of HostServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
HostCoreModules "hs_help hs_on hs_off hs_group hs_list hs_set hs_setall hs_del hs_delall"
|
||||
|
||||
# MemoCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of MemoServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
MemoCoreModules "ms_send ms_cancel ms_list ms_read ms_del ms_set ms_info ms_rsend ms_check ms_staff ms_sendall ms_help"
|
||||
|
||||
# HelpCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of HelpServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
HelpCoreModules "he_help"
|
||||
|
||||
# BotCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of BotServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
BotCoreModules "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot bs_fantasy bs_fantasy_kick bs_fantasy_kickban bs_fantasy_owner bs_fantasy_seen bs_fantasy_unban"
|
||||
|
||||
# OperCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of OperServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
OperCoreModules "os_help os_global os_stats os_oper os_admin os_staff os_mode os_kick os_clearmodes os_killclones os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_logonnews os_randomnews os_opernews os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo"
|
||||
|
||||
# NickCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of NickServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
NickCoreModules "ns_help ns_register ns_group ns_identify ns_access ns_set ns_drop ns_recover ns_release ns_sendpass ns_ghost ns_alist ns_info ns_list ns_logout ns_status ns_update ns_getpass ns_getemail ns_forbid ns_suspend"
|
||||
|
||||
# ChanCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of ChanServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
ChanCoreModules "cs_help cs_register cs_identify cs_set cs_xop cs_access cs_akick cs_drop cs_sendpass cs_ban cs_clear cs_modes cs_getkey cs_invite cs_kick cs_list cs_logout cs_topic cs_info cs_getpass cs_forbid cs_suspend cs_status"
|
||||
|
||||
# OSOpersOnly [RECOMMENDED]
|
||||
# If this is defined, only IRC Operators will be permitted to use
|
||||
# OperServ, regardless of module based command access restrictions.
|
||||
|
||||
OSOpersOnly
|
||||
|
||||
# NSEmailMax [OPTIONAL]
|
||||
# Module: ns_maxemail
|
||||
#
|
||||
# Limit the amount of registrations with the same email address to the
|
||||
# amount given here. If set to 0 or left commented, there will be no limit
|
||||
# enforced when registering new accounts or using /msg NickServ SET EMAIL.
|
||||
#
|
||||
#NSEmailMax 1
|
||||
|
||||
# NSAutoOPDBName [OPTIONAL]
|
||||
# Module: ns_noop
|
||||
#
|
||||
# Use the given filename as database for the autoop list. If not given,
|
||||
# the default of "autoop.db" will be used.
|
||||
#
|
||||
#NSAutoOPDBName "autoop.db"
|
||||
|
||||
# OSInfoDBName [OPTIONAL]
|
||||
# Module: os_info
|
||||
#
|
||||
# Use the given filename as database for the oper information lines.
|
||||
# If not given, the default of "os_info.db" will be used.
|
||||
#
|
||||
#OSInfoDBName "os_info.db"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UserKey1|2|3 <value> [REQUIRED]
|
||||
#
|
||||
# These keys are required to initiate the random number generator. These
|
||||
# numbers MUST be random as you want your passcodes to be random. Don't
|
||||
# give these keys to no anyone! Keep them private!
|
||||
# For those pple who don't understand what to do here: Just pick three
|
||||
# _different_ _random_ numbers with about 6 or 7 digits and put them here.
|
||||
# If the keys don't work, they might be too long or you forgot to remove
|
||||
# the # in front of them. Example:
|
||||
# UserKey1 9866235
|
||||
|
||||
# UserKey1 <your_first_random_number_here>
|
||||
# UserKey2 <your_second_random_number_here>
|
||||
# UserKey3 <you_third_random_number_here>
|
||||
|
||||
# Numeric [OPTIONAL]
|
||||
# Many ircd identify themselves with a Numeric ID when using this option
|
||||
# consult your ircds documentation before using this.
|
||||
#Numeric "3AX"
|
||||
#Numeric "4"
|
||||
|
||||
# ModuleDelayedAutoload [OPTIONAL]
|
||||
#
|
||||
# When compiled with module support, this contains a space separated list
|
||||
# of modules to automaticaly load when services are ready for new clients.
|
||||
# e.g. new pesudo clients such as CatServ :-) *meow*
|
||||
# By default a number of modules that we found worth adding by default are
|
||||
# loaded. Feel free to change this if you want to add more, or remove some
|
||||
# from the list.
|
||||
#
|
||||
ModuleDelayedAutoload "cs_appendtopic cs_enforce ns_maxemail ns_noop os_info"
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# Proxy detection
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# Note: if ProxyDetect is not set, all parameters after it in this section
|
||||
# are optional.
|
||||
|
||||
# ProxyDetect [OPTIONAL]
|
||||
#
|
||||
# Enables insecure proxy detection. Services will automatically
|
||||
# scan each incoming user and akill those that use insecure proxy.
|
||||
#
|
||||
# Anope currently supports detection of Wingate (port 23), SOCKS4/5
|
||||
# (port 1080), and HTTP proxy (ports 3128 and 8080). It uses the
|
||||
# protocol of each proxy type to connect to an IRC server, it does
|
||||
# not only check if the port is open (so your users may still have
|
||||
# an open telnet server on their port 23 for example).
|
||||
#
|
||||
# WARNING: You should get the authorization of the administrator of
|
||||
# the computer which runs the proxy detector before enabling it; not
|
||||
# all administrators will accept it. Also note that in certain
|
||||
# countries, port scanning is prohibited.
|
||||
#
|
||||
# This feature requires threading support to be compiled into Anope.
|
||||
|
||||
#ProxyDetect
|
||||
|
||||
# ProxyThreads <number> [REQUIRED]
|
||||
#
|
||||
# Sets the number of threads Services will launch when starting. Each
|
||||
# thread will have the responsibility to scan queued hostname for
|
||||
# proxies.
|
||||
#
|
||||
# This value must be set depending of the number of users you have
|
||||
# on your network. The more threads are used, the more simultaneous
|
||||
# checks can be done. Remember however, that threads are
|
||||
# resource-consuming.
|
||||
#
|
||||
# WARNING: On Linux, each thread takes a background process, and there
|
||||
# is an additional process used for thread management; this is a problem
|
||||
# if you are limited in the number of background process you can use
|
||||
# (on a paid shell for example).
|
||||
|
||||
ProxyThreads 5
|
||||
|
||||
# ProxyMessage... <message> [RECOMMENDED]
|
||||
#
|
||||
# Sets the notices that will be sent out to users before Services
|
||||
# scan them for proxy. You may not use all of them, but just as much as
|
||||
# necessary.
|
||||
|
||||
ProxyMessage1 "I will now detect if you're using an insecure proxy."
|
||||
ProxyMessage2 "If you see a connection on port 23, 1080, 3128 or 8080 from"
|
||||
ProxyMessage3 "my.box.net, please disregard it, as it is the detector in action."
|
||||
ProxyMessage4 "See http://proxy.myirc.net/ for information about our proxy policy."
|
||||
#ProxyMessage5 "Enter"
|
||||
#ProxyMessage6 "whatever"
|
||||
#ProxyMessage7 "you want"
|
||||
#ProxyMessage8 "here."
|
||||
|
||||
# ProxyCheck... [OPTIONAL]
|
||||
#
|
||||
# Determines what types of proxy Anope will try to find (respectively
|
||||
# Wingate on port 23, SOCKS4 on port 1080, SOCKS5 on port 1080, HTTP
|
||||
# proxy on port 3128, HTTP proxy on port 8080 and HTTP proxy on port
|
||||
# 80).
|
||||
|
||||
ProxyCheckWingate
|
||||
ProxyCheckSocks4
|
||||
ProxyCheckSocks5
|
||||
ProxyCheckHTTP1
|
||||
ProxyCheckHTTP2
|
||||
ProxyCheckHTTP3
|
||||
|
||||
# ProxyTimeout <time> [REQUIRED]
|
||||
|
||||
# Sets the maximum length of time we allow a connect/read operation to
|
||||
# take. If you set this value too high, your threads may hang on a single
|
||||
# check for a very long time. The best is to try different values
|
||||
# and see which one is the more efficient for your network.
|
||||
|
||||
ProxyTimeout 15s
|
||||
|
||||
# ProxyTestServer <ip> <port> [REQUIRED]
|
||||
#
|
||||
# Sets the *IP* and port of the IRC server to use as a target when
|
||||
# testing users for proxy.
|
||||
|
||||
ProxyTestServer "1.2.3.4" 6667
|
||||
|
||||
# ProxyExpire <time> [RECOMMENDED]
|
||||
#
|
||||
# Sets the length of time before a proxy host cache entry expires, if
|
||||
# not used. If this is not set the default time is 2 days.
|
||||
|
||||
ProxyExpire 30d
|
||||
|
||||
# ProxyCacheExpire <time> [REQUIRED]
|
||||
#
|
||||
# Sets the length of time before a normal host cache entry expires, if
|
||||
# not used. This cannot be set to 0d.
|
||||
#
|
||||
# Every non-proxy hosts will be stored in cache (to avoid too many scans
|
||||
# to the same host), so you should set this enough low to not fill your
|
||||
# memory, especially on large networks.
|
||||
|
||||
ProxyCacheExpire 1d
|
||||
|
||||
# ProxyAkillReason <reason> [REQUIRED]
|
||||
#
|
||||
# Sets the reason that will be used to AKILL an user from the network
|
||||
# if a proxy is detected.
|
||||
|
||||
ProxyAkillReason "You're using an insecure proxy. See http://proxy.myirc.net/config.html for information about how to config your proxy in a safe manner."
|
||||
|
||||
# WallProxy [OPTIONAL]
|
||||
#
|
||||
# Sends a WALLOPS/GLOBOPS when an user using an insecure proxy is being
|
||||
# AKILLed.
|
||||
|
||||
WallProxy
|
||||
|
||||
# ProxyMax <number> [REQUIRED]
|
||||
#
|
||||
# Sets the maximum proxy cache entries that can be displayed in a single
|
||||
# call to OperServ CACHE.
|
||||
|
||||
ProxyMax 50
|
||||
|
||||
|
||||
Anope Version 1.7.8
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UseTS6 [OPTIONAL]
|
||||
#
|
||||
# Modern hybrid ircd like Ratbox 2.0.x support a protocol called TS6.
|
||||
# However this protocol is optional thus our default support is for without
|
||||
# TS6, if you want to take advantage of TS6, enable this option.
|
||||
|
||||
#UseTS6
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.7
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NSAddAccessOnReg [OPTIONAL]
|
||||
#
|
||||
# When enabled, services will add the usermask of registering users to the
|
||||
# access list of their newly created account. If you disable this, users
|
||||
# will always have to identify to nickserv before being recognized, unless
|
||||
# they manually add an address to the access list of their account.
|
||||
|
||||
NSAddAccessOnReg
|
||||
|
||||
# UlineServers [OPTIONAL]
|
||||
#
|
||||
# A list of ulined servers on your network, these servers are assumed they
|
||||
# can set channel modes and we will not attempt to take them from them
|
||||
# WARNING: do not put your user servers in this option
|
||||
|
||||
UlineServers "stats.your.network, proxy.your.network"
|
||||
|
||||
# KillOnSGline [OPTIONAL]
|
||||
#
|
||||
# When enabled, this option makes the services send an (SVS)KILL command
|
||||
# immediately after SGLINE ADD. This eliminates the need of killing the
|
||||
# users after the SGLINE has been added.
|
||||
|
||||
# KillOnSGline
|
||||
|
||||
# KillOnSQline [OPTIONAL]
|
||||
#
|
||||
# When enabled, this option makes the services send an (SVS)KILL command
|
||||
# immediately after SQLINE ADD. This eliminates the need of killing the
|
||||
# users after the SQLINE has been added.
|
||||
|
||||
# KillOnSQline
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NetworkDomain <name> [OPTIONAL]
|
||||
#
|
||||
# If your network has a common domain name, specify it there (for
|
||||
# example, all IRCZONE servers have a name ending in ".irczone.cl",
|
||||
# so "irczone.cl" would be set there.
|
||||
#
|
||||
# You can specify more than one Network Domain by separating each one by
|
||||
# a space: NetworkDomain "localnet.net localnet.com"
|
||||
#
|
||||
# Note that this directive is no longer used by the GLOBAL command, since
|
||||
# it uses a dynamic list of connected servers regardless of their
|
||||
# domains. However, some modules may still use this value, so you might
|
||||
# want to keep it just in case.
|
||||
|
||||
NetworkDomain "localnet.com"
|
||||
|
||||
# ListOpersOnly [DEPRECATED]
|
||||
# When enabled, limits use of the ChanServ and NickServ LIST commands
|
||||
# to IRC operators.
|
||||
#
|
||||
# This directive has been superseded by the NSListOpersOnly and
|
||||
# CSListOpersOnly directives.
|
||||
|
||||
#ListOpersOnly
|
||||
|
||||
Anope Version 1.7.6
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UserKey1|2|3 <value> [REQUIRED]
|
||||
#
|
||||
# These keys are required to initiate the random number generator. These
|
||||
# numbers MUST be random as you want your passcodes to be random. Don't
|
||||
# give these keys to no anyone! Keep them private!
|
||||
|
||||
#UserKey1 9866235
|
||||
#UserKey2 5216332
|
||||
#UserKey3 9651291
|
||||
|
||||
|
||||
# RestrictOperNick [OPTIONAL]
|
||||
# Forbids the registration of nicks that contain nick with services
|
||||
# access. So if Tester is a Services Oper, for example, You can't
|
||||
# register NewTester or Tester123 unless you are an IRC operator.
|
||||
#RestrictOperNicks
|
||||
|
||||
# UseTokens [OPTIONAL]
|
||||
# Allows irc networks to use TOKEN commands instead of the
|
||||
# standard commands. This saves bandwidth but can break older
|
||||
# modules that are not set to trap for TOKEN - if you are using
|
||||
# older modules do NOT use this option
|
||||
#UseTokens
|
||||
|
||||
# UseSVS2MODE [OPTIONAL]
|
||||
# On Unreal IRCD use SVS2MODE instead of SVSMODE, doing this will
|
||||
# show services changing user modes.
|
||||
#UseSVS2MODE
|
||||
|
||||
# NewsCount [OPTIONAL]
|
||||
# The number of LOGON/OPER News item to display when a user logs
|
||||
# on. The default value is 3
|
||||
#NewsCount 3
|
||||
|
||||
# Numeric [OPTIONAL]
|
||||
# Many ircd identify themselves with a Numeric when using this option
|
||||
# consult your ircds documentation before using this
|
||||
#Numeric 0
|
||||
|
||||
# UnRestrictSAdmin [OPTIONAL]
|
||||
# On many ircd Anope removes the umode of +a from users whom are not
|
||||
# Service Admin in Anope. This mode is NOT used by Anope for any form
|
||||
# of access. Thus this option allows them to keep the mode without having
|
||||
# to be a Service Admin in Anope
|
||||
#UnRestrictSAdmin
|
||||
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.5
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UseSVSHOLD [OPTIONAL]
|
||||
# Allows Bahamut-networks to use SVSHOLD instead of the services
|
||||
# enforcer. This option has been introduced in Bahamut 1.4.35 and
|
||||
# places a temporary Q:Line instead of introducing a new nick,
|
||||
# which is better for both CPU and bandwidth. If you enable this
|
||||
# option on a pre-1.4.35 Bahamut, it is most likely to break.
|
||||
#UseSVSHOLD
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NetworkDomain <name> [OPTIONAL]
|
||||
#
|
||||
# If your network has a common domain name, specify it there (for
|
||||
# example, all IRCZONE servers have a name ending in ".irczone.cl",
|
||||
# so "irczone.cl" would be set there.
|
||||
#
|
||||
# You can specify more than one Network Domain by separating each one by
|
||||
# a space: NetworkDomain "localnet.net localnet.com"
|
||||
#
|
||||
# Note that this directive is no longer used by the GLOBAL command, since
|
||||
# it uses a dynamic list of connected servers regardless of their
|
||||
# domains. However, some modules may still use this value, so you might
|
||||
# want to keep it just in case.
|
||||
|
||||
NetworkDomain "localnet.com"
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.4
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NSNickTracking [OPTIONAL]
|
||||
#
|
||||
# When enabled, services will track your last nick identified when issuing
|
||||
# nick changes.
|
||||
|
||||
#NSNickTracking
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.3
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# BSCaseSensitive [OPTIONAL]
|
||||
# This option will make botserv use cAsE sEnSiTiVe checking for badwords
|
||||
|
||||
# BSCaseSensitive
|
||||
|
||||
# MSMemoReceipt [OPTIONAL]
|
||||
# Allow the use of memo receipts for the following groups:
|
||||
# 1 - Opers Only
|
||||
# 2 - Everybody
|
||||
#
|
||||
#MSMemoReceipt 1
|
||||
|
||||
Anope Version 1.7.2
|
||||
--------------------
|
||||
No Changes.
|
||||
|
||||
Anope Version 1.7.1
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UseRDB [OPTIONAL]
|
||||
#
|
||||
# Enable this if you want anope to load its data from a remote database.
|
||||
# (e.g. MySQL)
|
||||
#
|
||||
#UseRDB
|
||||
|
||||
# NickRegDelay <seconds> [OPTIONAL]
|
||||
# Prevents users from regging their nick if they are not
|
||||
# connected for at least X seconds.
|
||||
#NickRegDelay 30
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
-558
@@ -1,558 +0,0 @@
|
||||
Anope Version 1.8.0
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.24
|
||||
--------------------
|
||||
*** New Strings:
|
||||
OPER_STATS_HOSTSERV_MEM
|
||||
|
||||
*** Mod Strings:
|
||||
NICK_HELP_SASET_AUTOOP
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.23b
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.23
|
||||
--------------------
|
||||
*** New Strings:
|
||||
PASSWORD_TOO_LONG
|
||||
CHAN_LOGOUT_FOUNDER_FAILED
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_OPER
|
||||
NICK_HELP_SASET_PASSWORD
|
||||
OPER_IGNORE_SYNTAX
|
||||
OPER_HELP_IGNORE
|
||||
CHAN_LOGOUT_ALL_SUCCEEDED
|
||||
OPER_HELP_MODLIST
|
||||
|
||||
*** Del Strings:
|
||||
PASSWORD_TRUNCATED
|
||||
|
||||
Anope Version 1.7.22
|
||||
--------------------
|
||||
*** New Strings:
|
||||
NICK_SASET_LANGUAGE_SYNTAX
|
||||
NICK_SASET_LANGUAGE_UNKNOWN
|
||||
NICK_SASET_LANGUAGE_CHANGED
|
||||
NICK_HELP_SASET_LANGUAGE
|
||||
NICK_HELP_RESEND
|
||||
|
||||
*** Mod Strings:
|
||||
NICK_HELP_SASET
|
||||
NICK_RECOVERED
|
||||
NICK_LIST_SERVADMIN_SYNTAX
|
||||
NICK_SERVADMIN_HELP_LIST
|
||||
CHAN_GETKEY_KEY
|
||||
NICK_SERVADMIN_HELP_LIST
|
||||
CHAN_SERVADMIN_HELP_LIST
|
||||
OPER_HELP_GLOBAL
|
||||
OPER_HELP_UMODE
|
||||
OPER_HELP_OLINE
|
||||
OPER_HELP_KICK
|
||||
OPER_HELP_SVSNICK
|
||||
OPER_HELP_SET_LOGCHAN
|
||||
OPER_HELP_SET_SUPERADMIN
|
||||
CHAN_HELP_AKICK
|
||||
NICK_HELP_RECOVER
|
||||
NICK_HELP_RELEASE
|
||||
NEWS_HELP_LOGON
|
||||
NEWS_HELP_OPER
|
||||
OPER_HELP_IGNORE
|
||||
OPER_IGNORE_TIME_DONE
|
||||
OPER_IGNORE_PERM_DONE
|
||||
OPER_IGNORE_DEL_DONE
|
||||
|
||||
*** Del Strings:
|
||||
NICK_SET_UNKNOWN_OPTION_OR_BAD_NICK
|
||||
OPER_HELP_KILLCLONES
|
||||
|
||||
Anope Version 1.7.21
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.20
|
||||
--------------------
|
||||
*** New Strings:
|
||||
NICK_HELP_CONFIRM
|
||||
CHAN_XOP_NOT_AVAILABLE
|
||||
HELP_LIMIT_SERV_OPER
|
||||
HELP_LIMIT_SERV_ADMIN
|
||||
HELP_LIMIT_SERV_ROOT
|
||||
HELP_LIMIT_IRC_OPER
|
||||
HELP_LIMIT_HOST_SETTER
|
||||
HELP_LIMIT_HOST_REMOVER
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_SET
|
||||
In all of the following strings only the trailing 'Limited to ...' line has been removed:
|
||||
OPER_HELP_EXCEPTION
|
||||
OPER_HELP_SESSION
|
||||
NICK_HELP_SASET
|
||||
NICK_HELP_SASET_DISPLAY
|
||||
NICK_HELP_SASET_PASSWORD
|
||||
NICK_HELP_SASET_URL
|
||||
NICK_HELP_SASET_EMAIL
|
||||
NICK_HELP_SASET_ICQ
|
||||
NICK_HELP_SASET_GREET
|
||||
NICK_HELP_SASET_KILL
|
||||
NICK_HELP_SASET_SECURE
|
||||
NICK_HELP_SASET_PRIVATE
|
||||
NICK_HELP_SASET_HIDE
|
||||
NICK_HELP_SASET_MSG
|
||||
NICK_HELP_SASET_NOEXPIRE
|
||||
NICK_HELP_SASET_AUTOOP
|
||||
NICK_SERVADMIN_HELP_GETPASS
|
||||
NICK_SERVADMIN_HELP_GETEMAIL
|
||||
NICK_SERVADMIN_HELP_FORBID
|
||||
NICK_SERVADMIN_HELP_SUSPEND
|
||||
NICK_SERVADMIN_HELP_UNSUSPEND
|
||||
CHAN_SERVADMIN_HELP_SET_NOEXPIRE
|
||||
CHAN_SERVADMIN_HELP_GETPASS
|
||||
CHAN_SERVADMiN_HELP_FORBID
|
||||
CHAN_SERVADMIN_HELP_SUSPEND
|
||||
CHAN_SERVADMIN_HELP_UNSUSPEND
|
||||
CHAN_SERVADMIN_HELP_STATUS
|
||||
OPER_HELP_MODE
|
||||
OPER_HELP_CLEARMODES
|
||||
OPER_HELP_KICK
|
||||
OPER_HELP_SVSNICK
|
||||
OPER_HELP_AKILL
|
||||
OPER_HELP_SGLINE
|
||||
OPER_HELP_SQLINE
|
||||
OPER_HELP_SZLINE
|
||||
OPER_HELP_SET
|
||||
OPER_HELP_NOOP
|
||||
OPER_HELP_JUPE
|
||||
OPER_HELP_RAW
|
||||
OPER_HELP_UPDATE
|
||||
OPER_HELP_RELOAD
|
||||
OPER_HELP_QUIT
|
||||
OPER_HELP_SHUTDOWN
|
||||
OPER_HELP_RESTART
|
||||
OPER_HELP_KILLCLONES
|
||||
OPER_HELP_CHANLIST
|
||||
OPER_HELP_USERLIST
|
||||
OPER_HELP_MODLOAD
|
||||
OPER_HELP_MODUNLOAD
|
||||
OPER_HELP_MODINFO
|
||||
OPER_HELP_MODLIST
|
||||
BOT_SERVADMIN_HELP_SET_NOBOT
|
||||
BOT_SERVADMIN_HELP_SET_PRIVATE
|
||||
HOST_HELP_SET
|
||||
HOST_HELP_DELALL
|
||||
HOST_HELP_SETALL
|
||||
HOST_HELP_DEL
|
||||
HOST_HELP_LIST
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.19
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
CHAN_HELP_LIST
|
||||
BOT_SET_SYNTAX
|
||||
BOT_HELP_SET
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.18
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.17
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.16
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.15
|
||||
--------------------
|
||||
*** New Strings:
|
||||
INVALID_TARGET
|
||||
NICK_SET_AUTOOP_SYNTAX
|
||||
NICK_SET_AUTOOP_ON
|
||||
NICK_SET_AUTOOP_OFF
|
||||
BOT_LONG_IDENT
|
||||
|
||||
*** Mod Strings:
|
||||
NICK_HELP_SET
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.14
|
||||
--------------------
|
||||
*** New Strings:
|
||||
CHAN_X_INVALID
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.13
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.12
|
||||
--------------------
|
||||
*** New Strings:
|
||||
OPER_STATS_UPLINK_SERVER
|
||||
OPER_STATS_UPLINK_CAPAB
|
||||
OPER_STATS_UPLINK_SERVER_COUNT
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_STATS
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.11
|
||||
---------------------
|
||||
*** New Strings:
|
||||
NICK_SASET_SYNTAX
|
||||
NICK_SASET_DISABLED
|
||||
NICK_SASET_UNKNOWN_OPTION
|
||||
NICK_SASET_BAD_NICK
|
||||
NICK_SASET_OPTION_DISABLED
|
||||
NICK_SASET_DISPLAY_INVALID
|
||||
NICK_SASET_DISPLAY_CHANGED
|
||||
NICK_SASET_PASSWORD_FAILED
|
||||
NICK_SASET_PASSWORD_CHANGED
|
||||
NICK_SASET_PASSWORD_CHANGED_TO
|
||||
NICK_SASET_LANGUAGE_SYNTAX
|
||||
NICK_SASET_LANGUAGE_UNKNOWN
|
||||
NICK_SASET_LANGUAGE_CHANGED
|
||||
NICK_SASET_URL_CHANGED
|
||||
NICK_SASET_URL_UNSET
|
||||
NICK_SASET_EMAIL_CHANGED
|
||||
NICK_SASET_EMAIL_UNSET
|
||||
NICK_SASET_EMAIL_UNSET_IMPOSSIBLE
|
||||
NICK_SASET_ICQ_CHANGED
|
||||
NICK_SASET_ICQ_UNSET
|
||||
NICK_SASET_ICQ_INVALID
|
||||
NICK_SASET_GREET_CHANGED
|
||||
NICK_SASET_GREET_UNSET
|
||||
NICK_SASET_KILL_SYNTAX
|
||||
NICK_SASET_KILL_IMMED_SYNTAX
|
||||
NICK_SASET_KILL_ON
|
||||
NICK_SASET_KILL_QUICK
|
||||
NICK_SASET_KILL_IMMED
|
||||
NICK_SASET_KILL_IMMED_DISABLED
|
||||
NICK_SASET_KILL_OFF
|
||||
NICK_SASET_SECURE_SYNTAX
|
||||
NICK_SASET_SECURE_ON
|
||||
NICK_SASET_SECURE_OFF
|
||||
NICK_SASET_PRIVATE_SYNTAX
|
||||
NICK_SASET_PRIVATE_ON
|
||||
NICK_SASET_PRIVATE_OFF
|
||||
NICK_SASET_HIDE_SYNTAX
|
||||
NICK_SASET_HIDE_EMAIL_ON
|
||||
NICK_SASET_HIDE_EMAIL_OFF
|
||||
NICK_SASET_HIDE_MASK_ON
|
||||
NICK_SASET_HIDE_MASK_OFF
|
||||
NICK_SASET_HIDE_QUIT_ON
|
||||
NICK_SASET_HIDE_QUIT_OFF
|
||||
NICK_SASET_HIDE_STATUS_ON
|
||||
NICK_SASET_HIDE_STATUS_OFF
|
||||
NICK_SASET_MSG_SYNTAX
|
||||
NICK_SASET_MSG_ON
|
||||
NICK_SASET_MSG_OFF
|
||||
NICK_SASET_NOEXPIRE_SYNTAX
|
||||
NICK_SASET_NOEXPIRE_ON
|
||||
NICK_SASET_NOEXPIRE_OFF
|
||||
NICK_HELP_SASET
|
||||
NICK_HELP_SASET_DISPLAY
|
||||
NICK_HELP_SASET_PASSWORD
|
||||
NICK_HELP_SASET_LANGUAGE
|
||||
NICK_HELP_SASET_URL
|
||||
NICK_HELP_SASET_EMAIL
|
||||
NICK_HELP_SASET_ICQ
|
||||
NICK_HELP_SASET_GREET
|
||||
NICK_HELP_SASET_KILL
|
||||
NICK_HELP_SASET_SECURE
|
||||
NICK_HELP_SASET_PRIVATE
|
||||
NICK_HELP_SASET_HIDE
|
||||
NICK_HELP_SASET_MSG
|
||||
NICK_HELP_SASET_NOEXPIRE
|
||||
NICK_HELP_CMD_SASET
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_MODLIST
|
||||
|
||||
*** Del Strings:
|
||||
NICK_SERVADMIN_HELP_SET
|
||||
NICK_SERVADMIN_HELP_SET_NOEXPIRE
|
||||
NICK_SET_NOEXPIRE_SYNTAX
|
||||
NICK_SET_NOEXPIRE_ON
|
||||
NICK_SET_NOEXPIRE_OFF
|
||||
NICK_SASET_LANGUAGE_SYNTAX
|
||||
NICK_SASET_LANGUAGE_UNKNOWN
|
||||
NICK_SASET_LANGUAGE_CHANGED
|
||||
NICK_HELP_SASET_LANGUAGE
|
||||
|
||||
|
||||
Anope Version 1.7.10
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.9
|
||||
-------------------
|
||||
*** New Strings:
|
||||
CHAN_HELP_IRCD_HALFOP
|
||||
CHAN_HELP_IRCD_PROTECT
|
||||
CHAN_GETKEY_SYNTAX
|
||||
CHAN_GETKEY_NOKEY
|
||||
CHAN_GETKEY_KEY
|
||||
OPER_SET_SQL_ERROR_DISABLED
|
||||
NICK_X_SUSPENDED
|
||||
NICK_INFO_SUSPENDED
|
||||
NICK_SUSPEND_SYNTAX
|
||||
NICK_SUSPEND_SUCCEEDED
|
||||
NICK_SUSPEND_FAILED
|
||||
NICK_UNSUSPEND_SYNTAX
|
||||
NICK_UNSUSPEND_SUCCEEDED
|
||||
NICK_UNSUSPEND_FAILED
|
||||
NICK_SERVADMIN_HELP_SUSPEND
|
||||
NICK_SERVADMIN_HELP_UNSUSPEND
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_SET
|
||||
NICK_HELP
|
||||
CHAN_AOP_CLEAR
|
||||
CHAN_HOP_CLEAR
|
||||
CHAN_SOP_CLEAR
|
||||
CHAN_VOP_CLEAR
|
||||
CHAN_ACCESS_CLEAR
|
||||
CHAN_AKICK_CLEAR
|
||||
CHAN_SET_KEEPTOPIC_ON
|
||||
CHAN_SET_KEEPTOPIC_OFF
|
||||
CHAN_SET_TOPICLOCK_ON
|
||||
CHAN_SET_TOPICLOCK_OFF
|
||||
CHAN_SET_PEACE_ON
|
||||
CHAN_SET_PEACE_OFF
|
||||
CHAN_SET_PRIVATE_ON
|
||||
CHAN_SET_PRIVATE_OFF
|
||||
CHAN_SET_SECUREOPS_ON
|
||||
CHAN_SET_SECUREOPS_OFF
|
||||
CHAN_SET_SECUREFOUNDER_ON
|
||||
CHAN_SET_SECUREFOUNDER_OFF
|
||||
CHAN_SET_RESTRICTED_ON
|
||||
CHAN_SET_RESTRICTED_OFF
|
||||
CHAN_SET_SECURE_ON
|
||||
CHAN_SET_SECURE_OFF
|
||||
CHAN_SET_SIGNKICK_ON
|
||||
CHAN_SET_SIGNKICK_LEVEL
|
||||
CHAN_SET_SIGNKICK_OFF
|
||||
CHAN_SET_OPNOTICE_ON
|
||||
CHAN_SET_OPNOTICE_OFF
|
||||
CHAN_SET_XOP_ON
|
||||
CHAN_SET_XOP_OFF
|
||||
|
||||
*** Del Strings:
|
||||
CHAN_HELP_ULTIMATE
|
||||
OPER_STATS_PROXY_MEM
|
||||
OPER_CACHE_SYNTAX
|
||||
OPER_CACHE_DISABLED
|
||||
OPER_CACHE_NOT_FOUND
|
||||
OPER_CACHE_REMOVED
|
||||
OPER_CACHE_HEADER
|
||||
OPER_CACHE_LIST
|
||||
OPER_CACHE_FOOTER
|
||||
OPER_CACHE_QUEUED
|
||||
OPER_CACHE_PROGRESS
|
||||
OPER_CACHE_NORMAL
|
||||
OPER_CACHE_WINGATE
|
||||
OPER_CACHE_SOCKS4
|
||||
OPER_CACHE_SOCKS5
|
||||
OPER_CACHE_HTTP
|
||||
OPER_HELP_CACHE
|
||||
|
||||
Anope Version 1.7.8
|
||||
-------------------
|
||||
*** New Strings:
|
||||
OPER_HELP_SET_IGNORE
|
||||
OPER_HELP_ADMIN_CMD_EXTRA
|
||||
OPER_HELP_ADMIN_CMD_OLINE
|
||||
OPER_HELP_ADMIN_CMD_UMODE
|
||||
OPER_HELP_ADMIN_CMD_SVSNICK
|
||||
OPER_HELP_OPER_CMD_EXTRA
|
||||
OPER_HELP_OPER_CMD_SGLINE
|
||||
OPER_HELP_OPER_CMD_SQLINE
|
||||
OPER_HELP_OPER_CMD_SZLINE
|
||||
|
||||
*** Mod Strings:
|
||||
HOST_OFF_UNREAL
|
||||
OPER_HELP_OPER_CMD
|
||||
OPER_HELP_ADMIN_CMD
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.7
|
||||
-------------------
|
||||
*** New Strings:
|
||||
MEMO_NO_RSEND_SELF
|
||||
NICK_REGISTERED_NO_MASK
|
||||
OPER_ADMIN_MOVED
|
||||
OPER_OPER_MOVED
|
||||
OPER_HELP_SET_SQL
|
||||
OPER_SET_SQL_ON
|
||||
OPER_SET_SQL_OFF
|
||||
OPER_SET_SQL_ERROR
|
||||
OPER_SET_SQL_ERROR_INIT
|
||||
OPER_EXCEPTION_EXISTS
|
||||
OPER_EXCEPTION_CHANGED
|
||||
OPER_SET_LIST_OPTION_ON
|
||||
OPER_SET_LIST_OPTION_OFF
|
||||
OPER_HELP_SET_LIST
|
||||
OPER_SUPER_ADMIN_NOT_ENABLED
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
BOT_SERVADMIN_HELP_BOT
|
||||
NICK_HELP_STATUS
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.6
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
CHAN_REGISTER_NONE_CHANNEL
|
||||
CHAN_SYMBOL_REQUIRED
|
||||
OPER_SVSNICK_UNSUPPORTED
|
||||
OPER_SQLINE_UNSUPPORTED
|
||||
OPER_SVSO_UNSUPPORTED
|
||||
OPER_UMODE_UNSUPPORTED
|
||||
CHAN_CLEARED_INVITES
|
||||
NICK_INFO_VHOST2
|
||||
NICK_STATUS_0
|
||||
NICK_STATUS_1
|
||||
NICK_STATUS_2
|
||||
NICK_STATUS_3
|
||||
CHAN_STATUS_SYNTAX
|
||||
CHAN_STATUS_NOT_REGGED
|
||||
CHAN_STATUS_FORBIDDEN
|
||||
CHAN_STATUS_NOTONLINE
|
||||
CHAN_STATUS_INFO
|
||||
NICK_INFO_EXPIRE
|
||||
NICK_GLIST_REPLY
|
||||
NICK_GLIST_REPLY_ADMIN
|
||||
CHAN_INFO_EXPIRE
|
||||
NICK_ACCESS_LIST_EMPTY
|
||||
NICK_ACCESS_LIST_X_EMPTY
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.5
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
MEMO_HELP
|
||||
CHAN_LEVEL_NOJOIN
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.4
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
CHAN_CLEARED_HOPS
|
||||
OPER_MODULE_LIST_HEADER
|
||||
OPER_MODULE_LIST_FOOTER
|
||||
NICK_X_IS_SERVICES
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
CHAN_HELP_CLEAR
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.3
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
MEMO_RSEND_PLEASE_WAIT
|
||||
MEMO_RSEND_DISABLED
|
||||
MEMO_RSEND_SYNTAX
|
||||
MEMO_RSEND_NICK_MEMO_TEXT
|
||||
MEMO_RSEND_CHAN_MEMO_TEXT
|
||||
MEMO_RSEND_USER_NOTIFICATION
|
||||
MEMO_HELP_RSEND
|
||||
MEMO_CHECK_SYNTAX
|
||||
MEMO_CHECK_NOT_READ
|
||||
MEMO_CHECK_READ
|
||||
MEMO_CHECK_NO_MEMO
|
||||
MEMO_HELP_CHECK
|
||||
|
||||
*** Mod Strings:
|
||||
MEMO_HELP
|
||||
NICK_LIST_SERVADMIN_SYNTAX
|
||||
NICK_SERVADMIN_HELP_LIST
|
||||
|
||||
Anope Version 1.7.2
|
||||
--------------------
|
||||
No Changes.
|
||||
|
||||
Anope Version 1.7.1
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
MEMO_SET_NOTIFY_MAIL
|
||||
MEMO_SET_NOTIFY_NOMAIL
|
||||
MEMO_SET_NOTIFY_INVALIDMAIL
|
||||
MEMO_MAIL_SUBJECT
|
||||
MEMO_MAIL_TEXT1
|
||||
MEMO_MAIL_TEXT2
|
||||
MEMO_MAIL_TEXT3
|
||||
NICK_INFO_SERVICES_ROOT
|
||||
NICK_SET_HIDE_STATUS_ON
|
||||
NICK_SET_HIDE_STATUS_OFF
|
||||
NICK_REG_DELAY
|
||||
|
||||
*** Mod Strings:
|
||||
MEMO_SET_NOTIFY_SYNTAX
|
||||
NICK_HELP_SET_HIDE
|
||||
|
||||
*** Del Strings:
|
||||
-129
@@ -1,129 +0,0 @@
|
||||
Anope Version 1.8.0
|
||||
-------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.24
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.23b
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.23
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.22
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.21
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.20
|
||||
--------------------
|
||||
ALTER TABLE `anope_ns_request` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_ns_core` DROP INDEX `display_index` ;
|
||||
ALTER TABLE `anope_ns_access` ADD UNIQUE (`display`) ;
|
||||
ALTER TABLE `anope_ms_info` ADD UNIQUE (`nm_id` , `serv`) ;
|
||||
ALTER TABLE `anope_ns_alias` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_cs_info` DROP INDEX `name_index` ;
|
||||
ALTER TABLE `anope_cs_access` ADD UNIQUE (`channel` , `display`) ;
|
||||
ALTER TABLE `anope_cs_levels` ADD UNIQUE (`channel` , `position`) ;
|
||||
ALTER TABLE `anope_cs_akicks` CHANGE `dmask` `dmask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_cs_akicks` ADD UNIQUE (`channel` , `dmask`) ;
|
||||
ALTER TABLE `anope_cs_badwords` CHANGE `word` `word` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_cs_badwords` ADD UNIQUE (`channel` , `word`) ;
|
||||
ALTER TABLE `anope_cs_ttb` ADD UNIQUE (`channel` , `ttb_id`) ;
|
||||
ALTER TABLE `anope_os_akills` CHANGE `user` `user` VARCHAR( 255 ) NOT NULL , CHANGE `host` `host` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_akills` ADD UNIQUE (`user` , `host`) ;
|
||||
ALTER TABLE `anope_os_sglines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_sglines` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_os_sqlines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_sqlines` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_os_szlines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_szlines` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_os_news` ADD UNIQUE (`type` , `num` , `time`) ;
|
||||
ALTER TABLE `anope_os_exceptions` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_exceptions` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_hs_core` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_bs_core` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_ms_info` CHANGE `receiver` `receiver` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_ms_info` ADD INDEX ( `receiver` , `serv` ) ;
|
||||
|
||||
Anope Version 1.7.19
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.18
|
||||
--------------------
|
||||
- DROP TABLE IF EXISTS `anope_os_status`
|
||||
- ALTER TABLE `anope_bs_core` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_access` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_akicks` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_badwords` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_levels` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_ttb` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_hs_core` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_ms_info` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_ns_access` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_ns_request` CHANGE `active` `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_akills` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_exceptions` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_news` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_sglines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_sqlines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_szlines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
|
||||
Anope Version 1.7.17
|
||||
--------------------
|
||||
- CREATE TABLE anope_cs_ttb (
|
||||
ct_id int(11) NOT NULL auto_increment,
|
||||
channel varchar(255) NOT NULL default '',
|
||||
ttb_id int(11) NOT NULL default '0',
|
||||
value int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (ct_id)
|
||||
) TYPE=MyISAM
|
||||
- ALTER TABLE anope_cs_info DROP ttb
|
||||
|
||||
Anope Version 1.7.16
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.15
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.14
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.13
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.12
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.11
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.10
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.9
|
||||
-------------------
|
||||
- DROP TABLE IF EXISTS anope_os_cache
|
||||
|
||||
Anope Version 1.7.8
|
||||
-------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.7
|
||||
-------------------
|
||||
- ALTER TABLE anope_ns_alias CHANGE status status int(11) unsigned NOT NULL default '0'
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Configuration script for Services.
|
||||
#
|
||||
# Anope (c) 2003-2008 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,94 +40,58 @@ Run_Build_System () {
|
||||
WITH_INST=""
|
||||
WITH_RUN=""
|
||||
WITH_PERM=""
|
||||
BUILD_TYPE=""
|
||||
RUN_CC_PL=""
|
||||
GEN_TYPE=""
|
||||
|
||||
if [ "$INSTDIR" != "" ] ; then
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
|
||||
else
|
||||
WITH_INST="--with-instdir=$INSTDIR"
|
||||
fi
|
||||
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
|
||||
fi
|
||||
|
||||
if [ "$RUNGROUP" != "" ] ; then
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
|
||||
else
|
||||
WITH_RUN="--with-rungroup=$RUNGROUP"
|
||||
fi
|
||||
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
|
||||
fi
|
||||
|
||||
if [ "$UMASK" != "" ] ; then
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
|
||||
else
|
||||
WITH_PERM="--with-permissions=$UMASK"
|
||||
fi
|
||||
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
|
||||
fi
|
||||
|
||||
if [ "$DEBUG" = "yes" ] ; then
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
else
|
||||
BUILD_TYPE="--with-debugsym"
|
||||
fi
|
||||
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
else
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
fi
|
||||
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
fi
|
||||
|
||||
if [ "$USE_RUN_CC_PL" = "yes" ] ; then
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
|
||||
else
|
||||
pwdsave=`pwd`
|
||||
cd "`dirname $SOURCE_DIR/run-cc.pl`"
|
||||
RUN_CC_PL="--with-makebin=`pwd`/run-cc.pl"
|
||||
cd "$pwdsave"
|
||||
fi
|
||||
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
|
||||
else
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
|
||||
else
|
||||
RUN_CC_PL="--with-makebin="
|
||||
fi
|
||||
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
GEN_TYPE="-G\"MSYS Makefiles\""
|
||||
;;
|
||||
esac
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
GEN_TYPE="-G\"MSYS Makefiles\""
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
pwdsave=`pwd`
|
||||
test -d build || mkdir build
|
||||
cd "build"
|
||||
REAL_SOURCE_DIR=".."
|
||||
else
|
||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
||||
fi
|
||||
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $REAL_SOURCE_DIR"
|
||||
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $REAL_SOURCE_DIR
|
||||
|
||||
echo ""
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
echo "Now cd build, then run make to build Anope."
|
||||
cd "$pwdsave"
|
||||
else
|
||||
echo "Now run make to build Anope."
|
||||
fi
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
pwdsave=`pwd`
|
||||
test -d build || mkdir build
|
||||
cd "build"
|
||||
REAL_SOURCE_DIR=".."
|
||||
else
|
||||
echo "./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL"
|
||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
||||
fi
|
||||
|
||||
./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
||||
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
||||
|
||||
echo ""
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
echo "Now cd build, then run make to build Anope."
|
||||
cd "$pwdsave"
|
||||
else
|
||||
echo "Now run make to build Anope."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -148,12 +112,12 @@ export ECHO2 ECHO2SUF
|
||||
# Init values
|
||||
###########################################################################
|
||||
|
||||
BUILD_SYSTEM="cmake"
|
||||
INSTDIR=$HOME/services
|
||||
RUNGROUP=
|
||||
UMASK=
|
||||
DEBUG="yes"
|
||||
USE_RUN_CC_PL="no"
|
||||
EXTRA_CONFIG_ARGS=
|
||||
CAN_QUICK="no"
|
||||
SOURCE_DIR=`dirname $0`
|
||||
|
||||
@@ -189,6 +153,17 @@ done
|
||||
|
||||
###########################################################################
|
||||
|
||||
which cmake > /dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
clear
|
||||
echo "Anope requires CMake 2.4 or newer to be configured, which can"
|
||||
echo "be downloaded at http://www.cmake.org/. If you have installed"
|
||||
echo "CMake already, ensure it is in your PATH environment variable."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
###########################################################################
|
||||
|
||||
if [ ! "$NO_INTRO" ] ; then
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
@@ -199,8 +174,18 @@ if [ ! "$NO_INTRO" ] ; then
|
||||
clear
|
||||
;;
|
||||
esac
|
||||
. $SOURCE_DIR/version.log
|
||||
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
|
||||
. $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`
|
||||
# Only do this if we are not on a tag, src/version.sh will be all we need then.
|
||||
if [ "$VERSION_BUILD" != "$VERSION_EXTRA" ] ; then
|
||||
echo "#define VERSION_BUILD $VERSION_BUILD" > include/version.h
|
||||
echo "#define VERSION_EXTRA \"-$VERSION_EXTRA\"" >> include/version.h
|
||||
fi
|
||||
fi
|
||||
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
@@ -223,31 +208,6 @@ export ok INPUT
|
||||
|
||||
####
|
||||
|
||||
ok=0
|
||||
echo "Note: press Return for the default, or enter a new value."
|
||||
echo "Are you using configure or cmake?"
|
||||
while [ $ok -eq 0 ] ; do
|
||||
echo2 "[$BUILD_SYSTEM] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ ! "$INPUT" ] ; then
|
||||
INPUT=$BUILD_SYSTEM
|
||||
fi
|
||||
case $INPUT in
|
||||
cmake)
|
||||
ok=1
|
||||
;;
|
||||
configure)
|
||||
ok=1
|
||||
;;
|
||||
*)
|
||||
echo "That is not a valid choice!"
|
||||
ok=0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
BUILD_SYSTEM=$INPUT
|
||||
echo ""
|
||||
|
||||
ok=0
|
||||
echo "In what directory do you want the binaries to be installed?"
|
||||
while [ $ok -eq 0 ] ; do
|
||||
@@ -278,7 +238,6 @@ done
|
||||
INSTDIR=$INPUT
|
||||
echo ""
|
||||
|
||||
|
||||
####
|
||||
|
||||
OLD_RUNGROUP="$RUNGROUP"
|
||||
@@ -358,7 +317,7 @@ if [ "$USE_RUN_CC_PL" = "yes" ] ; then
|
||||
TEMP_YN="y"
|
||||
fi
|
||||
echo "You can optionally have the build run through run-cc.pl, which will"
|
||||
echo "cause warnings and errors (if any) to be colored yellow and run,"
|
||||
echo "cause warnings and errors (if any) to be colored yellow and red,"
|
||||
echo "respectively. This relies on Perl being installed, so if you say yes"
|
||||
echo "to this without Perl, the option will be ignored."
|
||||
echo "NOTE: If you are using MinGW, it is NOT recommended to say yes to"
|
||||
@@ -377,6 +336,19 @@ 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"
|
||||
echo "missing dependencies without hints."
|
||||
echo "You can do this by: -DEXTRA_INCLUDE:STRING=/path/to/files;/path/to/more/files"
|
||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
EXTRA_CONFIG_ARGS=$INPUT
|
||||
fi
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
################################################################################
|
||||
# Store values
|
||||
################################################################################
|
||||
@@ -384,12 +356,12 @@ echo ""
|
||||
echo2 "Saving configuration results in config.cache... "
|
||||
|
||||
cat <<EOT >$SOURCE_DIR/config.cache
|
||||
BUILD_SYSTEM="$BUILD_SYSTEM"
|
||||
INSTDIR="$INSTDIR"
|
||||
RUNGROUP="$RUNGROUP"
|
||||
UMASK=$UMASK
|
||||
DEBUG="$DEBUG"
|
||||
USE_RUN_CC_PL="$USE_RUN_CC_PL"
|
||||
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
|
||||
EOT
|
||||
echo "done."
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
@echo off
|
||||
cscript /nologo "%~dp0\install.js"
|
||||
pause
|
||||
BIN
Binary file not shown.
-102
@@ -1,102 +0,0 @@
|
||||
CC=g++ # probably wrong but oh well.
|
||||
INCLUDEDIR=../include
|
||||
ANOPELIBS=@ANOPELIBS@
|
||||
CFLAGS=@CFLAGS@ -Wall -ansi -pedantic -Wshadow
|
||||
PROFILE=-pg
|
||||
LDPROFILE=
|
||||
SHELL=/bin/sh
|
||||
INSTDIR=@INSTDIR@
|
||||
MAKEBIN=@MAKEBIN@
|
||||
INSTALL=@INSTALL@
|
||||
RM=@RM@
|
||||
CP=@CP@
|
||||
TOUCH=@TOUCH@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
RUNGROUP=@RUNGROUP@
|
||||
SHARED=@SHARED@
|
||||
MODULEFLAGS=@MODULEFLAGS@
|
||||
|
||||
all: language headers build core protocols tools modules
|
||||
profile: language headers profile_build profile_core profile_protocols profile_tools profile_modules
|
||||
|
||||
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
|
||||
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
|
||||
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
|
||||
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
|
||||
'RUNGROUP=${RUNGROUP}' \
|
||||
'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' \
|
||||
'MAKEBIN=${MAKEBIN}'
|
||||
|
||||
build: language headers
|
||||
@${MAKE} -C src ${MAKEARGS} all
|
||||
|
||||
profile_build:
|
||||
@${MAKE} -C src ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' 'LDFLAGS=${LDFLAGS} ${PROFILE}' all
|
||||
|
||||
modules: build
|
||||
@src/modules/configure src/modules
|
||||
@${MAKE} -C src/modules ${MAKEARGS} all
|
||||
@echo "*** All done, now (g)make install to install Anope/Modules";
|
||||
|
||||
clean_modules:
|
||||
@${MAKE} -C src ${MAKEARGS} clean_modules
|
||||
|
||||
distclean_modules:
|
||||
@${MAKE} -C src ${MAKEARGS} distclean_modules
|
||||
|
||||
protocols: build
|
||||
@echo "*** Building protocol support";
|
||||
@src/protocol/configure src/protocol
|
||||
@${MAKE} -C src/protocol ${MAKEARGS} all
|
||||
|
||||
profile_protocols: build
|
||||
@echo "*** Building protocol support";
|
||||
@src/protocol/configure src/protocol
|
||||
@${MAKE} -C src/protocol ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all
|
||||
|
||||
core: build
|
||||
@echo "*** Building Core modules";
|
||||
@${MAKE} -C src ${MAKEARGS} core
|
||||
|
||||
profile_core: build
|
||||
@echo "*** Building Core modules";
|
||||
@${MAKE} -C src ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' core
|
||||
|
||||
tools: build
|
||||
@${MAKE} -C src/tools ${MAKEARGS} all
|
||||
@echo "*** All done, now (g)make install to install Anope/Modules/Tools";
|
||||
|
||||
profile_tools: profile_build
|
||||
@${MAKE} -C src/tools ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' all
|
||||
@echo "*** All done, now (g)make install to install Anope/Modules/Tools";
|
||||
|
||||
profile_modules: profile_build
|
||||
@src/modules/configure src/modules
|
||||
@${MAKE} -C src/modules ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all
|
||||
@echo "*** All done, now (g)make install to install Anope/Modules";
|
||||
|
||||
language:
|
||||
@$(MAKE) -C lang ${MAKEARGS} all language.h
|
||||
|
||||
headers:
|
||||
@${MAKE} -C include ${MAKEARGS}
|
||||
|
||||
clean:
|
||||
${MAKE} -C lang ${MAKEARGS} clean
|
||||
${MAKE} -C include ${MAKEARGS} clean
|
||||
${MAKE} -C src ${MAKEARGS} clean
|
||||
${MAKE} -C src/tools ${MAKEARGS} clean
|
||||
|
||||
distclean: clean
|
||||
${MAKE} -C lang ${MAKEARGS} distclean
|
||||
${MAKE} -C include ${MAKEARGS} distclean
|
||||
${MAKE} -C src ${MAKEARGS} distclean
|
||||
${MAKE} -C src/tools ${MAKEARGS} distclean
|
||||
rm -f config.log config.status config.cache Makefile src/bin/anoperc
|
||||
|
||||
install: DUMMY
|
||||
${MAKE} -C src ${MAKEARGS} install
|
||||
${MAKE} -C src/tools ${MAKEARGS} install
|
||||
@echo "*** All done, Anope is now installed. Please read docs/INSTALL for details on what to do now.";
|
||||
|
||||
DUMMY:
|
||||
@@ -1,119 +0,0 @@
|
||||
Legend:
|
||||
x = done
|
||||
? = unsure
|
||||
+ = in progress
|
||||
|
||||
1.9.0
|
||||
-----
|
||||
[x] additional field where users' masked host can be stored so both masked IP and vhost are available instead of just one.
|
||||
[x] no struct Uid bollocks. that's insane, and now, unnecessary that we store UID in BotInfo.
|
||||
[x] prevent deletion of core services via /bs bot
|
||||
[x] Module subsystem cleanup ('modules' branch)
|
||||
[x] Move modules to use classes somewhat (AnopeInit, AnopeFini)
|
||||
[x] Change MODULE_INIT to return a pointer
|
||||
[x] Remove duplicate module creation.. have loadModule return a pointer rather than creating one
|
||||
[x] Remove buffered loading/unloading, this makes os_modunload perm, but who cares
|
||||
[x] Mark os_modunload permanent.
|
||||
[x] Remove 'delayed' loading, this is necessary because of before/after connected to ircd (ircd is before, rest after), I'm sure this can be done better.
|
||||
[x] Remove mod_current_* crap (involves passing Module * around a lot)
|
||||
[x] events.c
|
||||
[x] modules.c
|
||||
[x] commands.c
|
||||
[x] Redo moduleAdd|Get|Remove data to use class Extensible, etc.
|
||||
[x] remove old config, replace with insp-inspired (albeit bind format) config (CBX)
|
||||
[x] Clean up protocol
|
||||
[x] Fix anope_cmd_* stuff to just use IRCdProto methods directly
|
||||
[x] SendClientIntroduction should take a UID param, rather than generating one(?)
|
||||
[x] Fix permanent channels (+P) stuff.
|
||||
[x] Remove UnRestrictSAdmin, UseTS6, UseSVSHOLD
|
||||
[x] InspIRCd 1.2 support
|
||||
[x] Remove old (prior to 1.8.0) db compat
|
||||
[x] Establish a proper base for services pseudoclients
|
||||
[x] add ss_main StatServ Hal9000 to play with :)
|
||||
[x] burn automake with fire (CBX)
|
||||
|
||||
1.9.1
|
||||
-----
|
||||
[ ] Remove modules_unload_all fini + hack that goes with it
|
||||
[ ] signal handling cleanup
|
||||
[ ] Move a (lot) of stuff to class members as a defined interface rather than copypasta everywhere (ns_set, ns_saset!)
|
||||
[ ] Redo database insanity.
|
||||
[ ] Move database load/save to a module
|
||||
[ ] realtime SQL/whatever module using events
|
||||
[ ] flatfile save on a periodic timer
|
||||
[ ] SANE password encryption - prefix password with the method it was encrypted with, allowing for *seamless* upgrading to different methods
|
||||
[ ] Salted SHA256 (contact Special for this)
|
||||
[ ] New database format (text, not binary - works very well for merging and so on)
|
||||
[ ] burn do_sjoin with fire
|
||||
[ ] Seamless fantasy support for all ChanServ commands, instead of requiring bs_fantasy_*
|
||||
[ ] HelpServ must die (1.9.1?)
|
||||
[ ] Command parser cleanup
|
||||
[ ] mod_current_buffer needs to go away and be replaced by a proper parser. Commands should then indicate how they want the buffer split.
|
||||
[ ] Fix permanent channels support properly. This will require removing do_sjoin().
|
||||
[ ] Make NS ENFORCE/RELEASE stuff more sane, redo timers
|
||||
[ ] Add support for +k, +q, etc type umodes
|
||||
|
||||
1.9.2
|
||||
-----
|
||||
[ ] Socket subsystem needs some serious loving
|
||||
[ ] Multiple sockets
|
||||
[ ] Asynchronous, using select() (multiple engines? not really needed..)
|
||||
[ ] Callbacks, event style, see also inspircd
|
||||
[ ] Asynchronous DNS?
|
||||
[ ] CS SET INHABIT to keep pseudoclient in a channel after it empties to maintain banlists and such
|
||||
[?] Remote identification (1.9.1? will this break stuff?)
|
||||
[ ] Requires a rejig of how Alias vs Core works
|
||||
[ ] Language charset stuff, including collation (1.9.1? phoenix?)
|
||||
|
||||
Future
|
||||
------
|
||||
[ ] way for one module to depend on another... not like 2 MOD_HEADs and it being unpredictable which is loaded first..
|
||||
the MOD_HEAD MOD_TAIL allows for too few combinations (interface code of insp, hooks code of insp?)
|
||||
[ ] generic database routines modules can use to create their own database
|
||||
[ ] generic way to check which modes a user has set (u->HasUmode(UMODE_OPER))
|
||||
? [ ] a way for a module to queue itself (or even another module) for unloading
|
||||
[ ] add overridden form of SendGlobops accepting BotInfo
|
||||
[ ] SendAkill should just take a pointer to the Akill class instead of millions of fields (same for some other stuff)
|
||||
[ ] chan_set_modes should take BotInfo, possibly with override for User *?
|
||||
[ ] Language system is disgusting, it must die.
|
||||
[ ] Modules should also have a way to add strings programatically
|
||||
[ ] Should be able to add many strings by dropping a file in a set location.
|
||||
[ ] I forsee this working via a function rather than defines, as it seems to do now: e.g. _("NS_NICK_IS_REGISTERED").
|
||||
[?] Mail memos? think on consequences of this
|
||||
[ ] Useful/common "third party" modules to core distro
|
||||
[ ] NS AJOIN
|
||||
[ ] Last used time on AKICK/access entries
|
||||
[ ] Channel access additions
|
||||
[ ] Method to store listmodes (more generically than AKICK, too) for e.g. +beI and extbans, etc.
|
||||
[ ] Setter
|
||||
[ ] Time added
|
||||
[ ] Time modified
|
||||
[ ] Expiry (useful?)
|
||||
[ ] Set forbidden channels +s
|
||||
[ ] 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)
|
||||
XXX: is SUSPEND overlapping with OS IGNORE functionality?
|
||||
[ ] Merge NS INFO blah ALL with NS INFO blah, if you're requesting info, you really want the info anyway.
|
||||
? [ ] Channel passwords seem to be of limited use, think of a more appropriate way to handle this
|
||||
? [ ] Don't allow soper accounts to expire
|
||||
? [ ] Reason for CS SET RESTRICTED
|
||||
[ ] NS IDENTIFY changes
|
||||
? [ ] Last failed identify? Maybe more useful for sopers only, so users don't get unnecessarily worried
|
||||
? [ ] Last successful login time/ip? perhaps both of these should be a new nick setting
|
||||
[ ] AKILL/SGLINE/etc..
|
||||
[ ] Setter
|
||||
[ ] Time added
|
||||
[ ] Time modified (can they be modified?)
|
||||
[ ] Time until expiry/expiry time (YES, time until expiry *instead of* expiry time, more human)
|
||||
[ ] 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)
|
||||
[ ] Settable oper flags (split into types containing privs+commands, allow each oper to be set to a type, like we do with insp?)
|
||||
[ ] NS MARK, CS MARK. Allow multiple marks. Combine into OS MARK?
|
||||
[ ] General options block, ability to turn LOGCHAN on from the config file..
|
||||
[ ] Method to list suspended/forbidden nicks/channels?
|
||||
? [ ] MS IGNORE. Make it take nick (accounts) or n!u@h masks. Fake success of memo send still, but send to opers?
|
||||
? [ ] More "friendly" date displays of some things like registration time ("November 7th 2006 (2 years, 0 months, 0 days ago)")
|
||||
? [ ] Review settings like NSModeOnID for whether they actually have a point existing (Rob says it does not - and that it should probably be a nickname setting)
|
||||
? [ ] OS INJECT
|
||||
? [ ] Drop CS SET ENTRYMSG, replace with a 'news' type system? (limited to a configured number of items, default 3)
|
||||
Vendored
-871
@@ -1,871 +0,0 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
# lib-prefix.m4 serial 4 (gettext-0.14.2)
|
||||
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
|
||||
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
|
||||
dnl require excessive bracketing.
|
||||
ifdef([AC_HELP_STRING],
|
||||
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
|
||||
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
|
||||
|
||||
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
|
||||
dnl to access previously installed libraries. The basic assumption is that
|
||||
dnl a user will want packages to use other packages he previously installed
|
||||
dnl with the same --prefix option.
|
||||
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
|
||||
dnl libraries, but is otherwise very convenient.
|
||||
AC_DEFUN([AC_LIB_PREFIX],
|
||||
[
|
||||
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
dnl By default, look in $includedir and $libdir.
|
||||
use_additional=yes
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
AC_LIB_ARG_WITH([lib-prefix],
|
||||
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
|
||||
--without-lib-prefix don't search for libraries in includedir and libdir],
|
||||
[
|
||||
if test "X$withval" = "Xno"; then
|
||||
use_additional=no
|
||||
else
|
||||
if test "X$withval" = "X"; then
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
else
|
||||
additional_includedir="$withval/include"
|
||||
additional_libdir="$withval/lib"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
if test $use_additional = yes; then
|
||||
dnl Potentially add $additional_includedir to $CPPFLAGS.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/include,
|
||||
dnl 2. if it's already present in $CPPFLAGS,
|
||||
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_includedir" != "X/usr/include"; then
|
||||
haveit=
|
||||
for x in $CPPFLAGS; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-I$additional_includedir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test "X$additional_includedir" = "X/usr/local/include"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_includedir"; then
|
||||
dnl Really add $additional_includedir to $CPPFLAGS.
|
||||
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Potentially add $additional_libdir to $LDFLAGS.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/lib,
|
||||
dnl 2. if it's already present in $LDFLAGS,
|
||||
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_libdir" != "X/usr/lib"; then
|
||||
haveit=
|
||||
for x in $LDFLAGS; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test "X$additional_libdir" = "X/usr/local/lib"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux*) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LDFLAGS.
|
||||
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
|
||||
dnl acl_final_exec_prefix, containing the values to which $prefix and
|
||||
dnl $exec_prefix will expand at the end of the configure script.
|
||||
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
|
||||
[
|
||||
dnl Unfortunately, prefix and exec_prefix get only finally determined
|
||||
dnl at the end of configure.
|
||||
if test "X$prefix" = "XNONE"; then
|
||||
acl_final_prefix="$ac_default_prefix"
|
||||
else
|
||||
acl_final_prefix="$prefix"
|
||||
fi
|
||||
if test "X$exec_prefix" = "XNONE"; then
|
||||
acl_final_exec_prefix='${prefix}'
|
||||
else
|
||||
acl_final_exec_prefix="$exec_prefix"
|
||||
fi
|
||||
acl_save_prefix="$prefix"
|
||||
prefix="$acl_final_prefix"
|
||||
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
|
||||
prefix="$acl_save_prefix"
|
||||
])
|
||||
|
||||
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
|
||||
dnl variables prefix and exec_prefix bound to the values they will have
|
||||
dnl at the end of the configure script.
|
||||
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
|
||||
[
|
||||
acl_save_prefix="$prefix"
|
||||
prefix="$acl_final_prefix"
|
||||
acl_save_exec_prefix="$exec_prefix"
|
||||
exec_prefix="$acl_final_exec_prefix"
|
||||
$1
|
||||
exec_prefix="$acl_save_exec_prefix"
|
||||
prefix="$acl_save_prefix"
|
||||
])
|
||||
|
||||
# lib-link.m4 serial 6 (gettext-0.14.3)
|
||||
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
|
||||
dnl the libraries corresponding to explicit and implicit dependencies.
|
||||
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
|
||||
dnl augments the CPPFLAGS variable.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
define([Name],[translit([$1],[./-], [___])])
|
||||
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
|
||||
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
||||
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
|
||||
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
|
||||
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
|
||||
])
|
||||
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
|
||||
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
|
||||
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
||||
AC_SUBST([LIB]NAME)
|
||||
AC_SUBST([LTLIB]NAME)
|
||||
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
|
||||
dnl results of this search when this library appears as a dependency.
|
||||
HAVE_LIB[]NAME=yes
|
||||
undefine([Name])
|
||||
undefine([NAME])
|
||||
])
|
||||
|
||||
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
|
||||
dnl searches for libname and the libraries corresponding to explicit and
|
||||
dnl implicit dependencies, together with the specified include files and
|
||||
dnl the ability to compile and link the specified testcode. If found, it
|
||||
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
|
||||
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
|
||||
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
|
||||
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
|
||||
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
|
||||
[
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
AC_REQUIRE([AC_LIB_RPATH])
|
||||
define([Name],[translit([$1],[./-], [___])])
|
||||
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
|
||||
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
|
||||
dnl accordingly.
|
||||
AC_LIB_LINKFLAGS_BODY([$1], [$2])
|
||||
|
||||
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed lib[]Name and not disabled its use
|
||||
dnl via --without-lib[]Name-prefix, he wants to use it.
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
|
||||
|
||||
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIB[]NAME"
|
||||
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
|
||||
LIBS="$ac_save_LIBS"
|
||||
])
|
||||
if test "$ac_cv_lib[]Name" = yes; then
|
||||
HAVE_LIB[]NAME=yes
|
||||
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
|
||||
AC_MSG_CHECKING([how to link with lib[]$1])
|
||||
AC_MSG_RESULT([$LIB[]NAME])
|
||||
else
|
||||
HAVE_LIB[]NAME=no
|
||||
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
|
||||
dnl $INC[]NAME either.
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
LIB[]NAME=
|
||||
LTLIB[]NAME=
|
||||
fi
|
||||
AC_SUBST([HAVE_LIB]NAME)
|
||||
AC_SUBST([LIB]NAME)
|
||||
AC_SUBST([LTLIB]NAME)
|
||||
undefine([Name])
|
||||
undefine([NAME])
|
||||
])
|
||||
|
||||
dnl Determine the platform dependent parameters needed to use rpath:
|
||||
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
|
||||
dnl hardcode_direct, hardcode_minus_L.
|
||||
AC_DEFUN([AC_LIB_RPATH],
|
||||
[
|
||||
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
|
||||
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
|
||||
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
|
||||
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
|
||||
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
|
||||
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
|
||||
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
|
||||
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
|
||||
. ./conftest.sh
|
||||
rm -f ./conftest.sh
|
||||
acl_cv_rpath=done
|
||||
])
|
||||
wl="$acl_cv_wl"
|
||||
libext="$acl_cv_libext"
|
||||
shlibext="$acl_cv_shlibext"
|
||||
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
|
||||
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
|
||||
hardcode_direct="$acl_cv_hardcode_direct"
|
||||
hardcode_minus_L="$acl_cv_hardcode_minus_L"
|
||||
dnl Determine whether the user wants rpath handling at all.
|
||||
AC_ARG_ENABLE(rpath,
|
||||
[ --disable-rpath do not hardcode runtime library paths],
|
||||
:, enable_rpath=yes)
|
||||
])
|
||||
|
||||
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
|
||||
dnl the libraries corresponding to explicit and implicit dependencies.
|
||||
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
|
||||
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|
||||
[
|
||||
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
|
||||
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
|
||||
dnl By default, look in $includedir and $libdir.
|
||||
use_additional=yes
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
AC_LIB_ARG_WITH([lib$1-prefix],
|
||||
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
|
||||
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
|
||||
[
|
||||
if test "X$withval" = "Xno"; then
|
||||
use_additional=no
|
||||
else
|
||||
if test "X$withval" = "X"; then
|
||||
AC_LIB_WITH_FINAL_PREFIX([
|
||||
eval additional_includedir=\"$includedir\"
|
||||
eval additional_libdir=\"$libdir\"
|
||||
])
|
||||
else
|
||||
additional_includedir="$withval/include"
|
||||
additional_libdir="$withval/lib"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
dnl Search the library and its dependencies in $additional_libdir and
|
||||
dnl $LDFLAGS. Using breadth-first-seach.
|
||||
LIB[]NAME=
|
||||
LTLIB[]NAME=
|
||||
INC[]NAME=
|
||||
rpathdirs=
|
||||
ltrpathdirs=
|
||||
names_already_handled=
|
||||
names_next_round='$1 $2'
|
||||
while test -n "$names_next_round"; do
|
||||
names_this_round="$names_next_round"
|
||||
names_next_round=
|
||||
for name in $names_this_round; do
|
||||
already_handled=
|
||||
for n in $names_already_handled; do
|
||||
if test "$n" = "$name"; then
|
||||
already_handled=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$already_handled"; then
|
||||
names_already_handled="$names_already_handled $name"
|
||||
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
|
||||
dnl or AC_LIB_HAVE_LINKFLAGS call.
|
||||
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
|
||||
eval value=\"\$HAVE_LIB$uppername\"
|
||||
if test -n "$value"; then
|
||||
if test "$value" = yes; then
|
||||
eval value=\"\$LIB$uppername\"
|
||||
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
|
||||
eval value=\"\$LTLIB$uppername\"
|
||||
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
|
||||
else
|
||||
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
|
||||
dnl that this library doesn't exist. So just drop it.
|
||||
:
|
||||
fi
|
||||
else
|
||||
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
|
||||
dnl and the already constructed $LIBNAME/$LTLIBNAME.
|
||||
found_dir=
|
||||
found_la=
|
||||
found_so=
|
||||
found_a=
|
||||
if test $use_additional = yes; then
|
||||
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
|
||||
found_dir="$additional_libdir"
|
||||
found_so="$additional_libdir/lib$name.$shlibext"
|
||||
if test -f "$additional_libdir/lib$name.la"; then
|
||||
found_la="$additional_libdir/lib$name.la"
|
||||
fi
|
||||
else
|
||||
if test -f "$additional_libdir/lib$name.$libext"; then
|
||||
found_dir="$additional_libdir"
|
||||
found_a="$additional_libdir/lib$name.$libext"
|
||||
if test -f "$additional_libdir/lib$name.la"; then
|
||||
found_la="$additional_libdir/lib$name.la"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "X$found_dir" = "X"; then
|
||||
for x in $LDFLAGS $LTLIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
case "$x" in
|
||||
-L*)
|
||||
dir=`echo "X$x" | sed -e 's/^X-L//'`
|
||||
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
|
||||
found_dir="$dir"
|
||||
found_so="$dir/lib$name.$shlibext"
|
||||
if test -f "$dir/lib$name.la"; then
|
||||
found_la="$dir/lib$name.la"
|
||||
fi
|
||||
else
|
||||
if test -f "$dir/lib$name.$libext"; then
|
||||
found_dir="$dir"
|
||||
found_a="$dir/lib$name.$libext"
|
||||
if test -f "$dir/lib$name.la"; then
|
||||
found_la="$dir/lib$name.la"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "X$found_dir" != "X"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if test "X$found_dir" != "X"; then
|
||||
dnl Found the library.
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
|
||||
if test "X$found_so" != "X"; then
|
||||
dnl Linking with a shared library. We attempt to hardcode its
|
||||
dnl directory into the executable's runpath, unless it's the
|
||||
dnl standard /usr/lib.
|
||||
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
|
||||
dnl No hardcoding is needed.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
dnl Use an explicit option to hardcode DIR into the resulting
|
||||
dnl binary.
|
||||
dnl Potentially add DIR to ltrpathdirs.
|
||||
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
||||
haveit=
|
||||
for x in $ltrpathdirs; do
|
||||
if test "X$x" = "X$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
ltrpathdirs="$ltrpathdirs $found_dir"
|
||||
fi
|
||||
dnl The hardcoding into $LIBNAME is system dependent.
|
||||
if test "$hardcode_direct" = yes; then
|
||||
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
dnl resulting binary.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
|
||||
dnl Use an explicit option to hardcode DIR into the resulting
|
||||
dnl binary.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
dnl Potentially add DIR to rpathdirs.
|
||||
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
||||
haveit=
|
||||
for x in $rpathdirs; do
|
||||
if test "X$x" = "X$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
rpathdirs="$rpathdirs $found_dir"
|
||||
fi
|
||||
else
|
||||
dnl Rely on "-L$found_dir".
|
||||
dnl But don't add it if it's already contained in the LDFLAGS
|
||||
dnl or the already constructed $LIBNAME
|
||||
haveit=
|
||||
for x in $LDFLAGS $LIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$found_dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
|
||||
fi
|
||||
if test "$hardcode_minus_L" != no; then
|
||||
dnl FIXME: Not sure whether we should use
|
||||
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
||||
dnl here.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
|
||||
else
|
||||
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
|
||||
dnl here, because this doesn't fit in flags passed to the
|
||||
dnl compiler. So give up. No hardcoding. This affects only
|
||||
dnl very old systems.
|
||||
dnl FIXME: Not sure whether we should use
|
||||
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
|
||||
dnl here.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test "X$found_a" != "X"; then
|
||||
dnl Linking with a static library.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
|
||||
else
|
||||
dnl We shouldn't come here, but anyway it's good to have a
|
||||
dnl fallback.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
|
||||
fi
|
||||
fi
|
||||
dnl Assume the include files are nearby.
|
||||
additional_includedir=
|
||||
case "$found_dir" in
|
||||
*/lib | */lib/)
|
||||
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
|
||||
additional_includedir="$basedir/include"
|
||||
;;
|
||||
esac
|
||||
if test "X$additional_includedir" != "X"; then
|
||||
dnl Potentially add $additional_includedir to $INCNAME.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/include,
|
||||
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
|
||||
dnl 3. if it's already present in $CPPFLAGS or the already
|
||||
dnl constructed $INCNAME,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_includedir" != "X/usr/include"; then
|
||||
haveit=
|
||||
if test "X$additional_includedir" = "X/usr/local/include"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
for x in $CPPFLAGS $INC[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-I$additional_includedir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_includedir"; then
|
||||
dnl Really add $additional_includedir to $INCNAME.
|
||||
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dnl Look for dependencies.
|
||||
if test -n "$found_la"; then
|
||||
dnl Read the .la file. It defines the variables
|
||||
dnl dlname, library_names, old_library, dependency_libs, current,
|
||||
dnl age, revision, installed, dlopen, dlpreopen, libdir.
|
||||
save_libdir="$libdir"
|
||||
case "$found_la" in
|
||||
*/* | *\\*) . "$found_la" ;;
|
||||
*) . "./$found_la" ;;
|
||||
esac
|
||||
libdir="$save_libdir"
|
||||
dnl We use only dependency_libs.
|
||||
for dep in $dependency_libs; do
|
||||
case "$dep" in
|
||||
-L*)
|
||||
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
|
||||
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
|
||||
dnl But don't add it
|
||||
dnl 1. if it's the standard /usr/lib,
|
||||
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
|
||||
dnl 3. if it's already present in $LDFLAGS or the already
|
||||
dnl constructed $LIBNAME,
|
||||
dnl 4. if it doesn't exist as a directory.
|
||||
if test "X$additional_libdir" != "X/usr/lib"; then
|
||||
haveit=
|
||||
if test "X$additional_libdir" = "X/usr/local/lib"; then
|
||||
if test -n "$GCC"; then
|
||||
case $host_os in
|
||||
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if test -z "$haveit"; then
|
||||
haveit=
|
||||
for x in $LDFLAGS $LIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LIBNAME.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
haveit=
|
||||
for x in $LDFLAGS $LTLIB[]NAME; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X-L$additional_libdir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
if test -d "$additional_libdir"; then
|
||||
dnl Really add $additional_libdir to $LTLIBNAME.
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
-R*)
|
||||
dir=`echo "X$dep" | sed -e 's/^X-R//'`
|
||||
if test "$enable_rpath" != no; then
|
||||
dnl Potentially add DIR to rpathdirs.
|
||||
dnl The rpathdirs will be appended to $LIBNAME at the end.
|
||||
haveit=
|
||||
for x in $rpathdirs; do
|
||||
if test "X$x" = "X$dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
rpathdirs="$rpathdirs $dir"
|
||||
fi
|
||||
dnl Potentially add DIR to ltrpathdirs.
|
||||
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
|
||||
haveit=
|
||||
for x in $ltrpathdirs; do
|
||||
if test "X$x" = "X$dir"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
ltrpathdirs="$ltrpathdirs $dir"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
-l*)
|
||||
dnl Handle this in the next round.
|
||||
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
|
||||
;;
|
||||
*.la)
|
||||
dnl Handle this in the next round. Throw away the .la's
|
||||
dnl directory; it is already contained in a preceding -L
|
||||
dnl option.
|
||||
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
|
||||
;;
|
||||
*)
|
||||
dnl Most likely an immediate library name.
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
else
|
||||
dnl Didn't find the library; assume it is in the system directories
|
||||
dnl known to the linker and runtime loader. (All the system
|
||||
dnl directories known to the linker should also be known to the
|
||||
dnl runtime loader, otherwise the system is severely misconfigured.)
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
if test "X$rpathdirs" != "X"; then
|
||||
if test -n "$hardcode_libdir_separator"; then
|
||||
dnl Weird platform: only the last -rpath option counts, the user must
|
||||
dnl pass all path elements in one option. We can arrange that for a
|
||||
dnl single library, but not when more than one $LIBNAMEs are used.
|
||||
alldirs=
|
||||
for found_dir in $rpathdirs; do
|
||||
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
|
||||
done
|
||||
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$alldirs"
|
||||
eval flag=\"$hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
||||
else
|
||||
dnl The -rpath options are cumulative.
|
||||
for found_dir in $rpathdirs; do
|
||||
acl_save_libdir="$libdir"
|
||||
libdir="$found_dir"
|
||||
eval flag=\"$hardcode_libdir_flag_spec\"
|
||||
libdir="$acl_save_libdir"
|
||||
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
if test "X$ltrpathdirs" != "X"; then
|
||||
dnl When using libtool, the option that works for both libraries and
|
||||
dnl executables is -R. The -R options are cumulative.
|
||||
for found_dir in $ltrpathdirs; do
|
||||
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
|
||||
dnl unless already present in VAR.
|
||||
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
|
||||
dnl contains two or three consecutive elements that belong together.
|
||||
AC_DEFUN([AC_LIB_APPENDTOVAR],
|
||||
[
|
||||
for element in [$2]; do
|
||||
haveit=
|
||||
for x in $[$1]; do
|
||||
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
|
||||
if test "X$x" = "X$element"; then
|
||||
haveit=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$haveit"; then
|
||||
[$1]="${[$1]}${[$1]:+ }$element"
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
# lib-ld.m4 serial 3 (gettext-0.13)
|
||||
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Subroutines of libtool.m4,
|
||||
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
|
||||
dnl with libtool.m4.
|
||||
|
||||
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
|
||||
AC_DEFUN([AC_LIB_PROG_LD_GNU],
|
||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
|
||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
||||
case `$LD -v 2>&1 </dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
acl_cv_prog_gnu_ld=yes ;;
|
||||
*)
|
||||
acl_cv_prog_gnu_ld=no ;;
|
||||
esac])
|
||||
with_gnu_ld=$acl_cv_prog_gnu_ld
|
||||
])
|
||||
|
||||
dnl From libtool-1.4. Sets the variable LD.
|
||||
AC_DEFUN([AC_LIB_PROG_LD],
|
||||
[AC_ARG_WITH(gnu-ld,
|
||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
# Prepare PATH_SEPARATOR.
|
||||
# The user is always right.
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
echo "#! /bin/sh" >conf$$.sh
|
||||
echo "exit 0" >>conf$$.sh
|
||||
chmod +x conf$$.sh
|
||||
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
||||
PATH_SEPARATOR=';'
|
||||
else
|
||||
PATH_SEPARATOR=:
|
||||
fi
|
||||
rm -f conf$$.sh
|
||||
fi
|
||||
ac_prog=ld
|
||||
if test "$GCC" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
AC_MSG_CHECKING([for ld used by GCC])
|
||||
case $host in
|
||||
*-*-mingw*)
|
||||
# gcc leaves a trailing carriage return which upsets mingw
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
|
||||
*)
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
|
||||
esac
|
||||
case $ac_prog in
|
||||
# Accept absolute paths.
|
||||
[[\\/]* | [A-Za-z]:[\\/]*)]
|
||||
[re_direlt='/[^/][^/]*/\.\./']
|
||||
# Canonicalize the path of ld
|
||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
||||
done
|
||||
test -z "$LD" && LD="$ac_prog"
|
||||
;;
|
||||
"")
|
||||
# If it fails, then pretend we aren't using GCC.
|
||||
ac_prog=ld
|
||||
;;
|
||||
*)
|
||||
# If it is relative, then search for the first ld in PATH.
|
||||
with_gnu_ld=unknown
|
||||
;;
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
AC_MSG_CHECKING([for GNU ld])
|
||||
else
|
||||
AC_MSG_CHECKING([for non-GNU ld])
|
||||
fi
|
||||
AC_CACHE_VAL(acl_cv_path_LD,
|
||||
[if test -z "$LD"; then
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
||||
acl_cv_path_LD="$ac_dir/$ac_prog"
|
||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
||||
# but apparently some GNU ld's only accept -v.
|
||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
||||
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
test "$with_gnu_ld" != no && break ;;
|
||||
*)
|
||||
test "$with_gnu_ld" != yes && break ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
else
|
||||
acl_cv_path_LD="$LD" # Let the user override the test with a path.
|
||||
fi])
|
||||
LD="$acl_cv_path_LD"
|
||||
if test -n "$LD"; then
|
||||
AC_MSG_RESULT($LD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
||||
AC_LIB_PROG_LD_GNU
|
||||
])
|
||||
|
||||
dnl Macro: anope_CHECK_TYPE_SIZES
|
||||
dnl
|
||||
dnl Check the size of several types and define a valid int16_t and int32_t.
|
||||
dnl
|
||||
AC_DEFUN(anope_CHECK_TYPE_SIZES,
|
||||
[dnl Check type sizes
|
||||
dnl AC_CHECK_SIZEOF(short)
|
||||
dnl AC_CHECK_SIZEOF(int)
|
||||
dnl AC_CHECK_SIZEOF(long)
|
||||
dnl if test "$ac_cv_sizeof_int" = 2 ; then
|
||||
dnl AC_CHECK_TYPE(int16_t, int)
|
||||
dnl AC_CHECK_TYPE(u_int16_t, unsigned int)
|
||||
dnl elif test "$ac_cv_sizeof_short" = 2 ; then
|
||||
dnl AC_CHECK_TYPE(int16_t, short)
|
||||
dnl AC_CHECK_TYPE(u_int16_t, unsigned short)
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR([Cannot find a type with size of 16 bits])
|
||||
dnl fi
|
||||
dnl if test "$ac_cv_sizeof_int" = 4 ; then
|
||||
dnl AC_CHECK_TYPE(int32_t, int)
|
||||
dnl AC_CHECK_TYPE(u_int32_t, unsigned int)
|
||||
dnl elif test "$ac_cv_sizeof_short" = 4 ; then
|
||||
dnl AC_CHECK_TYPE(int32_t, short)
|
||||
dnl AC_CHECK_TYPE(u_int32_t, unsigned short)
|
||||
dnl elif test "$ac_cv_sizeof_long" = 4 ; then
|
||||
dnl AC_CHECK_TYPE(int32_t, long)
|
||||
dnl AC_CHECK_TYPE(u_int32_t, unsigned long)
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR([Cannot find a type with size of 32 bits])
|
||||
dnl fi
|
||||
AC_CHECK_TYPE(uint8_t, AC_DEFINE(HAVE_UINT8_T, 1, "Has uint8_t type"))
|
||||
AC_CHECK_TYPE(u_int8_t, AC_DEFINE(HAVE_U_INT8_T, 1, "Has u_int8_t type"))
|
||||
AC_CHECK_TYPE(int16_t, AC_DEFINE(HAVE_INT16_T, 1, "Has int16_t type"))
|
||||
AC_CHECK_TYPE(uint16_t, AC_DEFINE(HAVE_UINT16_T, 1, "Has uint16_t type"))
|
||||
AC_CHECK_TYPE(u_int16_t, AC_DEFINE(HAVE_U_INT16_T, 1, "Has u_int16_t type"))
|
||||
AC_CHECK_TYPE(int32_t, AC_DEFINE(HAVE_INT32_T, 1, "Has int32_t type"))
|
||||
AC_CHECK_TYPE(uint32_t, AC_DEFINE(HAVE_UINT32_T, 1, "Has uint32_t type"))
|
||||
AC_CHECK_TYPE(u_int32_t, AC_DEFINE(HAVE_U_INT32_T, 1, "Has u_int32_t type"))
|
||||
])
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
dnl Macro: anope_CHECK_TYPE_SIZES
|
||||
dnl
|
||||
dnl Check the size of several types and define a valid int16_t and int32_t.
|
||||
dnl
|
||||
AC_DEFUN(anope_CHECK_TYPE_SIZES,
|
||||
[dnl Check type sizes
|
||||
dnl AC_CHECK_SIZEOF(short)
|
||||
dnl AC_CHECK_SIZEOF(int)
|
||||
dnl AC_CHECK_SIZEOF(long)
|
||||
dnl if test "$ac_cv_sizeof_int" = 2 ; then
|
||||
dnl AC_CHECK_TYPE(int16_t, int)
|
||||
dnl AC_CHECK_TYPE(u_int16_t, unsigned int)
|
||||
dnl elif test "$ac_cv_sizeof_short" = 2 ; then
|
||||
dnl AC_CHECK_TYPE(int16_t, short)
|
||||
dnl AC_CHECK_TYPE(u_int16_t, unsigned short)
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR([Cannot find a type with size of 16 bits])
|
||||
dnl fi
|
||||
dnl if test "$ac_cv_sizeof_int" = 4 ; then
|
||||
dnl AC_CHECK_TYPE(int32_t, int)
|
||||
dnl AC_CHECK_TYPE(u_int32_t, unsigned int)
|
||||
dnl elif test "$ac_cv_sizeof_short" = 4 ; then
|
||||
dnl AC_CHECK_TYPE(int32_t, short)
|
||||
dnl AC_CHECK_TYPE(u_int32_t, unsigned short)
|
||||
dnl elif test "$ac_cv_sizeof_long" = 4 ; then
|
||||
dnl AC_CHECK_TYPE(int32_t, long)
|
||||
dnl AC_CHECK_TYPE(u_int32_t, unsigned long)
|
||||
dnl else
|
||||
dnl AC_MSG_ERROR([Cannot find a type with size of 32 bits])
|
||||
dnl fi
|
||||
AC_CHECK_TYPE(uint8_t, AC_DEFINE(HAVE_UINT8_T, 1, "Has uint8_t type"))
|
||||
AC_CHECK_TYPE(u_int8_t, AC_DEFINE(HAVE_U_INT8_T, 1, "Has u_int8_t type"))
|
||||
AC_CHECK_TYPE(int16_t, AC_DEFINE(HAVE_INT16_T, 1, "Has int16_t type"))
|
||||
AC_CHECK_TYPE(uint16_t, AC_DEFINE(HAVE_UINT16_T, 1, "Has uint16_t type"))
|
||||
AC_CHECK_TYPE(u_int16_t, AC_DEFINE(HAVE_U_INT16_T, 1, "Has u_int16_t type"))
|
||||
AC_CHECK_TYPE(int32_t, AC_DEFINE(HAVE_INT32_T, 1, "Has int32_t type"))
|
||||
AC_CHECK_TYPE(uint32_t, AC_DEFINE(HAVE_UINT32_T, 1, "Has uint32_t type"))
|
||||
AC_CHECK_TYPE(u_int32_t, AC_DEFINE(HAVE_U_INT32_T, 1, "Has u_int32_t type"))
|
||||
])
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Generating build information using aclocal, autoheader, automake and autoconf."
|
||||
echo
|
||||
|
||||
# Regerate configuration files
|
||||
aclocal
|
||||
autoheader
|
||||
automake --gnu --add-missing --copy
|
||||
autoconf
|
||||
|
||||
echo
|
||||
echo "Now you are ready to run ./configure"
|
||||
@@ -0,0 +1,540 @@
|
||||
###############################################################################
|
||||
# strip_string(<input string> <output string>)
|
||||
#
|
||||
# A macro to handle stripping the leading and trailing spaces from a string,
|
||||
# uses string(STRIP) if using CMake 2.6.x or better, otherwise uses
|
||||
# string(REGEX REPLACE).
|
||||
###############################################################################
|
||||
macro(strip_string INPUT_STRING OUTPUT_STRING)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, we can just use the STRIP sub-command of string()
|
||||
string(STRIP ${INPUT_STRING} ${OUTPUT_STRING})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we will have to use the REGEX REPLACE sub-command of string() instead
|
||||
# First check if the input string is empty or not
|
||||
if (${INPUT_STRING} STREQUAL "")
|
||||
set(${OUTPUT_STRING} "")
|
||||
else(${INPUT_STRING} STREQUAL "")
|
||||
# Determine if the string is entirely empty or not
|
||||
string(REGEX MATCH "^[ \t]*$" EMPTY_STRING "${INPUT_STRING}")
|
||||
if(EMPTY_STRING)
|
||||
set(${OUTPUT_STRING} "")
|
||||
else(EMPTY_STRING)
|
||||
# We detect if there is any leading whitespace and remove any if there is
|
||||
string(SUBSTRING "${INPUT_STRING}" 0 1 FIRST_CHAR)
|
||||
if(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
|
||||
string(REGEX REPLACE "^[ \t]+" "" TEMP_STRING "${INPUT_STRING}")
|
||||
else(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
|
||||
set(TEMP_STRING "${INPUT_STRING}")
|
||||
endif(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
|
||||
# Next we detect if there is any trailing whitespace and remove any if there is
|
||||
string(LENGTH "${TEMP_STRING}" STRING_LEN)
|
||||
math(EXPR STRING_LEN "${STRING_LEN} - 1")
|
||||
string(SUBSTRING "${TEMP_STRING}" ${STRING_LEN} 1 LAST_CHAR)
|
||||
if(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
string(REGEX REPLACE "[ \t]+$" "" ${OUTPUT_STRING} "${TEMP_STRING}")
|
||||
else(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
set(${OUTPUT_STRING} "${TEMP_STRING}")
|
||||
endif(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
endif(EMPTY_STRING)
|
||||
endif(${INPUT_STRING} STREQUAL "")
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
endmacro(strip_string)
|
||||
|
||||
###############################################################################
|
||||
# append_to_list(<list> <args>...)
|
||||
#
|
||||
# A macro to handle appending to lists, uses list(APPEND) if using CMake 2.4.2
|
||||
# or better, otherwise uses set() instead.
|
||||
###############################################################################
|
||||
macro(append_to_list LIST)
|
||||
if(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.2 or better, we can just use the APPEND sub-command of list()
|
||||
list(APPEND ${LIST} ${ARGN})
|
||||
else(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.2, we have to do this manually use set() instead
|
||||
set(${LIST} ${${LIST}} ${ARGN})
|
||||
endif(CMAKE242_OR_BETTER)
|
||||
endmacro(append_to_list)
|
||||
|
||||
###############################################################################
|
||||
# find_in_list(<list> <value> <output variable>)
|
||||
#
|
||||
# A macro to handle searching within a list, will store the result in the
|
||||
# given <output variable>, uses list(FIND) if using CMake 2.6.x or better
|
||||
# (or CMake 2.4.8 or better), otherwise it iterates through the list to find
|
||||
# the item.
|
||||
###############################################################################
|
||||
macro(find_in_list LIST ITEM_TO_FIND FOUND)
|
||||
if(CMAKE248_OR_BETTER)
|
||||
# For CMake 2.4.8 or better, we can use the FIND sub-command of list()
|
||||
list(FIND ${LIST} ${ITEM_TO_FIND} ITEM_FOUND)
|
||||
else(CMAKE248_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.8, we have to do this ourselves (NOTE: This is very slow due to a lack of break() as well)
|
||||
# Firstly we set the position to -1 indicating nothing found, we also use a temporary position
|
||||
set(ITEM_FOUND -1)
|
||||
set(POS 0)
|
||||
# Iterate through the list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# If the item we are looking at is the item we are trying to find, set that we've found the item
|
||||
if(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
set(ITEM_FOUND ${POS})
|
||||
endif(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
# Increase the position value by 1
|
||||
math(EXPR POS "${POS} + 1")
|
||||
endforeach(ITEM)
|
||||
endif(CMAKE248_OR_BETTER)
|
||||
# Set the given FOUND variable to the result
|
||||
set(${FOUND} ${ITEM_FOUND})
|
||||
endmacro(find_in_list)
|
||||
|
||||
###############################################################################
|
||||
# remove_list_duplicates(<list>)
|
||||
#
|
||||
# A macro to handle removing duplicates from a list, uses
|
||||
# list(REMOVE_DUPLICATES) if using CMake 2.6.x or better, otherwise it uses
|
||||
# a slower method of creating a temporary list and only adding to it when
|
||||
# a duplicate item hasn't been found.
|
||||
###############################################################################
|
||||
macro(remove_list_duplicates LIST)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, this can be done automatically
|
||||
list(REMOVE_DUPLICATES ${LIST})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we have to do this ourselves, firstly we'll clear a temporary list
|
||||
set(NEW_LIST)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# Check if the item is in the new list
|
||||
find_in_list(NEW_LIST ${ITEM} FOUND_ITEM)
|
||||
if(FOUND_ITEM EQUAL -1)
|
||||
# If the item was not found, append it to the list
|
||||
append_to_list(NEW_LIST ${ITEM})
|
||||
endif(FOUND_ITEM EQUAL -1)
|
||||
endforeach(ITEM)
|
||||
# Replace the old list with the new list
|
||||
set(${LIST} ${NEW_LIST})
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
endmacro(remove_list_duplicates)
|
||||
|
||||
###############################################################################
|
||||
# remove_item_from_list(<list> <value>)
|
||||
#
|
||||
# A macro to handle removing a value from a list, uses list(REMOVE_ITEM) in
|
||||
# both cases, but can remove the value itself using CMake 2.4.2 or better,
|
||||
# while older versions use a slower method of iterating the list to find the
|
||||
# index of the value to remove.
|
||||
###############################################################################
|
||||
macro(remove_item_from_list LIST VALUE)
|
||||
if(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.2 or better, this can be done automatically
|
||||
list(REMOVE_ITEM ${LIST} ${VALUE})
|
||||
else(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.2, we have to do this ourselves, firstly we set the index and a variable to indicate if the item was found
|
||||
set(INDEX 0)
|
||||
set(FOUND FALSE)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# If the item hasn't been found yet, but the current item is the same, remove it
|
||||
if(NOT FOUND)
|
||||
if(ITEM STREQUAL ${VALUE})
|
||||
set(FOUND TRUE)
|
||||
list(REMOVE_ITEM ${LIST} ${INDEX})
|
||||
endif(ITEM STREQUAL ${VALUE})
|
||||
endif(NOT FOUND)
|
||||
# Increase the index value by 1
|
||||
math(EXPR INDEX "${INDEX} + 1")
|
||||
endforeach(ITEM)
|
||||
endif(CMAKE242_OR_BETTER)
|
||||
endmacro(remove_item_from_list)
|
||||
|
||||
###############################################################################
|
||||
# sort_list(<list>)
|
||||
#
|
||||
# A macro to handle sorting a list, uses list(SORT) if using CMake 2.4.4 or
|
||||
# better, otherwise it uses a slower method of creating a temporary list and
|
||||
# adding elements in alphabetical order.
|
||||
###############################################################################
|
||||
macro(sort_list LIST)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
# For CMake 2.4.4 or better, this can be done automatically
|
||||
list(SORT ${LIST})
|
||||
else(CMAKE244_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.4, we have to do this ourselves, firstly we'll create a teporary list
|
||||
set(NEW_LIST)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# Temporary index position for the new list, as well as temporary value to store if the item was ever found
|
||||
set(INDEX 0)
|
||||
set(FOUND FALSE)
|
||||
# Iterate through the new list
|
||||
foreach(NEW_ITEM ${NEW_LIST})
|
||||
# Compare the items, only if nothing was found before
|
||||
if(NOT FOUND)
|
||||
if(NEW_ITEM STRGREATER "${ITEM}")
|
||||
set(FOUND TRUE)
|
||||
list(INSERT NEW_LIST ${INDEX} ${ITEM})
|
||||
endif(NEW_ITEM STRGREATER "${ITEM}")
|
||||
endif(NOT FOUND)
|
||||
# Increase the index value by 1
|
||||
math(EXPR INDEX "${INDEX} + 1")
|
||||
endforeach(NEW_ITEM)
|
||||
# If the item was never found, just append it to the end
|
||||
if(NOT FOUND)
|
||||
append_to_list(NEW_LIST ${ITEM})
|
||||
endif(NOT FOUND)
|
||||
endforeach(ITEM)
|
||||
# Replace the old list with the new list
|
||||
set(${LIST} ${NEW_LIST})
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
endmacro(sort_list)
|
||||
|
||||
###############################################################################
|
||||
# read_from_file(<filename> <regex> <output variable>)
|
||||
#
|
||||
# A macro to handle reading specific lines from a file, uses file(STRINGS) if
|
||||
# using CMake 2.6.x or better, otherwise we read in the entire file and
|
||||
# perform a string(REGEX MATCH) on each line of the file instead. This
|
||||
# macro can also be used to read in all the lines of a file if REGEX is set
|
||||
# to "".
|
||||
###############################################################################
|
||||
macro(read_from_file FILE REGEX STRINGS)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, we can just use the STRINGS sub-command to get the lines that match the given regular expression (if one is given, otherwise get all lines)
|
||||
if(REGEX STREQUAL "")
|
||||
file(STRINGS ${FILE} RESULT)
|
||||
else(REGEX STREQUAL "")
|
||||
file(STRINGS ${FILE} RESULT REGEX ${REGEX})
|
||||
endif(REGEX STREQUAL "")
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we need to do this manually, firstly we read the file in
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
|
||||
# Next we replace all newlines with semicolons
|
||||
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
||||
if(REGEX STREQUAL "")
|
||||
# For no regular expression, just set the result to all the lines
|
||||
set(RESULT ${ALL_STRINGS})
|
||||
else(REGEX STREQUAL "")
|
||||
# Clear the result list
|
||||
set(RESULT)
|
||||
# Iterate through all the lines of the file
|
||||
foreach(STRING ${ALL_STRINGS})
|
||||
# Check for a match against the given regular expression
|
||||
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
|
||||
# If we had a match, append the match to the list
|
||||
if(STRING_MATCH)
|
||||
append_to_list(RESULT ${STRING})
|
||||
endif(STRING_MATCH)
|
||||
endforeach(STRING)
|
||||
endif(REGEX STREQUAL "")
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
# Set the given STRINGS variable to the result
|
||||
set(${STRINGS} ${RESULT})
|
||||
endmacro(read_from_file)
|
||||
|
||||
###############################################################################
|
||||
# extract_include_filename(<line> <output variable> [<optional output variable of quote type>])
|
||||
#
|
||||
# This macro will take a #include line and extract the filename.
|
||||
###############################################################################
|
||||
macro(extract_include_filename INCLUDE FILENAME)
|
||||
# Strip the leading and trailing spaces from the include line
|
||||
strip_string(${INCLUDE} INCLUDE_STRIPPED)
|
||||
# Make sure to only do the following if there is a string
|
||||
if(INCLUDE_STRIPPED STREQUAL "")
|
||||
set(FILE "")
|
||||
else(INCLUDE_STRIPPED STREQUAL "")
|
||||
# Extract the filename including the quotes or angle brackets
|
||||
string(REGEX REPLACE "^.*([\"<].*[\">]).*$" "\\1" FILE "${INCLUDE_STRIPPED}")
|
||||
# If an optional 3rd argument is given, we'll store if the quote style was quoted or angle bracketed
|
||||
if(${ARGC} GREATER 2)
|
||||
string(SUBSTRING ${FILE} 0 1 QUOTE)
|
||||
if(QUOTE STREQUAL "<")
|
||||
set(${ARGV2} "angle brackets")
|
||||
else(QUOTE STREQUAL "<")
|
||||
set(${ARGV2} "quotes")
|
||||
endif(QUOTE STREQUAL "<")
|
||||
endif(${ARGC} GREATER 2)
|
||||
# Now remove the quotes or angle brackets
|
||||
string(REGEX REPLACE "^[\"<](.*)[\">]$" "\\1" FILE "${FILE}")
|
||||
endif(INCLUDE_STRIPPED STREQUAL "")
|
||||
# Set the filename to the the given variable
|
||||
set(${FILENAME} "${FILE}")
|
||||
endmacro(extract_include_filename)
|
||||
|
||||
###############################################################################
|
||||
# find_includes(<source filename> <output variable>)
|
||||
#
|
||||
# This macro will search through a file for #include lines, regardless of
|
||||
# whitespace, but only returns the lines that are valid for the current
|
||||
# platform CMake is running on.
|
||||
###############################################################################
|
||||
macro(find_includes SRC INCLUDES)
|
||||
# Read all lines from the file that start with #, regardless of whitespace before the #
|
||||
read_from_file(${SRC} "^[ \t]*#.*$" LINES)
|
||||
# Set that any #include lines found are valid, and create temporary variables for the last found #ifdef/#ifndef
|
||||
set(VALID_LINE TRUE)
|
||||
set(LAST_DEF)
|
||||
set(LAST_CHECK)
|
||||
# Create an empty include list
|
||||
set(INCLUDES_LIST)
|
||||
# Iterate through all the # lines
|
||||
foreach(LINE ${LINES})
|
||||
# Search for #ifdef, #ifndef, #else, #endif, and #include
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*ifdef[ \t]*.*$" FOUND_IFDEF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*ifndef[ \t]*.*$" FOUND_IFNDEF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*else.*$" FOUND_ELSE ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*endif.*$" FOUND_ENDIF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*include[ \t]*[\"<].*[\">][\ t]*.*$" FOUND_INCLUDE ${LINE})
|
||||
# If we found a #ifdef on the line, extract the data after the #ifdef and set if the lines after it are valid based on the variables in CMake
|
||||
if(FOUND_IFDEF)
|
||||
# Extract the define
|
||||
string(REGEX REPLACE "^[ \t]*#[ \t]*ifdef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
|
||||
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
|
||||
if(DEFINE STREQUAL "_WIN32")
|
||||
set(DEFINE WIN32)
|
||||
endif(DEFINE STREQUAL "_WIN32")
|
||||
# Set the last define to this one, and set the last check to true, so when #else is encountered, we can do an opposing check
|
||||
set(LAST_DEF ${DEFINE})
|
||||
set(LAST_CHECK TRUE)
|
||||
# If the define is true (it either exists or is a non-false result), the lines following will be checked, otherwise they will be skipped
|
||||
if(${DEFINE})
|
||||
set(VALID_LINE TRUE)
|
||||
else(${DEFINE})
|
||||
set(VALID_LINE FALSE)
|
||||
endif(${DEFINE})
|
||||
else(FOUND_IFDEF)
|
||||
# If we found a #ifndef on the line, the same thing as #ifdef is done, except with the checks in the opposite direction
|
||||
if(FOUND_IFNDEF)
|
||||
# Extract the define
|
||||
string(REGEX REPLACE "^[ \t]*#[ \t]*ifndef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
|
||||
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
|
||||
if(DEFINE STREQUAL "_WIN32")
|
||||
set(DEFINE WIN32)
|
||||
endif(DEFINE STREQUAL "_WIN32")
|
||||
# Set the last define to this one, and set the last check to false, so when #else is encountered, we can do an opposing check
|
||||
set(LAST_DEF ${DEFINE})
|
||||
set(LAST_CHECK FALSE)
|
||||
# If the define is not true (it either doesn't exists or is a false result), the lines following will be checked, otherwise they will be skipped
|
||||
if(${DEFINE})
|
||||
set(VALID_LINE FALSE)
|
||||
else(${DEFINE})
|
||||
set(VALUE_LINE TRUE)
|
||||
endif(${DEFINE})
|
||||
else(FOUND_IFNDEF)
|
||||
# If we found a #else on the line, we check the last define in the opposite direction
|
||||
if(FOUND_ELSE)
|
||||
# When LAST_CHECK is true, we were inside a #ifdef, now act as if we are entering a #ifndef section by doing an opposing check
|
||||
if(LAST_CHECK)
|
||||
if(${LAST_DEF})
|
||||
set(VALID_LINE FALSE)
|
||||
else(${LAST_DEF})
|
||||
set(VALID_LINE TRUE)
|
||||
endif(${LAST_DEF})
|
||||
# When LAST_CHECK is false, we were inside a #ifndef, now act as if we are entering a #ifdef section by doing an opposing check
|
||||
else(LAST_CHECK)
|
||||
if(${LAST_DEF})
|
||||
set(VALID_LINE TRUE)
|
||||
else(${LAST_DEF})
|
||||
set(VALID_LINE FALSE)
|
||||
endif(${LAST_DEF})
|
||||
endif(LAST_CHECK)
|
||||
else(FOUND_ELSE)
|
||||
# If we found a #endif on the line, we'll assume everything following the line is valid until we meet another one of the above lines
|
||||
if(FOUND_ENDIF)
|
||||
set(VALID_LINE TRUE)
|
||||
else(FOUND_ENDIF)
|
||||
# If we found a #include on the line, add the entire line to the list of includes unless the line isn't valid
|
||||
if(FOUND_INCLUDE)
|
||||
if(VALID_LINE)
|
||||
append_to_list(INCLUDES_LIST "${LINE}")
|
||||
endif(VALID_LINE)
|
||||
endif(FOUND_INCLUDE)
|
||||
endif(FOUND_ENDIF)
|
||||
endif(FOUND_ELSE)
|
||||
endif(FOUND_IFNDEF)
|
||||
endif(FOUND_IFDEF)
|
||||
endforeach(LINE)
|
||||
set(${INCLUDES} ${INCLUDES_LIST})
|
||||
endmacro(find_includes)
|
||||
|
||||
###############################################################################
|
||||
# calculate_depends(<source filename> <output variable set to TRUE on fail> [<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
|
||||
set(CHECK_ANGLE_INCLUDES FALSE)
|
||||
# Check for a third argument
|
||||
if(${ARGC} GREATER 2)
|
||||
set(CHECK_ANGLE_INCLUDES TRUE)
|
||||
endif(${ARGC} GREATER 2)
|
||||
# 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
|
||||
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
|
||||
if(QUOTE_TYPE STREQUAL "angle brackets")
|
||||
# The following checks will only be done if there was a request for angle includes to be checked
|
||||
if(CHECK_ANGLE_INCLUDES)
|
||||
# Find the path of the include file
|
||||
if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include ${EXTRA_INCLUDE})
|
||||
else(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} ${EXTRA_INCLUDE})
|
||||
endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
# If the include file was found, add it's path to the list of include paths, but only if it doesn't already exist and isn't in the defaults for the compiler
|
||||
if(FOUND_${FILENAME}_INCLUDE)
|
||||
find_in_list(DEFAULT_INCLUDE_DIRS "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_DEFAULTS)
|
||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
find_in_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
if(FOUND_IN_INCLUDES EQUAL -1)
|
||||
append_to_list(${ARGV2} "${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.")
|
||||
endif(FOUND_${FILENAME}_INCLUDE)
|
||||
endif(CHECK_ANGLE_INCLUDES)
|
||||
endif(QUOTE_TYPE STREQUAL "angle brackets")
|
||||
endforeach(INCLUDE)
|
||||
endmacro(calculate_depends)
|
||||
|
||||
###############################################################################
|
||||
# calculate_libraries(<source filename> <output variable set to TRUE on fail> <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)
|
||||
# Set up a temporary LDFLAGS for this file
|
||||
set(THIS_LDFLAGS "${LDFLAGS}")
|
||||
# Reset extra dependencies
|
||||
set(EXTRA_DEPENDENCIES)
|
||||
# Reset library paths
|
||||
set(LIBRARY_PATHS)
|
||||
# Reset libraries
|
||||
set(LIBRARIES)
|
||||
# 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
|
||||
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
|
||||
# Strip off the /* RequiredLibraries: and */ from the line
|
||||
string(REGEX REPLACE "/\\*[ \t]*RequiredLibraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
||||
# Replace all commas with semicolons
|
||||
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
||||
# Iterate through the libraries given
|
||||
foreach(LIBRARY ${REQUIRED_LIBRARY})
|
||||
# Locate the library to see if it exists
|
||||
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE})
|
||||
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE})
|
||||
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
# If the library was found, we will add it to the linker flags
|
||||
if(FOUND_${LIBRARY}_LIBRARY)
|
||||
# Get the path only of the library, to add it to linker flags
|
||||
get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH)
|
||||
if(MSVC)
|
||||
# For Visual Studio, instead of editing the linker flags, we'll add the library to a separate list of extra dependencies
|
||||
append_to_list(EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}")
|
||||
else(MSVC)
|
||||
# For all others, add the library paths and libraries
|
||||
append_to_list(LIBRARY_PATHS "${LIBRARY_PATH}")
|
||||
append_to_list(LIBRARIES "${LIBRARY}")
|
||||
endif(MSVC)
|
||||
else(FOUND_${LIBRARY}_LIBRARY)
|
||||
# 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.")
|
||||
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})
|
||||
endmacro(calculate_libraries)
|
||||
|
||||
###############################################################################
|
||||
# check_functions(<source filename> <output variable set to TRUE on success>)
|
||||
#
|
||||
# This macro is used in most of the module (sub)directories to calculate the
|
||||
# fcuntion dependencies for the given source file.
|
||||
###############################################################################
|
||||
macro(check_functions SRC SUCCESS)
|
||||
# Default to true
|
||||
set(${SUCCESS} TRUE)
|
||||
# Check to see if there are any lines matching: /* RequiredFunctions: [something] */
|
||||
read_from_file(${SRC} "/\\\\*[ \t]*RequiredFunctions:[ \t]*.*[ \t]*\\\\*/" REQUIRED_FUNCTIONS)
|
||||
# Iterate through those lines
|
||||
foreach(REQUIRED_FUNCTION ${REQUIRED_FUNCTIONS})
|
||||
# Strip off the /* RequiredFunctions: and */ from the line
|
||||
string(REGEX REPLACE "/\\*[ \t]*RequiredFunctions:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_FUNCTION ${REQUIRED_FUNCTION})
|
||||
# Replace all commas with semicolons
|
||||
string(REGEX REPLACE "," ";" REQUIRED_FUNCTION ${REQUIRED_FUNCTION})
|
||||
# Iterate through the functions given
|
||||
foreach(FUNCTION ${REQUIRED_FUNCTION})
|
||||
# Check if the function exists
|
||||
check_function_exists(${REQUIRED_FUNCTION} HAVE_${REQUIRED_FUNCTION})
|
||||
# If we don't have the function warn the user and set SUCCESS to FALSE
|
||||
if(NOT HAVE_${REQUIRED_FUNCTION})
|
||||
message("${SRC} needs function ${REQUIRED_FUNCTION} but we were unable to locate that function!")
|
||||
set(${SUCCESS} FALSE)
|
||||
endif(NOT HAVE_${REQUIRED_FUNCTION})
|
||||
endforeach(FUNCTION)
|
||||
endforeach(REQUIRED_FUNCTION)
|
||||
endmacro(check_functions)
|
||||
|
||||
###############################################################################
|
||||
# add_to_cpack_ignored_files(<item> [TRUE])
|
||||
#
|
||||
# A macro to update the environment variable CPACK_IGNORED_FILES which
|
||||
# contains a list of files for CPack to ignore. If the optional 2nd argument
|
||||
# of TRUE is given, periods will be converted to \\. for CPack.
|
||||
###############################################################################
|
||||
macro(add_to_cpack_ignored_files ITEM)
|
||||
# Temporary copy of the orignal item
|
||||
set(REAL_ITEM "${ITEM}")
|
||||
# If we have 2+ arguments, assume that the second one was something like TRUE (doesn't matter really) and convert periods so they will be \\. for CPack
|
||||
if(${ARGC} GREATER 1)
|
||||
string(REPLACE "." "\\\\." REAL_ITEM ${REAL_ITEM})
|
||||
endif(${ARGC} GREATER 1)
|
||||
# If the environment variable is already defined, just tack the item to the end
|
||||
if(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "$ENV{CPACK_IGNORED_FILES};${REAL_ITEM}")
|
||||
# Otherwise set the environment variable to the item
|
||||
else(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
|
||||
endif(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
endmacro(add_to_cpack_ignored_files)
|
||||
@@ -0,0 +1,33 @@
|
||||
# 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_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_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)
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
|
||||
endif(NOT WIN32)
|
||||
|
||||
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use
|
||||
if(GETTEXT_FOUND)
|
||||
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})
|
||||
endif(GETTEXT_LIBRARY)
|
||||
endif(WIN32)
|
||||
endif(GETTEXT_FOUND)
|
||||
@@ -0,0 +1,5 @@
|
||||
# This file is external to the read_from_file macro in Anope.cmake in order to
|
||||
# get around a possible memory leak in older versions of CMake.
|
||||
|
||||
file(READ "${FILE}" RESULT)
|
||||
message("${RESULT}")
|
||||
Vendored
-1526
File diff suppressed because it is too large
Load Diff
Vendored
-1662
File diff suppressed because it is too large
Load Diff
-290
@@ -1,290 +0,0 @@
|
||||
dnl autoconf.in for Services.
|
||||
dnl
|
||||
dnl Anope (c) 2003-2008 Anope team
|
||||
dnl Contact us at team@anope.org
|
||||
|
||||
dnl This program is free but copyrighted software; see the file COPYING for
|
||||
dnl details.
|
||||
|
||||
dnl Based heavily on the Unreal configure.in script, and extra thanks to
|
||||
dnl codemastr from UnrealIRCD.
|
||||
|
||||
AC_INIT
|
||||
|
||||
# Clear out any CFLAGS (cept -g) the os is using, usually -g -O2
|
||||
CFLAGS="-g"
|
||||
|
||||
# If no bindir, we tell him to run ./Config.
|
||||
if test "${with_instdir+set}" != set; then
|
||||
echo "You might want to run ./Config or provide some parameters to this script."
|
||||
echo "./configure --help for information about this script"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
AC_CONFIG_SRCDIR([src/actions.c])
|
||||
AC_CONFIG_HEADER(include/sysconf.h)
|
||||
AC_PROG_CC
|
||||
if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||
# CFLAGS="$CFLAGS -funsigned-char"
|
||||
AC_CACHE_CHECK(if gcc has a working -pipe, ac_cv_pipe, [
|
||||
save_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_pipe="yes"],[ac_cv_pipe="no"])
|
||||
CFLAGS="$save_cflags"
|
||||
])
|
||||
if test "$ac_cv_pipe" = "yes"; then
|
||||
CFLAGS="-pipe $CFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl CFLAGS="$CFLAGS -W -Wall"
|
||||
|
||||
AC_PATH_PROG(RM,rm)
|
||||
AC_PATH_PROG(CP,cp)
|
||||
AC_PATH_PROG(TOUCH,touch)
|
||||
AC_PATH_PROG(INSTALL,install)
|
||||
AC_CHECK_LIB(nsl,inet_ntoa,ANOPELIBS="$ANOPELIBS-lnsl ")
|
||||
AC_CHECK_LIB(socket, socket,ANOPELIBS="$ANOPELIBS-lsocket ")
|
||||
AC_CHECK_LIB(resolv, res_query,ANOPELIBS="$ANOPELIBS-lresolv ")
|
||||
AC_CHECK_LIB(bsd, revoke,ANOPELIBS="$ANOPELIBS-lbsd ")
|
||||
|
||||
dnl Does this platform require array notation to assign to a va_list?
|
||||
dnl If cross-compiling, we assume va_list is "normal". If this breaks
|
||||
dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY
|
||||
dnl also just to be sure.
|
||||
|
||||
dnl NOTE: this autoconf test is taken from mozilla: www.mozilla.org.
|
||||
|
||||
AC_MSG_CHECKING(whether va_list assignments need array notation)
|
||||
AC_CACHE_VAL(ac_cv_valistisarray,
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
void foo(int i, ...) {
|
||||
va_list ap1, ap2;
|
||||
va_start(ap1, i);
|
||||
ap2 = ap1;
|
||||
if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) { exit(1); }
|
||||
va_end(ap1); va_end(ap2);
|
||||
}
|
||||
int main()
|
||||
{ foo(0, 123); return(0); }]])],[ac_cv_valistisarray=false],[ac_cv_valistisarray=true],[ac_cv_valistisarray=false])])
|
||||
|
||||
if test "$ac_cv_valistisarray" = true ; then
|
||||
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY,[1],[va_list as array])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
|
||||
DIS_MYSQL=" MySQL: No"
|
||||
AC_ARG_WITH(mysql, [ --without-mysql Do not use MySQL or attempt to find it],,[
|
||||
AC_ARG_WITH(mysqlconfig-path, [ --with-mysqlconfig-path=PATH Complete path to the mysql_config executable],
|
||||
mysql_config_path="$withval", mysql_config_path="")
|
||||
MYSQLCONF=""
|
||||
if test "$mysql_config_path" != ""; then
|
||||
if test -x "$mysql_config_path"; then
|
||||
MYSQLCONF="$mysql_config_path"
|
||||
echo "checking for mysql_config... $MYSQLCONF" >&6
|
||||
fi
|
||||
fi
|
||||
if test "$MYSQLCONF" = ""; then
|
||||
AC_PATH_PROG(MYSQLCONF,mysql_config, "")
|
||||
fi
|
||||
if test "$MYSQLCONF" != ""; then
|
||||
hold_cflags="$CFLAGS"
|
||||
hold_ldflags="$LDFLAGS"
|
||||
if test "$MYSQL_CFLAGS" = ""; then
|
||||
MYSQL_CFLAGS="`$MYSQLCONF --cflags`"
|
||||
fi
|
||||
if test "$MYSQL_LDFLAGS" = ""; then
|
||||
MYSQL_LDFLAGS="`$MYSQLCONF --libs`"
|
||||
fi
|
||||
CFLAGS="$CFLAGS $MYSQL_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
|
||||
echo $ECHO_N "checking if mysql_config produces valid values... $ECHO_C" >&6
|
||||
AC_TRY_RUN([
|
||||
#include <mysql.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
MYSQL *mysql = mysql_init(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
], ac_cv_mysql_valid=yes, ac_cv_mysql_valid=no)
|
||||
echo $ac_cv_mysql_valid >&6
|
||||
if test "$ac_cv_mysql_valid" = "yes"; then
|
||||
DIS_MYSQL=" MySQL: Yes"
|
||||
else
|
||||
CFLAGS="$hold_cflags"
|
||||
LDFLAGS="$hold_ldflags"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether this is a bit or little endian system)
|
||||
AC_TRY_RUN([
|
||||
int main()
|
||||
{
|
||||
short s = 1;
|
||||
short* ptr = &s;
|
||||
unsigned char c = *((char*)ptr);
|
||||
return c;
|
||||
}
|
||||
]
|
||||
, AC_DEFINE(BIG_ENDIAN)
|
||||
AC_MSG_RESULT(big)
|
||||
, AC_DEFINE(LITTLE_ENDIAN)
|
||||
AC_MSG_RESULT(little)
|
||||
)
|
||||
|
||||
AC_SUBST(ANOPELIBS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
AC_CHECK_HEADER(sys/types.h,AC_DEFINE(HAS_SYS_TYPES_H,1,"Has sys/types.h"))
|
||||
dnl module checking based on Unreal's module checking code
|
||||
AC_DEFUN(AC_ENABLE_DYN,
|
||||
[
|
||||
AC_CHECK_FUNC(dlopen,, AC_CHECK_LIB(dl,dlopen,[
|
||||
ANOPELIBS="$ANOPELIBS -ldl"
|
||||
],
|
||||
[
|
||||
AC_ERROR("dlopen() is required for Anope to be compiled and used. Sorry.")
|
||||
]))
|
||||
|
||||
hold_cflags=$CFLAGS
|
||||
CFLAGS="$CFLAGS -export-dynamic"
|
||||
AC_CACHE_CHECK(if we need the -export-dynamic flag, ac_cv_export_dynamic, [
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[ac_cv_export_dynamic=yes],[ac_cv_export_dynamic=no])])
|
||||
if test "$ac_cv_export_dynamic" = "no"; then
|
||||
CFLAGS=$hold_cflags
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for compiler option to produce PIC,ac_cv_pic,[
|
||||
if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||
ac_cv_pic="-fPIC -DPIC -shared"
|
||||
case `uname -s` in
|
||||
Darwin*[)]
|
||||
ac_cv_pic="-bundle -flat_namespace -undefined suppress"
|
||||
;;
|
||||
HP-UX*[)]
|
||||
ac_cv_pic="-fPIC"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
case `uname -s` in
|
||||
SunOS*[)]
|
||||
ac_cv_pic="-KPIC -DPIC -G"
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||
case `uname -s` in
|
||||
Darwin*[)]
|
||||
SHARED="-bundle -flat_namespace -undefined suppress"
|
||||
AC_SUBST(SHARED)
|
||||
;;
|
||||
*[)]
|
||||
SHARED="-shared"
|
||||
AC_SUBST(SHARED)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(if your system prepends an underscore on symbols,ac_cv_underscore,[
|
||||
cat >uscore.c << __EOF__
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
__EOF__
|
||||
$CC -o uscore $CFLAGS uscore.c 1>&5
|
||||
if test -z "`strings -a uscore |grep '^_main$'`"; then
|
||||
ac_cv_underscore=no
|
||||
else
|
||||
ac_cv_underscore=yes
|
||||
fi
|
||||
|
||||
rm -f uscore uscore.c
|
||||
])
|
||||
if test "$ac_cv_underscore" = "yes"; then
|
||||
AC_DEFINE(DL_PREFIX,"_","Underscore needed for dlopen")
|
||||
else
|
||||
AC_DEFINE(DL_PREFIX,"","No prefix needed for dlopen")
|
||||
fi
|
||||
|
||||
MODULEFLAGS=$ac_cv_pic
|
||||
AC_SUBST(MODULEFLAGS)
|
||||
])
|
||||
|
||||
AC_ENABLE_DYN
|
||||
anope_CHECK_TYPE_SIZES
|
||||
|
||||
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H,1,""))
|
||||
AC_CHECK_HEADER(sys/select.h,AC_DEFINE(HAVE_SYS_SELECT_H,1,""))
|
||||
|
||||
AC_CHECK_FUNCS(backtrace,AC_DEFINE(HAVE_BACKTRACE,1))
|
||||
AC_CHECK_FUNCS(stricmp,AC_DEFINE(HAVE_STRICMP,1))
|
||||
AC_CHECK_FUNCS(strcasecmp,AC_DEFINE(HAVE_STRCASECMP,1))
|
||||
AC_CHECK_FUNCS(gettimeofday,AC_DEFINE(HAVE_GETTIMEOFDAY,1))
|
||||
AC_CHECK_FUNCS(setgrent,AC_DEFINE(HAVE_SETGRENT,1))
|
||||
AC_CHECK_FUNCS(umask,AC_DEFINE(HAVE_UMASK,1))
|
||||
AC_CHECK_FUNCS(fork,AC_DEFINE(HAVE_FORK,1))
|
||||
AC_CHECK_FUNCS(gethostbyname,AC_DEFINE(HAVE_GETHOSTBYNAME,1))
|
||||
AC_CHECK_FUNCS(gethostbyname_r,AC_DEFINE(HAVE_GETHOSTBYNAME_R,1))
|
||||
AC_CHECK_FUNCS(strlcpy,AC_DEFINE(HAVE_STRLCPY,1))
|
||||
AC_CHECK_FUNCS(strlcat,AC_DEFINE(HAVE_STRLCAT,1))
|
||||
|
||||
AC_ARG_WITH(rungroup, [ --with-rungroup=group Specify the rungroup for anope], [
|
||||
AC_DEFINE_UNQUOTED(RUNGROUP,"$withval","Run group")
|
||||
RUNGROUP=$withval
|
||||
])
|
||||
|
||||
AC_SUBST(RUNGROUP)
|
||||
|
||||
dnl AC_DEFINE_UNQUOTED(MYOSNAME,"`uname -a`","uname")
|
||||
|
||||
AC_ARG_WITH(permissions, [ --with-permissions=permissions Specify the default permissions for anope], AC_DEFINE_UNQUOTED(DEFUMASK,$withval,"Default umask permissions"), AC_DEFINE(DEFUMASK, 007,"Default umask Permissions"))
|
||||
|
||||
AC_ARG_WITH(instdir, [ --with-instdir=instdir Specify the default install dir for anope], [
|
||||
INSTDIR=$withval
|
||||
])
|
||||
|
||||
MAKEBIN=`pwd`/run-cc.pl
|
||||
|
||||
AC_ARG_WITH(makebin, [--with-makebin=run-cc.pl Specify the default make binary to use],[MAKEBIN=$withval])
|
||||
|
||||
AC_SUBST(INSTDIR)
|
||||
AC_SUBST(MAKEBIN)
|
||||
|
||||
AC_ARG_WITH(optimization, [ --with-optimization=1|2|3|4|5 Specify the optimization level], [
|
||||
CFLAGS="$CFLAGS -O$withval"
|
||||
])
|
||||
|
||||
AC_ARG_WITH(debugsym, [ --with-debugsym Include debugging symbols], [
|
||||
CFLAGS="$CFLAGS -g"
|
||||
])
|
||||
|
||||
|
||||
AC_CONFIG_FILES( \
|
||||
Makefile \
|
||||
src/bin/anoperc \
|
||||
)
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
cat <<EOT
|
||||
|
||||
$DIS_MODULES
|
||||
$DIS_MYSQL
|
||||
|
||||
|
||||
|
||||
All done! Now run "make" (or possibly "gmake") to compile Anope.
|
||||
See the INSTALL, README and FAQ files if you have any problems.
|
||||
EOT
|
||||
|
||||
+1
-1
@@ -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)
|
||||
set(DATA example.chk example.conf mysql/tables.sql)
|
||||
install(FILES ${DATA}
|
||||
DESTINATION data
|
||||
)
|
||||
|
||||
+9
-6
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Crontab script for Anope
|
||||
#
|
||||
#
|
||||
# To know how to install the crontab, read the INSTALL file.
|
||||
|
||||
###############################################################
|
||||
@@ -9,7 +9,10 @@
|
||||
###############################################################
|
||||
|
||||
# Anope binary directory
|
||||
ANOPATH=/home/ircd/services/
|
||||
ANOPATH=/home/ircd/services/bin
|
||||
|
||||
# Anope data directory
|
||||
ANODATA=/home/ircd/services/data
|
||||
|
||||
# Name of the pid file
|
||||
ANOPIDF=services.pid
|
||||
@@ -31,14 +34,14 @@ ANOPID=
|
||||
|
||||
cd $ANOPATH
|
||||
|
||||
if [ -f $ANOPIDF ]
|
||||
if [ -f "$ANODATA/$ANOPIDF" ]
|
||||
then
|
||||
ANOPID=`cat $ANOPIDF`
|
||||
ANOPID=`cat "$ANODATA/$ANOPIDF"`
|
||||
if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ]
|
||||
then
|
||||
exit
|
||||
exit
|
||||
fi
|
||||
rm -f $ANOPIDF
|
||||
rm -f "$ANODATA/$ANOPIDF"
|
||||
fi
|
||||
|
||||
./$ANOPROG $ANOARGS
|
||||
|
||||
+1106
-416
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,445 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 3.3.5
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Apr 28, 2011 at 07:08 PM
|
||||
-- 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',
|
||||
`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_mlock`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `anope_cs_mlock` (
|
||||
`channel` varchar(255) NOT NULL,
|
||||
`mode` varchar(127) NOT NULL,
|
||||
`status` int(11) NOT NULL,
|
||||
`setter` varchar(255) NOT NULL,
|
||||
`created` int(11) NOT NULL,
|
||||
`param` varchar(255) NOT NULL,
|
||||
UNIQUE KEY `entry` (`channel`,`mode`,`status`,`setter`,`param`),
|
||||
KEY `FK_anope_cs_mlock` (`channel`)
|
||||
) 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` varchar(5) NOT NULL DEFAULT '',
|
||||
`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_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_mlock`
|
||||
--
|
||||
ALTER TABLE `anope_cs_mlock`
|
||||
ADD CONSTRAINT `FK_anope_cs_mlock_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;
|
||||
|
||||
+3056
File diff suppressed because it is too large
Load Diff
Executable
+1
@@ -0,0 +1 @@
|
||||
git log --pretty=format:"Revision %h - %cD - %s" > version.log
|
||||
@@ -0,0 +1 @@
|
||||
astyle --style=java --indent=tab --brackets=break-closing --indent-switches --indent-cases --brackets=break
|
||||
@@ -1,4 +1 @@
|
||||
Reported Bugs from Bugzilla: http://bugs.anope.org/
|
||||
---------------------------------------------------
|
||||
|
||||
|
||||
For all bug reports / updates please see http://bugs.anope.org
|
||||
|
||||
@@ -78,6 +78,11 @@ This is safer than C-style casting in that an invalid pointer conversion will
|
||||
return a NULL pointer, and an invalid reference conversion will throw a
|
||||
Bad_cast exception.
|
||||
|
||||
Note that in Anope we prefer if Anope::debug_cast is used.
|
||||
This uses dynamic_cast (and checks for a NULL pointer return) on debug builds
|
||||
and static_cast on release builds, to speed up the program beacuse of dynamic_cast's
|
||||
reliance on RTTI.
|
||||
|
||||
reinterpret_cast
|
||||
----------------
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ if(WIN32)
|
||||
# Add README.txt to list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("README.txt$" TRUE)
|
||||
endif(IN_SOURCE)
|
||||
set(DOCS DEFCON FAQ INSTALL MODULES NEWS OLDCHANGES PROXY ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
|
||||
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES NEWS ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
|
||||
install(FILES ${DOCS}
|
||||
DESTINATION docs
|
||||
)
|
||||
|
||||
+239
@@ -0,0 +1,239 @@
|
||||
Orginally pulled from: http://www.inspircd.org/wiki/Coding_Guidelines
|
||||
|
||||
---
|
||||
|
||||
InspIRCd Coding Guidelines
|
||||
|
||||
The following are a set of guidelines for writing patches to InspIRCd, or for
|
||||
creating modules for distribution with the official package. These guidelines
|
||||
were written a time after InspIRCd development started, and so not all code
|
||||
yet follows these. This will be rectified with time.
|
||||
|
||||
|
||||
1. Comments
|
||||
|
||||
* Multi Line
|
||||
Multiple line comments should follow the C-style comment, for example:
|
||||
/*
|
||||
* This is a multiple line comment, huzzah..
|
||||
*/
|
||||
|
||||
* Single Line
|
||||
Single line comments should also be in the C style, for example:
|
||||
/* This is a boring one-line comment */
|
||||
|
||||
* Doxygen commenting
|
||||
If you wish your comment to show in doxygen, the comment should be directly
|
||||
above the item you are documenting (a class, function, enum, etc) and the
|
||||
first line should be "/**". For example:
|
||||
/** This is a doxygen multiline comment.
|
||||
* Description of thingymebob here.
|
||||
*/
|
||||
|
||||
The first line after the "**" is used as the short description of the item
|
||||
(up to the full stop) and everything afterwards as the detailed description.
|
||||
|
||||
|
||||
2. 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>}
|
||||
}
|
||||
|
||||
|
||||
3. Separation
|
||||
|
||||
Always put a space in between a keyword like if/while and the condition,
|
||||
for example:
|
||||
if (foo == bar)
|
||||
NOT
|
||||
if(foo == bar)
|
||||
|
||||
|
||||
4. Braces
|
||||
|
||||
Always put braces opening and closing blocks on separate lines, see the
|
||||
identation example. For example, place braces like this:
|
||||
if (apples == "green")
|
||||
{
|
||||
cout << "Apples are green" << endl;
|
||||
}
|
||||
|
||||
and not:
|
||||
if (apples == "green") {
|
||||
cout << "Apples are green" << endl;
|
||||
}
|
||||
|
||||
The one exception to this is if you are declaring a class method which is
|
||||
only one line long, in that case the following is acceptable in most cases:
|
||||
class foo : public bar
|
||||
{
|
||||
foo() { }
|
||||
getrandomfoo() { return rand(); }
|
||||
};
|
||||
|
||||
|
||||
5. Templates
|
||||
|
||||
Where possible, use templates rather than #defines. Avoid use of RTTI.
|
||||
|
||||
|
||||
6. 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.)
|
||||
|
||||
|
||||
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.
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
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
|
||||
A Tell users when their nicks expire in /ns glist and /ns info
|
||||
A Added SSL support
|
||||
A Prevent negaitve mode changes, kicks, bans, and autokicks from affecting people with the 'god' user mode (On UnrealIRCd, usermode +q)
|
||||
A Added nickserv/auxpex permission
|
||||
A Added nickserv ungroup command
|
||||
A Renamed the SGLINE to be SNLINE
|
||||
A Added /chanserv saset command
|
||||
A Added threads for mail sending
|
||||
A Added m_dnsbl and an asynchronous DNS system
|
||||
A Added a new language system that uses gettext
|
||||
A Added m_mysql which uses threads to execute queries
|
||||
A Added many subcommand modules for some commands, eg ns_set_autoop, ns_set_email, etc
|
||||
A Added a new logging system that is a bit more flexible
|
||||
A Added cs_set_misc and ns_set_misc to add miscellaneous set commands
|
||||
A Added os_modreload, which allows reloading some modules not normally unloable, like the protocol module
|
||||
A Added FOUNDER access level
|
||||
A Made OperServ, Global, MemoServ, and ChanServ optional
|
||||
F Shutting down if a config reload fails
|
||||
F Autoid to live through restarts on Unreal
|
||||
F Storing vhosts in MySQL
|
||||
F Not flushing the anope_extra table before rewriting databaes
|
||||
F Anoperc start/stop to send the globaloncycle global, and fixed anoperc rehash to really rehash
|
||||
F Fixed a potential crash if HostServ or BotServ was disbled
|
||||
|
||||
Anope Version 1.9.2
|
||||
--------------------
|
||||
A K alias to chanserv kick command
|
||||
A KB alias to chanserv ban command
|
||||
A The ability to register empty nonregistered channels
|
||||
A Flatfile plaintext databases and removed old binary ones
|
||||
A Added in live updating SQL and the ability to execute commands through SQL (see docs/MYSQL)
|
||||
A Added support for many more modes into Anope and the ability to have generic support for modes unknown to Anope
|
||||
A Added a mode stacker to combine many mode changes into fewer
|
||||
A Added in the CS SET PERSIST command which can be used to keep service bots in channels even when the channel is empty
|
||||
A Added AUTOOWNER OWNER and OWNERME into CS LEVELS
|
||||
A Added ns_resetpass module to the core
|
||||
A CS ACCESS VIEW which shows who added the access and last time used
|
||||
A Last used time to CS AKICK VIEW
|
||||
A Added a sha_256 encryption module
|
||||
A Added the ability to load multiple encryption modules, and the ability to seamlessly convert your database between diferent encryptions
|
||||
A Added configuration options to allow Anope to reconnect if it disconnects from the uplink instead of dieing
|
||||
A Added support for linking with IPv6
|
||||
F Unban command to accept an optional nick arg
|
||||
F Some typos in services.conf
|
||||
F Crash when users change their host that are identified to a group, but not a nick
|
||||
F Host length checking in HS SET(ALL) and HS REQUEST
|
||||
F Only show if a user is online in NS INFO if they are really identiifed for the group of the nick they are on
|
||||
F Crash when using BSSmartJoin
|
||||
F Converting access entries to access from xop when a users access is below voice
|
||||
F A bad pointer passed to the OnDelEvent which could cause some 3rd party modules to crash
|
||||
F CS FORBID allows to you forbid unregistered channels
|
||||
F The -nothird command line option to work
|
||||
F ms_rsend to really work
|
||||
F SQUITing juped servers on InspIRCd1.2+
|
||||
|
||||
Anope Version 1.9.1
|
||||
--------------------
|
||||
F Don't enforce akick/forbidden/etc.-restrictions on clients on ulined servers.
|
||||
F Remove modules_unload_all fini + hack that goes with it.
|
||||
F Signal handling cleanup.
|
||||
A Seamless fantasy support on all ChanServ commands, instead of requiring bs_fantasy_*.
|
||||
F Allow fantasy to be disabled on some commands (e.g. FORBID).
|
||||
F Some commands (e.g. !help) need to strip the pre-provided channelname from them.
|
||||
D HelpServ removed
|
||||
F Command parser cleanup: mod_current_buffer removed and replaced with proper parser. Commands now indicate how they want the buffer split.
|
||||
F Make NS ENFORCE/RELEASE stuff more sane, redo timers.
|
||||
A Opertypes (similar to InspIRCd's opertypes)
|
||||
|
||||
Provided by Ankit <ankit@nevitus.com> - 2009
|
||||
F Segfault on shutdown
|
||||
|
||||
Provided by Adam <adam@anope.org> - 2009
|
||||
F NickServ registration is sometimes denied.
|
||||
F Applied patch from Adam to fix some potential screwups
|
||||
F More fixes to bs_bot from Adam, plus an extra fix within DoAdd not covered in Adam's patch.
|
||||
F Fix bs_bot to use the correct parameters, patch from Adam.
|
||||
F Fix for bug #1004, based from second half of patch from Adam.
|
||||
F Partial patch by Adam, commenting fix for #1006 for future reference.
|
||||
F Forward-port r1946: Patch by Adam fixing #1006 (originally caused by #922): modes set by ChanServ are reversed. Thanks!
|
||||
|
||||
Provided by DukePyrolator <dukepyrolator@gmx.de> - 2009
|
||||
F Patch converting all match calls to new method, thanks!
|
||||
F Add 'w' and 'y' support to dotime(), also prevent an overflow.
|
||||
F Allow NS STATUS from unregistered users, thanks DP!
|
||||
F Wild pointers do not a happy Anope make. Thanks DP :)
|
||||
F Allow NS REGISTER to unregistered nicks, silly oversight. Thanks DP! :)
|
||||
F Fix call order, thanks to DP
|
||||
F Pass the right array to do_umode(), fixes mode tracking on Unreal. Thanks to DukePyrolator (yet again :P)
|
||||
F Fix bs_set help, thanks to DukePyrolator! :)
|
||||
F Fix two segfaults, noted by DukePyrolator. Thanks!
|
||||
F Fix part one of #1010, reported by DukePyrolator. (Language settings are not respected in message sending.) Thanks!
|
||||
F Memory leak on +beI modes.
|
||||
|
||||
Provided by Liber <Liber@jasonirc.net> - 2009
|
||||
F Support operoverride and such things (stop reversing changes from nonopped people where unnecessary)
|
||||
|
||||
Anope Version 1.9.0
|
||||
--------------------
|
||||
F Modified compile to use g++
|
||||
F Improve protocol modules support (classes, virtual methods, etc)
|
||||
F Move core services to use BotInfo
|
||||
F Move BotInfo and related methods into a class
|
||||
F Move modules into a class
|
||||
F Fixed ns resending of passcode issue
|
||||
F Modules now delete themselves
|
||||
F additional field where users' masked host can be stored so both masked IP and vhost are available instead of just one.
|
||||
F No struct Uid, ugly, and, unnecessary that we store UID in BotInfo.
|
||||
F Prevent deletion of core services via /bs bot
|
||||
F Module subsystem cleanup ('modules' branch)
|
||||
F Move modules to use classes somewhat (AnopeInit, AnopeFini)
|
||||
F Change MODULE_INIT to return a pointer
|
||||
F Remove duplicate module creation.. have loadModule return a pointer rather than creating one
|
||||
F Remove buffered loading/unloading, this makes os_modunload perm, but who cares
|
||||
F Remove 'delayed' loading, this is necessary because of before/after connected to ircd (ircd is before, rest after), I'm sure this can be done better.
|
||||
A Remove old config, replace with insp-inspired (albeit bind format) config (CBX)
|
||||
F Clean up protocol modules a bit
|
||||
A InspIRCd 1.2 support
|
||||
F Remove old (prior to 1.8.0) db compat
|
||||
F Establish a proper base for services pseudoclients
|
||||
F Add ss_main StatServ Hal9000 to play with :)
|
||||
F Burn automake with fire (CBX)
|
||||
|
||||
Provided by mooncup <mooncup@anonnet.org> - 2009
|
||||
F Automatically reapply vhost on hs off for unreal.
|
||||
@@ -0,0 +1,108 @@
|
||||
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 **
|
||||
nickserv/auspex privilege added
|
||||
SSL module added for SSL support
|
||||
opertype:inherits added to allow opertypes to inherit commands and privs from other opertypes
|
||||
Various nickserv/saset/* and chanserv/saset/* opertype command privileges added
|
||||
nickserv:modules added many new ns_set_command modules
|
||||
chanserv:modules added many new cs_set_command modules
|
||||
opertype:commands added nickserv/saset/* and chanserv/saset/*
|
||||
options:socketengine added to choose what socket engine to use
|
||||
module:cs_set_misc and module:ns_set_misc added to replace the old set url/icq/email modules
|
||||
options:hideprivilegedcommands added to hide privileged commands from normal users
|
||||
log block added to customize logging
|
||||
dns block added to configure dns settings
|
||||
m_dnsbl added
|
||||
mysql configuration block added
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
opertype:commands changed operserv/sgline to opserv/snline
|
||||
operserv:modules changed os_sgline to os_snline
|
||||
operserv:modules added os_modreload
|
||||
operserv:sglineexpiry changed to operserv:snlineexpiry
|
||||
operserv:killonsgline changed to operserv:killonsnline
|
||||
operserv:notifications ossgline changed ossnline
|
||||
memoserv was made optional
|
||||
moved operserv:global configuration into its own global block
|
||||
chanserv was made optional
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
serverinfo:helpchannel removed because it has been readded in m_helpchan
|
||||
networkinfo:logchannel, logbot, logusers, logmaxusers, logchannel, and options:keeplogs removed because of the log block
|
||||
dumpcore because it really didn't do anything
|
||||
|
||||
Anope Version 1.9.2
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
options:enablelogchannel added to auto turn on the logchannel on startup
|
||||
options:mlock added to configure the default mlock modes on new channels
|
||||
options:database added for the database modules
|
||||
options:botmodes added to configure modes BotServ bots should use
|
||||
options:userlen added to configure maxiumum ident length
|
||||
options:hostlen added to configure maximum hostname length
|
||||
options:database added to configure what database modules to use
|
||||
options:passlen added to specify the maximum length of passwords
|
||||
uplink:ipv6 added to enable IPv6 connectivity
|
||||
options:maxretries added to specify the number of reconnect attempts allowed
|
||||
options:retrywait added to specify how long to wait between reconnect attempts
|
||||
opertype command chanserv/aop/list removed as it was unnecessary, use chanserv/access/list instead
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
options:encryption added enc_sha256
|
||||
chanserv:modules added cs_unban
|
||||
nickserv:modules added ns_resetpass
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
nickserv:database deleted because of new database system
|
||||
nickserv:prenickdatabase deleted because of new database system
|
||||
chanserv:database deleted because of the new database system
|
||||
botserv:database deleted because of the new database system
|
||||
hostserv:database deleted because of the new database system
|
||||
operserv:database deleted because of the new database system
|
||||
operserv:newsdatabase deleted because of the new database system
|
||||
operserv:exceptiondatabase deleted because of the new database system
|
||||
hs_request:database deleted because of the new database system
|
||||
os_ignore:database deleted because of the new database system
|
||||
serverinfo:localport deleted
|
||||
|
||||
Anope Version 1.9.1
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
Opertypes have been added, through the opertype blocks.
|
||||
Services Operators are now specified in the oper blocks.
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
botserv:modules no longer contains bs_fantasy* modules, fantasy is now seamless.
|
||||
operserv:modules has replaced os_logonnews, os_opernews, and os_randomnews with os_news.
|
||||
operserv:modules no longer contains os_admin and os_oper modules, removed in favor of oper blocks.
|
||||
operserv:notifications no longer contains osraw due to removal of OS RAW.
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
Nick tracking has been removed as an option.
|
||||
Restricting of NS GETPASS and CS GETPASS removed in favor of opertypes.
|
||||
Host Setters were removed in favor of opertypes.
|
||||
HelpServ has been removed entirely.
|
||||
operserv:disableraw removed due to removal of OS RAW.
|
||||
+14
-35
@@ -32,8 +32,8 @@ Anope DefCon
|
||||
The DefCon system is part of Anope's core,
|
||||
|
||||
The DefCon system has to be configured on your services.conf file to
|
||||
be enabled. All directives are optional unless they depend on what
|
||||
options you enable for each level. Look for the "DefCon configuration"
|
||||
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.
|
||||
|
||||
Make sure you restart Anope after changing the DefCon configuration
|
||||
@@ -43,40 +43,19 @@ Anope DefCon
|
||||
|
||||
Pre-defined DefCon actions:
|
||||
|
||||
No new channel registrations 1
|
||||
No New Nick Registrations 2
|
||||
No MLOCK changes 4
|
||||
Force Chan Mode 8
|
||||
Use Reduced Session Limit 16
|
||||
KILL any new clients trying to connect 32
|
||||
Services will ignore everyone but opers 64
|
||||
Services will silently ignore everyone but opers 128
|
||||
AKILL all new clients trying to connect 256
|
||||
No new memos sent to block MemoServ attacks 512
|
||||
|
||||
These are the values used to determine each defcon setting, are set via:
|
||||
|
||||
DefCon1 XX
|
||||
DefCon2 XX
|
||||
DefCon3 XX
|
||||
DefCon4 XX
|
||||
|
||||
To set the desired value, you simply add the value of the numbers together
|
||||
and place that as your DefCon# setting. For instance:
|
||||
|
||||
Say you wish to set:
|
||||
|
||||
No Channel Registrations, No Nickname Registrations and Services Ignoring
|
||||
everyone except for Operators. You would do this by:
|
||||
|
||||
1 + 2 + 128 (Each value listed above is added together)
|
||||
Giving: 131
|
||||
|
||||
You would then place this as which ever Defcon setting you want:
|
||||
No new channel registrations
|
||||
No New Nick Registrations
|
||||
No MLOCK changes
|
||||
Force Chan Mode
|
||||
Use Reduced Session Limit
|
||||
KILL any new clients trying to connect
|
||||
Services will ignore everyone but opers
|
||||
Services will silently ignore everyone but opers
|
||||
AKILL all new clients trying to connect
|
||||
No new memos sent to block MemoServ attacks
|
||||
|
||||
DefCon1 131
|
||||
|
||||
The recommended default values are safe to use on any network.
|
||||
Information regarding how to enable this for specific defcon levels can
|
||||
be found in services.conf
|
||||
|
||||
4) Usage
|
||||
|
||||
|
||||
+21
-395
@@ -2,415 +2,41 @@ Anope Internal Events
|
||||
---------------------
|
||||
|
||||
1) Intro
|
||||
2) Complex Events
|
||||
3) Triggered Events
|
||||
4) Triggered Events List
|
||||
2) Using Events
|
||||
|
||||
1) Introduction to Internal Events
|
||||
|
||||
Internal Events are setup to give module developers more information
|
||||
about what the core is doing at different times. This information can
|
||||
be as complex as data we are feeding to the uplink, to simple triggered
|
||||
events such as the databases being saved. A list of triggered events
|
||||
can be found below. Additional there is a module included with the core
|
||||
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.
|
||||
The rest of this document assumes that you are used to writing modules.
|
||||
|
||||
2) Complex Events
|
||||
2) Using Events
|
||||
|
||||
This type of events are based around what happens when we talk to the
|
||||
IRCd, much like MESSAGE events that the IRCD sends to us. The events
|
||||
are triggered when Anope writes to the ircd. To watch for these events
|
||||
you must have some knowledge of how the IRCd command system works. In
|
||||
our example we will trap for NICK events.
|
||||
Anope is told about modules wanting to hook to events by the function
|
||||
ModuleManager::Attach(EventName, Module*);, eg:
|
||||
|
||||
A) All functions most be formatted as:
|
||||
ModuleManager::Attach(I_OnJoinChannel, this);
|
||||
|
||||
int functioname(char *source, int ac, char **av);
|
||||
You can also specifcy an array of events:
|
||||
|
||||
B) In AnopeInit you must declare EvtMessage in some fashion, it is into
|
||||
this variable that we will create the event handler. Here is what the
|
||||
base AnopeInit should look like at this point:
|
||||
|
||||
int AnopeInit(int argc, char **argv)
|
||||
{
|
||||
EvtMessage *msg = NULL;
|
||||
int status;
|
||||
Implementation i[] = { I_OnJoinChannel, I_OnPartChannel };
|
||||
ModuleManager::Attach(i, this, 2);
|
||||
Where 2 is the number of events in the list
|
||||
|
||||
moduleAddAuthor(AUTHOR);
|
||||
moduleAddVersion(VERSION);
|
||||
return MOD_CONT;
|
||||
}
|
||||
You must then overload these functions in your main modules class.
|
||||
The full list of functions and parameters are in modules.h. In this
|
||||
case, you would be overloading OnJoinChannel() and OnPartChannel() like so:
|
||||
|
||||
Note that AUTHOR and VERSION should be defined above the AnopeInit
|
||||
function, just like you should do with any module.
|
||||
void OnJoinChannel(User *u, Channel *c) { }
|
||||
void OnPartChannel(User *u, Channel *c) { }
|
||||
|
||||
C) Pass "createEventHandler" the name of the message in this case NICK,
|
||||
and the function that was created in Step A. At this point you should
|
||||
assign the return of "createEventHandler" to the EvtMessage variable.
|
||||
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).
|
||||
|
||||
msg = createEventHandler("NICK", my_nick);
|
||||
|
||||
D) The Handler is not ready for use yet; now you must add it to the hash
|
||||
with "moduleAddEventHandler". You will want to pass to this function
|
||||
the return of "createEventHandler".
|
||||
|
||||
status = moduleAddEventHandler(msg);
|
||||
|
||||
It will return the same module error codes as adding a regular message,
|
||||
which you can use to confirm it was added correctly.
|
||||
|
||||
E) With that setup in your function you will be passed 3 items. The source
|
||||
most of the time this will be set to ServerName or NULL; consult our
|
||||
IRCd documentation about how messages are formatted. AC is the count of
|
||||
variables you will find in AV.
|
||||
|
||||
int my_nick(char *source, int ac, char **av)
|
||||
{
|
||||
alog("Internal Event - nick is %s",av[0]);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
3) Triggered Events
|
||||
|
||||
These events also known as "event hooks" are internal events such as
|
||||
expiring of nicks to the saving of databases.
|
||||
|
||||
A) All functions most be formatted as:
|
||||
|
||||
int functioname(int argc, char **argv);
|
||||
|
||||
B) In AnopeInit you must declare EvtHook in some fashion; it is into
|
||||
this variable that we will create the event handler. Here is what
|
||||
the base AnopeInit should look like at this point:
|
||||
|
||||
int AnopeInit(int argc, char **argv)
|
||||
{
|
||||
EvtHook *hook = NULL;
|
||||
int status;
|
||||
|
||||
moduleAddAuthor(AUTHOR);
|
||||
moduleAddVersion(VERSION);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
C) Pass "createEventHook" the name of the event. In this case we are
|
||||
going to hook to the saving of databases, "EVENT_DB_SAVING".
|
||||
|
||||
hook = createEventHook(EVENT_DB_SAVING, my_save);
|
||||
|
||||
D) The Handler is not ready for use yet; now you must add it to the hash
|
||||
with "moduleAddEventHook". You will want to pass to this function the
|
||||
return of "createEventHook"
|
||||
|
||||
status = moduleAddEventHook(hook);
|
||||
|
||||
It will return the same module error codes as adding a regular message,
|
||||
which you can use to confirm it was added correctly.
|
||||
|
||||
E) With that setup in your function you will be passed 1 item. The message
|
||||
is very simple; it could be as simple as a start, stop or message. In
|
||||
the case of saving it has a start and stop.
|
||||
|
||||
int my_save(int argc, char **argv)
|
||||
{
|
||||
if (argc < 1) {
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!stricmp(argv[0], EVENT_START)) {
|
||||
alog("Saving the databases! has started");
|
||||
} else {
|
||||
alog("Saving the databases is complete");
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
4) Triggered Events List
|
||||
|
||||
Here's a list of all event hooks we currently offer, with a description
|
||||
of what argument is being passed to the event functions for this type of
|
||||
event. All arguments are plain-text strings (char *). The list is sorted
|
||||
in alphabetical order.
|
||||
|
||||
Note that all events are emitted AFTER the action has taken place, so
|
||||
any deleted nick/channel/etc won't exist anymore and any created one will
|
||||
exist when your function is being run, unless noted otherwise.
|
||||
|
||||
Also note that EVENT_START and EVENT_STOP should not be matched with an
|
||||
equal sign, but with string comparision. See the bundled events module for
|
||||
an example on how to do this.
|
||||
|
||||
The arguments are given as av[0] for the first argument, av[1] for the
|
||||
second argument, and so on. If av[0] and av[1] are given, the event has
|
||||
two arguments, and argc should be 2.
|
||||
|
||||
EVENT_ACCESS_ADD
|
||||
An user has been added to a channel access list.
|
||||
av[0] Name of the channel the user has been added to.
|
||||
av[1] The nickname of the user that has just added an entry to the
|
||||
access list.
|
||||
av[2] The nickname of the user that has been added to the access
|
||||
list.
|
||||
av[3] The level number the user has been added with.
|
||||
|
||||
EVENT_ACCESS_CHANGE
|
||||
An user level has been changed on a channel access list.
|
||||
av[0] Name of the channel the access list has been modified which.
|
||||
av[1] The nickname of the user that has just modified the access
|
||||
list of the channel.
|
||||
av[2] The nickname of the user wich his access level has just been
|
||||
modified.
|
||||
av[3] The new access level for the user.
|
||||
|
||||
EVENT_ACCESS_CLEAR
|
||||
A channel access list has been cleared.
|
||||
av[0] Name of the channel the access list has been cleared of
|
||||
av[1] The nickname of the user that has cleared the access list
|
||||
|
||||
EVENT_ACCESS_DEL
|
||||
An user has been deleted of a channel access list.
|
||||
av[0] Name of the channel the access entry has been deleted which.
|
||||
av[1] The nickname of the user that has just deleted the access entry.
|
||||
av[2] [OPTIONAL] The nickname of the user wich his access level has just
|
||||
been removed. Not present if numbers were used (e.g. /cs access
|
||||
del 7).
|
||||
|
||||
EVENT_BOT_ASSIGN
|
||||
A BotServ bot has been assigned to a channel.
|
||||
av[0] Name of the channel the bot has been assigned to.
|
||||
av[1] The nickname of the bot that has been assigned to the channel.
|
||||
|
||||
EVENT_BOT_BAN
|
||||
A BotServ bot has banned a user, e.g. kickers.
|
||||
av[0] The nick of the user banned.
|
||||
av[1] The Channel the user was banned from.
|
||||
av[2] The mask that was banned.
|
||||
|
||||
EVENT_BOT_CHANGE
|
||||
The properties of a BotServ bot have been changed.
|
||||
av[0] The nickname of the bot involved.
|
||||
|
||||
EVENT_BOT_CREATE
|
||||
A new BotServ bot has been created, and is ready to use.
|
||||
av[0] The nickname of the newly created bot.
|
||||
|
||||
EVENT_BOT_DEL
|
||||
A BotServ bot is being deleted from BotServ. This event is being sent
|
||||
just before the actual deletion is performed.
|
||||
av[0] The nickname of the bot being deleted.
|
||||
|
||||
EVENT_BOT_FANTASY
|
||||
A fantasy command of the bot has been triggered. This event should be
|
||||
used to create your own fantasy commands.
|
||||
av[0] The fantasy command that has been triggered without leading '!'.
|
||||
av[1] The nickname of the user that has triggered the fantasy
|
||||
command.
|
||||
av[2] The name of the channel the fantasy command has been triggered
|
||||
on.
|
||||
av[3] Contains any optional paramenters passed after the fantasy
|
||||
command. If none are present, this will not exist, and argc will
|
||||
will be 3.
|
||||
|
||||
EVENT_BOT_FANTASY_NO_ACCESS
|
||||
A fantasy command of the bot has been triggered by someone without
|
||||
access to BotServ FANTASY commands on the channel. This will NOT
|
||||
trigger if someone with access has triggered a fantasy command; use
|
||||
EVENT_BOT_FANTASY for those. Hook to both events to catch both event
|
||||
triggers.
|
||||
av[0] The fantasy command that has been triggered without leading '!'.
|
||||
av[1] The nickname of the user that has triggered the fantasy
|
||||
command.
|
||||
av[2] The name of the channel the fantasy command has been triggered
|
||||
on.
|
||||
av[3] Contains any optional paramenters passed after the fantasy
|
||||
command. If none are present, this will not exist, and argc will
|
||||
will be 3.
|
||||
|
||||
EVENT_BOT_JOIN
|
||||
A BotServ bot has joined a channel and opped itself.
|
||||
av[0] The channel name the bot has just joined.
|
||||
av[1] The nickname of the bot that has joined the channel.
|
||||
|
||||
EVENT_BOT_KICK
|
||||
A BotServ bot has kicked a user from a channel.
|
||||
av[0] The name of the user that has been kicked.
|
||||
av[1] The name of the channel the user was kicked from.
|
||||
av[2] The reason for the kick.
|
||||
|
||||
EVENT_BOT_UNASSIGN
|
||||
A BotServ bot is being unassigned from a channel. This event is being
|
||||
sent before the actual removing of the bot is done.
|
||||
av[0] The channel name the bot has been unassigned from.
|
||||
av[1] The nickname of the bot that has been unassigned.
|
||||
|
||||
EVENT_CHAN_DROP
|
||||
A channel has been dropped and deleted.
|
||||
av[0] The name of the channel that has been dropped.
|
||||
|
||||
EVENT_CHAN_EXPIRE
|
||||
A channel has been expired and will be deleted. The event will be
|
||||
emitted just before the actual channel deletion happens.
|
||||
av[0] The name of the channel that has been expired.
|
||||
|
||||
EVENT_CHAN_FORBIDDEN
|
||||
A channel has been forbidden (ChanServ FORBID).
|
||||
av[0] The name of the channel that has been forbidden.
|
||||
|
||||
EVENT_CHAN_KICK
|
||||
Someone has just been kicked from a channel.
|
||||
av[0] The nick of the user that has been kicked.
|
||||
av[1] The channel the user has been kicked from.
|
||||
|
||||
EVENT_CHAN_REGISTERED
|
||||
A new channel has been registered.
|
||||
av[0] The name of the channel that has been registered.
|
||||
|
||||
EVENT_CHAN_SUSPENDED
|
||||
A channel has been suspended (ChanServ SUSPEND).
|
||||
av[0] The name of the channel that has been suspended.
|
||||
|
||||
EVENT_CHAN_UNSUSPEND
|
||||
A channel has been unsuspended (ChanServ UNSUSPEND).
|
||||
av[0] The name of the channel that has been unsuspended.
|
||||
|
||||
EVENT_CHANGE_NICK
|
||||
A user has just changed it's nick.
|
||||
av[0] The new nickname of the user.
|
||||
|
||||
EVENT_CONNECT
|
||||
This event is emitted when the connection to our uplink hub is being
|
||||
made.
|
||||
av[0] EVENT_START or EVENT_STOP, to indicate if it's emitted before
|
||||
or after the connection has been made. EVENT_STOP is emitted
|
||||
before our burst is being sent over the link.
|
||||
|
||||
EVENT_DB_EXPIRE
|
||||
This event is emitted when the expiry routines for all things that can
|
||||
expire in Anope are being run.
|
||||
av[0] EVENT_START or EVENT_STOP, to indicate if it's being emitted
|
||||
before or after the expiry routines have been run.
|
||||
|
||||
EVENT_DB_SAVING
|
||||
This event is emitted when the databases are being saved.
|
||||
av[0] EVENT_START or EVENT_STOP, to indicate if it's emitted before
|
||||
or after the saving routines have been run.
|
||||
|
||||
EVENT_DB_BACKUP
|
||||
This event is emitted when the databases are backed up.
|
||||
av[0] EVENT_START when the backup commences, and EVENT_STOP when it
|
||||
finishes.
|
||||
|
||||
EVENT_DEFCON_LEVEL
|
||||
The DefCon level has just been changed. This event is emitted before
|
||||
any DefCon-related action is taken. The internal DefConLevel has
|
||||
already been raised at this point.
|
||||
av[0] The new level of DefCon being invoked.
|
||||
|
||||
EVENT_GROUP
|
||||
A user has grouped it's nickname to another user group.
|
||||
av[0] The nickname of the user that joined the group.
|
||||
|
||||
EVENT_JOIN_CHANNEL
|
||||
A user joins a channel.
|
||||
av[0] EVENT_START or EVENT_STOP. EVENT_START when the user has passed
|
||||
all access checks and is allowed to join, but has not yet
|
||||
joined the channel. EVENT_STOP when the user has joined and all
|
||||
needed modes are set etc.
|
||||
av[1] The nickname of the user joining the channel.
|
||||
av[2] The name of the channel the user has joined.
|
||||
|
||||
EVENT_NEWNICK
|
||||
A new user has been introduced on the network.
|
||||
av[0] The nickname of the newly introduced user.
|
||||
|
||||
EVENT_NICK_DROPPED
|
||||
A user's nick has just been dropped. Note that the nickname information
|
||||
has already been deleted!
|
||||
av[0] The nickname of the user that has just been dropped.
|
||||
|
||||
EVENT_NICK_EXPIRE
|
||||
A user's nick has just expired. Note that, as with EVENT_NICK_DROPPED,
|
||||
the nickname information has already been deleted!
|
||||
av[0] The nickname of the user that has just expired.
|
||||
|
||||
EVENT_NICK_FORBIDDEN
|
||||
A user's nick has just been forbidden.
|
||||
av[0] The nickname that has just been forbidden.
|
||||
|
||||
EVENT_NICK_IDENTIFY
|
||||
A user has just identified for it's nickname with NickServ.
|
||||
av[0] The nickname of the user that just identified.
|
||||
|
||||
EVENT_NICK_LOGOUT
|
||||
A user has just (been) logged out.
|
||||
av[0] The nickname of the user that has (been) logged out.
|
||||
|
||||
EVENT_NICK_REGISTERED
|
||||
A new user has just registered it's nickname. This event is being
|
||||
emitted when the registration is completed, but the user modes have not
|
||||
yet been set.
|
||||
av[0] The nickname of the newly registered user.
|
||||
|
||||
EVENT_NICK_SUSPENDED
|
||||
A user's nick has just been suspended.
|
||||
av[0] The nickname that has just been suspended.
|
||||
|
||||
EVENT_NICK_UNSUSPEND
|
||||
A user's nick has just been unsuspended.
|
||||
av[0] The nickname that has just been unsuspended.
|
||||
|
||||
EVENT_PART_CHANNEL
|
||||
A user parts a channel.
|
||||
av[0] EVENT_START or EVENT_STOP. EVENT_START when the user is about
|
||||
to be removed from the channel internally, EVENT_STOP when
|
||||
this has been done.
|
||||
av[1] The nickname of the user parting the channel.
|
||||
av[2] The name of the channel the user has parted.
|
||||
av[3] The reason the user parted the channel, this is not always sent
|
||||
so check the count to make sure it was passed. (ac == 4)
|
||||
|
||||
EVENT_RELOAD
|
||||
This event is emitted after the configuration file has been reloaded.
|
||||
av[0] Always EVENT_START.
|
||||
|
||||
EVENT_RESTART
|
||||
This event is emitted before the services are being restarted.
|
||||
av[0] Always EVENT_START.
|
||||
|
||||
EVENT_SERVER_CONNECT
|
||||
A new server has just connected to the network.
|
||||
av[0] The name of the new server.
|
||||
|
||||
EVENT_SERVER_SQUIT
|
||||
A server has sent an SQUIT and is about to be removed from the
|
||||
network. This event is being sent before the server is actually
|
||||
removed from the network.
|
||||
av[0] The name of the server that is being removed.
|
||||
|
||||
EVENT_SHUTDOWN
|
||||
This event is emitted when Anope is being shut down.
|
||||
av[0] EVENT_START or EVENT_STOP, to indicate where in the process of
|
||||
restarting the core is. With EVENT_START, services are still
|
||||
fully online and operating. With EVENT_STOP, every internal
|
||||
clean up has been done already, and the SQUIT has been sent;
|
||||
the only thing done after emitting the event is closing the
|
||||
socket to the uplink hub.
|
||||
|
||||
EVENT_SIGNAL
|
||||
This event is emitted when Anope is quitting because of a signal it
|
||||
received.
|
||||
av[0] The quit message that will be sent with the SQUIT for this
|
||||
shutdown.
|
||||
|
||||
EVENT_TOPIC_UPDATED
|
||||
A channel topic has been succesfully updated. Note that this event is
|
||||
only emitted if the new topic has been fully accepted and set by the
|
||||
Anope core.
|
||||
av[0] The name of the channel involved.
|
||||
av[1] The new topic set on the channel.
|
||||
|
||||
EVENT_USER_LOGOFF
|
||||
A user has left the network. This event is emitted before the internal
|
||||
removal is performed, so the user still exists internally.
|
||||
av[0] The nickname of the user leaving the network.
|
||||
|
||||
@@ -1,480 +1,10 @@
|
||||
Frequently Asked Questions (FAQ) concerning Anope
|
||||
------------------------------------------------
|
||||
|
||||
NOTE:
|
||||
An updated version of this FAQ can be found on our website: www.anope.org
|
||||
|
||||
Table of Contents
|
||||
-----------------
|
||||
|
||||
1) General
|
||||
1.1) What is Anope?
|
||||
1.2) Where can I find Anope?
|
||||
1.3) Does Anope run under Windows?
|
||||
1.4) Can I send you questions without reading the FAQ, INSTALL or README
|
||||
files?
|
||||
1.5) I need support for the XYZ protocol.
|
||||
1.6) Your Services program doesn't do XYZ like DALnet (or other) Services.
|
||||
What's wrong?
|
||||
1.7) I've got a great new idea for Services. Do you want it?
|
||||
1.8) Examples of features we have been asked about and why we won't add (or
|
||||
haven't yet added) them, so don't ask us about them:
|
||||
1.9) Can you help me?
|
||||
1.10) Where is RootServ?
|
||||
|
||||
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) OperServ
|
||||
3.1) Using the OperServ JUPE command results in server messages like
|
||||
"Server juped.server introduced by non-hub server services.my.net".
|
||||
3.2) I can't use the ADMIN command to add Services admins, it tells me
|
||||
"Permission denied."
|
||||
3.3) When I add an AKILL, the users matching it don't get killed.
|
||||
3.4) Trying to use OperServ gives me "Access denied", but my nick is in the
|
||||
ServicesRoot directive and is registered, and I've identified for my
|
||||
nick.
|
||||
3.5) When I used the OperServ RAW command, Anope and/or my network crashed,
|
||||
or did weird things! Please fix this bug!
|
||||
3.6) I would like to have the list of the different RAW on OperServ.
|
||||
3.7) I can't get /OS UMODES and /OS SVSNICK to work!
|
||||
3.8) What is a Super-Admin? How does it work? Why might it not work?
|
||||
3.9) How can i enable the OperServ RAW command?
|
||||
|
||||
4) Bugs / Crashes
|
||||
4.1) Anope always dies after about five minutes, saying "FATAL ERROR! Can't
|
||||
back up nick.db".
|
||||
4.2) Anope crashed with a segmentation fault.
|
||||
4.3) I've found a bug that's not mentioned here or in the README or BUGS
|
||||
files. What should I do?
|
||||
4.4) My FreeBSD box complains about 'Shared object "nss_dns.so.1" not
|
||||
found'
|
||||
4.5) Anope and long (more then 30 character) nicknames.
|
||||
|
||||
5) ChanServ
|
||||
5.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.
|
||||
5.2) Anope ignored the SET SUCCESSOR setting and deleted a channel when the
|
||||
founder expired.
|
||||
5.3) How to auto voice all those whom join my #channel?
|
||||
5.4) Channel options like RESTRICTED or SECUREOPS don't work. What's wrong?
|
||||
|
||||
6) BotServ
|
||||
6.1) How do I add bots to BotServ?
|
||||
6.2) Why do kick triggers and fantasy commands fail to work with my Bahamut
|
||||
IRCd?
|
||||
|
||||
7) Language
|
||||
7.1) Anope complains in the logfile about being unable to load the default
|
||||
language.
|
||||
7.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
|
||||
7.3) I selected a language other than English, but sometimes Anope sends
|
||||
responses in English instead.
|
||||
|
||||
8) DevNull
|
||||
8.1) What is the purpose of DevNull?
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
1) General
|
||||
|
||||
1.1) What is Anope?
|
||||
|
||||
Anope is a set of services for IRC networks. See the README file for more
|
||||
information. And in case you were wondering, Anope is Epona spelt backwards
|
||||
:)
|
||||
|
||||
1.2) Where can I find Anope?
|
||||
|
||||
The latest version can always be found at the official Anope distribution
|
||||
site:
|
||||
|
||||
* http://www.anope.org/
|
||||
|
||||
New version announcements can also be found at http://www.anope.org/ in the
|
||||
main page.
|
||||
|
||||
1.3) Does Anope run under Windows?
|
||||
|
||||
Yes. For more information on how to obtain the windows version of Anope
|
||||
visit http://wiki.anope.org/Windows
|
||||
|
||||
1.4) Can I send you questions without reading the FAQ, INSTALL or README files?
|
||||
|
||||
No. If you don't read those files, your messages will most probably be
|
||||
ignored. We don't mean to be rude, but if we took the time to write down
|
||||
some documentation, we'd expect you to take some time to read it.
|
||||
|
||||
1.5) I need support for the XYZ protocol.
|
||||
|
||||
Since Anope 1.7.9, support for other IRCD's, and thus protocols, has been
|
||||
made modular. More information on making a support file for your favorite
|
||||
IRCD can be found in the docs/IRCD file.
|
||||
|
||||
1.6) Your Services program doesn't do XYZ like DALnet (or other) Services.
|
||||
What's wrong?
|
||||
|
||||
Nothing is wrong, except your expectations. Anope is a completely
|
||||
different program from that used on DALnet; they are similar in concept
|
||||
only.
|
||||
|
||||
1.7) I've got a great new idea for Services. Do you want it?
|
||||
|
||||
We are always interested in hearing new ideas. HOWEVER, do not expect your
|
||||
proposal to be in the next Anope release for sure. As a rule, we usually
|
||||
don't add anything that can be equivalently done by other means, or that we
|
||||
consider totally useless; see question 1.8 for examples of things we don't
|
||||
plan to add.
|
||||
|
||||
Our general intent is for Anope to provide as much functionality as
|
||||
possible--while staying as lean as possible. So features which are
|
||||
arguably beneficial will tend to be added, while features of limited or no
|
||||
benefit or which can be equally provided by something else already in use
|
||||
will tend to be passed over.
|
||||
|
||||
If you'd like to give us your idea, you can go to our website at
|
||||
http://www.anope.org/ and add it on our online Forum, in the Feature
|
||||
Requests section.
|
||||
|
||||
1.8) Examples of features we have been asked about and why we won't add (or
|
||||
haven't yet added) them, so don't ask us about them:
|
||||
|
||||
* An option to make ChanServ stay in some/all registered channels: we see
|
||||
absolutely no necessity for this feature, since BotServ already does this
|
||||
anyway.
|
||||
|
||||
* A "current time" field in NickServ and ChanServ INFO displays: Most
|
||||
people have clocks of some sort either on their computer screens or on
|
||||
their walls (or both), and all IRC servers, as well as Services, have a
|
||||
command to return the server's current time. Thus a current-time field in
|
||||
INFO displays would simply take up extra space for no reason.
|
||||
|
||||
1.9) Can you help me?
|
||||
|
||||
No, we can't help you unless you tell us what you need help with.
|
||||
|
||||
1.10) Where is RootServ?
|
||||
|
||||
Anope does not supply RootServ. All functions you would find in RootServ
|
||||
have been integrated into OperServ. If you really want to use RootServ, you
|
||||
can set the OperServAlias in services.conf to be RootServ. This will enable
|
||||
the RootServ nick to be used for OperServ as well. Read the comments near
|
||||
OperServAlias in the configuration file for more information.
|
||||
|
||||
|
||||
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/ (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 server type in the
|
||||
configuration file. (Also make sure that you are actually running one of
|
||||
the supported servers. There are a gazillion different variations on the
|
||||
basic IRC protocol out there, and we have neither the time nor the desire
|
||||
to add support for them.)
|
||||
|
||||
The recommended server, under which Epona (the original code base used by
|
||||
Anope) was developed, is Bahamut. DreamForge 4.6.7 will also work fine, but
|
||||
it's a bit obsolete nowadays. Derivatives of Bahamut and DreamForge may
|
||||
also work, if they don't change the server<->server protocol too much;
|
||||
contact their authors for more information. Most people, though, are
|
||||
running Anope with UnrealIRCd, UltimateIRCd or Bahamut.
|
||||
|
||||
As always, you can check the log file (services.log by default) for error
|
||||
messages. You can also start services with the -nofork command line option
|
||||
to prevent it from running in the background, and it will output the
|
||||
messages written to the log file to the console as well.
|
||||
|
||||
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!
|
||||
|
||||
Of course not. RTFM (Read The Fine Manual), and see the previous answer.
|
||||
|
||||
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 question 2.4 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) OperServ
|
||||
|
||||
3.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
|
||||
|
||||
3.2) I can't use the ADMIN command to add Services admins, it tells me
|
||||
"Permission denied."
|
||||
|
||||
Did you define yourself as the Services root? You need to insert your
|
||||
nickname in the ServicesRoot directive in services.conf. Also, you must be
|
||||
a global IRC Operator and your nickname must be registered and properly
|
||||
indentified with NickServ.
|
||||
|
||||
3.3) When I add an AKILL, the users matching it don't get killed.
|
||||
|
||||
Use the AkillOnAdd configuration directive.
|
||||
|
||||
3.4) Trying to use OperServ gives me "Access denied", but my nick is in the
|
||||
ServicesRoot directive and is registered, and I've identified for my nick.
|
||||
|
||||
You need to be a global oper (i.e. user mode +o) to access OperServ. This
|
||||
can be configured via the OSOpersOnly directive in services.conf .
|
||||
|
||||
3.5) When I used the OperServ RAW command, Anope and/or my network crashed, or
|
||||
did weird things! Please fix this bug!
|
||||
|
||||
"That's not a bug, it's a feature."
|
||||
|
||||
Have you ever typed /msg OperServ HELP RAW? It's clearly stated there that
|
||||
this command is dangerous and that its use may result in very bad things.
|
||||
|
||||
And that's why this command has been disabled by default. If you enabled
|
||||
and used it, YOU'RE ON YOUR OWN. All help requests will be ignored, even if
|
||||
the problem happens not immediately.
|
||||
|
||||
3.6) I would like to have the list of the different RAW on OperServ.
|
||||
|
||||
If you have to ask, you should not be messing with RAW :)
|
||||
|
||||
3.7) I can't get /OS UMODES and /OS SVSNICK to work!
|
||||
|
||||
You need to be a SuperAdmin to be able to use these commands.
|
||||
|
||||
3.8) What is a Super-Admin? How does it work? Why might it not work?
|
||||
|
||||
Super-Admin'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.
|
||||
This is commented by default. Read /msg OperServ HELP SET SUPERADMIN for
|
||||
further help.
|
||||
|
||||
3.9) How can i enable the OperServ RAW command?
|
||||
|
||||
Enabling the OperServ RAW command is VERY dangerous and should never be
|
||||
done on a real network without thinking about it very well first. The RAW
|
||||
command can easily break your whole network if used incorrectly, and thus
|
||||
you will receive NO SUPPORT if you enable RAW on your network.
|
||||
|
||||
Before you enable RAW, be very sure you really want to enable it, and keep
|
||||
in mind that you will NOT BE ABLE to receive ANY SUPPORT anymore, because
|
||||
Anope's stability cannot be guaranteed if RAW is enabled.
|
||||
|
||||
The RAW command comes bundled as a core module for operserv. To load it,
|
||||
add the os_raw module to the list of OperServ core modules. But be sure to
|
||||
keep in mind that when you enable the RAW command, you CANNOT GET ANY
|
||||
SUPPORT for Anope anymore.
|
||||
|
||||
|
||||
4) Bugs / Crashes
|
||||
|
||||
4.1) 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.
|
||||
|
||||
4.2) 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.
|
||||
|
||||
4.3) 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.
|
||||
|
||||
4.4) 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.
|
||||
|
||||
4.5) 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 default anope
|
||||
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.
|
||||
|
||||
|
||||
5) ChanServ
|
||||
|
||||
5.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:*:*
|
||||
|
||||
5.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 below (see section 6 of the README file).
|
||||
|
||||
5.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
|
||||
|
||||
5.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.
|
||||
|
||||
|
||||
6) BotServ
|
||||
|
||||
6.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 before you can use the
|
||||
BOT command.
|
||||
|
||||
6.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 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'.
|
||||
|
||||
|
||||
7) Language
|
||||
|
||||
7.1) Anope complains in the logfile about being unable to load the default
|
||||
language.
|
||||
|
||||
You forgot to run "make install".
|
||||
|
||||
7.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
|
||||
|
||||
See section 5 of the README file.
|
||||
|
||||
7.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 don't have a
|
||||
translation of every message Anope uses, but only some of them. 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.
|
||||
|
||||
|
||||
8) DevNull
|
||||
|
||||
8.1) What is the purpose of DevNull?
|
||||
|
||||
DevNull functions as a message sink. Any message sent to it will be
|
||||
ignored. It will not be logged, there will be no response. It will be lost
|
||||
forever. Whether it's useful or not is up to you; we just provide you with
|
||||
the option.
|
||||
|
||||
The information in the 1.9 FAQ is subject to change at any
|
||||
moment due to new developments. Please visit our website
|
||||
for the most up to date information.
|
||||
|
||||
An updated version of the FAQ can be found here:
|
||||
|
||||
http://wiki.anope.org/index.php/FAQ
|
||||
|
||||
+7
-9
@@ -157,12 +157,12 @@ Note: You should also read the README and FAQ files!
|
||||
If you're unable to get a link with your IRCd after reading this section,
|
||||
you might try the interactive link maker, which is located at:
|
||||
|
||||
http://anope.org/~heinz/ilm.php
|
||||
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 +180,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
|
||||
|
||||
@@ -1,601 +1,202 @@
|
||||
How To Add IRCd Support
|
||||
-----------------------
|
||||
|
||||
1) Files to Edit
|
||||
2) Modifing the Header File
|
||||
3) The Code
|
||||
4) Modes
|
||||
5) Functions / Events
|
||||
6) CAPAB/PROTOCTL
|
||||
|
||||
1) Files to Edit
|
||||
|
||||
When preparing to add support to Anope for your ircd, you need to edit
|
||||
the following files.
|
||||
|
||||
A) Make a copy of the .c and .h file of the IRCd that matches the ircd
|
||||
that you are attempting to add support for best.
|
||||
B) Make a backup copy of include/services.h, include/sysconf.h.in
|
||||
C) Make a backup copy of Config and configure.in
|
||||
|
||||
First step in this process is to rename the .c and .h file after the IRCd
|
||||
that you are going to be adding support for. Its recommended that you come
|
||||
up with a name that is clear and easy to understand.
|
||||
|
||||
Now that you have the files that you will need to create your own ircd
|
||||
support, starting with Config. This file is a shell script file; scroll
|
||||
down until you find the list of ircs for the user to select. Indicate
|
||||
the based ircd version which is supported such as a series 1.x or 2.2.x,
|
||||
placing in the comment side an exact version that the support is for or
|
||||
"experimental" if you are not the ircd developer. The next step is to
|
||||
decide how the IRCd will be defined, following the existing examples edit
|
||||
'IRCTYPE_DEF="IRC_RATBOX"' to be the descriptive define for your ircd.
|
||||
|
||||
With the Config file ready to go, edit configure.in and find in there the
|
||||
reference to --with-ircd. You should see the various other ircds, and
|
||||
you will want to add yours in there using the same IRC_ name you came up
|
||||
with above. Important in this step is to make sure that you set the
|
||||
IRCDFILE to the name of the .c file you set in step 1. Once you have the
|
||||
configure.in created you can remove the old configure and at the command
|
||||
prompt type "autconf"; this will generate the new configure file.
|
||||
|
||||
Getting close to actually modify code. Open sysconf.h.in and add two
|
||||
lines for your given ircd, which is similar to this:
|
||||
|
||||
/* "First IRCD type" */
|
||||
#undef IRC_RATBOX
|
||||
|
||||
Open services.h and add a line with the rest of the ircd include files to
|
||||
match the name of the .h file you set in step 1.
|
||||
|
||||
#include "ratbox.h"
|
||||
|
||||
Taking the .c and .h file open them and replace the #ifdef IRC_* with the
|
||||
IRC_ name you set in step two. Ensure that the code comments at the top
|
||||
of the file match the ircd that the code will be for.
|
||||
|
||||
You are now ready to start getting into the code.
|
||||
|
||||
2) Modifying the Header File
|
||||
|
||||
Now that you have gotten past the first part of the creation process, you
|
||||
are into the code. This part is the harder and more complex part. You
|
||||
will need a general understanding of C code to continue. Here are the
|
||||
step by step instructions required to make this work.
|
||||
|
||||
Open the .h file and find the section of code with
|
||||
|
||||
#define PROTECT_SET_MODE "+"
|
||||
#define PROTECT_UNSET_MODE "-"
|
||||
#define CS_CMD_PROTECT "PROTECT"
|
||||
#define CS_CMD_DEPROTECT "DEPROTECT"
|
||||
#define FANT_PROTECT_ADD "!protect"
|
||||
#define FANT_PROTECT_DEL "!deprotect"
|
||||
#define LEVEL_PROTECT_WORD "AUTOPROTECT"
|
||||
#define LEVELINFO_PROTECT_WORD "PROTECT"
|
||||
#define LEVELINFO_PROTECTME_WORD "PROTECTME"
|
||||
|
||||
If the ircd supports a protective/admin (not owner) mode, set the
|
||||
PROTECT_SET_MODE and PROTECT_UNSET_MODE to be that mode. On most ircds
|
||||
it's usermode "a" so you will be setting it to "+a" and "-a". The next
|
||||
two are based more on what this mode is called. When you message ChanServ
|
||||
to get this mode, this is the command you will be using. After this are
|
||||
the fantasy commands which can be used in channel to get these modes. The
|
||||
next three relate to the ACCESS LEVEL list system. Again these are the
|
||||
words to gain these levels in the ACCESS LEVEL system. If your ircd does
|
||||
not have these functions, leave them at what ever value is currently set;
|
||||
the core code will ignore the request of the user.
|
||||
|
||||
Now that this is set, you can define the MODES. All user modes are stored
|
||||
with UMODE_ followed by a letter matching the modes case; be careful to
|
||||
use the correct case as this will make it clear when you setup MODES in
|
||||
the .c in a few. Use hex values for the modes so starting at 0x00000001
|
||||
to 0x8000000. In most cases you want to list all modes. If you run out of
|
||||
values look at removing any modes that do not impact services.
|
||||
|
||||
Channel modes are done much like user modes, with the exception that
|
||||
bans, exceptions, invites, and modes that are applied to a user such as
|
||||
op and voice are not defined here. All other modes are defined in here.
|
||||
Again be clear and use the correct case and use hex values as done with
|
||||
user modes.
|
||||
|
||||
Finally we come to DEFAULT_MLOCK; this is the mode that services will set
|
||||
by default on channels when they are registered. In general you want this
|
||||
to be what is acceptable by the ircd; in most cases this is "+nt"
|
||||
|
||||
3) The Code
|
||||
|
||||
Here is where the code of the .c file comes in. Be prepared to spend at
|
||||
least an hour, if not longer, going over the code and getting it right;
|
||||
Especially if you are setting up an ircd that is completely different
|
||||
than the one you used as a base. This section covers the majority of the
|
||||
code that is in use.
|
||||
|
||||
The first bit of code you will face is:
|
||||
|
||||
const char version_protocol[] = "Ratbox IRCD";
|
||||
|
||||
This the protocol name which will appear in various places; especially
|
||||
when you do -version at the command prompt, this is where you state the
|
||||
server name. The version is not always needed unless you are showing that
|
||||
the support is for one branch of a ircd family, such as Unreal 3.1 and
|
||||
Unreal 3.2.
|
||||
|
||||
Once you have decided on this little piece of code, you will come to
|
||||
flood mode characters being used for setting and removing. If your IRCd
|
||||
does not support flood modes, you can just use ""; we will be setting if
|
||||
your IRCD supports flooding or not in a little bit.
|
||||
|
||||
const char flood_mode_char_set[] = "+f";
|
||||
const char flood_mode_char_remove[] = "-f";
|
||||
|
||||
The next task that you will face is setting whether the IRCD sends time
|
||||
stamps on modes but does not tell us that it will do so. If it does, set
|
||||
UseTSMODE to 1; if it does not set it to be 0. If you're not sure refer
|
||||
to your IRCd's documentation on how MODE is sent.
|
||||
|
||||
int UseTSMODE = 0;
|
||||
|
||||
Now you've come to the part where you setup your ircd. There are two
|
||||
structs which hold this information; This allows you to quickly setup
|
||||
your specific ircd.
|
||||
|
||||
IRCDVar ircd[] = { }
|
||||
|
||||
This struct contains your basic IRCd functions. Your base source file has
|
||||
the list of all available variables; note that you should not swap any
|
||||
around, or you will break stuff. Here is a brief description of the usage
|
||||
of each.
|
||||
|
||||
1) Name: This member tells Anope about the IRCD's name. It may contain
|
||||
text about it's name and version. This is used to identify the
|
||||
build on startup.
|
||||
|
||||
2) NickServ Mode: This is the user mode set by Anope on NickServ.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
3) ChanServ Mode: This is the user mode set by Anope on ChanServ.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
4) MemoServ Mode: This is the user mode set by Anope on MemoServ.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
5) HostServ Mode: This is the user mode set by Anope on HostServ.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag. Note that if your ircd does not
|
||||
support HostServ, you can safely make this NULL or +,
|
||||
as there is a check before bringing HostServ online.
|
||||
|
||||
6) OperServ Mode: This is the user mode set by Anope on OperServ.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
7) BotServ Mode: This is the user mode set by Anope on BotServ.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
8) HelpServ Mode: This is the user mode set by Anope on HelpServ.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
9) DevNull Mode: This is the user mode set by Anope on DevNull.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
10) Global Mode: This is the user mode set by Anope on Global.
|
||||
Normally you want this to be some form of oper flag,
|
||||
or a services flag.
|
||||
|
||||
11) NickServ Alias Mode: This is the user mode set by Anope on the alias
|
||||
of NickServ. Normally you want this to be some
|
||||
form of oper flag, or a services flag.
|
||||
|
||||
12) ChanServ Alias Mode: This is the user mode set by Anope on the alias
|
||||
of ChanServ. Normally you want this to be some
|
||||
form of oper flag, or a services flag.
|
||||
|
||||
13) MemoServ Alias Mode: This is the user mode set by Anope on the alias
|
||||
of MemoServ. Normally you want this to be some
|
||||
form of oper flag, or a services flag.
|
||||
|
||||
14) HostServ Alias Mode: This is the user mode set by Anope on the alias
|
||||
of MemoServ. Normally you want this to be some
|
||||
form of oper flag, or a services flag. Note that
|
||||
if your ircd does not support HostServ, you can
|
||||
safely make this NULL or +, as there is a check
|
||||
before bringing HostServ online.
|
||||
|
||||
15) OperServ Alias Mode: This is the user mode set by Anope on the alias
|
||||
of OperServ. Normally you want this to be some
|
||||
form of oper flag, or a services flag.
|
||||
|
||||
16) BotServ Alias Mode: This is the user mode set by Anope on the alias
|
||||
of BotServ. Normally you want this to be some
|
||||
form of oper flag, or a services flag.
|
||||
|
||||
17) HelpServ Alias Mode: This is the user mode set by Anope on the alias
|
||||
of HelpServ. Normally you want this to be some
|
||||
form of oper flag, or a services flag.
|
||||
|
||||
18) DevNull Alias Mode: This is the user mode set by Anope on the alias
|
||||
of DevNull. Normally you want this to be some
|
||||
form of oper flag, or a services flag.
|
||||
|
||||
19) Global Alias Mode: This is the user mode set by Anope on the alias
|
||||
of Global. Normally you want this to be some form
|
||||
of oper flag, or a services flag.
|
||||
|
||||
20) BotServ Bots Mode: This is the user mode set by Anope on all BotServ
|
||||
bots. Normally you want this to be a some form of
|
||||
service or bot flag; you can use + for no mode at
|
||||
all.
|
||||
|
||||
21) Max Channelmode Symbols: This is the total number of possible channel
|
||||
modes that can appear before a nick. Do
|
||||
remember to count each possible mode, so +ov
|
||||
is 2.
|
||||
|
||||
22) Modes to Remove: This is every mode that Anope should remove when
|
||||
stripping channel modes.
|
||||
|
||||
23) Channelmode for bots: When a BotServ bot joins a channel, this is the
|
||||
mode set on them. Normally you will want them
|
||||
opped (+o), and protected (+a) on IRCd's that
|
||||
support it.
|
||||
|
||||
24) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise,
|
||||
KILL is used. Use 1 for yes, 0 for no.
|
||||
|
||||
25) VHOST: Can a user's host be changed on the fly? Enabling this allow
|
||||
HostServ online. Use 1 for yes, 0 for no.
|
||||
|
||||
26) OWNER: Has a channel umode for being the channel owner. For example,
|
||||
UnrealIRCd has mode +q. Use 1 for yes, 0 for no.
|
||||
|
||||
27) OWNER MODE SET: What mode to set to make someone the owner. If the
|
||||
IRCd doesn't support owners, set this to NULL.
|
||||
|
||||
28) OWNER MODE UNSET: What mode to unset to take away someone's channel
|
||||
owner status. If the IRCd doesn't support owners,
|
||||
set this to NULL.
|
||||
|
||||
29) ADMIN MODE SET: What mode to set to make someone a channel admin.
|
||||
If the IRCd dosn't support admins, set to NULL.
|
||||
|
||||
30) ADMIN MODE UNSET: What mode to unset to take away channel admin.
|
||||
If the IRCd dosn't support admins, set to NULL.
|
||||
|
||||
31) Mode on Nick Register: What mode to give users when they register
|
||||
with NickServ. If your ircd doesn't set expect
|
||||
a mode to be set on registration, you should
|
||||
set this to NULL.
|
||||
|
||||
32) Mode on Nick Unregister: What mode to set give users when they cancel
|
||||
their registration with NickServ. If your
|
||||
IRCd doesn't set a mode for registered users
|
||||
you should set this to NULL.
|
||||
|
||||
33) Mode on Nick Change: What mode to give users when they change their
|
||||
nick. If your ircd doesn't set a mode, you
|
||||
should set this to NULL.
|
||||
|
||||
34) SGLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
35) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
|
||||
|
||||
36) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no.
|
||||
|
||||
37) HALFOP: Is channel mode +h for halfop supported by the IRCd? Use 1 for
|
||||
yes, 0 for no.
|
||||
|
||||
38) Number of Server Args: When an IRCd connects, this is the number of
|
||||
parameters that are passed.
|
||||
|
||||
39) Join to Set: Services must join a channel to set any modes on that
|
||||
channel. Use 1 for yes, 0 for no.
|
||||
|
||||
40) Join to Message: Services must join a channel to send any message to
|
||||
that channel (cannot override +n). Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
41) Exceptions: Support for channel exceptions (mode +e). Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
42) TS Topic Forward: Some IRCd's (like UnrealIRCd) like their topic TS
|
||||
set forward by +1. Use 1 for yes, 0 for no.
|
||||
|
||||
43) TS Topic Backward: Some IRCd's (mainly older DreamForge-like ones)
|
||||
like their topic TS set back by -1. Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
44) Protected Umode: UMODE_ define that defines the protected usermod.
|
||||
Use 0 for no support, or enter the UMODE_ define.
|
||||
|
||||
45) Admin: Support for channel admins (Mainly used by UltimateIRCd). Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
46) SQline Channels: The IRCd's supports banning channel names via
|
||||
SQLINES. Use 1 for yes, 0 for no.
|
||||
|
||||
47) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a
|
||||
QUIT message for that user? Use 1 for yes, 0 for no.
|
||||
|
||||
48) SVSMODE -b: We can use SVSMODE to unban hosts from a channel. Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
49) Protect: Support for channel protect (mode +a, mainly being used by
|
||||
UnrealIRCd and ViagraIRCd). Use 1 for yes, 0 for no.
|
||||
|
||||
50) Reverse: We can do a reverse check when unbanning. For use with
|
||||
DreamForge based IRCd's. Use 1 for yes, 0 for no.
|
||||
|
||||
51) Register Channels: Supports sending a channelmode for registered
|
||||
channels. Use 1 for yes, 0 for no.
|
||||
|
||||
52) Registered Mode: Channelmode to set on registered channels, see the
|
||||
option above. Use 1 for yes, 0 for no.
|
||||
|
||||
53) vIdent: Support for including a user's ident in their vHost. Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
54) SVSHOLD: Support for temporarily 'holding' a nick, instead of using
|
||||
a nick enforcer client. Use 1 for yes, 0 for no.
|
||||
|
||||
55) TS on MODE: We need to send a timestamp when modes are being changed.
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
56) NICKIP: The IP address of new users is being sent along with their
|
||||
hostname when new users are being introduced on the network.
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
57) Umode: We can use OperServ to change a user's mode. Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
58) O:LINE: We can use OperServ to give some user a temporary O:LINE.
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
59) Vhost On Nick: On NICK the IRCd sends the VHOST. Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
60) Change Realname: Change real name. Use 1 for yes, 0 for no.
|
||||
|
||||
61) Extra Help: If the IRCd has more help for functions in ChanServ than
|
||||
the default help, you should put the language string
|
||||
identifier here. Use 0 for no extra help.
|
||||
|
||||
62) No Knock: CMODE_ that defines NO KNOCK. Use 0 for no support.
|
||||
|
||||
63) Admin Only: CMODE_ that defines Admin Only. Use 0 for no support.
|
||||
|
||||
64) Default MLock: Default channelmodes for MLOCK. Use 0 for no modes.
|
||||
|
||||
65) Vhost Umode: UMODE_ that indicates if the user currently has a vHost.
|
||||
Use 0 for no support.
|
||||
|
||||
66) Flood Mode: The IRCd has a channelmode for blocking floods. Use 1 for
|
||||
yes, 0 for no.
|
||||
|
||||
67) Link Mode: The IRCd has a channelmode for linking a channel to some
|
||||
other channel. Use 1 for yes, 0 for no.
|
||||
|
||||
68) CMode F: CMODE_ that defines flood mode. Use 0 for no support.
|
||||
|
||||
69) CMode L: CMODE_ that defines link mode. Use 0 for no support.
|
||||
|
||||
70) Check Nick ID: Should we check if a user should remain identified when
|
||||
changing their nick? This is for IRCd's that remove
|
||||
their registered-user mode when someone changes their
|
||||
nick (like Bahamut does).
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
71) No Knock Requires +i: Does the No Knock channel mode require invite
|
||||
only channels? Use 1 for yes, 0 for no.
|
||||
|
||||
72) Chan Modes: If sent in CAPAB/PROTOCOL, we store it in here. This is
|
||||
NULL by default.
|
||||
|
||||
73) Tokens: Can we use tokens to talk to the IRCd? Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
74) Token Case Senstive: Are the IRCd's TOKENS/COMMANDS case sensitive?
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
75) base64 SJOIN TS: Are the timestamps sent with a SJOIN in base64? Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
76) Supports +I: Does the IRCd support channelmode +I? Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
77) SJOIN Ban Char: Character used to identify bans. Use ''.
|
||||
|
||||
78) SJOIN Except Char: Character used to identify exceptions. use ''.
|
||||
|
||||
79) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
80) SGline Enforce: Does the IRCd enforce SGLINES for us or do we need to
|
||||
do so? Use 1 for yes, 0 for no.
|
||||
|
||||
81) Vhost Character: The character used to represent the vHost mode, if
|
||||
this is supported by the IRCd.
|
||||
|
||||
82) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
|
||||
|
||||
83) UMode +h: Does the IRCd support usermode +h for helpers?
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
84) P10: Is this IRCd a P10-style IRCd? Use 1 for yes, 0 for no.
|
||||
|
||||
85) Character Set: Unreal passes the character set during PROTOCTL,
|
||||
the value is stored here. Set this NULL to start.
|
||||
|
||||
86) Reports sync: Does the IRCd report when it's in sync (or done bursting,
|
||||
depending on how you want to say it)? Remember to set
|
||||
the sync state for servers correctly if it does.
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
87) 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.
|
||||
|
||||
So we've had this long list. Now there's a second struct to fill. This
|
||||
struct isn't as long as the previous one though, so we'll handle it quite
|
||||
quick compared to the previous one.
|
||||
|
||||
IRCDCAPAB ircdcap[] = { }
|
||||
|
||||
This struct is based on the CAPAB defines. You should review the CAPAB
|
||||
table below to see how this should be done.
|
||||
|
||||
Define Table
|
||||
--------------------------------------------------------------------------
|
||||
Define | Value | Token | Description
|
||||
----------------|------------|-----------|--------------------------------
|
||||
CAPAB_NOQUIT | 0x00000001 | NOQUIT | NOQUIT protocol support
|
||||
CAPAB_TSMODE | 0x00000002 | TS | Chanmodes are timestamped
|
||||
CAPAB_UNCONNECT | 0x00000004 | UNCONNECT | UNCONNECT protocol support
|
||||
CAPAB_NICKIP | 0x00000008 | NICKIP | IP sent in the NICK line
|
||||
CAPAB_NSJOIN | 0x00000010 | SSJOIN | Smart SJOIN support
|
||||
CAPAB_ZIP | 0x00000020 | ZIP | Support for gzipped links
|
||||
CAPAB_BURST | 0x00000040 | BURST | Supports BURST command
|
||||
CAPAB_TS3 | 0x00000080 | TS3 | Support for TS3 protocol
|
||||
CAPAB_TS5 | 0x00000100 | TS5 | Support for TS5 protocol
|
||||
CAPAB_DKEY | 0x00000200 | DKEY | DH-Key exchange using DKEY
|
||||
CAPAB_DOZIP | 0x00000400 | ZIP | Link traffic will be gzipped
|
||||
CAPAB_DODKEY | 0x00000800 | DKEY | Do DKEY with this link
|
||||
CAPAB_QS | 0x00001000 | QS | Supports quit storm removal
|
||||
CAPAB_SCS | 0x00002000 | SCS | String Cache System support
|
||||
CAPAB_PT4 | 0x00004000 | PT4 | Support for PT4 protocol
|
||||
CAPAB_UID | 0x00008000 | UID | Support for UIDs
|
||||
CAPAB_KNOCK | 0x00010000 | KNOCK | Supports KNOCK
|
||||
CAPAB_CLIENT | 0x00020000 | CLIENT | Supports CLIENT
|
||||
CAPAB_IPV6 | 0x00040000 | IPV6 | Support for IPv6 addresses
|
||||
CAPAB_SSJ5 | 0x00080000 | SSJ5 | Smart Join protocol 5 support
|
||||
CAPAB_SN2 | 0x00100000 | SN2 | Support for SN2 protocol
|
||||
CAPAB_VHOST | 0x00200000 | VHOST | Supports VHOST protocol
|
||||
CAPAB_TOKEN | 0x00400000 | TOKEN | Supports s2s tokens
|
||||
CAPAB_SSJ3 | 0x00800000 | SSJ3 | Smart Join protocol 3 support
|
||||
CAPAB_NICK2 | 0x01000000 | NICK2 | Support for extended NICK (v2)
|
||||
CAPAB_UMODE2 | 0x02000000 | UMODE2 | Supports UMODE2 command
|
||||
CAPAB_VL | 0x04000000 | VL | VLine information in info field
|
||||
CAPAB_TLKEXT | 0x08000000 | TLKEXT | Not 8, but 10 params in TKL's
|
||||
CAPAB_CHANMODE | 0x10000000 | CHANMODE | Channel modes are passed here
|
||||
CAPAB_SJB64 | 0x20000000 | SJB64 | SJOIN timestamps are base64 encoded
|
||||
CAPAB_NICKCHARS | 0x40000000 | NICKCHARS | Character set used by the IRCD for nicks
|
||||
|
||||
|
||||
4) Modes
|
||||
|
||||
The next thing you should do is defining the user modes. You will want to
|
||||
have your .h file handy for this part.
|
||||
|
||||
unsigned long umodes[128] = { }
|
||||
|
||||
This array goes from 0 to 127 in the ASCII character set. Insert the user
|
||||
modes at the slot where the mode fits. If you are adding a the user mode
|
||||
of +i find the 105th (ASCII code of 'i') character slot in the array, and
|
||||
place the UMODE_i into this slot. Your base .c file should contain a good
|
||||
start for this, as well as a little help locating the characters.
|
||||
|
||||
The following mode set is for the channel symbols. During a SJOIN event
|
||||
the modes are sent usually before the nick. These normally are @, +, %
|
||||
etc.. depending on the ircd. Starting at ASCII 0 and running to 127.
|
||||
Replace the 0 with the character (o = @, h = %) for the given mode. In the
|
||||
case of halfop which is usually sent as % replace the 37th character with
|
||||
'h', do this until all modes that are possible be received in this manor
|
||||
have been inserted into the array.
|
||||
|
||||
Now that you have that complete, the following array is ready to be dealt
|
||||
with. This is the cmmodes array, like the others it is a ASCII array
|
||||
starting at 0 and going to 127. However at the given letter you will want
|
||||
to enter the add, and delete function for the given mode. In the case of
|
||||
bans (+b) there is add_ban, and del_ban. Anope provides functions for
|
||||
bans, exceptions and invites, should your ircd have more then these please
|
||||
contact Anope to discuss what can be done to add this mode.
|
||||
|
||||
5) Functions and Events
|
||||
|
||||
A brief word about functions and events. All events are captured using:
|
||||
|
||||
void moduleAddIRCDMsgs(void)
|
||||
{
|
||||
m = createMessage("NICK", anope_event_nick);
|
||||
addCoreMessage(IRCD,m);
|
||||
}
|
||||
|
||||
Each event should have a event handler if its important enough to be
|
||||
processed by services. All event functions should be formed like this:
|
||||
|
||||
int anope_event_capab(char *source, int ac, char **av)
|
||||
{
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
They will receive the source; this can be NULL at times depending on the
|
||||
event. Next, ac is the number of arguments that are in the event, and av
|
||||
holds the values for each; so av[0] is the first variable, av[1] will be
|
||||
the second one, and so on. Events are likely to pass to various upper
|
||||
level event handlers; see the previous ircd source for how they handle
|
||||
these events.
|
||||
|
||||
All commands are formed like this:
|
||||
|
||||
void anope_cmd_svsnoop(char *server, int set)
|
||||
{
|
||||
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
|
||||
}
|
||||
|
||||
They may take any number of arguments, depending on the command. They
|
||||
should eventually come to a send_cmd(); this root function is how
|
||||
commands are sent to the IRCd.
|
||||
|
||||
6) CAPAB/PROTOCTL
|
||||
|
||||
Most IRCD send a CAPAB or PROTOCTL line so that they can work out what
|
||||
the other end of the connection is capable of doing. Anope has a function
|
||||
to read these lines and set itself up to to handle these events better.
|
||||
When adding support for your ircd, take the following steps.
|
||||
|
||||
1) In the ircd.c find the function anope_cmd_capab(); this function will
|
||||
send the CAPAB/PROTOCTL line (consult your ircd documentation for
|
||||
which to send). In a single line type in the tokens that anope must
|
||||
send. Here is an example of Hybrid's capab line:
|
||||
|
||||
/* CAPAB */
|
||||
void anope_cmd_capab()
|
||||
{
|
||||
send_cmd(NULL, "CAPAB TS5 EX IE HOPS HUB AOPS");
|
||||
}
|
||||
|
||||
2) In the ircd.h file make sure to place the defines (see below) that
|
||||
match your IRCd's tokens; only use the ones that matter to your ircd.
|
||||
Should your IRCd add new features not covered in the defined, please
|
||||
contact the Anope Dev team before doing so. See README for information
|
||||
on how to contact the Anope team.
|
||||
|
||||
3) Ensure that the CAPAB/PROTOCTL event his handled correctly.
|
||||
|
||||
A) In the function "moduleAddIRCDMsgs" making sure that you have the
|
||||
following two lines:
|
||||
|
||||
m = createMessage("CAPAB", anope_event_capab);
|
||||
addCoreMessage(IRCD,m);
|
||||
|
||||
B) Add the function to handle the event
|
||||
|
||||
int anope_event_capab(char *source, int ac, char **av)
|
||||
{
|
||||
capab_parse(ac, av);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
This function should call the capab_parse function which parses
|
||||
the received CAPAB/PROTOCTL line.
|
||||
How To Add IRCd Support
|
||||
-----------------------
|
||||
|
||||
1) Files to Edit
|
||||
2) The Code
|
||||
3) The IRCDVar struct
|
||||
4) Modes
|
||||
5) Functions / Events
|
||||
6) CAPAB/PROTOCTL
|
||||
7) IRCDProto Class
|
||||
|
||||
1) Files to Edit
|
||||
|
||||
When preparing to add supprt to Anope for your IRCd, you need to edit
|
||||
the following files
|
||||
|
||||
A) Make a copy of the .cpp file of the IRCd that matches the IRCd that
|
||||
you are attempting to add support for best.
|
||||
B) Add your IRCd into the supported IRCds in example.conf
|
||||
|
||||
2) The Code
|
||||
|
||||
Here is where the code of the .cpp file comes in. Be prepared to spend at
|
||||
least an hour, if not longer, going over the code and getting it right;
|
||||
Especially if you are setting up an ircd that is completely different
|
||||
than the one you used as a base. This section covers the majority of the
|
||||
code that is in use.
|
||||
|
||||
The first bit of code you will face is the IRCDVar structure, This is one
|
||||
of two structs which holds your IRCd information; This allows you to quickly
|
||||
setup your specific ircd.
|
||||
|
||||
IRCDVar myIrcd[] = { };
|
||||
|
||||
This struct contains your basic IRCd functions. Your base source file has
|
||||
the list of all available variables; note that you should not swap any
|
||||
around, or you will break stuff. Here is a brief description of the usage
|
||||
of each.
|
||||
|
||||
1) Name: This member tells Anope about the IRCD's name. It may contain
|
||||
text about it's name and version. This is used to identify the
|
||||
build on startup.
|
||||
|
||||
2) Pseudo Client Mode: This is the user mode set by Anope on all BotServ
|
||||
bots. Normally you want this to be a some form of
|
||||
service or bot flag; you can use + for no mode at
|
||||
all.
|
||||
|
||||
3) Max Channelmode Symbols: This is the total number of possible channel
|
||||
modes that can appear before a nick. Do
|
||||
remember to count each possible mode, so +ov
|
||||
is 2.
|
||||
|
||||
4) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise,
|
||||
KILL is used. Use 1 for yes, 0 for no.
|
||||
|
||||
5) VHOST: Can a user's host be changed on the fly? Enabling this allow
|
||||
HostServ online. Use 1 for yes, 0 for no.
|
||||
|
||||
6) SNLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
7) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
|
||||
|
||||
8) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no.
|
||||
|
||||
10) Join to Message: Services must join a channel to send any message to
|
||||
that channel (cannot override +n). Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
11) SQline Channels: The IRCd's supports banning channel names via
|
||||
SQLINES. Use 1 for yes, 0 for no.
|
||||
|
||||
12) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a
|
||||
QUIT message for that user? Use 1 for yes, 0 for no.
|
||||
|
||||
13) SVSMODE UNBAN: We can use SVSMODE to unban hosts from a channel. Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
14) Reverse: We can do a reverse check when unbanning. For use with
|
||||
DreamForge based IRCd's. Use 1 for yes, 0 for no.
|
||||
|
||||
15) vIdent: Support for including a user's ident in their vHost. Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
16) SVSHOLD: Support for temporarily 'holding' a nick, instead of using
|
||||
a nick enforcer client. Use 1 for yes, 0 for no.
|
||||
|
||||
17) TS on MODE: We need to send a timestamp when modes are being changed.
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
18) Umode: We can use OperServ to change a user's mode. Use 1 for yes,
|
||||
0 for no.
|
||||
|
||||
19) OMODE: We can use OperServ to give some user a temporary O:LINE.
|
||||
Use 1 for yes, 0 for no.
|
||||
|
||||
20) No Knock Requires +i: Does the No Knock channel mode require invite
|
||||
only channels? Use 1 for yes, 0 for no.
|
||||
|
||||
21) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
|
||||
1 for yes, 0 for no.
|
||||
|
||||
22) SGline Enforce: Does the IRCd enforce SNLINES for us or do we need to
|
||||
do so? Use 1 for yes, 0 for no.
|
||||
|
||||
23) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
|
||||
|
||||
24) Global TLD Prefix: Prefix used to send global messages, should probably
|
||||
be "$"
|
||||
|
||||
25) Max Modes: The max number of mode changes we can send in one line
|
||||
|
||||
3) Modes
|
||||
|
||||
Anope is told about modes in the protocol module.
|
||||
For the most part, the syntax for adding channel and user modes are:
|
||||
|
||||
ModeManager::AddUserMode(new UserMode(UMODE_NETADMIN, "UMODE_NETADMIN", 'N'));
|
||||
Where 'N' is the char for the mode, and UMODE_NETADMIN shows what the
|
||||
mode does. Or:
|
||||
|
||||
ModeManager::AddChannelMode(new ChannelMode(CMODE_BLOCKCOLOR, "CMODE_BLOCKCOLOR", 'c'));
|
||||
Where 'c' is the char for the mode and CMODE_BLOCKCOLOR shows what
|
||||
the mode does
|
||||
|
||||
A full list of valid mode names for the second param can be found
|
||||
in services.h in the enum for ChannelModeName and UserModeName
|
||||
If necessary, you can add additional modes to this list.
|
||||
|
||||
Adding simple modes with parameters is similar, instead adding a
|
||||
'new ChannelMode', use 'new ChannelModeParam', set the third optional
|
||||
arg of ChannelModeParam to false if the param should NOT be sent when unsetting
|
||||
it. Eg:
|
||||
|
||||
ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, "CMODE_JOINFLOOD", 'j', true));
|
||||
|
||||
Anope will internally track the params, and they can be retrieved through
|
||||
Channel::GetParam();
|
||||
|
||||
If you want to make param validity checking for a mode, you must create a new
|
||||
class which inherits from ChannelModeParam and overload the IsValid function.
|
||||
Modes CMODE_OPERONLY, CMODE_ADMINONLY, and CMODE_REGISTERED already exist
|
||||
internally as classes, to overload the CanSet function to disable non opers
|
||||
from mlocking (or in CMODE_REGISTERED's case, anyone) from setting them.
|
||||
This should be added like:
|
||||
|
||||
ModeManager::AddChannelMode(new ChannelModeOper('O'));
|
||||
|
||||
4) Functions and Events
|
||||
|
||||
A brief word about functions and events. All events are captured by creating a Message struct
|
||||
with the name of the message and the callback function:
|
||||
|
||||
Message my_message("MESSAGE", do_my_messsage);
|
||||
|
||||
Each message should have a message handler if its important enough to be
|
||||
processed by services. All event functions should be formed like this:
|
||||
|
||||
bool do_my_message(const Anope::string &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
They will receive the source; this can be empty at times depending on the
|
||||
event. Next, params holds the arguments for the event. Events are likely to
|
||||
pass to various upper level event handlers; see the previous ircd source for
|
||||
how they handle these events.
|
||||
|
||||
5) CAPAB/PROTOCTL
|
||||
|
||||
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:
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
Define | Description
|
||||
----------------|---------------------------------------------------------
|
||||
CAPAB_NOQUIT | NOQUIT protocol support
|
||||
CAPAB_TSMODE | Chanmodes are timestamped
|
||||
CAPAB_UNCONNECT | UNCONNECT protocol support
|
||||
CAPAB_QS | Quitstorm - same as NOQUIT
|
||||
|
||||
You can override the default OnCapab method in IRCdMessage if required.
|
||||
|
||||
6) IRCDProto Class
|
||||
|
||||
The IRCDProto class is set up like:
|
||||
|
||||
class MyIRCdProto : public IRCDProto { } ircdproto;
|
||||
|
||||
And told to Anope through the
|
||||
|
||||
pmodule_ircd_proto(&ircd_proto);
|
||||
|
||||
function.
|
||||
|
||||
This is used for sending out specific messages from Anope to your IRCd.
|
||||
A list of all of the valid function names to overload and their args
|
||||
are in services.h. If the protocol module you are editing is similar enough
|
||||
to the IRCd you are adding support for, many of these probably won't need to
|
||||
be changed.
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
Anope Mutli Language Support
|
||||
----------------------------
|
||||
|
||||
1) Building Anope with gettext support
|
||||
2) Adding a new language
|
||||
3) Using languages with modules
|
||||
|
||||
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.
|
||||
|
||||
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
||||
|
||||
2) Adding a new language
|
||||
|
||||
Anope uses gettext (http://www.gnu.org/software/gettext/) to translate messages for users. To add a new language
|
||||
install gettext and run `msginit -l language -o anope.language.po -i anope.pot`. For example if I was translating to
|
||||
Spanish I could run `msginit -l es_ES -o anope.es_ES.po -i anope.pot`. Open the newly generating .po file and start
|
||||
translating. Once you are done simply rerun ./Config; make && make install and add the language to your services.conf.
|
||||
Note that on Windows it is not quite this simple, windows.cpp must be edited and Anope recompiled and restarted.
|
||||
|
||||
Poedit (http://www.poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
|
||||
po files (especially on Windows).
|
||||
|
||||
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.
|
||||
-109
@@ -1,109 +0,0 @@
|
||||
Anope MySQL Support
|
||||
-------------------
|
||||
|
||||
1) Introduction
|
||||
|
||||
Anope 1.6 onwards supports MySQL databases. On Anope 1.6.0 only PHASE 1
|
||||
has been implemented. Since the next phases require major changes in the
|
||||
core, we decided to save it for 2.0. However, having your db's easily
|
||||
accessible on your website is still a great feature.
|
||||
|
||||
PHASE 1:Anope will be able to save all it's databases to MySQL. It will
|
||||
happen in conjunction with the current FFF databases. This first step is
|
||||
nothing more than a MySQL dump of the databases (i.e. read-only), since
|
||||
Anope will not (for now) read from Mysql. (COMPLETED)
|
||||
|
||||
PHASE 2:The next step is load the databases from MySQL, being able to
|
||||
replace the FFF completely as an archive method (since all changes to
|
||||
the MySQL db would be lost on the next Services save). All, while keeping
|
||||
FFF intact. This is still not the final goal, but it's a milestone.
|
||||
(COMPLETED)
|
||||
|
||||
UPDATE: Anope 1.7.0 (Revision 11 and above) finally supports phase 2!
|
||||
A new config directive called 'UseRDB' has been added.
|
||||
If you enable this, anope will automatically try to load its
|
||||
data from MySQL (if configured and compiled with).
|
||||
|
||||
PHASE 3:The next step, and most convoluted of all (since we'll need to
|
||||
modify pretty much all the source) is to load/save (SELECT/INSERT) data
|
||||
in realtime. That way the MySQL db could be modified externally (web?).
|
||||
Again, the FFF will be kept intact.
|
||||
|
||||
2) Requirements
|
||||
|
||||
1. MySQL server version 3.23.32 or greater
|
||||
2. MySQL libs and development files (usually called mysql-dev).
|
||||
3. A MySQL user account
|
||||
4. A MySQL database
|
||||
|
||||
3) Installation
|
||||
|
||||
1. The ./Config script automatically detects if your system is capable
|
||||
of running Anope with MySQL support. There is no need anymore to
|
||||
answer yes when asked.
|
||||
|
||||
Note: You might need to run "make distclean" prior to running ./Config
|
||||
|
||||
2. Compile Anope as usual. The (g)make process will now compile MySQL
|
||||
support into Anope.
|
||||
|
||||
3. Install Anope as usual.
|
||||
|
||||
4) Configuration
|
||||
|
||||
1. Go to your "services bin directory" (eg: /home/someuser/services/) and run mydbgen
|
||||
to help on the schema creation and adjustments.
|
||||
|
||||
2. Edit services.conf and add your MySQL data to the MySQL configuration
|
||||
block.
|
||||
|
||||
3. Start or restart services to make use of the new Anope executable.
|
||||
|
||||
5) Security
|
||||
|
||||
To add a layer of security you have the option of encrypting or encoding
|
||||
all passwords for nicks and chans. Use the "MysqlSecure" directive on your
|
||||
services.conf file to enable it. The available storage methods are:
|
||||
|
||||
#MysqlSecure ""
|
||||
|
||||
or
|
||||
|
||||
MysqlSecure ""
|
||||
|
||||
Disables security. All passwords will be saved on the MySQL database
|
||||
as clear text, with no encryption or encoding. FASTEST
|
||||
|
||||
MysqlSecure "des"
|
||||
|
||||
Encrypts all passwords using a UNIX DES encryption. This is a one way
|
||||
encryption algorithm. You can only validate it against another DES
|
||||
encrypted string, using the same "salt" (the first two characters of
|
||||
the encrypted string). FAST
|
||||
|
||||
MysqlSecure "md5"
|
||||
|
||||
Calculates an MD5 128-bit checksum for the password. The value is
|
||||
returned as a 32-digit hex number that may be used as a hash key.
|
||||
This is a one way encryption algorithm. SLOW
|
||||
|
||||
MysqlSecure "sha"
|
||||
|
||||
Calculates an SHA 160-bit checksum for the password. The value is
|
||||
returned as a 40-digit hex number. This is a one way encryption
|
||||
algorithm. SLOWEST
|
||||
|
||||
MysqlSecure "mykey"
|
||||
|
||||
Encodes the passwords using "mykey" as the encryption password. It
|
||||
produces a binary string and can be decoded using the MySQL built in
|
||||
function DECODE(crypt_str,mykey). VARIABLE
|
||||
|
||||
Caveat: Keep in mind that this if you use any method other than clear
|
||||
text, services will need to encrypt/encode every single password on
|
||||
every database save. On large networks, it may impact responsiveness
|
||||
during the saves.
|
||||
|
||||
Caveat: If you enable MysqlSecure you can not longer use the UseRDB directive
|
||||
as all the password types are encrypted with a one way encryption method for
|
||||
older MySQL servers.
|
||||
@@ -1,139 +1,7 @@
|
||||
Highlighted News in Anope 1.7 (and soon 1.8)
|
||||
============================================
|
||||
* Added a new and improved ./Config script.
|
||||
* Added MySQL phase 2 implementation (see docs/MYSQL).
|
||||
* Added NickServ registration delays.
|
||||
* Added read receipts for memos.
|
||||
* Added a way for modules to store data with internal structures.
|
||||
* Added nick tracking support.
|
||||
* Added support for SVSHOLD.
|
||||
* Added support for U:Lined servers.
|
||||
* Added support for TS6 IRCd's.
|
||||
* Added support for Windows.
|
||||
* Added internal events for modules.
|
||||
* Added a way to suspend nicks.
|
||||
* Added support for module configuration directives.
|
||||
* Added translation support for modules.
|
||||
* Added a module pack with handy modules.
|
||||
* Added IRCd protocol modules.
|
||||
* Added support for new IRCd's. Currently supported:
|
||||
- Bahamut 1.4.27 or later (including 1.8)
|
||||
- Charybdis 1.0 or later
|
||||
- DreamForge 4.6.7
|
||||
- Hybrid 7 or later
|
||||
- InspIRCd 1.0 or later (including 1.1)
|
||||
- Plexus 2.0 or later (including 3.0)
|
||||
- PTLink 6.15 or later
|
||||
- RageIRCd 2.0 or later
|
||||
- Ratbox 2.0.6 or later
|
||||
- ShadowIRCd 4.0 beta 7 or later
|
||||
- Solid IRCd 3.4.6 or later
|
||||
- UltimateIRCd 2.8.2 or later (including 3.0)
|
||||
- UnrealIRCd 3.1.1 or later (including 3.2)
|
||||
- ViagraIRCd 1.3 or later
|
||||
* Added new languages. Currently included:
|
||||
Catalan, German, English, Spanish, French, Greek,
|
||||
Hungarian, Italian, Dutch, Polish, Portugese,
|
||||
Russian, Turkish
|
||||
* Added support for CIDR channel lists.
|
||||
* Converted the core to be completely modular.
|
||||
* Improved random number algorithm.
|
||||
* Removed proxy detector (see docs/PROXY).
|
||||
* Fixed various exploits and vulnerabilities.
|
||||
* Fixed various language typos and inconsistencies.
|
||||
* Fixed a bug in the database system causing nickserv passwords
|
||||
to be saved incorrectly. Note that this breaks backwards
|
||||
compatibility on nick.db !!!
|
||||
|
||||
Highlighted News in Anope 1.6
|
||||
=============================
|
||||
* Fixed various exploits and vulnerabilities.
|
||||
* Fixed various language typos and inconsistencies.
|
||||
* Improved ignore system.
|
||||
* Improved ./configure script.
|
||||
* Removed all compile warning fixed.
|
||||
* Converted HelpServ into a proper service.
|
||||
* Added external module support.
|
||||
* Added Defense Condition (DEFCON) System.
|
||||
* Added MySQL support for mirroring databases.
|
||||
* Added multi-server configuration.
|
||||
* Added multi-domain /OS GLOBAL support.
|
||||
* Added combined +oq +oa +ha +va on net-joins.
|
||||
* Added support for ircd changes and upgrades.
|
||||
* Added HostSetters configuration directive.
|
||||
* Added /OS STAFF command.
|
||||
* Added /OS SVSNICK command.
|
||||
* Added /OS CHANKILL command.
|
||||
* Added /MS STAFF command.
|
||||
* Added /NS UPDATE command.
|
||||
* Added /MS SENDALL command.
|
||||
* Added /NS GETMAIL command.
|
||||
* Added /HS DELALL command.
|
||||
* Added /HS LIST command with pattern matching.
|
||||
* New support scripts and tools.
|
||||
* New ircd support, complete list: DreamForge 4.6.7, Bahamut 1.4.27,
|
||||
UnrealIRCd 3.1.1, UltimateIRCd 2.8.2,
|
||||
UltimateIRCd 3.0.0, Hybrid IRCd 7.0
|
||||
ViagraIRCd 1.3.x, PTlink 6.15.0
|
||||
* New Language files, complete list: cat.l, de.l, en_us.l, es.l, fr.l,
|
||||
gr.l, it.l, nl.l, pt.l, ru.l, tr.l
|
||||
|
||||
Highlighted News in Anope 1.4
|
||||
Highlighted News in Anope 1.9
|
||||
=============================
|
||||
|
||||
After the change from Epona to Anope
|
||||
------------------------------------
|
||||
* New Italian Language file
|
||||
* Added support for UltimateIRCd 3.0 and later
|
||||
* Services realtime logging to a channel
|
||||
* SuperAdmin directive for access to "super" commands.
|
||||
* Ban system is now exception aware.
|
||||
* HostServ for hostname masquerading.
|
||||
* Smarter XOP System.
|
||||
* Email verification/handshake upon registration.
|
||||
* Services can now /ignore users.
|
||||
* Smarter memo notification for channels.
|
||||
* Channel can be SUSPENDed instead of FORBIDen.
|
||||
|
||||
Before the change from Epona to Anope
|
||||
-------------------------------------
|
||||
* HostServ for networks that support them.
|
||||
* UnrealIRCd support has been rewritten, it is now fully
|
||||
working (hopefully) and officially supported again.
|
||||
* Added support for UltimateIRCd 2.8.2 and later.
|
||||
* A multi-threaded proxy detector that can scan Wingates,
|
||||
SOCKS 4/5 and HTTP proxies on ports 3128 and 8080. Don't use
|
||||
it if you have not been authorized to use it by your system
|
||||
administrator!
|
||||
* The ChanServ AOP/SOP/VOP commands, and, on networks that
|
||||
support halfops, the HOP command, have been added. They
|
||||
allow a more user-friendly control of channel privileges.
|
||||
* Use of services IDs that allow an user to be automatically
|
||||
identified after a split (if he was identified before the split)
|
||||
in a secure way. This also saves lots of bandwidth.
|
||||
* Services' default language can now be set in services.conf.
|
||||
* The OperServ RANDOMNEWS command provides an easy way to show
|
||||
network news in a random manner without flooding your users
|
||||
with them (one news per connection).
|
||||
* The BotServ SET PRIVATE option allows services admins to
|
||||
make the bot usable by IRC operators only.
|
||||
* The OperServ SQLINE command allows you to forbid nick masks
|
||||
and even channel masks with the latest Bahamut.
|
||||
* The ChanServ AKICK STICK command allows akicks to be permanently
|
||||
kept on channel.
|
||||
* The ChanServ SET TOPIC command has been renamed to TOPIC, and
|
||||
a new BAN command has been added. They both have their own
|
||||
associated levels.
|
||||
* A SET PEACE command has been added to ChanServ. It prevents
|
||||
users to use pejorative services commands (DEOP, KICK, ...)
|
||||
on users with greater or equal levels.
|
||||
|
||||
Networks using Bahamut must upgrade to Bahamut 1.4.27 or later,
|
||||
while networks using UnrealIRCd must upgrade to Unreal 3.1.1.
|
||||
|
||||
For the full changes, see the Changes file.
|
||||
|
||||
For announcements and discussions about Anope, please visit our
|
||||
web site http://www.anope.org
|
||||
|
||||
* Added in live updating SQL and the ability to execute commands through SQL
|
||||
* Re-designed configuration file
|
||||
* Code refresh / rewrite into C++
|
||||
|
||||
|
||||
-2509
File diff suppressed because it is too large
Load Diff
-41
@@ -1,41 +0,0 @@
|
||||
Anope Proxy Detector
|
||||
--------------------
|
||||
|
||||
1) Introduction
|
||||
2) Alternatives
|
||||
|
||||
1) Introduction
|
||||
|
||||
Anope has had a built-in proxy detector since it's first version. Recently,
|
||||
however, this built-in proxy detector has been removed. This was because
|
||||
the Anope team found that the proxy detector was showing it's age, and the
|
||||
time needed to restore it to a good state wasn't worth it, also considering
|
||||
that there are currently good alternatives out there which do the job as
|
||||
good as it can be done already.
|
||||
|
||||
2) Alternatives
|
||||
|
||||
A) Blitzed Open Proxy Monitor (BOPM)
|
||||
B) NeoStats + OPSB
|
||||
|
||||
Note that these are seperate projects and that the Anope team won't give
|
||||
support on these programs. For support, please refer to the sites of the
|
||||
creators of the software packages.
|
||||
|
||||
A) Blitzed Open Proxy Monitor (BOPM)
|
||||
|
||||
URL: http://wiki.blitzed.org/BOPM
|
||||
|
||||
BOPM is currently the leading proxy detector for IRC networks out
|
||||
there. Altough it is not designed to run on a central place for the
|
||||
entire network, it can be done with some minor tweaking on most IRCd's.
|
||||
The Anope Team advises BOPM for the best security.
|
||||
|
||||
B) NeoStats + OPSB
|
||||
|
||||
URL: http://www.neostats.net/
|
||||
|
||||
NeoStats is the swiss knife of IRC tools. In combination with the OPSB
|
||||
module by NeoStats Software, it can scan for proxies in a similar way
|
||||
as BOPM does. The OPSB module is based on BOPM and has been adjusted to
|
||||
be able to scan all clients from one centralized proxy detector.
|
||||
+284
-377
@@ -1,377 +1,284 @@
|
||||
Anope -- a set of IRC services for IRC networks
|
||||
-----------------------------------------------
|
||||
|
||||
Anope is 2003-2008 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>
|
||||
* 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>
|
||||
* 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.
|
||||
|
||||
* HelpServ, a skeleton service used to serve help files.
|
||||
|
||||
Anope currently works with:
|
||||
|
||||
* Bahamut 1.4.27 or later (including 1.8)
|
||||
* Charybdis 1.0 or later
|
||||
* DreamForge 4.6.7
|
||||
* Hybrid 7 or later
|
||||
* InspIRCd 1.0 or later (including 1.1)
|
||||
* Plexus 2.0 or later (including 3.0)
|
||||
* PTlink 6.15 or later
|
||||
* RageIRCd 2.0 beta-6 or later
|
||||
* Ratbox 2.0.6 or later
|
||||
* ShadowIRCd 4.0 beta 7 or later
|
||||
* Solid IRCd 3.4.6 or later
|
||||
* UltimateIRCd 2.8.2 or later (including 3.0)
|
||||
* UnrealIRCd 3.1.1 or later (including 3.2)
|
||||
* ViagraIRCd 1.3 or later
|
||||
|
||||
Anope could also work with some of the daemons derived by the ones listed
|
||||
above, but there's no support for them if they work or don't work.
|
||||
|
||||
|
||||
3) Installation
|
||||
|
||||
See the INSTALL file for instruction on installing Anope.
|
||||
|
||||
|
||||
4) Command Line Options
|
||||
|
||||
Normally, Anope can be run simply by invoking the "services" executable.
|
||||
Anope will then use the defaults specified in the services.conf file, and
|
||||
connect to the specified uplink server. Alternatively, any of the
|
||||
following command-line options can be specified to change the default
|
||||
values:
|
||||
|
||||
-remote server[:port] Connect to the specified server
|
||||
-local host -or- Connect from the specified address (e.g. for
|
||||
[host]:[port] multihomed servers)
|
||||
-name servername Our server name (e.g. services.some.net)
|
||||
-desc string Description of us (e.g. SomeNet Services)
|
||||
-user username Username for Services' nicks (e.g. services)
|
||||
-host hostname Hostname for Services' nicks (e.g. esper.net)
|
||||
-dir directory Directory containing Services' data files
|
||||
(e.g. /usr/local/lib/services)
|
||||
-log filename Services log filename (e.g. services.log)
|
||||
-update secs How often to update databases (in seconds)
|
||||
-expire secs How often to check for nick/channel
|
||||
expiration (in seconds)
|
||||
|
||||
Additionally, the following command-line options can be used to modify
|
||||
the behavior of Anope:
|
||||
|
||||
-debug Enable debugging mode; more info sent to log (give
|
||||
option more times for more info)
|
||||
-readonly Enable read-only mode; no changes to databases
|
||||
allowed, .db files and log not written
|
||||
-skeleton Enable skeleton mode; like read-only mode, but only
|
||||
OperServ is available
|
||||
-nofork Do not fork after startup; log messages will be
|
||||
written to terminal (as well as to the log file
|
||||
if not in read-only mode)
|
||||
-forceload Try to load as much of the databases as possible,
|
||||
even if errors are encountered
|
||||
-noexpire Expiration routines won't be run at all
|
||||
-logchan Startup with logchan enabled
|
||||
-version Display the version of Anope
|
||||
-nothird Do not load the modules specified in ModulesAutoload
|
||||
or ModulesDelayedAutoload in the config file
|
||||
-protocoldebug Debug each incoming message after protocol parsing
|
||||
-support Used for support, same as -debug -nofork -nothird
|
||||
|
||||
Upon starting, Anope will parse its command-line parameters, open its
|
||||
logfile, then (assuming the -nofork option is not given) detach itself
|
||||
and run in the background. If Anope encounters a problem reading the
|
||||
database files or cannot connect to its uplink server, it will terminate
|
||||
immediately; otherwise, it will run until the connection is terminated
|
||||
(or a QUIT, SHUTDOWN, or RESTART command is sent; see OperServ's help).
|
||||
In the case of an error, an appropriate error message will be written to
|
||||
the log file.
|
||||
|
||||
If Anope is run with the "-readonly" command-line option, it can serve as
|
||||
a "backup" to the full version of services. A "full" version of services
|
||||
(run without -readonly) will automatically reintroduce its pseudo-clients
|
||||
(NickServ, ChanServ, etc.), while a "backup" services will not, thus
|
||||
allowing full services to be brought up at any time without disrupting
|
||||
the network (and without having to take backup services down beforehand).
|
||||
|
||||
If Anope is run with the "-skeleton" command-line option, it will not try
|
||||
to load the nickname or channel databases, and will respond with "service
|
||||
is inactive" messages to any commands sent to NickServ, ChanServ,
|
||||
MemoServ or BotServ. This can be useful as an emergency stopgap measure
|
||||
when the main copy of Anope cannot be started.
|
||||
|
||||
The "-debug" option is useful if you find or suspect a problem in Anope.
|
||||
Giving it once on the command line will cause all traffic to and from
|
||||
services as well as some other debugging information to be recorded in
|
||||
the log file; if you send a bug report, PLEASE include an excerpt from
|
||||
the log file WITH DEBUGGING ACTIVE; we cannot emphasize enough how
|
||||
important this is to tracking down problems. (You can also enable
|
||||
debugging while Services is running using OperServ's SET DEBUG command.)
|
||||
If you repeat the -debug option more than once, the debugging level will
|
||||
be increased, which provides more detailed information but may also slow
|
||||
Anope down considerably and make the log file grow dramatically faster
|
||||
(in particular, at debug level 4 a message is written to the log for
|
||||
every character received from the server). In general, a debug level of 1
|
||||
is sufficient for the coding team to be able to trace a problem, because
|
||||
all network traffic is included and we can usually reproduce the problem.
|
||||
|
||||
The "-forceload" option is provided to attempt recovery of data from
|
||||
corrupted or truncated databases. Normally, if Anope encounters an error
|
||||
writing to a database file, it will attempt to restore the original
|
||||
version of the file and report an error to the logfile and through
|
||||
WALLOPS. However, if this should fail (which normally should not happen),
|
||||
or if Anope is terminated abruptly e.g. by kill -9 or a power failure,
|
||||
then one or more of the databases may be corrupt. Normally, this will
|
||||
cause Anope to abort the next time you try to run it; however, if yo
|
||||
give the -forceload option to Anope, it will instead read as much as it
|
||||
can, then skip to the next database. For obvious reasons, it's highly
|
||||
recommended to keep backup copies of your databases in case something
|
||||
does happen (since Anope will stop at the first error in a database, even
|
||||
with -forceload, meaning you lose any data after that).
|
||||
|
||||
5) Messages Translations
|
||||
|
||||
Anope has a powerful option in NickServ allowing users to choose what
|
||||
language it must use when sending messages to users. Messages are stored
|
||||
in language files (located in the lang directory).
|
||||
|
||||
Anope is currently provided with thirteen languages: Catalan, Dutch,
|
||||
English, French, German, Greek, Hungarian, Italian, Polish, Portuguese,
|
||||
Russian, Spanish and Turkish. If you want to translate Anope messages
|
||||
into another language, follow this instructions:
|
||||
|
||||
* Copy the lang/en_us.l file to a meaningful name (for example, if
|
||||
you would like to translate messages in Spanish, you would rename
|
||||
it to es.l).
|
||||
|
||||
* Edit the file with your favorite text editor. Carefully read the
|
||||
instructions given at the top of the file, and start translating
|
||||
the whole file. The file is big, so make sure you have some coffee
|
||||
available ;) Try to avoid the use of English words as much as
|
||||
possible. If the new language contains only a few 'special'
|
||||
characters, try and use latin representations of it, if possible.
|
||||
Remember that most clients are only capable of handling the
|
||||
ISO-8859-1 charset. Of course, if you are translating Anope to a
|
||||
language with a totally different charset, such as Russian, feel
|
||||
free to use the one that suites it best (and the one that is in use
|
||||
by most speakers of that language ;)).
|
||||
|
||||
* When this is done, you have two solutions: either patch Services
|
||||
source code so they take in account the new language file
|
||||
(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-2011 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:
|
||||
|
||||
* GeniusDex <geniusdex@anope.org> (nl.l)
|
||||
* Kein <kein-of@yandex.ru> (ru.l)
|
||||
* Maik Funke <Han@mefalcon.org> (de.l)
|
||||
* Gabriel Acevedo H. <drstein@anope.org> (es.l)
|
||||
* Janos Kapitany <sarkanyka@cjbchat.hu> (hun.l)
|
||||
* Szymon S'wierkosz <szymek@adres.pl> (pl.l)
|
||||
* Christopher N. <saka@epiknet.org> (fr.l)
|
||||
* Yusuf Kurekci <ysfm.20@gmail.com> (tr.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.
|
||||
|
||||
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
|
||||
* Plexus 3 or later
|
||||
|
||||
Anope could also work with some of the daemons derived by the ones listed
|
||||
above, but there's no support for them if they work or don't work.
|
||||
|
||||
|
||||
3) Installation
|
||||
|
||||
See the INSTALL file for instruction on installing Anope.
|
||||
|
||||
|
||||
4) Command Line Options
|
||||
|
||||
Normally, Anope can be run simply by invoking the "services" executable.
|
||||
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. :)
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
Legend:
|
||||
x = done
|
||||
? = unsure
|
||||
+ = in progress
|
||||
|
||||
1.9.4
|
||||
-----
|
||||
[x] MS IGNORE. Make it take nick (accounts) or n!u@h masks. Fake success of memo send still, but send to opers?
|
||||
[x] Allow users to delete their own access
|
||||
[x] ChanServ CLONE command
|
||||
[x] XMLRPC to execute commands and get data from Anope
|
||||
[+] fantasy: allow replies/notifications to fantasy commands to go to the channel via notice
|
||||
[x] Method to store listmodes (more generically than AKICK, too) for e.g. +beI and extbans, etc.
|
||||
[ ] understanding extbans for /cs unban etc.
|
||||
[ ] (optional?) A way to confirm email changes by users
|
||||
[ ] Auto identify through SSL key
|
||||
[ ] Optional os_login system that can also use SSL keys.
|
||||
[ ] os_info module to show useful configuration settings to services opers.
|
||||
[ ] Remove nick requests. Instead use an unconfirmed nick group which cant recieve umode +r and auto expires after 1d?
|
||||
[ ] LDAP
|
||||
|
||||
Future
|
||||
------
|
||||
[ ] 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)
|
||||
[ ] 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?)
|
||||
[?] a way for a module to queue itself (or even another module) for unloading
|
||||
[ ] Useful/common "third party" modules to core distro
|
||||
[ ] NS AJOIN
|
||||
[x] 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?)
|
||||
[x] 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)
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
Anope Bundled Tools
|
||||
-------------------
|
||||
|
||||
1) Anope SMTP Client
|
||||
|
||||
Provided with Anope is a simple SMTP client which can be used instead of
|
||||
programs like SendMail in some cases.
|
||||
|
||||
The SMTP client can be used instead of sendmail for use with Anope's mail
|
||||
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 "bin/anopesmtp" and the IP address of a valid SMTP server. It
|
||||
should look like this:
|
||||
|
||||
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
|
||||
to connect to the SMTP server.
|
||||
|
||||
Credits:
|
||||
Originally written by Dominick Meglio <codemastr@unrealircd.com>
|
||||
Ported to *nix by Trystan Scott Lee <trystan@nomadirc.net>
|
||||
|
||||
+23
-54
@@ -25,28 +25,20 @@ Anope for Windows
|
||||
|
||||
(NOTE: When installing, tell CMake to add itself to the PATH.)
|
||||
|
||||
If you have Visual C++ 6, 7 (.NET 2002/2003), 8 (2005), or 9 (2008) skip ahead to step 2, else you
|
||||
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.
|
||||
|
||||
* Microsoft Visual C++ 2008 Express Edition:
|
||||
* Microsoft Visual C++ 2010 Express Edition:
|
||||
http://www.microsoft.com/express/vc/
|
||||
|
||||
or
|
||||
|
||||
* Microsoft Visual C++ 2005 Express Edition:
|
||||
http://www.microsoft.com/downloads/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&displaylang=en
|
||||
|
||||
then download and install:
|
||||
|
||||
* Microsoft Windows 2008 SDK:
|
||||
http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en
|
||||
|
||||
or (if you prefer a smaller download)
|
||||
|
||||
* Microsoft Windows 2003 Platform SDK: (Requires WGA validation)
|
||||
http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en
|
||||
|
||||
(NOTE: Although they say for Windows Server 2003 or 2008, they do infact work on all supported
|
||||
versions of Windows. When installing the 2003 SDK, you should select the Custom option, and only select
|
||||
to have the Microsoft Windows Core SDK installed. When installing the 2008 SDK, you should select the
|
||||
@@ -54,10 +46,6 @@ Anope for Windows
|
||||
the Visual C++ Compilers as well as the Mobile Tools. Doing this will decrease the install time as well
|
||||
as the space used by the SDK.)
|
||||
|
||||
If you chose to download the 2003 SDK, it will not work out-of-the-box on either Visual C++ 2005 Express or
|
||||
Visual C++ 2008 Express. The 2008 SDK will work out-of-the-box with Visual C++ 2008 Express but not with
|
||||
Visual C++ 2005 Express.
|
||||
|
||||
2) Unpack the Anope tarball with your favorite uncompression program
|
||||
(WinZip or WinRAR, etc).
|
||||
|
||||
@@ -84,7 +72,7 @@ Anope for Windows
|
||||
|
||||
4) You now need to configure Anope to your requirements. At the prompt type:
|
||||
|
||||
<path to source directory>\Config.bat
|
||||
<path to source directory>\Config.exe
|
||||
|
||||
NOTE: If you run an Anti-Virus program such as McAfee or Norton, you may
|
||||
be unable to run this command due to the protection in place. Some Anti-
|
||||
@@ -103,6 +91,23 @@ Anope for Windows
|
||||
If you cannot find whats causing the error, please visit our forums or
|
||||
our IRC Support channel for assistance.
|
||||
|
||||
Some Anope modules require third party libraries, such as m_mysql and
|
||||
m_ssl. If these libraries are installed in nonstandard locations, cmake
|
||||
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.
|
||||
|
||||
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, 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.
|
||||
|
||||
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
|
||||
at the prompt type:
|
||||
|
||||
@@ -146,22 +151,10 @@ Anope for Windows
|
||||
edit the file correctly.
|
||||
|
||||
Open services.conf, and read through it carefully and adjust the settings
|
||||
you think you need to adjust. Pay special attention to these settings:
|
||||
|
||||
A) IRCDModule: This is the name of an IRCd Module that Anope will use
|
||||
to communicate with your server. Anope supports 15 IRCds,
|
||||
so ensure you set the right value here.
|
||||
B) RemoteServer: This is the address to your ircd, along with the port
|
||||
and password. You should consult your ircd
|
||||
documentation on how to link ircds.
|
||||
C) ServicesRoot: Remove the # and change the names to your nick so you
|
||||
can take control of services once they are online.
|
||||
D) UserKey1/2/3: Remove the # infront of the three UserKey settings, and
|
||||
change the parameters to numbers; around 6-7 digits will
|
||||
do.
|
||||
you think you need to adjust.
|
||||
|
||||
If you are unsure of the settings, you can go to the dos command prompt
|
||||
and run "anope.exe -nofork -debug" and watch the information as it
|
||||
and run "anope.exe --nofork --debug" and watch the information as it
|
||||
attempts to connect.
|
||||
|
||||
You can launch services in two ways. If you are sure that the entered
|
||||
@@ -174,31 +167,7 @@ Anope for Windows
|
||||
3) Compiling Modules
|
||||
|
||||
If you want to build other modules than the ones shipped by default, you
|
||||
will need to modify the Makefile.inc.win32 file, in the src\modules folder.
|
||||
|
||||
A) Add modules; find the line stating "SRCS=" and add the name of the
|
||||
file to the end of the line. So if you have two files:
|
||||
|
||||
SRCS=file.c file2.c
|
||||
|
||||
If you are compiling a folder of module components, such as the example
|
||||
"catserv", you will need to add/change the "SUBS=" line. If you were
|
||||
compiling the "catserv" example, the line would look like this:
|
||||
|
||||
SUBS=catserv
|
||||
|
||||
B) When you've done this, use the same command prompt you set up in part
|
||||
1, change directories to the src\modules folder, and type:
|
||||
|
||||
nmake -f Makefile.win32
|
||||
|
||||
followed afterwards, by:
|
||||
|
||||
nmake -f Makefile.win32 install
|
||||
|
||||
C) You should now be able to load your modules on IRC via OperServ, or via
|
||||
the services.conf file.
|
||||
|
||||
will need to rerun Config.exe
|
||||
|
||||
4) Other compile options
|
||||
|
||||
|
||||
@@ -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_mysql, 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 onlive. 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,101 @@
|
||||
<?php
|
||||
/* XMLRPC Functions
|
||||
*
|
||||
* (C) 2003-2011 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
*/
|
||||
|
||||
class AnopeXMLRPC
|
||||
{
|
||||
private $Host, $Bind, $Port;
|
||||
|
||||
private $Socket;
|
||||
|
||||
function __construct($Host, $Port, $Bind = NULL)
|
||||
{
|
||||
$this->Host = $Host;
|
||||
$this->Port = $Port;
|
||||
$this->Bind = $Bind;
|
||||
|
||||
$this->Socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
if ($Bind && socket_bind($this->Socket, $this->Bind) == false)
|
||||
$his->Socket = false;
|
||||
if (socket_connect($this->Socket, $this->Host, $this->Port) == false)
|
||||
$this->Socket = false;
|
||||
}
|
||||
|
||||
function __destruct()
|
||||
{
|
||||
@socket_close($this->Socket);
|
||||
}
|
||||
|
||||
/** 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);
|
||||
socket_write($this->Socket, $xmlquery);
|
||||
|
||||
$inbuf = socket_read($this->Socket, 4096);
|
||||
$inbuf = substr($inbuf, strpos($inbuf, "\r\n\r\n") + 4);
|
||||
$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));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+44
-27
@@ -1,30 +1,47 @@
|
||||
# If we are building for Visual Studio OR if the system we are on doesn't have sh (which would be odd on a *nix system...), we'll build a C++ program to create version.h
|
||||
if(MSVC OR NOT SH)
|
||||
# Set version.sh.c to use C++ as well as set it's compile flags
|
||||
set_source_files_properties(version.sh.c PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
|
||||
# Generate version_sh executable to create version.h from the contents of version.sh, setting it's linker flags as well
|
||||
add_executable(version_sh version.sh.c)
|
||||
set_target_properties(version_sh PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
|
||||
# Generate version.h from the above executable and the version.log file from the main source directory, with dependencies to the given headers and all source files in the main Anope build
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
COMMAND version_sh ${Anope_SOURCE_DIR}/version.log ${CMAKE_CURRENT_SOURCE_DIR}/version.sh ${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/version.sh DEPENDS version_sh ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${CMAKE_CURRENT_SOURCE_DIR}/pseudo.h ${CMAKE_CURRENT_SOURCE_DIR}/messages.h ${SRC_SRCS}
|
||||
)
|
||||
# Add version_sh to list of files for CPack to ignore
|
||||
get_target_property(version_sh_BINARY version_sh LOCATION)
|
||||
get_filename_component(version_sh_BINARY ${version_sh_BINARY} NAME)
|
||||
add_to_cpack_ignored_files("${version_sh_BINARY}$" TRUE)
|
||||
# For any non-Visual Studio platforms that do have sh, we will run version.h through the version.h shell script
|
||||
else(MSVC OR NOT SH)
|
||||
# Generate version.h from version.sh and the version.log file from the main source directory, with dependencies to the given headers and all source files in the main Anope build
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
COMMAND ${SH} ${CMAKE_CURRENT_SOURCE_DIR}/version.sh ${Anope_SOURCE_DIR}/version.log ${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/version.sh DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/services.h ${CMAKE_CURRENT_SOURCE_DIR}/pseudo.h ${CMAKE_CURRENT_SOURCE_DIR}/messages.h ${SRC_SRCS}
|
||||
)
|
||||
endif(MSVC OR NOT SH)
|
||||
# Set version.cpp to use C++ as well as set its compile flags
|
||||
set_source_files_properties(version.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
|
||||
# Generate version executable to modify version.h, setting it's linker flags as well
|
||||
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
|
||||
DEPENDS version ${SRC_SRCS}
|
||||
)
|
||||
# Add version to list of files for CPack to ignore
|
||||
get_filename_component(version_BINARY ${version_BINARY} NAME)
|
||||
add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
|
||||
if(NOT WIN32)
|
||||
add_to_cpack_ignored_files("version.h$" TRUE)
|
||||
endif(NOT WIN32)
|
||||
|
||||
# Add version.h to the list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("version.h$" TRUE)
|
||||
set(PCH_SOURCES_GCH "")
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
string(REPLACE " " ";" PCH_CXXFLAGS ${CXXFLAGS})
|
||||
file(GLOB INCLUDE_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
|
||||
remove_item_from_list(INCLUDE_SRCS "version.h")
|
||||
|
||||
set(PCH_SOURCES "module.h;modules.h;services.h")
|
||||
foreach(PCH_SOURCE ${PCH_SOURCES})
|
||||
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} ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
|
||||
DEPENDS ${INCLUDE_SRCS} VERBATIM
|
||||
)
|
||||
endforeach(PCH_SOURCE ${PCH_SOURCES})
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# Add a custom target to the above file
|
||||
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||
add_custom_target(headers DEPENDS version ${CMAKE_CURRENT_BINARY_DIR}/version.h ${PCH_SOURCES_GCH})
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
all: services.h extern.h pseudo.h version.h
|
||||
|
||||
version.h: Makefile version.sh services.h pseudo.h messages.h $(SRCS)
|
||||
sh version.sh ../version.log $@
|
||||
|
||||
services.h: sysconf.h config.h extern.h
|
||||
touch $@
|
||||
|
||||
extern.h: slist.h
|
||||
touch $@
|
||||
|
||||
pseudo.h: commands.h timeout.h encrypt.h datafiles.h slist.h
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
(rm -f language.h)
|
||||
|
||||
distclean: clean
|
||||
(rm -f sysconf.h version.h)
|
||||
+274
-61
@@ -1,86 +1,299 @@
|
||||
#ifndef ACCOUNT_H
|
||||
#define ACCOUNT_H
|
||||
|
||||
#include "anope.h"
|
||||
|
||||
class NickAlias;
|
||||
class NickCore;
|
||||
|
||||
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;
|
||||
|
||||
extern CoreExport nickalias_map NickAliasList;
|
||||
extern CoreExport nickcore_map NickCoreList;
|
||||
|
||||
/* NickServ nickname structures. */
|
||||
|
||||
/** XXX: this really needs to die with fire and be merged with metadata into NickCore or something.
|
||||
/** Flags set on NickAliases
|
||||
*/
|
||||
class NickRequest
|
||||
enum NickNameFlag
|
||||
{
|
||||
public:
|
||||
NickRequest()
|
||||
{
|
||||
next = prev = NULL;
|
||||
nick = passcode = email = NULL;
|
||||
*password = 0;
|
||||
requested = lastmail = 0;
|
||||
}
|
||||
NickRequest *next, *prev;
|
||||
char *nick;
|
||||
char *passcode;
|
||||
char password[PASSMAX];
|
||||
char *email;
|
||||
time_t requested;
|
||||
time_t lastmail; /* Unsaved */
|
||||
NS_BEGIN,
|
||||
|
||||
/* Nick may not be registered or used */
|
||||
NS_FORBIDDEN,
|
||||
/* Nick never expires */
|
||||
NS_NO_EXPIRE,
|
||||
/* This nick is being held after a kill by an enforcer client
|
||||
* or is being SVSHeld. Used by ns_release to determin if something
|
||||
* should be allowed to be released
|
||||
*/
|
||||
NS_HELD,
|
||||
/* We are taking over this nick, either by SVSNICK or KILL.
|
||||
* We are waiting for the confirmation of either of these actions to
|
||||
* proceed. This is checked in NickAlias::OnCancel
|
||||
*/
|
||||
NS_COLLIDED,
|
||||
|
||||
NS_END
|
||||
};
|
||||
|
||||
const Anope::string NickNameFlagStrings[] = {
|
||||
"BEGIN", "FORBIDDEN", "NO_EXPIRE", "HELD", "COLLIDED", ""
|
||||
};
|
||||
|
||||
/** 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,
|
||||
/* If set means the nick core does not have their email addrses confirmed.
|
||||
*/
|
||||
NI_UNCONFIRMED,
|
||||
|
||||
NI_END
|
||||
};
|
||||
|
||||
const Anope::string NickCoreFlagStrings[] = {
|
||||
"BEGIN", "KILLPROTECT", "SECURE", "MSG", "MEMO_HARDMAX", "MEMO_SIGNON", "MEMO_RECEIVE",
|
||||
"PRIVATE", "HIDE_EMAIL", "HIDE_MASK", "HIDE_QUIT", "KILL_QUICK", "KILL_IMMED",
|
||||
"MEMO_MAIL", "HIDE_STATUS", "SUSPENDED", "AUTOOP", "FORBIDDEN", "UNCONFIRMED", ""
|
||||
};
|
||||
|
||||
class NickCore;
|
||||
|
||||
class NickAlias
|
||||
class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_END>
|
||||
{
|
||||
public:
|
||||
NickAlias()
|
||||
{
|
||||
next = prev = NULL;
|
||||
nick = last_quit = last_realname = last_usermask = NULL;
|
||||
time_registered = last_seen = 0;
|
||||
status = 0;
|
||||
nc = NULL;
|
||||
u = NULL;
|
||||
}
|
||||
/** Default constructor
|
||||
* @param nickname The nick
|
||||
* @param nickcore The nickcofe for this nick
|
||||
*/
|
||||
NickAlias(const Anope::string &nickname, NickCore *nickcore);
|
||||
|
||||
NickAlias *next, *prev;
|
||||
char *nick; /* Nickname */
|
||||
char *last_quit; /* Last quit message */
|
||||
char *last_realname; /* Last realname */
|
||||
char *last_usermask; /* Last usermask */
|
||||
/** 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 */
|
||||
uint16 status; /* See NS_* below */
|
||||
NickCore *nc; /* I'm an alias of this */
|
||||
time_t last_seen; /* When it was seen online for the last time */
|
||||
NickCore *nc; /* I'm an alias of this */
|
||||
HostInfo hostinfo;
|
||||
|
||||
/* Not saved */
|
||||
User *u; /* Current online user that has me */
|
||||
/** Release a nick
|
||||
* See the comment in users.cpp
|
||||
*/
|
||||
void Release();
|
||||
|
||||
/** This function is called when a user on this nick either disconnects or changes nick.
|
||||
* Note that the user isnt necessarially identified to this nick
|
||||
* See the comment in users.cpp
|
||||
* @param u The user
|
||||
*/
|
||||
void OnCancel(User *u);
|
||||
};
|
||||
|
||||
class NickCore : public Extensible
|
||||
class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END>
|
||||
{
|
||||
public:
|
||||
NickCore()
|
||||
{
|
||||
next = prev = NULL;
|
||||
display = email = greet = url = NULL;
|
||||
pass[0] = '\0';
|
||||
icq = flags = 0;
|
||||
language = accesscount = channelcount = 0;
|
||||
lastmail = 0;
|
||||
}
|
||||
/** Default constructor
|
||||
* @param display The display nick
|
||||
*/
|
||||
NickCore(const Anope::string &nickdisplay);
|
||||
|
||||
NickCore *next, *prev;
|
||||
/** Default destructor
|
||||
*/
|
||||
~NickCore();
|
||||
|
||||
char *display; /* How the nick is displayed */
|
||||
char pass[PASSMAX]; /* Password of the nicks */
|
||||
char *email; /* E-mail associated to the nick */
|
||||
char *greet; /* Greet associated to the nick */
|
||||
uint32 icq; /* ICQ # associated to the nick */
|
||||
char *url; /* URL associated to the nick */
|
||||
uint32 flags; /* See NI_* below */
|
||||
uint16 language; /* Language selected by nickname owner (LANG_*) */
|
||||
uint16 accesscount; /* # of entries */
|
||||
char **access; /* Array of strings */
|
||||
std::list<User *> Users;
|
||||
|
||||
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 */
|
||||
std::vector<Anope::string> cert; /* ssl certificate list, vector of strings */
|
||||
MemoInfo memos;
|
||||
uint16 channelcount; /* Number of channels currently registered */
|
||||
uint16 channelcount; /* Number of channels currently registered */
|
||||
|
||||
Oper *o;
|
||||
|
||||
/* Unsaved data */
|
||||
time_t lastmail; /* Last time this nick record got a mail */
|
||||
SList aliases; /* List of aliases */
|
||||
time_t lastmail; /* Last time this nick record got a mail */
|
||||
std::list<NickAlias *> aliases; /* List of aliases */
|
||||
|
||||
/** 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;
|
||||
|
||||
/** Add an entry to the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to add to the access list
|
||||
*
|
||||
* Adds a new entry into the access list.
|
||||
*/
|
||||
void AddAccess(const Anope::string &entry);
|
||||
|
||||
/** Get an entry from the nick's access list by index
|
||||
*
|
||||
* @param entry Index in the access list vector to retrieve
|
||||
* @return The access list entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
|
||||
*
|
||||
* Retrieves an entry from the access list corresponding to the given index.
|
||||
*/
|
||||
Anope::string GetAccess(unsigned entry) const;
|
||||
|
||||
/** Find an entry in the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to search for
|
||||
* @return True if the entry is found in the access list, false otherwise
|
||||
*
|
||||
* Search for an entry within the access list.
|
||||
*/
|
||||
bool FindAccess(const Anope::string &entry);
|
||||
|
||||
/** Erase an entry from the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to remove
|
||||
*
|
||||
* Removes the specified access list entry from the access list.
|
||||
*/
|
||||
void EraseAccess(const Anope::string &entry);
|
||||
|
||||
/** Clears the entire nick's access list
|
||||
*
|
||||
* Deletes all the memory allocated in the access list vector and then clears the vector.
|
||||
*/
|
||||
void ClearAccess();
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
void AddCert(const Anope::string &entry);
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
Anope::string GetCert(unsigned entry) const;
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
bool FindCert(const Anope::string &entry);
|
||||
|
||||
/** Erase a fingerprint from the nick's certificate list
|
||||
*
|
||||
* @param entry The fingerprint to remove
|
||||
*
|
||||
* Removes the specified fingerprint from the cert list.
|
||||
*/
|
||||
void EraseCert(const Anope::string &entry);
|
||||
|
||||
/** Clears the entire nick's cert list
|
||||
*
|
||||
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
||||
*/
|
||||
void ClearCert();
|
||||
|
||||
};
|
||||
|
||||
/** Timer for colliding nicks to force people off of nicknames
|
||||
*/
|
||||
class NickServCollide : public Timer
|
||||
{
|
||||
dynamic_reference<User> u;
|
||||
Anope::string nick;
|
||||
|
||||
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);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~NickServCollide();
|
||||
|
||||
/** Called when the delay is up
|
||||
* @param t The current time
|
||||
*/
|
||||
void Tick(time_t t);
|
||||
};
|
||||
|
||||
/** 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
|
||||
*/
|
||||
NickServRelease(NickAlias *na, time_t delay);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~NickServRelease();
|
||||
|
||||
/** Called when the delay is up
|
||||
* @param t The current time
|
||||
*/
|
||||
void Tick(time_t t);
|
||||
};
|
||||
|
||||
#endif // ACCOUNT_H
|
||||
|
||||
+499
@@ -0,0 +1,499 @@
|
||||
/*
|
||||
* (C) 2003-2011 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 ANOPE_H
|
||||
#define ANOPE_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include "hashcomp.h"
|
||||
|
||||
class Message;
|
||||
|
||||
namespace Anope
|
||||
{
|
||||
template<typename T> class map : public std::map<string, T> { };
|
||||
template<typename T> class insensitive_map : public std::map<string, T, std::less<ci::string> > { };
|
||||
|
||||
/**
|
||||
* A wrapper string class around all the other string classes, this class will
|
||||
* 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
|
||||
{
|
||||
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.
|
||||
*/
|
||||
std::string _string;
|
||||
public:
|
||||
/**
|
||||
* Extras.
|
||||
*/
|
||||
typedef std::string::iterator iterator;
|
||||
typedef std::string::const_iterator const_iterator;
|
||||
typedef std::string::reverse_iterator reverse_iterator;
|
||||
typedef std::string::const_reverse_iterator const_reverse_iterator;
|
||||
typedef std::string::size_type size_type;
|
||||
static const size_type npos = static_cast<size_type>(-1);
|
||||
|
||||
/**
|
||||
* Constructors that can take in any type of string.
|
||||
*/
|
||||
string() : _string("") { }
|
||||
string(char chr) : _string() { _string = chr; }
|
||||
string(size_type n, char chr) : _string(n, chr) { }
|
||||
string(const char *_str) : _string(_str) { }
|
||||
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) { }
|
||||
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
|
||||
|
||||
/**
|
||||
* Assignment operators, so any type of string can be assigned to this class.
|
||||
*/
|
||||
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; }
|
||||
|
||||
/**
|
||||
* Equality operators, to compare to any type of string.
|
||||
*/
|
||||
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); }
|
||||
|
||||
/**
|
||||
* Compound addition operators, overloaded to do concatenation.
|
||||
*/
|
||||
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; }
|
||||
|
||||
/**
|
||||
* Addition operators, overloaded to do concatenation.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
inline bool operator<(const string &_str) const { return this->_string < _str._string; }
|
||||
|
||||
/**
|
||||
* The following functions return the various types of strings.
|
||||
*/
|
||||
inline const char *c_str() const { return this->_string.c_str(); }
|
||||
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.
|
||||
*/
|
||||
inline bool empty() const { return this->_string.empty(); }
|
||||
|
||||
/**
|
||||
* Returns the string's length.
|
||||
*/
|
||||
inline size_type length() const { return this->_string.length(); }
|
||||
|
||||
/**
|
||||
* Add a char to the end of the string.
|
||||
*/
|
||||
inline void push_back(char c) { return this->_string.push_back(c); }
|
||||
|
||||
/**
|
||||
* Resizes the string content to n characters.
|
||||
*/
|
||||
inline void resize(size_type n) { return this->_string.resize(n); }
|
||||
|
||||
/**
|
||||
* Erases characters from the string.
|
||||
*/
|
||||
inline iterator erase(const iterator &i) { return this->_string.erase(i); }
|
||||
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); }
|
||||
|
||||
/**
|
||||
* Clears the string.
|
||||
*/
|
||||
inline void clear() { this->_string.clear(); }
|
||||
|
||||
/**
|
||||
* Find substrings of the string.
|
||||
*/
|
||||
inline size_type find(const string &_str, size_type pos = 0) const { return this->_string.find(_str._string, pos); }
|
||||
inline size_type find(char chr, size_type pos = 0) const { return this->_string.find(chr, pos); }
|
||||
inline size_type find_ci(const string &_str, size_type pos = 0) const { return ci::string(this->_string.c_str()).find(ci::string(_str._string.c_str()), pos); }
|
||||
inline size_type find_ci(char chr, size_type pos = 0) const { return ci::string(this->_string.c_str()).find(chr, pos); }
|
||||
|
||||
inline size_type rfind(const string &_str, size_type pos = npos) const { return this->_string.rfind(_str._string, pos); }
|
||||
inline size_type rfind(char chr, size_type pos = npos) const { return this->_string.rfind(chr, pos); }
|
||||
inline size_type rfind_ci(const string &_str, size_type pos = npos) const { return ci::string(this->_string.c_str()).rfind(ci::string(_str._string.c_str()), pos); }
|
||||
inline size_type rfind_ci(char chr, size_type pos = npos) const { return ci::string(this->_string.c_str()).rfind(chr, pos); }
|
||||
|
||||
inline size_type find_first_of(const string &_str, size_type pos = 0) const { return this->_string.find_first_of(_str._string, pos); }
|
||||
inline size_type find_first_of_ci(const string &_str, size_type pos = 0) const { return ci::string(this->_string.c_str()).find_first_of(ci::string(_str._string.c_str()), pos); }
|
||||
|
||||
inline size_type find_first_not_of(const string &_str, size_type pos = 0) const { return this->_string.find_first_not_of(_str._string, pos); }
|
||||
inline size_type find_first_not_of_ci(const string &_str, size_type pos = 0) const { return ci::string(this->_string.c_str()).find_first_not_of(ci::string(_str._string.c_str()), pos); }
|
||||
|
||||
inline size_type find_last_of(const string &_str, size_type pos = npos) const { return this->_string.find_last_of(_str._string, pos); }
|
||||
inline size_type find_last_of_ci(const string &_str, size_type pos = npos) const { return ci::string(this->_string.c_str()).find_last_of(ci::string(_str._string.c_str()), pos); }
|
||||
|
||||
inline size_type find_last_not_of(const string &_str, size_type pos = npos) const { return this->_string.find_last_not_of(_str._string, pos); }
|
||||
inline size_type find_last_not_of_ci(const string &_str, size_type pos = npos) const { return ci::string(this->_string.c_str()).find_last_not_of(ci::string(_str._string.c_str()), pos); }
|
||||
|
||||
/**
|
||||
* Determine if string consists of only numbers.
|
||||
*/
|
||||
inline bool is_number_only() const { return this->find_first_not_of("0123456789.-") == npos; }
|
||||
inline bool is_pos_number_only() const { return this->find_first_not_of("0123456789.") == npos; }
|
||||
|
||||
/**
|
||||
* Replace parts of the string.
|
||||
*/
|
||||
inline string replace(size_type pos, size_type n, const string &_str) { return string(this->_string.replace(pos, n, _str._string)); }
|
||||
inline string replace(size_type pos, size_type n, const string &_str, size_type pos1, size_type n1) { return string(this->_string.replace(pos, n, _str._string, pos1, n1)); }
|
||||
inline string replace(size_type pos, size_type n, size_type n1, char chr) { return string(this->_string.replace(pos, n, n1, chr)); }
|
||||
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)
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
size_type pos = new_string.find(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
||||
while (pos != npos)
|
||||
{
|
||||
new_string = new_string.substr(0, pos) + _repl + new_string.substr(pos + orig_length);
|
||||
pos = new_string.find(_orig, pos + repl_length);
|
||||
}
|
||||
return new_string;
|
||||
}
|
||||
inline string replace_all_ci(const string &_orig, const string &_repl)
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
size_type pos = new_string.find_ci(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
||||
while (pos != npos)
|
||||
{
|
||||
new_string = new_string.substr(0, pos) + _repl + new_string.substr(pos + orig_length);
|
||||
pos = new_string.find_ci(_orig, pos + repl_length);
|
||||
}
|
||||
return new_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a substring of the string.
|
||||
*/
|
||||
inline string substr(size_type pos = 0, size_type n = npos) const { return string(this->_string.substr(pos, n)); }
|
||||
|
||||
/**
|
||||
* Iterators to the string.
|
||||
*/
|
||||
inline iterator begin() { return this->_string.begin(); }
|
||||
inline const_iterator begin() const { return this->_string.begin(); }
|
||||
inline iterator end() { return this->_string.end(); }
|
||||
inline const_iterator end() const { return this->_string.end(); }
|
||||
inline reverse_iterator rbegin() { return this->_string.rbegin(); }
|
||||
inline const_reverse_iterator rbegin() const { return this->_string.rbegin(); }
|
||||
inline reverse_iterator rend() { return this->_string.rend(); }
|
||||
inline const_reverse_iterator rend() const { return this->_string.rend(); }
|
||||
|
||||
/**
|
||||
* Subscript operator, to access individual characters of the string.
|
||||
*/
|
||||
inline char &operator[](size_type n) { return this->_string[n]; }
|
||||
inline const char &operator[](size_type n) const { return this->_string[n]; }
|
||||
|
||||
/**
|
||||
* 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;
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &os, const string &_str) { return os << _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; }
|
||||
|
||||
static const char *const compiled = __TIME__ " " __DATE__;
|
||||
|
||||
/** 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();
|
||||
extern CoreExport string VersionShort();
|
||||
extern CoreExport string VersionBuildString();
|
||||
extern CoreExport int VersionMajor();
|
||||
extern CoreExport int VersionMinor();
|
||||
extern CoreExport int VersionPatch();
|
||||
extern CoreExport int VersionBuild();
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
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);
|
||||
|
||||
/** Converts a string to hex
|
||||
* @param the data to be converted
|
||||
* @return a anope::string containing the hex value
|
||||
*/
|
||||
extern CoreExport string Hex(const string &data);
|
||||
extern CoreExport string Hex(const char *data, unsigned len);
|
||||
|
||||
/** Converts a string from hex
|
||||
* @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);
|
||||
|
||||
/** 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, uses errno/GetLastError() to determin this
|
||||
* @return An error message
|
||||
*/
|
||||
extern CoreExport const Anope::string LastError();
|
||||
}
|
||||
|
||||
/** sepstream allows for splitting token seperated lists.
|
||||
* Each successive call to sepstream::GetToken() returns
|
||||
* the next token, until none remain, at which point the method returns
|
||||
* an empty string.
|
||||
*/
|
||||
class CoreExport sepstream
|
||||
{
|
||||
private:
|
||||
/** Original string.
|
||||
*/
|
||||
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;
|
||||
public:
|
||||
/** Create a sepstream and fill it with the provided data
|
||||
*/
|
||||
sepstream(const Anope::string &source, char seperator);
|
||||
virtual ~sepstream() { }
|
||||
|
||||
/** Fetch the next token from the stream
|
||||
* @param token The next token from the stream is placed here
|
||||
* @return True if tokens still remain, false if there are none left
|
||||
*/
|
||||
virtual bool GetToken(Anope::string &token);
|
||||
|
||||
/** Fetch the entire remaining stream, without tokenizing
|
||||
* @return The remaining part of the stream
|
||||
*/
|
||||
virtual 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();
|
||||
};
|
||||
|
||||
/** A derived form of sepstream, which seperates on commas
|
||||
*/
|
||||
class commasepstream : public sepstream
|
||||
{
|
||||
public:
|
||||
/** Initialize with comma seperator
|
||||
*/
|
||||
commasepstream(const Anope::string &source) : sepstream(source, ',') { }
|
||||
};
|
||||
|
||||
/** A derived form of sepstream, which seperates on spaces
|
||||
*/
|
||||
class spacesepstream : public sepstream
|
||||
{
|
||||
public:
|
||||
/** Initialize with space seperator
|
||||
*/
|
||||
spacesepstream(const Anope::string &source) : sepstream(source, ' ') { }
|
||||
};
|
||||
|
||||
/** The base class that most classes in Anope inherit from
|
||||
*/
|
||||
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
|
||||
{
|
||||
protected:
|
||||
bool invalid;
|
||||
public:
|
||||
dynamic_reference_base() : invalid(false) { }
|
||||
virtual ~dynamic_reference_base() { }
|
||||
inline void Invalidate() { this->invalid = true; }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class dynamic_reference : public dynamic_reference_base
|
||||
{
|
||||
protected:
|
||||
T *ref;
|
||||
public:
|
||||
dynamic_reference(T *obj) : ref(obj)
|
||||
{
|
||||
if (ref)
|
||||
ref->AddReference(this);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // ANOPE_H
|
||||
+52
-28
@@ -1,55 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2009 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2011 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BOTS_H
|
||||
#define BOTS_H
|
||||
|
||||
struct CommandHash;
|
||||
#include "commands.h"
|
||||
|
||||
class CoreExport BotInfo
|
||||
class BotInfo;
|
||||
|
||||
extern CoreExport Anope::insensitive_map<BotInfo *> BotListByNick;
|
||||
extern CoreExport Anope::map<BotInfo *> BotListByUID;
|
||||
|
||||
/** 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
|
||||
};
|
||||
|
||||
static const Anope::string BotFlagString[] = { "BEGIN", "CORE", "PRIVATE", "" };
|
||||
|
||||
class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>
|
||||
{
|
||||
public:
|
||||
BotInfo *next, *prev;
|
||||
|
||||
std::string uid; /* required for UID supporting servers, as opposed to the shitty struct Uid. */
|
||||
char *nick; /* Nickname of the bot */
|
||||
char *user; /* Its user name */
|
||||
char *host; /* Its hostname */
|
||||
char *real; /* Its real name */
|
||||
int16 flags; /* Bot flags -- see BI_* below */
|
||||
time_t created; /* Birth date ;) */
|
||||
int16 chancount; /* Number of channels that use the bot. */
|
||||
/* Dynamic data */
|
||||
uint32 chancount;
|
||||
time_t created; /* Birth date ;) */
|
||||
time_t lastmsg; /* Last time we said something */
|
||||
CommandHash **cmdTable;
|
||||
CommandMap Commands; /* Commands on this bot */
|
||||
|
||||
/** Create a new bot.
|
||||
* XXX: Note - this constructor is considered obsolete. Use the four parameter form.
|
||||
* @param nick The nickname to assign to the bot.
|
||||
*/
|
||||
BotInfo(const char *nick);
|
||||
/** Create a new bot.
|
||||
* @param nick The nickname to assign to the bot.
|
||||
* @param user The ident to give the bot.
|
||||
* @param host The hostname to give the bot.
|
||||
* @param real The realname to give the bot.
|
||||
*/
|
||||
BotInfo(const char *nick, const char *user, const char *host, const char *real);
|
||||
BotInfo(const Anope::string &nick, const Anope::string &user = "", const Anope::string &host = "", const Anope::string &real = "");
|
||||
|
||||
/** Destroy a bot, clearing up appropriately.
|
||||
*/
|
||||
virtual ~BotInfo();
|
||||
|
||||
/** Change the nickname set on a bot.
|
||||
/** Change the nickname for the bot.
|
||||
* @param newnick The nick to change to
|
||||
*/
|
||||
void ChangeNick(const char *newnick);
|
||||
void SetNewNick(const Anope::string &newnick);
|
||||
|
||||
/** Rejoins all channels that this bot is assigned to.
|
||||
* Used on /kill, rename, etc.
|
||||
@@ -67,5 +72,24 @@ class CoreExport BotInfo
|
||||
* @param ci The channel registration to remove the bot from.
|
||||
*/
|
||||
void UnAssign(User *u, ChannelInfo *ci);
|
||||
|
||||
/** Join this bot to a channel
|
||||
* @param c The channel
|
||||
* @param status The status the bot should have on the channel
|
||||
*/
|
||||
void Join(Channel *c, ChannelStatus *status = NULL);
|
||||
|
||||
/** Join this bot to a channel
|
||||
* @param chname The channel name
|
||||
* @param status The status the bot should have on the channel
|
||||
*/
|
||||
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 = "");
|
||||
};
|
||||
|
||||
#endif // BOTS_H
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
/* Channel support
|
||||
*
|
||||
* (C) 2008-2011 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;
|
||||
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
|
||||
{
|
||||
User *user;
|
||||
UserData ud;
|
||||
ChannelStatus *Status;
|
||||
|
||||
UserContainer(User *u) : user(u) { }
|
||||
virtual ~UserContainer() { }
|
||||
};
|
||||
|
||||
typedef std::list<UserContainer *> CUserList;
|
||||
|
||||
enum ChannelFlag
|
||||
{
|
||||
/* 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<ChannelFlag, 3>
|
||||
{
|
||||
public:
|
||||
typedef std::multimap<ChannelModeName, Anope::string> ModeList;
|
||||
private:
|
||||
/** A map of channel modes with their parameters set on this channel
|
||||
*/
|
||||
ModeList modes;
|
||||
|
||||
public:
|
||||
/** Default 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
|
||||
*/
|
||||
~Channel();
|
||||
|
||||
Anope::string name; /* Channel name */
|
||||
ChannelInfo *ci; /* Corresponding ChannelInfo */
|
||||
time_t creation_time; /* When channel was created */
|
||||
|
||||
/* 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
|
||||
*/
|
||||
void Reset();
|
||||
|
||||
/** Restore the channel topic, set mlock (key), set stickied bans, etc
|
||||
*/
|
||||
void Sync();
|
||||
|
||||
/** Join a user internally to the channel
|
||||
* @param u The user
|
||||
*/
|
||||
void JoinUser(User *u);
|
||||
|
||||
/** Remove a user internally from the channel
|
||||
* @param u The user
|
||||
*/
|
||||
void DeleteUser(User *u);
|
||||
|
||||
/** Check if the user is on the channel
|
||||
* @param u The user
|
||||
* @return A user container if found, else NULL
|
||||
*/
|
||||
UserContainer *FindUser(User *u);
|
||||
|
||||
/** Check if a user has a status on a channel
|
||||
* @param u The user
|
||||
* @param cms The status mode, or NULL to represent no status
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasUserStatus(User *u, ChannelModeStatus *cms) const;
|
||||
|
||||
/** Check if a user has a status on a channel
|
||||
* Use the overloaded function for ChannelModeStatus* to check for no status
|
||||
* @param u The user
|
||||
* @param Name The Mode name, eg CMODE_OP, CMODE_VOICE
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasUserStatus(User *u, ChannelModeName Name) const;
|
||||
|
||||
/** See if a channel has a mode
|
||||
* @param Name The mode name
|
||||
* @return The number of modes set
|
||||
* @param param The optional mode param
|
||||
*/
|
||||
size_t HasMode(ChannelModeName Name, const Anope::string ¶m = "");
|
||||
|
||||
/** 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(ChannelModeName Name);
|
||||
|
||||
/** Set a mode internally on a channel, this is not sent out to the IRCd
|
||||
* @param cm The mode
|
||||
* @param param The param
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetModeInternal(ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
|
||||
/** Remove a mode internally on a channel, this is not sent out to the IRCd
|
||||
* @param cm The mode
|
||||
* @param param The param
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveModeInternal(ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
|
||||
/** Set a mode on a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param cm The mode
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
|
||||
/**
|
||||
* Set a mode on a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param Name The mode name
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
|
||||
/** Remove a mode from a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param cm The mode
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
|
||||
/**
|
||||
* Remove a mode from a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param Name The mode name
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
|
||||
/** 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;
|
||||
|
||||
/** Set a string of modes on the channel
|
||||
* @param bi The client setting the modes
|
||||
* @param EnforceMLock Should mlock be enforced on this mode change
|
||||
* @param cmodes The modes to set
|
||||
*/
|
||||
void SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...);
|
||||
|
||||
/** Set a string of modes internally on a channel
|
||||
* @param setter the setter (if it is a user)
|
||||
* @param mode the modes
|
||||
* @param EnforceMLock true to enforce mlock
|
||||
*/
|
||||
void SetModesInternal(User *setter, const Anope::string &mode, bool EnforceMLock = true);
|
||||
|
||||
/** 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);
|
||||
|
||||
/** Kick a user from the channel
|
||||
* @param bi The sender, can be NULL for the service bot for this channel
|
||||
* @param u The user being kicked
|
||||
* @param reason The reason for the kick
|
||||
* @return true if the kick was scucessful, false if a module blocked the kick
|
||||
*/
|
||||
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
|
||||
|
||||
/** 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
|
||||
* @return A mode string
|
||||
*/
|
||||
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 newtopic The new topic
|
||||
* @param ts The time the new topic is being set
|
||||
*/
|
||||
void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
|
||||
|
||||
/** Update the topic of the channel, and reset it if topiclock etc says to
|
||||
* @param user The user setting the topic
|
||||
* @param newtopic The new topic
|
||||
* @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);
|
||||
};
|
||||
|
||||
#endif // CHANNELS_H
|
||||
+147
-15
@@ -1,28 +1,160 @@
|
||||
/* Declarations for command data.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* (C) 2003-2011 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.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#include "modules.h"
|
||||
#ifndef COMMAND_H
|
||||
#define COMMAND_H
|
||||
|
||||
/*************************************************************************/
|
||||
#include "services.h"
|
||||
|
||||
/* Routines for looking up commands. Command lists are arrays that must be
|
||||
* terminated with a NULL name.
|
||||
class Module;
|
||||
class BotInfo;
|
||||
class Command;
|
||||
|
||||
typedef std::map<Anope::string, Command *, std::less<ci::string> > CommandMap;
|
||||
|
||||
/** The return value from commands.
|
||||
*/
|
||||
enum CommandReturn
|
||||
{
|
||||
MOD_CONT,
|
||||
MOD_STOP
|
||||
};
|
||||
|
||||
extern MDE Command *lookup_cmd(Command *list, char *name);
|
||||
extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
|
||||
extern MDE void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
|
||||
extern MDE void do_help_limited(char *service, User * u, Command * c);
|
||||
extern CoreExport Command *FindCommand(BotInfo *bi, const Anope::string &cmd);
|
||||
extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, ChannelInfo *ci, const Anope::string &cmd);
|
||||
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, ChannelInfo *ci, const Anope::string &message);
|
||||
extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, ChannelInfo *ci, Command *c, const Anope::string &command, const Anope::string &message);
|
||||
|
||||
/*************************************************************************/
|
||||
enum CommandFlag
|
||||
{
|
||||
CFLAG_ALLOW_UNREGISTERED,
|
||||
CFLAG_ALLOW_FORBIDDEN,
|
||||
CFLAG_ALLOW_SUSPENDED,
|
||||
CFLAG_ALLOW_UNREGISTEREDCHANNEL,
|
||||
CFLAG_STRIP_CHANNEL,
|
||||
CFLAG_DISABLE_FANTASY
|
||||
};
|
||||
|
||||
const Anope::string CommandFlagStrings[] = {
|
||||
"CFLAG_ALLOW_UNREGISTERED",
|
||||
"CFLAG_ALLOW_FORBIDDEN",
|
||||
"CFLAG_ALLOW_SUSPENDED",
|
||||
"CFLAG_ALLOW_UNREGISTEREDCHANNEL",
|
||||
"CFLAG_STRIP_CHANNEL",
|
||||
"CFLAG_DISABLE_FANTASY",
|
||||
""
|
||||
};
|
||||
|
||||
/* The source for a command */
|
||||
struct CoreExport CommandSource
|
||||
{
|
||||
/* User executing the command */
|
||||
User *u;
|
||||
/* Channel (if applicable) */
|
||||
ChannelInfo *ci;
|
||||
/* The service this command is on */
|
||||
BotInfo *owner;
|
||||
/* The service the reply should come from, *not* necessarily the service the command is on */
|
||||
BotInfo *service;
|
||||
/* Whether or not this was a fantasy command */
|
||||
bool fantasy;
|
||||
|
||||
std::list<Anope::string> reply;
|
||||
|
||||
void Reply(const char *message, ...);
|
||||
void Reply(const Anope::string &message);
|
||||
|
||||
void DoReply();
|
||||
};
|
||||
|
||||
/** Every services command is a class, inheriting from Command.
|
||||
*/
|
||||
class CoreExport Command : public Flags<CommandFlag>, public Base
|
||||
{
|
||||
Anope::string desc;
|
||||
|
||||
public:
|
||||
/* Maximum paramaters accepted by this command */
|
||||
size_t MaxParams;
|
||||
/* Minimum parameters required to use this command */
|
||||
size_t MinParams;
|
||||
/* Command name */
|
||||
Anope::string name;
|
||||
/* Permission needed to use this comand */
|
||||
Anope::string permission;
|
||||
|
||||
/* Module which owns us */
|
||||
Module *module;
|
||||
/* Service this command is on */
|
||||
BotInfo *service;
|
||||
|
||||
/** Create a new 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 = "");
|
||||
|
||||
virtual ~Command();
|
||||
|
||||
protected:
|
||||
void SetDesc(const Anope::string &d);
|
||||
|
||||
public:
|
||||
/** Execute this command.
|
||||
* @param source The source
|
||||
* @param params Command parameters
|
||||
*/
|
||||
virtual CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) = 0;
|
||||
|
||||
/** Called when HELP is requsted for the client this command is on.
|
||||
* @param source The source
|
||||
*/
|
||||
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 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(CommandSource &source, const Anope::string &subcommand);
|
||||
|
||||
/** Requested when the user provides bad syntax to this command (not enough params, etc).
|
||||
* @param source The source
|
||||
* @param subcommand The subcommand the user tried to use
|
||||
*/
|
||||
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
|
||||
*/
|
||||
void SetPermission(const Anope::string &reststr);
|
||||
|
||||
/** Add a subcommand to this command
|
||||
* @param creator The creator of the subcommand
|
||||
* @param c The command
|
||||
*/
|
||||
virtual bool AddSubcommand(Module *creator, 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);
|
||||
};
|
||||
|
||||
#endif // COMMANDS_H
|
||||
|
||||
+877
-59
@@ -1,72 +1,890 @@
|
||||
/* Services configuration.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
/* Note that most of the options which used to be here have been moved to
|
||||
* services.conf. */
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <deque>
|
||||
|
||||
/*************************************************************************/
|
||||
#include "anope.h"
|
||||
|
||||
/******* General configuration *******/
|
||||
|
||||
/* Name of configuration file (in Services directory) */
|
||||
#define SERVICES_CONF "services.conf"
|
||||
|
||||
/* Name of log file (in Services directory) */
|
||||
#define LOG_FILENAME "services.log"
|
||||
|
||||
/* Maximum amount of data from/to the network to buffer (bytes). */
|
||||
#define NET_BUFSIZE 65536
|
||||
|
||||
/******* OperServ configuration *******/
|
||||
|
||||
/* Define this to enable OperServ's svs commands (superadmin only). */
|
||||
#define USE_OSSVS
|
||||
|
||||
/******************* END OF USER-CONFIGURABLE SECTION ********************/
|
||||
|
||||
/* Size of input buffer (note: this is different from BUFSIZ)
|
||||
* This must be big enough to hold at least one full IRC message, or messy
|
||||
* things will happen. */
|
||||
#define BUFSIZE 1024
|
||||
|
||||
/* Extra warning: If you change CHANMAX, your ChanServ database will be
|
||||
* unusable.
|
||||
/** A configuration key and value pair
|
||||
*/
|
||||
typedef std::pair<Anope::string, Anope::string> KeyVal;
|
||||
|
||||
/* Maximum length of a channel name, including the trailing null. Any
|
||||
* channels with a length longer than (CHANMAX-1) including the leading #
|
||||
* will not be usable with ChanServ. */
|
||||
#define CHANMAX 64
|
||||
/** A list of related configuration keys and values
|
||||
*/
|
||||
typedef std::vector<KeyVal> KeyValList;
|
||||
|
||||
/* Maximum length of a nickname, including the trailing null. This MUST be
|
||||
* at least one greater than the maximum allowable nickname length on your
|
||||
* network, or people will run into problems using Services! The default
|
||||
* (32) works with all servers I know of. */
|
||||
#define NICKMAX 32
|
||||
/** An entire config file, built up of KeyValLists
|
||||
*/
|
||||
typedef std::multimap<Anope::string, KeyValList> ConfigDataHash;
|
||||
|
||||
/* Maximum length of a password */
|
||||
#define PASSMAX 32
|
||||
// Required forward definitions
|
||||
class ServerConfig;
|
||||
|
||||
/* Maximum length of a username */
|
||||
#define USERMAX 10
|
||||
/** Types of data in the core config
|
||||
*/
|
||||
enum ConfigDataType
|
||||
{
|
||||
DT_NOTHING, // No data
|
||||
DT_INTEGER, // Integer
|
||||
DT_UINTEGER, // Unsigned Integer
|
||||
DT_LUINTEGER, // Long Unsigned Integer
|
||||
DT_CHARPTR, // Char pointer
|
||||
DT_STRING, // Anope::string
|
||||
DT_BOOLEAN, // Boolean
|
||||
DT_HOSTNAME, // Hostname syntax
|
||||
DT_NOSPACES, // No spaces
|
||||
DT_IPADDRESS, // IP address (v4, v6)
|
||||
DT_TIME, // Time value
|
||||
DT_NORELOAD = 32, // Item can't be reloaded after startup
|
||||
DT_ALLOW_WILD = 64, // Allow wildcards/CIDR in DT_IPADDRESS
|
||||
DT_ALLOW_NEWLINE = 128 // New line characters allowed in DT_CHARPTR
|
||||
};
|
||||
|
||||
/* Maximum length of a domain */
|
||||
#define HOSTMAX 64
|
||||
/** Holds a config value, either string, integer or boolean.
|
||||
* Callback functions receive one or more of these, either on
|
||||
* their own as a reference, or in a reference to a deque of them.
|
||||
* The callback function can then alter the values of the ValueItem
|
||||
* classes to validate the settings.
|
||||
*/
|
||||
class CoreExport ValueItem
|
||||
{
|
||||
private:
|
||||
/** Actual data */
|
||||
Anope::string v;
|
||||
public:
|
||||
/** Initialize with an int */
|
||||
ValueItem(int);
|
||||
/** Initialize with a bool */
|
||||
ValueItem(bool);
|
||||
/** Initialize with a char pointer */
|
||||
ValueItem(const char *);
|
||||
/** Initialize with an std::string */
|
||||
ValueItem(const std::string &);
|
||||
/** Initialize with a ci::string */
|
||||
ValueItem(const ci::string &);
|
||||
/** Initialize with an Anope::string */
|
||||
ValueItem(const Anope::string &);
|
||||
/** Initialize with a long */
|
||||
ValueItem(long);
|
||||
/** Change value to a char pointer */
|
||||
//void Set(char *);
|
||||
/** Change value to a const char pointer */
|
||||
void Set(const char *);
|
||||
/** Change value to an std::string */
|
||||
void Set(const std::string &);
|
||||
/** Change value to a ci::string */
|
||||
void Set(const ci::string &);
|
||||
/** Change value to an Anope::string */
|
||||
void Set(const Anope::string &);
|
||||
/** Change value to an int */
|
||||
void Set(int);
|
||||
/** Get value as an int */
|
||||
int GetInteger() const;
|
||||
/** Get value as a string */
|
||||
const char *GetString() const;
|
||||
/** Get value as an Anope::string */
|
||||
inline const Anope::string &GetValue() const { return v; }
|
||||
/** Get value as a bool */
|
||||
bool GetBool() const;
|
||||
};
|
||||
|
||||
/**************************************************************************/
|
||||
/** The base class of the container 'ValueContainer'
|
||||
* used internally by the core to hold core values.
|
||||
*/
|
||||
class ValueContainerBase
|
||||
{
|
||||
public:
|
||||
/** Constructor */
|
||||
ValueContainerBase() { }
|
||||
/** Destructor */
|
||||
virtual ~ValueContainerBase() { }
|
||||
};
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
/** ValueContainer is used to contain pointers to different
|
||||
* core values such as the server name, maximum number of
|
||||
* clients etc.
|
||||
* It is specialized to hold a data type, then pointed at
|
||||
* a value in the ServerConfig class. When the value has been
|
||||
* read and validated, the Set method is called to write the
|
||||
* value safely in a type-safe manner.
|
||||
*/
|
||||
template<typename T> class ValueContainer : public ValueContainerBase
|
||||
{
|
||||
private:
|
||||
/** Contained item */
|
||||
T val;
|
||||
public:
|
||||
/** Initialize with nothing */
|
||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
||||
/** Initialize with a value of type T */
|
||||
ValueContainer(T Val) : ValueContainerBase(), val(Val) { }
|
||||
/** Initialize with a copy */
|
||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
||||
ValueContainer &operator=(const ValueContainer &Val)
|
||||
{
|
||||
val = Val.val;
|
||||
return *this;
|
||||
}
|
||||
/** Change value to type T of size s */
|
||||
void Set(const T newval, size_t s)
|
||||
{
|
||||
memcpy(val, newval, s);
|
||||
}
|
||||
};
|
||||
|
||||
/** This a specific version of ValueContainer to handle character arrays specially
|
||||
*/
|
||||
template<> class ValueContainer<char **> : public ValueContainerBase
|
||||
{
|
||||
private:
|
||||
/** Contained item */
|
||||
char **val;
|
||||
public:
|
||||
/** Initialize with nothing */
|
||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
||||
/** Initialize with a value of type T */
|
||||
ValueContainer(char **Val) : ValueContainerBase(), val(Val) { }
|
||||
/** Initialize with a copy */
|
||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
||||
ValueContainer &operator=(const ValueContainer &Val)
|
||||
{
|
||||
val = Val.val;
|
||||
return *this;
|
||||
}
|
||||
/** Change value to type T of size s */
|
||||
void Set(const char *newval, size_t s)
|
||||
{
|
||||
if (*val)
|
||||
delete [] *val;
|
||||
if (!*newval)
|
||||
{
|
||||
*val = NULL;
|
||||
return;
|
||||
}
|
||||
*val = new char[s];
|
||||
strlcpy(*val, newval, s);
|
||||
}
|
||||
};
|
||||
|
||||
/** This a specific version of ValueContainer to handle Anope::string specially
|
||||
*/
|
||||
template<> class ValueContainer<Anope::string *> : public ValueContainerBase
|
||||
{
|
||||
private:
|
||||
/** Contained item */
|
||||
Anope::string *val;
|
||||
public:
|
||||
/** Initialize with nothing */
|
||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
||||
/** Initialize with an std::string */
|
||||
ValueContainer(Anope::string *Val) : ValueContainerBase(), val(Val) { }
|
||||
/** Initialize with a copy */
|
||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
||||
ValueContainer &operator=(const ValueContainer &Val)
|
||||
{
|
||||
val = Val.val;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Change value to given Anope::string */
|
||||
void Set(const Anope::string &newval)
|
||||
{
|
||||
*val = newval;
|
||||
}
|
||||
/** Change value to given char pointer */
|
||||
void Set(const char *newval)
|
||||
{
|
||||
*val = newval;
|
||||
}
|
||||
};
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to a bool
|
||||
*/
|
||||
typedef ValueContainer<bool *> ValueContainerBool;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* an unsigned int
|
||||
*/
|
||||
typedef ValueContainer<unsigned *> ValueContainerUInt;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* a long unsigned int
|
||||
*/
|
||||
typedef ValueContainer<long unsigned *> ValueContainerLUInt;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* a char array.
|
||||
*/
|
||||
typedef ValueContainer<char **> ValueContainerChar;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* an int
|
||||
*/
|
||||
typedef ValueContainer<int *> ValueContainerInt;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* a time_t
|
||||
*/
|
||||
typedef ValueContainer<time_t *> ValueContainerTime;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* an Anope::string
|
||||
*/
|
||||
typedef ValueContainer<Anope::string *> ValueContainerString;
|
||||
|
||||
/** A set of ValueItems used by multi-value validator functions
|
||||
*/
|
||||
typedef std::deque<ValueItem> ValueList;
|
||||
|
||||
/** A callback for validating a single value
|
||||
*/
|
||||
typedef bool (*Validator)(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &);
|
||||
/** A callback for validating multiple value entries
|
||||
*/
|
||||
typedef bool (*MultiValidator)(ServerConfig *, const Anope::string &, const Anope::string *, ValueList &, int *);
|
||||
/** A callback indicating the end of a group of entries
|
||||
*/
|
||||
typedef bool (*MultiNotify)(ServerConfig *, const Anope::string &);
|
||||
|
||||
bool ValidateNotEmpty(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateNotZero(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateEmailReg(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidatePort(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateGuestPrefix(ServerConfig *conf, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateBantype(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data);
|
||||
bool ValidateChanServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateMemoServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateBotServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateHostServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateLimitSessions(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateOperServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateGlobal(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateDefCon(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateNickLen(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data);
|
||||
bool ValidateMail(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateGlobalOnCycle(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
|
||||
/** Represents a configuration file
|
||||
*/
|
||||
class ConfigurationFile
|
||||
{
|
||||
Anope::string name;
|
||||
bool executable;
|
||||
FILE *fp;
|
||||
public:
|
||||
ConfigurationFile(const Anope::string &, bool);
|
||||
~ConfigurationFile();
|
||||
const Anope::string &GetName() const;
|
||||
|
||||
bool IsOpen() const;
|
||||
bool Open();
|
||||
void Close();
|
||||
bool End() const;
|
||||
Anope::string Read();
|
||||
};
|
||||
|
||||
/** Holds all of the core configuration items
|
||||
*/
|
||||
class CoreExport ConfigItems
|
||||
{
|
||||
public:
|
||||
/** Holds a core configuration item and its callbacks
|
||||
*/
|
||||
struct Item
|
||||
{
|
||||
/** Tag name */
|
||||
Anope::string tag;
|
||||
/** Value name */
|
||||
Anope::string value;
|
||||
/** Default, if not defined */
|
||||
Anope::string default_value;
|
||||
/** Value containers */
|
||||
ValueContainerBase *val;
|
||||
/** Data types */
|
||||
int datatype;
|
||||
/** Validation function */
|
||||
Validator validation_function;
|
||||
} *Values;
|
||||
|
||||
/** Holds a core configuration item and its callbacks
|
||||
* where there may be more than one item
|
||||
*/
|
||||
struct MultiItem
|
||||
{
|
||||
/** Tag name */
|
||||
Anope::string tag;
|
||||
/** One or more items within tag */
|
||||
Anope::string items[17];
|
||||
/** One or more defaults for items within tags */
|
||||
Anope::string items_default[17];
|
||||
/** One or more data types */
|
||||
int datatype[17];
|
||||
/** Initialization function */
|
||||
MultiNotify init_function;
|
||||
/** Validation function */
|
||||
MultiValidator validation_function;
|
||||
/** Completion function */
|
||||
MultiNotify finish_function;
|
||||
} *MultiValues;
|
||||
|
||||
ConfigItems(ServerConfig *conf);
|
||||
~ConfigItems();
|
||||
};
|
||||
|
||||
/** This class holds the bulk of the runtime configuration for Anope.
|
||||
* It allows for reading new config values, accessing configuration files,
|
||||
* and storage of the configuration data needed to run Anope.
|
||||
*/
|
||||
class CoreExport ServerConfig
|
||||
{
|
||||
private:
|
||||
/** Check that there is only one of each configuration item
|
||||
*/
|
||||
bool CheckOnce(const Anope::string &);
|
||||
public:
|
||||
/** This holds all the information in the config file,
|
||||
* it's indexed by tag name to a vector of key/values.
|
||||
*/
|
||||
ConfigDataHash config_data;
|
||||
/** Construct a new ServerConfig
|
||||
*/
|
||||
ServerConfig();
|
||||
|
||||
/** Read the entire configuration into memory
|
||||
* and initialize this class. All other methods
|
||||
* should be used only by the core.
|
||||
*/
|
||||
void Read();
|
||||
/** Load the configuration file into 'this'. With the new config parser everything is parsed into
|
||||
* tag/key/value at load-time rather than at read-value time.
|
||||
*/
|
||||
void LoadConf(ConfigurationFile &file);
|
||||
// Both these return true if the value existed or false otherwise
|
||||
/** Writes 'length' chars into 'result' as a string
|
||||
*/
|
||||
bool ConfValue(ConfigDataHash &, const Anope::string &, const Anope::string &, int, Anope::string &, bool = false);
|
||||
/** Writes 'length' chars into 'result' as a string
|
||||
*/
|
||||
bool ConfValue(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, Anope::string &, bool = false);
|
||||
/** Tries to convert the value to an integer and write it to 'result'
|
||||
*/
|
||||
bool ConfValueInteger(ConfigDataHash &, const Anope::string &, const Anope::string &, int, int &);
|
||||
/** Tries to convert the value to an integer and write it to 'result'
|
||||
*/
|
||||
bool ConfValueInteger(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, int &);
|
||||
/** Returns true if the value exists and has a true value, false otherwise
|
||||
*/
|
||||
bool ConfValueBool(ConfigDataHash &, const Anope::string &, const Anope::string &, int);
|
||||
/** Returns true if the value exists and has a true value, false otherwise
|
||||
*/
|
||||
bool ConfValueBool(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int);
|
||||
/** Returns the number of occurences of tag in the config file
|
||||
*/
|
||||
int ConfValueEnum(const ConfigDataHash &, const Anope::string &);
|
||||
/** Returns the numbers of vars inside the index'th 'tag in the config file
|
||||
*/
|
||||
int ConfVarEnum(ConfigDataHash &, const Anope::string &, int);
|
||||
void ValidateHostname(const Anope::string &, const Anope::string &, const Anope::string &) const;
|
||||
void ValidateIP(const Anope::string &p, const Anope::string &, const Anope::string &, bool) const;
|
||||
void ValidateNoSpaces(const Anope::string &, const Anope::string &, const Anope::string &) const;
|
||||
|
||||
/** Below here is a list of variables which contain the config files values
|
||||
*/
|
||||
/* IRCd module in use */
|
||||
Anope::string IRCDModule;
|
||||
|
||||
/* Host to connect to **/
|
||||
Anope::string LocalHost;
|
||||
/* List of uplink servers to try and connect to */
|
||||
std::list<Uplink *> Uplinks;
|
||||
|
||||
/* Our server name */
|
||||
Anope::string ServerName;
|
||||
/* Our servers description */
|
||||
Anope::string ServerDesc;
|
||||
/* The username/ident of services clients */
|
||||
Anope::string ServiceUser;
|
||||
/* The hostname if services clients */
|
||||
Anope::string ServiceHost;
|
||||
|
||||
/* Name of the network were on */
|
||||
Anope::string NetworkName;
|
||||
/* The max legnth of nicks */
|
||||
unsigned NickLen;
|
||||
/* Max length of idents */
|
||||
unsigned UserLen;
|
||||
/* Max lenght of hostnames */
|
||||
unsigned HostLen;
|
||||
|
||||
/* Max length of passwords */
|
||||
unsigned PassLen;
|
||||
|
||||
/* NickServ Name */
|
||||
Anope::string s_NickServ;
|
||||
/* ChanServ Name */
|
||||
Anope::string s_ChanServ;
|
||||
/* MemoServ Name */
|
||||
Anope::string s_MemoServ;
|
||||
/* BotServ Name */
|
||||
Anope::string s_BotServ;
|
||||
/* OperServ name */
|
||||
Anope::string s_OperServ;
|
||||
/* Global name */
|
||||
Anope::string s_GlobalNoticer;
|
||||
/* NickServs realname */
|
||||
Anope::string desc_NickServ;
|
||||
/* ChanServ realname */
|
||||
Anope::string desc_ChanServ;
|
||||
/* MemoServ realname */
|
||||
Anope::string desc_MemoServ;
|
||||
/* BotServ realname */
|
||||
Anope::string desc_BotServ;
|
||||
/* OperServ realname */
|
||||
Anope::string desc_OperServ;
|
||||
/* Global realname */
|
||||
Anope::string desc_GlobalNoticer;
|
||||
|
||||
/* HostServ Name */
|
||||
Anope::string s_HostServ;
|
||||
/* HostServ realname */
|
||||
Anope::string desc_HostServ;
|
||||
|
||||
/* Filename for the PID file */
|
||||
Anope::string PIDFilename;
|
||||
/* MOTD filename */
|
||||
Anope::string MOTDFilename;
|
||||
|
||||
/* True if its ok to not be able to save backs */
|
||||
bool NoBackupOkay;
|
||||
/* Do password checking when new people register */
|
||||
bool StrictPasswords;
|
||||
/* How many times you're allowed to give a bad password before being killed */
|
||||
unsigned BadPassLimit;
|
||||
/* How long before bad passwords are forgotten */
|
||||
time_t BadPassTimeout;
|
||||
/* Delay between automatic database updates */
|
||||
time_t UpdateTimeout;
|
||||
/* Delay between checks for expired nicks and channels */
|
||||
time_t ExpireTimeout;
|
||||
/* How long to wait for something from the uplink, this is passed to select() */
|
||||
time_t ReadTimeout;
|
||||
/* How often to send program errors */
|
||||
time_t WarningTimeout;
|
||||
/* How long to process things such as timers to see if there is anything to calll */
|
||||
time_t TimeoutCheck;
|
||||
/* Number of days backups are kept */
|
||||
int KeepBackups;
|
||||
/* Forbidding requires a reason */
|
||||
bool ForceForbidReason;
|
||||
/* Services should use privmsgs instead of notices */
|
||||
bool UsePrivmsg;
|
||||
/* Services only respond to full PRIVMSG client@services.server.name messages */
|
||||
bool UseStrictPrivMsg;
|
||||
/* This is not a configurable option.
|
||||
* Config::Config will set it depending on the value of UseStrictPrivMsg */
|
||||
Anope::string UseStrictPrivMsgString;
|
||||
/* Number of seconds between consecutive uses of the REGISTER command
|
||||
* Not to be confused with NSRegDelay */
|
||||
unsigned NickRegDelay;
|
||||
/* Max number if news items allowed in the list */
|
||||
unsigned NewsCount;
|
||||
/* Default mlock modes */
|
||||
Anope::string MLock;
|
||||
/* Unmlockable modes */
|
||||
Anope::string NoMLock;
|
||||
/* Default botmodes on channels, defaults to ao */
|
||||
Anope::string BotModes;
|
||||
/* THe actual modes */
|
||||
ChannelStatus BotModeList;
|
||||
/* How many times to try and reconnect to the uplink before giving up */
|
||||
unsigned MaxRetries;
|
||||
/* How long to wait between connection attempts */
|
||||
int RetryWait;
|
||||
/* If services should hide unprivileged commands */
|
||||
bool HidePrivilegedCommands;
|
||||
|
||||
/* A vector of our logfile options */
|
||||
std::vector<LogInfo *> LogInfos;
|
||||
|
||||
/* Services can use email */
|
||||
bool UseMail;
|
||||
/* Path to the sendmail executable */
|
||||
Anope::string SendMailPath;
|
||||
/* Address to send from */
|
||||
Anope::string SendFrom;
|
||||
/* Only opers can have services send mail */
|
||||
bool RestrictMail;
|
||||
/* Delay between sending mail */
|
||||
time_t MailDelay;
|
||||
/* Don't quote the To: address */
|
||||
bool DontQuoteAddresses;
|
||||
|
||||
/* Nameserver to use for resolving hostnames */
|
||||
Anope::string NameServer;
|
||||
/* TIme before a DNS query is considered dead */
|
||||
time_t DNSTimeout;
|
||||
|
||||
/* Prefix of guest nicks when a user gets forced off of a nick */
|
||||
Anope::string NSGuestNickPrefix;
|
||||
/* Allow users to set kill immed on */
|
||||
bool NSAllowKillImmed;
|
||||
/* Don't allow nicks to use /ns group to regroup nicks */
|
||||
bool NSNoGroupChange;
|
||||
/* Default flags for newly registered nicks */
|
||||
Flags<NickCoreFlag, NI_END> NSDefFlags;
|
||||
/* All languages Anope is aware about */
|
||||
Anope::string Languages;
|
||||
/* Default language used by services */
|
||||
Anope::string NSDefLanguage;
|
||||
/* Users must be connected this long before they can register
|
||||
* Not to be confused with NickRegDelay */
|
||||
time_t NSRegDelay;
|
||||
/* Time before the registering mail will be resent */
|
||||
time_t NSResendDelay;
|
||||
/* How long before nicks expire */
|
||||
time_t NSExpire;
|
||||
/* How long before suspended nicks expire */
|
||||
time_t NSSuspendExpire;
|
||||
/* How long before forbidden nicks expire */
|
||||
time_t NSForbidExpire;
|
||||
/* Time before unconfirmed nicks expire */
|
||||
time_t NSUnconfirmedExpire;
|
||||
/* Force email when registering */
|
||||
bool NSForceEmail;
|
||||
/* Force users to validate new email addresses */
|
||||
bool NSConfirmEmailChanges;
|
||||
/* Max number of nicks in a group */
|
||||
unsigned NSMaxAliases;
|
||||
/* Max number of allowed strings on the access list */
|
||||
unsigned NSAccessMax;
|
||||
/* Enforcer client user name */
|
||||
Anope::string NSEnforcerUser;
|
||||
/* Enforcer client hostname */
|
||||
Anope::string NSEnforcerHost;
|
||||
/* How long before recovered nicks are released */
|
||||
time_t NSReleaseTimeout;
|
||||
/* /nickserv list is oper only */
|
||||
bool NSListOpersOnly;
|
||||
/* Max number of entries that can be returned from the list command */
|
||||
unsigned NSListMax;
|
||||
/* Only allow usermode +a etc on real services admins */
|
||||
bool NSSecureAdmins;
|
||||
/* Services opers must be /operd on the ircd aswell */
|
||||
bool NSStrictPrivileges;
|
||||
/* Use email to verify new users registering */
|
||||
bool NSEmailReg;
|
||||
/* Set the proper channel modes on users when they identify */
|
||||
bool NSModeOnID;
|
||||
/* Add the users hostnask their access list when they register */
|
||||
bool NSAddAccessOnReg;
|
||||
/* Maximum number of channels on AJoin */
|
||||
unsigned AJoinMax;
|
||||
|
||||
/* Default flags for newly registered channels */
|
||||
Flags<ChannelInfoFlag, CI_END> CSDefFlags;
|
||||
/* Max number of channels a user can own */
|
||||
unsigned CSMaxReg;
|
||||
/* Time before a channel expires */
|
||||
time_t CSExpire;
|
||||
/* How long before suspended channels expire */
|
||||
time_t CSSuspendExpire;
|
||||
/* How long before forbidden channels expire */
|
||||
time_t CSForbidExpire;
|
||||
/* Default ban type to use for channels */
|
||||
int CSDefBantype;
|
||||
/* Max number of entries allowed on channel access lists */
|
||||
unsigned CSAccessMax;
|
||||
/* Max number of entries allowed on autokick lists */
|
||||
unsigned CSAutokickMax;
|
||||
/* Default autokick reason */
|
||||
Anope::string CSAutokickReason;
|
||||
/* Time ChanServ should stay in the channel to hold it to keep users from getting in */
|
||||
time_t CSInhabit;
|
||||
/* ChanServ's LIST command is oper only */
|
||||
bool CSListOpersOnly;
|
||||
/* Max number of entries allowed to be returned from the LIST command */
|
||||
unsigned CSListMax;
|
||||
/* true to make ChanServ oper only */
|
||||
bool CSOpersOnly;
|
||||
|
||||
/* Max number of memos allowed */
|
||||
unsigned MSMaxMemos;
|
||||
/* Time you must wait between sending memos */
|
||||
time_t MSSendDelay;
|
||||
/* Notify all of the aliases of the core the memo was sent to */
|
||||
bool MSNotifyAll;
|
||||
/* Who can use memos reciepts */
|
||||
unsigned MSMemoReceipt;
|
||||
|
||||
/* Defai;t BotServ flags */
|
||||
Flags<BotServFlag> BSDefFlags;
|
||||
/* How long before botserv forgets a user. This is used for flood kickers etc */
|
||||
time_t BSKeepData;
|
||||
/* Min number of users to have in the channel before the service bot joins */
|
||||
unsigned BSMinUsers;
|
||||
/* Max number of words allowed on the badwordslist */
|
||||
unsigned BSBadWordsMax;
|
||||
/* BotServ bot only joins if it would normally allowed to, abides by bans etc */
|
||||
bool BSSmartJoin;
|
||||
/* Dont tell users what badword they used */
|
||||
bool BSGentleBWReason;
|
||||
/* Case sensitive badwords matching */
|
||||
bool BSCaseSensitive;
|
||||
/* Char to use for the fantasy char, eg ! */
|
||||
Anope::string BSFantasyCharacter;
|
||||
|
||||
/* Only show /stats o to opers */
|
||||
bool HideStatsO;
|
||||
/* Send out a global when services shut down or restart */
|
||||
bool GlobalOnCycle;
|
||||
/* Don't include the opers name in globals */
|
||||
bool AnonymousGlobal;
|
||||
/* Dont allow users to register nicks with oper names in them */
|
||||
bool RestrictOperNicks;
|
||||
/* Message to send when shutting down */
|
||||
Anope::string GlobalOnCycleMessage;
|
||||
/* Message to send when starting up */
|
||||
Anope::string GlobalOnCycleUP;
|
||||
/* Super admin is allowed */
|
||||
bool SuperAdmin;
|
||||
/* Default expiry time for akills */
|
||||
time_t AutokillExpiry;
|
||||
/* Default expiry time for chan kills */
|
||||
time_t ChankillExpiry;
|
||||
/* Default expiry time for SNLine Expire */
|
||||
time_t SNLineExpiry;
|
||||
/* Default expiry time for SQLines */
|
||||
time_t SQLineExpiry;
|
||||
/* Default expiry time for SZLine */
|
||||
time_t SZLineExpiry;
|
||||
/* Actually akill the user when the akill is added */
|
||||
bool AkillOnAdd;
|
||||
/* Kill users on SNLine */
|
||||
bool KillonSNline;
|
||||
/* Kill users on SQline */
|
||||
bool KillonSQline;
|
||||
/* Send a WALLOPS/GLOBOPS when a user opers */
|
||||
bool WallOper;
|
||||
/* Send a WALLOPS/GLOBOPS when a nonoper tries to use OperServ */
|
||||
bool WallBadOS;
|
||||
/* Send a WALLOPS/GLOBOPS when an akill expires */
|
||||
bool WallAkillExpire;
|
||||
/* Send a WALLOPS/GLOBOPS when SNLines expire */
|
||||
bool WallSNLineExpire;
|
||||
/* Send a WALLOPS/GLOBOPS when SQLines expire */
|
||||
bool WallSQLineExpire;
|
||||
/* Send a WALLOPS/GLOBOPS when SZLines expire */
|
||||
bool WallSZLineExpire;
|
||||
/* Send a WALLOPS/GLOBOPS when exceptions expire */
|
||||
bool WallExceptionExpire;
|
||||
/* Add the akillers nick to the akill reason */
|
||||
bool AddAkiller;
|
||||
|
||||
/* Limit sessions */
|
||||
bool LimitSessions;
|
||||
/* The default session limit */
|
||||
unsigned DefSessionLimit;
|
||||
/* How long before exceptions expire */
|
||||
time_t ExceptionExpiry;
|
||||
/* How many times to kill before adding an KILL */
|
||||
unsigned MaxSessionKill;
|
||||
/* Max limit that can be used for exceptions */
|
||||
unsigned MaxSessionLimit;
|
||||
/* How long session akills should last */
|
||||
time_t SessionAutoKillExpiry;
|
||||
/* Reason to use for session kills */
|
||||
Anope::string SessionLimitExceeded;
|
||||
/* Optional second reason */
|
||||
Anope::string SessionLimitDetailsLoc;
|
||||
/* OperServ requires you to be an operator */
|
||||
bool OSOpersOnly;
|
||||
|
||||
/* List of modules to autoload */
|
||||
std::list<Anope::string> ModulesAutoLoad;
|
||||
/* Encryption modules */
|
||||
std::list<Anope::string> EncModuleList;
|
||||
/* Database modules */
|
||||
std::list<Anope::string> DBModuleList;
|
||||
/* HostServ Core Modules */
|
||||
std::list<Anope::string> HostServCoreModules;
|
||||
/* MemoServ Core Modules */
|
||||
std::list<Anope::string> MemoServCoreModules;
|
||||
/* BotServ Core Modules */
|
||||
std::list<Anope::string> BotServCoreModules;
|
||||
/* OperServ Core Modules */
|
||||
std::list<Anope::string> OperServCoreModules;
|
||||
/* NickServ Core Modules */
|
||||
std::list<Anope::string> NickServCoreModules;
|
||||
/* ChanServ Core Modules */
|
||||
std::list<Anope::string> ChanServCoreModules;
|
||||
|
||||
/* Default defcon level */
|
||||
int DefConLevel;
|
||||
/* Timeout before defcon is reset */
|
||||
time_t DefConTimeOut;
|
||||
/* Session limiit to use when using defcon */
|
||||
unsigned DefConSessionLimit;
|
||||
/* How long to add akills for defcon */
|
||||
time_t DefConAKILL;
|
||||
/* Chan modes for defcon */
|
||||
Anope::string DefConChanModes;
|
||||
/* Should we global on defcon */
|
||||
bool GlobalOnDefcon;
|
||||
/* Should we send DefconMessage aswell? */
|
||||
bool GlobalOnDefconMore;
|
||||
/* Message to send when defcon is off */
|
||||
Anope::string DefConOffMessage;
|
||||
/* Message to send when defcon is on*/
|
||||
Anope::string DefconMessage;
|
||||
/* Reason to akill clients for defcon */
|
||||
Anope::string DefConAkillReason;
|
||||
|
||||
/* The socket engine in use */
|
||||
Anope::string SocketEngine;
|
||||
|
||||
/* User keys to use for generating random hashes for pass codes etc */
|
||||
unsigned long UserKey1;
|
||||
unsigned long UserKey2;
|
||||
unsigned long UserKey3;
|
||||
|
||||
/* Numeric */
|
||||
Anope::string Numeric;
|
||||
/* Array of ulined servers */
|
||||
std::list<Anope::string> Ulines;
|
||||
|
||||
/* List of available opertypes */
|
||||
std::list<OperType *> MyOperTypes;
|
||||
/* List of pairs of opers and their opertype from the config */
|
||||
std::vector<Oper *> Opers;
|
||||
};
|
||||
|
||||
/** This class can be used on its own to represent an exception, or derived to represent a module-specific exception.
|
||||
* When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or
|
||||
* a class derived from ModuleException. If a module throws an exception during its constructor, the module will not
|
||||
* be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user
|
||||
* attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.
|
||||
*/
|
||||
class ConfigException : public CoreException
|
||||
{
|
||||
public:
|
||||
/** Default constructor, just uses the error mesage 'Config threw an exception'.
|
||||
*/
|
||||
ConfigException() : CoreException("Config threw an exception", "Config Parser") { }
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
ConfigException(const Anope::string &message) : CoreException(message, "Config Parser") { }
|
||||
/** This destructor solves world hunger, cancels the world debt, and causes the world to end.
|
||||
* Actually no, it does nothing. Never mind.
|
||||
* @throws Nothing!
|
||||
*/
|
||||
virtual ~ConfigException() throw() { }
|
||||
};
|
||||
|
||||
#define CONF_NO_ERROR 0x000000
|
||||
#define CONF_NOT_A_NUMBER 0x000010
|
||||
#define CONF_INT_NEGATIVE 0x000080
|
||||
#define CONF_VALUE_NOT_FOUND 0x000100
|
||||
#define CONF_FILE_NOT_FOUND 0x000200
|
||||
|
||||
/** Allows reading of values from configuration files
|
||||
* This class allows a module to read from either the main configuration file (inspircd.conf) or from
|
||||
* a module-specified configuration file. It may either be instantiated with one parameter or none.
|
||||
* Constructing the class using one parameter allows you to specify a path to your own configuration
|
||||
* file, otherwise, inspircd.conf is read.
|
||||
*/
|
||||
class CoreExport ConfigReader
|
||||
{
|
||||
protected:
|
||||
/** True if an error occured reading the config file
|
||||
*/
|
||||
bool readerror;
|
||||
/** Error code
|
||||
*/
|
||||
long error;
|
||||
public:
|
||||
/** Default constructor.
|
||||
* This constructor initialises the ConfigReader class to read the configuration file(s).
|
||||
*/
|
||||
ConfigReader();
|
||||
/** Overloaded constructor.
|
||||
* This constructor initialises the ConfigReader class to read a user-specified config file
|
||||
*/
|
||||
ConfigReader(const Anope::string &);
|
||||
/** Default destructor.
|
||||
* This method destroys the ConfigReader class.
|
||||
*/
|
||||
~ConfigReader();
|
||||
/** Retrieves a value from the config file.
|
||||
* This method retrieves a value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve.
|
||||
*/
|
||||
Anope::string ReadValue(const Anope::string &, const Anope::string &, int, bool = false);
|
||||
/** Retrieves a value from the config file.
|
||||
* This method retrieves a value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. If the
|
||||
* tag is not found the default value is returned instead.
|
||||
*/
|
||||
Anope::string ReadValue(const Anope::string &, const Anope::string &, const Anope::string &, int, bool = false);
|
||||
/** Retrieves a boolean value from the config file.
|
||||
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
|
||||
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
|
||||
*/
|
||||
bool ReadFlag(const Anope::string &, const Anope::string &, int);
|
||||
/** Retrieves a boolean value from the config file.
|
||||
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
|
||||
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
|
||||
* If the tag is not found, the default value is used instead.
|
||||
*/
|
||||
bool ReadFlag(const Anope::string &, const Anope::string &, const Anope::string &, int);
|
||||
/** Retrieves an integer value from the config file.
|
||||
* This method retrieves an integer value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
|
||||
* values in the tag will cause the objects error value to be set, and any call to GetError() will
|
||||
* return CONF_INVALID_NUMBER to be returned. need_positive is set if the number must be non-negative.
|
||||
* If a negative number is placed into a tag which is specified positive, 0 will be returned and GetError()
|
||||
* will return CONF_INT_NEGATIVE. Note that need_positive is not suitable to get an unsigned int - you
|
||||
* should cast the result to achieve that effect.
|
||||
*/
|
||||
int ReadInteger(const Anope::string &, const Anope::string &, int, bool);
|
||||
/** Retrieves an integer value from the config file.
|
||||
* This method retrieves an integer value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
|
||||
* values in the tag will cause the objects error value to be set, and any call to GetError() will
|
||||
* return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned.
|
||||
* If a signed number is placed into a tag which is specified unsigned, 0 will be returned and GetError()
|
||||
* will return CONF_NOT_UNSIGNED. If the tag is not found, the default value is used instead.
|
||||
*/
|
||||
int ReadInteger(const Anope::string &, const Anope::string &, const Anope::string &, int, bool);
|
||||
/** Returns the last error to occur.
|
||||
* Valid errors can be found by looking in modules.h. Any nonzero value indicates an error condition.
|
||||
* A call to GetError() resets the error flag back to 0.
|
||||
*/
|
||||
long GetError();
|
||||
/** Counts the number of times a given tag appears in the config file.
|
||||
* This method counts the number of times a tag appears in a config file, for use where
|
||||
* there are several tags of the same kind, e.g. with opers and connect types. It can be
|
||||
* used with the index value of ConfigReader::ReadValue to loop through all copies of a
|
||||
* multiple instance tag.
|
||||
*/
|
||||
int Enumerate(const Anope::string &) const;
|
||||
/** Returns true if a config file is valid.
|
||||
* This method is partially implemented and will only return false if the config
|
||||
* file does not exist or could not be opened.
|
||||
*/
|
||||
bool Verify();
|
||||
/** Returns the number of items within a tag.
|
||||
* For example if the tag was <test tag="blah" data="foo"> then this
|
||||
* function would return 2. Spaces and newlines both qualify as valid seperators
|
||||
* between values.
|
||||
*/
|
||||
int EnumerateValues(const Anope::string &, int);
|
||||
};
|
||||
|
||||
#endif // CONFIG_H
|
||||
|
||||
@@ -1,518 +0,0 @@
|
||||
#ifndef _CONFIGREADER_H_
|
||||
#define _CONFIGREADER_H_
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <deque>
|
||||
|
||||
/** A configuration key and value pair
|
||||
*/
|
||||
typedef std::pair<std::string, std::string> KeyVal;
|
||||
|
||||
/** A list of related configuration keys and values
|
||||
*/
|
||||
typedef std::vector<KeyVal> KeyValList;
|
||||
|
||||
/** An entire config file, built up of KeyValLists
|
||||
*/
|
||||
typedef std::multimap<std::string, KeyValList> ConfigDataHash;
|
||||
|
||||
// Required forward definitions
|
||||
class ServerConfig;
|
||||
|
||||
/** Types of data in the core config
|
||||
*/
|
||||
enum ConfigDataType {
|
||||
DT_NOTHING, // No data
|
||||
DT_INTEGER, // Integer
|
||||
DT_UINTEGER, // Unsigned Integer
|
||||
DT_LUINTEGER, // Long Unsigned Integer
|
||||
DT_CHARPTR, // Char pointer
|
||||
DT_STRING, // std::string
|
||||
DT_BOOLEAN, // Boolean
|
||||
DT_HOSTNAME, // Hostname syntax
|
||||
DT_NOSPACES, // No spaces
|
||||
DT_IPADDRESS, // IP address (v4, v6)
|
||||
DT_TIME, // Time value
|
||||
DT_NORELOAD = 32, // Item can't be reloaded after startup
|
||||
DT_ALLOW_WILD = 64, // Allow wildcards/CIDR in DT_IPADDRESS
|
||||
DT_ALLOW_NEWLINE = 128 // New line characters allowed in DT_CHARPTR
|
||||
};
|
||||
|
||||
/** Holds a config value, either string, integer or boolean.
|
||||
* Callback functions receive one or more of these, either on
|
||||
* their own as a reference, or in a reference to a deque of them.
|
||||
* The callback function can then alter the values of the ValueItem
|
||||
* classes to validate the settings.
|
||||
*/
|
||||
class ValueItem
|
||||
{
|
||||
/** Actual data */
|
||||
std::string v;
|
||||
public:
|
||||
/** Initialize with an int */
|
||||
ValueItem(int);
|
||||
/** Initialize with a bool */
|
||||
ValueItem(bool);
|
||||
/** Initialize with a char pointer */
|
||||
ValueItem(const char *);
|
||||
/** Initialize with an std::string */
|
||||
ValueItem(const std::string &);
|
||||
/** Change value to a char pointer */
|
||||
//void Set(char *);
|
||||
/** Change value to a const char pointer */
|
||||
void Set(const char *);
|
||||
/** Change value to an std::string */
|
||||
void Set(const std::string &);
|
||||
/** Change value to an int */
|
||||
void Set(int);
|
||||
/** Get value as an int */
|
||||
int GetInteger();
|
||||
/** Get value as a string */
|
||||
char *GetString();
|
||||
/** Get value as a bool */
|
||||
bool GetBool();
|
||||
};
|
||||
|
||||
/** The base class of the container 'ValueContainer'
|
||||
* used internally by the core to hold core values.
|
||||
*/
|
||||
class ValueContainerBase
|
||||
{
|
||||
public:
|
||||
/** Constructor */
|
||||
ValueContainerBase() { }
|
||||
/** Destructor */
|
||||
virtual ~ValueContainerBase() { }
|
||||
};
|
||||
|
||||
/** ValueContainer is used to contain pointers to different
|
||||
* core values such as the server name, maximum number of
|
||||
* clients etc.
|
||||
* It is specialized to hold a data type, then pointed at
|
||||
* a value in the ServerConfig class. When the value has been
|
||||
* read and validated, the Set method is called to write the
|
||||
* value safely in a type-safe manner.
|
||||
*/
|
||||
template<typename T> class ValueContainer : public ValueContainerBase
|
||||
{
|
||||
/** Contained item */
|
||||
T val;
|
||||
public:
|
||||
/** Initialize with nothing */
|
||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
||||
/** Initialize with a value of type T */
|
||||
ValueContainer(T Val) : ValueContainerBase(), val(Val) { }
|
||||
/** Initialize with a copy */
|
||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
||||
ValueContainer &operator=(const ValueContainer &Val)
|
||||
{
|
||||
val = Val.val;
|
||||
return *this;
|
||||
}
|
||||
/** Change value to type T of size s */
|
||||
void Set(const T newval, size_t s)
|
||||
{
|
||||
memcpy(val, newval, s);
|
||||
}
|
||||
};
|
||||
|
||||
/** This a specific version of ValueContainer to handle character arrays specially
|
||||
*/
|
||||
template<> class ValueContainer<char **> : public ValueContainerBase
|
||||
{
|
||||
/** Contained item */
|
||||
char **val;
|
||||
public:
|
||||
/** Initialize with nothing */
|
||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
||||
/** Initialize with a value of type T */
|
||||
ValueContainer(char **Val) : ValueContainerBase(), val(Val) { }
|
||||
/** Initialize with a copy */
|
||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
||||
ValueContainer &operator=(const ValueContainer &Val)
|
||||
{
|
||||
val = Val.val;
|
||||
return *this;
|
||||
}
|
||||
/** Change value to type T of size s */
|
||||
void Set(const char *newval, size_t s)
|
||||
{
|
||||
if (*val) delete [] *val;
|
||||
if (!*newval) {
|
||||
*val = NULL;
|
||||
return;
|
||||
}
|
||||
*val = new char[s];
|
||||
strlcpy(*val, newval, s);
|
||||
}
|
||||
};
|
||||
|
||||
/** This a specific version of ValueContainer to handle std::string specially
|
||||
*/
|
||||
template<> class ValueContainer<std::string *> : public ValueContainerBase
|
||||
{
|
||||
/** Contained item */
|
||||
std::string *val;
|
||||
public:
|
||||
/** Initialize with nothing */
|
||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
||||
/** Initialize with an std::string */
|
||||
ValueContainer(std::string *Val) : ValueContainerBase(), val(Val) { }
|
||||
/** Initialize with a copy */
|
||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
||||
ValueContainer &operator=(const ValueContainer &Val)
|
||||
{
|
||||
val = Val.val;
|
||||
return *this;
|
||||
}
|
||||
/** Change value to given std::string */
|
||||
void Set(const std::string &newval)
|
||||
{
|
||||
*val = newval;
|
||||
}
|
||||
/** Change value to given char pointer */
|
||||
void Set(const char *newval)
|
||||
{
|
||||
*val = newval;
|
||||
}
|
||||
};
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to a bool
|
||||
*/
|
||||
typedef ValueContainer<bool *> ValueContainerBool;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* an unsigned int
|
||||
*/
|
||||
typedef ValueContainer<unsigned *> ValueContainerUInt;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* a long unsigned int
|
||||
*/
|
||||
typedef ValueContainer<long unsigned *> ValueContainerLUInt;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* a char array.
|
||||
*/
|
||||
typedef ValueContainer<char **> ValueContainerChar;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* an int
|
||||
*/
|
||||
typedef ValueContainer<int *> ValueContainerInt;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* a time_t
|
||||
*/
|
||||
typedef ValueContainer<time_t *> ValueContainerTime;
|
||||
|
||||
/** A specialization of ValueContainer to hold a pointer to
|
||||
* an std::string
|
||||
*/
|
||||
typedef ValueContainer<std::string *> ValueContainerString;
|
||||
|
||||
/** A set of ValueItems used by multi-value validator functions
|
||||
*/
|
||||
typedef std::deque<ValueItem> ValueList;
|
||||
|
||||
/** A callback for validating a single value
|
||||
*/
|
||||
typedef bool (*Validator)(ServerConfig *, const char *, const char *, ValueItem &);
|
||||
/** A callback for validating multiple value entries
|
||||
*/
|
||||
typedef bool (*MultiValidator)(ServerConfig *, const char *, const char **, ValueList &, int *, bool);
|
||||
/** A callback indicating the end of a group of entries
|
||||
*/
|
||||
typedef bool (*MultiNotify)(ServerConfig *, const char *, bool);
|
||||
|
||||
/** Holds a core configuration item and its callbacks
|
||||
*/
|
||||
struct InitialConfig
|
||||
{
|
||||
/** Tag name */
|
||||
const char *tag;
|
||||
/** Value name */
|
||||
const char *value;
|
||||
/** Default, if not defined */
|
||||
const char *default_value;
|
||||
/** Value containers */
|
||||
ValueContainerBase *val;
|
||||
/** Data types */
|
||||
int datatype;
|
||||
/** Validation function */
|
||||
Validator validation_function;
|
||||
};
|
||||
|
||||
/** Holds a core configuration item and its callbacks
|
||||
* where there may be more than one item
|
||||
*/
|
||||
struct MultiConfig
|
||||
{
|
||||
/** Tag name */
|
||||
const char *tag;
|
||||
/** One or more items within tag */
|
||||
const char *items[17];
|
||||
/** One or more defaults for items within tags */
|
||||
const char *items_default[17];
|
||||
/** One or more data types */
|
||||
int datatype[17];
|
||||
/** Initialization function */
|
||||
MultiNotify init_function;
|
||||
/** Validation function */
|
||||
MultiValidator validation_function;
|
||||
/** Completion function */
|
||||
MultiNotify finish_function;
|
||||
};
|
||||
|
||||
/** This class holds the bulk of the runtime configuration for the ircd.
|
||||
* It allows for reading new config values, accessing configuration files,
|
||||
* and storage of the configuration data needed to run the ircd, such as
|
||||
* the servername, connect classes, /ADMIN data, MOTDs and filenames etc.
|
||||
*/
|
||||
class ServerConfig
|
||||
{
|
||||
private:
|
||||
/** This variable holds the names of all
|
||||
* files included from the main one. This
|
||||
* is used to make sure that no files are
|
||||
* recursively included.
|
||||
*/
|
||||
std::vector<std::string> include_stack;
|
||||
/** Check that there is only one of each configuration item
|
||||
*/
|
||||
bool CheckOnce(const char *);
|
||||
public:
|
||||
std::ostringstream errstr;
|
||||
ConfigDataHash newconfig;
|
||||
/** This holds all the information in the config file,
|
||||
* it's indexed by tag name to a vector of key/values.
|
||||
*/
|
||||
ConfigDataHash config_data;
|
||||
/** Construct a new ServerConfig
|
||||
*/
|
||||
ServerConfig();
|
||||
/** Clears the include stack in preperation for a Read() call.
|
||||
*/
|
||||
void ClearStack();
|
||||
/** Read the entire configuration into memory
|
||||
* and initialize this class. All other methods
|
||||
* should be used only by the core.
|
||||
*/
|
||||
int Read(bool);
|
||||
/** Report a configuration error given in errormessage.
|
||||
* @param bail If this is set to true, the error is sent to the console, and the program exits
|
||||
* @param connection If this is set to a non-null value, and bail is false, the errors are spooled to
|
||||
* this connection as SNOTICEs.
|
||||
* If the parameter is NULL, the messages are spooled to all connections via WriteOpers as SNOTICEs.
|
||||
*/
|
||||
void ReportConfigError(const std::string &, bool);
|
||||
/** Load 'filename' into 'target', with the new config parser everything is parsed into
|
||||
* tag/key/value at load-time rather than at read-value time.
|
||||
*/
|
||||
bool LoadConf(ConfigDataHash &, const char *, std::ostringstream &);
|
||||
/** Load 'filename' into 'target', with the new config parser everything is parsed into
|
||||
* tag/key/value at load-time rather than at read-value time.
|
||||
*/
|
||||
bool LoadConf(ConfigDataHash &, const std::string &, std::ostringstream &);
|
||||
// Both these return true if the value existed or false otherwise
|
||||
/** Writes 'length' chars into 'result' as a string
|
||||
*/
|
||||
bool ConfValue(ConfigDataHash &, const char *, const char *, int, char *, int, bool = false);
|
||||
/** Writes 'length' chars into 'result' as a string
|
||||
*/
|
||||
bool ConfValue(ConfigDataHash &, const char *, const char *, const char *, int, char *, int, bool = false);
|
||||
/** Writes 'length' chars into 'result' as a string
|
||||
*/
|
||||
bool ConfValue(ConfigDataHash &, const std::string &, const std::string &, int, std::string &, bool = false);
|
||||
/** Writes 'length' chars into 'result' as a string
|
||||
*/
|
||||
bool ConfValue(ConfigDataHash &, const std::string &, const std::string &, const std::string &, int, std::string &, bool = false);
|
||||
/** Tries to convert the value to an integer and write it to 'result'
|
||||
*/
|
||||
bool ConfValueInteger(ConfigDataHash &, const char *, const char *, int, int &);
|
||||
/** Tries to convert the value to an integer and write it to 'result'
|
||||
*/
|
||||
bool ConfValueInteger(ConfigDataHash &, const char *, const char *, const char *, int, int &);
|
||||
/** Tries to convert the value to an integer and write it to 'result'
|
||||
*/
|
||||
bool ConfValueInteger(ConfigDataHash &, const std::string &, const std::string &, int, int &);
|
||||
/** Tries to convert the value to an integer and write it to 'result'
|
||||
*/
|
||||
bool ConfValueInteger(ConfigDataHash &, const std::string &, const std::string &, const std::string &, int, int &);
|
||||
/** Returns true if the value exists and has a true value, false otherwise
|
||||
*/
|
||||
bool ConfValueBool(ConfigDataHash &, const char *, const char *, int);
|
||||
/** Returns true if the value exists and has a true value, false otherwise
|
||||
*/
|
||||
bool ConfValueBool(ConfigDataHash &, const char *, const char *, const char *, int);
|
||||
/** Returns true if the value exists and has a true value, false otherwise
|
||||
*/
|
||||
bool ConfValueBool(ConfigDataHash &, const std::string &, const std::string &, int);
|
||||
/** Returns true if the value exists and has a true value, false otherwise
|
||||
*/
|
||||
bool ConfValueBool(ConfigDataHash &, const std::string &, const std::string &, const std::string &, int);
|
||||
/** Returns the number of occurences of tag in the config file
|
||||
*/
|
||||
int ConfValueEnum(ConfigDataHash &, const char *);
|
||||
/** Returns the number of occurences of tag in the config file
|
||||
*/
|
||||
int ConfValueEnum(ConfigDataHash &, const std::string &);
|
||||
/** Returns the numbers of vars inside the index'th 'tag in the config file
|
||||
*/
|
||||
int ConfVarEnum(ConfigDataHash &, const char *, int);
|
||||
/** Returns the numbers of vars inside the index'th 'tag in the config file
|
||||
*/
|
||||
int ConfVarEnum(ConfigDataHash &, const std::string &, int);
|
||||
void ValidateHostname(const char *, const std::string &, const std::string &);
|
||||
void ValidateIP(const char *p, const std::string &, const std::string &, bool);
|
||||
void ValidateNoSpaces(const char *, const std::string &, const std::string &);
|
||||
};
|
||||
|
||||
/** This class can be used on its own to represent an exception, or derived to represent a module-specific exception.
|
||||
* When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or
|
||||
* a class derived from ModuleException. If a module throws an exception during its constructor, the module will not
|
||||
* be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user
|
||||
* attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.
|
||||
*/
|
||||
class ConfigException : public CoreException
|
||||
{
|
||||
public:
|
||||
/** Default constructor, just uses the error mesage 'Config threw an exception'.
|
||||
*/
|
||||
ConfigException() : CoreException("Config threw an exception", "Config Parser") {}
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
ConfigException(const std::string &message) : CoreException(message, "Config Parser") {}
|
||||
/** This destructor solves world hunger, cancels the world debt, and causes the world to end.
|
||||
* Actually no, it does nothing. Never mind.
|
||||
* @throws Nothing!
|
||||
*/
|
||||
virtual ~ConfigException() throw() { };
|
||||
};
|
||||
|
||||
#define CONF_NO_ERROR 0x000000
|
||||
#define CONF_NOT_A_NUMBER 0x000010
|
||||
#define CONF_INT_NEGATIVE 0x000080
|
||||
#define CONF_VALUE_NOT_FOUND 0x000100
|
||||
#define CONF_FILE_NOT_FOUND 0x000200
|
||||
|
||||
/** Allows reading of values from configuration files
|
||||
* This class allows a module to read from either the main configuration file (inspircd.conf) or from
|
||||
* a module-specified configuration file. It may either be instantiated with one parameter or none.
|
||||
* Constructing the class using one parameter allows you to specify a path to your own configuration
|
||||
* file, otherwise, inspircd.conf is read.
|
||||
*/
|
||||
class CoreExport ConfigReader
|
||||
{
|
||||
protected:
|
||||
/** The contents of the configuration file
|
||||
* This protected member should never be accessed by a module (and cannot be accessed unless the
|
||||
* core is changed). It will contain a pointer to the configuration file data with unneeded data
|
||||
* (such as comments) stripped from it.
|
||||
*/
|
||||
ConfigDataHash *data;
|
||||
/** Used to store errors
|
||||
*/
|
||||
std::ostringstream *errorlog;
|
||||
/** If we're using our own config data hash or not
|
||||
*/
|
||||
bool privatehash;
|
||||
/** True if an error occured reading the config file
|
||||
*/
|
||||
bool readerror;
|
||||
/** Error code
|
||||
*/
|
||||
long error;
|
||||
public:
|
||||
/** Default constructor.
|
||||
* This constructor initialises the ConfigReader class to read services.conf.
|
||||
*/
|
||||
ConfigReader();
|
||||
/** Overloaded constructor.
|
||||
* This constructor initialises the ConfigReader class to read a user-specified config file
|
||||
*/
|
||||
ConfigReader(const std::string &);
|
||||
/** Default destructor.
|
||||
* This method destroys the ConfigReader class.
|
||||
*/
|
||||
~ConfigReader();
|
||||
/** Retrieves a value from the config file.
|
||||
* This method retrieves a value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve.
|
||||
*/
|
||||
std::string ReadValue(const std::string &, const std::string &, int, bool = false);
|
||||
/** Retrieves a value from the config file.
|
||||
* This method retrieves a value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. If the
|
||||
* tag is not found the default value is returned instead.
|
||||
*/
|
||||
std::string ReadValue(const std::string &, const std::string &, const std::string &, int, bool = false);
|
||||
/** Retrieves a boolean value from the config file.
|
||||
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
|
||||
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
|
||||
*/
|
||||
bool ReadFlag(const std::string &, const std::string &, int);
|
||||
/** Retrieves a boolean value from the config file.
|
||||
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
|
||||
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
|
||||
* If the tag is not found, the default value is used instead.
|
||||
*/
|
||||
bool ReadFlag(const std::string &, const std::string &, const std::string &, int);
|
||||
/** Retrieves an integer value from the config file.
|
||||
* This method retrieves an integer value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
|
||||
* values in the tag will cause the objects error value to be set, and any call to GetError() will
|
||||
* return CONF_INVALID_NUMBER to be returned. need_positive is set if the number must be non-negative.
|
||||
* If a negative number is placed into a tag which is specified positive, 0 will be returned and GetError()
|
||||
* will return CONF_INT_NEGATIVE. Note that need_positive is not suitable to get an unsigned int - you
|
||||
* should cast the result to achieve that effect.
|
||||
*/
|
||||
int ReadInteger(const std::string &, const std::string &, int, bool);
|
||||
/** Retrieves an integer value from the config file.
|
||||
* This method retrieves an integer value from the config file. Where multiple copies of the tag
|
||||
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
|
||||
* values in the tag will cause the objects error value to be set, and any call to GetError() will
|
||||
* return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned.
|
||||
* If a signed number is placed into a tag which is specified unsigned, 0 will be returned and GetError()
|
||||
* will return CONF_NOT_UNSIGNED. If the tag is not found, the default value is used instead.
|
||||
*/
|
||||
int ReadInteger(const std::string &, const std::string &, const std::string &, int, bool);
|
||||
/** Returns the last error to occur.
|
||||
* Valid errors can be found by looking in modules.h. Any nonzero value indicates an error condition.
|
||||
* A call to GetError() resets the error flag back to 0.
|
||||
*/
|
||||
long GetError();
|
||||
/** Counts the number of times a given tag appears in the config file.
|
||||
* This method counts the number of times a tag appears in a config file, for use where
|
||||
* there are several tags of the same kind, e.g. with opers and connect types. It can be
|
||||
* used with the index value of ConfigReader::ReadValue to loop through all copies of a
|
||||
* multiple instance tag.
|
||||
*/
|
||||
int Enumerate(const std::string &);
|
||||
/** Returns true if a config file is valid.
|
||||
* This method is partially implemented and will only return false if the config
|
||||
* file does not exist or could not be opened.
|
||||
*/
|
||||
bool Verify();
|
||||
/** Dumps the list of errors in a config file to an output location. If bail is true,
|
||||
* then the program will abort. If bail is false and user points to a valid user
|
||||
* record, the error report will be spooled to the given user by means of NOTICE.
|
||||
* if bool is false AND user is false, the error report will be spooled to all opers
|
||||
* by means of a NOTICE to all opers.
|
||||
*/
|
||||
void DumpErrors(bool);
|
||||
/** Returns the number of items within a tag.
|
||||
* For example if the tag was <test tag="blah" data="foo"> then this
|
||||
* function would return 2. Spaces and newlines both qualify as valid seperators
|
||||
* between values.
|
||||
*/
|
||||
int EnumerateValues(const std::string &, int);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,71 +0,0 @@
|
||||
/* Database file descriptor structure and file handling routine prototypes.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DATAFILES_H
|
||||
#define DATAFILES_H
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct dbFILE_ dbFILE;
|
||||
struct dbFILE_ {
|
||||
int mode; /* 'r' for reading, 'w' for writing */
|
||||
FILE *fp; /* The normal file descriptor */
|
||||
FILE *backupfp; /* Open file pointer to a backup copy of
|
||||
* the database file (if non-NULL) */
|
||||
char filename[MAXPATHLEN]; /* Name of the database file */
|
||||
char backupname[MAXPATHLEN]; /* Name of the backup file */
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Prototypes and macros: */
|
||||
|
||||
E void check_file_version(dbFILE *f);
|
||||
E int get_file_version(dbFILE *f);
|
||||
E int write_file_version(dbFILE *f, uint32 version);
|
||||
|
||||
E dbFILE *open_db(const char *service, const char *filename, const char *mode, uint32 version);
|
||||
E void restore_db(dbFILE *f); /* Restore to state before open_db() */
|
||||
E void close_db(dbFILE *f);
|
||||
E void backup_databases();
|
||||
|
||||
#define read_db(f,buf,len) (fread((buf),1,(len),(f)->fp))
|
||||
#define write_db(f,buf,len) (fwrite((buf),1,(len),(f)->fp))
|
||||
#define getc_db(f) (fgetc((f)->fp))
|
||||
|
||||
E int read_int16(uint16 *ret, dbFILE *f);
|
||||
E int write_int16(uint16 val, dbFILE *f);
|
||||
E int read_int32(uint32 *ret, dbFILE *f);
|
||||
E int write_int32(uint32 val, dbFILE *f);
|
||||
E int read_ptr(void **ret, dbFILE *f);
|
||||
E int write_ptr(const void *ptr, dbFILE *f);
|
||||
E int read_string(char **ret, dbFILE *f);
|
||||
E int write_string(const char *s, dbFILE *f);
|
||||
|
||||
#define read_int8(ret,f) ((*(ret)=fgetc((f)->fp))==EOF ? -1 : 0)
|
||||
#define write_int8(val,f) (fputc((val),(f)->fp)==EOF ? -1 : 0)
|
||||
#define read_buffer(buf,f) (read_db((f),(buf),sizeof(buf)) == sizeof(buf))
|
||||
#define write_buffer(buf,f) (write_db((f),(buf),sizeof(buf)) == sizeof(buf))
|
||||
#define read_buflen(buf,len,f) (read_db((f),(buf),(len)) == (len))
|
||||
#define write_buflen(buf,len,f) (write_db((f),(buf),(len)) == (len))
|
||||
#define read_variable(var,f) (read_db((f),&(var),sizeof(var)) == sizeof(var))
|
||||
#define write_variable(var,f) (write_db((f),&(var),sizeof(var)) == sizeof(var))
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#endif /* DATAFILES_H */
|
||||
@@ -1,40 +0,0 @@
|
||||
/* Set default values for any constants that should be in include files but
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef NAME_MAX
|
||||
# define NAME_MAX 255
|
||||
#endif
|
||||
|
||||
#ifndef BUFSIZ
|
||||
# define BUFSIZ 256
|
||||
#else
|
||||
# if BUFSIZ < 256
|
||||
# define BUFSIZ 256
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Length of an array: */
|
||||
#define lenof(a) (sizeof(a) / sizeof(*(a)))
|
||||
|
||||
/* Telling compilers about printf()-like functions: */
|
||||
#ifdef __GNUC__
|
||||
# define FORMAT(type,fmt,start) __attribute__((format(type,fmt,start)))
|
||||
#else
|
||||
# define FORMAT(type,fmt,start)
|
||||
#endif
|
||||
|
||||
/*************************************************************************/
|
||||
+205
@@ -0,0 +1,205 @@
|
||||
#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 CoreExport 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;
|
||||
|
||||
/* When this record was created in our cache */
|
||||
time_t created;
|
||||
|
||||
inline DNSRecord(const Anope::string &n);
|
||||
operator bool() const;
|
||||
};
|
||||
|
||||
/** 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 CoreExport 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);
|
||||
|
||||
/** Does a BLOCKING DNS query and returns the first IP.
|
||||
* Only use this if you know what you are doing. Unless you specifically
|
||||
* need a blocking query use the DNSRequest system
|
||||
*/
|
||||
static DNSRecord BlockingQuery(const Anope::string &mask, QueryType qt);
|
||||
};
|
||||
|
||||
/** 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
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/* Include file for high-level encryption routines.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct encryption_ {
|
||||
int (*encrypt)(const char *src, int len, char *dest, int size);
|
||||
int (*encrypt_in_place)(char *buf, int size);
|
||||
int (*encrypt_check_len)(int passlen, int bufsize);
|
||||
int (*decrypt)(const char *src, char *dest, int size);
|
||||
int (*check_password)(const char *plaintext, const char *password);
|
||||
} Encryption;
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/* Prototypes and external variable declarations.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#define EVENT_START "start"
|
||||
#define EVENT_STOP "stop"
|
||||
|
||||
#define EVENT_DB_SAVING "db_saving"
|
||||
#define EVENT_DB_BACKUP "db_backup"
|
||||
#define EVENT_NEWNICK "newnick"
|
||||
#define EVENT_BOT_UNASSIGN "bot_unassign"
|
||||
#define EVENT_BOT_JOIN "bot_join"
|
||||
#define EVENT_BOT_CREATE "bot_create"
|
||||
#define EVENT_BOT_CHANGE "bot_change"
|
||||
#define EVENT_BOT_FANTASY "bot_command"
|
||||
#define EVENT_BOT_FANTASY_NO_ACCESS "bot_command_no_access"
|
||||
#define EVENT_BOT_DEL "bot_del"
|
||||
#define EVENT_BOT_ASSIGN "bot_assign"
|
||||
#define EVENT_BOT_KICK "bot_kick"
|
||||
#define EVENT_BOT_BAN "bot_ban"
|
||||
#define EVENT_TOPIC_UPDATED "chan_topic_updated"
|
||||
#define EVENT_CHAN_EXPIRE "chan_expire"
|
||||
#define EVENT_CHAN_REGISTERED "chan_registered"
|
||||
#define EVENT_CHAN_DROP "chan_dropped"
|
||||
#define EVENT_CHAN_FORBIDDEN "chan_forbidden"
|
||||
#define EVENT_CHAN_SUSPENDED "chan_suspended"
|
||||
#define EVENT_CHAN_UNSUSPEND "chan_unsuspend"
|
||||
#define EVENT_CONNECT "connect"
|
||||
#define EVENT_DB_EXPIRE "db_expire"
|
||||
#define EVENT_RESTART "restart"
|
||||
#define EVENT_RELOAD "reload"
|
||||
#define EVENT_SHUTDOWN "shutdown"
|
||||
#define EVENT_SIGNAL "signal"
|
||||
#define EVENT_NICK_REGISTERED "nick_registered"
|
||||
#define EVENT_NICK_DROPPED "nick_dropped"
|
||||
#define EVENT_NICK_FORBIDDEN "nick_forbidden"
|
||||
#define EVENT_NICK_EXPIRE "nick_expire"
|
||||
#define EVENT_CHANGE_NICK "change_nick"
|
||||
#define EVENT_USER_LOGOFF "user_logoff"
|
||||
#define EVENT_GROUP "nick_group"
|
||||
#define EVENT_NICK_IDENTIFY "nick_id"
|
||||
#define EVENT_SERVER_SQUIT "server_squit"
|
||||
#define EVENT_SERVER_CONNECT "server_connect"
|
||||
#define EVENT_DEFCON_LEVEL "defcon_level"
|
||||
#define EVENT_NICK_SUSPENDED "nick_suspended"
|
||||
#define EVENT_NICK_UNSUSPEND "nick_unsuspend"
|
||||
#define EVENT_JOIN_CHANNEL "join_channel"
|
||||
#define EVENT_PART_CHANNEL "part_channel"
|
||||
#define EVENT_ACCESS_ADD "access_add"
|
||||
#define EVENT_ACCESS_CHANGE "access_change"
|
||||
#define EVENT_ACCESS_DEL "access_del"
|
||||
#define EVENT_ACCESS_CLEAR "access_clear"
|
||||
#define EVENT_NICK_LOGOUT "nick_logout"
|
||||
#define EVENT_CHAN_KICK "chan_kick"
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef EXTENSIBLE_H
|
||||
#define EXTENSIBLE_H
|
||||
|
||||
#include "hashcomp.h"
|
||||
|
||||
/** Dummy base class we use to cast everything to/from
|
||||
*/
|
||||
class ExtensibleItemBase
|
||||
{
|
||||
public:
|
||||
ExtensibleItemBase() { }
|
||||
virtual ~ExtensibleItemBase() { }
|
||||
};
|
||||
|
||||
/** Class used to represent an extensible item that doesn't hold a pointer
|
||||
*/
|
||||
template<typename T> class ExtensibleItemRegular : public ExtensibleItemBase
|
||||
{
|
||||
protected:
|
||||
T Item;
|
||||
|
||||
public:
|
||||
ExtensibleItemRegular(T item) : Item(item) { }
|
||||
virtual ~ExtensibleItemRegular() { }
|
||||
T &GetItem() { return Item; }
|
||||
};
|
||||
|
||||
/** Class used to represent an extensible item that holds a pointer
|
||||
*/
|
||||
template<typename T> class ExtensibleItemPointer : public ExtensibleItemBase
|
||||
{
|
||||
protected:
|
||||
T *Item;
|
||||
|
||||
public:
|
||||
ExtensibleItemPointer(T *item) : Item(item) { }
|
||||
virtual ~ExtensibleItemPointer() { delete Item; }
|
||||
T *GetItem() { return Item; }
|
||||
};
|
||||
|
||||
/** Class used to represent an extensible item that holds a pointer to an arrray
|
||||
*/
|
||||
template<typename T> class ExtensibleItemPointerArray : public ExtensibleItemBase
|
||||
{
|
||||
protected:
|
||||
T *Item;
|
||||
|
||||
public:
|
||||
ExtensibleItemPointerArray(T *item) : Item(item) { }
|
||||
virtual ~ExtensibleItemPointerArray() { delete [] Item; }
|
||||
T *GetItem() { return Item; }
|
||||
};
|
||||
|
||||
class CoreExport Extensible : public Base
|
||||
{
|
||||
private:
|
||||
typedef std::map<Anope::string, ExtensibleItemBase *> extensible_map;
|
||||
extensible_map Extension_Items;
|
||||
|
||||
public:
|
||||
/** Default constructor, does nothing
|
||||
*/
|
||||
Extensible() { }
|
||||
|
||||
/** Default destructor, deletes all of the extensible items in this object
|
||||
* then clears the map
|
||||
*/
|
||||
virtual ~Extensible()
|
||||
{
|
||||
for (extensible_map::iterator it = Extension_Items.begin(), it_end = Extension_Items.end(); it != it_end; ++it)
|
||||
delete it->second;
|
||||
Extension_Items.clear();
|
||||
}
|
||||
|
||||
/** Extend an Extensible class.
|
||||
*
|
||||
* @param key The key parameter is an arbitary string which identifies the extension data
|
||||
* @param p This parameter is a pointer to an ExtensibleItem or ExtensibleItemBase derived class
|
||||
*
|
||||
* You must provide a key to store the data as via the parameter 'key'.
|
||||
* The data will be inserted into the map. If the data already exists, you may not insert it
|
||||
* twice, Extensible::Extend will return false in this case.
|
||||
*
|
||||
* @return Returns true on success, false if otherwise
|
||||
*/
|
||||
void Extend(const Anope::string &key, ExtensibleItemBase *p)
|
||||
{
|
||||
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 ExtensibleItemPointer<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);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // EXTENSIBLE_H
|
||||
+184
-853
File diff suppressed because it is too large
Load Diff
+486
-63
@@ -1,82 +1,505 @@
|
||||
/*
|
||||
* Copyright (C) 2002-2009 InspIRCd Development Team
|
||||
* Copyright (C) 2009 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2002-2011 InspIRCd Development Team
|
||||
* Copyright (C) 2009-2011 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* These classes have been copied from InspIRCd and modified
|
||||
* for use in Anope.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HASHCOMP_H_
|
||||
#define _HASHCOMP_H_
|
||||
#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
|
||||
#else
|
||||
# define CoreExport
|
||||
# define DllExport
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
/** sepstream allows for splitting token seperated lists.
|
||||
* Each successive call to sepstream::GetToken() returns
|
||||
* the next token, until none remain, at which point the method returns
|
||||
* an empty string.
|
||||
*/
|
||||
class sepstream
|
||||
namespace Anope
|
||||
{
|
||||
private:
|
||||
/** Original string.
|
||||
*/
|
||||
std::string tokens;
|
||||
/** Last position of a seperator token
|
||||
*/
|
||||
std::string::iterator last_starting_position;
|
||||
/** Current string position
|
||||
*/
|
||||
std::string::iterator n;
|
||||
/** Seperator value
|
||||
*/
|
||||
char sep;
|
||||
public:
|
||||
/** Create a sepstream and fill it with the provided data
|
||||
*/
|
||||
sepstream(const std::string &source, char seperator);
|
||||
virtual ~sepstream() { }
|
||||
class string;
|
||||
}
|
||||
|
||||
/** Fetch the next token from the stream
|
||||
* @param token The next token from the stream is placed here
|
||||
* @return True if tokens still remain, false if there are none left
|
||||
*/
|
||||
virtual bool GetToken(std::string &token);
|
||||
|
||||
/** Fetch the entire remaining stream, without tokenizing
|
||||
* @return The remaining part of the stream
|
||||
*/
|
||||
virtual const std::string GetRemaining();
|
||||
|
||||
/** Returns true if the end of the stream has been reached
|
||||
* @return True if the end of the stream has been reached, otherwise false
|
||||
*/
|
||||
virtual bool StreamEnd();
|
||||
};
|
||||
|
||||
/** A derived form of sepstream, which seperates on commas
|
||||
*/
|
||||
class commasepstream : public sepstream
|
||||
#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:
|
||||
/** Initialize with comma seperator
|
||||
*/
|
||||
commasepstream(const std::string &source) : sepstream(source, ',') { }
|
||||
unordered_map() : hash_map() { }
|
||||
};
|
||||
|
||||
/** A derived form of sepstream, which seperates on spaces
|
||||
*/
|
||||
class spacesepstream : public sepstream
|
||||
{
|
||||
public:
|
||||
/** Initialize with space seperator
|
||||
*/
|
||||
spacesepstream(const std::string &source) : sepstream(source, ' ') { }
|
||||
};
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*******************************************************
|
||||
* 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.
|
||||
*******************************************************/
|
||||
|
||||
/** 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>
|
||||
{
|
||||
/** Check if two chars match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are equal
|
||||
*/
|
||||
static bool eq(char c1st, char c2nd);
|
||||
|
||||
/** Check if two chars do NOT match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are unequal
|
||||
*/
|
||||
static bool ne(char c1st, char c2nd);
|
||||
|
||||
/** Check if one char is less than another.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if c1st is less than c2nd
|
||||
*/
|
||||
static bool lt(char c1st, char c2nd);
|
||||
|
||||
/** Compare two strings of size n.
|
||||
* @param str1 First string
|
||||
* @param str2 Second string
|
||||
* @param n Length to compare to
|
||||
* @return similar to strcmp, zero for equal, less than zero for str1
|
||||
* being less and greater than zero for str1 being greater than str2.
|
||||
*/
|
||||
static int compare(const char *str1, const char *str2, size_t n);
|
||||
|
||||
/** Find a char within a string up to position n.
|
||||
* @param s1 String to find in
|
||||
* @param n Position to search up to
|
||||
* @param c Character to search for
|
||||
* @return Pointer to the first occurance of c in s1
|
||||
*/
|
||||
static const char *find(const char *s1, int n, char c);
|
||||
};
|
||||
|
||||
/** This typedef declares irc::string based upon irc_char_traits.
|
||||
*/
|
||||
typedef std::basic_string<char, irc_char_traits, std::allocator<char> > string;
|
||||
|
||||
/** Used to hash irc::strings for unordered_map
|
||||
*/
|
||||
struct CoreExport hash
|
||||
{
|
||||
/* 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 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;
|
||||
};
|
||||
}
|
||||
|
||||
/** The ci namespace contains a number of helper classes.
|
||||
*/
|
||||
namespace ci
|
||||
{
|
||||
/** The ci_char_traits class is used for ASCII-style comparison of strings.
|
||||
* This class is used to implement ci::string, a case-insensitive, ASCII-
|
||||
* comparing string class.
|
||||
*/
|
||||
struct CoreExport ci_char_traits : std::char_traits<char>
|
||||
{
|
||||
/** Check if two chars match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are equal
|
||||
*/
|
||||
static bool eq(char c1st, char c2nd);
|
||||
|
||||
/** Check if two chars do NOT match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are unequal
|
||||
*/
|
||||
static bool ne(char c1st, char c2nd);
|
||||
|
||||
/** Check if one char is less than another.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if c1st is less than c2nd
|
||||
*/
|
||||
static bool lt(char c1st, char c2nd);
|
||||
|
||||
/** Compare two strings of size n.
|
||||
* @param str1 First string
|
||||
* @param str2 Second string
|
||||
* @param n Length to compare to
|
||||
* @return similar to strcmp, zero for equal, less than zero for str1
|
||||
* being less and greater than zero for str1 being greater than str2.
|
||||
*/
|
||||
static int compare(const char *str1, const char *str2, size_t n);
|
||||
|
||||
/** Find a char within a string up to position n.
|
||||
* @param s1 String to find in
|
||||
* @param n Position to search up to
|
||||
* @param c Character to search for
|
||||
* @return Pointer to the first occurance of c in s1
|
||||
*/
|
||||
static const char *find(const char *s1, int n, char c);
|
||||
};
|
||||
|
||||
/** This typedef declares ci::string based upon ci_char_traits.
|
||||
*/
|
||||
typedef std::basic_string<char, ci_char_traits, std::allocator<char> > string;
|
||||
|
||||
/** Used to hash ci::strings for unordered_map
|
||||
*/
|
||||
struct CoreExport hash
|
||||
{
|
||||
/* 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
|
||||
* @return true if s1 < s2, else false
|
||||
*/
|
||||
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
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline std::string operator+(std::string &leftval, ci::string &rightval)
|
||||
{
|
||||
return leftval + std::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with ci::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline ci::string operator+(ci::string &leftval, std::string &rightval)
|
||||
{
|
||||
return leftval + ci::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline irc::string operator+(irc::string &leftval, ci::string &rightval)
|
||||
{
|
||||
return leftval + irc::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline ci::string operator+(ci::string &leftval, irc::string &rightval)
|
||||
{
|
||||
return leftval + ci::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const std::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return leftval.c_str() == rightval;
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const irc::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return leftval == rightval.c_str();
|
||||
}
|
||||
|
||||
/* Define operators for + and == with ci::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const std::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return leftval.c_str() == rightval;
|
||||
}
|
||||
|
||||
/* Define operators for + and == with ci::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const ci::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return leftval == rightval.c_str();
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const ci::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return leftval.c_str() == rightval;
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const irc::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return leftval == rightval.c_str();
|
||||
}
|
||||
|
||||
/* Define operators != for irc::string to std::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const irc::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return !(leftval == rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators != for std::string to irc::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const std::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return !(leftval.c_str() == rightval);
|
||||
}
|
||||
|
||||
/* Define operators != for ci::string to std::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const ci::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return !(leftval == rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators != for ci::string to irc::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const std::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return !(leftval.c_str() == rightval);
|
||||
}
|
||||
|
||||
/* Define operators != for irc::string to ci::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const irc::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return !(leftval == rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators != for irc::string to ci::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const ci::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return !(leftval.c_str() == rightval);
|
||||
}
|
||||
|
||||
#endif // HASHCOMP_H
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/* Commonly used language strings
|
||||
*
|
||||
* (C) 2008-2011 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#define MORE_INFO "\002%s%s HELP %s\002 for more information."
|
||||
#define BAD_USERHOST_MASK "Mask must be in the form \037user\037@\037host\037."
|
||||
#define BAD_EXPIRY_TIME "Invalid expiry time."
|
||||
#define USERHOST_MASK_TOO_WIDE "%s coverage is too wide; Please use a more specific mask."
|
||||
#define READ_ONLY_MODE "Services are in read-only mode!"
|
||||
#define PASSWORD_INCORRECT "Password incorrect."
|
||||
#define ACCESS_DENIED "Access denied."
|
||||
#define MORE_OBSCURE_PASSWORD "Please try again with a more obscure password. Passwords should be at least five characters long, should not be something easily guessed (e.g. your real name or your nick), and cannot contain the space or tab characters."
|
||||
#define PASSWORD_TOO_LONG "Your password is too long. Please try again with a shorter password."
|
||||
#define NICK_NOT_REGISTERED "Your nick isn't registered."
|
||||
#define NICK_X_NOT_REGISTERED "Nick \002%s\002 isn't registered."
|
||||
#define NICK_X_NOT_IN_USE "Nick \002%s\002 isn't currently in use."
|
||||
#define NICK_X_NOT_ON_CHAN "\002%s\002 is not currently on channel %s."
|
||||
#define NICK_X_FORBIDDEN "Nick \002%s\002 may not be registered or used."
|
||||
#define NICK_X_FORBIDDEN_OPER "Nick \002%s\002 has been forbidden by %s:\n" \
|
||||
"%s"
|
||||
#define NICK_X_SUSPENDED "Nick %s is currently suspended."
|
||||
#define CHAN_X_NOT_REGISTERED "Channel \002%s\002 isn't registered."
|
||||
#define CHAN_X_NOT_IN_USE "Channel \002%s\002 doesn't exist."
|
||||
#define CHAN_X_FORBIDDEN "Channel \002%s\002 may not be registered or used."
|
||||
#define CHAN_X_FORBIDDEN_OPER "Channel \002%s\002 has been forbidden by %s:\n" \
|
||||
"%s"
|
||||
#define NICK_IDENTIFY_REQUIRED "Password authentication required for that command.\n" \
|
||||
"Retry after typing \002%s%s IDENTIFY \037password\037\002."
|
||||
#define MAIL_X_INVALID "\002%s\002 is not a valid e-mail address."
|
||||
#define NO_REASON "No reason"
|
||||
#define UNKNOWN "<unknown>"
|
||||
#define NO_EXPIRE "does not expire"
|
||||
#define END_OF_ANY_LIST "End of \002%s\002 list."
|
||||
#define LIST_INCORRECT_RANGE "Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002."
|
||||
#define UNKNOWN_OPTION "Unknown option \002%s\002.\n" \
|
||||
"Type %s%s HELP %s for more information."
|
||||
#define NICK_IS_REGISTERED "This nick is owned by someone else. Please choose another.\n" \
|
||||
"(If this is your nick, type \002%s%s IDENTIFY \037password\037\002.)"
|
||||
#define NICK_IS_SECURE "This nickname is registered and protected. If it is your\n" \
|
||||
"nick, type \002%s%s IDENTIFY \037password\037\002. Otherwise,\n" \
|
||||
"please choose a different nick."
|
||||
#define FORCENICKCHANGE_NOW "This nickname has been registered; you may not use it."
|
||||
#define NICK_CANNOT_BE_REGISTERED "Nickname \002%s\002 may not be registered."
|
||||
#define NICK_ALREADY_REGISTERED "Nickname \002%s\002 is already registered!"
|
||||
#define NICK_SET_SYNTAX "SET \037option\037 \037parameters\037"
|
||||
#define NICK_SET_DISABLED "Sorry, nickname option setting is temporarily disabled."
|
||||
#define NICK_SET_UNKNOWN_OPTION "Unknown SET option \002%s%s\002."
|
||||
#define NICK_SET_DISPLAY_CHANGED "The new display is now \002%s\002."
|
||||
#define NICK_SASET_SYNTAX "SASET \037nickname\037 \037option\037 \037parameters\037"
|
||||
#define NICK_SASET_DISPLAY_INVALID "The new display for \002%s\002 MUST be a nickname of the nickname group!"
|
||||
#define NICK_SASET_PASSWORD_FAILED "Sorry, couldn't change password for \002%s\002."
|
||||
#define NICK_SASET_PASSWORD_CHANGED "Password for \002%s\002 changed."
|
||||
#define NICK_SASET_PASSWORD_CHANGED_TO "Password for \002%s\002 changed to \002%s\002."
|
||||
#define NICK_INFO_OPTIONS " Options: %s"
|
||||
#define NICK_LIST_SYNTAX "LIST \037pattern\037"
|
||||
#define LIST_HEADER "List of entries matching \002%s\002:"
|
||||
#define NICK_RECOVERED "User claiming your nick has been killed.\n" \
|
||||
"\002%s%s RELEASE %s\002 to get it back before %s timeout."
|
||||
#define NICK_REQUESTED "This nick has already been requested, please check your e-mail address for the pass code"
|
||||
#define NICK_CONFIRM_INVALID "Invalid passcode has been entered, please check the e-mail again, and retry"
|
||||
#define CHAN_NOT_ALLOWED_TO_JOIN "You are not permitted to be on this channel."
|
||||
#define CHAN_X_INVALID "Channel %s is not a valid channel."
|
||||
#define CHAN_REACHED_CHANNEL_LIMIT "Sorry, you have already reached your limit of \002%d\002 channels."
|
||||
#define CHAN_EXCEEDED_CHANNEL_LIMIT "Sorry, you have already exceeded your limit of \002%d\002 channels."
|
||||
#define CHAN_SYMBOL_REQUIRED "Please use the symbol of \002#\002 when attempting to register"
|
||||
#define CHAN_SASET_SYNTAX "SASET \002channel\002 \037option\037 \037parameters\037"
|
||||
#define CHAN_SET_SYNTAX "SET \037channel\037 \037option\037 \037parameters\037"
|
||||
#define CHAN_SET_DISABLED "Sorry, channel option setting is temporarily disabled."
|
||||
#define CHAN_SETTING_CHANGED "%s for %s set to %s."
|
||||
#define CHAN_SETTING_UNSET "%s for %s unset."
|
||||
#define CHAN_SET_MLOCK_DEPRECATED "MLOCK is deprecated. Use \002%s%s HELP MODE\002 instead."
|
||||
#define CHAN_ACCESS_LEVEL_RANGE "Access level must be between %d and %d inclusive."
|
||||
#define CHAN_ACCESS_LIST_HEADER "Access list for %s:\n" \
|
||||
" Num Lev Mask"
|
||||
#define CHAN_ACCESS_VIEW_XOP_FORMAT " %3d %s %s\n" \
|
||||
" by %s, last seen %s"
|
||||
#define CHAN_ACCESS_VIEW_AXS_FORMAT " %3d %4d %s\n" \
|
||||
" by %s, last seen %s"
|
||||
#define CHAN_AKICK_VIEW_FORMAT "%3d %s (by %s on %s)\n" \
|
||||
" %s"
|
||||
#define CHAN_INFO_HEADER "Information for channel \002%s\002:"
|
||||
#define CHAN_EXCEPTED "\002%s\002 matches an except on %s and cannot be banned until the except have been removed."
|
||||
#define CHAN_LIST_ENTRY "%3d %s\n" \
|
||||
" Added by %s on %s"
|
||||
#define MEMO_NEW_X_MEMO_ARRIVED "There is a new memo on channel %s.\n" \
|
||||
"Type \002%s%s READ %s %d\002 to read it."
|
||||
#define MEMO_NEW_MEMO_ARRIVED "You have a new memo from %s.\n" \
|
||||
"Type \002%s%s READ %d\002 to read it."
|
||||
#define MEMO_HAVE_NO_MEMOS "You have no memos."
|
||||
#define MEMO_X_HAS_NO_MEMOS "%s has no memos."
|
||||
#define MEMO_SEND_SYNTAX "SEND {\037nick\037 | \037channel\037} \037memo-text\037"
|
||||
#define MEMO_SEND_DISABLED "Sorry, memo sending is temporarily disabled."
|
||||
#define MEMO_HAVE_NO_NEW_MEMOS "You have no new memos."
|
||||
#define MEMO_X_HAS_NO_NEW_MEMOS "%s has no new memos."
|
||||
#define BOT_DOES_NOT_EXIST "Bot \002%s\002 does not exist."
|
||||
#define BOT_NOT_ASSIGNED "You must assign a bot to the channel before using this command.\n" \
|
||||
"Type %s%s HELP ASSIGN for more information."
|
||||
#define BOT_NOT_ON_CHANNEL "Bot is not on channel \002%s\002."
|
||||
#define BOT_ASSIGN_READONLY "Sorry, bot assignment is temporarily disabled."
|
||||
#define ENABLED "Enabled"
|
||||
#define DISABLED "Disabled"
|
||||
#define OPER_LIST_FORMAT " %3d %-32s %s"
|
||||
#define OPER_VIEW_FORMAT "%3d %s (by %s on %s; %s)\n" \
|
||||
" %s"
|
||||
#define HOST_SET_ERROR "A vhost must be in the format of a valid hostmask."
|
||||
#define HOST_SET_IDENT_ERROR "A vhost ident must be in the format of a valid ident"
|
||||
#define HOST_SET_TOOLONG "Error! The vhost is too long, please use a host shorter than %d characters."
|
||||
#define HOST_SET_IDENTTOOLONG "Error! The Ident is too long, please use an ident shorter than %d characters."
|
||||
#define HOST_NOT_ASSIGNED "Please contact an Operator to get a vhost assigned to this nick."
|
||||
#define HOST_NO_VIDENT "Your IRCD does not support vIdent's, if this is incorrect, please report this as a possible bug"
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
|
||||
enum LogType
|
||||
{
|
||||
LOG_ADMIN,
|
||||
LOG_OVERRIDE,
|
||||
LOG_COMMAND,
|
||||
LOG_SERVER,
|
||||
LOG_CHANNEL,
|
||||
LOG_USER,
|
||||
LOG_NORMAL,
|
||||
LOG_TERMINAL,
|
||||
LOG_RAWIO,
|
||||
LOG_DEBUG,
|
||||
LOG_DEBUG_2,
|
||||
LOG_DEBUG_3,
|
||||
LOG_DEBUG_4
|
||||
};
|
||||
|
||||
struct LogFile
|
||||
{
|
||||
Anope::string filename;
|
||||
|
||||
public:
|
||||
std::ofstream stream;
|
||||
|
||||
LogFile(const Anope::string &name);
|
||||
Anope::string GetName() const;
|
||||
};
|
||||
|
||||
class CoreExport Log
|
||||
{
|
||||
public:
|
||||
BotInfo *bi;
|
||||
LogType Type;
|
||||
Anope::string Category;
|
||||
std::list<Anope::string> Sources;
|
||||
|
||||
std::stringstream buf;
|
||||
|
||||
Log(LogType type = LOG_NORMAL, const Anope::string &category = "", BotInfo *bi = Global);
|
||||
|
||||
/* LOG_COMMAND/OVERRIDE/ADMIN */
|
||||
Log(LogType type, User *u, 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_SERVER */
|
||||
Log(Server *s, const Anope::string &category = "");
|
||||
|
||||
Log(BotInfo *b, const Anope::string &category = "");
|
||||
|
||||
~Log();
|
||||
|
||||
template<typename T> Log &operator<<(T val)
|
||||
{
|
||||
this->buf << val;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
LogInfo(int logage, bool inhabit, bool rawio, bool debug);
|
||||
|
||||
~LogInfo();
|
||||
|
||||
void AddType(std::list<Anope::string> &list, const Anope::string &type);
|
||||
|
||||
bool HasType(std::list<Anope::string> &list, const Anope::string &type) const;
|
||||
|
||||
std::list<Anope::string> &GetList(LogType type);
|
||||
|
||||
bool HasType(LogType Type);
|
||||
|
||||
void ProcessMessage(const Log *l);
|
||||
};
|
||||
|
||||
#endif // LOGGER_H
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef MAIL_H
|
||||
#define MAIL_H
|
||||
|
||||
#include "anope.h"
|
||||
|
||||
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
|
||||
{
|
||||
private:
|
||||
Anope::string MailTo;
|
||||
Anope::string Addr;
|
||||
Anope::string Subject;
|
||||
Anope::string Message;
|
||||
bool DontQuoteAddresses;
|
||||
|
||||
bool Success;
|
||||
public:
|
||||
MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message);
|
||||
|
||||
~MailThread();
|
||||
|
||||
void Run();
|
||||
};
|
||||
|
||||
#endif // MAIL_H
|
||||
@@ -1,23 +0,0 @@
|
||||
/* Declarations of IRC message structures, variables, and functions.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
#include "modules.h"
|
||||
|
||||
extern Message messages[];
|
||||
extern void moduleAddMsgs();
|
||||
extern Message *find_message(const char *name);
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
+495
@@ -0,0 +1,495 @@
|
||||
/* Mode support
|
||||
*
|
||||
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
||||
* Copyright (C) 2008-2011 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#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_WEBIRC, 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_SOFTCALLERID, UMODE_CALLERID,
|
||||
UMODE_COMMONCHANS, UMODE_HIDDEN, UMODE_STRIPCOLOR, UMODE_INVISIBLE_OPER, UMODE_RESTRICTED,
|
||||
|
||||
UMODE_END
|
||||
};
|
||||
|
||||
const Anope::string UserModeNameStrings[] = {
|
||||
"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_WEBIRC", "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_SOFTCALLERID", "UMODE_CALLERID",
|
||||
"UMODE_COMMONCHANS", "UMODE_HIDDEN", "UMODE_STRIPCOLOR", "UMODE_INVISIBLE_OPER", "UMODE_RESTRICTED"
|
||||
|
||||
""
|
||||
};
|
||||
|
||||
/** 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,
|
||||
CMODE_BANDWIDTH,
|
||||
|
||||
/* 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
|
||||
};
|
||||
|
||||
const Anope::string ChannelModeNameStrings[] = {
|
||||
"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",
|
||||
"CMODE_BANDWIDTH",
|
||||
|
||||
/* b/e/I */
|
||||
"CMODE_BAN", "CMODE_EXCEPT",
|
||||
"CMODE_INVITEOVERRIDE",
|
||||
|
||||
/* v/h/o/a/q */
|
||||
"CMODE_VOICE", "CMODE_HALFOP", "CMODE_OP",
|
||||
"CMODE_PROTECT", "CMODE_OWNER",
|
||||
|
||||
""
|
||||
};
|
||||
|
||||
|
||||
/** The different types of modes
|
||||
*/
|
||||
enum ModeType
|
||||
{
|
||||
/* Regular mode */
|
||||
MODE_REGULAR,
|
||||
/* b/e/I */
|
||||
MODE_LIST,
|
||||
/* k/l etc */
|
||||
MODE_PARAM,
|
||||
/* v/h/o/a/q */
|
||||
MODE_STATUS
|
||||
};
|
||||
|
||||
/* Classes of modes, Channel modes and User modes
|
||||
*/
|
||||
enum ModeClass
|
||||
{
|
||||
/* Channel mode */
|
||||
MC_CHANNEL,
|
||||
/* User mode */
|
||||
MC_USER
|
||||
};
|
||||
|
||||
/** This class is the basis of all modes in Anope
|
||||
*/
|
||||
class CoreExport Mode : public Base
|
||||
{
|
||||
public:
|
||||
/* Class of mode this is */
|
||||
ModeClass Class;
|
||||
/* Mode char for this */
|
||||
char ModeChar;
|
||||
/* Type of mode this is */
|
||||
ModeType Type;
|
||||
|
||||
/** Default constructor
|
||||
* @param mClass The type of mode this is
|
||||
* @param modeChar The mode char
|
||||
* @param type The mode type
|
||||
*/
|
||||
Mode(ModeClass mClass, char modeChar, ModeType type);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~Mode();
|
||||
};
|
||||
|
||||
/** This class is a user mode, all user modes use this/inherit from this
|
||||
*/
|
||||
class CoreExport UserMode : public Mode
|
||||
{
|
||||
public:
|
||||
/* Mode name */
|
||||
UserModeName Name;
|
||||
|
||||
/** Default constructor
|
||||
* @param nName The mode name
|
||||
* @param modeChar The mode char
|
||||
*/
|
||||
UserMode(UserModeName mName, char modeChar);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~UserMode();
|
||||
|
||||
/** Returns the mode name as a string
|
||||
*/
|
||||
const Anope::string NameAsString();
|
||||
};
|
||||
|
||||
class CoreExport UserModeParam : public UserMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
*/
|
||||
UserModeParam(UserModeName mName, char modeChar);
|
||||
|
||||
/** Check if the param is valid
|
||||
* @param value The param
|
||||
* @return true or false
|
||||
*/
|
||||
virtual bool IsValid(const Anope::string &value) const { return true; }
|
||||
};
|
||||
|
||||
/** This class is a channel mode, all channel modes use this/inherit from this
|
||||
*/
|
||||
class CoreExport ChannelMode : public Mode
|
||||
{
|
||||
public:
|
||||
/* Mode name */
|
||||
ChannelModeName Name;
|
||||
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
*/
|
||||
ChannelMode(ChannelModeName mName, char modeChar);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~ChannelMode();
|
||||
|
||||
/** Can a user set this mode, used for mlock
|
||||
* NOTE: User CAN be NULL, this is for checking if it can be locked with defcon
|
||||
* @param u The user, or NULL
|
||||
*/
|
||||
bool CanSet(User *u) const;
|
||||
|
||||
/** Returns the mode name as a string
|
||||
*/
|
||||
const Anope::string NameAsString();
|
||||
};
|
||||
|
||||
|
||||
/** This is a mode for lists, eg b/e/I. These modes should inherit from this
|
||||
*/
|
||||
class CoreExport ChannelModeList : public ChannelMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
*/
|
||||
ChannelModeList(ChannelModeName mName, char modeChar);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~ChannelModeList();
|
||||
|
||||
/** Is the mask valid
|
||||
* @param mask The mask
|
||||
* @return true for yes, false for no
|
||||
*/
|
||||
virtual bool IsValid(const Anope::string &mask) const { return true; }
|
||||
|
||||
/** 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 OnAdd(Channel *chan, const Anope::string &mask) { }
|
||||
|
||||
/** Called when a mask is removed from a channel
|
||||
* @param chan The channel
|
||||
* @param mask The 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
|
||||
*/
|
||||
class CoreExport ChannelModeParam : public ChannelMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
* @param MinusArg true if this mode sends no arg when unsetting
|
||||
*/
|
||||
ChannelModeParam(ChannelModeName mName, char modeChar, bool MinusArg = false);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~ChannelModeParam();
|
||||
|
||||
/* Should we send an arg when unsetting this mode? */
|
||||
bool MinusNoArg;
|
||||
|
||||
/** Is the param valid
|
||||
* @param value The param
|
||||
* @return true for yes, false for no
|
||||
*/
|
||||
virtual bool IsValid(const Anope::string &value) const { return true; }
|
||||
};
|
||||
|
||||
/** This is a mode that is a channel status, eg +v/h/o/a/q.
|
||||
*/
|
||||
class CoreExport ChannelModeStatus : public ChannelMode
|
||||
{
|
||||
public:
|
||||
/* The symbol, eg @ % + */
|
||||
char Symbol;
|
||||
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
* @param mSymbol The symbol for the mode, eg @ % +
|
||||
*/
|
||||
ChannelModeStatus(ChannelModeName mName, char modeChar, char mSymbol);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~ChannelModeStatus();
|
||||
};
|
||||
|
||||
/** Channel mode +b
|
||||
*/
|
||||
class CoreExport ChannelModeBan : public ChannelModeList
|
||||
{
|
||||
public:
|
||||
ChannelModeBan(ChannelModeName mName, char modeChar) : ChannelModeList(mName, modeChar) { }
|
||||
|
||||
void OnAdd(Channel *chan, const Anope::string &mask);
|
||||
};
|
||||
|
||||
/** Channel mode +k (key)
|
||||
*/
|
||||
class CoreExport ChannelModeKey : public ChannelModeParam
|
||||
{
|
||||
public:
|
||||
ChannelModeKey(char modeChar) : ChannelModeParam(CMODE_KEY, modeChar) { }
|
||||
|
||||
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, modeChar) { }
|
||||
|
||||
/* Opers only */
|
||||
bool CanSet(User *u) const;
|
||||
};
|
||||
|
||||
/** This class is used for channel mode +O (Opers only)
|
||||
* Only opers can mlock it
|
||||
*/
|
||||
class CoreExport ChannelModeOper : public ChannelMode
|
||||
{
|
||||
public:
|
||||
ChannelModeOper(char modeChar) : ChannelMode(CMODE_OPERONLY, modeChar) { }
|
||||
|
||||
/* Opers only */
|
||||
bool CanSet(User *u) const;
|
||||
};
|
||||
|
||||
/** This class is used for channel mode +r (registered channel)
|
||||
* No one may mlock r
|
||||
*/
|
||||
class CoreExport ChannelModeRegistered : public ChannelMode
|
||||
{
|
||||
public:
|
||||
ChannelModeRegistered(char modeChar) : ChannelMode(CMODE_REGISTERED, modeChar) { }
|
||||
|
||||
/* No one mlocks +r */
|
||||
bool CanSet(User *u) 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
|
||||
* It contains functions for adding modes to Anope so Anope can track them
|
||||
* and do things such as MLOCK.
|
||||
* This also contains a mode stacker that will combine multiple modes and set
|
||||
* them on a channel all at once
|
||||
*/
|
||||
class CoreExport ModeManager
|
||||
{
|
||||
protected:
|
||||
/* List of pairs of user/channels and their stacker info */
|
||||
static std::list<std::pair<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
|
||||
*/
|
||||
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);
|
||||
|
||||
public:
|
||||
/* List of all modes Anope knows about */
|
||||
static std::vector<ChannelMode *> ChannelModes;
|
||||
static std::vector<UserMode *> UserModes;
|
||||
|
||||
/** Add a user mode to Anope
|
||||
* @param um A UserMode or UserMode derived class
|
||||
* @return true on success, false on error
|
||||
*/
|
||||
static bool AddUserMode(UserMode *um);
|
||||
|
||||
/** Add a channel mode to Anope
|
||||
* @param cm A ChannelMode or ChannelMode derived class
|
||||
* @return true on success, false on error
|
||||
*/
|
||||
static bool AddChannelMode(ChannelMode *cm);
|
||||
|
||||
/** Find a channel mode
|
||||
* @param Mode The mode
|
||||
* @return The mode class
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByChar(char Mode);
|
||||
|
||||
/** Find a user mode
|
||||
* @param Mode The mode
|
||||
* @return The mode class
|
||||
*/
|
||||
static UserMode *FindUserModeByChar(char Mode);
|
||||
|
||||
/** Find a channel mode
|
||||
* @param Mode The modename
|
||||
* @return The mode class
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByName(ChannelModeName Name);
|
||||
|
||||
/** Find a user mode
|
||||
* @param Mode The modename
|
||||
* @return The mode class
|
||||
*/
|
||||
static UserMode *FindUserModeByName(UserModeName Name);
|
||||
|
||||
/** Find channel mode by string
|
||||
* @param name The mode name
|
||||
* @return The mode
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByString(const Anope::string &name);
|
||||
|
||||
/** Find user mode by string
|
||||
* @param name The mode name
|
||||
* @return The mode
|
||||
*/
|
||||
static UserMode *FindUserModeByString(const Anope::string &name);
|
||||
|
||||
/** Gets the channel mode char for a symbol (eg + returns v)
|
||||
* @param Value The symbol
|
||||
* @return The char
|
||||
*/
|
||||
static char GetStatusChar(char Value);
|
||||
|
||||
/** Add a mode to the stacker to be set on a channel
|
||||
* @param bi The client to set the modes from
|
||||
* @param c The channel
|
||||
* @param cm The channel mode
|
||||
* @param Set true for setting, false for removing
|
||||
* @param Param The param, if there is one
|
||||
*/
|
||||
static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool Set, const Anope::string &Param = "");
|
||||
|
||||
/** Add a mode to the stacker to be set on a user
|
||||
* @param bi The client to set the modes from
|
||||
* @param u The user
|
||||
* @param um The user mode
|
||||
* @param Set true for setting, false for removing
|
||||
* @param param The param, if there is one
|
||||
*/
|
||||
static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool Set, const Anope::string &Param = "");
|
||||
|
||||
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
|
||||
*/
|
||||
static void ProcessModes();
|
||||
|
||||
/** Delete a user or channel from the stacker
|
||||
* @param b The user/channel
|
||||
*/
|
||||
static void StackerDel(Base *b);
|
||||
};
|
||||
|
||||
#endif // MODES_H
|
||||
+1
-8
@@ -3,13 +3,6 @@
|
||||
|
||||
#include "services.h"
|
||||
#include "commands.h"
|
||||
#include "language.h"
|
||||
#include "modules.h"
|
||||
#include "version.h"
|
||||
|
||||
#define MOD_UNIQUE 0
|
||||
#define MOD_HEAD 1
|
||||
#define MOD_TAIL 2
|
||||
|
||||
#endif
|
||||
|
||||
#endif // MODULE_H
|
||||
|
||||
+1190
-395
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,250 @@
|
||||
/* OperServ support
|
||||
*
|
||||
* (C) 2008-2011 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);
|
||||
|
||||
private:
|
||||
/** Delete an XLine, eg, remove it from the IRCd.
|
||||
* @param x The xline
|
||||
*/
|
||||
virtual void Del(XLine *x);
|
||||
|
||||
public:
|
||||
/** 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);
|
||||
|
||||
/** Called to send an XLine to the IRCd
|
||||
* @param u The user, if we know it
|
||||
* @param x The xline
|
||||
*/
|
||||
virtual void Send(User *u, XLine *x) = 0;
|
||||
};
|
||||
|
||||
/* 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);
|
||||
|
||||
void Send(User *u, 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);
|
||||
|
||||
void Send(User *u, XLine *x);
|
||||
|
||||
XLine *Check(User *u);
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
void Send(User *u, 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);
|
||||
|
||||
void Send(User *u, XLine *x);
|
||||
};
|
||||
|
||||
#endif // OPERSERV_H
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2011 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef OPERTYPE_H
|
||||
#define OPERTYPE_H
|
||||
|
||||
#include "hashcomp.h"
|
||||
|
||||
class OperType;
|
||||
|
||||
struct Oper
|
||||
{
|
||||
Anope::string name;
|
||||
Anope::string password;
|
||||
Anope::string certfp;
|
||||
OperType *ot;
|
||||
|
||||
Oper(const Anope::string &n, const Anope::string &p, const Anope::string &c, OperType *o) :
|
||||
name(n), password(p), certfp(c), ot(o) { }
|
||||
|
||||
/** Find an oper block by name
|
||||
* @param name The name
|
||||
* @return the oper block
|
||||
*/
|
||||
static Oper *Find(const Anope::string &name);
|
||||
};
|
||||
|
||||
class CoreExport OperType
|
||||
{
|
||||
private:
|
||||
/** The name of this opertype, e.g. "sra".
|
||||
*/
|
||||
Anope::string name;
|
||||
|
||||
/** Privs that this opertype may use, e.g. 'users/auspex'.
|
||||
* This *must* be std::list, see commands comment for details.
|
||||
*/
|
||||
std::list<Anope::string> privs;
|
||||
|
||||
/** Commands this user may execute, e.g:
|
||||
* botserv/set/ *, botserv/set/private, botserv/ *
|
||||
* et cetera.
|
||||
*
|
||||
* This *must* be std::list, not std::map, because
|
||||
* we support full globbing here. This shouldn't be a problem
|
||||
* as we don't invoke it often.
|
||||
*/
|
||||
std::list<Anope::string> commands;
|
||||
|
||||
/** Set of opertypes we inherit from
|
||||
*/
|
||||
std::set<OperType *> inheritances;
|
||||
public:
|
||||
/** 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".
|
||||
*/
|
||||
OperType(const Anope::string &nname);
|
||||
|
||||
/** Check whether this opertype has access to run the given command string.
|
||||
* @param cmdstr The string to check, e.g. botserv/set/private.
|
||||
* @return True if this opertype may run the specified command, false otherwise.
|
||||
*/
|
||||
bool HasCommand(const Anope::string &cmdstr) const;
|
||||
|
||||
/** Check whether this opertype has access to the given special permission.
|
||||
* @param privstr The priv to check for, e.g. users/auspex.
|
||||
* @return True if this opertype has the specified priv, false otherwise.
|
||||
*/
|
||||
bool HasPriv(const Anope::string &privstr) const;
|
||||
|
||||
/** Add the specified command to this opertype.
|
||||
* @param cmdstr The command mask to grant this opertype access to, e.g: nickserv/ *, chanserv/set/ *, botserv/set/private.
|
||||
*/
|
||||
void AddCommand(const Anope::string &cmdstr);
|
||||
|
||||
/** Add the specified priv mask to this opertype.
|
||||
* @param privstr The specified mask of privs to grant this opertype access to, e.g. users/auspex, users/ *, etc.
|
||||
*/
|
||||
void AddPriv(const Anope::string &privstr);
|
||||
|
||||
/** Returns the name of this opertype.
|
||||
*/
|
||||
const Anope::string &GetName() const;
|
||||
|
||||
/** Make this opertype inherit commands and privs from another 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
|
||||
@@ -1,20 +0,0 @@
|
||||
/* Include extra includes needed by most/all pseudo-clients.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "commands.h"
|
||||
#include "language.h"
|
||||
#include "timeout.h"
|
||||
#include "encrypt.h"
|
||||
#include "datafiles.h"
|
||||
#include "slist.h"
|
||||
+384
-64
@@ -1,93 +1,413 @@
|
||||
/* Modular support
|
||||
*
|
||||
* (C) 2008-2009 Anope Team
|
||||
* (C) 2008-2011 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
class ChannelInfo : public Extensible
|
||||
|
||||
#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;
|
||||
|
||||
/** Flags used for the ChannelInfo class
|
||||
*/
|
||||
enum ChannelInfoFlag
|
||||
{
|
||||
CI_BEGIN,
|
||||
|
||||
/* ChanServ is currently holding the channel */
|
||||
CI_INHABIT,
|
||||
/* Retain the topic even after the channel is emptied */
|
||||
CI_KEEPTOPIC,
|
||||
/* Don't allow non-authorized users to be opped */
|
||||
CI_SECUREOPS,
|
||||
/* Hide channel from ChanServ LIST command */
|
||||
CI_PRIVATE,
|
||||
/* Topic can only be changed by SET TOPIC */
|
||||
CI_TOPICLOCK,
|
||||
/* Only users on the access list may join */
|
||||
CI_RESTRICTED,
|
||||
/* Don't allow ChanServ and BotServ commands to do bad things to users with higher access levels */
|
||||
CI_PEACE,
|
||||
/* Don't allow any privileges unless a user is IDENTIFIED with NickServ */
|
||||
CI_SECURE,
|
||||
/* Don't allow the channel to be registered or used */
|
||||
CI_FORBIDDEN,
|
||||
/* Channel does not expire */
|
||||
CI_NO_EXPIRE,
|
||||
/* Channel memo limit may not be changed */
|
||||
CI_MEMO_HARDMAX,
|
||||
/* Send notice to channel on use of OP/DEOP */
|
||||
CI_OPNOTICE,
|
||||
/* Stricter control of channel founder status */
|
||||
CI_SECUREFOUNDER,
|
||||
/* Sign kicks with the user who did the kick */
|
||||
CI_SIGNKICK,
|
||||
/* Sign kicks if level is < than the one defined by the SIGNKIGK level */
|
||||
CI_SIGNKICK_LEVEL,
|
||||
/* Uses XOP */
|
||||
CI_XOP,
|
||||
/* Channel is suspended */
|
||||
CI_SUSPENDED,
|
||||
/* Channel still exists when emptied, this can be caused by setting a perm
|
||||
* channel mode (+P on InspIRCd) or /cs set #chan persist on.
|
||||
* This keeps the service bot in the channel regardless if a +P type mode
|
||||
* is set or not
|
||||
*/
|
||||
CI_PERSIST,
|
||||
|
||||
CI_END
|
||||
};
|
||||
|
||||
const Anope::string ChannelInfoFlagStrings[] = {
|
||||
"BEGIN", "INHABIT", "KEEPTOPIC", "SECUREOPS", "PRIVATE", "TOPICLOCK", "RESTRICTED",
|
||||
"PEACE", "SECURE", "FORBIDDEN", "NO_EXPIRE", "MEMO_HARDMAX", "OPNOTICE", "SECUREFOUNDER",
|
||||
"SIGNKICK", "SIGNKICK_LEVEL", "XOP", "SUSPENDED", "PERSIST", ""
|
||||
};
|
||||
|
||||
class CoreExport ChanAccess
|
||||
{
|
||||
Anope::string mask; /* Mask of the access entry */
|
||||
public:
|
||||
int16 level;
|
||||
NickCore *nc; /* NC of the entry, if the entry is a valid nickcore */
|
||||
time_t last_seen;
|
||||
Anope::string creator;
|
||||
|
||||
ChanAccess(const Anope::string &umask);
|
||||
const Anope::string &GetMask();
|
||||
};
|
||||
|
||||
/** Flags for auto kick
|
||||
*/
|
||||
enum AutoKickFlag
|
||||
{
|
||||
/* Is by nick core, not mask */
|
||||
AK_ISNICK
|
||||
};
|
||||
|
||||
const Anope::string AutoKickFlagString[] = { "AK_ISNICK", "" };
|
||||
|
||||
/* AutoKick data. */
|
||||
class AutoKick : public Flags<AutoKickFlag>
|
||||
{
|
||||
public:
|
||||
ChannelInfo()
|
||||
{
|
||||
next = prev = NULL;
|
||||
founderpass[0] = name[0] = last_topic_setter[0] = '\0';
|
||||
founder = successor = NULL;
|
||||
desc = url = email = last_topic = forbidby = forbidreason = NULL;
|
||||
time_registered = last_used = last_topic_time = 0;
|
||||
flags = 0;
|
||||
bantype = accesscount = akickcount = 0;
|
||||
levels = NULL;
|
||||
access = NULL;
|
||||
akick = NULL;
|
||||
mlock_on = mlock_off = mlock_limit = 0;
|
||||
mlock_key = mlock_flood = mlock_redirect = entry_message = NULL;
|
||||
c = NULL;
|
||||
bi = NULL;
|
||||
botflags = 0;
|
||||
ttb = NULL;
|
||||
bwcount = 0;
|
||||
badwords = NULL;
|
||||
capsmin = capspercent = 0;
|
||||
floodlines = floodsecs = 0;
|
||||
repeattimes = 0;
|
||||
}
|
||||
|
||||
ChannelInfo *next, *prev;
|
||||
char name[CHANMAX];
|
||||
AutoKick() : Flags<AutoKickFlag>(AutoKickFlagString) { }
|
||||
/* Only one of these can be in use */
|
||||
Anope::string mask;
|
||||
NickCore *nc;
|
||||
|
||||
Anope::string reason;
|
||||
Anope::string creator;
|
||||
time_t addtime;
|
||||
time_t last_used;
|
||||
};
|
||||
|
||||
struct ModeLock
|
||||
{
|
||||
bool set;
|
||||
ChannelModeName name;
|
||||
Anope::string param;
|
||||
Anope::string setter;
|
||||
time_t created;
|
||||
|
||||
ModeLock(bool s, ChannelModeName n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime) : set(s), name(n), param(p), setter(se), created(c) { }
|
||||
};
|
||||
|
||||
class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, CI_END>
|
||||
{
|
||||
private:
|
||||
typedef std::multimap<ChannelModeName, ModeLock> ModeList;
|
||||
private:
|
||||
std::vector<ChanAccess *> access; /* List of authorized users */
|
||||
std::vector<AutoKick *> akick; /* List of users to kickban */
|
||||
std::vector<BadWord *> badwords; /* List of badwords */
|
||||
ModeList mode_locks;
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param chname The channel name
|
||||
*/
|
||||
ChannelInfo(const Anope::string &chname);
|
||||
|
||||
/** Copy constructor
|
||||
* @param ci The ChannelInfo to copy settings to
|
||||
*/
|
||||
ChannelInfo(ChannelInfo *ci);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~ChannelInfo();
|
||||
|
||||
Anope::string name; /* Channel name */
|
||||
NickCore *founder;
|
||||
NickCore *successor; /* Who gets the channel if the founder
|
||||
* nick is dropped or expires */
|
||||
char founderpass[PASSMAX];
|
||||
char *desc;
|
||||
char *url;
|
||||
char *email;
|
||||
NickCore *successor; /* Who gets the channel if the founder nick is dropped or expires */
|
||||
Anope::string desc;
|
||||
|
||||
time_t time_registered;
|
||||
time_t last_used;
|
||||
char *last_topic; /* Last topic on the channel */
|
||||
char last_topic_setter[NICKMAX]; /* Who set the last topic */
|
||||
time_t last_topic_time; /* When the last topic was set */
|
||||
|
||||
uint32 flags; /* See below */
|
||||
char *forbidby;
|
||||
char *forbidreason;
|
||||
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 */
|
||||
|
||||
// These two should be using extensible
|
||||
Anope::string forbidby;
|
||||
Anope::string forbidreason;
|
||||
|
||||
int16 bantype;
|
||||
int16 *levels; /* Access levels for commands */
|
||||
|
||||
uint16 accesscount;
|
||||
ChanAccess *access; /* List of authorized users */
|
||||
uint16 akickcount;
|
||||
AutoKick *akick; /* List of users to kickban */
|
||||
|
||||
uint32 mlock_on, mlock_off; /* See channel modes below */
|
||||
uint32 mlock_limit; /* 0 if no limit */
|
||||
char *mlock_key; /* NULL if no key */
|
||||
char *mlock_flood; /* NULL if no +f */
|
||||
char *mlock_redirect; /* NULL if no +L */
|
||||
|
||||
char *entry_message; /* Notice sent on entering channel */
|
||||
int16 *levels; /* Access levels for commands */
|
||||
|
||||
MemoInfo memos;
|
||||
|
||||
struct channel_ *c; /* Pointer to channel record (if *
|
||||
* channel is currently in use) */
|
||||
Channel *c; /* Pointer to channel record (if channel is currently in use) */
|
||||
|
||||
/* For BotServ */
|
||||
|
||||
BotInfo *bi; /* Bot used on this channel */
|
||||
uint32 botflags; /* BS_* below */
|
||||
Flags<BotServFlag> botflags;
|
||||
int16 *ttb; /* Times to ban for each kicker */
|
||||
|
||||
uint16 bwcount;
|
||||
BadWord *badwords; /* For BADWORDS kicker */
|
||||
int16 capsmin, capspercent; /* For CAPS kicker */
|
||||
int16 floodlines, floodsecs; /* For FLOOD kicker */
|
||||
int16 repeattimes; /* For REPEAT kicker */
|
||||
|
||||
/** Add an entry to the channel access list
|
||||
*
|
||||
* @param mask The mask of the access entry
|
||||
* @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
|
||||
* @return The new access class
|
||||
*
|
||||
* Creates a new access list entry and inserts it into the access list.
|
||||
*/
|
||||
ChanAccess *AddAccess(const Anope::string &mask, int16 level, const Anope::string &creator, int32 last_seen = 0);
|
||||
|
||||
/** Get an entry from the channel access list by index
|
||||
*
|
||||
* @param index The index in the access list vector
|
||||
* @return A ChanAccess struct corresponding to the index given, or NULL if outside the bounds
|
||||
*
|
||||
* Retrieves an entry from the access list that matches the given index.
|
||||
*/
|
||||
ChanAccess *GetAccess(unsigned index);
|
||||
|
||||
/** Get an entry from the channel access list by User
|
||||
*
|
||||
* @param u The User 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 User, or NULL if not found
|
||||
*
|
||||
* Retrieves an entry from the access list that matches the given User, optionally also matching a certain level.
|
||||
*/
|
||||
ChanAccess *GetAccess(User *u, int16 level = 0);
|
||||
|
||||
/** Get an entry from the channel access list by NickCore
|
||||
*
|
||||
* @param u The NickCore to find within the access list vector
|
||||
* @param level Optional channel access level to compare the access entries to
|
||||
* @return A ChanAccess struct corresponding to the NickCore, or NULL if not found
|
||||
*
|
||||
* Retrieves an entry from the access list that matches the given NickCore, optionally also matching a certain level.
|
||||
*/
|
||||
ChanAccess *GetAccess(NickCore *nc, int16 level = 0);
|
||||
|
||||
/** Get an entry from the channel access list by mask
|
||||
*
|
||||
* @param u The mask to find within the access list vector
|
||||
* @param level Optional channel access level to compare the access entries to
|
||||
* @param wildcard True to match using wildcards
|
||||
* @return A ChanAccess struct corresponding to the mask, or NULL if not found
|
||||
*
|
||||
* Retrieves an entry from the access list that matches the given mask, optionally also matching a certain level.
|
||||
*/
|
||||
ChanAccess *GetAccess(const Anope::string &mask, int16 level = 0, bool wildcard = true);
|
||||
|
||||
/** Get the size of the accss vector for this channel
|
||||
* @return The access vector size
|
||||
*/
|
||||
unsigned GetAccessCount() const;
|
||||
|
||||
/** Erase an entry from the channel access list
|
||||
*
|
||||
* @param index The index in the access list vector
|
||||
*
|
||||
* Clears the memory used by the given access entry and removes it from the vector.
|
||||
*/
|
||||
void EraseAccess(unsigned index);
|
||||
|
||||
/** Erase an entry from the channel access list
|
||||
*
|
||||
* @param taccess The access to remove
|
||||
*
|
||||
* Clears the memory used by the given access entry and removes it from the vector.
|
||||
*/
|
||||
void EraseAccess(ChanAccess *taccess);
|
||||
|
||||
/** Clear the entire channel access list
|
||||
*
|
||||
* Clears the entire access list by deleting every item and then clearing the vector.
|
||||
*/
|
||||
void ClearAccess();
|
||||
|
||||
/** Add an akick entry to the channel by NickCore
|
||||
* @param user The user who added the akick
|
||||
* @param akicknc The nickcore being akicked
|
||||
* @param reason The reason for the akick
|
||||
* @param t The time the akick was added, defaults to now
|
||||
* @param lu The time the akick was last used, defaults to never
|
||||
*/
|
||||
AutoKick *AddAkick(const 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
|
||||
* @param mask The mask of the akick
|
||||
* @param reason The reason for the akick
|
||||
* @param t The time the akick was added, defaults to now
|
||||
* @param lu The time the akick was last used, defaults to never
|
||||
*/
|
||||
AutoKick *AddAkick(const 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);
|
||||
|
||||
/** Get the size of the akick vector for this channel
|
||||
* @return The akick vector size
|
||||
*/
|
||||
unsigned GetAkickCount() const;
|
||||
|
||||
/** Erase an entry from the channel akick list
|
||||
* @param index The index of the akick
|
||||
*/
|
||||
void EraseAkick(unsigned index);
|
||||
|
||||
/** Clear the whole akick list
|
||||
*/
|
||||
void ClearAkick();
|
||||
|
||||
/** Add a badword to the badword list
|
||||
* @param word The badword
|
||||
* @param type The type (SINGLE START END)
|
||||
* @return The badword
|
||||
*/
|
||||
BadWord *AddBadWord(const Anope::string &word, BadWordType type);
|
||||
|
||||
/** Get a badword structure by index
|
||||
* @param index The index
|
||||
* @return The badword
|
||||
*/
|
||||
BadWord *GetBadWord(unsigned index);
|
||||
|
||||
/** Get how many badwords are on this channel
|
||||
* @return The number of badwords in the vector
|
||||
*/
|
||||
unsigned GetBadWordCount() const;
|
||||
|
||||
/** Remove a badword
|
||||
* @param index The index of the badword
|
||||
*/
|
||||
void EraseBadWord(unsigned index);
|
||||
|
||||
/** 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 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
|
||||
*/
|
||||
bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const;
|
||||
|
||||
/** 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)
|
||||
*/
|
||||
bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "", Anope::string setter = "", time_t created = Anope::CurTime);
|
||||
|
||||
/** Remove a mlock
|
||||
* @param mode The mode
|
||||
* @param param The param of the mode, required if it is a list or status mode
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
bool RemoveMLock(ChannelMode *mode, const Anope::string ¶m = "");
|
||||
|
||||
/** Clear all mlocks on the channel
|
||||
*/
|
||||
void ClearMLock();
|
||||
|
||||
/** Get all of the mlocks for this channel
|
||||
* @return The mlocks
|
||||
*/
|
||||
const std::multimap<ChannelModeName, ModeLock> &GetMLock() const;
|
||||
|
||||
/** Get a list of modes on a channel
|
||||
* @param Name The mode name to get a list of
|
||||
* @return a pair of iterators for the beginning and end of the list
|
||||
*/
|
||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(ChannelModeName Name);
|
||||
|
||||
/** Get details for a specific mlock
|
||||
* @param mname The mode name
|
||||
* @param An optional param to match with
|
||||
* @return The MLock, if any
|
||||
*/
|
||||
ModeLock *GetMLock(ChannelModeName mname, const Anope::string ¶m = "");
|
||||
|
||||
/** 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);
|
||||
|
||||
/** Check the channel topic
|
||||
* If topic lock is enabled will change the topic back, else it records
|
||||
* the new topic in the ChannelInfo
|
||||
*/
|
||||
void CheckTopic();
|
||||
|
||||
/** Restore the channel topic, used on channel creation when not syncing with the uplink
|
||||
* and after uplink sync
|
||||
*/
|
||||
void RestoreTopic();
|
||||
};
|
||||
|
||||
/** A timer used to keep the BotServ bot/ChanServ in the channel
|
||||
* after kicking the last user in a channel
|
||||
*/
|
||||
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);
|
||||
};
|
||||
|
||||
|
||||
#endif // REGCHANNEL_H
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
#ifndef SERVERS_H
|
||||
#define SERVERS_H
|
||||
|
||||
/* Anope */
|
||||
extern CoreExport Server *Me;
|
||||
|
||||
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 const char *ts6_uid_retrieve();
|
||||
extern CoreExport const char *ts6_sid_retrieve();
|
||||
|
||||
/* Types of capab
|
||||
*/
|
||||
enum CapabType
|
||||
{
|
||||
CAPAB_BEGIN,
|
||||
|
||||
CAPAB_NOQUIT,
|
||||
CAPAB_TSMODE,
|
||||
CAPAB_UNCONNECT,
|
||||
CAPAB_QS,
|
||||
|
||||
CAPAB_END
|
||||
};
|
||||
|
||||
/* 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
|
||||
};
|
||||
|
||||
const Anope::string ServerFlagStrings[] = { "SERVER_NONE", "SERVER_SYNCING", "SERVER_JUPED", "" };
|
||||
|
||||
/** Class representing a server
|
||||
*/
|
||||
class CoreExport Server : public Flags<ServerFlag>
|
||||
{
|
||||
private:
|
||||
/* Server name */
|
||||
Anope::string Name;
|
||||
/* Hops between services and server */
|
||||
unsigned int Hops;
|
||||
/* Server description */
|
||||
Anope::string Description;
|
||||
/* Server ID */
|
||||
Anope::string SID;
|
||||
/* Links for this server */
|
||||
std::vector<Server *> Links;
|
||||
/* Uplink for this server */
|
||||
Server *UplinkServer;
|
||||
|
||||
/* Reason this server was quit */
|
||||
Anope::string QReason;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
* @param uplink The uplink this server is from, is only NULL when creating Me
|
||||
* @param name The server name
|
||||
* @param hops Hops from services server
|
||||
* @param description Server rdescription
|
||||
* @param sid Server sid/numeric
|
||||
* @param flag An optional server flag
|
||||
*/
|
||||
Server(Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid, ServerFlag flag = SERVER_NONE);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
~Server();
|
||||
|
||||
/** Delete this server with a reason
|
||||
* @param reason The reason
|
||||
*/
|
||||
void Delete(const Anope::string &reason);
|
||||
|
||||
/** Get the name for this server
|
||||
* @return The name
|
||||
*/
|
||||
const Anope::string &GetName() const;
|
||||
|
||||
/** Get the number of hops this server is from services
|
||||
* @return Number of hops
|
||||
*/
|
||||
unsigned GetHops() const;
|
||||
|
||||
/** Set the server description
|
||||
* @param desc The new description
|
||||
*/
|
||||
void SetDescription(const Anope::string &desc);
|
||||
|
||||
/** Get the server description
|
||||
* @return The server description
|
||||
*/
|
||||
const Anope::string &GetDescription() const;
|
||||
|
||||
/** Get the server numeric/SID
|
||||
* @return The numeric/SID
|
||||
*/
|
||||
const Anope::string &GetSID() const;
|
||||
|
||||
/** Get the list of links this server has, or NULL if it has none
|
||||
* @return A list of servers
|
||||
*/
|
||||
const std::vector<Server *> &GetLinks() const;
|
||||
|
||||
/** Get the uplink server for this server, if this is our uplink will be Me
|
||||
* @return The servers uplink
|
||||
*/
|
||||
Server *GetUplink();
|
||||
|
||||
/** Adds a link to this server
|
||||
* @param s The linking server
|
||||
*/
|
||||
void AddLink(Server *s);
|
||||
|
||||
/** Delinks a server from this server
|
||||
* @param s The server
|
||||
*/
|
||||
void DelLink(Server *s);
|
||||
|
||||
/** Finish syncing this server and optionally all links to it
|
||||
* @param SyncLinks True to sync the links for this server too (if any)
|
||||
*/
|
||||
void Sync(bool SyncLinks);
|
||||
|
||||
/** Check if this server is synced
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsSynced() const;
|
||||
|
||||
/** Check if this server is ULined
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsULined() const;
|
||||
|
||||
/** 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
|
||||
* @return The server
|
||||
*/
|
||||
static Server *Find(const Anope::string &name, Server *s = NULL);
|
||||
};
|
||||
|
||||
#endif // SERVERS_H
|
||||
+801
-1299
File diff suppressed because it is too large
Load Diff
@@ -1,50 +0,0 @@
|
||||
/* Header for Services list handler.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SLIST_H
|
||||
#define SLIST_H
|
||||
|
||||
typedef struct slist_ SList;
|
||||
typedef struct slistopts_ SListOpts;
|
||||
|
||||
struct slist_ {
|
||||
void **list;
|
||||
|
||||
int16 count; /* Total entries of the list */
|
||||
int16 capacity; /* Capacity of the list */
|
||||
int16 limit; /* Maximum possible entries on the list */
|
||||
|
||||
SListOpts *opts;
|
||||
};
|
||||
|
||||
struct slistopts_ {
|
||||
int32 flags; /* Flags for the list. See below. */
|
||||
|
||||
int (*compareitem) (SList *slist, void *item1, void *item2); /* Called to compare two items */
|
||||
int (*isequal) (SList *slist, void *item1, void *item2); /* Called by slist_indexof. item1 can be an arbitrary pointer. */
|
||||
void (*freeitem) (SList *slist, void *item); /* Called when an item is removed */
|
||||
};
|
||||
|
||||
#define SLIST_DEFAULT_LIMIT 32767
|
||||
|
||||
#define SLISTF_NODUP 0x00000001 /* No duplicates in the list. */
|
||||
#define SLISTF_SORT 0x00000002 /* Automatically sort the list. Used with compareitem member. */
|
||||
|
||||
/* Note that number is the index in the array + 1 */
|
||||
typedef int (*slist_enumcb_t) (SList *slist, int number, void *item, va_list args);
|
||||
/* Callback to know whether we can delete the entry. */
|
||||
typedef int (*slist_delcheckcb_t) (SList *slist, void *item, va_list args);
|
||||
|
||||
#endif /* SLIST_H */
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2011 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 SOCKETENGINE_H
|
||||
#define SOCKETENGINE_H
|
||||
|
||||
class CoreExport SocketEngineBase
|
||||
{
|
||||
public:
|
||||
#ifdef _WIN32
|
||||
/* Windows crap */
|
||||
WSADATA wsa;
|
||||
#endif
|
||||
/* Map of sockets */
|
||||
std::map<int, Socket *> Sockets;
|
||||
|
||||
/** Default constructor
|
||||
*/
|
||||
SocketEngineBase();
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~SocketEngineBase();
|
||||
|
||||
/** Add a socket to the internal list
|
||||
* @param s The socket
|
||||
*/
|
||||
virtual void AddSocket(Socket *s) { }
|
||||
|
||||
/** Delete a socket from the internal list
|
||||
* @param s The socket
|
||||
*/
|
||||
virtual void DelSocket(Socket *s) { }
|
||||
|
||||
/** Mark a socket as writeable
|
||||
* @param s The socket
|
||||
*/
|
||||
virtual void MarkWritable(Socket *s) { }
|
||||
|
||||
/** Unmark a socket as writeable
|
||||
* @param s The socket
|
||||
*/
|
||||
virtual void ClearWritable(Socket *s) { }
|
||||
|
||||
/** Read from sockets and do things
|
||||
*/
|
||||
virtual void Process() { }
|
||||
};
|
||||
|
||||
#endif // SOCKETENGINE_H
|
||||
+375
-33
@@ -1,48 +1,390 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2004-2009 Anope Team
|
||||
* (C) 2003-2011 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.
|
||||
*
|
||||
*
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef SOCKETS_H
|
||||
#define SOCKETS_H
|
||||
|
||||
#include "anope.h"
|
||||
|
||||
#define NET_BUFSIZE 65535
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef SOCKET ano_socket_t;
|
||||
#define ano_sockread(fd, buf, len) recv(fd, buf, len, 0)
|
||||
#define ano_sockwrite(fd, buf, len) send(fd, buf, len, 0)
|
||||
#define ano_sockclose(fd) closesocket(fd)
|
||||
#define ano_sockgeterr() WSAGetLastError()
|
||||
#define ano_sockseterr(err) WSASetLastError(err)
|
||||
/* ano_sockstrerror in sockutil.c */
|
||||
extern char *ano_sockstrerror(int);
|
||||
/* ano_socksetnonb in sockutil.c */
|
||||
#define ano_sockerrnonb(err) (err == WSAEINPROGRESS || err == WSAEWOULDBLOCK)
|
||||
#define SOCKERR_EBADF WSAENOTSOCK
|
||||
#define SOCKERR_EINTR WSAEINTR
|
||||
#define SOCKERR_EINVAL WSAEINVAL
|
||||
#define SOCKERR_EINPROGRESS WSAEINPROGRESS
|
||||
# define CloseSocket closesocket
|
||||
#else
|
||||
typedef int ano_socket_t;
|
||||
#define ano_sockread(fd, buf, len) read(fd, buf, len)
|
||||
#define ano_sockwrite(fd, buf, len) write(fd, buf, len)
|
||||
#define ano_sockclose(fd) close(fd)
|
||||
#define ano_sockgeterr() errno
|
||||
#define ano_sockseterr(err) errno = err
|
||||
#define ano_sockstrerror(err) strerror(err)
|
||||
#define ano_socksetnonb(fd) fcntl(fd, F_SETFL, O_NONBLOCK)
|
||||
#define ano_sockerrnonb(err) (err == EINPROGRESS)
|
||||
#define SOCKERR_EBADF EBADF
|
||||
#define SOCKERR_EINTR EINTR
|
||||
#define SOCKERR_EINVAL EINVAL
|
||||
#define SOCKERR_EINPROGRESS EINPROGRESS
|
||||
# define CloseSocket close
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/** A sockaddr union used to combine IPv4 and IPv6 sockaddrs
|
||||
*/
|
||||
union CoreExport sockaddrs
|
||||
{
|
||||
sockaddr sa;
|
||||
sockaddr_in sa4;
|
||||
sockaddr_in6 sa6;
|
||||
|
||||
/** Construct the object, sets everything to 0
|
||||
*/
|
||||
sockaddrs();
|
||||
|
||||
/** Memset the object to 0
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/** Get the size of the sockaddr we represent
|
||||
* @return The size
|
||||
*/
|
||||
size_t size() const;
|
||||
|
||||
/** Get the port represented by this addr
|
||||
* @return The port, or -1 on fail
|
||||
*/
|
||||
int port() const;
|
||||
|
||||
/** Get the address represented by this addr
|
||||
* @return The address
|
||||
*/
|
||||
Anope::string addr() const;
|
||||
|
||||
/** Check if this sockaddr has data in it
|
||||
*/
|
||||
bool operator()() const;
|
||||
|
||||
/** Compares with sockaddr with another. Compares address type, port, and address
|
||||
* @return true if they are the same
|
||||
*/
|
||||
bool operator==(const sockaddrs &other) const;
|
||||
/* The same as above but not */
|
||||
inline bool operator!=(const sockaddrs &other) const { return !(*this == other); }
|
||||
|
||||
/** The equivalent of inet_pton
|
||||
* @param type AF_INET or AF_INET6
|
||||
* @param address The address to place in the sockaddr structures
|
||||
* @param pport An option port to include in the sockaddr structures
|
||||
* @throws A socket exception if given invalid IPs
|
||||
*/
|
||||
void pton(int type, const Anope::string &address, int pport = 0);
|
||||
|
||||
/** The equivalent of inet_ntop
|
||||
* @param type AF_INET or AF_INET6
|
||||
* @param address The in_addr or in_addr6 structure
|
||||
* @throws A socket exception if given an invalid structure
|
||||
*/
|
||||
void ntop(int type, const void *src);
|
||||
};
|
||||
|
||||
class CoreExport cidr
|
||||
{
|
||||
sockaddrs addr;
|
||||
Anope::string cidr_ip;
|
||||
unsigned char cidr_len;
|
||||
public:
|
||||
cidr(const Anope::string &ip);
|
||||
cidr(const Anope::string &ip, unsigned char len);
|
||||
Anope::string mask() const;
|
||||
bool match(sockaddrs &other);
|
||||
};
|
||||
|
||||
class SocketException : public CoreException
|
||||
{
|
||||
public:
|
||||
/** Default constructor for socket exceptions
|
||||
* @param message Error message
|
||||
*/
|
||||
SocketException(const Anope::string &message) : CoreException(message) { }
|
||||
|
||||
/** Default destructor
|
||||
* @throws Nothing
|
||||
*/
|
||||
virtual ~SocketException() throw() { }
|
||||
};
|
||||
|
||||
enum SocketType
|
||||
{
|
||||
SOCKTYPE_BASE,
|
||||
SOCKTYPE_BUFFERED,
|
||||
SOCKTYPE_CONNECTION,
|
||||
SOCKTYPE_CLIENT,
|
||||
SOCKTYPE_LISTEN
|
||||
};
|
||||
|
||||
enum SocketFlag
|
||||
{
|
||||
SF_DEAD,
|
||||
SF_WRITABLE
|
||||
};
|
||||
|
||||
static const Anope::string SocketFlagStrings[] = { "SF_DEAD", "SF_WRITABLE", "" };
|
||||
|
||||
class Socket;
|
||||
class ClientSocket;
|
||||
class ListenSocket;
|
||||
class ConnectionSocket;
|
||||
|
||||
class CoreExport SocketIO
|
||||
{
|
||||
public:
|
||||
/** Receive something from the buffer
|
||||
* @param s The socket
|
||||
* @param buf The buf to read to
|
||||
* @param sz How much to read
|
||||
* @return Number of bytes received
|
||||
*/
|
||||
virtual int Recv(Socket *s, char *buf, size_t sz) const;
|
||||
|
||||
/** Write something to the socket
|
||||
* @param s The socket
|
||||
* @param buf What to write
|
||||
* @return Number of bytes written
|
||||
*/
|
||||
virtual int Send(Socket *s, const Anope::string &buf) const;
|
||||
|
||||
/** Accept a connection from a socket
|
||||
* @param s The socket
|
||||
*/
|
||||
virtual void Accept(ListenSocket *s);
|
||||
|
||||
/** Connect the socket
|
||||
* @param s THe socket
|
||||
* @param target IP to connect to
|
||||
* @param port to connect to
|
||||
* @param bindip IP to bind to, if any
|
||||
*/
|
||||
virtual void Connect(ConnectionSocket *s, const Anope::string &target, int port, const Anope::string &bindip = "");
|
||||
|
||||
/** Called when the socket is destructing
|
||||
*/
|
||||
virtual void Destroy() { }
|
||||
};
|
||||
|
||||
class CoreExport Socket : public Flags<SocketFlag, 2>
|
||||
{
|
||||
protected:
|
||||
/* Socket FD */
|
||||
int Sock;
|
||||
/* Is this an IPv6 socket? */
|
||||
bool IPv6;
|
||||
|
||||
public:
|
||||
/* I/O functions used for this socket */
|
||||
SocketIO *IO;
|
||||
|
||||
/* Type this socket is */
|
||||
SocketType Type;
|
||||
|
||||
/** Empty constructor, used for things such as the pipe socket
|
||||
*/
|
||||
Socket();
|
||||
|
||||
/** Default constructor
|
||||
* @param sock The socket to use, 0 if we need to create our own
|
||||
* @param ipv6 true if using ipv6
|
||||
* @param type The socket type, defaults to SOCK_STREAM
|
||||
*/
|
||||
Socket(int sock, bool ipv6, int type = SOCK_STREAM);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~Socket();
|
||||
|
||||
/** Get the socket FD for this socket
|
||||
* @return the fd
|
||||
*/
|
||||
int GetFD() const;
|
||||
|
||||
/** Check if this socket is IPv6
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsIPv6() const;
|
||||
|
||||
/** Mark a socket as blockig
|
||||
* @return true if the socket is now blocking
|
||||
*/
|
||||
bool SetBlocking();
|
||||
|
||||
/** Mark a socket as non-blocking
|
||||
* @return true if the socket is now non-blocking
|
||||
*/
|
||||
bool SetNonBlocking();
|
||||
|
||||
/** Called when there is something to be received for this socket
|
||||
* @return true on success, false to drop this socket
|
||||
*/
|
||||
virtual bool ProcessRead();
|
||||
|
||||
/** Called when the socket is ready to be written to
|
||||
* @return true on success, false to drop this socket
|
||||
*/
|
||||
virtual bool ProcessWrite();
|
||||
|
||||
/** Called when there is an error for this socket
|
||||
* @return true on success, false to drop this socket
|
||||
*/
|
||||
virtual void ProcessError();
|
||||
};
|
||||
|
||||
class CoreExport BufferedSocket : public Socket
|
||||
{
|
||||
protected:
|
||||
/* Things to be written to the socket */
|
||||
std::string WriteBuffer;
|
||||
/* Part of a message sent from the server, but not totally received */
|
||||
std::string extrabuf;
|
||||
/* How much data was received from this socket */
|
||||
size_t RecvLen;
|
||||
|
||||
public:
|
||||
/** Blank constructor
|
||||
*/
|
||||
BufferedSocket();
|
||||
|
||||
/** Constructor
|
||||
* @param fd FD to use
|
||||
* @param ipv6 true for ipv6
|
||||
* @param type socket type, defaults to SOCK_STREAM
|
||||
*/
|
||||
BufferedSocket(int fd, bool ipv6, int type = SOCK_STREAM);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~BufferedSocket();
|
||||
|
||||
/** Called when there is something to be received for this socket
|
||||
* @return true on success, false to drop this socket
|
||||
*/
|
||||
bool ProcessRead();
|
||||
|
||||
/** Called when the socket is ready to be written to
|
||||
* @return true on success, false to drop this socket
|
||||
*/
|
||||
bool ProcessWrite();
|
||||
|
||||
/** Called with a line received from the socket
|
||||
* @param buf The line
|
||||
* @return true to continue reading, false to drop the socket
|
||||
*/
|
||||
virtual bool Read(const Anope::string &buf);
|
||||
|
||||
/** Write to the socket
|
||||
* @param message The message
|
||||
*/
|
||||
void Write(const char *message, ...);
|
||||
void Write(const Anope::string &message);
|
||||
|
||||
/** Get the length of the read buffer
|
||||
* @return The length of the read buffer
|
||||
*/
|
||||
size_t ReadBufferLen() const;
|
||||
|
||||
/** Get the length of the write buffer
|
||||
* @return The length of the write buffer
|
||||
*/
|
||||
size_t WriteBufferLen() const;
|
||||
};
|
||||
|
||||
class CoreExport ListenSocket : public Socket
|
||||
{
|
||||
protected:
|
||||
/* Sockaddrs for bindip/port */
|
||||
sockaddrs listenaddrs;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
* @param bindip The IP to bind to
|
||||
* @param port The port to listen on
|
||||
* @param ipv6 true for ipv6
|
||||
*/
|
||||
ListenSocket(const Anope::string &bindip, int port, bool ipv6);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
virtual ~ListenSocket();
|
||||
|
||||
/** Process what has come in from the connection
|
||||
* @return false to destory this socket
|
||||
*/
|
||||
bool ProcessRead();
|
||||
|
||||
/** Called when a connection is accepted
|
||||
* @param fd The FD for the new connection
|
||||
* @param addr The sockaddr for where the connection came from
|
||||
* @return The new socket
|
||||
*/
|
||||
virtual ClientSocket *OnAccept(int fd, const sockaddrs &addr);
|
||||
};
|
||||
|
||||
class CoreExport ConnectionSocket : public BufferedSocket
|
||||
{
|
||||
public:
|
||||
/* Sockaddrs for bindip (if there is one) */
|
||||
sockaddrs bindaddr;
|
||||
/* Sockaddrs for connection ip/port */
|
||||
sockaddrs conaddr;
|
||||
|
||||
/** Constructor
|
||||
* @param ipv6 true to use IPv6
|
||||
* @param type The socket type, defaults to SOCK_STREAM
|
||||
*/
|
||||
ConnectionSocket(bool ipv6 = false, int type = SOCK_STREAM);
|
||||
|
||||
/** Connect the socket
|
||||
* @param TargetHost The target host to connect to
|
||||
* @param Port The target port to connect to
|
||||
* @param BindHost The host to bind to for connecting
|
||||
*/
|
||||
void Connect(const Anope::string &TargetHost, int Port, const Anope::string &BindHost = "");
|
||||
};
|
||||
|
||||
class CoreExport ClientSocket : public BufferedSocket
|
||||
{
|
||||
public:
|
||||
/* Listen socket this connection came from */
|
||||
ListenSocket *LS;
|
||||
/* Clients address */
|
||||
sockaddrs clientaddr;
|
||||
|
||||
/** Constructor
|
||||
* @param ls Listen socket this connection is from
|
||||
* @param fd New FD for this socket
|
||||
* @param addr Address the connection came from
|
||||
*/
|
||||
ClientSocket(ListenSocket *ls, int fd, const sockaddrs &addr);
|
||||
};
|
||||
|
||||
class CoreExport Pipe : public BufferedSocket
|
||||
{
|
||||
public:
|
||||
/** The FD of the write pipe (if this isn't evenfd)
|
||||
* this->Sock is the readfd
|
||||
*/
|
||||
int WritePipe;
|
||||
|
||||
/** Constructor
|
||||
*/
|
||||
Pipe();
|
||||
|
||||
/** Called when data is to be read
|
||||
*/
|
||||
bool ProcessRead();
|
||||
|
||||
/** Function that calls OnNotify
|
||||
*/
|
||||
bool Read(const Anope::string &);
|
||||
|
||||
/** Called when this pipe needs to be woken up
|
||||
*/
|
||||
void Notify();
|
||||
|
||||
/** Should be overloaded to do something useful
|
||||
*/
|
||||
virtual void OnNotify();
|
||||
};
|
||||
|
||||
#endif // SOCKET_H
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
#ifndef _SYSCONF_H_
|
||||
#define _SYSCONF_H_
|
||||
|
||||
#cmakedefine DEBUG_BUILD
|
||||
|
||||
#cmakedefine DEFUMASK @DEFUMASK@
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
#cmakedefine HAVE_STDDEF_H 1
|
||||
#cmakedefine HAVE_BACKTRACE 1
|
||||
#cmakedefine HAVE_GETHOSTBYNAME 1
|
||||
#cmakedefine HAVE_GETTIMEOFDAY 1
|
||||
#cmakedefine HAVE_SETGRENT 1
|
||||
#cmakedefine HAVE_STRCASECMP 1
|
||||
#cmakedefine HAVE_STRICMP 1
|
||||
#cmakedefine HAVE_STRINGS_H 1
|
||||
#cmakedefine HAVE_STRLCAT 1
|
||||
#cmakedefine HAVE_STRLCPY 1
|
||||
#cmakedefine HAVE_SYS_SELECT_H 1
|
||||
#cmakedefine HAVE_UMASK 1
|
||||
#cmakedefine HAVE_EVENTFD 1
|
||||
#cmakedefine GETTEXT_FOUND 1
|
||||
#cmakedefine RUNGROUP "@RUNGROUP@"
|
||||
#cmakedefine SERVICES_BIN "@SERVICES_BIN@"
|
||||
|
||||
#cmakedefine HAVE_UINT8_T 1
|
||||
#cmakedefine HAVE_U_INT8_T 1
|
||||
@@ -101,9 +101,6 @@ typedef unsigned long uint32;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef MSVCPP
|
||||
# define snprintf _snprintf
|
||||
# endif
|
||||
# define popen _popen
|
||||
# define pclose _pclose
|
||||
# define ftruncate _chsize
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
#ifndef _SYSCONF_H_
|
||||
#define _SYSCONF_H_
|
||||
|
||||
#undef DEFUMASK
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
#undef HAVE_STDINT_H
|
||||
#undef HAVE_STDDEF_H
|
||||
#undef HAVE_BACKTRACE
|
||||
#undef HAVE_GETHOSTBYNAME
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
#undef HAVE_SETGRENT
|
||||
#undef HAVE_STRCASECMP
|
||||
#undef HAVE_STRICMP
|
||||
#undef HAVE_STRINGS_H
|
||||
#undef HAVE_STRLCAT
|
||||
#undef HAVE_STRLCPY
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
#undef HAVE_UMASK
|
||||
#undef RUNGROUP
|
||||
#define SERVICES_BIN "services"
|
||||
|
||||
#undef HAVE_UINT8_T
|
||||
#undef HAVE_U_INT8_T
|
||||
#undef HAVE_INT16_T
|
||||
#undef HAVE_UINT16_T
|
||||
#undef HAVE_U_INT16_T
|
||||
#undef HAVE_INT32_T
|
||||
#undef HAVE_UINT32_T
|
||||
#undef HAVE_U_INT32_T
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UINT8_T
|
||||
typedef uint8_t uint8;
|
||||
#else
|
||||
# ifdef HAVE_U_INT8_T
|
||||
typedef u_int8_t uint8;
|
||||
# else
|
||||
# ifdef _WIN32
|
||||
typedef unsigned __int8 uint8;
|
||||
# else
|
||||
typedef unsigned short uint8;
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INT16_T
|
||||
typedef int16_t int16;
|
||||
#else
|
||||
# ifdef _WIN32
|
||||
typedef signed __int16 int16;
|
||||
# else
|
||||
typedef int int16;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UINT16_T
|
||||
typedef uint16_t uint16;
|
||||
#else
|
||||
# ifdef HAVE_U_INT16_T
|
||||
typedef u_int16_t uint16;
|
||||
# else
|
||||
# ifdef _WIN32
|
||||
typedef unsigned __int16 uint16;
|
||||
# else
|
||||
typedef unsigned int uint16;
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INT32_T
|
||||
typedef int32_t int32;
|
||||
#else
|
||||
# ifdef _WIN32
|
||||
typedef signed __int32 int32;
|
||||
# else
|
||||
typedef long int32;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UINT32_T
|
||||
typedef uint32_t uint32;
|
||||
#else
|
||||
# ifdef HAVE_U_INT32_T
|
||||
typedef u_int32_t uint32;
|
||||
# else
|
||||
# ifdef _WIN32
|
||||
typedef unsigned __int32 uint32;
|
||||
# else
|
||||
typedef unsigned long uint32;
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef MSVCPP
|
||||
# define snprintf _snprintf
|
||||
# endif
|
||||
# define popen _popen
|
||||
# define pclose _pclose
|
||||
# define ftruncate _chsize
|
||||
# ifdef MSVCPP
|
||||
# define PATH_MAX MAX_PATH
|
||||
# endif
|
||||
# define MAXPATHLEN MAX_PATH
|
||||
# define bzero(buf, size) memset(buf, 0, size)
|
||||
# ifdef MSVCPP
|
||||
# define strcasecmp stricmp
|
||||
# endif
|
||||
# define sleep(x) Sleep(x * 1000)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,138 @@
|
||||
#ifndef THREADENGINE_H
|
||||
#define THREADENGINE_H
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef HANDLE ThreadHandle;
|
||||
typedef CRITICAL_SECTION MutexHandle;
|
||||
typedef HANDLE CondHandle;
|
||||
#else
|
||||
# include <pthread.h>
|
||||
typedef pthread_t ThreadHandle;
|
||||
typedef pthread_mutex_t MutexHandle;
|
||||
typedef pthread_cond_t CondHandle;
|
||||
#endif
|
||||
|
||||
class ThreadEngine;
|
||||
class Thread;
|
||||
|
||||
extern CoreExport ThreadEngine threadEngine;
|
||||
|
||||
class CoreExport ThreadEngine
|
||||
{
|
||||
public:
|
||||
/* Vector of threads */
|
||||
std::vector<Thread *> threads;
|
||||
|
||||
/** Threadengines constructor
|
||||
*/
|
||||
ThreadEngine();
|
||||
|
||||
/** Threadengines destructor
|
||||
*/
|
||||
~ThreadEngine();
|
||||
|
||||
/** Start a new thread
|
||||
* @param thread A pointer to a newley allocated thread
|
||||
*/
|
||||
void Start(Thread *thread);
|
||||
|
||||
/** Check for finished threads
|
||||
*/
|
||||
void Process();
|
||||
};
|
||||
|
||||
class CoreExport Thread : public Extensible
|
||||
{
|
||||
private:
|
||||
/* Set to true to tell the thread to finish and we are waiting for it */
|
||||
bool exit;
|
||||
|
||||
public:
|
||||
/* Handle for this thread */
|
||||
ThreadHandle Handle;
|
||||
|
||||
/** Threads constructor
|
||||
*/
|
||||
Thread();
|
||||
|
||||
/** Threads destructor
|
||||
*/
|
||||
virtual ~Thread();
|
||||
|
||||
/** Join to the thread, sets the exit state to true
|
||||
*/
|
||||
void Join();
|
||||
|
||||
/** Sets the exit state as true informing the thread we want it to shut down
|
||||
*/
|
||||
void SetExitState();
|
||||
|
||||
/** Exit the thread. Note that the thread still must be joined to free resources!
|
||||
*/
|
||||
void Exit();
|
||||
|
||||
/** Returns the exit state of the thread
|
||||
* @return true if we want to exit
|
||||
*/
|
||||
bool GetExitState() const;
|
||||
|
||||
/** Called to run the thread, should be overloaded
|
||||
*/
|
||||
virtual void Run();
|
||||
};
|
||||
|
||||
class CoreExport Mutex
|
||||
{
|
||||
protected:
|
||||
/* A mutex, used to keep threads in sync */
|
||||
MutexHandle mutex;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
*/
|
||||
Mutex();
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
~Mutex();
|
||||
|
||||
/** Attempt to lock the mutex, will hang until a lock can be achieved
|
||||
*/
|
||||
void Lock();
|
||||
|
||||
/** Unlock the mutex, it must be locked first
|
||||
*/
|
||||
void Unlock();
|
||||
|
||||
/** Attempt to lock the mutex, will return true on success and false on fail
|
||||
* Does not block
|
||||
* @return true or false
|
||||
*/
|
||||
bool TryLock();
|
||||
};
|
||||
|
||||
class CoreExport Condition : public Mutex
|
||||
{
|
||||
private:
|
||||
/* A condition */
|
||||
CondHandle cond;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
*/
|
||||
Condition();
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
~Condition();
|
||||
|
||||
/** Called to wakeup the waiter
|
||||
*/
|
||||
void Wakeup();
|
||||
|
||||
/** Called to wait for a Wakeup() call
|
||||
*/
|
||||
void Wait();
|
||||
};
|
||||
|
||||
#endif // THREADENGINE_H
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Time-delay routine include stuff.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TIMEOUT_H
|
||||
#define TIMEOUT_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
|
||||
/* Definitions for timeouts: */
|
||||
typedef struct timeout_ Timeout;
|
||||
struct timeout_ {
|
||||
Timeout *next, *prev;
|
||||
time_t settime, timeout;
|
||||
int repeat; /* Does this timeout repeat indefinitely? */
|
||||
void (*code)(Timeout *); /* This structure is passed to the code */
|
||||
void *data; /* Can be anything */
|
||||
};
|
||||
|
||||
|
||||
/* Check the timeout list for any pending actions. */
|
||||
extern void check_timeouts();
|
||||
|
||||
/* Add a timeout to the list to be triggered in `delay' seconds. Any
|
||||
* timeout added from within a timeout routine will not be checked during
|
||||
* that run through the timeout list.
|
||||
*/
|
||||
extern Timeout *add_timeout(int delay, void (*code)(Timeout *), int repeat);
|
||||
|
||||
/* Remove a timeout from the list (if it's there). */
|
||||
extern void del_timeout(Timeout *t);
|
||||
|
||||
|
||||
#endif /* TIMEOUT_H */
|
||||
@@ -0,0 +1,113 @@
|
||||
/* Timer include stuff.
|
||||
*
|
||||
* (C) 2003-2011 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 TIMERS_H
|
||||
#define TIMERS_H
|
||||
|
||||
#include "services.h"
|
||||
#include <time.h>
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
class CoreExport Timer : public Extensible
|
||||
{
|
||||
private:
|
||||
/** The time this was created
|
||||
*/
|
||||
time_t settime;
|
||||
|
||||
/** The triggering time
|
||||
*/
|
||||
time_t trigger;
|
||||
|
||||
/** Numer of seconds between triggers
|
||||
*/
|
||||
long secs;
|
||||
|
||||
/** True if this is a repeating timer
|
||||
*/
|
||||
bool repeat;
|
||||
|
||||
public:
|
||||
/** Default constructor, initializes the triggering time
|
||||
* @param time_from_now The number of seconds from now to trigger the timer
|
||||
* @param now The time now
|
||||
* @param repeating Repeat this timer every time_from_now if this is true
|
||||
*/
|
||||
Timer(long time_from_now, time_t now = Anope::CurTime, bool repeating = false);
|
||||
|
||||
/** Default destructor, removes the timer from the list
|
||||
*/
|
||||
virtual ~Timer();
|
||||
|
||||
/** Set the trigger time to a new value
|
||||
* @param t The new time
|
||||
*/
|
||||
void SetTimer(time_t t);
|
||||
|
||||
/** Retrieve the triggering time
|
||||
* @return The trigger time
|
||||
*/
|
||||
time_t GetTimer() const;
|
||||
|
||||
/** Returns true if the timer is set to repeat
|
||||
* @return Returns true if the timer is set to repeat
|
||||
*/
|
||||
bool GetRepeat() const;
|
||||
|
||||
/** Returns the interval between ticks
|
||||
* @return The interval
|
||||
*/
|
||||
long GetSecs() const;
|
||||
|
||||
/** Returns the time this timer was created
|
||||
* @return The time this timer was created
|
||||
*/
|
||||
time_t GetSetTime() const;
|
||||
|
||||
/** Called when the timer ticks
|
||||
* This should be overridden with something useful
|
||||
*/
|
||||
virtual void Tick(time_t ctime) = 0;
|
||||
};
|
||||
|
||||
/** This class manages sets of Timers, and triggers them at their defined times.
|
||||
* This will ensure timers are not missed, as well as removing timers that have
|
||||
* expired and allowing the addition of new ones.
|
||||
*/
|
||||
class CoreExport TimerManager : public Extensible
|
||||
{
|
||||
protected:
|
||||
/** A list of timers
|
||||
*/
|
||||
static std::vector<Timer *> Timers;
|
||||
public:
|
||||
/** Add a timer to the list
|
||||
* @param T A Timer derived class to add
|
||||
*/
|
||||
static void AddTimer(Timer *T);
|
||||
|
||||
/** Deletes a timer
|
||||
* @param T A Timer derived class to delete
|
||||
*/
|
||||
static void DelTimer(Timer *T);
|
||||
|
||||
/** Tick all pending timers
|
||||
* @param ctime The current time
|
||||
*/
|
||||
static void TickTimers(time_t ctime = Anope::CurTime);
|
||||
|
||||
/** Compares two timers
|
||||
*/
|
||||
static bool TimerComparison(Timer *one, Timer *two);
|
||||
};
|
||||
|
||||
#endif // TIMERS_H
|
||||
+238
-50
@@ -1,101 +1,289 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2009 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2011 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
struct u_chanlist {
|
||||
struct u_chanlist *next, *prev;
|
||||
Channel *chan;
|
||||
int16 status; /* Associated flags; see CSTATUS_* below. */
|
||||
|
||||
#ifndef USERS_H
|
||||
#define USERS_H
|
||||
|
||||
extern CoreExport Anope::insensitive_map<User *> UserListByNick;
|
||||
extern CoreExport Anope::map<User *> UserListByUID;
|
||||
|
||||
class CoreExport ChannelStatus : public Flags<ChannelModeName, CMODE_END * 2>
|
||||
{
|
||||
public:
|
||||
ChannelStatus();
|
||||
Anope::string BuildCharPrefixList() const;
|
||||
Anope::string BuildModePrefixList() const;
|
||||
};
|
||||
|
||||
struct u_chaninfolist {
|
||||
struct u_chaninfolist *next, *prev;
|
||||
ChannelInfo *chan;
|
||||
struct ChannelContainer
|
||||
{
|
||||
Channel *chan;
|
||||
ChannelStatus *Status;
|
||||
|
||||
ChannelContainer(Channel *c) : chan(c) { }
|
||||
virtual ~ChannelContainer() { }
|
||||
};
|
||||
|
||||
typedef std::list<ChannelContainer *> UChannelList;
|
||||
|
||||
/* Online user and channel data. */
|
||||
class CoreExport User : public Extensible
|
||||
{
|
||||
protected:
|
||||
Anope::string vident;
|
||||
Anope::string ident;
|
||||
Anope::string uid;
|
||||
bool OnAccess; /* If the user is on the access list of the nick theyre on */
|
||||
Flags<UserModeName, UMODE_END * 2> modes; /* Bitset of mode names the user has set on them */
|
||||
std::map<UserModeName, Anope::string> Params; /* Map of user modes and the params this user has */
|
||||
NickCore *nc; /* NickCore account the user is currently loggged in as */
|
||||
|
||||
public: // XXX: exposing a tiny bit too much
|
||||
User *next, *prev;
|
||||
Anope::string nick; /* User's current nick */
|
||||
|
||||
char nick[NICKMAX];
|
||||
Anope::string host; /* User's real hostname */
|
||||
Anope::string vhost; /* User's virtual hostname */
|
||||
Anope::string chost; /* User's cloaked hostname */
|
||||
Anope::string realname; /* Realname */
|
||||
Anope::string fingerprint; /* SSL Fingerprint */
|
||||
sockaddrs ip; /* User's IP */
|
||||
Server *server; /* Server user is connected to */
|
||||
time_t timestamp; /* Timestamp of the nick */
|
||||
time_t my_signon; /* When did _we_ see the user? */
|
||||
|
||||
char *username; /* ident */
|
||||
char *host; /* User's real hostname */
|
||||
char *hostip; /* User's IP number */
|
||||
char *vhost; /* User's virtual hostname */
|
||||
std::string chost; /* User's cloaked hostname */
|
||||
char *vident; /* User's virtual ident */
|
||||
char *realname; /* Realname */
|
||||
Server *server; /* Server user is connected to */
|
||||
char *nickTrack; /* Nick Tracking */
|
||||
time_t timestamp; /* Timestamp of the nick */
|
||||
time_t my_signon; /* When did _we_ see the user? */
|
||||
time_t svid; /* Services ID */
|
||||
uint32 mode; /* See below */
|
||||
char *uid; /* Univeral ID */
|
||||
int isSuperAdmin; /* is SuperAdmin on or off? */
|
||||
|
||||
NickAlias *na;
|
||||
|
||||
int isSuperAdmin; /* is SuperAdmin on or off? */
|
||||
|
||||
struct u_chanlist *chans; /* Channels user has joined */
|
||||
struct u_chaninfolist *founder_chans; /* Channels user has identified for */
|
||||
/* Channels the user is in */
|
||||
UChannelList chans;
|
||||
|
||||
unsigned short invalid_pw_count; /* # of invalid password attempts */
|
||||
time_t invalid_pw_time; /* Time of last invalid password */
|
||||
time_t invalid_pw_time; /* Time of last invalid password */
|
||||
|
||||
time_t lastmemosend; /* Last time MS SEND command used */
|
||||
time_t lastnickreg; /* Last time NS REGISTER cmd used */
|
||||
time_t lastmail; /* Last time this user sent a mail */
|
||||
|
||||
time_t lastnickreg; /* Last time NS REGISTER cmd used */
|
||||
time_t lastmail; /* Last time this user sent a mail */
|
||||
|
||||
/****************************************************************/
|
||||
|
||||
/** Create a new user object, initialising necessary fields and
|
||||
* adds it to the hash
|
||||
*
|
||||
* @parameter nick The nickname of the user account.
|
||||
* @param snick The nickname of the user.
|
||||
* @param sident The username of the user
|
||||
* @param shost The hostname of the user
|
||||
* @param suid The unique identifier of the user.
|
||||
*/
|
||||
User(const std::string &nick);
|
||||
User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &suid);
|
||||
|
||||
/** Destroy a user.
|
||||
*/
|
||||
~User();
|
||||
virtual ~User();
|
||||
|
||||
/** Update the nickname of a user record accordingly, should be
|
||||
* called from ircd protocol.
|
||||
*/
|
||||
void SetNewNick(const std::string &newnick);
|
||||
void SetNewNick(const Anope::string &newnick);
|
||||
|
||||
/** Update the displayed (vhost) of a user record.
|
||||
* This is used (if set) instead of real host.
|
||||
* @param host The new displayed host to give the user.
|
||||
*/
|
||||
void SetDisplayedHost(const std::string &host);
|
||||
void SetDisplayedHost(const Anope::string &host);
|
||||
|
||||
/** Get the displayed vhost of a user record.
|
||||
* @return The displayed vhost of the user, where ircd-supported, or the user's real host.
|
||||
*/
|
||||
const Anope::string &GetDisplayedHost() const;
|
||||
|
||||
/** Update the cloaked host of a user
|
||||
* @param host The cloaked host
|
||||
*/
|
||||
void SetCloakedHost(const Anope::string &newhost);
|
||||
|
||||
/** Get the cloaked host of a user
|
||||
* @return The cloaked host
|
||||
*/
|
||||
const Anope::string &GetCloakedHost() const;
|
||||
|
||||
/** Retrieves the UID of the user, where applicable, if set.
|
||||
* This is not used on some IRCds, but is for a lot e.g. P10, TS6 protocols.
|
||||
* @return The UID of the user.
|
||||
*/
|
||||
const Anope::string &GetUID() const;
|
||||
|
||||
/** Update the displayed ident (username) of a user record.
|
||||
* @param ident The new ident to give this user.
|
||||
*/
|
||||
void SetIdent(const std::string &ident);
|
||||
void SetVIdent(const Anope::string &ident);
|
||||
|
||||
/** Get the displayed ident (username) of this user.
|
||||
* @return The displayed ident of this user.
|
||||
*/
|
||||
const Anope::string &GetVIdent() const;
|
||||
|
||||
/** Update the real ident (username) of a user record.
|
||||
* @param ident The new ident to give this user.
|
||||
* NOTE: Where possible, you should use the Get/SetVIdent() equivilants.
|
||||
*/
|
||||
void SetIdent(const Anope::string &ident);
|
||||
|
||||
/** Get the real ident (username) of this user.
|
||||
* @return The displayed ident of this user.
|
||||
* NOTE: Where possible, you should use the Get/SetVIdent() equivilants.
|
||||
*/
|
||||
const Anope::string &GetIdent() const;
|
||||
|
||||
/** Get the full mask ( nick!ident@realhost ) of a user
|
||||
*/
|
||||
Anope::string GetMask() const;
|
||||
|
||||
/** Get the full display mask (nick!vident@vhost/chost)
|
||||
*/
|
||||
Anope::string GetDisplayedMask() const;
|
||||
|
||||
/** Updates the realname of the user record.
|
||||
*/
|
||||
void SetRealname(const std::string &realname);
|
||||
void SetRealname(const Anope::string &realname);
|
||||
|
||||
/**
|
||||
* Send a message (notice or privmsg, depending on settings) to a user
|
||||
* @param source Sender nick
|
||||
* @param source Sender
|
||||
* @param fmt Format of the Message
|
||||
* @param ... any number of parameters
|
||||
* @return void
|
||||
*/
|
||||
void SendMessage(const char *source, const char *fmt, ...);
|
||||
void SendMessage(const char *source, const std::string &msg);
|
||||
void SendMessage(BotInfo *source, const char *fmt, ...);
|
||||
virtual void SendMessage(BotInfo *source, Anope::string msg);
|
||||
|
||||
/** Collide a nick
|
||||
* See the comment in users.cpp
|
||||
* @param na The nick
|
||||
*/
|
||||
void Collide(NickAlias *na);
|
||||
|
||||
/** Identify the user to the Nick
|
||||
* updates last_seen, logs the user in,
|
||||
* send messages, checks for mails, set vhost and more
|
||||
* @param the NickAlias
|
||||
*/
|
||||
void Identify(NickAlias *na);
|
||||
|
||||
/** Login the user to a NickCore
|
||||
* @param core The account the user is useing
|
||||
*/
|
||||
void Login(NickCore *core);
|
||||
|
||||
/** Logout the user
|
||||
*/
|
||||
void Logout();
|
||||
|
||||
/** Get the account the user is logged in using
|
||||
* @return The account or NULL
|
||||
*/
|
||||
virtual NickCore *Account();
|
||||
|
||||
/** Check if the user is identified for their nick
|
||||
* @param CheckNick True to check if the user is identified to the nickname they are on too
|
||||
* @return true or false
|
||||
*/
|
||||
virtual bool IsIdentified(bool CheckNick = false);
|
||||
|
||||
/** Check if the user is recognized for their nick (on the nicks access list)
|
||||
* @param CheckSecure Only returns true if the user has secure off
|
||||
* @return true or false
|
||||
*/
|
||||
virtual bool IsRecognized(bool CheckSecure = false);
|
||||
|
||||
/** Check if the user is a services oper
|
||||
* @return true if they are an oper
|
||||
*/
|
||||
bool IsServicesOper();
|
||||
|
||||
/** Check whether this user has access to run the given command string.
|
||||
* @param cmdstr The string to check, e.g. botserv/set/private.
|
||||
* @return True if this user may run the specified command, false otherwise.
|
||||
*/
|
||||
bool HasCommand(const Anope::string &cmdstr);
|
||||
|
||||
/** Check whether this user has access to the given special permission.
|
||||
* @param privstr The priv to check for, e.g. users/auspex.
|
||||
* @return True if this user has the specified priv, false otherwise.
|
||||
*/
|
||||
bool HasPriv(const Anope::string &privstr);
|
||||
|
||||
/** Update the last usermask stored for a user, and check to see if they are recognized
|
||||
*/
|
||||
void UpdateHost();
|
||||
|
||||
/** Check if the user has a mode
|
||||
* @param Name Mode name
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasMode(UserModeName Name) const;
|
||||
|
||||
/** Set a mode internally on the user, the IRCd is not informed
|
||||
* @param um The user mode
|
||||
* @param Param The param, if there is one
|
||||
*/
|
||||
void SetModeInternal(UserMode *um, const Anope::string &Param = "");
|
||||
|
||||
/** Remove a mode internally on the user, the IRCd is not informed
|
||||
* @param um The user mode
|
||||
*/
|
||||
void RemoveModeInternal(UserMode *um);
|
||||
|
||||
/** Set a mode on the user
|
||||
* @param bi The client setting the mode
|
||||
* @param um The user mode
|
||||
* @param Param Optional param for the mode
|
||||
*/
|
||||
void SetMode(BotInfo *bi, UserMode *um, const Anope::string &Param = "");
|
||||
|
||||
/** Set a mode on the user
|
||||
* @param bi The client setting the mode
|
||||
* @param Name The mode name
|
||||
* @param Param Optional param for the mode
|
||||
*/
|
||||
void SetMode(BotInfo *bi, UserModeName Name, const Anope::string &Param = "");
|
||||
|
||||
/** Remove a mode on the user
|
||||
* @param bi The client setting the mode
|
||||
* @param um The user mode
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, UserMode *um);
|
||||
|
||||
/** Remove a mode from the user
|
||||
* @param bi The client setting the mode
|
||||
* @param Name The mode name
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, UserModeName Name);
|
||||
|
||||
/** Set a string of modes on a user
|
||||
* @param bi The client setting the modes
|
||||
* @param umodes The modes
|
||||
*/
|
||||
void SetModes(BotInfo *bi, const char *umodes, ...);
|
||||
|
||||
/** Set a string of modes on a user internally
|
||||
* @param umodes The modes
|
||||
*/
|
||||
void SetModesInternal(const char *umodes, ...);
|
||||
|
||||
/** Find the channel container for Channel c that the user is on
|
||||
* This is preferred over using FindUser in Channel, as there are usually more users in a channel
|
||||
* than channels a user is in
|
||||
* @param c The channel
|
||||
* @return The channel container, or NULL
|
||||
*/
|
||||
ChannelContainer *FindChannel(const Channel *c);
|
||||
|
||||
/** Check if the user is protected from kicks and negative mode changes
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsProtected() const;
|
||||
};
|
||||
|
||||
#endif // USERS_H
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
/* Build bumper
|
||||
*
|
||||
* (C) 2003-2011 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 <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <list>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 3)
|
||||
{
|
||||
std::cout << "Syntax: " << argv[0] << " <src/version.sh> <version.h>" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::fstream fd;
|
||||
|
||||
fd.clear();
|
||||
fd.open(argv[1], std::ios::in);
|
||||
if (!fd.is_open())
|
||||
{
|
||||
std::cout << "Error: Unable to open src/version.sh for reading: " << argv[1] << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string filebuf;
|
||||
std::list<std::pair<std::string, std::string> > versions;
|
||||
while (getline(fd, filebuf))
|
||||
{
|
||||
if (!filebuf.find("VERSION_"))
|
||||
{
|
||||
size_t eq = filebuf.find('=');
|
||||
|
||||
std::string type = filebuf.substr(8, 5);
|
||||
std::string value = filebuf.substr(eq + 2, filebuf.length() - eq - 3);
|
||||
versions.push_back(std::make_pair(type, value));
|
||||
}
|
||||
}
|
||||
|
||||
fd.close();
|
||||
|
||||
fd.clear();
|
||||
fd.open(argv[2], std::ios::in);
|
||||
|
||||
std::string version_build = "#define VERSION_BUILD 1";
|
||||
std::string build = "#define BUILD 1";
|
||||
std::string version_extra;
|
||||
if (fd.is_open())
|
||||
{
|
||||
while (getline(fd, filebuf))
|
||||
{
|
||||
if (!filebuf.find("#define VERSION_BUILD"))
|
||||
version_build = filebuf;
|
||||
else if (!filebuf.find("#define VERSION_EXTRA"))
|
||||
{
|
||||
size_t q = filebuf.find('"');
|
||||
|
||||
version_extra = filebuf.substr(q + 1, filebuf.length() - q - 2);
|
||||
}
|
||||
else if (!filebuf.find("#define BUILD"))
|
||||
{
|
||||
size_t tab = filebuf.find(' ');
|
||||
|
||||
int ibuild = atoi(filebuf.substr(tab + 1).c_str()) + 1;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "#define BUILD " << ibuild;
|
||||
build = ss.str();
|
||||
}
|
||||
}
|
||||
|
||||
fd.close();
|
||||
}
|
||||
|
||||
fd.clear();
|
||||
fd.open(argv[2], std::ios::out);
|
||||
|
||||
if (!fd.is_open())
|
||||
{
|
||||
std::cout << "Error: Unable to include/version.h for writing: " << argv[2] << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
fd << "/* This file is automatically generated by version.cpp - do not edit it! */" << std::endl;
|
||||
|
||||
for (std::list<std::pair<std::string, std::string> >::iterator it = versions.begin(), it_end = versions.end(); it != it_end; ++it)
|
||||
{
|
||||
if (it->first == "EXTRA")
|
||||
fd << "#define VERSION_EXTRA \"" << (!version_extra.empty() ? version_extra : "") << (version_extra.find(it->second) == std::string::npos ? it->second : "") << "\"" << std::endl;
|
||||
else
|
||||
fd << "#define VERSION_" << it->first << " " << it->second << std::endl;
|
||||
}
|
||||
|
||||
fd << version_build << std::endl;
|
||||
fd << build << std::endl;
|
||||
|
||||
fd.close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Build version string and increment Services build number.
|
||||
#
|
||||
|
||||
if [ $# -lt 2 ] ; then
|
||||
echo "Syntax: $0 <version.log> <version.h>"
|
||||
exit 1
|
||||
fi
|
||||
# Grab version information from the version control file.
|
||||
CTRL="$1"
|
||||
if [ -f $CTRL ] ; then
|
||||
. $CTRL
|
||||
else
|
||||
echo "Error: Unable to find control file: $CTRL"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA} (${VERSION_BUILD})"
|
||||
VERSIONDOTTED="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_EXTRA}.${VERSION_BUILD}"
|
||||
|
||||
VERSIONH="$2"
|
||||
if [ -f $VERSIONH ] ; then
|
||||
BUILD=`fgrep '#define BUILD' $VERSIONH | cut -f2 -d\"`
|
||||
BUILD=`expr $BUILD + 1 2>/dev/null`
|
||||
else
|
||||
BUILD=1
|
||||
fi
|
||||
if [ ! "$BUILD" ] ; then
|
||||
BUILD=1
|
||||
fi
|
||||
cat >$VERSIONH <<EOF
|
||||
/* Version information for Services.
|
||||
*
|
||||
* (C) 2003-2008 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and CREDITS for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* This file is auto-generated by version.sh
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
#define VERSION_MAJOR $VERSION_MAJOR
|
||||
#define VERSION_MINOR $VERSION_MINOR
|
||||
#define VERSION_PATCH $VERSION_PATCH
|
||||
#define VERSION_EXTRA "$VERSION_EXTRA"
|
||||
#define VERSION_BUILD $VERSION_BUILD
|
||||
|
||||
#define BUILD "$BUILD"
|
||||
#define VERSION_STRING "$VERSION"
|
||||
#define VERSION_STRING_DOTTED "$VERSIONDOTTED"
|
||||
|
||||
#if defined(_WIN32)
|
||||
# if _MSC_VER >= 1400
|
||||
# define VER_OS "W"
|
||||
# else
|
||||
# define VER_OS "w"
|
||||
# endif
|
||||
#else
|
||||
# define VER_OS
|
||||
#endif
|
||||
|
||||
#if defined(USE_MYSQL)
|
||||
# define VER_MYSQL "Q"
|
||||
#else
|
||||
# define VER_MYSQL
|
||||
#endif
|
||||
|
||||
#if defined(USE_MODULES)
|
||||
# define VER_MODULE "M"
|
||||
#else
|
||||
# define VER_MODULE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
EOF
|
||||
|
||||
@@ -1,238 +0,0 @@
|
||||
/* version file handler for win32.
|
||||
*
|
||||
* (C) 2003-2009 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.
|
||||
*
|
||||
* Written by Dominick Meglio <codemastr@unrealircd.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/* Needed due to Windows lack of a decent interpreter */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cstdlib>
|
||||
#include <cctype>
|
||||
|
||||
long version_major, version_minor, version_patch, version_build, build;
|
||||
char *version_extra = NULL;
|
||||
char version[1024];
|
||||
char version_dotted[1024];
|
||||
|
||||
|
||||
void load_ctrl(FILE *);
|
||||
long get_value(char *);
|
||||
char *get_value_str(char *);
|
||||
char *strip(char *);
|
||||
void parse_version(FILE *);
|
||||
void write_version(FILE *, const char *);
|
||||
void parse_line(FILE *, char *);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 4) {
|
||||
fprintf(stderr, "Syntax: %s <version.log> <version.sh> <version.h>\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
FILE *fd = fopen(argv[1], "r");
|
||||
|
||||
|
||||
if (!fd) {
|
||||
fprintf(stderr, "Error: Unable to find control file: %s\n", argv[1]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
load_ctrl(fd);
|
||||
fclose(fd);
|
||||
|
||||
_snprintf(version, 1024, "%ld.%ld.%ld%s (%ld)", version_major, version_minor,
|
||||
version_patch, (version_extra ? version_extra : ""), version_build);
|
||||
|
||||
_snprintf(version_dotted, 1024, "%ld.%ld.%ld%s.%ld", version_major, version_minor,
|
||||
version_patch, (version_extra ? version_extra : ""), version_build);
|
||||
|
||||
fd = fopen(argv[3], "r");
|
||||
|
||||
if (fd) {
|
||||
parse_version(fd);
|
||||
fclose(fd);
|
||||
} else
|
||||
build = 1;
|
||||
|
||||
|
||||
fd = fopen(argv[3], "w");
|
||||
write_version(fd, argv[2]);
|
||||
fclose(fd);
|
||||
|
||||
if (version_extra)
|
||||
free(version_extra);
|
||||
}
|
||||
|
||||
void load_ctrl(FILE * fd)
|
||||
{
|
||||
char buf[512];
|
||||
while (fgets(buf, 511, fd)) {
|
||||
char *var;
|
||||
|
||||
strip(buf);
|
||||
|
||||
var = strtok(buf, "=");
|
||||
if (!var)
|
||||
continue;
|
||||
if (!strcmp(var, "VERSION_MAJOR"))
|
||||
version_major = get_value(strtok(NULL, ""));
|
||||
else if (!strcmp(var, "VERSION_MINOR"))
|
||||
version_minor = get_value(strtok(NULL, ""));
|
||||
else if (!strcmp(var, "VERSION_PATCH"))
|
||||
version_patch = get_value(strtok(NULL, ""));
|
||||
else if (!strcmp(var, "VERSION_BUILD"))
|
||||
version_build = get_value(strtok(NULL, ""));
|
||||
else if (!strcmp(var, "VERSION_EXTRA"))
|
||||
version_extra = get_value_str(strtok(NULL, ""));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
char *strip(char *str)
|
||||
{
|
||||
char *c;
|
||||
if ((c = strchr(str, '\n')))
|
||||
*c = 0;
|
||||
if ((c = strchr(str, '\r')))
|
||||
*c = 0;
|
||||
return str;
|
||||
}
|
||||
|
||||
long get_value(char *string)
|
||||
{
|
||||
// XXX : if the fields in version.log are empty strtok returns a double quote, dont try to atol it then
|
||||
if (string[1] != '"')
|
||||
return atol(get_value_str(string));
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *get_value_str(char *string)
|
||||
{
|
||||
int len;
|
||||
char *newstr;
|
||||
|
||||
if (*string == '"')
|
||||
string++;
|
||||
|
||||
len = strlen(string);
|
||||
|
||||
if (string[len - 1] == '"')
|
||||
string[len - 1] = 0;
|
||||
if (!*string)
|
||||
return NULL;
|
||||
newstr = (char *)malloc(len + 1);
|
||||
strcpy(newstr, string);
|
||||
return newstr;
|
||||
//return strdup(string);
|
||||
}
|
||||
|
||||
void parse_version(FILE * fd)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
while (fgets(buf, 1023, fd)) {
|
||||
char *para1;
|
||||
|
||||
strip(buf);
|
||||
para1 = strtok(buf, " \t");
|
||||
|
||||
if (!para1)
|
||||
continue;
|
||||
|
||||
if (!strcmp(para1, "#define")) {
|
||||
char *para2 = strtok(NULL, " \t");
|
||||
|
||||
if (!para2)
|
||||
continue;
|
||||
|
||||
if (!strcmp(para2, "BUILD")) {
|
||||
char *value = strtok(NULL, "");
|
||||
build = get_value(value);
|
||||
build++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
build = 1;
|
||||
}
|
||||
|
||||
void write_version(FILE * fd, const char *input)
|
||||
{
|
||||
FILE *fdin = fopen(input, "r");
|
||||
char buf[1024];
|
||||
short until_eof = 0;
|
||||
|
||||
while (fgets(buf, 1023, fdin)) {
|
||||
strip(buf);
|
||||
|
||||
if (until_eof)
|
||||
{
|
||||
if (!strcmp(buf, "EOF"))
|
||||
break;
|
||||
else
|
||||
parse_line(fd, buf);
|
||||
}
|
||||
|
||||
if (!strcmp(buf, "cat >$VERSIONH <<EOF"))
|
||||
until_eof = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void parse_line(FILE * fd, char *line)
|
||||
{
|
||||
char *c;
|
||||
for (c = line; *c; c++) {
|
||||
/* It's a variable, find out which */
|
||||
if (*c == '$') {
|
||||
char *var, *varbegin;
|
||||
|
||||
if (*(c + 1))
|
||||
c++;
|
||||
else
|
||||
continue;
|
||||
for (var = varbegin = c; var; var++) {
|
||||
if (!isalnum(*var) && *var != '_')
|
||||
break;
|
||||
}
|
||||
if (var != varbegin) {
|
||||
char tmp = *var;
|
||||
|
||||
*var = 0;
|
||||
if (!strcmp(varbegin, "VERSION_MAJOR"))
|
||||
fprintf(fd, "%ld", version_major);
|
||||
else if (!strcmp(varbegin, "VERSION_MINOR"))
|
||||
fprintf(fd, "%ld", version_minor);
|
||||
else if (!strcmp(varbegin, "VERSION_PATCH"))
|
||||
fprintf(fd, "%ld", version_patch);
|
||||
else if (!strcmp(varbegin, "VERSION_EXTRA")) {
|
||||
if (version_extra)
|
||||
fprintf(fd, "%s", version_extra);
|
||||
} else if (!strcmp(varbegin, "VERSION_BUILD"))
|
||||
fprintf(fd, "%ld", version_build);
|
||||
else if (!strcmp(varbegin, "BUILD"))
|
||||
fprintf(fd, "%ld", build);
|
||||
else if (!strcmp(varbegin, "VERSION"))
|
||||
fprintf(fd, "%s", version);
|
||||
else if (!strcmp(varbegin, "VERSIONDOTTED"))
|
||||
fprintf(fd, "%s", version_dotted);
|
||||
if (tmp) fputc(tmp, fd);
|
||||
}
|
||||
c = var;
|
||||
} else
|
||||
fputc(*c, fd);
|
||||
}
|
||||
/* We only need \n here - we didn't open the file as binary -GD */
|
||||
fprintf(fd, "\n");
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
SRC= ; DEST= ; MODE= ; USER= ; GROUP= ; export SRC DEST MODE USER GROUP
|
||||
while [ $# -gt 0 ] ; do
|
||||
case $1 in
|
||||
-m) MODE=$2; shift; shift;;
|
||||
-u) USER=$2; shift; shift;;
|
||||
-g) GROUP=$2; shift; shift;;
|
||||
-c) shift;;
|
||||
*) SRC="$DEST"; DEST="$1"; shift;;
|
||||
esac
|
||||
done
|
||||
if [ ! "$DEST" ] ; then
|
||||
echo >&2 "Usage: $0 [-c] [-m mode] [-u user] [-g group] source dest"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "$DEST" ] ; then
|
||||
DEST="$DEST/$SRC"
|
||||
fi
|
||||
/bin/cp -p "$SRC" "$DEST"
|
||||
if [ "$MODE" ] ; then
|
||||
/bin/chmod $MODE "$DEST"
|
||||
fi
|
||||
if [ "$USER" ] ; then
|
||||
/bin/chown "$USER" "$DEST"
|
||||
fi
|
||||
if [ "$GROUP" ] ; then
|
||||
/bin/chgrp "$GROUP" "$DEST"
|
||||
fi
|
||||
-278
@@ -1,278 +0,0 @@
|
||||
//
|
||||
// install.js - Windows Configuration
|
||||
//
|
||||
// (C) 2003-2008 Anope Team
|
||||
// Contact us at team@anope.org
|
||||
//
|
||||
// This program is free but copyrighted software; see the file COPYING for
|
||||
// details.
|
||||
//
|
||||
// Based on the original code of Epona by Lara.
|
||||
// Based on the original code of Services by Andy Church.
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
|
||||
var anopeVersion = "Unknown";
|
||||
var vMaj, vMin, vPat, vBuild, vExtra;
|
||||
|
||||
var installerResponses = new Array();
|
||||
|
||||
var installerQuestions = [
|
||||
{
|
||||
'question' : [
|
||||
'In what directory do you want Anope to be installed?'
|
||||
],
|
||||
'short' : 'Install directory:',
|
||||
'default_answer' : '',
|
||||
'store_answer' : function(answer) {
|
||||
if (!answer) {
|
||||
WScript.Echo("You must give a directory!\n");
|
||||
return false;
|
||||
}
|
||||
if (!fso.FolderExists(answer)) {
|
||||
if (fso.FileExists(answer)) {
|
||||
WScript.Echo(answer + " exists, but is not a directory!\n");
|
||||
return false;
|
||||
}
|
||||
WScript.Echo(answer + " does not exist. Create it ([yes]/no)?\n");
|
||||
var inputValue = InstallerInput().toLowerCase();
|
||||
if (!inputValue) {
|
||||
inputValue = 'yes';
|
||||
}
|
||||
if (inputValue != 'no') {
|
||||
fso.CreateFolder(answer);
|
||||
}
|
||||
}
|
||||
else if (fso.FileExists(answer + '\\include\\services.h')) {
|
||||
WScript.Echo("You cannot use the Anope source directory as a target directory.\n");
|
||||
return false;
|
||||
}
|
||||
installerResponses['Install Directory'] = answer.replace(/\\/g, '/');
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
return '-DINSTDIR:STRING=' + installerResponses['Install Directory'];
|
||||
}
|
||||
},
|
||||
{
|
||||
'question' : [
|
||||
'Would you like to build using NMake instead of using Visual Studio?',
|
||||
'NOTE: If you decide to use NMake, you must be in an environment where',
|
||||
' NMake can function, such as the Visual Studio command line.',
|
||||
' If you say yes to this while not in an environment that can run',
|
||||
' NMake, it can cause the CMake configuration to enter an endless',
|
||||
' loop.'
|
||||
],
|
||||
'short' : 'Use NMake?',
|
||||
'options' : [
|
||||
'yes',
|
||||
'no'
|
||||
],
|
||||
'default_answer' : 'no',
|
||||
'store_answer' : function(answer) {
|
||||
installerResponses['Use NMake'] = answer;
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
if (installerResponses['Use NMake'] == 'yes') return '-G"NMake Makefiles"';
|
||||
else return '';
|
||||
}
|
||||
},
|
||||
{
|
||||
'question' : [
|
||||
'Would you like to build a debug version of Anope?'
|
||||
],
|
||||
'short' : 'Build debug?',
|
||||
'options' : [
|
||||
'yes',
|
||||
'no'
|
||||
],
|
||||
'default_answer' : 'no',
|
||||
'store_answer' : function(answer) {
|
||||
installerResponses['Debug'] = answer;
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
if (installerResponses['Debug'] == 'msvc') return '';
|
||||
else if (installerResponses['Debug'] == 'yes') return '-DCMAKE_BUILD_TYPE:STRING=DEBUG';
|
||||
else return '-DCMAKE_BUILD_TYPE:STRING=RELEASE';
|
||||
}
|
||||
},
|
||||
{
|
||||
'question' : [
|
||||
'Are you using Visual Studio 2008? If you are, you need to answer yes',
|
||||
'to this question, otherwise CMake will not function properly.'
|
||||
],
|
||||
'short' : 'Using Visual Studio 2008?',
|
||||
'options' : [
|
||||
'yes',
|
||||
'no'
|
||||
],
|
||||
'default_answer' : 'no',
|
||||
'store_answer' : function(answer) {
|
||||
installerResponses['Visual Studio 2008'] = answer;
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
if (installerResponses['Visual Studio 2008'] == 'yes') return '-G"Visual Studio 9 2008"';
|
||||
else return '';
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
var bannerReplacements = [
|
||||
{
|
||||
'findtext' : /CURVER/g,
|
||||
'replacement' : function() { FindAnopeVersion(); return anopeVersion; }
|
||||
},
|
||||
{
|
||||
'findtext' : / For more options type SOURCE_DIR\/Config --help/g,
|
||||
'replacement' : function() { return ''; }
|
||||
}
|
||||
];
|
||||
|
||||
var ScriptPath = WScript.ScriptFullName.substr(0, WScript.ScriptFullName.length - WScript.ScriptName.length);
|
||||
|
||||
var fso = WScript.CreateObject('Scripting.FileSystemObject');
|
||||
var x, y, z;
|
||||
|
||||
if (fso.FileExists(ScriptPath + '.BANNER')) {
|
||||
var bannerStream = fso.OpenTextFile(ScriptPath + '.BANNER');
|
||||
var bannerText = bannerStream.ReadAll();
|
||||
bannerStream.close();
|
||||
|
||||
for (x in bannerReplacements) {
|
||||
var thisReplacement = bannerReplacements[x];
|
||||
bannerText = bannerText.replace(thisReplacement['findtext'], thisReplacement['replacement']);
|
||||
}
|
||||
|
||||
WScript.Echo(bannerText + "\n");
|
||||
}
|
||||
else {
|
||||
WScript.Echo("ERROR: Cannot find banner file!\n");
|
||||
}
|
||||
|
||||
WScript.Echo('Press Enter to Begin...');
|
||||
InstallerInput();
|
||||
WScript.Echo('');
|
||||
|
||||
for (x in installerQuestions) {
|
||||
var thisQuestion = installerQuestions[x];
|
||||
var validResponse = false;
|
||||
var validOpts = new Array();
|
||||
if (thisQuestion.short == 'Build debug?' && installerResponses['Use NMake'] == 'no') {
|
||||
installerResponses['Debug'] = 'msvc';
|
||||
continue;
|
||||
}
|
||||
if (thisQuestion.short == 'Using Visual Studio 2008?' && installerResponses['Debug'] != 'msvc') {
|
||||
installerResponses['Visual Studio 2008'] = 'no';
|
||||
continue;
|
||||
}
|
||||
while (!validResponse) {
|
||||
for (y in thisQuestion.question) {
|
||||
var qLine = thisQuestion.question[y];
|
||||
WScript.Echo(qLine);
|
||||
}
|
||||
WScript.Echo('');
|
||||
var choiceLine = '';
|
||||
if (thisQuestion.options) {
|
||||
for (y in thisQuestion.options) {
|
||||
choiceLine += thisQuestion.options[y] + ', ';
|
||||
validOpts[thisQuestion.options[y]] = true;
|
||||
}
|
||||
choiceLine = choiceLine.substring(0, choiceLine.length - 2);
|
||||
WScript.Echo('Available Options: ' + choiceLine);
|
||||
}
|
||||
if (thisQuestion.default_answer) WScript.Echo('Default Answer: ' + thisQuestion.default_answer + "\n");
|
||||
WScript.Echo(thisQuestion.short);
|
||||
var inputValue = InstallerInput().toLowerCase();
|
||||
if (!inputValue) {
|
||||
inputValue = thisQuestion.default_answer;
|
||||
}
|
||||
if (choiceLine && !validOpts[inputValue]) {
|
||||
WScript.Echo("ERROR: Invalid option '" + inputValue + "'\n");
|
||||
}
|
||||
else if (thisQuestion.store_answer(inputValue)) {
|
||||
validResponse = true;
|
||||
}
|
||||
}
|
||||
WScript.Echo('');
|
||||
}
|
||||
|
||||
WScript.Echo("\nAnope will be compiled with the following options:\n");
|
||||
for (x in installerResponses) {
|
||||
var thisResponse = installerResponses[x];
|
||||
WScript.Echo("\t" + x + ":\t\t[" + thisResponse.toUpperCase() + "]");
|
||||
}
|
||||
WScript.Echo("\tAnope Version:\t\t\t" + anopeVersion);
|
||||
WScript.Echo("\nTo continue, please press Enter...");
|
||||
InstallerInput();
|
||||
|
||||
var cmake = 'cmake';
|
||||
for (x in installerQuestions) {
|
||||
var thisQuestion = installerQuestions[x];
|
||||
cmake += ' ' + thisQuestion.cmake_argument();
|
||||
}
|
||||
cmake += ' "' + ScriptPath + '"';
|
||||
WScript.Echo(cmake + "\n");
|
||||
|
||||
var shell = WScript.CreateObject('WScript.Shell');
|
||||
var cmake_shell = shell.exec('%comspec% /c ' + cmake);
|
||||
while (!cmake_shell.StdOut.AtEndOfStream) {
|
||||
var strLine = cmake_shell.StdOut.ReadLine();
|
||||
WScript.Echo(strLine);
|
||||
}
|
||||
|
||||
if (installerResponses['Use NMake'] == 'yes') WScript.Echo("\nTo compile Anope, run 'nmake'. To install, run 'nmake install'.\n");
|
||||
else WScript.Echo("\nTo compile Anope, open Anope.sln and build the solution. To install,\ndo a build on the INSTALL project.\n");
|
||||
WScript.Echo("If you update Anope, you should run this script again to ensure\nall available options are set.\n");
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
// Functions
|
||||
|
||||
function FindAnopeVersion() {
|
||||
if (!fso.FileExists(ScriptPath + 'version.log')) {
|
||||
anopeVersion = 'Unknown';
|
||||
return;
|
||||
}
|
||||
|
||||
var versionLog = fso.OpenTextFile(ScriptPath + 'version.log');
|
||||
while (!versionLog.atEndOfStream) {
|
||||
var versionLine = versionLog.readline();
|
||||
var thisMatch = versionLine.replace('\n', '');
|
||||
while (thisMatch.match(/\"/g)) {
|
||||
thisMatch = thisMatch.replace('"', '');
|
||||
}
|
||||
versionLine = thisMatch;
|
||||
if (versionLine.match(/VERSION_MAJOR=/g)) {
|
||||
vMaj = versionLine.replace('VERSION_MAJOR=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_MINOR=/g)) {
|
||||
vMin = versionLine.replace('VERSION_MINOR=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_PATCH=/g)) {
|
||||
vPat = versionLine.replace('VERSION_PATCH=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_EXTRA=/g)) {
|
||||
vExtra = versionLine.replace('VERSION_EXTRA=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_BUILD=/g)) {
|
||||
vBuild = versionLine.replace('VERSION_BUILD=', '');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
versionLog.close();
|
||||
anopeVersion = vMaj + '.' + vMin + '.' + vPat + '.' + vBuild + vExtra;
|
||||
return;
|
||||
}
|
||||
|
||||
function InstallerInput() {
|
||||
var input = WScript.StdIn.Readline();
|
||||
return input;
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
# Set the source file for langcomp to use C++ as well as set it's compile flags
|
||||
set_source_files_properties(langcomp.c PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
|
||||
# Generate langcomp and set it's linker flags
|
||||
add_executable(langcomp langcomp.c)
|
||||
set_target_properties(langcomp PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
|
||||
# Get the location of the binary to use later
|
||||
get_target_property(langcomp_BINARY langcomp LOCATION)
|
||||
# Add the executable to the list of files for CPack to ignore
|
||||
file(RELATIVE_PATH langcomp_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langcomp_BINARY})
|
||||
add_to_cpack_ignored_files("${langcomp_BINARY_RELATIVE}$" TRUE)
|
||||
|
||||
# Determine if langtool should be built
|
||||
if(MSVC)
|
||||
set(BUILD_LANGTOOL TRUE)
|
||||
else(MSVC)
|
||||
if(NOT GREP OR NOT PERL)
|
||||
set(BUILD_LANGTOOL TRUE)
|
||||
else(NOT GREP OR NOT PERL)
|
||||
set(BUILD_LANGTOOL FALSE)
|
||||
endif(NOT GREP OR NOT PERL)
|
||||
endif(MSVC)
|
||||
|
||||
# If grep or perl don't exist on the system, build langtool to generate index and language.h
|
||||
if(BUILD_LANGTOOL)
|
||||
# Set the source file for langtool to use C++ as well as set it's compile flags
|
||||
set_source_files_properties(langtool.c PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
|
||||
# Generate langtool and set it's linker flags
|
||||
add_executable(langtool langtool.c)
|
||||
set_target_properties(langtool PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
|
||||
# Get the location of the binary to use later)
|
||||
get_target_property(langtool_BINARY langtool LOCATION)
|
||||
# Add the executable to the list of files for CPack to ignore
|
||||
file(RELATIVE_PATH langtool_BINARY_RELATIVE ${Anope_BINARY_DIR} ${langtool_BINARY})
|
||||
add_to_cpack_ignored_files("${langtool_BINARY_RELATIVE}$" TRUE)
|
||||
endif(BUILD_LANGTOOL)
|
||||
|
||||
# If grep exists (and we aren't using Visual Studio, it hates this), use it to generate the index file
|
||||
if(NOT MSVC AND GREP)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/index
|
||||
COMMAND ${GREP} '^[A-Z]' ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l > ${CMAKE_CURRENT_BINARY_DIR}/index
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l
|
||||
)
|
||||
# Otherwise, use langtool to generate the index file
|
||||
else(NOT MSVC AND GREP)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/index
|
||||
COMMAND ${langtool_BINARY} index ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l ${CMAKE_CURRENT_BINARY_DIR}/index
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/en_us.l DEPENDS langtool
|
||||
)
|
||||
endif(NOT MSVC AND GREP)
|
||||
# Add the index file to the list of files for CPack to ignore
|
||||
file(RELATIVE_PATH index_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/index)
|
||||
add_to_cpack_ignored_files("${index_RELATIVE}$")
|
||||
|
||||
# Find all the *.l files within the current source directory, and sort the list
|
||||
file(GLOB LANG_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.l")
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT LANG_SRCS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
|
||||
# Iterate through the language files
|
||||
foreach(LANG_L ${LANG_SRCS})
|
||||
# Convert the language file's extension to have no extension
|
||||
STRING(REGEX REPLACE "\\.l$" "" LANG ${LANG_L})
|
||||
# Add the language file to the list of compiled language files
|
||||
append_to_list(LANGS ${CMAKE_CURRENT_BINARY_DIR}/${LANG})
|
||||
# Generate a compiled language file using langcomp, as well as having a dependency on the index file being generated
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${LANG}
|
||||
COMMAND ${langcomp_BINARY} ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_L} ${CMAKE_CURRENT_BINARY_DIR}/${LANG}
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_L} DEPENDS langcomp ${CMAKE_CURRENT_BINARY_DIR}/index
|
||||
)
|
||||
# Add the language file to the list of files for CPack to ignore
|
||||
file(RELATIVE_PATH LANG_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${LANG})
|
||||
add_to_cpack_ignored_files("${LANG_RELATIVE}$")
|
||||
endforeach(LANG_L)
|
||||
|
||||
# If perl exists (and we aren't using Visual Studio, it hates this), use it to generate language.h
|
||||
if(NOT MSVC AND PERL)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/language.h
|
||||
COMMAND ${PERL} -e < ${CMAKE_CURRENT_BINARY_DIR}/index > ${CMAKE_CURRENT_BINARY_DIR}/language.h 'print STDERR \"Generating language.h... \"\; $$i=0\; while \(<>\) { chop\; printf \"\#define %-32s %d\\n\", $$_, $$i++\; } print \"\\n\#define NUM_STRINGS $$i\\n\"\; print STDERR \"$$i strings\\n\"\;'
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/index
|
||||
)
|
||||
# Otherwise, use langtool to generate language.h
|
||||
else(NOT MSVC AND PERL)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/language.h
|
||||
COMMAND ${langtool_BINARY} language.h ${CMAKE_CURRENT_BINARY_DIR}/index ${CMAKE_CURRENT_BINARY_DIR}/language.h
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/index DEPENDS langtool
|
||||
)
|
||||
endif(NOT MSVC AND PERL)
|
||||
# Add language.h to the list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("language.h$" TRUE)
|
||||
|
||||
# Add a custom target to depend on the language files and language.h
|
||||
add_custom_target(language DEPENDS ${LANGS} ${CMAKE_CURRENT_BINARY_DIR}/language.h)
|
||||
|
||||
# If RUNGROUP was set, make the permissions be to have owner read/write as well as group read/write
|
||||
if(RUNGROUP)
|
||||
set(PERMS OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE)
|
||||
# Otherwise, only make the permissions be owner read/write
|
||||
else(RUNGROUP)
|
||||
set(PERMS OWNER_READ OWNER_WRITE)
|
||||
endif(RUNGROUP)
|
||||
# Set the language files to be installed to the languages directory under the data directory
|
||||
install(FILES ${LANGS}
|
||||
DESTINATION data/languages
|
||||
PERMISSIONS ${PERMS}
|
||||
)
|
||||
|
||||
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the languages directory
|
||||
if(NOT WIN32)
|
||||
if(RUNGROUP)
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"\${CMAKE_INSTALL_PREFIX}/data/languages\")")
|
||||
else(RUNGROUP)
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 0700 \"\${CMAKE_INSTALL_PREFIX}/data/languages\")")
|
||||
endif(RUNGROUP)
|
||||
endif(NOT WIN32)
|
||||
@@ -1,82 +0,0 @@
|
||||
# Makefile for language module
|
||||
|
||||
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
|
||||
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
|
||||
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
|
||||
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
|
||||
'RUNGROUP=${RUNGROUP}' 'MAKEBIN=${MAKEBIN}'
|
||||
|
||||
LANGOBJS = cat de en_us es fr gr hun it nl pl pt ru tr
|
||||
LANGSRCS = cat.l de.l en_us.l es.l fr.l gr.l hun.l it.l nl.l pl.l pt.l ru.l tr.l
|
||||
|
||||
LANGCOMP = ./langcomp
|
||||
#LANGCOMP = ./langcomp -w
|
||||
|
||||
|
||||
all: $(LANGOBJS)
|
||||
|
||||
distclean: clean spotless
|
||||
|
||||
install: all
|
||||
test -d $(INSTDIR)/data/languages || mkdir $(INSTDIR)/data/languages
|
||||
@if [ "$(RUNGROUP)" ] ; then \
|
||||
echo chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
|
||||
chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
|
||||
echo chmod -R g+rw $(INSTDIR)/data/languages ; \
|
||||
chmod -R g+rw $(INSTDIR)/data/languages ; \
|
||||
$(CP) $(LANGOBJS) $(INSTDIR)/data/languages ; \
|
||||
echo chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
|
||||
chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages/* ; \
|
||||
echo chmod -R g+rw $(INSTDIR)/data/languages/* ; \
|
||||
chmod -R g+rw $(INSTDIR)/data/languages/* ; \
|
||||
fi
|
||||
@if [ ! "$(RUNGROUP)" ] ; then \
|
||||
chmod 700 $(INSTDIR)/data/languages/ ; \
|
||||
$(CP) $(LANGOBJS) $(INSTDIR)/data/languages ; \
|
||||
chmod 600 $(INSTDIR)/data/languages/* ; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
rm -f $(LANGOBJS) langcomp language.h
|
||||
|
||||
spotless: clean
|
||||
rm -f index
|
||||
|
||||
|
||||
cat: cat.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
de: de.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
en_us: en_us.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
es: es.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
fr: fr.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
gr: gr.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
hun: hun.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
it: it.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
nl: nl.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
pl: pl.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
pt: pt.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
ru: ru.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
tr: tr.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
|
||||
langcomp: langcomp.c
|
||||
@$(MAKEBIN) $(CC) $(CFLAGS) langcomp.c -o $@
|
||||
|
||||
|
||||
language.h: index Makefile
|
||||
@perl -e <index >$@ 'print STDERR "Generating language.h... "; $$i=0; while (<>) { chop; printf "#define %-32s %d\n", $$_, $$i++; } print "\n#define NUM_STRINGS $$i\n"; print STDERR "$$i strings\n";'
|
||||
@cp language.h ../include
|
||||
|
||||
index: en_us.l
|
||||
@grep '^[A-Z]' en_us.l >index
|
||||
-6913
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