mirror of
https://github.com/anope/anope.git
synced 2026-06-12 20:34:48 +02:00
Compare commits
823 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b51c6453ae | |||
| 8a44b9c0ea | |||
| 0dd5430c94 | |||
| 046fa5c848 | |||
| 551f3504c8 | |||
| c11638db98 | |||
| 9ca69a7b49 | |||
| 459c7947ce | |||
| fad0a4a0e8 | |||
| 1630ccedb1 | |||
| 36d69b1e5c | |||
| 627b89ec7b | |||
| 9373677610 | |||
| bbb65ddc33 | |||
| 508bbe11e6 | |||
| 095ed3c8c8 | |||
| f3743cd37d | |||
| 0c155e0c05 | |||
| f362959834 | |||
| f5a85c69d2 | |||
| c8b3819767 | |||
| e6a1982922 | |||
| 40a1dc9536 | |||
| 70bf013ef0 | |||
| 18dfa62626 | |||
| d815906393 | |||
| 452e62c050 | |||
| 4916e1dbfc | |||
| fa7ed12aad | |||
| 94c20f3084 | |||
| 597d4a1aee | |||
| 1e95d0f536 | |||
| ad0b4d1aa0 | |||
| 74e9a9d2fe | |||
| d2aee394ea | |||
| 3e696fae0f | |||
| ce362854a3 | |||
| a883b616a1 | |||
| b421ba258e | |||
| 3691887297 | |||
| 75e2501500 | |||
| 1c6db37681 | |||
| 5c2fc1cedd | |||
| d891f2bcbd | |||
| 5eb13f4420 | |||
| bd9d3b0f7d | |||
| cbb41241d4 | |||
| 9d18fdf0f6 | |||
| d04a312d0d | |||
| 099f0ce43a | |||
| 07bd1bbec9 | |||
| aa0a687a58 | |||
| b89cc47642 | |||
| d87fa4d781 | |||
| 9351debd73 | |||
| 40d558ef21 | |||
| e1224ac486 | |||
| ddd33e65b4 | |||
| e4f88d44cd | |||
| 063b4a9918 | |||
| d019da673d | |||
| 4d7adbf2b7 | |||
| 404bf77ef5 | |||
| 69393a5f14 | |||
| 97c63822fc | |||
| 698dd78ef8 | |||
| 59d516d5b0 | |||
| 2ecb667d1c | |||
| c21f6ac597 | |||
| 390d0482fc | |||
| 65bb0a374b | |||
| ea4877dc16 | |||
| 4024598bd8 | |||
| a154532e98 | |||
| 665b0fdef8 | |||
| 0802d9d3ff | |||
| 8d3b8c08b3 | |||
| f3e5ccf353 | |||
| b5213d5a81 | |||
| dc09408f1a | |||
| 49d86527ef | |||
| 65183c3c49 | |||
| c60477384c | |||
| 25c3fd51b7 | |||
| a40eaeb2a3 | |||
| e14a650cb9 | |||
| 6401e328bb | |||
| 8f0ee6f383 | |||
| 1adbce61cb | |||
| fe60c9a085 | |||
| 39bb5825ad | |||
| 602ff60e21 | |||
| 8d0399e356 | |||
| a4d0213bcb | |||
| ecbf53ba6c | |||
| 6d72fd67d8 | |||
| 0a11bc7693 | |||
| e86fa67e38 | |||
| 1fc2642034 | |||
| 1641f6415a | |||
| bb1f93f150 | |||
| 85fbc500d8 | |||
| 99bcc6d3b7 | |||
| 5fd2145821 | |||
| 4700d48b35 | |||
| 019b2aafef | |||
| 3744649320 | |||
| 30593321f4 | |||
| 3b35199a53 | |||
| 5ac5e1068e | |||
| 0ebc43f0dc | |||
| 5ff86ea2c5 | |||
| 1bdc9c0a64 | |||
| d0d46408bc | |||
| fdc33b0f6d | |||
| 6a43370e13 | |||
| 1fcd045aff | |||
| b4d068b01a | |||
| 23d548336a | |||
| 82371dc279 | |||
| fd6770373f | |||
| 645f969d70 | |||
| 3187233783 | |||
| 8b932dc459 | |||
| a357ba38fb | |||
| 9f8525e3b2 | |||
| ace82596d8 | |||
| 09e10d2a02 | |||
| 9ec3f6abd6 | |||
| e7b18609f6 | |||
| cdcf0e2f9a | |||
| 718f2e922a | |||
| 2b2b6f75a1 | |||
| 2276c62ff0 | |||
| fb0ee27df0 | |||
| b14befc77c | |||
| 64fd5a862a | |||
| 0ff170c671 | |||
| ea0d5c4d70 | |||
| b96dbfc9ba | |||
| e221c7642a | |||
| b8c28419da | |||
| 1c4f9042e7 | |||
| a3f483ad87 | |||
| 6e90a8ea55 | |||
| 6d7fe69cdf | |||
| 314ef60900 | |||
| 1e8ac58bb4 | |||
| badcf31499 | |||
| c98602bf19 | |||
| 50bec959e5 | |||
| 62bfa33464 | |||
| b4ab7dadb9 | |||
| df0cd3ef3e | |||
| 9e37a643f1 | |||
| b30bfb5d2b | |||
| cccdf0431b | |||
| 0005ebbbc3 | |||
| 161841925d | |||
| e099180d8f | |||
| 2091dc68bc | |||
| 9926ac5a05 | |||
| 14342f6375 | |||
| a0a9d433dc | |||
| c88fac1a20 | |||
| 64d26f7c61 | |||
| 34896cefe9 | |||
| c0c7046a6d | |||
| 937ea7dab4 | |||
| bfd2b0fa8e | |||
| 224caf32c7 | |||
| 5828cdba45 | |||
| 4526fbed96 | |||
| f9911dde52 | |||
| a5e5eb5eb0 | |||
| 82aecd6c7e | |||
| 3cef83c8c5 | |||
| 0781f8a82a | |||
| fb03d745c5 | |||
| 752f5e269e | |||
| bb3e124bdb | |||
| 07610ad2d9 | |||
| e500258ce4 | |||
| 801a748e25 | |||
| a111b40560 | |||
| 2ccd182d2e | |||
| ee08b3e880 | |||
| a4bfd52b7e | |||
| 34a539ba78 | |||
| 096c996900 | |||
| ab0a67c35c | |||
| d5f4b06972 | |||
| ff8aca1db4 | |||
| 8da52bf121 | |||
| 0c193f8149 | |||
| fa0f78b937 | |||
| 96839ae1b8 | |||
| 5420f48580 | |||
| 5967bf4176 | |||
| bf68d1c0e0 | |||
| b498f4f4d9 | |||
| 8330cd119a | |||
| 3c55fbe650 | |||
| 98320d130f | |||
| 37f21a2e1e | |||
| 9f82a960e4 | |||
| 3bba87b655 | |||
| 515dc96d6c | |||
| 69bc149f7f | |||
| 3c340f550a | |||
| 420f83bbbf | |||
| 84b0859e8d | |||
| ddce28c055 | |||
| 947eabed6c | |||
| 94ccd03790 | |||
| 84dbb5c9a3 | |||
| 4b2b47fc95 | |||
| 9e621cca11 | |||
| 1e82b4075e | |||
| f8c1b8f4f9 | |||
| eaa00c7c9e | |||
| 2d48d9ef0d | |||
| 3e986b215e | |||
| 8486962fef | |||
| e3abae44a7 | |||
| a8be208da1 | |||
| abbb602463 | |||
| 86805a6b3b | |||
| 5d9344b677 | |||
| 8d3755af5b | |||
| 115c9eb5a0 | |||
| ee18083bb7 | |||
| 3af8f35d3a | |||
| da2f2fd852 | |||
| d460b267e3 | |||
| 9bab54af79 | |||
| 0a82366a6b | |||
| f0bc9536e6 | |||
| 9d165f13e7 | |||
| 3582bc0f58 | |||
| 97589e5c62 | |||
| 098074ba8b | |||
| c680cb6c58 | |||
| a603f39b4b | |||
| 78b548628c | |||
| d0e24a50b8 | |||
| 69b94fe041 | |||
| 6ba0224f7b | |||
| b6f5b50086 | |||
| 3ae4a022eb | |||
| ea8a692191 | |||
| 026d6c461d | |||
| 3cbac4bcea | |||
| e42b4c21b7 | |||
| 2464913200 | |||
| ebea728957 | |||
| 233a5bf4cd | |||
| 7019b27e59 | |||
| 70227dc882 | |||
| 6178ea644a | |||
| df7f0730dd | |||
| 331168379f | |||
| 5220963be1 | |||
| 436dab3eb8 | |||
| c3055e1cfa | |||
| a27be92e4b | |||
| faf0ad5f35 | |||
| e9202916b2 | |||
| 2cb20ded78 | |||
| 687bcaa83f | |||
| 1fb8a624f9 | |||
| b4b51d4828 | |||
| c55d8450a4 | |||
| 7a20f26b84 | |||
| 240f8b9e50 | |||
| 656ca80dd0 | |||
| d40cbdb8cf | |||
| bc44195a3d | |||
| a7cbe2a139 | |||
| 8408bf95c7 | |||
| 309c342b86 | |||
| 4de59d61d8 | |||
| 0dc65cc162 | |||
| 2e6c90d502 | |||
| 127ea3e68a | |||
| ba11b5eab0 | |||
| df1c6176b3 | |||
| 8634594cd1 | |||
| 613452acba | |||
| 9411dac991 | |||
| aa32f7c926 | |||
| 517810b208 | |||
| b7f7a91dfb | |||
| b6e4c7302e | |||
| b7590e20c1 | |||
| 4952a9c852 | |||
| 59647baff9 | |||
| 1393518555 | |||
| 51827b94ad | |||
| 24cbb84009 | |||
| f3c94e5d23 | |||
| f2ab092742 | |||
| 8ee85efd70 | |||
| 0cab675825 | |||
| f1751dcb21 | |||
| 8b02613549 | |||
| c9625ccf3f | |||
| 435ce51196 | |||
| 57ac7cb4db | |||
| 8cb2b801e9 | |||
| 66b45534a8 | |||
| 499077826c | |||
| bc4d34ebd8 | |||
| 934a13c21f | |||
| de11a19e03 | |||
| b437468b84 | |||
| 0a99571c0f | |||
| f908514095 | |||
| 9a44b74186 | |||
| 883935c3e0 | |||
| 3da9b6df0d | |||
| 0ab0e4737c | |||
| cdf356ed33 | |||
| 7d268bb4ca | |||
| 184350ff4a | |||
| 4cdbf560e1 | |||
| cbccc79d37 | |||
| 9b188a6c04 | |||
| 2f74513246 | |||
| 94dbb19593 | |||
| 8232759a92 | |||
| b006966d25 | |||
| 6037f63ae5 | |||
| 5cdb65ca52 | |||
| f9e4ca4d06 | |||
| 66c9be8627 | |||
| 546f65c38e | |||
| 9fcb022d5e | |||
| 5a0c6b1f18 | |||
| ade8db023e | |||
| 2ae733bcd1 | |||
| 101c68f786 | |||
| ec0cd9e7f9 | |||
| ab0b851d28 | |||
| 4e3720b810 | |||
| 82993c8d1e | |||
| d352718a39 | |||
| d44632e57d | |||
| 80451011dd | |||
| b4e673b2f4 | |||
| 58a78e9aa5 | |||
| a3edb09eda | |||
| 27beb8f877 | |||
| 136680f917 | |||
| 378ae21ac7 | |||
| e35a86661d | |||
| 528b5938ec | |||
| 03bee17063 | |||
| fe18050c49 | |||
| aa0496f69b | |||
| 4ee22ab05e | |||
| 7d0184ca34 | |||
| e0b687f289 | |||
| ff65b68dfa | |||
| 94456a6063 | |||
| 347d82f59b | |||
| fe68f40634 | |||
| 08b1344056 | |||
| ff67a80a71 | |||
| 230e85798d | |||
| 9604690e9d | |||
| 01e0cf4868 | |||
| 693eeed762 | |||
| 6e5713d64a | |||
| 249ad3dfea | |||
| b94c3740b9 | |||
| 59ec42f0e6 | |||
| 8a65f116b6 | |||
| 601da1141e | |||
| 8c0edef714 | |||
| c3efd9426d | |||
| a386439f86 | |||
| 016a5b3903 | |||
| 60aeb2a71a | |||
| 54ea63df66 | |||
| 01fc3ea22e | |||
| 3388736fab | |||
| 0065a0f405 | |||
| 490f832dc0 | |||
| a44acb6de5 | |||
| 13e5ddf807 | |||
| e42c728ab8 | |||
| 4eec5c5435 | |||
| 2667d9e90c | |||
| f2b66278aa | |||
| 5b7d952626 | |||
| 24375d53e6 | |||
| 88ac47e217 | |||
| 8a1bffba9b | |||
| 01eef7a392 | |||
| 67b76fadca | |||
| 7861712437 | |||
| 4468fe77fa | |||
| e71a9e2894 | |||
| f80bdf06ba | |||
| 2d6033c73f | |||
| 756dc49813 | |||
| aa92559aa0 | |||
| eb12a89b8e | |||
| d4a34308e5 | |||
| aab3a8e5b6 | |||
| c72e12d0a6 | |||
| bce0d629fd | |||
| 7d0dacc86c | |||
| 729aa4ab4a | |||
| 18e9e12261 | |||
| 9d68b29c9e | |||
| a4792412ba | |||
| cb21c7c1fa | |||
| 4008e64f26 | |||
| 1cf5918574 | |||
| ff1c5adb8b | |||
| c36030c826 | |||
| 33a02b1223 | |||
| 68f4556609 | |||
| 23db58a303 | |||
| ee69dc3105 | |||
| e9243c3fde | |||
| 4cfee23303 | |||
| be3822523b | |||
| 111f81aa95 | |||
| f12e1ad222 | |||
| 72318a6bf0 | |||
| 2f77cb38e2 | |||
| 84ca4c0d27 | |||
| 1f9a197b18 | |||
| 1647968c50 | |||
| 5473311bd7 | |||
| f3ebb67469 | |||
| 0d149ce195 | |||
| d68ba1b570 | |||
| 1877833e73 | |||
| 63c3710785 | |||
| 0043d137e5 | |||
| 3e5d3c5bdc | |||
| 62deedfa75 | |||
| 44af4eac6b | |||
| 5fdc637327 | |||
| 7c93007aa6 | |||
| e8fee93a7e | |||
| 260539e987 | |||
| 4603cd467b | |||
| 00549bc9b2 | |||
| e0a6f7456b | |||
| 5a54b37aeb | |||
| 2e43665266 | |||
| 8b4cd65e2a | |||
| c08aaa86d1 | |||
| 87a8af0ad7 | |||
| 4691dfa3f0 | |||
| 507eefc820 | |||
| 72af764861 | |||
| 1b631e96bd | |||
| 3b4a4da52d | |||
| 2e59aac025 | |||
| 3de6da80c6 | |||
| 2829c83118 | |||
| f58012ea0e | |||
| f8605ec188 | |||
| 5a12beff15 | |||
| 6b1f8de885 | |||
| 33be5de66e | |||
| 4399eeaa58 | |||
| 38cfb0603a | |||
| 1a3844e74e | |||
| bfed2e1bf5 | |||
| e488f294a1 | |||
| fde3438ef2 | |||
| 1575dea5b9 | |||
| a1972ba9b6 | |||
| 5a72d8783e | |||
| e6770bc2fd | |||
| 413fed474e | |||
| 60083834f8 | |||
| 9ac4da0489 | |||
| cb3848b7db | |||
| 753119c4a1 | |||
| d996c3aa8f | |||
| ac6e8c617d | |||
| 3b09f4aa54 | |||
| ad86535024 | |||
| 628f4d2a7e | |||
| 13a556df89 | |||
| 4e9d183523 | |||
| 074dfb63a7 | |||
| beaf09de7b | |||
| c8d8978cd0 | |||
| 11edba04fe | |||
| 22ba54b00d | |||
| 6fd7ca39e2 | |||
| b8cd00b412 | |||
| b52e1b2b02 | |||
| 54719fbfc6 | |||
| 06add0e5fc | |||
| 63d682314b | |||
| a302f8f1be | |||
| 04e1a4f5c8 | |||
| 1538909ac0 | |||
| a15f165a1d | |||
| 77435dd0d9 | |||
| 7c1cfd2849 | |||
| 259b10b83a | |||
| 02355546ff | |||
| 6ad3430ac4 | |||
| 29e7674e56 | |||
| e2df7d4d01 | |||
| 9a984a8148 | |||
| fb9c8950ed | |||
| a849a81ac3 | |||
| f919bb0748 | |||
| 3b85a8071f | |||
| 9a8cac060d | |||
| 0353338436 | |||
| defb8348a7 | |||
| 1b86665d81 | |||
| 2f52fa723c | |||
| 6e0f0b8896 | |||
| 2c5b2c649e | |||
| a6bc4cab9d | |||
| ef37daf44a | |||
| 39d288f99f | |||
| 9ead3f15c3 | |||
| 272104af95 | |||
| 51e95d72e3 | |||
| 12486f6cee | |||
| 891375baca | |||
| 41a295202e | |||
| 722c5b7d61 | |||
| 52216b56a1 | |||
| 1d0a836a2e | |||
| 46b7064834 | |||
| bb8df01e25 | |||
| 16700b0e30 | |||
| 4e04a11995 | |||
| 76e5480be9 | |||
| 464e6b8010 | |||
| 3272c1bbc6 | |||
| 307ffea951 | |||
| bb94f286f5 | |||
| 86e3556438 | |||
| 12214bee72 | |||
| 08a35231ef | |||
| 9970b4e37b | |||
| a5a615d5c7 | |||
| ce97fdd1c6 | |||
| 1a8ae513b4 | |||
| d15ac93a8f | |||
| 4e0f94bcce | |||
| 1c1645096f | |||
| e0ac5509b4 | |||
| 190c37a68b | |||
| a67bef2dee | |||
| 893bbf9251 | |||
| 5441093211 | |||
| 579af3c442 | |||
| 25bdcfcbc4 | |||
| 26919f41d2 | |||
| 9c80f9e34e | |||
| b5b3c74477 | |||
| 73d4ac6de0 | |||
| 7640fad30c | |||
| 9f6d378755 | |||
| 642e68f53a | |||
| eb658f87a3 | |||
| 1e87849e5c | |||
| 5fa4acb195 | |||
| 79f215606d | |||
| 2fd4b45f81 | |||
| d3b4a4bd05 | |||
| d914febbec | |||
| 2962a0be8c | |||
| 6be4df3b39 | |||
| 4789751e50 | |||
| 57674f5869 | |||
| c6cb4ba159 | |||
| e341cac8d6 | |||
| 83dd96b9f2 | |||
| cabaa079df | |||
| 273e7f249c | |||
| 8c9ca23900 | |||
| 8e3da86283 | |||
| 97b65b2255 | |||
| b26f198489 | |||
| a99a00d7c5 | |||
| 283137841f | |||
| 3290ebd36a | |||
| c4e9c0bf85 | |||
| 84ad85ee85 | |||
| 9789c3bd8c | |||
| a75afb597b | |||
| f93d9e7698 | |||
| 7423fa9998 | |||
| 7cba665270 | |||
| 9502567453 | |||
| 14472c5a95 | |||
| d4f4bcf23c | |||
| 82fa7e1467 | |||
| aefbb4fbda | |||
| 9b77fdf5b6 | |||
| 7a6979c814 | |||
| c4ab550ec7 | |||
| 3ecf6b495b | |||
| 8475697e3b | |||
| 85687781d1 | |||
| ccfaca32a2 | |||
| 07373c8cf2 | |||
| 89594d4557 | |||
| b478a1cb53 | |||
| 1fb77e414d | |||
| 22fe5bb724 | |||
| 909b9b2679 | |||
| 49ea709027 | |||
| e47ad6ed3f | |||
| f3b14694c6 | |||
| e9424b529c | |||
| a60c796cf6 | |||
| fcf16ab20a | |||
| a25d0aa60e | |||
| c50d1dc2b5 | |||
| 274bb19d03 | |||
| 2c5b84bd1d | |||
| 5c50bcb9c7 | |||
| cef56abea4 | |||
| 30b9f12711 | |||
| 5337326cc9 | |||
| 6237245ab7 | |||
| ae1829e5a8 | |||
| 026661c9a2 | |||
| ec7223ace2 | |||
| 1f31621bbf | |||
| dfd41b9b94 | |||
| fdd4aade3b | |||
| 0a53f4c26e | |||
| 484160eb4e | |||
| 7ac1fe5847 | |||
| 72acef4e15 | |||
| a6a0f6c447 | |||
| 398d674cf4 | |||
| 1467de1c7e | |||
| c5023fdfa0 | |||
| 97782248af | |||
| d6ced86021 | |||
| 0d8d1675f7 | |||
| 4056af00e3 | |||
| 99b4305573 | |||
| 113301dbba | |||
| 349ae043b6 | |||
| 710e7dd3a2 | |||
| 1e9c6d7931 | |||
| 5772b924cc | |||
| fce5f4cc0f | |||
| fa7ad6b3df | |||
| fc2df00cfc | |||
| f92c5471c2 | |||
| 0439e3b21b | |||
| 5b23fae8bf | |||
| aac4b0f0a3 | |||
| f083795c79 | |||
| 5db79c1e24 | |||
| a4dddfd5f1 | |||
| 7ddc865cde | |||
| 688ecf1c1d | |||
| c0453cfec1 | |||
| a9ab0c72a6 | |||
| de918ef9cf | |||
| 0ee9874112 | |||
| 388858aee6 | |||
| f22703df59 | |||
| 4715b76dbe | |||
| 50bd385ccf | |||
| e738da9b11 | |||
| 4573e1925d | |||
| a40f8e0b9d | |||
| 9db49ec790 | |||
| e8cd2909a5 | |||
| e7a57aa754 | |||
| 1c30f69bd0 | |||
| 36c43683e5 | |||
| 0b63a4244d | |||
| 4a62259695 | |||
| 87e3d5a045 | |||
| 2b8384bb39 | |||
| 6d981960da | |||
| 6acbd326f3 | |||
| cb533b63ac | |||
| 6538641e87 | |||
| eb0e5c89b2 | |||
| 84c2f8d3fc | |||
| 8d99b3e2d7 | |||
| b3ec2a5463 | |||
| 4c67f4393f | |||
| 4e9a2df827 | |||
| 2d2d1972e9 | |||
| 2b21264fb0 | |||
| 3f61b52db3 | |||
| f5fa4ff0e9 | |||
| 251551c8c3 | |||
| e2d546ad46 | |||
| 949176c3e0 | |||
| 3371941be5 | |||
| 70d72b62df | |||
| 46209895e3 | |||
| b28180d680 | |||
| 0f1f0c5a22 | |||
| 6e16e71fda | |||
| 38d5b93e4a | |||
| 78398a4481 | |||
| 0f32d2e553 | |||
| 8e1c7e1e44 | |||
| a3241065c5 | |||
| dc371aad6d | |||
| adf820c08a | |||
| 377ba87d52 | |||
| aa619f1eeb | |||
| b7458c5da1 | |||
| 4a6f4bc92f | |||
| 1c30205af5 | |||
| 9d0a6ddc67 | |||
| 29db25dac7 | |||
| d210cd2695 | |||
| fc8e6ee338 | |||
| ebe3fd7e57 | |||
| 885462d98e | |||
| 6395107be6 | |||
| 24b881c427 | |||
| 28be881886 | |||
| 5bc560a743 | |||
| b235da2e9c | |||
| 3f3062a077 | |||
| 8a8fb7725b | |||
| f6e5e6a2b4 | |||
| dfdcd3021a | |||
| 5fa3d8f929 | |||
| 1a2da82106 | |||
| 9d92de1157 | |||
| 1664689eb7 | |||
| b96519d85c | |||
| ac98ed615b | |||
| f2bcf449cd | |||
| 09c587bed0 | |||
| a8724b5f03 | |||
| b7e85f5161 | |||
| 773ed39d5d | |||
| 15d51ff033 | |||
| 83bf5ba255 | |||
| 2881ba112b | |||
| 1ee81580c6 | |||
| 4f421db5a9 | |||
| 091c0eea28 | |||
| eaaabd8de0 | |||
| 40ce51a1a9 | |||
| 23ac008cc1 | |||
| 6486956401 | |||
| 33b42ce86e | |||
| a631028660 | |||
| 4e5fc9797c | |||
| 9befb13ea4 | |||
| 8eb6a4da71 | |||
| ec7dfb3675 | |||
| 106750db77 | |||
| 7d1047490e | |||
| c9f93eeaed | |||
| db6b2225b1 | |||
| c6c9d9591c | |||
| c1f6a79c72 | |||
| eb81f22a5b | |||
| a31a7f5a6c | |||
| 7531e90499 | |||
| dfcc025a19 | |||
| a5f7aac295 | |||
| d76d747196 | |||
| aee1e53cb3 | |||
| fd1ca96e2c | |||
| 6a7488edc1 | |||
| 4af8dfa549 | |||
| 4efc2c219b | |||
| 84ec0903ee | |||
| 754c82d047 | |||
| 17fa704278 | |||
| b9ccd4bb0b | |||
| 595bc09ec1 | |||
| 27cff11e31 | |||
| b7da27ad3a | |||
| e5075d2dc2 | |||
| e7e8447fa3 | |||
| 561b205c4a | |||
| 376053e0ac | |||
| cadc6f48e6 | |||
| b6665d5eb9 | |||
| 95955ae069 | |||
| df4313f5bb | |||
| 53cd3f47b5 | |||
| c21f6eb5a3 | |||
| e2aeab970b | |||
| ef4fd869ae | |||
| dfc8bd4aa2 | |||
| fd774bd52a | |||
| 16fac79b78 | |||
| 622a8ea7e9 | |||
| 0a518f4bbd | |||
| 3f6e694e50 | |||
| c2646d67bb | |||
| c68b81eac8 | |||
| 8b2c1548ab | |||
| 5dd5fa4644 | |||
| 9d6dd4af11 | |||
| f430522b41 | |||
| 907aa60380 | |||
| c7e26c5f67 | |||
| 8e0e1806a4 | |||
| 7f39fb14f2 | |||
| fb86705d3f | |||
| f4fa5b3733 |
@@ -7,11 +7,11 @@
|
||||
| |
|
||||
|_| IRC Services
|
||||
CURVER
|
||||
This program will help you to compile your Services, and ask you
|
||||
This program will help you to compile your services, and ask you
|
||||
questions regarding the compile-time settings of it during the
|
||||
process. For more options type SOURCE_DIR/Config --help
|
||||
|
||||
Anope is a set of Services for IRC networks that allows users to
|
||||
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.
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
name: Bug report
|
||||
description: Report a non-security bug in Anope.
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report! Please make sure to answer the questions properly and don't just enter the same text into every field as this will make it harder for us to fix your bug.
|
||||
|
||||
If you're looking for help with setting up your services please post on [our support forum](https://github.com/orgs/anope/discussions/categories/support) instead.
|
||||
|
||||
If you're reporting a crash or other security issue [please read our security policy](https://github.com/anope/anope/security/policy#reporting-a-vulnerability) for how to report security issues privately.
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce the issue
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the results you received
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the results you expected
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Anope version
|
||||
description: |-
|
||||
Either the output of `services --version` (2.0) or `anope --version` (2.1).
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a non-security issue with Anope.
|
||||
---
|
||||
|
||||
<!--
|
||||
Please fill in the template below. It will help us process your bug report a lot faster. If you have multiple bugs to report then please open one issue for each bug.
|
||||
-->
|
||||
|
||||
**Description**
|
||||
|
||||
|
||||
|
||||
**Steps to reproduce the issue:**
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
**Describe the results you received:**
|
||||
|
||||
|
||||
|
||||
**Describe the results you expected:**
|
||||
|
||||
|
||||
|
||||
**Additional information you deem important (e.g. issue happens only occasionally):**
|
||||
|
||||
|
||||
|
||||
**Output of `services --version`:**
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
description: Request that a new feature is added to Anope.
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this feature request!
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Why this would be useful?
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Request that a new feature is added to Anope.
|
||||
---
|
||||
|
||||
<!--
|
||||
Please fill in the template below. It will help us process your feature request a lot faster. If you have multiple features to request then please open one issue for each feature.
|
||||
-->
|
||||
|
||||
**Description**
|
||||
|
||||
|
||||
|
||||
**Why this would be useful**
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Support forum
|
||||
url: https://github.com/orgs/anope/discussions/categories/support
|
||||
about: Please ask support questions here.
|
||||
|
||||
@@ -24,3 +24,16 @@ I have tested this pull request on:
|
||||
|
||||
**Operating system name and version:** <!-- e.g. Linux 3.11 -->
|
||||
**Compiler name and version:** <!-- e.g. GCC 4.2.0 -->
|
||||
|
||||
## Checks
|
||||
|
||||
<!--
|
||||
Tick the boxes for the checks you have made.
|
||||
-->
|
||||
|
||||
I have ensured that:
|
||||
|
||||
- [ ] The code I am submitting is my own work and/or I have permission from the author to share it.
|
||||
- [ ] Generative AI (Copilot, ChatGPT, etc) was not used to create any part of this pull request.
|
||||
- [ ] I have documented any features added by this pull request.
|
||||
- [ ] This pull request does not introduce any incompatible API changes (stable branches only, delete if not applicable).
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
name: Alpine CI
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
jobs:
|
||||
build:
|
||||
if: "!contains(github.event.head_commit.message, '[skip alpine ci]')"
|
||||
container: alpine:edge
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CXX: ${{ matrix.compiler }}
|
||||
CXXFLAGS: -Werror
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
|
||||
apk update
|
||||
apk add \
|
||||
argon2-dev \
|
||||
clang \
|
||||
cmake \
|
||||
g++ \
|
||||
gettext \
|
||||
git \
|
||||
gnutls-dev \
|
||||
mariadb-dev \
|
||||
openldap-dev \
|
||||
openssl-dev \
|
||||
pcre2-dev \
|
||||
samurai \
|
||||
sqlite-dev \
|
||||
tre-dev
|
||||
|
||||
- name: Enable extras
|
||||
run: |
|
||||
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
||||
do
|
||||
ln -s $PWD/modules/extra/$MODULE.cpp $PWD/modules
|
||||
done
|
||||
|
||||
- name: Run CMake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=DEBUG -DINSTDIR:STRING=$(readlink -f ../run) ..
|
||||
|
||||
- name: Build Anope
|
||||
run: |
|
||||
ninja -C build install
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
compiler:
|
||||
- clang++
|
||||
- g++
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
CXX: ${{ matrix.compiler }}
|
||||
CXXFLAGS: -std=${{ matrix.standard }}
|
||||
CXXFLAGS: -Werror
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -20,11 +20,11 @@ jobs:
|
||||
g++ \
|
||||
gettext \
|
||||
git \
|
||||
libargon2-dev \
|
||||
libgnutls28-dev \
|
||||
libldap2-dev \
|
||||
libmysqlclient-dev \
|
||||
libpcre2-dev \
|
||||
libpcre3-dev \
|
||||
libsqlite3-dev \
|
||||
libssl-dev \
|
||||
libtre-dev \
|
||||
@@ -32,9 +32,9 @@ jobs:
|
||||
|
||||
- name: Enable extras
|
||||
run: |
|
||||
for MODULE in m_ldap.cpp m_ldap_authentication.cpp m_ldap_oper.cpp m_mysql.cpp m_regex_pcre.cpp m_regex_pcre2.cpp m_regex_posix.cpp m_regex_tre.cpp m_sql_authentication.cpp m_sql_log.cpp m_sql_oper.cpp m_sqlite.cpp m_ssl_gnutls.cpp m_ssl_openssl.cpp stats
|
||||
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
||||
do
|
||||
ln -s ${{ github.workspace }}/modules/extra/$MODULE ${{ github.workspace }}/modules
|
||||
ln -s ${{ github.workspace }}/modules/extra/$MODULE.cpp ${{ github.workspace }}/modules
|
||||
done
|
||||
|
||||
- name: Run CMake
|
||||
@@ -52,6 +52,3 @@ jobs:
|
||||
compiler:
|
||||
- clang++
|
||||
- g++
|
||||
standard:
|
||||
- c++98
|
||||
- c++17
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
name: Windows CI
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
jobs:
|
||||
build:
|
||||
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
|
||||
runs-on: windows-2025
|
||||
env:
|
||||
BUILD_TYPE: ${{ github.event_name == 'release' && 'Release' || 'Debug' }}
|
||||
CONAN_USER_HOME: ${{ github.workspace }}/win/build
|
||||
CONAN_USER_HOME_SHORT: None
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup NSIS
|
||||
run: |-
|
||||
choco install nsis
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Setup Conan
|
||||
uses: turtlebrowser/get-conan@v1.2
|
||||
with:
|
||||
version: 1.64.0
|
||||
|
||||
- name: Try to restore libraries from the cache
|
||||
uses: actions/cache/restore@v4
|
||||
id: library-cache
|
||||
with:
|
||||
key: conan-${{ hashFiles('src/win32/conanfile.txt') }}
|
||||
path: ${{ env.CONAN_USER_HOME }}/.conan
|
||||
|
||||
- name: Install libraries
|
||||
run: |
|
||||
conan install ${{ github.workspace }}\src\win32 --build=missing
|
||||
|
||||
- name: Save libraries to the cache
|
||||
if: ${{ steps.library-cache.outputs.cache-hit != 'true' }}
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
key: ${{ steps.library-cache.outputs.cache-primary-key }}
|
||||
path: ${{ env.CONAN_USER_HOME }}/.conan
|
||||
|
||||
- name: Run CMake
|
||||
run: |
|
||||
mkdir ${{ github.workspace }}\build
|
||||
cd ${{ github.workspace }}\build
|
||||
cmake -A x64 -D "CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}" -G "Visual Studio 17 2022" ..
|
||||
|
||||
- name: Build Anope
|
||||
working-directory: ${{ github.workspace }}\build
|
||||
run: |
|
||||
msbuild PACKAGE.vcxproj /M:5 /P:Configuration=${{ env.BUILD_TYPE }} /P:Platform=x64 /VERBOSITY:MINIMAL
|
||||
|
||||
- name: Upload installer
|
||||
if: "${{ github.event_name == 'release' }}"
|
||||
working-directory: ${{ github.workspace }}\build
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload ${{ github.event.release.tag_name }} $(Get-ChildItem anope-*.exe)
|
||||
+13
-14
@@ -1,19 +1,18 @@
|
||||
build/
|
||||
config.cache
|
||||
include/sysconf.h
|
||||
modules/m_ldap.cpp
|
||||
modules/m_ldap_authentication.cpp
|
||||
modules/m_ldap_oper.cpp
|
||||
modules/m_mysql.cpp
|
||||
modules/m_regex_pcre.cpp
|
||||
modules/m_regex_pcre2.cpp
|
||||
modules/m_regex_posix.cpp
|
||||
modules/m_regex_tre.cpp
|
||||
modules/m_sql_authentication.cpp
|
||||
modules/m_sql_log.cpp
|
||||
modules/m_sql_oper.cpp
|
||||
modules/m_sqlite.cpp
|
||||
modules/m_ssl_gnutls.cpp
|
||||
modules/m_ssl_openssl.cpp
|
||||
modules/enc_argon2.cpp
|
||||
modules/enc_posix.cpp
|
||||
modules/ldap.cpp
|
||||
modules/mysql.cpp
|
||||
modules/regex_pcre2.cpp
|
||||
modules/regex_posix.cpp
|
||||
modules/regex_tre.cpp
|
||||
modules/sqlite.cpp
|
||||
modules/ssl_gnutls.cpp
|
||||
modules/ssl_openssl.cpp
|
||||
modules/stats
|
||||
modules/xmlrpc.cpp
|
||||
run/
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
@@ -12,39 +12,49 @@ Charles Kingsley <chaz@anope.org>
|
||||
Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Cronus <cronus@nite-serv.com>
|
||||
Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Dragone2 <dragone2@risposteinformatiche.it> <davide.paolini8@gmail.com>
|
||||
Fabio Scotoni <cculex@gmail.com>
|
||||
Filippo Cortigiani <simos@simosnap.org> <devel@devel.crtnet.it>
|
||||
Filippo Cortigiani <simos@simosnap.org> <simos@H7-25.fritz.box>
|
||||
Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Harakiri <harakiri@overstack.fr>
|
||||
Hendrik Jäger <gitcommit@henk.geekmail.org> <github@henk.geekmail.org>
|
||||
Jan Milants <viper@anope.org>
|
||||
Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <anope@s15355730.onlinehome-server.info>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
|
||||
Jens Voss <dukepyrolator@anope.org> Jens Voß <jens@pyrobook.(none)>
|
||||
Jens Voss <dukepyrolator@anope.org> <jens@pyrobook.(none)>
|
||||
k4be <k4be@pirc.pl> <34816207+k4bek4be@users.noreply.github.com>
|
||||
Lee Holmes <lethality@anope.org>
|
||||
Lee Holmes <lethality@anope.org> <lee@lethality.me.uk>
|
||||
Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Matt Schatz <genius3000@g3k.solutions>
|
||||
Matt Ullman <matt@airraidsirens.com> <blindsight@gamesurge.net>
|
||||
Michael Hazell <michaelhazell@hotmail.com> <Techman-@users.noreply.github.com>
|
||||
Michael Stapelberg <michael@robustirc.net> <stapelberg@users.noreply.github.com>
|
||||
Michael Wobst <wobst.michael@web.de>
|
||||
Michael Wobst <wobst.michael@web.de> <michael@static.163.129.251.148.clients.your-server.de>
|
||||
Michael Wobst <wobst.michael@web.de> <michael@wobst.at>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
|
||||
Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
PeGaSuS <droider.pc@gmail.com>
|
||||
PeGaSuS <droider.pc@gmail.com> <25697531+TehPeGaSuS@users.noreply.github.com>
|
||||
Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robby <robby@chatbelgie.be> <robby@anope.org>
|
||||
Robby <robby@chatbelgie.be> <robby@chat.be>
|
||||
Robert Scheck <robert@fedoraproject.org> <robert-scheck@users.noreply.github.com>
|
||||
Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Sadie Powell <sadie@witchery.services> Peter Powell <petpow@saberuk.com>
|
||||
Sadie Powell <sadie@witchery.services> <petpow@saberuk.com>
|
||||
Sebastian Barfurth <github@afreshmelon.com>
|
||||
Sebastian V. <hal9000@denorastats.org>
|
||||
Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Val Lorentz <progval+git@progval.net> <progval+git@progval.net>
|
||||
|
||||
+117
-268
@@ -1,64 +1,10 @@
|
||||
# This usage of CMake requires at least version 2.4 (checks are made to determine what to use when certain versions lack functions)
|
||||
cmake_minimum_required(VERSION 2.4...3.20 FATAL_ERROR)
|
||||
# This usage of CMake requires at least version 3.20
|
||||
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
|
||||
|
||||
# Set the project as C++ primarily, but have C enabled for the checks required later
|
||||
project(Anope CXX)
|
||||
enable_language(C)
|
||||
|
||||
# Detect the version of CMake for the later conditional checks
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --version OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "cmake version 2\\.(.*)" "\\1" ONLY_VERSION "${VERSION}")
|
||||
string(REGEX MATCH "-patch .*$" HAS_PATCH "${ONLY_VERSION}")
|
||||
if(HAS_PATCH)
|
||||
string(REGEX REPLACE "(.*)-patch .*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
string(REGEX REPLACE ".*-patch (.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
|
||||
else(HAS_PATCH)
|
||||
string(REGEX MATCH "\\." HAS_DOT "${ONLY_VERSION}")
|
||||
if(HAS_DOT)
|
||||
string(REGEX REPLACE "(.*)\\..*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
string(REGEX REPLACE ".*\\.(.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
|
||||
else(HAS_DOT)
|
||||
string(REGEX REPLACE "(.*)-beta" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
if(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(PATCH_VERSION 1)
|
||||
else(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(PATCH_VERSION 0)
|
||||
endif(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(MINOR_VERSION 4)
|
||||
endif(HAS_DOT)
|
||||
endif(HAS_PATCH)
|
||||
|
||||
# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does
|
||||
if(MINOR_VERSION GREATER 5)
|
||||
set(CMAKE26_OR_BETTER TRUE)
|
||||
set(CMAKE248_OR_BETTER TRUE)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(MINOR_VERSION GREATER 5)
|
||||
set(CMAKE26_OR_BETTER FALSE)
|
||||
# Also detect if we are using CMake 2.4.8 or better, the FIND sub-command of list() is nonexistent in earlier versions
|
||||
if(PATCH_VERSION GREATER 7)
|
||||
set(CMAKE248_OR_BETTER TRUE)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(PATCH_VERSION GREATER 7)
|
||||
set(CMAKE248_OR_BETTER FALSE)
|
||||
# Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module and SORT sub-command of list() are nonexistent in earlier versions
|
||||
if(PATCH_VERSION GREATER 3)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(PATCH_VERSION GREATER 3)
|
||||
set(CMAKE244_OR_BETTER FALSE)
|
||||
# ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is nonexistent 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)
|
||||
|
||||
@@ -71,14 +17,13 @@ set(ENV{LC_ALL} C)
|
||||
set(DEFAULT_LIBRARY_DIRS)
|
||||
set(DEFAULT_INCLUDE_DIRS)
|
||||
|
||||
# Check that we aren't running on an ancient broken GCC
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_FULL_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "^(\\d+\\.\\d+)" "\\1" GCC_VERSION ${GCC_FULL_VERSION})
|
||||
if(GCC_VERSION LESS 4.2)
|
||||
message(FATAL_ERROR "Your compiler is too old to build Anope. Upgrade to GCC 4.2 or newer!")
|
||||
endif(GCC_VERSION LESS 4.2)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# We require C++17 to build
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Put modules in their own folder
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# 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 OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
||||
@@ -86,12 +31,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
||||
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)
|
||||
# Replace the colons in the list with semicolons
|
||||
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
|
||||
# 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
|
||||
@@ -99,13 +40,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
||||
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)
|
||||
list(APPEND DEFAULT_LIBRARY_DIRS ${LIBRARY})
|
||||
endif()
|
||||
endforeach()
|
||||
# Remove duplicate entries from the list
|
||||
if(DEFAULT_LIBRARY_DIRS)
|
||||
remove_list_duplicates(DEFAULT_LIBRARY_DIRS)
|
||||
endif(DEFAULT_LIBRARY_DIRS)
|
||||
list(REMOVE_DUPLICATES DEFAULT_LIBRARY_DIRS)
|
||||
endif()
|
||||
# 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
|
||||
@@ -122,11 +63,11 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
||||
# 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:")
|
||||
else()
|
||||
# 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.")
|
||||
else()
|
||||
# If we are within the block between the above two lines...
|
||||
if(IN_SEARCH)
|
||||
# Get everything but the first character of the line
|
||||
@@ -138,47 +79,16 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
||||
# 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)
|
||||
list(APPEND DEFAULT_INCLUDE_DIRS ${INCLUDE})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
# 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 OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
||||
|
||||
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
|
||||
if(MSVC)
|
||||
# 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 "/registry")
|
||||
# The SDK was never found, set the path to nothing
|
||||
set(WSDK_PATH "")
|
||||
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")
|
||||
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)
|
||||
list(REMOVE_DUPLICATES DEFAULT_INCLUDE_DIRS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# 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
|
||||
@@ -187,38 +97,26 @@ endif(MSVC)
|
||||
if(NOT MSVC)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||
else(CMAKE_BUILD_TYPE)
|
||||
else()
|
||||
set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||
endif(CMAKE_BUILD_TYPE)
|
||||
endif(NOT MSVC)
|
||||
|
||||
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
|
||||
if(MINGW)
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
enable_language(RC)
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
|
||||
endif(MINGW)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Include the checking functions used later in this CMakeLists.txt
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckTypeSize)
|
||||
include(CheckLibraryExists)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
include(CheckCXXCompilerFlag)
|
||||
else(CMAKE244_OR_BETTER)
|
||||
include(TestCXXAcceptsFlag)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
# If extra include directories were specified, tell cmake about them.
|
||||
if(EXTRA_INCLUDE)
|
||||
include_directories(${EXTRA_INCLUDE})
|
||||
endif(EXTRA_INCLUDE)
|
||||
endif()
|
||||
|
||||
# If extra library directories were specified, tell cmake about them.
|
||||
if(EXTRA_LIBS)
|
||||
link_directories(${EXTRA_LIBS})
|
||||
endif(EXTRA_LIBS)
|
||||
endif()
|
||||
|
||||
# setup conan
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake")
|
||||
@@ -228,25 +126,26 @@ endif()
|
||||
|
||||
# Find gettext
|
||||
find_package(Gettext)
|
||||
|
||||
option(USE_PCH "Use precompiled headers" OFF)
|
||||
find_package(Intl)
|
||||
if(GETTEXT_FOUND AND Intl_FOUND)
|
||||
set(HAVE_LOCALIZATION ON)
|
||||
include_directories(${Intl_INCLUDE_DIRS})
|
||||
else()
|
||||
message("Unable to find gettext and libintl; disabling localization")
|
||||
set(HAVE_LOCALIZATION OFF)
|
||||
endif()
|
||||
|
||||
# Use the following directories as includes
|
||||
# Note that it is important the binary include directory comes before the
|
||||
# source include directory so the precompiled headers work correctly.
|
||||
include_directories(${Anope_BINARY_DIR}/include ${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/language ${Anope_SOURCE_DIR}/modules/pseudoclients)
|
||||
include_directories(
|
||||
${Anope_BINARY_DIR}/include
|
||||
${Anope_SOURCE_DIR}/include
|
||||
${Anope_SOURCE_DIR}/vendor
|
||||
)
|
||||
|
||||
# Pass on REPRODUCIBLE_BUILD
|
||||
if(REPRODUCIBLE_BUILD)
|
||||
add_definitions(-DREPRODUCIBLE_BUILD)
|
||||
endif(REPRODUCIBLE_BUILD)
|
||||
|
||||
# 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
|
||||
# If using Windows, include the windows specific folder for anope_windows.h
|
||||
include_directories(${Anope_SOURCE_DIR}/src/win32)
|
||||
endif(WIN32)
|
||||
endif()
|
||||
|
||||
# If using Visual Studio, set the C++ flags accordingly
|
||||
if(MSVC)
|
||||
@@ -255,108 +154,56 @@ if(MSVC)
|
||||
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
# Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS)
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4267 /wd4275 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
# Otherwise, we're not using Visual Studio
|
||||
else(MSVC)
|
||||
else()
|
||||
# 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 (only on GNU compiler)
|
||||
if(UNIX)
|
||||
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic ${CMAKE_CXX_FLAGS}")
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore")
|
||||
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# If we aren't on a *nix system, we are using MinGW
|
||||
else(UNIX)
|
||||
# Also, if we are building under MinGW, add another define for MinGW
|
||||
if(MINGW)
|
||||
add_definitions(-DMINGW)
|
||||
endif(MINGW)
|
||||
endif(UNIX)
|
||||
endif(MSVC)
|
||||
set(CXXFLAGS "${CXXFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -Wpedantic -Wno-format-nonliteral -Wno-format-zero-length -Wno-unused-parameter ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
# If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags
|
||||
if(CMAKE_DL_LIBS)
|
||||
append_to_list(LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
endif(CMAKE_DL_LIBS)
|
||||
list(APPEND LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
|
||||
if(MINGW)
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
||||
endif(MINGW)
|
||||
# Find the linker flags required for using threads.
|
||||
find_package("Threads" REQUIRED)
|
||||
if(CMAKE_THREAD_LIBS_INIT)
|
||||
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
if(NOT PROGRAM_NAME)
|
||||
# Under Windows, we set the executable name for Anope to be anope
|
||||
if(WIN32)
|
||||
set(PROGRAM_NAME anope)
|
||||
# Under *nix, we set the executable name for Anope to be services
|
||||
else(WIN32)
|
||||
set(PROGRAM_NAME services)
|
||||
endif(WIN32)
|
||||
endif(NOT PROGRAM_NAME)
|
||||
set(PROGRAM_NAME anope)
|
||||
endif()
|
||||
|
||||
# If we are not using Visual Studio, we'll run the following checks
|
||||
if(NOT MSVC)
|
||||
# Check if the C++ compiler can accept the -pipe flag, and add it to the compile flags if it works
|
||||
if(CMAKE244_OR_BETTER)
|
||||
# If using CMake 2.4.4 or better, we can use check_cxx_compiler_flag
|
||||
check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG)
|
||||
else(CMAKE244_OR_BETTER)
|
||||
# If using CMake 2.4.3 or older, we will use check_cxx_accepts_flags instead
|
||||
check_cxx_accepts_flag(-pipe HAVE_PIPE_FLAG)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG)
|
||||
# If the flag was accepted, add it to the list of flags
|
||||
if(HAVE_PIPE_FLAG)
|
||||
set(CXXFLAGS "${CXXFLAGS} -pipe")
|
||||
endif(HAVE_PIPE_FLAG)
|
||||
|
||||
# The following are additional library checks, they are not required for Windows
|
||||
if(NOT WIN32)
|
||||
# Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
|
||||
if(HAVE_SOCKET_LIB)
|
||||
append_to_list(LINK_LIBS socket)
|
||||
endif(HAVE_SOCKET_LIB)
|
||||
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
|
||||
if(HAVE_NSL_LIB)
|
||||
append_to_list(LINK_LIBS nsl)
|
||||
endif(HAVE_NSL_LIB)
|
||||
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
if(NOT APPLE)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
endif(NOT APPLE)
|
||||
else(HAVE_PTHREAD)
|
||||
message(FATAL_ERROR "The pthread library is required to build Anope")
|
||||
endif(HAVE_PTHREAD)
|
||||
endif(NOT WIN32)
|
||||
endif(NOT MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If DEFUMASK wasn't passed to CMake, set a default depending on if RUNGROUP was passed in or not
|
||||
if(NOT DEFUMASK)
|
||||
if(RUNGROUP)
|
||||
set(DEFUMASK "007")
|
||||
else(RUNGROUP)
|
||||
else()
|
||||
set(DEFUMASK "077")
|
||||
endif(RUNGROUP)
|
||||
endif(NOT DEFUMASK)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set the DEBUG_BUILD for sysconf.h
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(DEBUG_BUILD TRUE)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
|
||||
|
||||
# Check for the existence of the following include files
|
||||
check_include_file(cstdint HAVE_CSTDINT)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(strings.h HAVE_STRINGS_H)
|
||||
endif()
|
||||
|
||||
# Check for the existence of the following functions
|
||||
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
||||
check_function_exists(stricmp HAVE_STRICMP)
|
||||
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
|
||||
check_function_exists(umask HAVE_UMASK)
|
||||
check_function_exists(epoll_wait HAVE_EPOLL)
|
||||
check_function_exists(poll HAVE_POLL)
|
||||
@@ -364,52 +211,52 @@ check_function_exists(kqueue HAVE_KQUEUE)
|
||||
|
||||
# Strip the leading and trailing spaces from the compile flags
|
||||
if(CXXFLAGS)
|
||||
strip_string(${CXXFLAGS} CXXFLAGS)
|
||||
endif(CXXFLAGS)
|
||||
string(STRIP ${CXXFLAGS} CXXFLAGS)
|
||||
endif()
|
||||
# Strip the leading and trailing spaces from the linker flags
|
||||
if(LDFLAGS)
|
||||
strip_string(${LDFLAGS} LDFLAGS)
|
||||
endif(LDFLAGS)
|
||||
string(STRIP ${LDFLAGS} LDFLAGS)
|
||||
endif()
|
||||
|
||||
# Search for the following programs
|
||||
find_program(GREP grep)
|
||||
find_program(SH sh)
|
||||
find_program(CHGRP chgrp)
|
||||
find_program(CHMOD chmod)
|
||||
if(NOT WIN32 AND RUNGROUP)
|
||||
find_program(CHGRP "chgrp" REQUIRED)
|
||||
find_program(CHMOD "chmod" REQUIRED)
|
||||
endif()
|
||||
|
||||
# If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the services directory under the user's home directory
|
||||
# If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the anope directory under the user's home directory
|
||||
if(INSTDIR)
|
||||
set(CMAKE_INSTALL_PREFIX "${INSTDIR}")
|
||||
elseif(NOT CMAKE_INSTALL_PREFIX)
|
||||
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/services")
|
||||
endif(INSTDIR)
|
||||
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/anope")
|
||||
endif()
|
||||
|
||||
# Set default paths for various directories if not already defined
|
||||
if(NOT BIN_DIR)
|
||||
set(BIN_DIR "bin")
|
||||
endif(NOT BIN_DIR)
|
||||
if(NOT DB_DIR)
|
||||
set(DB_DIR "data")
|
||||
endif(NOT DB_DIR)
|
||||
endif()
|
||||
if(NOT DATA_DIR)
|
||||
set(DATA_DIR "data")
|
||||
endif()
|
||||
if(NOT DOC_DIR)
|
||||
set(DOC_DIR "doc")
|
||||
endif(NOT DOC_DIR)
|
||||
endif()
|
||||
if(NOT CONF_DIR)
|
||||
set(CONF_DIR "conf")
|
||||
endif(NOT CONF_DIR)
|
||||
if(NOT LIB_DIR)
|
||||
set(LIB_DIR "lib")
|
||||
endif(NOT LIB_DIR)
|
||||
endif()
|
||||
if(NOT MODULE_DIR)
|
||||
set(MODULE_DIR "modules")
|
||||
endif()
|
||||
if(NOT LOCALE_DIR)
|
||||
set(LOCALE_DIR "locale")
|
||||
endif(NOT LOCALE_DIR)
|
||||
if(NOT LOGS_DIR)
|
||||
set(LOGS_DIR "logs")
|
||||
endif(NOT LOGS_DIR)
|
||||
endif()
|
||||
if(NOT LOG_DIR)
|
||||
set(LOG_DIR "logs")
|
||||
endif()
|
||||
|
||||
# Version number processing
|
||||
# Find all lines in src/version.sh that start with VERSION_
|
||||
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
|
||||
file(STRINGS ${Anope_SOURCE_DIR}/src/version.sh VERSIONS REGEX "^VERSION_")
|
||||
# Iterate through the strings found
|
||||
foreach(VERSION_STR ${VERSIONS})
|
||||
string(REGEX REPLACE "^VERSION_([A-Z]+)=\"?([^\"]*)\"?$" "\\1;\\2" VERSION_OUT ${VERSION_STR})
|
||||
@@ -418,8 +265,8 @@ foreach(VERSION_STR ${VERSIONS})
|
||||
if(${VERSION_LEN} GREATER 1)
|
||||
list(GET VERSION_OUT 1 VERSION_DATA)
|
||||
set(VERSION_${VERSION_TYPE} ${VERSION_DATA})
|
||||
endif(${VERSION_LEN} GREATER 1)
|
||||
endforeach(VERSION_STR ${VERSIONS})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Default build version to 0
|
||||
set(VERSION_BUILD 0)
|
||||
@@ -427,7 +274,7 @@ 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)
|
||||
file(STRINGS ${Anope_SOURCE_DIR}/src/version.sh VERSIONS REGEX "^#define VERSION_BUILD")
|
||||
foreach(VERSION_STR ${VERSIONS})
|
||||
# Get the length of the string
|
||||
string(LENGTH ${VERSION_STR} VERSION_LEN)
|
||||
@@ -437,8 +284,8 @@ if(EXISTS "${Anope_SOURCE_DIR}/include/version.h")
|
||||
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")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Set the version variables based on what was found above
|
||||
set(VERSION_COMMA "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_BUILD}")
|
||||
@@ -451,7 +298,7 @@ set(VERSION_FULL_NOBUILD "${VERSION_DOTTED_NOBUILD}${VERSION_EXTRA}")
|
||||
if(WIN32)
|
||||
# Generate the win32.rc file using the above variables
|
||||
configure_file(${Anope_SOURCE_DIR}/src/win32/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32/win32.rc)
|
||||
endif(WIN32)
|
||||
endif()
|
||||
|
||||
# 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\;CMakeFiles\;sysconf.h$\;build" TRUE)
|
||||
@@ -466,33 +313,36 @@ if(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
|
||||
# If using Visual Studio, add these files as well
|
||||
if(MSVC)
|
||||
add_to_cpack_ignored_files(".vcproj$\;.sln$\;.ncb$\;.suo$\;.dir$\;.ilk$\;.exp$\;.pdb$\;.lib$\;/debug$;/release$;/relwithdebinfo$;/minsizerel$" TRUE)
|
||||
endif(MSVC)
|
||||
endif(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Get the filename of the Anope binary, to use later
|
||||
set(SERVICES_BINARY "$<TARGET_FILE:${PROGRAM_NAME}>")
|
||||
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
|
||||
|
||||
# At install time, create the following additional directories
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
|
||||
get_filename_component(ABSOLUTE_DATA_DIR ${DATA_DIR} REALPATH BASE_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
get_filename_component(ABSOLUTE_LOG_DIR ${LOG_DIR} REALPATH BASE_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
|
||||
if(WIN32)
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
|
||||
endif(WIN32)
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/runtime\")")
|
||||
endif()
|
||||
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
|
||||
if(NOT WIN32 AND RUNGROUP)
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
|
||||
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")")
|
||||
endif(NOT WIN32 AND RUNGROUP)
|
||||
endif()
|
||||
# On Windows platforms, install extra files
|
||||
if(WIN32)
|
||||
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
|
||||
DESTINATION ${BIN_DIR}
|
||||
)
|
||||
endif(WIN32)
|
||||
endif()
|
||||
|
||||
install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
|
||||
get_filename_component(ABSOLUTE_MODULE_DIR ${MODULE_DIR} REALPATH BASE_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}${ABSOLUTE_MODULE_DIR}\")")
|
||||
|
||||
# Only process the CPack section if we have CPack
|
||||
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
@@ -531,13 +381,13 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${SERVICES_BINARY}")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "https://www.anope.org/")
|
||||
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
|
||||
endif(WIN32)
|
||||
endif()
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}-source")
|
||||
set(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
set(CPACK_SOURCE_IGNORE_FILES "$ENV{CPACK_IGNORED_FILES}")
|
||||
set(CPACK_MONOLITHIC_INSTALL TRUE)
|
||||
include(CPack)
|
||||
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
endif()
|
||||
|
||||
# Go into the following directories and run their CMakeLists.txt as well
|
||||
add_subdirectory(data)
|
||||
@@ -546,4 +396,3 @@ add_subdirectory(language)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(modules)
|
||||
add_subdirectory(include)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Configuration script for Services.
|
||||
# Configuration script for Anope.
|
||||
#
|
||||
# Anope (C) 2003-2024 Anope Team
|
||||
# Anope (C) 2003-2025 Anope Team
|
||||
# Contact us at team@anope.org
|
||||
#
|
||||
# This program is free but copyrighted software; see the file COPYING for
|
||||
@@ -13,10 +13,6 @@
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
echo2 () {
|
||||
$ECHO2 "$*$ECHO2SUF" # these are defined later
|
||||
}
|
||||
|
||||
exists () { # because some shells don't have test -e
|
||||
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
|
||||
return 0
|
||||
@@ -42,7 +38,6 @@ Run_Build_System () {
|
||||
WITH_PERM=""
|
||||
EXTRA_INCLUDE=""
|
||||
EXTRA_LIBS=""
|
||||
GEN_TYPE=""
|
||||
|
||||
if [ "$INSTDIR" != "" ] ; then
|
||||
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
|
||||
@@ -62,12 +57,6 @@ Run_Build_System () {
|
||||
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
fi
|
||||
|
||||
if [ "$USE_PCH" = "yes" ] ; then
|
||||
PCH="-DUSE_PCH:BOOLEAN=ON"
|
||||
else
|
||||
PCH="-DUSE_PCH:BOOLEAN=OFF"
|
||||
fi
|
||||
|
||||
if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
|
||||
EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
|
||||
fi
|
||||
@@ -76,65 +65,38 @@ Run_Build_System () {
|
||||
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
||||
fi
|
||||
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
GEN_TYPE="-G\"MSYS Makefiles\""
|
||||
;;
|
||||
esac
|
||||
BUILD_PATHS="-B ${SOURCE_DIR}/build ${SOURCE_DIR}"
|
||||
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
pwdsave=`pwd`
|
||||
test -d build || mkdir build
|
||||
cd "build"
|
||||
REAL_SOURCE_DIR=".."
|
||||
else
|
||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
||||
fi
|
||||
CMAKE="cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $BUILD_PATHS"
|
||||
echo $CMAKE
|
||||
$CMAKE
|
||||
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
||||
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
echo "Now cd build, then run make to build Anope."
|
||||
cd "$pwdsave"
|
||||
else
|
||||
if [ "$PWD" = "${SOURCE_DIR}/build" ]; then
|
||||
echo "Now run make to build Anope."
|
||||
else
|
||||
echo "Now cd build, then run make to build Anope."
|
||||
fi
|
||||
}
|
||||
|
||||
ECHO2SUF=''
|
||||
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
|
||||
ECHO2='echo -n'
|
||||
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
|
||||
ECHO2='echo' ; ECHO2SUF='\c'
|
||||
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
|
||||
ECHO2='printf "%s"'
|
||||
else
|
||||
# oh well...
|
||||
ECHO2='echo'
|
||||
fi
|
||||
export ECHO2 ECHO2SUF
|
||||
|
||||
###########################################################################
|
||||
# Init values
|
||||
###########################################################################
|
||||
|
||||
INSTDIR=$HOME/services
|
||||
INSTDIR=$HOME/anope
|
||||
RUNGROUP=
|
||||
UMASK=
|
||||
DEBUG="no"
|
||||
USE_PCH="no"
|
||||
EXTRA_INCLUDE_DIRS=
|
||||
EXTRA_LIB_DIRS=
|
||||
EXTRA_CONFIG_ARGS=
|
||||
CAN_QUICK="no"
|
||||
SOURCE_DIR=`dirname $0`
|
||||
SOURCE_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
###########################################################################
|
||||
# Check out the options
|
||||
@@ -151,7 +113,8 @@ while [ $# -ge 1 ] ; do
|
||||
exit 0
|
||||
elif [ $1 = "-devel" ] ; then
|
||||
DEBUG="yes"
|
||||
INSTDIR="$PWD/run"
|
||||
DEVEL="yes"
|
||||
INSTDIR="$SOURCE_DIR/run"
|
||||
elif [ $1 = "-nocache" ] ; then
|
||||
IGNORE_CACHE="1"
|
||||
elif [ $1 = "-nointro" ] ; then
|
||||
@@ -176,7 +139,7 @@ done
|
||||
cmake --version 2>&1 > /dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
clear
|
||||
echo "Anope requires CMake 2.4 or newer, which can be downloaded at https://cmake.org/ or through your system's package manager."
|
||||
echo "Anope requires CMake 3.20 or newer, which can be downloaded at https://cmake.org/ or through your system's package manager."
|
||||
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
|
||||
exit 0
|
||||
fi
|
||||
@@ -184,24 +147,15 @@ fi
|
||||
###########################################################################
|
||||
|
||||
if [ ! "$NO_INTRO" ] ; then
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
PAGER=less
|
||||
;;
|
||||
*)
|
||||
PAGER=more
|
||||
clear
|
||||
;;
|
||||
esac
|
||||
export MORE='-e'
|
||||
. $SOURCE_DIR/src/version.sh
|
||||
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | $PAGER
|
||||
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | more
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "Beginning Services configuration."
|
||||
echo "Beginning Anope configuration."
|
||||
echo ""
|
||||
|
||||
###########################################################################
|
||||
@@ -218,10 +172,37 @@ export ok INPUT
|
||||
|
||||
####
|
||||
|
||||
TEMP_YN="n"
|
||||
if [ "$DEVEL" = "yes" ] ; then
|
||||
TEMP_YN="y"
|
||||
fi
|
||||
echo "You are building the 2.1 development branch. This branch is not as well tested"
|
||||
echo "as the 2.0 stable branch and may have compatibility breaks without notice. Are"
|
||||
echo "you sure you want to use this version?"
|
||||
echo -n "[$TEMP_YN] "
|
||||
read YN
|
||||
if [ "$YN" ] ; then
|
||||
if [ "$YN" = "y" ] ; then
|
||||
DEVEL="yes"
|
||||
else
|
||||
DEVEL="no"
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
if [ "$DEVEL" != "yes" ] ; then
|
||||
echo "If you are building from Git you can run \`git checkout 2.0\` to get the latest"
|
||||
echo "stable code. Otherwise, you can download the latest 2.0 release tarball from"
|
||||
echo "https://github.com/anope/anope/releases/latest"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
####
|
||||
|
||||
ok=0
|
||||
echo "In what directory should Anope be installed?"
|
||||
while [ $ok -eq 0 ] ; do
|
||||
echo2 "[$INSTDIR] "
|
||||
echo -n "[$INSTDIR] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ ! "$INPUT" ] ; then
|
||||
INPUT=$INSTDIR
|
||||
@@ -231,7 +212,7 @@ while [ $ok -eq 0 ] ; do
|
||||
echo "$INPUT exists, but is not a directory!"
|
||||
else
|
||||
echo "$INPUT does not exist. Create it?"
|
||||
echo2 "[y] "
|
||||
echo -n "[y] "
|
||||
read YN
|
||||
if [ "$YN" != "n" ] ; then
|
||||
if mkdir -p $INPUT ; then
|
||||
@@ -240,7 +221,7 @@ while [ $ok -eq 0 ] ; do
|
||||
fi
|
||||
fi
|
||||
elif exists "$INPUT/include/services.h" ; then
|
||||
echo "You cannot use the Services source directory as a target directory."
|
||||
echo "You cannot use the Anope source directory as a target directory."
|
||||
else
|
||||
ok=1
|
||||
fi
|
||||
@@ -252,15 +233,15 @@ echo ""
|
||||
|
||||
OLD_RUNGROUP="$RUNGROUP"
|
||||
if [ "$RUNGROUP" ] ; then
|
||||
echo "Which group should all Services data files be owned by? (If Services"
|
||||
echo "Which group should all Anope data files be owned by? (If Anope"
|
||||
echo "should not force files to be owned by a particular group, type \"none\""
|
||||
echo "(without the quotes) and press Return.)"
|
||||
else
|
||||
echo "Which group should all Services data files be owned by? (If Services"
|
||||
echo "Which group should all Anope data files be owned by? (If Anope"
|
||||
echo "should not force files to be owned by a particular group, just press"
|
||||
echo "Return.)"
|
||||
fi
|
||||
echo2 "[$RUNGROUP] "
|
||||
echo -n "[$RUNGROUP] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "none" ] ; then
|
||||
@@ -285,7 +266,7 @@ ok=0
|
||||
echo "What should the default umask for data files be (in octal)?"
|
||||
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
|
||||
while [ $ok -eq 0 ] ; do
|
||||
echo2 "[$UMASK] "
|
||||
echo -n "[$UMASK] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ ! "$INPUT" ] ; then
|
||||
INPUT=$UMASK
|
||||
@@ -309,7 +290,7 @@ if [ "$DEBUG" = "yes" ] ; then
|
||||
TEMP_YN="y"
|
||||
fi
|
||||
echo "Would you like to build a debug version of Anope?"
|
||||
echo2 "[$TEMP_YN] "
|
||||
echo -n "[$TEMP_YN] "
|
||||
read YN
|
||||
if [ "$YN" ] ; then
|
||||
if [ "$YN" = "y" ] ; then
|
||||
@@ -322,31 +303,12 @@ echo ""
|
||||
|
||||
####
|
||||
|
||||
TEMP_YN="n"
|
||||
if [ "$USE_PCH" = "yes" ] ; then
|
||||
TEMP_YN="y"
|
||||
fi
|
||||
echo "Do you want to build using precompiled headers? This can speed up"
|
||||
echo "the build, but uses more disk space."
|
||||
echo2 "[$TEMP_YN] "
|
||||
read YN
|
||||
if [ "$YN" ] ; then
|
||||
if [ "$YN" = "y" ] ; then
|
||||
USE_PCH="yes"
|
||||
else
|
||||
USE_PCH="no"
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra include directories you wish to use?"
|
||||
echo "You may only need to do this if CMake is unable to locate"
|
||||
echo "missing dependencies without hints."
|
||||
echo "Separate directories with semicolons."
|
||||
echo "If you need no extra include directories, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_INCLUDE_DIRS] "
|
||||
echo -n "[$EXTRA_INCLUDE_DIRS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
@@ -364,7 +326,7 @@ echo "You may only need to do this if CMake is unable to locate"
|
||||
echo "missing dependencies without hints."
|
||||
echo "Separate directories with semicolons."
|
||||
echo "If you need no extra library directories, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_LIB_DIRS] "
|
||||
echo -n "[$EXTRA_LIB_DIRS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
@@ -379,7 +341,7 @@ echo ""
|
||||
|
||||
echo "Are there any extra arguments you wish to pass to CMake?"
|
||||
echo "If you need no extra arguments to CMake, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
||||
echo -n "[$EXTRA_CONFIG_ARGS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
@@ -396,14 +358,14 @@ echo ""
|
||||
# Store values
|
||||
################################################################################
|
||||
|
||||
echo2 "Saving configuration results in config.cache... "
|
||||
echo -n "Saving configuration results in config.cache... "
|
||||
|
||||
cat <<EOT >$SOURCE_DIR/config.cache
|
||||
INSTDIR="$INSTDIR"
|
||||
RUNGROUP="$RUNGROUP"
|
||||
UMASK=$UMASK
|
||||
DEBUG="$DEBUG"
|
||||
USE_PCH="$USE_PCH"
|
||||
DEVEL="$DEVEL"
|
||||
EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
|
||||
EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
|
||||
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## About
|
||||
|
||||
Anope is an open source set of IRC Services. It is highly modular, with a vast number of configurable parameters, and is the most used IRC services package. There are also many modules on the [modsite](https://modules.anope.org) to add additional features. It runs on Linux, BSD, and Windows, and supports many modern IRCds, including InspIRCd, UnrealIRCd, and ircd-hybrid. For more details, credits, command line options, and contact information see [docs/README](https://github.com/anope/anope/blob/2.0/docs/README).
|
||||
Anope is an open source set of IRC services. It is highly modular, with a vast number of configurable parameters, and is the most used IRC services package. There are also many modules on the [modsite](https://modules.anope.org) to add additional features. It runs on Linux, BSD, and Windows, and supports many modern IRCds, including InspIRCd, UnrealIRCd, and ircd-hybrid. For more details, credits, command line options, and contact information see [docs/README](https://github.com/anope/anope/blob/2.0/docs/README).
|
||||
|
||||
* [Website](https://anope.org)
|
||||
* [GitHub](https://github.com/anope)
|
||||
@@ -19,7 +19,7 @@ $ make
|
||||
$ make install
|
||||
```
|
||||
|
||||
Now change to the directory where you installed Anope to, e.g. `$ cd ~/services/`
|
||||
Now change to the directory where you installed Anope to, e.g. `$ cd ~/anope/`
|
||||
|
||||
### Windows
|
||||
Download the latest release off of the [releases page](https://github.com/anope/anope/releases) and run the installer.
|
||||
@@ -27,19 +27,19 @@ Download the latest release off of the [releases page](https://github.com/anope/
|
||||
|
||||
## Configuration
|
||||
|
||||
Copy conf/example.conf to conf/services.conf
|
||||
Copy conf/anope.example.conf to conf/anope.conf
|
||||
|
||||
```
|
||||
$ cp conf/example.conf conf/services.conf
|
||||
$ cp conf/anope.example.conf conf/anope.conf
|
||||
```
|
||||
|
||||
Edit services.conf, configuring the uplink, serverinfo, and protocol module configurations. Example link blocks for popular IRCds are included in the the example.conf documentation. The [Anope wiki](https://wiki.anope.org) is also a good source of information. Our support channel is located at #anope on [irc.teranova.net](ircs://irc.teranova.net/anope).
|
||||
Edit anope.conf, configuring the uplink, serverinfo, and protocol module configurations. Example link blocks for popular IRCds are included in the the example.conf documentation. The [Anope wiki](https://wiki.anope.org) is also a good source of information. Our support channel is located at #anope on [irc.teranova.net](ircs://irc.teranova.net/anope).
|
||||
|
||||
Note that the example configuration file includes other example configuration files. If you want to modify the other example configuration files, copy them (e.g. `modules.example.conf` to `modules.conf`) and modify the `include` directive in `services.conf` to include the new file.
|
||||
Note that the example configuration file includes other example configuration files. If you want to modify the other example configuration files, copy them (e.g. `modules.example.conf` to `modules.conf`) and modify the `include` directive in `anope.conf` to include the new file.
|
||||
|
||||
## Running
|
||||
|
||||
Run `$ ./bin/services` to start Anope. If asked to provide logs for support, use the `--support` flag, e.g.: `$ ./bin/services --support`
|
||||
Run `$ ./bin/anope` to start Anope. If asked to provide logs for support, use the `--support` flag, e.g.: `$ ./bin/anope --support`
|
||||
|
||||
## Installing extra modules
|
||||
|
||||
|
||||
+32
-481
@@ -1,421 +1,3 @@
|
||||
###############################################################################
|
||||
# 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 temporary 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}/cmake/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
|
||||
# Next we replace all newlines with semicolons
|
||||
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
||||
if(REGEX STREQUAL "")
|
||||
# For no regular expression, just set the result to all the lines
|
||||
set(RESULT ${ALL_STRINGS})
|
||||
else(REGEX STREQUAL "")
|
||||
# Clear the result list
|
||||
set(RESULT)
|
||||
# Iterate through all the lines of the file
|
||||
foreach(STRING ${ALL_STRINGS})
|
||||
# Check for a match against the given regular expression
|
||||
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
|
||||
# If we had a match, append the match to the list
|
||||
if(STRING_MATCH)
|
||||
append_to_list(RESULT ${STRING})
|
||||
endif(STRING_MATCH)
|
||||
endforeach(STRING)
|
||||
endif(REGEX STREQUAL "")
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
# Set the given STRINGS variable to the result
|
||||
set(${STRINGS} ${RESULT})
|
||||
endmacro(read_from_file)
|
||||
|
||||
###############################################################################
|
||||
# extract_include_filename(<line> <output variable> [<optional output variable of quote type>])
|
||||
#
|
||||
# This macro will take a #include line and extract the filename.
|
||||
###############################################################################
|
||||
macro(extract_include_filename INCLUDE FILENAME)
|
||||
# Strip the leading and trailing spaces from the include line
|
||||
strip_string(${INCLUDE} INCLUDE_STRIPPED)
|
||||
# Make sure to only do the following if there is a string
|
||||
if(INCLUDE_STRIPPED STREQUAL "")
|
||||
set(FILE "")
|
||||
else(INCLUDE_STRIPPED STREQUAL "")
|
||||
# Extract the filename including the quotes or angle brackets
|
||||
string(REGEX REPLACE "^.*([\"<].*[\">]).*$" "\\1" FILE "${INCLUDE_STRIPPED}")
|
||||
# If an optional 3rd argument is given, we'll store if the quote style was quoted or angle bracketed
|
||||
if(${ARGC} GREATER 2)
|
||||
string(SUBSTRING ${FILE} 0 1 QUOTE)
|
||||
if(QUOTE STREQUAL "<")
|
||||
set(${ARGV2} "angle brackets")
|
||||
else(QUOTE STREQUAL "<")
|
||||
set(${ARGV2} "quotes")
|
||||
endif(QUOTE STREQUAL "<")
|
||||
endif(${ARGC} GREATER 2)
|
||||
# Now remove the quotes or angle brackets
|
||||
string(REGEX REPLACE "^[\"<](.*)[\">]$" "\\1" FILE "${FILE}")
|
||||
endif(INCLUDE_STRIPPED STREQUAL "")
|
||||
# Set the filename to the the given variable
|
||||
set(${FILENAME} "${FILE}")
|
||||
endmacro(extract_include_filename)
|
||||
|
||||
###############################################################################
|
||||
# find_includes(<source filename> <output variable>)
|
||||
#
|
||||
# This macro will search through a file for #include lines, regardless of
|
||||
# whitespace, but only returns the lines that are valid for the current
|
||||
# platform CMake is running on.
|
||||
###############################################################################
|
||||
macro(find_includes SRC INCLUDES)
|
||||
# Read all lines from the file that start with #, regardless of whitespace before the #
|
||||
read_from_file(${SRC} "^[ \t]*#.*$" LINES)
|
||||
# Set that any #include lines found are valid, and create temporary variables for the last found #ifdef/#ifndef
|
||||
set(VALID_LINE TRUE)
|
||||
set(LAST_DEF)
|
||||
set(LAST_CHECK)
|
||||
# Create an empty include list
|
||||
set(INCLUDES_LIST)
|
||||
# Iterate through all the # lines
|
||||
foreach(LINE ${LINES})
|
||||
# Search for #ifdef, #ifndef, #else, #endif, and #include
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*ifdef[ \t]*.*$" FOUND_IFDEF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*ifndef[ \t]*.*$" FOUND_IFNDEF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*else.*$" FOUND_ELSE ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*endif.*$" FOUND_ENDIF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*include[ \t]*[\"<].*[\">][\ t]*.*$" FOUND_INCLUDE ${LINE})
|
||||
# If we found a #ifdef on the line, extract the data after the #ifdef and set if the lines after it are valid based on the variables in CMake
|
||||
if(FOUND_IFDEF)
|
||||
# Extract the define
|
||||
string(REGEX REPLACE "^[ \t]*#[ \t]*ifdef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
|
||||
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
|
||||
if(DEFINE STREQUAL "_WIN32")
|
||||
set(DEFINE WIN32)
|
||||
endif(DEFINE STREQUAL "_WIN32")
|
||||
# Set the last define to this one, and set the last check to true, so when #else is encountered, we can do an opposing check
|
||||
set(LAST_DEF ${DEFINE})
|
||||
set(LAST_CHECK TRUE)
|
||||
# If the define is true (it either exists or is a non-false result), the lines following will be checked, otherwise they will be skipped
|
||||
if(${DEFINE})
|
||||
set(VALID_LINE TRUE)
|
||||
else(${DEFINE})
|
||||
set(VALID_LINE FALSE)
|
||||
endif(${DEFINE})
|
||||
else(FOUND_IFDEF)
|
||||
# If we found a #ifndef on the line, the same thing as #ifdef is done, except with the checks in the opposite direction
|
||||
if(FOUND_IFNDEF)
|
||||
# Extract the define
|
||||
string(REGEX REPLACE "^[ \t]*#[ \t]*ifndef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
|
||||
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
|
||||
if(DEFINE STREQUAL "_WIN32")
|
||||
set(DEFINE WIN32)
|
||||
endif(DEFINE STREQUAL "_WIN32")
|
||||
# Set the last define to this one, and set the last check to false, so when #else is encountered, we can do an opposing check
|
||||
set(LAST_DEF ${DEFINE})
|
||||
set(LAST_CHECK FALSE)
|
||||
# If the define is not true (it either doesn't exists or is a false result), the lines following will be checked, otherwise they will be skipped
|
||||
if(${DEFINE})
|
||||
set(VALID_LINE FALSE)
|
||||
else(${DEFINE})
|
||||
set(VALUE_LINE TRUE)
|
||||
endif(${DEFINE})
|
||||
else(FOUND_IFNDEF)
|
||||
# If we found a #else on the line, we check the last define in the opposite direction
|
||||
if(FOUND_ELSE)
|
||||
# When LAST_CHECK is true, we were inside a #ifdef, now act as if we are entering a #ifndef section by doing an opposing check
|
||||
if(LAST_CHECK)
|
||||
if(${LAST_DEF})
|
||||
set(VALID_LINE FALSE)
|
||||
else(${LAST_DEF})
|
||||
set(VALID_LINE TRUE)
|
||||
endif(${LAST_DEF})
|
||||
# When LAST_CHECK is false, we were inside a #ifndef, now act as if we are entering a #ifdef section by doing an opposing check
|
||||
else(LAST_CHECK)
|
||||
if(${LAST_DEF})
|
||||
set(VALID_LINE TRUE)
|
||||
else(${LAST_DEF})
|
||||
set(VALID_LINE FALSE)
|
||||
endif(${LAST_DEF})
|
||||
endif(LAST_CHECK)
|
||||
else(FOUND_ELSE)
|
||||
# If we found a #endif on the line, we'll assume everything following the line is valid until we meet another one of the above lines
|
||||
if(FOUND_ENDIF)
|
||||
set(VALID_LINE TRUE)
|
||||
else(FOUND_ENDIF)
|
||||
# If we found a #include on the line, add the entire line to the list of includes unless the line isn't valid
|
||||
if(FOUND_INCLUDE)
|
||||
if(VALID_LINE)
|
||||
append_to_list(INCLUDES_LIST "${LINE}")
|
||||
endif(VALID_LINE)
|
||||
endif(FOUND_INCLUDE)
|
||||
endif(FOUND_ENDIF)
|
||||
endif(FOUND_ELSE)
|
||||
endif(FOUND_IFNDEF)
|
||||
endif(FOUND_IFDEF)
|
||||
endforeach(LINE)
|
||||
set(${INCLUDES} ${INCLUDES_LIST})
|
||||
endmacro(find_includes)
|
||||
|
||||
###############################################################################
|
||||
# calculate_depends(<source filename> [<optional output variable for includes>])
|
||||
#
|
||||
# This macro is used in most of the src (sub)directories to calculate the
|
||||
# header file dependencies for the given source file.
|
||||
###############################################################################
|
||||
macro(calculate_depends SRC)
|
||||
# Temporarily set that we didn't get a 3rd argument before we actually check if we did get one or not
|
||||
set(CHECK_ANGLE_INCLUDES FALSE)
|
||||
# Check for a third argument
|
||||
if(${ARGC} GREATER 1)
|
||||
set(CHECK_ANGLE_INCLUDES TRUE)
|
||||
endif(${ARGC} GREATER 1)
|
||||
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on
|
||||
find_includes(${SRC} INCLUDES)
|
||||
# Reset the list of headers to empty
|
||||
set(HEADERS)
|
||||
# Iterate through the strings containing #include (if any)
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
|
||||
if(QUOTE_TYPE STREQUAL "angle brackets")
|
||||
# The following checks will only be done if there was a request for angle includes to be checked
|
||||
if(CHECK_ANGLE_INCLUDES)
|
||||
# Find the path of the include file
|
||||
if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include ${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)
|
||||
# This used to be find_in_list, but it was changed to this loop to do a find on each default include directory, this fixes Mac OS X trying to get it's framework directories in here
|
||||
set(FOUND_IN_DEFAULTS -1)
|
||||
foreach(DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIRS})
|
||||
string(REGEX REPLACE "\\+" "\\\\+" DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIR})
|
||||
string(REGEX MATCH ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT ${FOUND_${FILENAME}_INCLUDE})
|
||||
if(FOUND_DEFAULT)
|
||||
set(FOUND_IN_DEFAULTS 0)
|
||||
endif(FOUND_DEFAULT)
|
||||
endforeach(DEFAULT_INCLUDE_DIR)
|
||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
if(FOUND_IN_INCLUDES EQUAL -1)
|
||||
append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}")
|
||||
endif(FOUND_IN_INCLUDES EQUAL -1)
|
||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
else(FOUND_${FILENAME}_INCLUDE)
|
||||
# XXX
|
||||
if(NOT ${FILENAME} STREQUAL "libintl.h")
|
||||
message(FATAL_ERROR "${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.")
|
||||
endif(NOT ${FILENAME} STREQUAL "libintl.h")
|
||||
endif(FOUND_${FILENAME}_INCLUDE)
|
||||
endif(CHECK_ANGLE_INCLUDES)
|
||||
endif(QUOTE_TYPE STREQUAL "angle brackets")
|
||||
endforeach(INCLUDE)
|
||||
endmacro(calculate_depends)
|
||||
|
||||
###############################################################################
|
||||
# calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
|
||||
#
|
||||
@@ -433,10 +15,10 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
set(LIBRARIES)
|
||||
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
|
||||
if(WIN32)
|
||||
read_from_file(${SRC} "/\\\\*[ \t]*RequiredWindowsLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
|
||||
else(WIN32)
|
||||
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
|
||||
endif(WIN32)
|
||||
file(STRINGS ${SRC} REQUIRED_LIBRARIES REGEX "/\\*[ \t]*RequiredWindowsLibraries:[ \t]*.*[ \t]*\\*/")
|
||||
else()
|
||||
file(STRINGS ${SRC} REQUIRED_LIBRARIES REGEX "/\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\*/")
|
||||
endif()
|
||||
# Iterate through those lines
|
||||
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
|
||||
# Strip off the /* RequiredLibraries: and */ from the line
|
||||
@@ -450,86 +32,55 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
if (${LIBRARY} MATCHES "^.+\\|.+$")
|
||||
string(REGEX REPLACE ".+\\|(.*)" "\\1" LIBRARY_ALT ${LIBRARY})
|
||||
string(REGEX REPLACE "(.+)\\|.*" "\\1" LIBRARY ${LIBRARY})
|
||||
endif(${LIBRARY} MATCHES "^.+\\|.+$")
|
||||
endif()
|
||||
# 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} ${LIBRARY_ALT} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
if(DEFAULT_LIBRARY_DIRS OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${DEFAULT_LIBRARY_DIRS} $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||
else()
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${EXTRA_INCLUDE} ${EXTRA_LIBS} NO_DEFAULT_PATH)
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
endif()
|
||||
# If the library was found, we will add it to the linker flags
|
||||
if(FOUND_${LIBRARY}_LIBRARY)
|
||||
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)
|
||||
list(APPEND EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}")
|
||||
else()
|
||||
# Get the path only of the library, to add it to library paths.
|
||||
get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH)
|
||||
append_to_list(LIBRARY_PATHS "${LIBRARY_PATH}")
|
||||
list(APPEND LIBRARY_PATHS "${LIBRARY_PATH}")
|
||||
# Extract the library short name, add it to the library path
|
||||
get_filename_component(LIBRARY_NAME ${FOUND_${LIBRARY}_LIBRARY} NAME_WE)
|
||||
string(REGEX REPLACE "^lib" "" LIBRARY_NAME ${LIBRARY_NAME})
|
||||
append_to_list(LIBRARIES ${LIBRARY_NAME})
|
||||
endif(MSVC)
|
||||
else(FOUND_${LIBRARY}_LIBRARY)
|
||||
list(APPEND LIBRARIES ${LIBRARY_NAME})
|
||||
endif()
|
||||
else()
|
||||
# In the case of the library not being found, we fatally error so CMake stops trying to generate
|
||||
message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
|
||||
endif(FOUND_${LIBRARY}_LIBRARY)
|
||||
endforeach(LIBRARY)
|
||||
endforeach(REQUIRED_LIBRARY)
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
# Remove duplicates from the library paths
|
||||
if(LIBRARY_PATHS)
|
||||
remove_list_duplicates(LIBRARY_PATHS)
|
||||
endif(LIBRARY_PATHS)
|
||||
list(REMOVE_DUPLICATES LIBRARY_PATHS)
|
||||
endif()
|
||||
# Remove diplicates from the libraries
|
||||
if(LIBRARIES)
|
||||
remove_list_duplicates(LIBRARIES)
|
||||
endif(LIBRARIES)
|
||||
list(REMOVE_DUPLICATES LIBRARIES)
|
||||
endif()
|
||||
# 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)
|
||||
if(NOT "${LIBRARY_PATH}" IN_LIST DEFAULT_LIBRARY_DIRS)
|
||||
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
|
||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
endforeach(LIBRARY_PATH)
|
||||
endif()
|
||||
endforeach()
|
||||
# Iterate through libraries and add them to the linker flags
|
||||
foreach(LIBRARY ${LIBRARIES})
|
||||
append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}")
|
||||
endforeach(LIBRARY)
|
||||
list(APPEND EXTRA_DEPENDENCIES "${LIBRARY}")
|
||||
endforeach()
|
||||
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
|
||||
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
|
||||
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
|
||||
# function 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)
|
||||
endmacro()
|
||||
|
||||
###############################################################################
|
||||
# add_to_cpack_ignored_files(<item> [TRUE])
|
||||
@@ -544,12 +95,12 @@ macro(add_to_cpack_ignored_files 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)
|
||||
endif()
|
||||
# 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})
|
||||
else()
|
||||
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
|
||||
endif(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
endmacro(add_to_cpack_ignored_files)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# 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_LIBS})
|
||||
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
if(GETTEXT_LIBRARY)
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||
endif(GETTEXT_LIBRARY)
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
else(NOT WIN32)
|
||||
find_path(GETTEXT_INCLUDE libintl.h)
|
||||
find_library(GETTEXT_LIBRARY gnuintl)
|
||||
find_program(GETTEXT_MSGFMT msgfmt)
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
|
||||
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})
|
||||
endif(GETTEXT_FOUND)
|
||||
@@ -1,5 +0,0 @@
|
||||
# This file is external to the read_from_file macro in Anope.cmake in order to
|
||||
# get around a possible memory leak in older versions of CMake.
|
||||
|
||||
file(READ "${FILE}" RESULT)
|
||||
message("${RESULT}")
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# Only install example.chk and example.conf from this directory
|
||||
# Only install cron.example.sh and anope.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 botserv.example.conf example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
||||
set(DATA cron.example.sh anope.example.conf botserv.example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
||||
install(FILES ${DATA}
|
||||
DESTINATION ${CONF_DIR}
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@ service
|
||||
/*
|
||||
* The hostname of the BotServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the BotServ client.
|
||||
@@ -59,6 +59,17 @@ service
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
|
||||
/*
|
||||
* The server alias that can be used to securely message this service. If
|
||||
* your IRC server does not have an alias for this service you can set this
|
||||
* to an empty string to tell users to use /msg instead.
|
||||
*
|
||||
* This setting is ignored when options:servicealias is disabled.
|
||||
*
|
||||
* Defaults to the nick of the service if not set.
|
||||
*/
|
||||
#alias = "BS"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -183,7 +194,7 @@ module
|
||||
/*
|
||||
* The maximum number of entries a single bad words list can have.
|
||||
*/
|
||||
badwordsmax = 32
|
||||
badwordsmax = 50
|
||||
|
||||
/*
|
||||
* If set, BotServ will use case sensitive checking for badwords.
|
||||
@@ -323,6 +334,7 @@ command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/
|
||||
privilege
|
||||
{
|
||||
name = "GREET"
|
||||
desc = _("Greet message displayed on join")
|
||||
rank = 40
|
||||
level = 5
|
||||
flag = "g"
|
||||
@@ -333,10 +345,10 @@ privilege
|
||||
/*
|
||||
* fantasy
|
||||
*
|
||||
* Allows 'fantasist' commands to be used in channels.
|
||||
* Allows fantasy commands (e.g. !kick) to be used in channels.
|
||||
*
|
||||
* Provides the commands:
|
||||
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
|
||||
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasy commands.
|
||||
*/
|
||||
module
|
||||
{
|
||||
@@ -398,6 +410,7 @@ fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv
|
||||
fantasy { name = "SYNC"; command = "chanserv/sync"; }
|
||||
fantasy { name = "TOPIC"; command = "chanserv/topic"; }
|
||||
fantasy { name = "UNBAN"; command = "chanserv/unban"; }
|
||||
fantasy { name = "UNMUTE"; command = "chanserv/unban"; mode = "QUIET"; }
|
||||
fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
|
||||
fantasy { name = "UP"; command = "chanserv/up"; }
|
||||
fantasy { name = "VOICE"; command = "chanserv/modes"; }
|
||||
|
||||
+82
-20
@@ -21,7 +21,7 @@ service
|
||||
/*
|
||||
* The hostname of the ChanServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the ChanServ client.
|
||||
@@ -49,6 +49,17 @@ service
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
|
||||
/*
|
||||
* The server alias that can be used to securely message this service. If
|
||||
* your IRC server does not have an alias for this service you can set this
|
||||
* to an empty string to tell users to use /msg instead.
|
||||
*
|
||||
* This setting is ignored when options:servicealias is disabled.
|
||||
*
|
||||
* Defaults to the nick of the service if not set.
|
||||
*/
|
||||
#alias = "CS"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -76,8 +87,6 @@ module
|
||||
* access level or superior
|
||||
* - cs_private: Hide the channel from ChanServ's LIST command
|
||||
* - restricted: Kick/ban users who are restricted from the channel
|
||||
* - cs_secure: Enable channel security, requiring the user to be identified with NickServ in
|
||||
* order to be considered for being on the access list of the channel
|
||||
* - secureops: Only allow operator status to be given if the user is on the access list
|
||||
* - securefounder: Only allow the real founder of the channel to drop the channel, change its
|
||||
* password, or change the founder or successor
|
||||
@@ -93,10 +102,10 @@ module
|
||||
* to be a registered nick, otherwise the channel will be dropped.
|
||||
* - none: No defaults
|
||||
*
|
||||
* This directive is optional, if left blank, the options will default to keeptopic, peace, cs_secure,
|
||||
* securefounder, and signkick. If you really want no defaults, use "none" by itself as the option.
|
||||
* This directive is optional, if left blank, the options will default to cs_keep_modes, keeptopic, peace,
|
||||
* persist, securefounder, and signkick. If you really want no defaults, use "none" by itself as the option.
|
||||
*/
|
||||
defaults = "keeptopic peace cs_secure securefounder signkick"
|
||||
defaults = "cs_keep_modes keeptopic peace persist securefounder signkick"
|
||||
|
||||
/*
|
||||
* The maximum number of channels which may be registered to a single nickname.
|
||||
@@ -115,15 +124,15 @@ module
|
||||
|
||||
/*
|
||||
* The maximum number of entries on a channel's access list.
|
||||
* If not set, the default is 1024. This can be set to 0 for unlimited.
|
||||
* If not set, the default is 1000. This can be set to 0 for unlimited.
|
||||
*/
|
||||
accessmax = 1024
|
||||
accessmax = 1000
|
||||
|
||||
/*
|
||||
* The length of time ChanServ stays in a channel after kicking a user from a channel they are not
|
||||
* permitted to be in. This only occurs when the user is the only one in the channel.
|
||||
*/
|
||||
inhabit = 15s
|
||||
inhabit = 1m
|
||||
|
||||
/*
|
||||
* Allow only IRC Operators to use ChanServ.
|
||||
@@ -154,10 +163,10 @@ module
|
||||
|
||||
/*
|
||||
* The message formatting to use for signed kick messages.
|
||||
* %n is the nick of the kicker
|
||||
* %m is the message specified
|
||||
* {nick} is the nick of the kicker
|
||||
* {message} is the message specified
|
||||
*/
|
||||
signkickformat = "%m (%n)"
|
||||
signkickformat = "{message} ({nick})"
|
||||
|
||||
/*
|
||||
* If set, prevents channel access entries from containing hostmasks.
|
||||
@@ -215,6 +224,7 @@ module
|
||||
privilege
|
||||
{
|
||||
name = "ACCESS_CHANGE"
|
||||
desc = _("Allowed to modify the access list")
|
||||
rank = 0
|
||||
level = 10
|
||||
flag = "f"
|
||||
@@ -231,6 +241,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "ACCESS_LIST"
|
||||
desc = _("Allowed to view the access list")
|
||||
rank = 10
|
||||
level = 3
|
||||
flag = "f"
|
||||
@@ -247,6 +258,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "AKICK"
|
||||
desc = _("Allowed to use the AKICK command")
|
||||
rank = 250
|
||||
level = 10
|
||||
flag = "K"
|
||||
@@ -263,6 +275,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "ASSIGN"
|
||||
desc = _("Allowed to assign/unassign a bot")
|
||||
rank = 270
|
||||
level = "founder"
|
||||
flag = "s"
|
||||
@@ -279,6 +292,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "AUTOHALFOP"
|
||||
desc = _("Automatic halfop upon join")
|
||||
rank = 100
|
||||
level = 4
|
||||
flag = "H"
|
||||
@@ -295,6 +309,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "AUTOOP"
|
||||
desc = _("Automatic channel operator status upon join")
|
||||
rank = 210
|
||||
level = 5
|
||||
flag = "O"
|
||||
@@ -311,6 +326,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "AUTOOWNER"
|
||||
desc = _("Automatic owner upon join")
|
||||
rank = 330
|
||||
level = 9999
|
||||
flag = "Q"
|
||||
@@ -327,6 +343,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "AUTOPROTECT"
|
||||
desc = _("Automatic protect upon join")
|
||||
rank = 240
|
||||
level = 10
|
||||
flag = "A"
|
||||
@@ -343,6 +360,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "AUTOVOICE"
|
||||
desc = _("Automatic voice on join")
|
||||
rank = 50
|
||||
level = 3
|
||||
flag = "V"
|
||||
@@ -359,6 +377,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "BADWORDS"
|
||||
desc = _("Allowed to modify channel badwords list")
|
||||
rank = 260
|
||||
level = 10
|
||||
flag = "K"
|
||||
@@ -375,6 +394,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "BAN"
|
||||
desc = _("Allowed to ban users")
|
||||
rank = 150
|
||||
level = 4
|
||||
flag = "b"
|
||||
@@ -382,7 +402,7 @@ privilege
|
||||
}
|
||||
|
||||
/*
|
||||
* FANTASIA privilege.
|
||||
* FANTASY privilege.
|
||||
*
|
||||
* Used by botserv/main and chanserv/xop.
|
||||
*
|
||||
@@ -390,7 +410,8 @@ privilege
|
||||
*/
|
||||
privilege
|
||||
{
|
||||
name = "FANTASIA"
|
||||
name = "FANTASY"
|
||||
desc = _("Allowed to use fantasy commands")
|
||||
rank = 30
|
||||
level = 3
|
||||
flag = "c"
|
||||
@@ -410,6 +431,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "FOUNDER"
|
||||
desc = _("Allowed to issue commands restricted to channel founders")
|
||||
rank = 360
|
||||
level = 10000
|
||||
flag = "F"
|
||||
@@ -427,6 +449,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "GETKEY"
|
||||
desc = _("Allowed to use GETKEY command")
|
||||
rank = 180
|
||||
level = 5
|
||||
flag = "G"
|
||||
@@ -444,6 +467,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "HALFOP"
|
||||
desc = _("Allowed to (de)halfop users")
|
||||
rank = 120
|
||||
level = 5
|
||||
flag = "h"
|
||||
@@ -461,6 +485,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "HALFOPME"
|
||||
desc = _("Allowed to (de)halfop themself")
|
||||
rank = 110
|
||||
level = 4
|
||||
flag = "h"
|
||||
@@ -478,6 +503,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "INFO"
|
||||
desc = _("Allowed to get full INFO output")
|
||||
rank = 80
|
||||
level = 9999
|
||||
flag = "I"
|
||||
@@ -495,6 +521,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "INVITE"
|
||||
desc = _("Allowed to use the INVITE command")
|
||||
rank = 190
|
||||
level = 5
|
||||
flag = "i"
|
||||
@@ -511,6 +538,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "KICK"
|
||||
desc = _("Allowed to use the KICK command")
|
||||
rank = 130
|
||||
level = 4
|
||||
flag = "k"
|
||||
@@ -528,6 +556,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "MEMO"
|
||||
desc = _("Allowed to read channel memos")
|
||||
rank = 280
|
||||
level = 10
|
||||
flag = "m"
|
||||
@@ -545,6 +574,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "MODE"
|
||||
desc = _("Allowed to use the MODE command")
|
||||
rank = 170
|
||||
level = 9999
|
||||
flag = "s"
|
||||
@@ -561,6 +591,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "NOKICK"
|
||||
desc = _("Prevents users being kicked by services")
|
||||
rank = 20
|
||||
level = 1
|
||||
flag = "N"
|
||||
@@ -578,6 +609,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "OP"
|
||||
desc = _("Allowed to (de)op users")
|
||||
rank = 230
|
||||
level = 5
|
||||
flag = "o"
|
||||
@@ -595,6 +627,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "OPME"
|
||||
desc = _("Allowed to (de)op themself")
|
||||
rank = 220
|
||||
level = 5
|
||||
flag = "o"
|
||||
@@ -612,6 +645,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "OWNER"
|
||||
desc = _("Allowed to (de)owner users")
|
||||
rank = 350
|
||||
level = "founder"
|
||||
flag = "q"
|
||||
@@ -629,6 +663,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "OWNERME"
|
||||
desc = _("Allowed to (de)owner themself")
|
||||
rank = 340
|
||||
level = 9999
|
||||
flag = "q"
|
||||
@@ -646,6 +681,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "PROTECT"
|
||||
desc = _("Allowed to (de)protect users")
|
||||
rank = 310
|
||||
level = 9999
|
||||
flag = "a"
|
||||
@@ -663,6 +699,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "PROTECTME"
|
||||
desc = _("Allowed to (de)protect themself")
|
||||
rank = 300
|
||||
level = 10
|
||||
flag = "a"
|
||||
@@ -680,6 +717,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "SAY"
|
||||
desc = _("Allowed to use SAY and ACT commands")
|
||||
rank = 90
|
||||
level = 5
|
||||
flag = "B"
|
||||
@@ -699,6 +737,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "SET"
|
||||
desc = _("Allowed to modify channel settings")
|
||||
rank = 320
|
||||
level = 9999
|
||||
flag = "s"
|
||||
@@ -716,6 +755,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "SIGNKICK"
|
||||
desc = _("No signed kick when SIGNKICK LEVEL is used")
|
||||
rank = 140
|
||||
level = 9999
|
||||
flag = "K"
|
||||
@@ -732,6 +772,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "TOPIC"
|
||||
desc = _("Allowed to change channel topics")
|
||||
rank = 160
|
||||
level = 5
|
||||
flag = "t"
|
||||
@@ -748,12 +789,30 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "UNBAN"
|
||||
desc = _("Allowed to unban users")
|
||||
rank = 200
|
||||
level = 4
|
||||
flag = "u"
|
||||
xop = "HOP"
|
||||
}
|
||||
|
||||
/*
|
||||
* UNBANME privilege.
|
||||
*
|
||||
* Used by chanserv/unban.
|
||||
*
|
||||
* Users with this permission can unban themself through ChanServ.
|
||||
*/
|
||||
privilege
|
||||
{
|
||||
name = "UNBANME"
|
||||
desc = _("Allowed to unban themself")
|
||||
rank = 200
|
||||
level = 4
|
||||
flag = "U"
|
||||
xop = "HOP"
|
||||
}
|
||||
|
||||
/*
|
||||
* VOICE privilege.
|
||||
*
|
||||
@@ -765,6 +824,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "VOICE"
|
||||
desc = _("Allowed to (de)voice users")
|
||||
rank = 70
|
||||
level = 4
|
||||
flag = "v"
|
||||
@@ -782,6 +842,7 @@ privilege
|
||||
privilege
|
||||
{
|
||||
name = "VOICEME"
|
||||
desc = _("Allowed to (de)voice themself")
|
||||
rank = 60
|
||||
level = 3
|
||||
flag = "v"
|
||||
@@ -862,7 +923,7 @@ module
|
||||
/*
|
||||
* The maximum number of entries on a channel's autokick list.
|
||||
*/
|
||||
autokickmax = 32
|
||||
autokickmax = 50
|
||||
|
||||
/*
|
||||
* The default reason for an autokick if none is given.
|
||||
@@ -1075,7 +1136,7 @@ module
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
max = 32
|
||||
max = 50
|
||||
}
|
||||
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
|
||||
|
||||
@@ -1121,7 +1182,7 @@ module
|
||||
simple = false
|
||||
|
||||
/* Sets the time to keep seen entries in the seen database. */
|
||||
purgetime = "30d"
|
||||
purgetime = 90d
|
||||
}
|
||||
command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; permission = "operserv/seen"; }
|
||||
|
||||
@@ -1195,8 +1256,8 @@ command { service = "ChanServ"; name = "SET NOEXPIRE"; command = "chanserv/saset
|
||||
* A field named misc_description may be given for use with help output.
|
||||
*/
|
||||
module { name = "cs_set_misc" }
|
||||
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; misc_description = _("Associate a URL with the channel"); }
|
||||
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an E-mail address with the channel"); }
|
||||
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; misc_description = _("Associate a URL with the channel"); misc_numeric = 328; }
|
||||
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an email address with the channel"); }
|
||||
|
||||
/*
|
||||
* cs_status
|
||||
@@ -1208,6 +1269,7 @@ command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc
|
||||
*/
|
||||
module { name = "cs_status" }
|
||||
command { service = "ChanServ"; name = "STATUS"; command = "chanserv/status"; }
|
||||
command { service = "ChanServ"; name = "WHY"; command = "chanserv/status"; hide = true; }
|
||||
|
||||
/*
|
||||
* cs_suspend
|
||||
@@ -1226,7 +1288,7 @@ module
|
||||
* This directive is optional.
|
||||
* If not set, the default is never.
|
||||
*/
|
||||
expire = 90d
|
||||
suspendexpire = 90d
|
||||
|
||||
/*
|
||||
* Settings to show to non-opers in ChanServ's INFO output.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
module
|
||||
{
|
||||
name = "m_chanstats"
|
||||
name = "chanstats"
|
||||
|
||||
/*
|
||||
* The name of this engine.
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
###############################################################
|
||||
|
||||
# Anope binary directory
|
||||
ANOPATH=/home/ircd/services/bin
|
||||
ANOPATH=/home/ircd/anope/bin
|
||||
|
||||
# Anope data directory
|
||||
ANODATA=/home/ircd/services/data
|
||||
ANODATA=/home/ircd/anope/data
|
||||
|
||||
# Name of the pid file
|
||||
ANOPIDF=services.pid
|
||||
ANOPIDF=anope.pid
|
||||
|
||||
# Name of the executable
|
||||
ANOPROG=services
|
||||
ANOPROG=anope
|
||||
|
||||
# Parameters to pass to the executable
|
||||
ANOARGS=""
|
||||
@@ -21,7 +21,7 @@ service
|
||||
/*
|
||||
* The hostname of the Global client.
|
||||
*/
|
||||
host = "services.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the Global client.
|
||||
@@ -49,6 +49,17 @@ service
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
|
||||
/*
|
||||
* The server alias that can be used to securely message this service. If
|
||||
* your IRC server does not have an alias for this service you can set this
|
||||
* to an empty string to tell users to use /msg instead.
|
||||
*
|
||||
* This setting is ignored when options:servicealias is disabled.
|
||||
*
|
||||
* Defaults to the nick of the service if not set.
|
||||
*/
|
||||
#alias = "GL"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -66,7 +77,7 @@ module
|
||||
client = "Global"
|
||||
|
||||
/*
|
||||
* This is the global message that will be sent when Services are being
|
||||
* This is the global message that will be sent when Anope is being
|
||||
* shutdown/restarted.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -74,7 +85,7 @@ module
|
||||
#globaloncycledown = "Services are restarting, they will be back shortly - please be good while they're gone"
|
||||
|
||||
/*
|
||||
* This is the global message that will be sent when Services (re)join the
|
||||
* This is the global message that will be sent when Anope (re)joins the
|
||||
* network.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -82,7 +93,7 @@ module
|
||||
#globaloncycleup = "Services are now back online - have a nice day"
|
||||
|
||||
/*
|
||||
* If set, Services will hide the IRC Operator's nick in a global
|
||||
* If set, Anope will hide the IRC Operator's nick in a global
|
||||
* message/notice.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -113,3 +124,29 @@ command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
||||
*/
|
||||
module { name = "gl_global" }
|
||||
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
|
||||
|
||||
/*
|
||||
* gl_queue
|
||||
*
|
||||
* Provides the command global/queue.
|
||||
*
|
||||
* Used for queuing messages to send to every online user.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "gl_queue"
|
||||
|
||||
/* The maximum number of messages in a message queue. Defaults to 10. */
|
||||
maxqueue = 10
|
||||
}
|
||||
command { service = "Global"; name = "QUEUE"; command = "global/queue"; permission = "global/queue"; }
|
||||
|
||||
/*
|
||||
* gl_server
|
||||
*
|
||||
* Provides the command global/server.
|
||||
*
|
||||
* Used for sending a message to every online user on a server.
|
||||
*/
|
||||
module { name = "gl_server" }
|
||||
command { service = "Global"; name = "SERVER"; command = "global/server"; permission = "global/server"; }
|
||||
|
||||
@@ -21,7 +21,7 @@ service
|
||||
/*
|
||||
* The hostname of the HostServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the HostServ client.
|
||||
@@ -49,6 +49,17 @@ service
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
|
||||
/*
|
||||
* The server alias that can be used to securely message this service. If
|
||||
* your IRC server does not have an alias for this service you can set this
|
||||
* to an empty string to tell users to use /msg instead.
|
||||
*
|
||||
* This setting is ignored when options:servicealias is disabled.
|
||||
*
|
||||
* Defaults to the nick of the service if not set.
|
||||
*/
|
||||
#alias = "HS"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -68,7 +79,12 @@ module
|
||||
/*
|
||||
* If enabled, vhosts are activated on users immediately when they are set.
|
||||
*/
|
||||
activate_on_set = false
|
||||
activate_on_set = yes
|
||||
|
||||
/*
|
||||
* If enabled, vhosts are activated on users immediately when they log out of an operator account.
|
||||
*/
|
||||
activate_on_deoper = yes
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -110,12 +126,12 @@ module
|
||||
/*
|
||||
* Upon nickserv/group, this option syncs the nick's main vHost to the grouped nick.
|
||||
*/
|
||||
syncongroup = false
|
||||
syncongroup = true
|
||||
|
||||
/*
|
||||
* This makes vhosts act as if they are per account.
|
||||
*/
|
||||
synconset = false
|
||||
synconset = true
|
||||
}
|
||||
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
|
||||
|
||||
@@ -161,13 +177,13 @@ module
|
||||
name = "hs_request"
|
||||
|
||||
/*
|
||||
* If set, Services will send a memo to the user requesting a vHost when it's been
|
||||
* If set, Anope will send a memo to the user requesting a vHost when it's been
|
||||
* approved or rejected.
|
||||
*/
|
||||
#memouser = yes
|
||||
|
||||
/*
|
||||
* If set, Services will send a memo to all Services staff when a new vHost is requested.
|
||||
* If set, Anope will send a memo to all services staff when a new vHost is requested.
|
||||
*/
|
||||
#memooper = yes
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ service
|
||||
/*
|
||||
* The hostname of the StatServ client.
|
||||
*/
|
||||
host = "stats.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the StatServ client.
|
||||
|
||||
@@ -21,7 +21,7 @@ service
|
||||
/*
|
||||
* The hostname of the MemoServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the MemoServ client.
|
||||
@@ -49,6 +49,17 @@ service
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
|
||||
/*
|
||||
* The server alias that can be used to securely message this service. If
|
||||
* your IRC server does not have an alias for this service you can set this
|
||||
* to an empty string to tell users to use /msg instead.
|
||||
*
|
||||
* This setting is ignored when options:servicealias is disabled.
|
||||
*
|
||||
* Defaults to the nick of the service if not set.
|
||||
*/
|
||||
#alias = "MS"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -83,7 +94,7 @@ module
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
senddelay = 3s
|
||||
senddelay = 30s
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -146,7 +157,7 @@ module
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
max = 32
|
||||
max = 50
|
||||
}
|
||||
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
|
||||
|
||||
|
||||
+228
-123
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* The following blocks are used to load all non-core modules, including 3rd-party modules.
|
||||
* Modules can be prevented from loading by commenting out the line, other modules can be added by
|
||||
* adding a module block. These modules will be loaded prior to Services connecting to your network.
|
||||
* adding a module block. These modules will be loaded prior to Anope connecting to your network.
|
||||
*
|
||||
* Note that some of these modules are labeled EXTRA, and must be enabled prior to compiling by
|
||||
* running the 'extras' script on Linux and UNIX.
|
||||
@@ -19,14 +19,14 @@
|
||||
module { name = "help" }
|
||||
|
||||
/*
|
||||
* m_dns
|
||||
* dns
|
||||
*
|
||||
* Adds support for the DNS protocol. By itself this module does nothing useful,
|
||||
* but other modules such as m_dnsbl and os_dns require this.
|
||||
* but other modules such as dnsbl and os_dns require this.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_dns"
|
||||
name = "dns"
|
||||
|
||||
/*
|
||||
* The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file.
|
||||
@@ -59,7 +59,7 @@ module { name = "help" }
|
||||
* SOA record information.
|
||||
*/
|
||||
|
||||
/* E-mail address of the DNS administrator. */
|
||||
/* Email address of the DNS administrator. */
|
||||
admin = "admin@example.com"
|
||||
|
||||
/* This should be the names of the public facing nameservers serving the records. */
|
||||
@@ -80,7 +80,7 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_dnsbl
|
||||
* dnsbl
|
||||
*
|
||||
* Allows configurable DNS blacklists to check connecting users against. If a user
|
||||
* is found on the blacklist they will be immediately banned. This is a crucial module
|
||||
@@ -88,17 +88,17 @@ module { name = "help" }
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_dnsbl"
|
||||
name = "dnsbl"
|
||||
|
||||
/*
|
||||
* If set, Services will check clients against the DNSBLs when services connect to its uplink.
|
||||
* If set, Anope will check clients against the DNSBLs when services connect to its uplink.
|
||||
* This is not recommended, and on large networks will open a very large amount of DNS queries.
|
||||
* Whilst services are not drastically affected by this, your nameserver/DNSBL might care.
|
||||
*/
|
||||
check_on_connect = no
|
||||
|
||||
/*
|
||||
* If set, Services will check clients when coming back from a netsplit. This can cause a large number
|
||||
* If set, Anope will check clients when coming back from a netsplit. This can cause a large number
|
||||
* of DNS queries open at once. Whilst services are not drastically affected by this, your nameserver/DNSBL
|
||||
* might care.
|
||||
*/
|
||||
@@ -119,15 +119,15 @@ module { name = "help" }
|
||||
time = 4h
|
||||
|
||||
/* Reason for akill.
|
||||
* %n is the nick of the user
|
||||
* %u is the ident/username of the user
|
||||
* %g is the realname of the user
|
||||
* %h is the hostname of the user
|
||||
* %i is the IP of the user
|
||||
* %r is the reply reason (configured below). Will be nothing if not configured.
|
||||
* %N is the network name set in networkinfo:networkname
|
||||
* {nick} is the nick of the user
|
||||
* {user} is the ident/username of the user
|
||||
* {real} is the realname of the user
|
||||
* {host} is the hostname of the user
|
||||
* {ip} is the IP of the user
|
||||
* {reply} is the reply reason (configured below). Will be nothing if not configured.
|
||||
* {network} is the network name set in networkinfo:networkname
|
||||
*/
|
||||
reason = "You are listed in the EFnet RBL, visit https://rbl.efnetrbl.org/?i=%i for info"
|
||||
reason = "You are listed in the EFnet RBL, visit https://rbl.efnetrbl.org/?i={ip} for info"
|
||||
|
||||
/* Replies to ban and their reason. If no replies are configured, all replies get banned. */
|
||||
reply
|
||||
@@ -171,7 +171,7 @@ module { name = "help" }
|
||||
{
|
||||
name = "dnsbl.dronebl.org"
|
||||
time = 4h
|
||||
reason = "You have a host listed in the DroneBL. For more information, visit https://dronebl.org/lookup_branded?ip=%i&network=%N"
|
||||
reason = "You have a host listed in the DroneBL. For more information, visit https://dronebl.org/lookup?ip={ip}&network={network}"
|
||||
}
|
||||
|
||||
/* Exempt localhost from DNSBL checks */
|
||||
@@ -179,19 +179,19 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_helpchan
|
||||
* helpchan
|
||||
*
|
||||
* Gives users who are op in the specified help channel usermode +h (helpop).
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_helpchan"
|
||||
name = "helpchan"
|
||||
|
||||
helpchannel = "#help"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_httpd
|
||||
* httpd
|
||||
*
|
||||
* Allows services to serve web pages. By itself, this module does nothing useful.
|
||||
*
|
||||
@@ -200,7 +200,7 @@ module { name = "help" }
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_httpd"
|
||||
name = "httpd"
|
||||
|
||||
httpd
|
||||
{
|
||||
@@ -233,13 +233,13 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ldap [EXTRA]
|
||||
* ldap [EXTRA]
|
||||
*
|
||||
* This module allows other modules to use LDAP. By itself, this module does nothing useful.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ldap"
|
||||
name = "ldap"
|
||||
|
||||
ldap
|
||||
{
|
||||
@@ -254,14 +254,14 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ldap_authentication [EXTRA]
|
||||
* ldap_authentication
|
||||
*
|
||||
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
|
||||
* LDAP to authenticate users. Requires m_ldap.
|
||||
* LDAP to authenticate users. Requires ldap.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ldap_authentication"
|
||||
name = "ldap_authentication"
|
||||
|
||||
/*
|
||||
* The distinguished name used for searching for users's accounts.
|
||||
@@ -270,10 +270,10 @@ module { name = "help" }
|
||||
|
||||
/*
|
||||
* The search filter used to look up users's accounts.
|
||||
* %account is replaced with the user's account.
|
||||
* %object_class is replaced with the object_class configured below.
|
||||
* {account} is replaced with the user's account.
|
||||
* {object_class} is replaced with the object_class configured below.
|
||||
*/
|
||||
search_filter = "(&(uid=%account)(objectClass=%object_class))"
|
||||
search_filter = "(&(uid={account})(objectClass={object_class}))"
|
||||
|
||||
/*
|
||||
* The object class used by LDAP to store user account information.
|
||||
@@ -314,20 +314,20 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ldap_oper [EXTRA]
|
||||
* ldap_oper
|
||||
*
|
||||
* This module dynamically ties users to Anope opertypes when they identify
|
||||
* via LDAP group membership. Requires m_ldap.
|
||||
* via LDAP group membership. Requires ldap.
|
||||
*
|
||||
* Note that this doesn't give the user privileges on the IRCd, only in Services.
|
||||
* Note that this doesn't give the user privileges on the IRCd, only in Anope.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ldap_oper"
|
||||
name = "ldap_oper"
|
||||
|
||||
/*
|
||||
* An optional binddn to use when searching for groups.
|
||||
* %a is replaced with the account name of the user.
|
||||
* {account} is replaced with the account name of the user.
|
||||
*/
|
||||
#binddn = "cn=Manager,dc=anope,dc=org"
|
||||
|
||||
@@ -343,9 +343,9 @@ module { name = "help" }
|
||||
|
||||
/*
|
||||
* The filter to use when searching for users.
|
||||
* %a is replaced with the account name of the user.
|
||||
* {account} is replaced with the account name of the user.
|
||||
*/
|
||||
filter = "(member=uid=%a,ou=users,dc=anope,dc=org)"
|
||||
filter = "(member=uid={account},ou=users,dc=anope,dc=org)"
|
||||
|
||||
/*
|
||||
* The attribute of the group that is the name of the opertype.
|
||||
@@ -355,13 +355,13 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_mysql [EXTRA]
|
||||
* mysql [EXTRA]
|
||||
*
|
||||
* This module allows other modules to use MySQL.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_mysql"
|
||||
name = "mysql"
|
||||
|
||||
mysql
|
||||
{
|
||||
@@ -372,17 +372,18 @@ module { name = "help" }
|
||||
username = "anope"
|
||||
password = "mypassword"
|
||||
port = 3306
|
||||
socket = ""
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_redis
|
||||
* redis
|
||||
*
|
||||
* This module allows other modules to use Redis.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_redis"
|
||||
name = "redis"
|
||||
|
||||
/* A redis database */
|
||||
redis
|
||||
@@ -401,47 +402,61 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_regex_pcre [EXTRA]
|
||||
*
|
||||
* Provides the regex engine regex/pcre, which uses version 1 of the Perl Compatible Regular
|
||||
* Expressions library. This can not be loaded at the same time as the m_regex_pcre2 module.
|
||||
*/
|
||||
#module { name = "m_regex_pcre" }
|
||||
|
||||
/*
|
||||
* m_regex_pcre2 [EXTRA]
|
||||
* regex_pcre2 [EXTRA]
|
||||
*
|
||||
* Provides the regex engine regex/pcre, which uses version 2 of the Perl Compatible Regular
|
||||
* Expressions library. This can not be loaded at the same time as the m_regex_pcre module.
|
||||
* Expressions library.
|
||||
*/
|
||||
#module { name = "m_regex_pcre2" }
|
||||
#module { name = "regex_pcre2" }
|
||||
|
||||
/*
|
||||
* m_regex_posix [EXTRA]
|
||||
* regex_posix [EXTRA]
|
||||
*
|
||||
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
|
||||
* This is likely the only regex module you will not need extra libraries for.
|
||||
*/
|
||||
#module { name = "m_regex_posix" }
|
||||
#module { name = "regex_posix" }
|
||||
|
||||
/*
|
||||
* m_regex_tre [EXTRA]
|
||||
* regex_stdlib
|
||||
*
|
||||
* Provides the regex engine regex/stdlib, which uses the regular expression library that is part of
|
||||
* the C++ standard library.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "regex_stdlib"
|
||||
|
||||
/*
|
||||
* The syntax scheme to use. Can be set to awk to use the regular expression grammar used by the
|
||||
* awk utility in POSIX, basic to use the basic POSIX regular expression grammar, ecmascript to
|
||||
* use the modified ECMAScript regular expression grammar, egrep to use the regular expression
|
||||
* grammar used by the grep utility with the -E option in POSIX, extended to use the extended
|
||||
* POSIX regular expression grammar, or grep to use the regular expression grammar used by the
|
||||
* grep utility in POSIX.
|
||||
*
|
||||
* See https://en.cppreference.com/w/cpp/regex/syntax_option_type for more information.
|
||||
*/
|
||||
syntax = "ecmascript"
|
||||
}
|
||||
|
||||
/*
|
||||
* regex_tre [EXTRA]
|
||||
*
|
||||
* Provides the regex engine regex/tre, which uses the TRE regex library.
|
||||
*/
|
||||
#module { name = "m_regex_tre" }
|
||||
#module { name = "regex_tre" }
|
||||
|
||||
/*
|
||||
* m_rewrite
|
||||
* rewrite
|
||||
*
|
||||
* Allows rewriting commands sent to/from clients.
|
||||
*/
|
||||
#module { name = "m_rewrite" }
|
||||
#module { name = "rewrite" }
|
||||
#command
|
||||
{
|
||||
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
|
||||
|
||||
/* Enable m_rewrite. */
|
||||
/* Enable rewrite. */
|
||||
rewrite = true
|
||||
|
||||
/* Source message to match. A $ can be used to match anything. */
|
||||
@@ -462,7 +477,7 @@ module { name = "help" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_proxyscan
|
||||
* proxyscan
|
||||
*
|
||||
* This module allows you to scan connecting clients for open proxies.
|
||||
* Note that using this will allow users to get the IP of your services.
|
||||
@@ -476,7 +491,7 @@ module { name = "help" }
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_proxyscan"
|
||||
name = "proxyscan"
|
||||
|
||||
/*
|
||||
* The target IP services tells the proxy to connect back to. This must be a publicly
|
||||
@@ -535,47 +550,38 @@ module { name = "help" }
|
||||
|
||||
/*
|
||||
* The reason to ban the user for.
|
||||
* %h is replaced with the type of proxy found.
|
||||
* %i is replaced with the IP of proxy found.
|
||||
* %p is replaced with the port.
|
||||
* {type} is replaced with the type of proxy found.
|
||||
* {ip} is replaced with the IP of proxy found.
|
||||
* {port} is replaced with the port.
|
||||
*/
|
||||
reason = "You have an open proxy running on your host (%t:%i:%p)"
|
||||
reason = "You have an open proxy running on your host ({type}:{ip}:{port})"
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sasl
|
||||
*
|
||||
* Some IRCds allow "SASL" authentication to let users identify to Services
|
||||
* during the IRCd user registration process. If this module is loaded, Services will allow
|
||||
* authenticating users through this mechanism. Supported mechanisms are:
|
||||
* PLAIN, EXTERNAL.
|
||||
*/
|
||||
module { name = "m_sasl" }
|
||||
|
||||
/*
|
||||
* m_ssl_gnutls [EXTRA]
|
||||
* ssl_gnutls [EXTRA]
|
||||
*
|
||||
* This module provides SSL services to Anope using GnuTLS, for example to
|
||||
* connect to the uplink server(s) via SSL.
|
||||
*
|
||||
* You may only load either m_ssl_gnutls or m_ssl_openssl, but not both.
|
||||
* You may only load either ssl_gnutls or ssl_openssl, but not both.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ssl_gnutls"
|
||||
name = "ssl_gnutls"
|
||||
|
||||
/*
|
||||
* An optional certificate and key for m_ssl_gnutls to give to the uplink.
|
||||
* An optional certificate and key for ssl_gnutls to give to the uplink. All
|
||||
* paths are relative to the config directory.
|
||||
*
|
||||
* You can generate your own certificate and key pair by using:
|
||||
*
|
||||
* certtool --generate-privkey --bits 2048 --outfile anope.key
|
||||
* certtool --generate-self-signed --load-privkey anope.key --outfile anope.crt
|
||||
* certtool --generate-privkey --bits 2048 --outfile privkey.pem
|
||||
* certtool --generate-self-signed --load-privkey privkey.pem --outfile fullchain.pem
|
||||
*
|
||||
*/
|
||||
cert = "data/anope.crt"
|
||||
key = "data/anope.key"
|
||||
cert = "fullchain.pem"
|
||||
key = "privkey.pem"
|
||||
|
||||
/*
|
||||
* Diffie-Hellman parameters to use when acting as a server. This is only
|
||||
@@ -588,53 +594,55 @@ module { name = "m_sasl" }
|
||||
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
|
||||
*
|
||||
*/
|
||||
# dhparams = "data/dhparams.pem"
|
||||
#dhparams = "dhparams.pem"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_ssl_openssl [EXTRA]
|
||||
* ssl_openssl [EXTRA]
|
||||
*
|
||||
* This module provides SSL services to Anope using OpenSSL, for example to
|
||||
* connect to the uplink server(s) via SSL.
|
||||
*
|
||||
* You may only load either m_ssl_openssl or m_ssl_gnutls, but not both.
|
||||
* You may only load either ssl_openssl or ssl_gnutls, but not both.
|
||||
*
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_ssl_openssl"
|
||||
name = "ssl_openssl"
|
||||
|
||||
/*
|
||||
* An optional certificate and key for m_ssl_openssl to give to the uplink.
|
||||
* An optional certificate and key for ssl_openssl to give to the uplink.
|
||||
* All paths are relative to the config directory.
|
||||
*
|
||||
* You can generate your own certificate and key pair by using:
|
||||
*
|
||||
* openssl genrsa -out anope.key 2048
|
||||
* openssl req -new -x509 -key anope.key -out anope.crt -days 1095
|
||||
* openssl genrsa -out privkey.pem 2048
|
||||
* openssl req -new -x509 -key privkey.pem -out fullchain.pem -days 1095
|
||||
*/
|
||||
cert = "data/anope.crt"
|
||||
key = "data/anope.key"
|
||||
cert = "fullchain.pem"
|
||||
key = "privkey.pem"
|
||||
|
||||
/*
|
||||
* As of 2014 SSL 3.0 is considered insecure, but it might be enabled
|
||||
* on some systems by default for compatibility reasons.
|
||||
* You can use the following option to enable or disable it explicitly.
|
||||
* Leaving this option not set defaults to the default system behavior.
|
||||
* If you wish to increase security you can disable support for older
|
||||
* versions of TLS with no known vulnerabilities but that provide less
|
||||
* security. For your security SSLv2 and SSLv3 are always disabled.
|
||||
*/
|
||||
#sslv3 = no
|
||||
#tlsv10 = no
|
||||
#tlsv11 = no
|
||||
#tlsv12 = yes
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sql_authentication [EXTRA]
|
||||
* sql_authentication
|
||||
*
|
||||
* This module allows authenticating users against an external SQL database using a custom
|
||||
* query.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_sql_authentication"
|
||||
name = "sql_authentication"
|
||||
|
||||
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||
/* SQL engine to use. Should be configured elsewhere with mysql, sqlite, etc. */
|
||||
engine = "mysql/main"
|
||||
|
||||
/* Query to execute to authenticate. A non empty result from this query is considered a success,
|
||||
@@ -662,6 +670,23 @@ module { name = "m_sasl" }
|
||||
*/
|
||||
query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
|
||||
|
||||
/*
|
||||
* If your database uses a password hashing algorithm that can not be compared using a simple
|
||||
* comparison function then you can specify it here to compare locally.
|
||||
*
|
||||
* You will need to have the appropriate encryption module (e.g. enc_bcrypt) loaded in order
|
||||
* for this to work.
|
||||
*/
|
||||
#password_hash = "bcrypt"
|
||||
|
||||
/*
|
||||
* If using the password_hash field (above) you will need to specify the name of the field to
|
||||
* fetch the password from.
|
||||
*
|
||||
* Defaults to "password" if not set.
|
||||
*/
|
||||
#password_field = "password"
|
||||
|
||||
/*
|
||||
* If set, the reason to give the users who try to "/msg NickServ REGISTER".
|
||||
* If not set, then registration is not blocked.
|
||||
@@ -676,7 +701,7 @@ module { name = "m_sasl" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sql_log [EXTRA]
|
||||
* sql_log
|
||||
*
|
||||
* This module adds an additional target option to log{} blocks
|
||||
* that allows logging Service's logs to SQL. To log to SQL, add
|
||||
@@ -693,24 +718,24 @@ module { name = "m_sasl" }
|
||||
* it if it doesn't exist. This module does not create any indexes (keys)
|
||||
* on the table and it is recommended you add them yourself as necessary.
|
||||
*/
|
||||
#module { name = "m_sql_log" }
|
||||
#module { name = "sql_log" }
|
||||
|
||||
/*
|
||||
* m_sql_oper [EXTRA]
|
||||
* sql_oper
|
||||
*
|
||||
* This module allows granting users services operator privileges and possibly IRC Operator
|
||||
* privileges based on an external SQL database using a custom query.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_sql_oper"
|
||||
name = "sql_oper"
|
||||
|
||||
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||
/* SQL engine to use. Should be configured elsewhere with mysql, sqlite, etc. */
|
||||
engine = "mysql/main"
|
||||
|
||||
/* Query to execute to determine if a user should have operator privileges.
|
||||
* A field named opertype must be returned in order to link the user to their oper type.
|
||||
* The oper types must be configured earlier in services.conf.
|
||||
* The oper types must be configured earlier in anope.conf.
|
||||
*
|
||||
* If a field named modes is returned from this query then those modes are set on the user.
|
||||
* Without this, only a simple +o is sent.
|
||||
@@ -722,13 +747,13 @@ module { name = "m_sasl" }
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sqlite [EXTRA]
|
||||
* sqlite [EXTRA]
|
||||
*
|
||||
* This module allows other modules to use SQLite.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_sqlite"
|
||||
name = "sqlite"
|
||||
|
||||
/* A SQLite database */
|
||||
sqlite
|
||||
@@ -737,7 +762,7 @@ module { name = "m_sasl" }
|
||||
name = "sqlite/main"
|
||||
|
||||
/* The database name, it will be created if it does not exist. */
|
||||
database = "anope.db"
|
||||
database = "anope.sqlite"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,40 +773,120 @@ module { name = "m_sasl" }
|
||||
* as they could over IRC. If you are using the default configuration you should be able to access
|
||||
* this panel by visiting http://127.0.0.1:8080 in your web browser from the machine Anope is running on.
|
||||
*
|
||||
* This module requires m_httpd.
|
||||
* This module requires httpd.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "webcpanel"
|
||||
|
||||
/* Web server to use. */
|
||||
server = "httpd/main";
|
||||
server = "httpd/main"
|
||||
|
||||
/* Template to use. */
|
||||
template = "default";
|
||||
/*
|
||||
* The directory containing the webcpanel templates. This is relative to the
|
||||
* data directory.
|
||||
*/
|
||||
template_dir = "webcpanel/templates/default"
|
||||
|
||||
/* Page title. */
|
||||
title = "Anope IRC Services";
|
||||
title = "Anope IRC Services"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_xmlrpc
|
||||
* jsonrpc
|
||||
*
|
||||
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
|
||||
* By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries.
|
||||
* By itself this module does nothing, but allows other modules (rpc_main) to receive and send JSON-RPC queries.
|
||||
*
|
||||
* IMPORTANT: this can not be loaded at the same time as the xmlrpc module.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
name = "m_xmlrpc"
|
||||
name = "jsonrpc"
|
||||
|
||||
/* Web service to use. Requires m_httpd. */
|
||||
/* Web service to use. Requires httpd. */
|
||||
server = "httpd/main"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_xmlrpc_main
|
||||
* [EXTRA] xmlrpc
|
||||
*
|
||||
* Adds the main XMLRPC core functions.
|
||||
* Requires m_xmlrpc.
|
||||
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
|
||||
* By itself this module does nothing, but allows other modules (rpc_main) to receive and send XMLRPC queries.
|
||||
*
|
||||
* IMPORTANT: this can not be loaded at the same time as the jsonrpc module.
|
||||
*/
|
||||
#module { name = "m_xmlrpc_main" }
|
||||
#module
|
||||
{
|
||||
name = "xmlrpc"
|
||||
|
||||
/* Web service to use. Requires httpd. */
|
||||
server = "httpd/main"
|
||||
|
||||
/*
|
||||
* Whether to enable the use of XML-RPC extensions.
|
||||
*
|
||||
* By default Anope will use some extended XML-RPC types. If your XML-RPC
|
||||
* client can not handle these you will need to disable them.
|
||||
*
|
||||
* If i8 is disabled a string will be used for values outside of the range
|
||||
* supported by the 32-bit int data type.
|
||||
*
|
||||
* If nil is disabled an empty struct will be used instead.
|
||||
*/
|
||||
#enable_i8 = no
|
||||
#enable_nil = no
|
||||
}
|
||||
|
||||
/*
|
||||
* rpc_data
|
||||
*
|
||||
* Adds support for the following RPC methods:
|
||||
*
|
||||
* anope.listAccounts anope.account
|
||||
* anope.listChannels anope.channel
|
||||
* anope.listOpers anope.oper
|
||||
* anope.listServers anope.server
|
||||
* anope.listUsers anope.user
|
||||
*
|
||||
* Requires either the jsonrpc or xmlrpc module.
|
||||
*
|
||||
* See docs/RPC/rpc_data.md for API documentation.
|
||||
*/
|
||||
#module { name = "rpc_data" }
|
||||
|
||||
/*
|
||||
* rpc_main
|
||||
*
|
||||
* Adds the main RPC core functions.
|
||||
* Requires xmlrpc.
|
||||
*/
|
||||
#module { name = "rpc_main" }
|
||||
|
||||
/*
|
||||
* rpc_message
|
||||
*
|
||||
* Adds support for the following RPC methods:
|
||||
*
|
||||
* anope.messageNetwork anope.messageServer
|
||||
* anope.messageUser
|
||||
*
|
||||
* Requires either the jsonrpc or xmlrpc module.
|
||||
*
|
||||
* See docs/RPC/rpc_message.md for API documentation.
|
||||
*/
|
||||
#module { name = "rpc_message" }
|
||||
|
||||
/*
|
||||
* rpc_system
|
||||
*
|
||||
* Adds support for the following RPC methods:
|
||||
*
|
||||
* system.listMethods
|
||||
*
|
||||
* Requires either the jsonrpc or xmlrpc module.
|
||||
*
|
||||
* See https://gggeek.github.io/phpxmlrpc/doc-1.1/ch08.html for API
|
||||
* documentation.
|
||||
*/
|
||||
#module { name = "rpc_system" }
|
||||
|
||||
+180
-125
@@ -21,7 +21,7 @@ service
|
||||
/*
|
||||
* The hostname of the NickServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the NickServ client.
|
||||
@@ -49,6 +49,17 @@ service
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
|
||||
/*
|
||||
* The server alias that can be used to securely message this service. If
|
||||
* your IRC server does not have an alias for this service you can set this
|
||||
* to an empty string to tell users to use /msg instead.
|
||||
*
|
||||
* This setting is ignored when options:servicealias is disabled.
|
||||
*
|
||||
* Defaults to the nick of the service if not set.
|
||||
*/
|
||||
#alias = "NS"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -66,20 +77,23 @@ module
|
||||
client = "NickServ"
|
||||
|
||||
/*
|
||||
* Force users to give an e-mail address when they register a nick.
|
||||
* Requires users to give an email address when they register a nick.
|
||||
*
|
||||
* This directive defaults to "yes" and is recommended to be enabled. This is required if e-mail registration is enabled.
|
||||
* This directive defaults to "yes" and is recommended to be enabled.
|
||||
*/
|
||||
forceemail = yes
|
||||
|
||||
/*
|
||||
* Require users who change their email address to confirm they
|
||||
* own their new email.
|
||||
*
|
||||
* If {ns_register}:registration is set to mail then this defaults
|
||||
* to yes. Otherwise, it defaults to no.
|
||||
*/
|
||||
confirmemailchanges = no
|
||||
#confirmemailchanges = yes
|
||||
|
||||
/*
|
||||
* A message sent to users on connect if they use an unregistered nick. %n will be replaced with the user's nickname.
|
||||
* A message sent to users on connect if they use an unregistered nick. {nick} will be replaced with the user's nickname.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
@@ -91,15 +105,8 @@ module
|
||||
* by spaces.
|
||||
*
|
||||
* The options are:
|
||||
* - killprotect: Kill nick if not identified within 60 seconds
|
||||
* - kill_quick: Kill nick if not identified within 20 seconds, this one overrides the killprotect
|
||||
* option and the killprotect option must be specified with this one
|
||||
* - kill_immed: Kill nick immediately if not identified, this one overrides both the killprotect
|
||||
* and kill_quick options and the killprotect option must be specified with this one
|
||||
* - ns_secure: Enable nickname security, requiring the nick's password before any operations
|
||||
* can be done on it
|
||||
* - ns_private: Hide the nick from NickServ's LIST command
|
||||
* - hide_email: Hide the nick's e-mail address from NickServ's INFO command
|
||||
* - hide_email: Hide the nick's email address from NickServ's INFO command
|
||||
* - hide_mask: Hide the nick's last or current user@host from NickServ's INFO command
|
||||
* - hide_status: Hide the nick's services operator access status from NickServ's INFO command
|
||||
* - hide_quit: Hide the nick's last quit message from NickServ's INFO command
|
||||
@@ -107,38 +114,39 @@ module
|
||||
* - memo_receive: Notify user if they have a new memo as soon as it's received
|
||||
* - memo_mail: Notify user if they have a new memo by mail
|
||||
* - autoop: User will be automatically opped in channels they enter and have access to
|
||||
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires
|
||||
* options:useprivmsg to be enabled as well
|
||||
* - neverop: User can not be added to access lists
|
||||
* - msg: Messages will be sent as PRIVMSGs instead of NOTICEs
|
||||
* - ns_keep_modes: Enables keepmodes, which retains user modes across sessions
|
||||
* - protect: Protects the registered nickname from use by unidentified users.
|
||||
*
|
||||
* This directive is optional, if left blank, the options will default to ns_secure, memo_signon, and
|
||||
* This directive is optional, if left blank, the options will default to memo_signon, and
|
||||
* memo_receive. If you really want no defaults, use "none" by itself as the option.
|
||||
*/
|
||||
defaults = "killprotect ns_secure ns_private hide_email hide_mask memo_signon memo_receive autoop"
|
||||
defaults = "autoop hide_email hide_mask memo_receive memo_signon ns_private protect"
|
||||
|
||||
/*
|
||||
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
|
||||
* directive is optional, but recommended. If not set, this restriction will be disabled.
|
||||
*/
|
||||
regdelay = 30s
|
||||
regdelay = 5m
|
||||
|
||||
/*
|
||||
* The length of time before a nick's registration expires.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set, the default is 21 days.
|
||||
* This directive is optional, but recommended. If not set, the default is one year.
|
||||
*/
|
||||
expire = 21d
|
||||
expire = 1y
|
||||
|
||||
/*
|
||||
* Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND,
|
||||
* GETPASS and SET PASSWORD commands by services operators on other services operators.
|
||||
* Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND
|
||||
* and SET PASSWORD commands by services operators on other services operators.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
secureadmins = yes
|
||||
|
||||
/*
|
||||
* If set, Services will set the channel modes a user has access to upon identifying, assuming
|
||||
* If set, Anope will set the channel modes a user has access to upon identifying, assuming
|
||||
* they are not already set.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -146,28 +154,42 @@ module
|
||||
modeonid = yes
|
||||
|
||||
/*
|
||||
* If set, Services will set these user modes on any user who identifies.
|
||||
* If set, Anope will set these user modes on any user who identifies.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#modesonid = "+R"
|
||||
|
||||
/*
|
||||
* If set, Services will not show netsplits in the last quit message field
|
||||
* If set, Anope will not show netsplits in the last quit message field
|
||||
* of NickServ's INFO command.
|
||||
*/
|
||||
hidenetsplitquit = no
|
||||
|
||||
/*
|
||||
* If set, is the length of time NickServ's killquick and kill options wait before
|
||||
* forcing users off of protected nicknames.
|
||||
* The default period to force users to stop using a protected nickname after.
|
||||
*
|
||||
* Defaults to 1 minute.
|
||||
*/
|
||||
killquick = 20s
|
||||
kill = 60s
|
||||
defaultprotect = 1m
|
||||
|
||||
/*
|
||||
* The minimum period that a user can have a user forced off their protected nickname after.
|
||||
*
|
||||
* Defaults to 10 seconds.
|
||||
*/
|
||||
minprotect = 10s
|
||||
|
||||
/*
|
||||
* The maximum period that a user can have a user forced off their protected nickname after.
|
||||
*
|
||||
* Defaults to 10 minutes.
|
||||
*/
|
||||
maxprotect = 10m
|
||||
|
||||
/*
|
||||
* If set, forbids the registration of nicks that contain an existing
|
||||
* nick with Services access. For example, if Tester is a Services Oper,
|
||||
* nick with services access. For example, if Tester is a Services Oper,
|
||||
* you can't register NewTester or Tester123 unless you are an IRC
|
||||
* Operator.
|
||||
*
|
||||
@@ -180,39 +202,56 @@ module
|
||||
#restrictopernicks = yes
|
||||
|
||||
/*
|
||||
* The username, and possibly hostname, used for fake users created when Services needs to
|
||||
* The username, and possibly hostname, used for fake users created when Anope needs to
|
||||
* hold a nickname.
|
||||
*/
|
||||
enforceruser = "enforcer"
|
||||
enforcerhost = "services.host"
|
||||
enforcerhost = "${services.host}"
|
||||
|
||||
/*
|
||||
* The length of time Services hold nicknames.
|
||||
* The length of time Anope should hold nicknames for.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set it defaults to 1 minute.
|
||||
*/
|
||||
releasetimeout = 1m
|
||||
|
||||
/*
|
||||
* When a user's nick is forcibly changed to enforce a "nick kill", their new nick will start
|
||||
* with this value. The rest will be made up of 6 or 7 digits.
|
||||
* Make sure this is a valid nick and Nicklen+7 is not longer than the allowed Nicklen on your ircd.
|
||||
* When a user's nick is forcibly changed to enforce nickname protection their new
|
||||
* nick will be based on this value. Any # in the value will be replaced with a random
|
||||
* number. If your IRCd has support for unique identifiers you can also set this to an
|
||||
* empty string to change a user's nick to their unique identifier.
|
||||
*
|
||||
* This directive is optional. If not set it defaults to "Guest"
|
||||
* Make sure this is a valid nick and that it is is not longer than the maximum nick
|
||||
* length on your IRCd.
|
||||
*
|
||||
* This directive is optional. If not set it defaults to "Guest####"
|
||||
*/
|
||||
guestnickprefix = "Guest"
|
||||
guestnick = "Guest####"
|
||||
|
||||
/*
|
||||
* If set, Services do not allow ownership of nick names, only ownership of accounts.
|
||||
* If set, Anope does not allow ownership of nick names, only ownership of accounts.
|
||||
*/
|
||||
nonicknameownership = no
|
||||
|
||||
/*
|
||||
* The minimum length of passwords
|
||||
*
|
||||
* This directive is optional. If not set it defaults to 10.
|
||||
*/
|
||||
minpasslen = 10
|
||||
|
||||
/*
|
||||
* The maximum length of passwords
|
||||
*
|
||||
* This directive is optional. If not set it defaults to 32.
|
||||
* This directive is optional. If not set it defaults to 50.
|
||||
*/
|
||||
passlen = 32
|
||||
maxpasslen = 50
|
||||
|
||||
/*
|
||||
* Whether all of the secondary nicks of a nick group have to expire or be
|
||||
dropped before the display nick can expire or be dropped.
|
||||
*/
|
||||
preservedisplay = no
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -240,33 +279,6 @@ command_group
|
||||
/* Give it a help command. */
|
||||
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* ns_access
|
||||
*
|
||||
* Provides the command nickserv/access.
|
||||
*
|
||||
* Used for configuring what hosts have access to your account.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_access"
|
||||
|
||||
/*
|
||||
* The maximum number of entries allowed on a nickname's access list.
|
||||
* If not set, the default is 32. This number cannot be set to 0.
|
||||
*/
|
||||
accessmax = 32
|
||||
|
||||
/*
|
||||
* If set, Services will add the usermask of registering users to the access list of their
|
||||
* newly created account. If not set, users will always have to identify to NickServ before
|
||||
* being recognized, unless they manually add an address to the access list of their account.
|
||||
* This directive is optional.
|
||||
*/
|
||||
addaccessonreg = no
|
||||
}
|
||||
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
|
||||
|
||||
/*
|
||||
* ns_ajoin
|
||||
*
|
||||
@@ -294,6 +306,7 @@ command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
|
||||
*/
|
||||
module { name = "ns_alist" }
|
||||
command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
|
||||
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/alist"; hide = true; }
|
||||
|
||||
/*
|
||||
* ns_cert
|
||||
@@ -306,6 +319,12 @@ module
|
||||
{
|
||||
name = "ns_cert"
|
||||
|
||||
/*
|
||||
* Should users who are connected with a SSL client certificate have its fingerprint be added to
|
||||
* their account when they register. Defaults to yes.
|
||||
*/
|
||||
automatic = yes
|
||||
|
||||
/*
|
||||
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
|
||||
* The default is 5. This number cannot be set to 0.
|
||||
@@ -334,18 +353,6 @@ command { service = "NickServ"; name = "DROP"; command = "nickserv/drop"; }
|
||||
module { name = "ns_getemail" }
|
||||
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_getpass
|
||||
*
|
||||
* Provides the command nickserv/getpass.
|
||||
*
|
||||
* Used for getting users passwords.
|
||||
*
|
||||
* Requires no encryption is being used.
|
||||
*/
|
||||
#module { name = "ns_getpass" }
|
||||
#command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; permission = "nickserv/getpass"; }
|
||||
|
||||
/*
|
||||
* ns_group
|
||||
*
|
||||
@@ -362,7 +369,7 @@ module
|
||||
*
|
||||
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
|
||||
*/
|
||||
maxaliases = 16
|
||||
maxaliases = 10
|
||||
|
||||
/*
|
||||
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
|
||||
@@ -456,7 +463,7 @@ module
|
||||
name = "ns_recover"
|
||||
|
||||
/*
|
||||
* If set, Services will svsnick and svsjoin users who use the recover
|
||||
* If set, Anope will svsnick and svsjoin users who use the recover
|
||||
* command on an identified user to the nick and channels of the recovered user.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -464,9 +471,10 @@ module
|
||||
restoreonrecover = yes
|
||||
}
|
||||
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
|
||||
# Uncomment below to emulate 1.8's behavior of ghost and release.
|
||||
#command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; }
|
||||
#command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; }
|
||||
|
||||
# For compatibility with Anope 1.8 and Atheme.
|
||||
command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; hide = true; }
|
||||
command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; hide = true; }
|
||||
|
||||
/*
|
||||
* ns_register
|
||||
@@ -499,7 +507,7 @@ module
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#nickregdelay = 30s
|
||||
nickregdelay = 15s
|
||||
|
||||
/*
|
||||
* The length of time a user using an unconfirmed account has
|
||||
@@ -521,6 +529,27 @@ command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; }
|
||||
module { name = "ns_resetpass" }
|
||||
command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass"; }
|
||||
|
||||
/*
|
||||
* ns_sasl
|
||||
*
|
||||
* Provides support for authentication to services via IRCv3 SASL. This is a standardised
|
||||
* alternative to ns_identify that is supported by several IRCds.
|
||||
*
|
||||
* You will need to configure your IRCd to use SASL. See the following links for details:
|
||||
*
|
||||
* InspIRCd: https://docs.inspircd.org/4/modules/sasl/
|
||||
* UnrealIRCd: https://www.unrealircd.org/docs/SASL#Enabling_SASL_on_the_server
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_sasl"
|
||||
|
||||
/*
|
||||
* The nick of the client which operates as the SASL agent.
|
||||
*/
|
||||
#agent = "NickServ"
|
||||
}
|
||||
|
||||
/*
|
||||
* ns_set
|
||||
*
|
||||
@@ -530,24 +559,11 @@ command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpas
|
||||
* nickserv/set/display, nickserv/saset/display - Used for setting a users display name.
|
||||
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
|
||||
* nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
|
||||
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
|
||||
* nickserv/set/language, nickserv/saset/language - Used for configuring what language services use.
|
||||
* nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you.
|
||||
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
|
||||
* nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access.
|
||||
* nickserv/set/neverop, nickserv/saset/neverop - Used to configure whether a user can be added to access lists
|
||||
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
|
||||
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_set"
|
||||
|
||||
/*
|
||||
* Allow the use of the IMMED option in the NickServ SET KILL command.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#allowkillimmed = yes
|
||||
}
|
||||
module { name = "ns_set" }
|
||||
|
||||
command { service = "NickServ"; name = "SET"; command = "nickserv/set"; }
|
||||
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin"; }
|
||||
@@ -561,26 +577,60 @@ command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/sase
|
||||
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; }
|
||||
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET KEEPMODES"; command = "nickserv/set/keepmodes"; }
|
||||
command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/saset/keepmodes"; permission = "nickserv/saset/keepmodes"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
|
||||
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
|
||||
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
|
||||
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
|
||||
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
|
||||
command { service = "NickServ"; name = "SET NEVEROP"; command = "nickserv/set/neverop"; }
|
||||
command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop"; }
|
||||
|
||||
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
|
||||
|
||||
/*
|
||||
* ns_set_keepmodes
|
||||
*
|
||||
* Provides the command nickserv/set/keepmodes and nickserv/saset/keepmodes.
|
||||
*
|
||||
* Allows configuring services to keep user modes across logins.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_set_keepmodes"
|
||||
|
||||
/*
|
||||
* Anope will try to not restore user modes that aren't settable by users. However, if
|
||||
* you have modes that you don't want to be automatically restored you can list them
|
||||
* here.
|
||||
*/
|
||||
#norestore = "ABCabc"
|
||||
}
|
||||
command { service = "NickServ"; name = "SET KEEPMODES"; command = "nickserv/set/keepmodes"; }
|
||||
command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/saset/keepmodes"; permission = "nickserv/saset/keepmodes"; }
|
||||
|
||||
/*
|
||||
* ns_set_language
|
||||
*
|
||||
* Provides the command nickserv/set/language and nickserv/saset/language.
|
||||
*
|
||||
* Allows configuring the language that services uses.
|
||||
*/
|
||||
module { name = "ns_set_language" }
|
||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
||||
|
||||
/*
|
||||
* ns_set_message
|
||||
*
|
||||
* Provides the commands nickserv/set/message and nickserv/saset/message.
|
||||
*
|
||||
* Allows users to let services send them PRIVMSGs instead of NOTICEs.
|
||||
*
|
||||
* This might cause problems with badly written clients as the IRC RFC
|
||||
* requires that automatic responses to a PRIVMSG use a NOTICE to avoid
|
||||
* message loops. Only enable this if you are sure this can not happen.
|
||||
*/
|
||||
#module { name = "ns_set_message" }
|
||||
#command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
|
||||
#command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
||||
|
||||
/*
|
||||
* ns_set_misc
|
||||
@@ -595,21 +645,26 @@ command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc";
|
||||
command { service = "NickServ"; name = "SASET URL"; command = "nickserv/saset/misc"; misc_description = _("Associate a URL with this account"); permission = "nickserv/saset/url"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET DISCORD"; command = "nickserv/set/misc"; misc_description = _("Associate a Discord account with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET DISCORD"; command = "nickserv/saset/misc"; misc_description = _("Associate a Discord account with this account"); permission = "nickserv/saset/discord"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET FACEBOOK"; command = "nickserv/set/misc"; misc_description = _("Associate a Facebook URL with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET FACEBOOK"; command = "nickserv/saset/misc"; misc_description = _("Associate a Facebook URL with this account"); permission = "nickserv/saset/facebook"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET MASTODON"; command = "nickserv/set/misc"; misc_description = _("Associate a Mastodon account with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET MASTODON"; command = "nickserv/saset/misc"; misc_description = _("Associate a Mastodon account with this account"); permission = "nickserv/saset/mastodon"; group = "nickserv/admin"; }
|
||||
|
||||
#command { service = "NickServ"; name = "SET TIMEZONE"; command = "nickserv/set/misc"; misc_description = _("Associate a time zone with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET TIMEZONE"; command = "nickserv/saset/misc"; misc_description = _("Associate a time zone with this account"); permission = "nickserv/saset/timezone"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_status
|
||||
* ns_set_protect
|
||||
*
|
||||
* Provides the nickserv/status command.
|
||||
* Provides the commands nickserv/set/protect and kickserv/saset/protect.
|
||||
*
|
||||
* Used to determine if a user is recognized or identified by services.
|
||||
* Used for configuring nickname protection.
|
||||
*/
|
||||
module { name = "ns_status" }
|
||||
command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
|
||||
module { name = "ns_set_protect" }
|
||||
|
||||
command { service = "NickServ"; name = "SET PROTECT"; command = "nickserv/set/protect"; }
|
||||
command { service = "NickServ"; name = "SASET PROTECT"; command = "nickserv/saset/protect"; permission = "nickserv/saset/kill"; }
|
||||
|
||||
# For compatibility with Anope 2.0.
|
||||
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/protect"; hide = true; }
|
||||
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/protect"; permission = "nickserv/saset/protect"; hide = true; }
|
||||
|
||||
/*
|
||||
* ns_suspend
|
||||
@@ -665,7 +720,7 @@ command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
|
||||
name = "ns_maxemail"
|
||||
|
||||
/*
|
||||
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
|
||||
* The limit to how many registered nicks can use the same email address. If set to 0 or left
|
||||
* commented, there will be no limit enforced when registering new accounts or using
|
||||
* /msg NickServ SET EMAIL.
|
||||
*/
|
||||
|
||||
+46
-29
@@ -21,7 +21,7 @@ service
|
||||
/*
|
||||
* The hostname of the OperServ client.
|
||||
*/
|
||||
host = "services.host"
|
||||
host = "${services.host}"
|
||||
|
||||
/*
|
||||
* The realname of the OperServ client.
|
||||
@@ -49,6 +49,17 @@ service
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
|
||||
/*
|
||||
* The server alias that can be used to securely message this service. If
|
||||
* your IRC server does not have an alias for this service you can set this
|
||||
* to an empty string to tell users to use /msg instead.
|
||||
*
|
||||
* This setting is ignored when options:servicealias is disabled.
|
||||
*
|
||||
* Defaults to the nick of the service if not set.
|
||||
*/
|
||||
#alias = "OS"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -75,7 +86,7 @@ module
|
||||
sqlineexpiry = 30d
|
||||
|
||||
/*
|
||||
* If set, this option will make Services send an AKILL command immediately after it has been
|
||||
* If set, this option will make Anope send an AKILL command immediately after it has been
|
||||
* added with AKILL ADD. This eliminates the need for killing the user after the AKILL has
|
||||
* been added.
|
||||
*
|
||||
@@ -84,7 +95,7 @@ module
|
||||
akillonadd = yes
|
||||
|
||||
/*
|
||||
* If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD.
|
||||
* If set, this option will make Anope send an (SVS)KILL command immediately after SNLINE ADD.
|
||||
* This eliminates the need for killing the user after the SNLINE has been added.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -92,7 +103,7 @@ module
|
||||
killonsnline = yes
|
||||
|
||||
/*
|
||||
* If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD.
|
||||
* If set, this option will make Anope send an (SVS)KILL command immediately after SQLINE ADD.
|
||||
* This eliminates the need for killing the user after the SQLINE has been added.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -167,7 +178,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
|
||||
name = "os_defcon"
|
||||
|
||||
/*
|
||||
* Default DefCon level (1-5) to use when starting Services up. Level 5 constitutes normal operation
|
||||
* Default DefCon level (1-5) to use when starting Anope up. Level 5 constitutes normal operation
|
||||
* while level 1 constitutes the most restrictive operation. If this setting is left out or set to
|
||||
* 0, DefCon will be disabled and the rest of this block will be ignored.
|
||||
*/
|
||||
@@ -184,8 +195,8 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
|
||||
* - forcechanmodes: Forces all channels to have the modes given in the later chanmodes directive
|
||||
* - reducedsessions: Reduces the session limit to the value given in the later sessionlimit directive
|
||||
* - nonewclients: KILL any new clients trying to connect
|
||||
* - operonly: Services will ignore all non-IRCops
|
||||
* - silentoperonly: Services will silently ignore all non-IRCops
|
||||
* - operonly: Ignore all non-IRCops
|
||||
* - silentoperonly: Silently ignore all non-IRCops
|
||||
* - akillnewclients: AKILL any new clients trying to connect
|
||||
* - nonewmemos: No new memos will be sent to block MemoServ attacks
|
||||
*/
|
||||
@@ -209,7 +220,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
|
||||
* The channel modes to set on all channels when the DefCon channel mode system is in use.
|
||||
*
|
||||
* Note 1: Choose these modes carefully, because when DefCon switches to a level which does NOT have
|
||||
* the mode setting selected, Services will set the reverse on all channels, e.g. if this setting
|
||||
* the mode setting selected, Anope will set the reverse on all channels, e.g. if this setting
|
||||
* is +RN when DefCon is used, all channels will be set to +RN, when DefCon is removed, all
|
||||
* channels will be set to -RN. You don't want to set this to +k for example, because when DefCon
|
||||
* is removed, all channels are set -k, removing the key from previously keyed channels.
|
||||
@@ -227,14 +238,14 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
|
||||
#timeout = 15m
|
||||
|
||||
/*
|
||||
* If set, Services will send a global message on DefCon level changes.
|
||||
* If set, Anope will send a global message on DefCon level changes.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#globalondefcon = yes
|
||||
|
||||
/*
|
||||
* If set, Services will send the global message defined in the message directive on DefCon level
|
||||
* If set, Anope will send the global message defined in the message directive on DefCon level
|
||||
* changes.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -267,7 +278,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
|
||||
*
|
||||
* Provides the command operserv/dns.
|
||||
*
|
||||
* This module requires that m_dns is loaded.
|
||||
* This module requires that dns is loaded.
|
||||
*
|
||||
* This module allows controlling a DNS zone. This is useful for
|
||||
* controlling what servers users are placed on for load balancing,
|
||||
@@ -348,7 +359,7 @@ command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; pe
|
||||
*
|
||||
* Provides the command operserv/ignore.
|
||||
*
|
||||
* Used to make Services ignore users.
|
||||
* Used to make Anope ignore users.
|
||||
*/
|
||||
module { name = "os_ignore" }
|
||||
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
|
||||
@@ -491,6 +502,13 @@ module
|
||||
* This directive is optional, if not set it will default to 3.
|
||||
*/
|
||||
#newscount = 3
|
||||
|
||||
/*
|
||||
* Whether to show the datetime at which the news entry was added.
|
||||
*
|
||||
* This directive is optional, if not set it will default to yes.
|
||||
*/
|
||||
#showdate = yes
|
||||
}
|
||||
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; }
|
||||
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; }
|
||||
@@ -503,20 +521,9 @@ command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomn
|
||||
*
|
||||
* Used to NOOP a server, which prevents users from opering on that server.
|
||||
*/
|
||||
module { name = "os_noop" }
|
||||
#module { name = "os_noop" }
|
||||
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop"; }
|
||||
|
||||
/*
|
||||
* os_oline
|
||||
*
|
||||
* Provides the command operserv/oline.
|
||||
*
|
||||
* Used to set oper flags on users, and is specific to UnrealIRCd 3.2.
|
||||
* See /helpop ?svso on your IRCd for more information.
|
||||
*/
|
||||
#module { name = "os_oline" }
|
||||
#command { service = "OperServ"; name = "OLINE"; command = "operserv/oline"; permission = "operserv/oline"; }
|
||||
|
||||
/*
|
||||
* os_oper
|
||||
*
|
||||
@@ -532,7 +539,7 @@ command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permis
|
||||
*
|
||||
* Provides the command operserv/reload.
|
||||
*
|
||||
* Used to reload the services.conf configuration file.
|
||||
* Used to reload the anope.conf configuration file.
|
||||
*/
|
||||
module { name = "os_reload" }
|
||||
command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; permission = "operserv/reload"; }
|
||||
@@ -580,7 +587,7 @@ module
|
||||
*
|
||||
* This directive is optional, if not set, nothing will be sent.
|
||||
*/
|
||||
sessionlimitexceeded = "The session limit for your IP %IP% has been exceeded."
|
||||
sessionlimitexceeded = "The session limit for your IP {ip} has been exceeded."
|
||||
|
||||
/*
|
||||
* Same as above, but should be used to provide a website address where users can find out more
|
||||
@@ -595,7 +602,7 @@ module
|
||||
#sessionlimitdetailsloc = "Please visit https://your.website.url/ for more information about session limits."
|
||||
|
||||
/*
|
||||
* If set and is not 0, this directive tells Services to add an AKILL if the number of subsequent kills
|
||||
* If set and is not 0, this directive tells Anope to add an AKILL if the number of subsequent kills
|
||||
* for the same host exceeds this value, preventing the network from experiencing KILL floods.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -649,8 +656,18 @@ command { service = "OperServ"; name = "SET"; command = "operserv/set"; permissi
|
||||
*
|
||||
* Used to quit, restart, or shutdown services.
|
||||
*/
|
||||
module { name = "os_shutdown" }
|
||||
command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; permission = "operserv/quit"; }
|
||||
module
|
||||
{
|
||||
name = "os_shutdown"
|
||||
|
||||
/*
|
||||
* If enabled then server operators will be required to provide the network
|
||||
* name to confirm that they are quitting, restarting, or shutting down the
|
||||
* right server.
|
||||
*/
|
||||
requirename = yes
|
||||
}
|
||||
#command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; permission = "operserv/quit"; }
|
||||
command { service = "OperServ"; name = "RESTART"; command = "operserv/restart"; permission = "operserv/restart"; }
|
||||
command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"; permission = "operserv/shutdown"; }
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Example configuration file for Services. After making the appropriate
|
||||
* changes to this file, place it in the Services conf directory (as
|
||||
* specified in the "configure" script, default /home/username/services/conf)
|
||||
* under the name "services.conf".
|
||||
* Example configuration file for Anope. After making the appropriate
|
||||
* changes to this file, place it in the Anope conf directory (as
|
||||
* specified in the "Config" script, default /home/username/anope/conf)
|
||||
* under the name "anope.conf".
|
||||
*
|
||||
* The format of this file is fairly simple: three types of comments are supported:
|
||||
* - All text after a '#' on a line is ignored, as in shell scripting
|
||||
@@ -53,7 +53,7 @@
|
||||
* included to indicate whether an option is required:
|
||||
*
|
||||
* [REQUIRED]
|
||||
* Indicates a directive which must be given. Without it, Services will
|
||||
* Indicates a directive which must be given. Without it, Anope will
|
||||
* not start.
|
||||
*
|
||||
* [RECOMMENDED]
|
||||
@@ -71,7 +71,7 @@
|
||||
*
|
||||
* [DEPRECATED]
|
||||
* Indicates a directive which will disappear in a future version of
|
||||
* Services, usually because its functionality has been either
|
||||
* Anope, usually because its functionality has been either
|
||||
* superseded by that of other directives or incorporated into the main
|
||||
* program.
|
||||
*/
|
||||
@@ -79,17 +79,20 @@
|
||||
/*
|
||||
* [OPTIONAL] Defines
|
||||
*
|
||||
* You can define values to other values, which can be used to easily change
|
||||
* many values in the configuration at once.
|
||||
* You can use defines for repeated information, which can be used to easily change many
|
||||
* values in the configuration at once.
|
||||
*
|
||||
* To use a define called foo.bar you use ${foo.bar} in your config file. You can also use
|
||||
* environment variables by prefixing their name with "env." like ${env.USER}.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The stats.host define is used in multiple different locations throughout the
|
||||
* configuration for the stats client hostname.
|
||||
* The services.host define is used in multiple different locations throughout the
|
||||
* configuration for the server name and pseudoclient hostnames.
|
||||
*/
|
||||
define
|
||||
{
|
||||
name = "stats.host"
|
||||
name = "services.host"
|
||||
value = "stats.example.com"
|
||||
}
|
||||
|
||||
@@ -120,7 +123,7 @@ define
|
||||
* This section can be included multiple times, and Anope will attempt to
|
||||
* connect to each server until it finally connects.
|
||||
*
|
||||
* Each uplink IRCd should have a corresponding configuration to allow Services
|
||||
* Each uplink IRCd should have a corresponding configuration to allow Anope
|
||||
* to link to it.
|
||||
*
|
||||
* An example configuration for InspIRCd that is compatible with the below uplink
|
||||
@@ -158,20 +161,22 @@ define
|
||||
uplink
|
||||
{
|
||||
/*
|
||||
* The IP or hostname of the IRC server you wish to connect Services to.
|
||||
* Usually, you will want to connect Services over 127.0.0.1 (aka localhost).
|
||||
* The IP address, hostname, or UNIX socket path of the IRC server you wish
|
||||
* to connect Anope to.
|
||||
* Usually, you will want to connect over 127.0.0.1 (aka localhost).
|
||||
*
|
||||
* NOTE: On some shell providers, this will not be an option.
|
||||
*/
|
||||
host = "127.0.0.1"
|
||||
|
||||
/*
|
||||
* Enable if Services should connect using IPv6.
|
||||
* The protocol that Anope should use when connecting to the uplink. Can
|
||||
* be set to "ipv4" (the default), "ipv6", or "unix".
|
||||
*/
|
||||
ipv6 = no
|
||||
protocol = "ipv4"
|
||||
|
||||
/*
|
||||
* Enable if Services should connect using SSL.
|
||||
* Enable if Anope should connect using SSL.
|
||||
* You must have an SSL module loaded for this to work.
|
||||
*/
|
||||
ssl = no
|
||||
@@ -197,26 +202,26 @@ uplink
|
||||
/*
|
||||
* [REQUIRED] Server Information
|
||||
*
|
||||
* This section contains information about the Services server.
|
||||
* This section contains information about the services server.
|
||||
*/
|
||||
serverinfo
|
||||
{
|
||||
/*
|
||||
* The hostname that Services will be seen as, it must have no conflicts with any
|
||||
* The hostname that Anope will be seen as, it must have no conflicts with any
|
||||
* other server names on the rest of your IRC network. Note that it does not have
|
||||
* to be an existing hostname, just one that isn't on your network already.
|
||||
*/
|
||||
name = "stats.example.com"
|
||||
name = "${services.host}"
|
||||
|
||||
/*
|
||||
* The text which should appear as the server's information in /WHOIS and similar
|
||||
* queries.
|
||||
*/
|
||||
description = "Stats for IRC Networks"
|
||||
description = "Anope IRC Statistics"
|
||||
|
||||
/*
|
||||
* The local address that Services will bind to before connecting to the remote
|
||||
* server. This may be useful for multihomed hosts. If omitted, Services will let
|
||||
* The local address that Anope will bind to before connecting to the remote
|
||||
* server. This may be useful for multihomed hosts. If omitted, Anope will let
|
||||
* the Operating System choose the local address. This directive is optional.
|
||||
*
|
||||
* If you don't know what this means or don't need to use it, just leave this
|
||||
@@ -232,16 +237,16 @@ serverinfo
|
||||
#id = "00A"
|
||||
|
||||
/*
|
||||
* The filename containing the Services process ID. The path is relative to the
|
||||
* services root directory.
|
||||
* The filename containing the Anope process ID. The path is relative to the
|
||||
* data directory.
|
||||
*/
|
||||
pid = "data/stats.pid"
|
||||
pid = "anope.pid"
|
||||
|
||||
/*
|
||||
* The filename containing the Message of the Day. The path is relative to the
|
||||
* services root directory.
|
||||
* config directory.
|
||||
*/
|
||||
motd = "conf/stats.motd"
|
||||
motd = "motd.txt"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -252,57 +257,55 @@ serverinfo
|
||||
*
|
||||
* Supported:
|
||||
* - bahamut
|
||||
* - charybdis
|
||||
* - hybrid
|
||||
* - inspircd12
|
||||
* - inspircd20
|
||||
* - inspircd3 (for 3.x and 4.x)
|
||||
* - inspircd
|
||||
* - ngircd
|
||||
* - plexus
|
||||
* - ratbox
|
||||
* - unreal (for 3.2.x)
|
||||
* - unreal4 (for 4.x or later)
|
||||
* - solanum
|
||||
* - unrealircd
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "inspircd3"
|
||||
name = "inspircd"
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] Network Information
|
||||
*
|
||||
* This section contains information about the IRC network that Services will be
|
||||
* This section contains information about the IRC network that Anope will be
|
||||
* connecting to.
|
||||
*/
|
||||
networkinfo
|
||||
{
|
||||
/*
|
||||
* This is the name of the network that Services will be running on.
|
||||
* This is the name of the network that Anope will be running on.
|
||||
*/
|
||||
networkname = "LocalNet"
|
||||
|
||||
/*
|
||||
* Set this to the maximum allowed nick length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Services being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 31.
|
||||
*/
|
||||
nicklen = 31
|
||||
#nicklen = 31
|
||||
|
||||
/* Set this to the maximum allowed ident length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Services being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 10.
|
||||
*/
|
||||
userlen = 10
|
||||
#userlen = 10
|
||||
|
||||
/* Set this to the maximum allowed hostname length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Services being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 64.
|
||||
*/
|
||||
hostlen = 64
|
||||
#hostlen = 64
|
||||
|
||||
/* Set this to the maximum allowed channel length on your network.
|
||||
* Defaults to 64.
|
||||
*/
|
||||
chanlen = 32
|
||||
#chanlen = 32
|
||||
|
||||
/* The maximum number of list modes settable on a channel (such as b, e, I).
|
||||
* Comment out or set to 0 to disable.
|
||||
@@ -314,7 +317,7 @@ networkinfo
|
||||
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
|
||||
* recommended unless you know for sure your IRCd supports whatever characters you are
|
||||
* wanting to use. Telling services to set a vHost containing characters your IRCd
|
||||
* disallows could potentially break the IRCd and/or Services.
|
||||
* disallows could potentially break the IRCd and/or Anope.
|
||||
*
|
||||
* It is recommended you DON'T change this.
|
||||
*/
|
||||
@@ -339,22 +342,22 @@ networkinfo
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] Services Options
|
||||
* [REQUIRED] Anope Options
|
||||
*
|
||||
* This section contains various options which determine how Services will operate.
|
||||
* This section contains various options which determine how Anope will operate.
|
||||
*/
|
||||
options
|
||||
{
|
||||
/*
|
||||
* On Linux/UNIX systems Anope can setuid and setgid to this user and group
|
||||
* after starting up. This is useful if Anope has to bind to privileged ports
|
||||
* after starting up. This is useful if Anope has to bind to privileged ports.
|
||||
*/
|
||||
#user = "anope"
|
||||
#group = "anope"
|
||||
|
||||
/*
|
||||
* The case mapping used by services. This must be set to a valid locale name
|
||||
* installed on your machine. Services use this case map to compare, with
|
||||
* installed on your machine. Anope uses this case map to compare, with
|
||||
* case insensitivity, things such as nick names, channel names, etc.
|
||||
*
|
||||
* We provide two special casemaps shipped with Anope, ascii and rfc1459.
|
||||
@@ -372,14 +375,14 @@ options
|
||||
readtimeout = 5s
|
||||
|
||||
/*
|
||||
* If set, Services will only show /stats o to IRC Operators. This directive
|
||||
* If set, Anope will only show /stats o to IRC Operators. This directive
|
||||
* is optional.
|
||||
*/
|
||||
#hidestatso = yes
|
||||
|
||||
/*
|
||||
* A space-separated list of U-lined servers on your network, it is assumed that
|
||||
* the servers in this list are allowed to set channel modes and Services will
|
||||
* the servers in this list are allowed to set channel modes and Anope will
|
||||
* not attempt to reverse their mode changes.
|
||||
*
|
||||
* WARNING: Do NOT put your normal IRC user servers in this directive.
|
||||
@@ -478,13 +481,13 @@ log
|
||||
/*
|
||||
* [REQUIRED] MySQL Database configuration.
|
||||
*
|
||||
* m_mysql
|
||||
* mysql
|
||||
*
|
||||
* This module allows other modules to use MySQL.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "m_mysql"
|
||||
name = "mysql"
|
||||
|
||||
mysql
|
||||
{
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
astyle --style=java --indent=tab --brackets=break-closing --indent-switches --indent-cases --brackets=break
|
||||
@@ -0,0 +1,92 @@
|
||||
Since the first commit in March 2004 88 people have submitted patches, commits,
|
||||
and other useful contributions to Anope. These people, ordered by the number of
|
||||
contributions they have made, are:
|
||||
|
||||
* Adam <adam@anope.org>
|
||||
* Sadie Powell <sadie@witchery.services>
|
||||
* Robin Burchell <w00t@inspircd.org>
|
||||
* Naram Qashat <cyberbotx@anope.org>
|
||||
* Pieter Bootsma <geniusdex@anope.org>
|
||||
* Jens Voss <dukepyrolator@anope.org>
|
||||
* David Robson <rob@anope.org>
|
||||
* Florian Schulze <certus@anope.org>
|
||||
* Daniel Engel <dane@zero.org>
|
||||
* Trystan S. Lee <trystan@nomadirc.net>
|
||||
* Robby <robby@chatbelgie.be>
|
||||
* Charles Kingsley <chaz@anope.org>
|
||||
* Lee Holmes <lethality@anope.org>
|
||||
* Gabriel Acevedo H. <drstein@anope.org>
|
||||
* Jan Milants <viper@anope.org>
|
||||
* Adam Kramer <ribosome@anope.org>
|
||||
* Attila Molnar <attilamolnar@hush.com>
|
||||
* Michael Wobst <wobst.michael@web.de>
|
||||
* Mark Summers <mark@goopler.net>
|
||||
* Matt Schatz <genius3000@g3k.solutions>
|
||||
* Daniel Vassdal <shutter@canternet.org>
|
||||
* MatthewM <mcm@they-got.us>
|
||||
* PeGaSuS <droider.pc@gmail.com>
|
||||
* Sebastian V. <hal9000@denorastats.org>
|
||||
* Alvaro Toledo <atoledo@keldon.org>
|
||||
* Dragone2 <dragone2@risposteinformatiche.it>
|
||||
* Björn Stiddien <keeper@anope.org>
|
||||
* n0kS Phr33d0m <god@politeia.in>
|
||||
* Hendrik Jäger <gitcommit@henk.geekmail.org>
|
||||
* k4be <k4be@pirc.pl>
|
||||
* Thomas Fargeix <t.fargeix@gmail.com>
|
||||
* Bram Matthys <syzop@vulnscan.org>
|
||||
* Federico G. Schwindt <fgsch@lodoss.net>
|
||||
* Val Lorentz <progval+git@progval.net>
|
||||
* Alexander Barton <alex@barton.de>
|
||||
* CaPa CuL <capacul@gmail.com>
|
||||
* Cronus <cronus@nite-serv.com>
|
||||
* H7-25 <simos@simosnap.org>
|
||||
* Jyzee <jyzee.git@gmail.com>
|
||||
* Sebastian Barfurth <github@afreshmelon.com>
|
||||
* Zantox <jyoerger10@msn.com>
|
||||
* Zoddo <zoddo.ino@gmail.com>
|
||||
* Dominic Hargreaves <dom@earth.li>
|
||||
* Michael Hazell <michaelhazell@hotmail.com>
|
||||
* Robert Scheck <robert@fedoraproject.org>
|
||||
* Dennis Friis <peavey@inspircd.org>
|
||||
* Filippo Cortigiani <simos@simosnap.org>
|
||||
* Michał Zegan <webczat_200@poczta.onet.pl>
|
||||
* AlphaTech <alphat3ch@icloud.com>
|
||||
* Austin Ellis <siniStar@IRC4Fun.net>
|
||||
* bonnedav <theD_2011@hotmail.com>
|
||||
* Denis M. (Phr33d0m) <god@politeia.in>
|
||||
* Harakiri <harakiri@overstack.fr>
|
||||
* Marcin Łabanowski <marcin@6irc.net>
|
||||
* Matt Ullman <matt@airraidsirens.com>
|
||||
* Michael Stapelberg <michael@robustirc.net>
|
||||
* Alexander Maassen <outsider@twingoversum.scarynet.org>
|
||||
* artemiiav <artemiiav@gmail.com>
|
||||
* blackbeard420 <blackbeard@blackbeard420.me>
|
||||
* BoGu5 <bogus@onzin.org>
|
||||
* Chris Langsenkamp <chris@langsenkamp.com>
|
||||
* Clem Morton
|
||||
* Daniel Oaks <danneh@danneh.net>
|
||||
* Fabio Scotoni <cculex@gmail.com>
|
||||
* ItsOnlyBinary
|
||||
* Jason Foster <retsofaj@gmail.com>
|
||||
* Jeremy <jeremy@ssnet.ca>
|
||||
* Josh Soref
|
||||
* KindOne <ineedalifetoday@live.com>
|
||||
* linuxdaemon
|
||||
* Mantas Mikulėnas <grawity@gmail.com>
|
||||
* Matthew Beeching <jobe@mdbnet.co.uk>
|
||||
* Michael <michaelhazell@hotmail.com>
|
||||
* Mingjie Shen <shen497@purdue.edu>
|
||||
* nekoswag
|
||||
* Peter Tseng <pht24@cornell.edu>
|
||||
* Romain Rivière <lecoyote@lecoyote.org>
|
||||
* Sam James (sam_c) <sam@cmpct.info>
|
||||
* ShutterQuick <shutter@canternet.org>
|
||||
* Sketch <denverfreeburn@outlook.com>
|
||||
* Tim Gunter <tim@vanillaforums.com>
|
||||
* Toni Kaija <diftraku@gmail.com>
|
||||
* Victor Coss <gtaxl@gtaxl.net>
|
||||
* VisioN <vision@myirc.us>
|
||||
* westor <westor7@gmail.com>
|
||||
* Wilson Birney <wpb@360scada.com>
|
||||
* Yann Sionneau <yann@sionneau.net>
|
||||
* Zach Bloomquist <zrbq@live.com>
|
||||
@@ -1 +0,0 @@
|
||||
For all bug reports / updates please see https://github.com/anope/anope/issues
|
||||
-111
@@ -1,111 +0,0 @@
|
||||
C++-style Casting
|
||||
=================
|
||||
|
||||
In C, you can cast in one of two ways:
|
||||
|
||||
(type)var
|
||||
type(var)
|
||||
|
||||
The problem with C-style casting is that it allows a programmer to get away
|
||||
with too much, and is also not designed to handle C++ classes.
|
||||
|
||||
C++ has 4 types of casting in addition to allowing C-style casting. They are:
|
||||
|
||||
static_cast
|
||||
const_cast
|
||||
dynamic_cast
|
||||
reinterpret_cast
|
||||
|
||||
The syntax is usually *_cast<type>(var).
|
||||
|
||||
static_cast
|
||||
-----------
|
||||
|
||||
From my experience, this cast is closest to C-style casting for non-pointer
|
||||
types as well as between some (but not all) pointer types. This type of cast,
|
||||
like C-style casting, is performed at compile-time. static_cast can also do
|
||||
a downcast of a derived class to a base class, but only if the base class is
|
||||
not a virtual base class. Sometimes the result of this cast can become
|
||||
undefined. static_cast is a bit more strict that C-style casting, though. It
|
||||
disallows certain class conversions that would've been allowed with a C-style
|
||||
cast. static_cast also doesn't allow you to cast to an incomplete type. In
|
||||
these cases, I would try either dynamic_cast or reinterpret_cast.
|
||||
|
||||
const_cast
|
||||
----------
|
||||
|
||||
This cast is mainly to add or remove const-ness or volatile-ness from a
|
||||
variable. This is safer than using a C-style cast to change the const-ness
|
||||
of a variable. In most cases if you try to use one of the other casts and it
|
||||
complains about const-ness, you will want to either use this cast instead or
|
||||
wrap the other cast around this cast. An example:
|
||||
|
||||
const int *a;
|
||||
static_cast<void *>(a); <-- This will fail.
|
||||
|
||||
To remedy the above, you would might try this:
|
||||
|
||||
const int *a;
|
||||
const_cast<void *>(a); <-- But this will still fail.
|
||||
|
||||
The real solution is this:
|
||||
|
||||
const int *a;
|
||||
static_cast<void *>(const_cast<int *>(a));
|
||||
|
||||
It is not recommended to use const_cast on the this variable within a member
|
||||
function of a class that is declared const. Instead you should use the mutable
|
||||
keyword on the variable in the class's definition.
|
||||
|
||||
dynamic_cast
|
||||
------------
|
||||
|
||||
This cast can only be used on pointers or references to classes. It can cast a
|
||||
derived class to a base class, a derived class to another derived class
|
||||
(provided that both are children of the same base class), or a base class to a
|
||||
derived class. You can also use this to cast a class to void *. This cast is
|
||||
done at run-time as opposed to the other casts, and relies on C++'s RTTI to be
|
||||
enabled. It is meant to be used on polymorphic classes, so use static_cast on
|
||||
non-polymorphic classes.
|
||||
|
||||
derived-to-base conversions are actually done statically, so you use either
|
||||
dynamic_cast or static_cast on them, regardless of if the classes are
|
||||
polymorphic or not.
|
||||
|
||||
derived-to-derived or base-to-derived conversions, however, rely on run-time
|
||||
type information, and this cast is used on those classes that are polymorphic.
|
||||
This is safer than C-style casting in that an invalid pointer conversion will
|
||||
return a NULL pointer, and an invalid reference conversion will throw a
|
||||
Bad_cast exception.
|
||||
|
||||
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 because of dynamic_cast's
|
||||
reliance on RTTI.
|
||||
|
||||
reinterpret_cast
|
||||
----------------
|
||||
|
||||
This cast I would use only as a last resort if static_cast isn't allowed on a
|
||||
conversion. It allows for conversions between two unrelated types, such as
|
||||
going from char * to int *. It can also be used to convert a pointer to an
|
||||
integral type and vica versa. The sites I've read mention how the result is
|
||||
non-portable, which I assume means the resulting object code is non-portable,
|
||||
so since the code is compiled on many systems anyways, I don't see this as
|
||||
being a huge issue. It is recommended to only use this if necessary, though.
|
||||
|
||||
Links
|
||||
=====
|
||||
|
||||
The following links are web sites I've used to get this information, and might
|
||||
describe some of the above a bit better than I have. :P
|
||||
|
||||
https://www.acm.org/crossroads/xrds3-1/ovp3-1.html
|
||||
http://www.cplusplus.com/doc/tutorial/typecasting.html
|
||||
http://www.codeguru.com/forum/showthread.php?t=312456
|
||||
https://web.archive.org/web/20170810222238/http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/cast.html
|
||||
https://www.microsoft.com/en-us/download/details.aspx?id=55984
|
||||
https://en.wikibooks.org/wiki/C%2B%2B_Programming/Type_Casting
|
||||
https://web.archive.org/web/20160510114447/http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=134
|
||||
|
||||
-- CyberBotX, Nov 23, 2008
|
||||
+3
-3
@@ -6,10 +6,10 @@ if(WIN32)
|
||||
if(IN_SOURCE)
|
||||
# Add README.txt to list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("README.txt$" TRUE)
|
||||
endif(IN_SOURCE)
|
||||
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES NEWS ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
|
||||
endif()
|
||||
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
|
||||
install(FILES ${DOCS}
|
||||
DESTINATION ${DOC_DIR}
|
||||
)
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/README.txt")
|
||||
endif(WIN32)
|
||||
endif()
|
||||
|
||||
-239
@@ -1,239 +0,0 @@
|
||||
Originally pulled from: https://wiki.inspircd.org/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
|
||||
indentation 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.
|
||||
+232
-474
@@ -1,497 +1,255 @@
|
||||
Anope Version 2.0.18-git
|
||||
Anope Version 2.1.14-git
|
||||
------------------------
|
||||
Backported better sendmail error messages from 2.1.
|
||||
Fixed building Anope with CMake 4.
|
||||
Fixed compatibility with MariaDB.
|
||||
Added a detail specifier to the anope.list{Channels,Opers,Servers,Users} RPC methods.
|
||||
Added a matcher for the InspIRCd oper extban.
|
||||
Added support for hashed operator passwords.
|
||||
Added support for hiding the date news was added in os_news.
|
||||
Added support for local password comparison to the sql_authentication module.
|
||||
Added support for monthly backups to db_json.
|
||||
Added support for unbanning virtual modes using cs_unban.
|
||||
Added the !unmute fantasy command.
|
||||
Added the anope.account and anope.listAccounts RPC methods to the rpc_data module.
|
||||
Added the protection time to the INFO output.
|
||||
Allowed unprivileged channel successors to remove themselves from succession.
|
||||
Bumped the minimum required CMake version to 3.20.
|
||||
Changed deletion callbacks to specify the mask that was deleted if only one was.
|
||||
Changed nickserv/alist to show all permissions not just the highest ranked one.
|
||||
Fixed NEVEROP not being respected in chanserv/set/founder and chanserv/set/successor.
|
||||
Fixed stripping IRC formatting codes from messages.
|
||||
Messages are now automatically line wrapped to options:linelength.
|
||||
Redocumented the ns_sasl module.
|
||||
Removed hardcoded command names from several messages.
|
||||
Updated the Windows CI to Windows Server 2025 and Visual Studio 2022.
|
||||
|
||||
Anope Version 2.1.13
|
||||
--------------------
|
||||
Added a Config check to ensure users actually want to use the development branch.
|
||||
Added a flag to the version string when Anope is compiled in reproducible mode.
|
||||
Added a warning on rehash when the max password is longer than the maximum bcrypt password length.
|
||||
Added an ALLTIME handler on InspIRCd.
|
||||
Added an opt-out for extended XML-RPC types.
|
||||
Added RPC messages for sending global messages.
|
||||
Added support for importing cs_set_misc and ns_set_misc data from Atheme.
|
||||
Added support for importing news from Atheme.
|
||||
Added support for oper-only quit messages.
|
||||
Added support for the experimental "services cloak" system from the InspIRCd development branch.
|
||||
Added support for using defines from the environment.
|
||||
Added support for using defines within the value of a variable.
|
||||
Blacklisted an old version of an UnrealIRCd module that is known to send malformed S2S messages.
|
||||
Changed RPC events to be registered as core services.
|
||||
Changed the database to refer to accounts by their account identifier instead of their display nick.
|
||||
Changed the syntax of defines from "foo" to "${foo}".
|
||||
Deduplicated JSON generation code in the jsonrpc module.
|
||||
Fixed a warning when importing an Atheme account that uses external authentication.
|
||||
Fixed counting email addresses in ns_maxemail.
|
||||
Fixed importing user ICQ and URL data from 1.8.
|
||||
Fixed operserv/ignore not being prioritised first.
|
||||
Fixed resetting the stats with operserv/stats.
|
||||
Fixed db_atheme creating duplicate accounts, bots, and nicks when importing over an existing database.
|
||||
Fixed deleting old database backups after Anope has been restarted.
|
||||
Fixed importing user metadata from Anope 1.8.
|
||||
Fixed including a port in uplink messages when connecting to a UNIX socket endpoint.
|
||||
Fixed memo ignores being erroneously case sensitive.
|
||||
Fixed modules with third-party dependencies writing generic log messages instead of module log messages.
|
||||
Fixed not performing SQL database updates in some rare circumstances.
|
||||
Fixed sending global messages with the default sender.
|
||||
Imported mkauthors from InspIRCd and used it to generate docs/AUTHORS.txt
|
||||
Moved around a bunch of module headers.
|
||||
Moved database serialization from the serializable to the serializable type.
|
||||
Moved the SASL protocol interface to its own service.
|
||||
Refactored handling S2S metadata on InspIRCd.
|
||||
Updated more messages to use gettext plural forms.
|
||||
|
||||
Anope Version 2.1.12
|
||||
--------------------
|
||||
Added an example JavaScript library for accessing the RPC interface.
|
||||
Added an option to require specifying the server name when running destructive network commands like restart or shutdown.
|
||||
Added support for importing X-line identifiers from Atheme.
|
||||
Added support for JSON-RPC to the RPC interface.
|
||||
Added support for killing SASL users that fail to log in repeatedly.
|
||||
Added support for more RPC response types to the RPC interface.
|
||||
Added support for multiple targets in chanserv/modes.
|
||||
Added support for SSL client certificate fallback fingerprints on InspIRCd.
|
||||
Added the anope. prefix to the channel and user RPC events and moved them to the rpc_data module.
|
||||
Added the anope.listChannels, anope.listServers, anope.listUsers, and anope.server RPC events to the new rpc_data module.
|
||||
Added the OPERONLY, UNUSED and VANITY filters to botserv/botlist.
|
||||
Added the system.listMethods RPC event to the new rpc_system module.
|
||||
Deprecated support for InspIRCd v3 (scheduled to be removed in around a year).
|
||||
Fixed enc_bcrypt silently truncating passwords longer than 71 characters.
|
||||
Fixed ns_set_language being able to be loaded when Anope was built without language support.
|
||||
Fixed sql_authentication not being able to use the IP address of a RPC, SASL, or web user in SQL queries.
|
||||
Made modules that use third-party libraries log the version in use on load.
|
||||
Redesigned the RPC interface to add support for emitting multiple data types.
|
||||
Replaced the opers RPC event with rpc.listOpers and rpc.oper events in the new rpc_data module.
|
||||
Updated the Dutch translation.
|
||||
|
||||
Anope Version 2.0.17
|
||||
Anope Version 2.1.11
|
||||
--------------------
|
||||
Fixed importing large flatfile databases into SQL.
|
||||
Fixed marking channels as permanent.
|
||||
Fixed serialising unset boolean extension items.
|
||||
Fixed the documentation about how to import SQL databases.
|
||||
Fixed the documentation of options:usemail.
|
||||
Fixed the location of the geoipupdate CSV files.
|
||||
Fixed translating memo emails.
|
||||
Fixed unnecessary SQL updates caused by dereferencing user accounts.
|
||||
Increased the size of the chanstats letter and word count columns.
|
||||
Updated the location of the Anope IRC channels.
|
||||
Added support for database migrations to the mysql module.
|
||||
Added support for renicking users to their UID when enforcing nickname protection.
|
||||
Added support for sending channel URLs to joining users.
|
||||
Allowed selecting languages using a shorter version of their name.
|
||||
Changed various messages to use human-readable durations instead of seconds.
|
||||
Improved the creation of expiry and duration messages.
|
||||
Improved the translation system with support for plural forms.
|
||||
Reworked how guest nicknames are generated.
|
||||
Simplified how account identifiers are allocated.
|
||||
|
||||
Anope Version 2.0.16
|
||||
Anope Version 2.1.10
|
||||
--------------------
|
||||
Added a workaround for users matching expired sqlines.
|
||||
Fixed a copy/paste error in webcpanel.
|
||||
Fixed a crash in db_flatfile caused by trying to serialize data without a type.
|
||||
Fixed duplicate messages when synconset/syncongroup is set.
|
||||
Fixed expiring channel suspensions.
|
||||
Fixed expiring forbids.
|
||||
Fixed expiring nick suspensions.
|
||||
Fixed feature detection on InspIRCd.
|
||||
Fixed InspIRCd account cloaks causing CHGHOST spam when a user also has a services vhost.
|
||||
Fixed joining users to channels with a key set on InspIRCd.
|
||||
Fixed logging users out fully when their nick gets suspended.
|
||||
Fixed marking boolean columns in SQL as TEXT instead of INT.
|
||||
Fixed matching extbans on InspIRCd and implement missing matchers.
|
||||
Fixed operserv/sqline expiry on UnrealIRCd
|
||||
Fixed respecting --noexpire in cs_suspend and ns_suspend.
|
||||
Fixed sending emails to nicks ending with a backslash.
|
||||
Fixed sending SVSTOPIC when topiclock is loaded on InspIRCd.
|
||||
Fixed some SQL tables taking up too much space on disk.
|
||||
Fixed the default config for channel suspensions.
|
||||
Fixed the TIME message on InspIRCd.
|
||||
Fixed trying to escape SQL data when not connected to MySQL.
|
||||
Fixed {ldap,sql}_authentication creating zombie accounts on expiry.
|
||||
Added support for NEXTBANS on UnrealIRCd.
|
||||
Changed hostmask access entries added by nick to use that nick as the default description.
|
||||
Changed modes to be handled internally in their split form.
|
||||
Changed ns_cert to notify a user that their certificate is being automatically added to their account.
|
||||
Fixed matching users against extended bans.
|
||||
Fixed parsing name-only extended bans on InspIRCd.
|
||||
Fixed respecting the preferred extended ban format on InspIRCd.
|
||||
Fixed the name of the cron script in the docs.
|
||||
Updated the list of supported IRCds.
|
||||
Updated the location of the Anope IRC channels
|
||||
|
||||
Anope Version 2.0.15
|
||||
--------------------
|
||||
Fixed a race condition in changing the nick of a user.
|
||||
Fixed being able to reset the password of suspended accounts.
|
||||
Fixed chanserv/suspend info not being visible to regular users.
|
||||
Fixed removing entries by an alias in chanserv/access and chanserv/xop.
|
||||
Fixed various grammar issues in messages.
|
||||
Made the SASL PLAIN implementation more robust.
|
||||
Updated the Dutch translation.
|
||||
Updated the French translation.
|
||||
Anope Version 2.1.9
|
||||
-------------------
|
||||
Bumped the minimum supported version of UnrealIRCd to 6.
|
||||
Fixed granting IRC operator status to services operators.
|
||||
Fixed making users an IRC operator on InspIRCd.
|
||||
Fixed nonicknameownership on InspIRCd v4.
|
||||
Fixed some messages not being translatable.
|
||||
Fixed the Argon2 module not having test vectors.
|
||||
Increased the default nickname expiry period to one year.
|
||||
|
||||
Anope Version 2.1.8
|
||||
-------------------
|
||||
Added account identifiers to the nickserv/info output.
|
||||
Added support for bool, float, and uint SQL columns.
|
||||
Added the ability to automatically determine SQL column types based on the native type.
|
||||
Added UNIX socket support to mysql module.
|
||||
Changed smartjoin to use SendClearBans where available.
|
||||
Dropped support for MinGW in favour of native builds.
|
||||
Fixed parsing named extbans on InspIRCd.
|
||||
Fixed parsing SVSMODE and SVS2MODE from UnrealIRCd.
|
||||
Fixed sending global messages to remotely linked servers.
|
||||
Removed the services server name from the CTCP version response.
|
||||
|
||||
Anope Version 2.1.7
|
||||
-------------------
|
||||
Added importing of akick reasons, forbid reasons, opers and session exceptions to db_atheme.
|
||||
Added support for sending tag messages.
|
||||
Added the ability to look up account information of an authenticated user.
|
||||
Fixed a crash in ns_cert when an IRC user is not present during a nick registration.
|
||||
Fixed a null pointer dereference in the global module.
|
||||
Fixed a rare memory leak in os_akill and os_sxline.
|
||||
Improved the performance of some code that looks up the primary nick from an account.
|
||||
Removed the broken Catalan, Hungarian, and Russian translations.
|
||||
Reworked the protocol interface for sending messages.
|
||||
Updated the Turkish translation.
|
||||
|
||||
Anope Version 2.0.14
|
||||
--------------------
|
||||
Added support for sqlining channels on UnrealIRCd.
|
||||
Fixed a crash when trying to access config for non-loaded modules.
|
||||
Fixed detection of the InspIRCd nopartmsg module.
|
||||
Fixed not getting memo notifications when authing with SASL.
|
||||
Fixed not serialising dontkickops/dontkickvoices in botserv/kick.
|
||||
Fixed sending emails with the wrong kind of line terminator.
|
||||
Fixed sending log messages from a renamed pseudoclient.
|
||||
Fixed telling users their passcode is incorrect when they need to authenticate in nickserv/confirm.
|
||||
Fixed the Config script freezing on some versions of util-linux.
|
||||
Updated the Windows packaging scripts to use dependencies from Conan.
|
||||
|
||||
Anope Version 2.0.13
|
||||
--------------------
|
||||
Fixed a crash on some compilers when trying to call methods on a null pointer
|
||||
Fixed a crash when encountering an unterminated commented config block
|
||||
Fixed erroneously rejecting spaces in fantasy:name
|
||||
Fixed marking services pseudoclients as an oper on InspIRCd
|
||||
Fixed not checking user@ip as well as user@host when logging into an operator account
|
||||
Fixed setting the vhost/vident during SASL on UnrealIRCd
|
||||
Updated the German translation
|
||||
Updated the Italian translation
|
||||
|
||||
Anope Version 2.0.12
|
||||
--------------------
|
||||
Added account confirmation to the web panel
|
||||
Added the regex_pcre2 module which provides regex/pcre with PCRE2
|
||||
Documented the cs_no_expire channel default
|
||||
Fixed config validation mistakenly allowing spaces in some fields
|
||||
Fixed the bahamut protocol module not knowing about halfops
|
||||
Fixed writing a flatfile database not being atomic
|
||||
Updated the hybrid protocol module for recent protocol changes
|
||||
|
||||
Anope Version 2.0.11
|
||||
--------------------
|
||||
Fixed ldap on OpenLDAP 2.5+
|
||||
Fixed not using utf-8 encoding for outgoing email
|
||||
Fixed ns_resetpass not returning a response for XMLRPC
|
||||
Fixed some message params being sent as <middle> instead of <trailing>
|
||||
Fixed unsetting vhosts on unreal4
|
||||
Fixed username validity checking on ircd-hybrid
|
||||
Send the oper mode for services pseudoclients on InspIRCd
|
||||
Updated the pl_PL translation
|
||||
Updated unreal4 for various protocol changes
|
||||
|
||||
Anope Version 2.0.10
|
||||
--------------------
|
||||
Add support for channel SQLines on InspIRCd
|
||||
Change default protocol module from inspircd20 to inspircd3
|
||||
Change the character set used by chanstats and irc2sql to utf8mb4
|
||||
Fix a ton of typos in messages
|
||||
Fix being able to override MAXLIST on InspIRCd
|
||||
Fix blocking on boot when trying to upgrade SQL databases without account identifiers
|
||||
Fix not flushing the ERROR message on squit
|
||||
Fix using an invalidated iterator when deleting bots
|
||||
Fix various harmless compiler warnings
|
||||
Fix webcpanel not using the forwarded IP
|
||||
Show the account name in nickserv/info
|
||||
|
||||
Anope Version 2.0.9
|
||||
Anope Version 2.1.6
|
||||
-------------------
|
||||
Fix a regression from 2.0.8 that prevented serialising to MySQL
|
||||
Send account identifiers to InspIRCd on SASL logins too
|
||||
Fix a query bug in irc2sql
|
||||
Added opportunistic upgrading of TLS fingerprints to more secure algorithms on InspIRCd.
|
||||
Added support for logging out partially connected users on Plexus.
|
||||
Added the account registration time to nickserv/info.
|
||||
Changed ns_cert to automatically add a TLS fingerprint to new accounts if available.
|
||||
Clarified that a non-deprecated encryption module must be loaded.
|
||||
Fixed creating the runtime directory on Windows.
|
||||
Fixed mistakenly allowing badpasslimit to be set to a negative value.
|
||||
Fixed parsing backup TLS fingerprints on InspIRCd.
|
||||
Fixed parsing the flood mode on UnrealIRCd.
|
||||
Fixed parsing the history mode on UnrealIRCd.
|
||||
Fixed various iterator invalidation issues.
|
||||
Partially rewrote the Portuguese translation.
|
||||
Removed some incorrect strings from the Turkish translation.
|
||||
Renamed the --modulesdir option to --moduledir to match the name of other path options.
|
||||
|
||||
Anope Version 2.0.8
|
||||
Anope Version 2.1.5
|
||||
-------------------
|
||||
Add +K channel mode for ircd-hybrid
|
||||
Add immutable identifiers to user accounts
|
||||
Fix build on systems that use musl libc
|
||||
Fix help of global/global not showing the correct origin nick
|
||||
Fix not removing vhosts when an nick is dropped
|
||||
Fix parsing channel metadata on InspIRCd 3+
|
||||
Fix parsing kicks on InspIRCd 3+
|
||||
Fix parsing topic changes on InspIRCd 3+
|
||||
Fix topiclock on InspIRCd
|
||||
Modernize the ircd-hybrid protocol module
|
||||
Added an example systemd unit file.
|
||||
Added support for BIGLINES on UnrealIRCd.
|
||||
Bumped the minimum supported version of Bahamut to 2.0.
|
||||
Fixed truncating messages in global/global and global/server.
|
||||
Improved building Anope for use as a system package.
|
||||
Updated the Turkish translation.
|
||||
|
||||
|
||||
Anope Version 2.0.7
|
||||
Anope Version 2.1.4
|
||||
-------------------
|
||||
Fix not sending login data on successful NickServ GROUP
|
||||
Fix m_httpd to not consider headers to be case sensitive
|
||||
Add InspIRCd 3 protocol support
|
||||
Add 'n' email token for use in the email change template
|
||||
Add logging for NickServ UNGROUP
|
||||
Fix setting swhois on UnrealIRCd
|
||||
Add nickserv/recover permission to allow opers to recover other users
|
||||
Fix superadmin not being removed when deopering
|
||||
Fix setting nickserv access list in webcpanel
|
||||
Add support for post-handshake SASL in Unreal 4.2.2+
|
||||
Add logging for channel memo deletionso
|
||||
Added a check for a non-deprecated encryption module on start.
|
||||
Added a way for protocol modules to report an error to the uplink.
|
||||
Added more account settings to the webcpanel.
|
||||
Added self-test functionality for all encryption modules.
|
||||
Added support for challenge authentication on InspIRCd.
|
||||
Added support for importing databases from Atheme.
|
||||
Added support for sending client tags on UnrealIRCd.
|
||||
Added support for the InspIRCd 1206 (v4) protocol.
|
||||
Added the --nopid option to disable writing a pid file.
|
||||
Added the enc_argon2 module to encrypt passwords with Argon2.
|
||||
Added the enc_sha2 module to encrypt passwords with HMAC-SHA-2.
|
||||
Added the global/queue command for queueing multi-line messages.
|
||||
Added the global/server command for sending messages to an individual server.
|
||||
Added the PASSWORD category to operserv/stats to view password encryption methods.
|
||||
Added the verify-only enc_posix module to validate passwords from Atheme that were encrypted with Argon2.
|
||||
Changed nickserv/drop to use confirmation codes to confirm a nickname drop.
|
||||
Changed various paths to be relative to the data and config directories.
|
||||
Converted some IRCDProto member functions to variables.
|
||||
Converted the enc_md5, enc_none, enc_old, enc_sha1, and enc_sha256 modules to be verify-only.
|
||||
Deduplicated page headers and footers in the webcpanel templates.
|
||||
Deprecated the enc_sha256 module.
|
||||
Fixed inconsistent spelling/casing of email, vhost, and vident.
|
||||
Fixed various bugs in the inspircd module.
|
||||
Improved portability of email sending.
|
||||
Improved protocol debug messages.
|
||||
Improved the performance and reliability of internal conversion logic.
|
||||
Improved the randomness of randomly generated numbers.
|
||||
Refactored the enc_bcrypt module and exposed it as an encryption context.
|
||||
Removed several duplicate translation strings.
|
||||
Replaced the custom MD5 implementation in enc_md5 with a vendored one.
|
||||
Replaced the custom SHA256 implementation in enc_sha256 with a vendored one.
|
||||
The ldap_authentication, ldap_oper, sql_authentication, sql_log, and sql_oper modules are now always enabled.
|
||||
|
||||
Anope Version 2.0.6
|
||||
Anope Version 2.1.3
|
||||
-------------------
|
||||
Log client IP for web clients running commands via webcpanel
|
||||
Fix log file path for the config file could not be opened log message
|
||||
Allow nickserv/group to be used via XMLRPC
|
||||
Fix logsearch without wildcards
|
||||
Support cidr exempts in m_dnsbl
|
||||
Add support for IPv6 dnsbls
|
||||
Add +u and +L channel modes for ircd-hybrid
|
||||
Set +x after hostserv/off on InspIRCd and UnrealIRCd
|
||||
Fix chanserv/mode not being able to set extbans
|
||||
Send CHGIDENT/CHGHOST on SVSLOGIN on InspIRCd
|
||||
Fix escaping replies from commands in webcpanel
|
||||
Enable require_oper for all opers added via operserv/oper
|
||||
Advertise SASL mechanisms to UnrealIRCd servers
|
||||
Added alternate command suggestions when a user runs an invalid command.
|
||||
Added support for the IRCv3 +draft/channel-context tag.
|
||||
Added support for the IRCv3 +draft/reply tag.
|
||||
Allow using more than one fingerprint in an oper block.
|
||||
Changed chanserv/drop to use confirmation codes to confirm a channel drop.
|
||||
Cleaned up more of the codebase to use Modern C++17.
|
||||
Enabled using more field limits sent by the IRC server instead of requiring the user to configure them.
|
||||
Fixed NickServ lying about the minimum password length.
|
||||
Fixed a crash when sending emails.
|
||||
Fixed bs_kick not using the correct kick message for automatic kicks.
|
||||
Increased the security of randomly generated confirmation codes.
|
||||
Removed the ns_access module and associated cs_secure and ns_secure options.
|
||||
Removed the ns_status module.
|
||||
Reworked how messages are sent in protocol modules to allow sending message tags.
|
||||
|
||||
Anope Version 2.0.5
|
||||
Anope Version 2.1.2
|
||||
-------------------
|
||||
Fix negative levels to not match users with negative access
|
||||
Fix memo sender to always be the account name of the sender
|
||||
Allow unregistered users to use the ChanServ seen command
|
||||
Fix secureops to not be enforced on operators with the chanserv/administration privilege
|
||||
Fix command name in HELP syntax messages to always be upper case
|
||||
Show unconfirmed nickname messages on registration in webcpanel
|
||||
Fix NickServ SET EMAIL to be executable via XMLRPC
|
||||
Fix OperServ USERLIST/CHANLIST to accept regexes
|
||||
Allow OperServ USERLIST to also match realname syntax (n!u@h#r)
|
||||
Fix db_old importing languages to use the UTF-8 version
|
||||
Fix m_dns to return REFUSED if no answers could be found
|
||||
Fix ns_maxemail to be case insensitive
|
||||
Add MemoServ READ ALL command
|
||||
Add support for NickServ GROUP to be executed via XMLRPC
|
||||
Add support for logging hostname/ip of SASL authentication attempts, if supported by IRCd
|
||||
Bumped the minimum OpenSSL version to 1.1.0.
|
||||
Bumped the minimum GnuTLS version to 3.0.0.
|
||||
Disabled SSLv3 support in the m_ssl_openssl module.
|
||||
Modernized mutex and thread code to use Modern C++.
|
||||
Normalised the program exit codes.
|
||||
Updated the Dutch translation.
|
||||
Updated the French translation.
|
||||
|
||||
Anope Version 2.0.4
|
||||
Anope Version 2.1.1
|
||||
-------------------
|
||||
Add notice rpc method to XMLRPC
|
||||
Fix access check in cs_updown to not allow actions on users with equal access
|
||||
Fix randomnews to work when there are more than 'newscount' random news
|
||||
Fix crash from handling nick introduction collisions on unreal4
|
||||
Add support for GCC6
|
||||
Fix handling /join 0 on ratbox
|
||||
Fix saset display to update the account of the proper user
|
||||
Fix nickserv/confirm to send account and +r when appropriate
|
||||
Fix chankill to not add duplicate akills
|
||||
Allow nickserv/maxemail to disregard gmail style aliases when comparing emails
|
||||
Fix chanserv/mode when setting listmodes with CIDR ranges
|
||||
Fix reported expiry time when the time is divisible by 1 year
|
||||
Clarify botserv repeat kicker help and allow setting repeat times to 1
|
||||
Send vident/vhost with SASL login
|
||||
Add support for SASL reauth
|
||||
Fix log and database backup directories to be properly created by the installer
|
||||
Added the UNBANME privilege to allow users to unban themselves.
|
||||
Fixed building on Windows systems without chgrp/chmod.
|
||||
Fixed creating sockets in the m_dns, m_httpd, m_proxyscan, and m_redis modules.
|
||||
Fixed reading the values of command line arguments.
|
||||
Moved core privilege descriptions to the example configs.
|
||||
Updated the Italian translation.
|
||||
Updated the Polish translation.
|
||||
|
||||
Anope Version 2.0.3
|
||||
Anope Version 2.1.0
|
||||
-------------------
|
||||
Add support for UnrealIRCd 4
|
||||
Fix cs_access to respect chanserv/access/list privilege
|
||||
Fix cs_access to match level -1 as every user, not any level <0
|
||||
Fix problems related to object destruction order when using db_sql_live
|
||||
Show memo notify settings in ms_info
|
||||
Fix some actions bumping channels last used time that shouldn't have
|
||||
Add maxlogins configuration directive to limit the number of concurrent logins to one account
|
||||
Fix race with auto svsnick on ghost sometimes causing nick collisions instead
|
||||
Fix saset language reply
|
||||
Show akill/sxlines ids in VIEW
|
||||
Fix crash when an oper is configured in both the configuration and via os_oper
|
||||
Fix m_ldap reconnect logic not properly setting protocol and network timeout settings
|
||||
Fix crash from unloading regex modules when regex xlines exist
|
||||
Fix irc2sql to store away messages
|
||||
Add notice method to m_xmlrpc_main
|
||||
Fix numerics on InspIRCd from being sent to user UID
|
||||
Fix usermode +I on UnrealIRCd to be considered oper only
|
||||
Fix crash in webcpanel when deleting your own access on a channel
|
||||
Fix webcpanel allowing suspended users to login
|
||||
Fix hs_off on InspIRCd to not desync active user host
|
||||
Fix bs_bot to not allow colliding bots into users
|
||||
Don't allow hostserv modules to load if there is no hostserv
|
||||
Fix ns_register allowing bot nicks to be registered through webcpanel
|
||||
Don't update chanserv keepmodes during inhabit
|
||||
Fix build on cmake 2.4
|
||||
Allow searching emails by wildcard in ns_getemail
|
||||
|
||||
Anope Version 2.0.2
|
||||
-------------------
|
||||
Fix keepmodes preventing the first user of a channel from being deopped
|
||||
Fix SQlines that don't begin with # from matching channels
|
||||
Made cs_clone behave like the help describes, copying many settings and lists by default
|
||||
Allow cs_clone to clone levels, too
|
||||
Update Hybrid protocol module for 8.2
|
||||
Fix not unescaping all characters sent over XMLRPC
|
||||
Fix crash when os_mode is used to destroy channels, like when unsetting permanent channel mode from an empty channel
|
||||
Allow users with topic change privilege to change the topic instead of requiring them to use ChanServ's topic command
|
||||
Fix negatively locking param modes in default mlock
|
||||
Change entrymsg to check for the SET privilege, not real founder
|
||||
Allow configuring characters allowed in nicknames
|
||||
Fix crash when non users register channels externally (like XMLRPC)
|
||||
Remove operserv/exception MOVE, it did not function correctly. Instead reorder the list by deleting/adding entries.
|
||||
Allow flood ttb to be 0.
|
||||
Enforce mlock when disabling defcon modes
|
||||
Fix cs_mode not being able to apply mlock on register
|
||||
Add log message when users send memos
|
||||
Fix old collide timers from staying around after successful identify. Fixes being able to identify and logout and still being hit by the old timers.
|
||||
Fix undefined behavior in cs_mode which usually crashes when clearing large list modes
|
||||
Show all opertypes in operserv/info, even if no opers use them
|
||||
|
||||
Anope Version 2.0.1
|
||||
-------------------
|
||||
Fix access entries on accounts sometimes not updating when a user's display name changes
|
||||
Fix ns_group to properly validate the account of the user against the target
|
||||
Fix os_stats not saving max user count and time when using SQL
|
||||
Fix nickalias's 'nc' field sometimes not being updated when using SQL
|
||||
Fix several crashes on Windows related to being unable to load modules
|
||||
Fix bs_bot change not properly reintroducing bots after changing their ident, host, or realname
|
||||
|
||||
Add English language file to allow users to easily modify language strings
|
||||
Add configuring which mode cs_ban sets, and added a MUTE command to BotServ's fantasy
|
||||
Allow SVSPART to take an optional reason
|
||||
Allow cs_list to search channel topics and descriptions
|
||||
|
||||
Anope Version 2.0.0
|
||||
-------------------
|
||||
Added irc2sql stats module
|
||||
|
||||
Anope Version 1.9.9
|
||||
-------------------
|
||||
A Added a better webpanel template, removed the old one
|
||||
A Added SQL logging support
|
||||
A Added Redis database support
|
||||
A Added ability to configure what privileges XOP commands give
|
||||
U Updated Dutch language file, from Robby <robby@chat.be>
|
||||
U Updated Spanish language file, from Isaac Fontal <i_fontal@hotmail.com>
|
||||
F Fix build on Solaris and OSX
|
||||
F Fixed setting BotServ's default settings in the config
|
||||
F Fixed some names of config items, including NickServ's kill protect
|
||||
|
||||
Anope Version 1.9.8
|
||||
-------------------
|
||||
A Ability to configure fantasy commands in the config
|
||||
A Add SVSJOIN and SVSPART commands
|
||||
F Fix "leave" channel log level from not logging
|
||||
F Fix users able to "resend" their registration mail with registration set to admin only
|
||||
F Fix build on OpenBSD
|
||||
F Fix not logging debug logs to the logfile when debug mode is enabled
|
||||
F Fix defcon timeout timer
|
||||
F Fix crash in os_forbid with expiring entries
|
||||
F Fix several issues with db_sql_live
|
||||
|
||||
Anope Version 1.9.7
|
||||
-------------------
|
||||
A Added ability for using regex as patterns for various commands
|
||||
A Extended ability of operserv/akill to also match against nick and realname
|
||||
A Added chanserv:require configuration option
|
||||
A Added nickserv:unregistered_notice and nickserv:registration configuration option
|
||||
A Added options:casemap configuration option
|
||||
A Added a web panel
|
||||
A db_sql_live now allows all tables to be "live", not just a select few
|
||||
|
||||
Anope Version 1.9.6
|
||||
-------------------
|
||||
A Added ability to configure emails sent by services
|
||||
A Added chanserv/up and chanserv/down
|
||||
A Added m_proxyscan
|
||||
A Added more configurability for what vhosts are valid
|
||||
A Added chanserv/log
|
||||
A Added ability to configure ChanServ privileges
|
||||
A Added a new database format
|
||||
A Added SQLite support
|
||||
A Added more verbose messages on startup
|
||||
A Added ability for chanserv/suspend and nickserv/suspend to take an expiry time
|
||||
A Added no nickname ownership config option
|
||||
A Added m_rewrite
|
||||
A Added akill IDs
|
||||
F Fixed crash in clearusers
|
||||
F Fixed crash in /os oper info
|
||||
F Fixed eventfd Config check to work properly on OpenVZ
|
||||
|
||||
Anope Version 1.9.5
|
||||
-------------------
|
||||
A Extended LDAP support
|
||||
A Added os_oper, os_kill, os_forbid, m_statusupdate, cs_sync, and bs_autoassign
|
||||
A Added a new configuration file format
|
||||
A Added a new commands system
|
||||
A Added a new access system, and cs_flags
|
||||
F Fixed not logging debug logs to file
|
||||
F Fixed the mail delay time
|
||||
F Fixed sending account data for unconfirmed nicks
|
||||
F Fixed poll() engine build on FreeBSD
|
||||
F Fixed really large HELP replies being truncated
|
||||
F Fixed sometimes appending !*@* to valid hosts on access lists
|
||||
F Fixed m_ssl sometimes failing connecting for no reason
|
||||
F Fixed crash in cs_entrymsg
|
||||
F Fixed setting -P on channels with only a botserv bot in it
|
||||
F Fixed modemanager complaining about prefixless modes on InspIRCd
|
||||
|
||||
Anope Version 1.9.4
|
||||
-------------------
|
||||
A Automatically set channel founder to the user with the highest access if there is no successor
|
||||
A /chanserv clone command to copy settings from one channel to another.
|
||||
A /chanserv mode command
|
||||
A Ability for users to delete their own access in channels
|
||||
A Added support for Plexus 3
|
||||
A Readded in support for /cs op/deop/etc to op/deop you in all channels
|
||||
A Added LDAP support
|
||||
A Added live SQL support
|
||||
A Added support for learning tracking/storing/locking all modes at runtime
|
||||
A Added m_alias
|
||||
A Added support for XMLRPC queries
|
||||
A Added /botserv set msg
|
||||
A Added /operserv config
|
||||
A Added /ns cert
|
||||
A Added /operserv login
|
||||
F Changed the GHOST command to not allow ghosting unidentified users if the RECOVER command exists
|
||||
F Some failed logic in /operserv exception that prevents proper exceptions from being added
|
||||
F Fixed the anope_os_sxlines MySQL table and code to work after restarting
|
||||
|
||||
Anope Version 1.9.3
|
||||
-------------------
|
||||
A Added italics BotServ kicks support
|
||||
A Tell users when their nicks expire in /ns glist and /ns info
|
||||
A Added SSL support
|
||||
A Prevent negative 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 unloadable, 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 database
|
||||
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 disabled
|
||||
|
||||
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 different encryptions
|
||||
A Added configuration options to allow Anope to reconnect if it disconnects from the uplink instead of dying
|
||||
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 identified 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.
|
||||
Added support for access list entry descriptions.
|
||||
Added support for linking over a UNIX socket.
|
||||
Added support for server-initiated logins and logouts on UnrealIRCd.
|
||||
Added support for server-initiated logouts on InspIRCd.
|
||||
Added support for the ANONYMOUS SASL mechanism.
|
||||
Allowed users to opt-out of being added to channel access lists.
|
||||
Cleaned up the codebase to use Modern C++17.
|
||||
Modernized the build system to use a modern version of CMake.
|
||||
Removed support for using insecure encryption methods as the primary method.
|
||||
Removed the Windows-only anopesmtp tool.
|
||||
Removed the two day X-line cap.
|
||||
Updated all references to IRCServices to refer to Anope instead.
|
||||
|
||||
+117
-214
@@ -1,244 +1,147 @@
|
||||
Anope Version 2.0.18-git
|
||||
Anope Version 2.1.14-git
|
||||
------------------------
|
||||
No significant changes.
|
||||
Added oper:password_hash.
|
||||
Added options:codelength (defaults to 15).
|
||||
Added {os_news}:showdate (defaults to yes).
|
||||
Added {sql_authentication}:password_field (defaults to "password").
|
||||
Added {sql_authentication}:password_hash.
|
||||
Changed the default value for options:linelength to "100".
|
||||
Changed the default value for {enc_sha2}:algorithm to "sha512".
|
||||
Changed the default value for {ns_seen}:purgetime to "90d".
|
||||
Changed the syntax for template variables in mail:emailchange_message, mail:emailchange_subject, mail:memo_message, mail:memo_subject, mail:registration_message, mail:registration_subject,, mail:reset_message, mail:reset_subject, {chanserv}:signkickformat, {dnsbl}:blacklist:reason, {ldap_authentication}:search_filter, {ldap_oper}:binddn, {ldap_oper}:search_filter, {nickserv}:unregistered_notice, {os_session}:sessionlimitexceeded, {proxyscan}:proxyscan:reason.
|
||||
|
||||
Anope Version 2.0.17
|
||||
Anope Version 2.1.13
|
||||
--------------------
|
||||
No significant changes.
|
||||
Added options:linelength (defaults to 120).
|
||||
Added the db_json module.
|
||||
Added the rpc_message module.
|
||||
Added {nickserv}:defaultprotect (defaults to 1m).
|
||||
Added {nickserv}:maxprotect (defaults to 10m).
|
||||
Added {nickserv}:minprotect (defaults to 10s)
|
||||
Added {xmlrpc}:enable_i8 (defaults to yes).
|
||||
Added {xmlrpc}:enable_nil (defaults to yes).
|
||||
Changed the syntax for using defines (all existing defines will need to be updated).
|
||||
Removed {nickserv}:kill (replaced by custom protection timer durations).
|
||||
Removed {nickserv}:killquick (replaced by custom protection timer durations).
|
||||
Removed {ns_set_kill}:allowkillimmed (replaced by custom protection timer durations).
|
||||
Renamed the nickserv/saset/kill command to nickserv/saset/protect.
|
||||
Renamed the nickserv/saset/kill oper privilege to nickserv/saset/protect.
|
||||
Renamed the nickserv/set/kill command to nickserv/set/protect.
|
||||
Renamed the ns_set_kill module to ns_set_protect.
|
||||
Renamed the sasl module to ns_sasl and moved it to nickserv.example.conf.
|
||||
|
||||
Anope Version 2.0.16
|
||||
Anope Version 2.1.12
|
||||
--------------------
|
||||
No significant changes.
|
||||
Added the jsonrpc module.
|
||||
Added the rpc_data module.
|
||||
Added the rpc_system module.
|
||||
Added {hostserv}:activate_on_deoper (defaults to yes).
|
||||
Added {os_shutdown}:requirename (defaults to yes).
|
||||
Moved nickserv/set/keepmodes and nickserv/saset/keepmodes to the ns_set_keepmodes module.
|
||||
Moved the xmlrpc module to extra.
|
||||
Renamed the xmlrpc_main module to rpc_main.
|
||||
|
||||
Anope Version 2.0.15
|
||||
Anope Version 2.1.11
|
||||
--------------------
|
||||
No significant changes.
|
||||
Moved nickserv/set/kill and nickserv/saset/kill to the ns_set_kill module.
|
||||
Moved {ns_set}:allowkillimmed to {ns_set_kill}:allowkillimmed.
|
||||
Replaced {nickserv}:guestnickprefix with {nickserv}:guestnick (defaults to Guest####).
|
||||
|
||||
Anope Version 2.0.14
|
||||
Anope Version 2.1.10
|
||||
--------------------
|
||||
Added mail:content_type to allow customizing the content type of emails.
|
||||
Added options:servicealias (defaults to no)
|
||||
Moved nickserv/set/message and nickserv/saset/message to the ns_set_message module.
|
||||
Removed options:useprivmsg (replaced by loading the ns_set_message module to enable).
|
||||
Removed options:usestrictprivmsg (feature unusable on modern servers, consider migrating to options:servicealias instead).
|
||||
|
||||
Anope Version 2.0.13
|
||||
--------------------
|
||||
No significant changes.
|
||||
|
||||
Anope Version 2.0.12
|
||||
--------------------
|
||||
Added the regex_pcre2 module
|
||||
|
||||
Anope Version 2.0.11
|
||||
--------------------
|
||||
No significant changes.
|
||||
|
||||
Anope Version 2.0.10
|
||||
--------------------
|
||||
No significant changes.
|
||||
|
||||
Anope Version 2.0.9
|
||||
Anope Version 2.1.9
|
||||
-------------------
|
||||
No significant changes.
|
||||
|
||||
Anope Version 2.0.8
|
||||
Anope Version 2.1.8
|
||||
-------------------
|
||||
Fix ns_register:unconfirmedexpire not being used
|
||||
Added the nickserv/drop/display oper privilege.
|
||||
Added {nickserv}:preservedisplay (defaults to no).
|
||||
|
||||
Anope Version 2.0.7
|
||||
Anope Version 2.1.7
|
||||
-------------------
|
||||
Add nickserv/recover permission
|
||||
Add inspircd3 protocol module
|
||||
Add default permission for chanstats saset chanstats command
|
||||
Moved nickserv/set/language and nickserv/saset/language to the ns_set_language module.
|
||||
Renamed the FANTASIA channel privilege to FANTASY.
|
||||
Renamed {cs_suspend}:expire to {cs_suspend}:suspendexpire.
|
||||
|
||||
Anope Version 2.0.6
|
||||
Anope Version 2.1.6
|
||||
-------------------
|
||||
Mark enc_md5 and enc_sha1 as deprecated. Their use has been discouraged for years, and they will be removed in a future release.
|
||||
Exempt all of 127.0.0.0/8 from m_dnsbl by default
|
||||
Load m_sasl by default
|
||||
Fix documentation for nickserv default option ns_keep_modes
|
||||
Added {ns_cert}:automatic (defaults to yes).
|
||||
Removed {hybrid,inspircd,solanum,unrealircd}:use_server_side_mlock (now always enabled).
|
||||
Removed {inspircd}:use_server_side_topiclock (now always enabled).
|
||||
|
||||
Anope Version 2.0.5
|
||||
Anope Version 2.1.5
|
||||
-------------------
|
||||
No significant changes.
|
||||
Added the nickserv/drop/override and chanserv/drop/override oper privileges.
|
||||
|
||||
Anope Version 2.0.4
|
||||
Anope Version 2.1.4
|
||||
-------------------
|
||||
Removed m_sasl_dh-aes and m_sasl_dh-blowfish
|
||||
Added the db_atheme module.
|
||||
Added the enc_argon2 module.
|
||||
Added the enc_posix module.
|
||||
Added the enc_sha2 module.
|
||||
Added the gl_queue module.
|
||||
Added the gl_server module.
|
||||
Added the global/queue oper privilege.
|
||||
Added the global/server oper privilege.
|
||||
Changed serverinfo:motd to be relative to the config directory.
|
||||
Changed serverinfo:pid to be relative to the data directory.
|
||||
Changed the default value of mail:sendmailpath to "/usr/sbin/sendmail -it".
|
||||
Changed the default value of {chanserv}:accessmax to 1000.
|
||||
Changed the default value of {chanserv}:inhabit to 1 minute.
|
||||
Changed the default value of {cs_mode}:max to 50.
|
||||
Changed the default value of {ms_ignore}:max to 50.
|
||||
Removed options:seed (not needed with modern random number generation).
|
||||
Replaced {webcpanel}:template with {webcpanel}:template_dir (defaults to webcpanel/templates/default).
|
||||
|
||||
Anope Version 2.0.3
|
||||
Anope Version 2.1.3
|
||||
-------------------
|
||||
Add operserv/chankill to default globops log
|
||||
Add ns_identify:maxlogins to limit the max number of concurrent logins per account
|
||||
Document ns_no_expire nickserv default
|
||||
Remove default session exception expiry time
|
||||
Added options:didyoumeandifference (defaults to 4).
|
||||
Added support for multiple SSL fingerprints in oper:certfp.
|
||||
Added the chanserv/cert oper privilege for modifying other user's certificate lists.
|
||||
Changed networkinfo:chanlen to default to 32 if not set.
|
||||
Changed networkinfo:hostlen to default to 64 if not set.
|
||||
Changed networkinfo:modelistsize to default to 100 if not set.
|
||||
Changed networkinfo:nicklen to default to 31 if not set.
|
||||
Changed networkinfo:userlen to default to 10 if not set.
|
||||
Increased the default maximum password length to 50 characters.
|
||||
Increased the default minimum password length to 10 characters.
|
||||
Removed the cs_secure option in {chanserv}:defaults (now always enabled as support for nick access lists has been removed).
|
||||
Removed the nickserv/saset/secure command (support for nick access lists has been removed).
|
||||
Removed the nickserv/saset/secure oper privilege (support for nick access lists has been removed).
|
||||
Removed the nickserv/set/secure command (support for nick access lists has been removed).
|
||||
Removed the nickserv/status command (obsolete with modern IRCv3 extensions and the removal of nick access lists).
|
||||
Removed the ns_access module (support for nick access lists has been removed).
|
||||
Removed the ns_secure option in {nickserv}:defaults (now always enabled as support for nick access lists has been removed).
|
||||
|
||||
Anope Version 2.0.2
|
||||
Anope Version 2.1.2
|
||||
-------------------
|
||||
Add an operserv/oper/modify privilege, required to use oper add and oper del
|
||||
Add a chanserv/access/list privilege, which allow readonly access to ChanServ access and akick lists
|
||||
Changed m_dnsbl's result configuration to be more extensible
|
||||
Add 'max' setting to cs_mode
|
||||
Add 'nickchars' setting to networkinfo
|
||||
Add 'botserv/fantasy', 'chanserv/access/list', and 'operserv/oper/modify' oper privileges
|
||||
Fix 'emailchange_message' to include the proper email address
|
||||
Set a default permission on operserv/defcon
|
||||
Added {ssl_openssl}:tlsv10 for configuring whether TLSv1.0 is usable (defaults to no).
|
||||
Added {ssl_openssl}:tlsv11 for configuring whether TLSv1.1 is usable (defaults to yes).
|
||||
Added {ssl_openssl}:tlsv12 for configuring whether TLSv1.2 is usable (defaults to yes).
|
||||
Removed the m_ prefix from the names of the chanstats, dns, dnsbl, helpchan, httpd, ldap, ldap_oper, mysql, proxyscan, redis, regex_pcre2, regex_posix, regex_stdlib, regex_tre, rewrite, sasl, sql_log, sql_oper, sqlite, ssl_gnutls, ssl_openssl, xmlrpc, and xmlrpc_main modules.
|
||||
Removed {ssl_openssl}:sslv3 (now always disabled).
|
||||
|
||||
Anope Version 2.0.1
|
||||
Anope Version 2.1.1
|
||||
-------------------
|
||||
Add MUTE command to BotServ fantasy configuration
|
||||
Document memo_mail option in nickserv.conf
|
||||
Add 'show' setting to ns_info and cs_info to control which fields are shown to non opers
|
||||
Added the m_regex_stdlib module.
|
||||
Removed the m_regex_pcre module (use m_regex_pcre2 instead).
|
||||
|
||||
Anope Version 2.0.0
|
||||
Anope Version 2.1.0
|
||||
-------------------
|
||||
options:passlen, enforceruser, enforcerhost, releasetimeout, and guestnickprefix moved to nickserv's module configuration
|
||||
options:hideregisteredcommands added
|
||||
m_ssl renamed to m_ssl_openssl
|
||||
mail:restrict removed
|
||||
|
||||
Anope Version 1.9.9
|
||||
-------------------
|
||||
There is not many config changes between 1.9.8 and 1.9.9, however many of the
|
||||
options have been moved around to make more sense, too many to list here,
|
||||
so get a new config.
|
||||
|
||||
Anope Version 1.9.8
|
||||
-------------------
|
||||
networkinfo:chanlen added
|
||||
options:user and options:group added
|
||||
nickserv:modesonid added to set modes on everyone who identifies
|
||||
nickserv:kill and nickserv:killquick added to configure NickServ's kill timeout
|
||||
nickserv:restoreonrecover added to try to restore a user's session after a ghost
|
||||
command:group added
|
||||
fantasy block added
|
||||
dns block has been moved to modules.conf as a part of m_dns
|
||||
|
||||
Anope Version 1.9.7
|
||||
-------------------
|
||||
operserv:notifications removed in favor of log{} blocks
|
||||
options:regexengine added
|
||||
options:casemap added
|
||||
chanserv:require added
|
||||
nickserv:registration added, emailregistration removed.
|
||||
nickserv:unregistered_notice added
|
||||
|
||||
Anope Version 1.9.6
|
||||
-------------------
|
||||
service:channels added to join services to channels
|
||||
mail block modified to allow configuring of email messages
|
||||
oper:host and oper:vhost added
|
||||
oper:require_oper added
|
||||
options:nonicknameownership added
|
||||
operserv:akillids added
|
||||
nickserv/access oper privilege added
|
||||
|
||||
Anope Version 1.9.5
|
||||
-------------------
|
||||
Don't even try it, get a new config and start over.
|
||||
|
||||
Anope Version 1.9.4
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
memoserv:modules added ms_ignore
|
||||
chanserv:modules added cs_clone and cs_mode
|
||||
nickserv:suspendexpire and nickserv:forbidexpire added
|
||||
chanserv:suspendexpire and chanserv:forbidexpire added
|
||||
module added cs_entrymsg
|
||||
nickserv:modules added ns_ajoin, ns_cert
|
||||
options:nomlock added
|
||||
log:target added globops
|
||||
nickserv:confirmemailchanges added
|
||||
operserv:modules added os_config, os_login
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
operserv:notifications removed osglobal, osmode, oskick, osakill, ossnline, ossqline, osszline, osnoop, osjupe, getpass, setpass, forbid, drop
|
||||
renamed nickserv:preregexpire to nickserv:unconfirmedexpire
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
opertype:commands removed operserv/umode
|
||||
operserv:modules removed os_umode
|
||||
|
||||
Anope Version 1.9.3
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
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 maximum 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.
|
||||
Added nickserv:minpasslen for configuring the minimum password length (defaults to 8).
|
||||
Removed nickserv:strictpasswords (obsolete now nickserv:minpasslen exists).
|
||||
Removed the inspircd12 and inspircd20 modules (use inspircd instead).
|
||||
Removed the ns_getpass module (no supported encryption modules).
|
||||
Removed the os_oline module (no supported IRCds).
|
||||
Removed the unreal module (use unrealircd instead).
|
||||
Renamed nickserv:passlen to nickserv:maxpasslen.
|
||||
Renamed the charybdis module to solanum.
|
||||
Renamed the inspircd3 module to inspircd.
|
||||
Renamed the unreal4 module to unrealircd.
|
||||
Replaced uplink:ipv6 with uplink:protocol (defaults to ipv4).
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@ Anope DefCon
|
||||
|
||||
1) Introduction
|
||||
|
||||
Anope 1.6 onwards supports a unique protection mechanism based on the
|
||||
Anope supports a unique protection mechanism based on the
|
||||
military "Defense Readiness Condition" (DefCon) system. It is based on
|
||||
5 levels of defense readiness defined as:
|
||||
|
||||
@@ -23,7 +23,7 @@ Anope DefCon
|
||||
These are configurable levels that mandates what actions Anope should
|
||||
take in case of emergency and change in readiness status.
|
||||
|
||||
It is used to prevent abuse to both Services, and the ircd on which they
|
||||
It is used to prevent abuse to both Anope, and the IRCd on which they
|
||||
are running. Also to protect the users, primarily in the event of Clones
|
||||
and/or FloodBOT attacks.
|
||||
|
||||
@@ -50,8 +50,8 @@ Anope DefCon
|
||||
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
|
||||
Ignore everyone but opers
|
||||
Silently ignore everyone but opers
|
||||
AKILL all new clients trying to connect
|
||||
No new memos sent to block MemoServ attacks
|
||||
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
Anope Internal Events
|
||||
---------------------
|
||||
|
||||
1) Intro
|
||||
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.
|
||||
|
||||
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) Using Events
|
||||
|
||||
Each Event in Anope calls a function.
|
||||
You must override these functions in your main modules class.
|
||||
The full list of functions and parameters are in modules.h. In this
|
||||
case, you would be overriding OnJoinChannel() and OnPartChannel() like so:
|
||||
|
||||
void OnJoinChannel(User *u, Channel *c) anope_override { }
|
||||
void OnPartChannel(User *u, Channel *c) anope_override { }
|
||||
|
||||
Some of these event overrides can be used to prevent or allow things to
|
||||
happen that would normally not be allowed or denied. You can also use
|
||||
ModuleManager (not explained here) to set control which order the modules
|
||||
are queried (when multiple modules hook to the same event).
|
||||
|
||||
The "anope_override" identifier is for compatibility with C++11.
|
||||
Its usage is highly recommended.
|
||||
+14
-14
@@ -27,7 +27,7 @@ Note: You should also read the README and FAQ files!
|
||||
cmake --version
|
||||
|
||||
If it's installed, you will get a line that says something similar to
|
||||
"cmake version 2.8.12.2". If the version is less than 2.4 or you get
|
||||
"cmake version 3.28.3". If the version is less than 3.20.0 or you get
|
||||
an error saying the command was not found, you will not be able to use
|
||||
CMake unless you install it yourself into your home directory. CMake
|
||||
can be downloaded from:
|
||||
@@ -37,7 +37,7 @@ Note: You should also read the README and FAQ files!
|
||||
Next, unpack the package in your home directory, and go into the created
|
||||
directory.
|
||||
|
||||
If there are any extra modules you want to enable, such as m_mysql, run
|
||||
If there are any extra modules you want to enable, such as mysql, run
|
||||
the 'extras' script to enable them. If you do not know you can come back
|
||||
later and enable them.
|
||||
|
||||
@@ -52,8 +52,8 @@ Note: You should also read the README and FAQ files!
|
||||
cause trouble on your network if passwords are not encrypted, or read
|
||||
the memos of any user.
|
||||
|
||||
Now go into the conf directory (by default, ~/services/conf). Copy the example
|
||||
configuration file (example.conf) to services.conf, and open the latter
|
||||
Now go into the conf directory (by default, ~/anope/conf). Copy the example
|
||||
configuration file (anope.example.conf) to anope.conf, and open the latter
|
||||
with your favorite text editor. It contains all the configuration
|
||||
directives Anope will use at startup. Read the instructions contained in
|
||||
the file carefully. Using the default values is NOT a good idea, and will
|
||||
@@ -71,11 +71,11 @@ Note: You should also read the README and FAQ files!
|
||||
|
||||
* IMPORTANT: Back up your old databases!
|
||||
* If you are upgrading to a new major release, ALWAYS restart a
|
||||
fresh configuration file from example.conf.
|
||||
fresh configuration file from anope.example.conf.
|
||||
|
||||
3) Setting up the IRCd
|
||||
|
||||
Services acts as an IRC server with pseudo-clients on it. To link them to
|
||||
Anope acts as an IRC server with pseudo-clients on it. To link them to
|
||||
your network, you'll need to configure your IRCd to allow services to link.
|
||||
|
||||
The configuration varies depending on the IRCd, but you will probably need
|
||||
@@ -83,7 +83,7 @@ Note: You should also read the README and FAQ files!
|
||||
a shared block), and be sure that the IRCd is listening on the given port
|
||||
in the link block.
|
||||
|
||||
Example link configurations can be found in example.conf for some of the
|
||||
Example link configurations can be found in anope.example.conf for some of the
|
||||
popular IRCds.
|
||||
|
||||
Don't forget to /rehash your IRCd to apply changes.
|
||||
@@ -91,16 +91,16 @@ Note: You should also read the README and FAQ files!
|
||||
4) Starting Anope
|
||||
|
||||
Go into the directory where binaries were installed (by default, this is
|
||||
~/services/bin). Type ./services to launch Anope.
|
||||
~/anope/bin). Type ./anope 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.
|
||||
A successful startup won't generate any message.
|
||||
|
||||
Give Services at least one minute to link to your network, as certain
|
||||
Give Anope at least one minute to link to your network, as certain
|
||||
IRCds on some OSes may be really slow for the link process. If nothing
|
||||
happens after about a minute, it is probably a configuration problem. Try
|
||||
to launch Anope with ./services -debug -nofork to see any errors that it
|
||||
to launch Anope with ./anope -debug -nofork to see any errors that it
|
||||
encounters, and try to correct them.
|
||||
|
||||
If you need help to solve errors, feel free to subscribe to the Anope
|
||||
@@ -111,17 +111,17 @@ Note: You should also read the README and FAQ files!
|
||||
A crontab entry will allow you to check periodically whether Anope is
|
||||
still running, and restart it if not.
|
||||
|
||||
First rename the example.chk script that is in Anope path (by default,
|
||||
this is ~/services/conf) to services.chk and edit it. You'll need to
|
||||
First rename the cron.example.sh script that is in Anope path (by default,
|
||||
this is ~/anope/conf) to cron.sh 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
|
||||
marked as executable by typing chmod +x cron.sh, 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/conf/services.chk >/dev/null 2>&1
|
||||
*/5 * * * * /home/ircd/anope/conf/cron.sh >/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
|
||||
|
||||
+15
-15
@@ -27,7 +27,7 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
cmake --version
|
||||
|
||||
Si CMake est installé, vous aurez une ligne qui dit quelque chose comme
|
||||
"cmake version 2.8.12.2". Si la version est inférieure à 2.4 ou si vous
|
||||
"cmake version 3.28.3". Si la version est inférieure à 3.20.0 ou si vous
|
||||
obtenez une erreur disant que la commande n'a pas été trouvée, vous ne
|
||||
pourrez pas utiliser CMake à moins de l'installer vous-même dans votre
|
||||
répertoire home. CMake peut être téléchargé ici :
|
||||
@@ -37,7 +37,7 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
Ensuite, décompressez le package dans votre répertoire home, et allez
|
||||
dans le répértoire qui vient d'être créé.
|
||||
|
||||
Si il y a des modules facultatifs que vous voulez activer comme m_mysql,
|
||||
Si il y a des modules facultatifs que vous voulez activer comme mysql,
|
||||
exécuter le script 'extras' pour les activer. Si vous ne savez pas, vous
|
||||
pouvez les activer plus tard.
|
||||
|
||||
@@ -49,15 +49,15 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
Allez dans le dossier build (cd build) et tapez make et make install.
|
||||
Ceci va installer tous les fichiers nécessaires dans les dossiers que
|
||||
vous avez indiqués avec le script Config et régler les permissions des
|
||||
fichiers. Vous devez vous assurer que le répertoire data n'est pas
|
||||
fichiers. Vous devez vous assurer que le répertoire data n'est pas
|
||||
accessible par les autres utilisateurs, car des utilisateurs
|
||||
malveillants pourraient causer des problèmes sur votre réseau, si les
|
||||
mots de passe ne sont pas chiffrés, ou lire les mémos de tous les
|
||||
utilisateurs.
|
||||
|
||||
Allez maintenant dans le répertoire conf (par défaut, ~/services/conf).
|
||||
Copiez l'exemple de fichier de configuration (example.conf) en
|
||||
services.conf et ouvrez ce dernier avec votre éditeur de texte favori.
|
||||
Allez maintenant dans le répertoire conf (par défaut, ~/anope/conf).
|
||||
Copiez l'exemple de fichier de configuration (anope.example.conf) en
|
||||
anope.conf et ouvrez ce dernier avec votre éditeur de texte favori.
|
||||
Il contient toutes les directives de configuration qu'Anope va utiliser
|
||||
en démarrant. Lisez attentivement les instructions contenues dans le
|
||||
fichier. L'utilisation des valeurs par défaut n'est pas toujours
|
||||
@@ -78,11 +78,11 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
* IMPORTANT : Sauvegardez vos anciennes bases de données !
|
||||
* Si vous mettez à jour vers une nouvelle version majeure,
|
||||
recommencez *toujours* toute votre configuration à partir du
|
||||
fichier example.conf.
|
||||
fichier anope.example.conf.
|
||||
|
||||
3) Configuration de l'IRCd
|
||||
|
||||
Les Services agissent comme un serveur IRC avec des pseudo-clients.
|
||||
Anope agit comme un serveur IRC avec des pseudo-clients.
|
||||
Pour les relier à votre réseau, vous aurez besoin de configurer votre
|
||||
IRCd pour permettre aux services de se connecter.
|
||||
|
||||
@@ -92,14 +92,14 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
sur le port donné dans le bloc link.
|
||||
|
||||
Des exemples de configurations de bloc link peuvent être trouvés dans
|
||||
le fichier example.conf pour certains des IRCd les plus populaires.
|
||||
le fichier anope.example.conf pour certains des IRCd les plus populaires.
|
||||
|
||||
Souvenez-vous de /rehash votre IRCd pour appliquer les changements.
|
||||
|
||||
4) Mettre en route Anope
|
||||
|
||||
Allez dans le répertoire où les fichiers binaires ont été installés
|
||||
(par défaut, ~/services/bin). Tapez ./services pour lancer Anope.
|
||||
(par défaut, ~/anope/bin). Tapez ./anope pour lancer Anope.
|
||||
|
||||
S'il y a des erreurs de syntaxe dans le fichier de configuration, elles
|
||||
seront affichées à l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait
|
||||
@@ -109,7 +109,7 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
réseau, car certains IRCds sur certains systèmes peuvent être très
|
||||
lents pour le processus de liaison. Si rien ne se passe après environ
|
||||
une minute, il y a probablement un problème de configuration. Essayez
|
||||
de lancer Anope en mode debug avec ./services -debug -nofork pour voir
|
||||
de lancer Anope en mode debug avec ./anope -debug -nofork pour voir
|
||||
toutes les erreurs rencontrées et essayez de les corriger.
|
||||
|
||||
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à
|
||||
@@ -121,11 +121,11 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
Une entrée crontab vous permettra de vérifier périodiquement si Anope
|
||||
est toujours en cours d'exécution et de le redémarrer s'il n'est pas.
|
||||
|
||||
D'abord renommez le script example.chk qui est dans les dossiers
|
||||
d'Anope (par défaut, ~/services/conf) en services.chk et modifiez-le.
|
||||
D'abord renommez le script cron.example.sh qui est dans les dossiers
|
||||
d'Anope (par défaut, ~/anope/conf) en cron.sh et modifiez-le.
|
||||
Vous aurez besoin de modifier la partie CONFIGURATION du fichier.
|
||||
Assurez-vous ensuite que le fichier est marqué comme exécutable en
|
||||
tapant chmod +x services.chk et essayez de lancer le script pour voir
|
||||
tapant chmod +x cron.sh et essayez de lancer le script pour voir
|
||||
si cela fonctionne (Anope ne doit pas être en marche lorsque vous
|
||||
testez cela ;))
|
||||
|
||||
@@ -133,7 +133,7 @@ Note : Vous devrez également lire les fichiers README et FAQ !
|
||||
crontab -e. Cela va ouvrir l'éditeur de texte par défaut avec le
|
||||
fichier crontab. Entrez la ligne suivante (avec le chemin correct) :
|
||||
|
||||
*/5 * * * * /home/ircd/services/conf/services.chk > /dev/null 2>&1
|
||||
*/5 * * * * /home/ircd/anope/conf/cron.sh > /dev/null 2>&1
|
||||
|
||||
Le */5 au début signifie "vérifier toutes les 5 minutes". Vous pouvez
|
||||
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ Anope Multi Language Support
|
||||
Anope uses gettext (https://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.
|
||||
translating. Once you are done simply rerun ./Config; make && make install and add the language to your anope.conf.
|
||||
Note that on Windows it is not quite this simple, windows.cpp must be edited and Anope recompiled and restarted.
|
||||
|
||||
Poedit (https://poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@ Anope Modules
|
||||
|
||||
1) Introduction
|
||||
|
||||
Anope 1.6 onwards supports external modules. External modules are pieces
|
||||
Anope supports external modules. External modules are pieces
|
||||
of code that can be attached to a running Anope process dynamically. These
|
||||
modules can serve several purposes, and perform all kind of operations to
|
||||
enhance your network.
|
||||
@@ -22,7 +22,7 @@ Anope Modules
|
||||
1. If modules are supported by your system, they will be configured
|
||||
automatically when you run ./Config. The modules will be installed
|
||||
to the modules directory in your data path (by default this will
|
||||
be ~/services/data/modules).
|
||||
be ~/anope/data/modules).
|
||||
|
||||
2. Compile Anope as usual using ./Config. The "make" process will now
|
||||
compile module support into Anope, and compile the default sample
|
||||
@@ -98,7 +98,7 @@ Anope Modules
|
||||
1. Make sure you're in the main source directory. (usually anope-1.X.XX/)
|
||||
2. Run ./Config to find and configure modules, then `cd build`.
|
||||
3. Run `make` to compile Anope, and any modules.
|
||||
4. Run `make install` to copy the compiled binaries to the ~/services/
|
||||
4. Run `make install` to copy the compiled binaries to the ~/anope/
|
||||
directory.
|
||||
|
||||
You can now use /msg OperServ MODLOAD to load the new modules.
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
Highlighted News in Anope 1.9
|
||||
=============================
|
||||
|
||||
* Added in live updating SQL and the ability to execute commands through SQL
|
||||
* Re-designed configuration file
|
||||
* Code refresh / rewrite into C++
|
||||
+8
-8
@@ -1,7 +1,7 @@
|
||||
Anope -- a set of IRC services for IRC networks
|
||||
-----------------------------------------------
|
||||
|
||||
Anope is 2003-2024 Anope Team <team@anope.org>.
|
||||
Anope is 2003-2025 Anope Team <team@anope.org>.
|
||||
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
|
||||
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
|
||||
|
||||
@@ -120,7 +120,7 @@ Table of Contents
|
||||
|
||||
2) Presentation
|
||||
|
||||
Anope is a set of Services for IRC networks that allows users to manage
|
||||
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.
|
||||
|
||||
@@ -166,14 +166,14 @@ Table of Contents
|
||||
|
||||
Anope currently works with:
|
||||
|
||||
* Bahamut 1.4.27 or later (including 1.8)
|
||||
* Charybdis 3.4 or later
|
||||
* Bahamut 2.0 or later
|
||||
* InspIRCd 3 or later
|
||||
* ircd-hybrid 8.2.23 or later
|
||||
* InspIRCd 1.2 or later
|
||||
* ircd-ratbox 3 or later
|
||||
* ngIRCd 19.2 or later
|
||||
* Plexus 3 or later
|
||||
* Ratbox 2.0.6 or later
|
||||
* UnrealIRCd 3.2 or later
|
||||
* Solanum (all versions)
|
||||
* UnrealIRCd 6 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.
|
||||
@@ -225,7 +225,7 @@ Table of Contents
|
||||
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.)
|
||||
debugging while Anope 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,
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
Starting in Anope 1.9.9, Anope has Redis database support (https://redis.io/).
|
||||
Anope has Redis database support (https://redis.io/).
|
||||
This document explains the data structure used by Anope, and explains how
|
||||
keyspace notification works.
|
||||
|
||||
@@ -149,12 +149,12 @@ Table of Contents
|
||||
Which returns a new object ID for me, in this example it will be "8".
|
||||
Now I can create the object:
|
||||
|
||||
HMSET hash:BotInfo:8 nick redis user redis host services.anope.org realname "Services for IRC Networks"
|
||||
HMSET hash:BotInfo:8 nick redis user redis host services.anope.org realname "Anope IRC Services"
|
||||
|
||||
Note if you are using HSET instead of HMSET you will need to use a transaction, as shown in the above example.
|
||||
If you are watching your services logs you will immediately see:
|
||||
|
||||
USERS: redis!redis@services.anope.org (Services for IRC Networks) connected to the network (services.anope.org)
|
||||
USERS: redis!redis@services.anope.org (Anope IRC Services) connected to the network (services.anope.org)
|
||||
|
||||
And the bot redis will be in BotServ's bot list.
|
||||
Notice how ids:BotInfo and the value keys are updated automatically.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
RPC using JSON-RPC and XML-RPC (using PECL'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 RPC calls, provided by rpc_main:
|
||||
|
||||
checkAuthentication - 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 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 RPC.
|
||||
|
||||
stats - Takes no parameters, returns miscellaneous stats that can be found in the /operserv stats command.
|
||||
|
||||
RPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL
|
||||
database, such as accounts and registered channel information. It is instead used for pulling realtime data such
|
||||
as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/RPC.
|
||||
|
||||
Also note that when using XMLRPC 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,211 @@
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
"use strict";
|
||||
|
||||
/** Implements methods for accessing an Anope JSON-RPC server. */
|
||||
class AnopeRPC {
|
||||
|
||||
/**
|
||||
* Initializes a new AnopeRPC instance with the specified RPC host.
|
||||
*
|
||||
* @param {string} The RPC host base URL.
|
||||
*/
|
||||
constructor(host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes an arbitrary RPC query.
|
||||
*
|
||||
* @param {string} method The name of the method to execute.
|
||||
* @param {...*} params The parameters pass to the method.
|
||||
* @returns {*} The result of the RPC query.
|
||||
*/
|
||||
async run(method, ...params) {
|
||||
const request = JSON.stringify({
|
||||
"jsonrpc": "2.0",
|
||||
"method": method,
|
||||
"params": params,
|
||||
"id": Math.random().toString(36).slice(2)
|
||||
});
|
||||
const response = await fetch(this.host, {
|
||||
method: 'POST',
|
||||
body: request
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP returned ${response.status}`)
|
||||
}
|
||||
const json = await response.json();
|
||||
if ("error" in json) {
|
||||
throw new Error(`JSON-RPC returned ${json.error.code}: ${json.error.message}`)
|
||||
}
|
||||
if ("result" in json) {
|
||||
return json.result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of accounts.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} The level of detail to request.
|
||||
* @returns {array} An array of account names.
|
||||
*/
|
||||
listAccounts(detail = "name") {
|
||||
return this.run("anope.listAccounts", detail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the specified account.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} name The name of the account.
|
||||
* @returns {object} An object containing information about the account.
|
||||
*/
|
||||
account(name) {
|
||||
return this.run("anope.account", name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of channels.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} The level of detail to request.
|
||||
* @returns {array} An array of channel names.
|
||||
*/
|
||||
listChannels(detail = "name") {
|
||||
return this.run("anope.listChannels", detail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the specified channel.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} name The name of the channel.
|
||||
* @returns {object} An object containing information about the channel.
|
||||
*/
|
||||
channel(name) {
|
||||
return this.run("anope.channel", name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of services operators.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} The level of detail to request.
|
||||
* @returns {array} An array of channel names.
|
||||
*/
|
||||
listOpers(detail = "name") {
|
||||
return this.run("anope.listOpers", detail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the specified services operator.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} name The name of the services operator.
|
||||
* @returns {object} An object containing information about the services operator.
|
||||
*/
|
||||
oper(name) {
|
||||
return this.run("anope.oper", name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of servers.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} The level of detail to request.
|
||||
* @returns {array} An array of servers names.
|
||||
*/
|
||||
listServers(detail = "name") {
|
||||
return this.run("anope.listServers", detail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the specified server.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} name The name of the server.
|
||||
* @returns {object} An object containing information about the server.
|
||||
*/
|
||||
server(name) {
|
||||
return this.run("anope.server", name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of users.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} The level of detail to request.
|
||||
* @returns {array} An array of channel names.
|
||||
*/
|
||||
listUsers(detail = "name") {
|
||||
return this.run("anope.listUsers", detail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves information about the specified user.
|
||||
*
|
||||
* Requires the rpc_data module to be loaded.
|
||||
*
|
||||
* @param {string} nick The nick of the user.
|
||||
* @returns {object} An object containing information about the user.
|
||||
*/
|
||||
user(nick) {
|
||||
return this.run("anope.user", nick);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to every user on the network.
|
||||
*
|
||||
* Requires the rpc_message module to be loaded.
|
||||
*
|
||||
* @param {...*} messages One or more messages to send.
|
||||
*/
|
||||
messageNetwork(...messages) {
|
||||
return this.run("anope.messageNetwork", ...messages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to every user on the specified server.
|
||||
*
|
||||
* Requires the rpc_message module to be loaded.
|
||||
*
|
||||
* @param {string} name The name of the server.
|
||||
* @param {...*} messages One or more messages to send.
|
||||
*/
|
||||
messageServer(server, ...messages) {
|
||||
return this.run("anope.messageServer", server, ...messages);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to the specified user.
|
||||
*
|
||||
* Requires the rpc_message module to be loaded.
|
||||
*
|
||||
* @param {string} source The source pseudoclient to send the message from.
|
||||
* @param {string} target The target user to send the message to.
|
||||
* @param {...*} messages One or more messages to send.
|
||||
*/
|
||||
messageUser(source, target, ...messages) {
|
||||
return this.run("anope.messageUser", source, target, ...messages);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
const arpc = new AnopeRPC("http://127.0.0.1:8080/jsonrpc");
|
||||
arpc.listServers().then(servers => {
|
||||
console.log(servers);
|
||||
}).catch (error => {
|
||||
console.log(error);
|
||||
});
|
||||
*/
|
||||
@@ -1,23 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* XMLRPC Functions
|
||||
* JSON-RPC functions
|
||||
*
|
||||
* (C) 2003-2024 Anope Team
|
||||
* (C) 2003-2025 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*/
|
||||
|
||||
class AnopeXMLRPC
|
||||
class AnopeRPC
|
||||
{
|
||||
/**
|
||||
* The XMLRPC host
|
||||
* The RPC host
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $host;
|
||||
|
||||
/**
|
||||
* Initiate a new AnopeXMLRPC instance
|
||||
* Initiate a new AnopeRPC instance
|
||||
*
|
||||
* @param $host
|
||||
*/
|
||||
@@ -27,7 +27,7 @@ class AnopeXMLRPC
|
||||
}
|
||||
|
||||
/**
|
||||
* Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
|
||||
* Run an RPC command. Name should be a query name and params an array of parameters, eg:
|
||||
* $this->raw("checkAuthentication", ["adam", "qwerty"]);
|
||||
* If successful returns back an array of useful information.
|
||||
*
|
||||
@@ -40,14 +40,19 @@ class AnopeXMLRPC
|
||||
*/
|
||||
public function run($name, $params)
|
||||
{
|
||||
$xmlquery = xmlrpc_encode_request($name, $params);
|
||||
$request = json_encode([
|
||||
"jsonrpc" => "2.0",
|
||||
"id" => uniqid(),
|
||||
"method" => $name,
|
||||
"params" => $params,
|
||||
]);
|
||||
$context = stream_context_create(["http" => [
|
||||
"method" => "POST",
|
||||
"header" => "Content-Type: text/xml",
|
||||
"content" => $xmlquery]]);
|
||||
"header" => "Content-Type: application/json",
|
||||
"content" => $request]]);
|
||||
|
||||
$inbuf = file_get_contents($this->host, false, $context);
|
||||
$response = xmlrpc_decode($inbuf);
|
||||
$response = json_decode($inbuf, true);
|
||||
|
||||
if ($response) {
|
||||
return $response;
|
||||
@@ -85,8 +90,8 @@ class AnopeXMLRPC
|
||||
{
|
||||
$ret = $this->run("checkAuthentication", [$account, $pass]);
|
||||
|
||||
if ($ret && $ret["result"] == "Success") {
|
||||
return $ret["account"];
|
||||
if ($ret && array_key_exists("result", $ret) && array_key_exists("account", $ret["result"])) {
|
||||
return $ret["result"]["account"];
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -112,7 +117,7 @@ class AnopeXMLRPC
|
||||
*/
|
||||
public function channel($channel)
|
||||
{
|
||||
return $this->run("channel", [$channel]);
|
||||
return $this->run("anope.channel", [$channel]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,7 +132,7 @@ class AnopeXMLRPC
|
||||
*/
|
||||
public function notice($source, $target, $message)
|
||||
{
|
||||
return $this->run("notice", [$source, $target, $message]);
|
||||
return $this->run("anope.messageUser", [$source, $target, $message]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,8 +143,8 @@ class AnopeXMLRPC
|
||||
*/
|
||||
public function user($user)
|
||||
{
|
||||
return $this->run("user", [$user]);
|
||||
return $this->run("anope.user", [$user]);
|
||||
}
|
||||
}
|
||||
|
||||
$anope = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
|
||||
$anope = new AnopeRPC("http://127.0.0.1:8080/jsonrpc");
|
||||
@@ -0,0 +1,457 @@
|
||||
# Anope `rpc_data` RPC interface
|
||||
|
||||
## `anope.listAccounts`
|
||||
|
||||
Lists all accounts that exist on the network.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the account names. Defaults to "name".
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified detail level does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
If the detail level is not specified or is "name" then an array of account names.
|
||||
|
||||
If the detail level is "full" then a mapping of account names to information about the account. See `anope.account` for more information on the data structure.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
["account1", "account2", "account3"]
|
||||
```
|
||||
|
||||
## `anope.account`
|
||||
|
||||
Retrieves information about the specified account.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | A nickname belonging to the account.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified account does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
Returns a map containing information about the account.
|
||||
|
||||
Key | Type | Description
|
||||
--- | ---- | -----------
|
||||
display | string | The display nickname of the account.
|
||||
email | string or null | The email address associated with the account or null if one has not been specified.
|
||||
extensions | map | A key-value map of the extensions set on this account by modules.
|
||||
language | string or null | The language associated with the account or null if the account uses the default language.
|
||||
lastmail | int | The time at which an email was last sent for this account.
|
||||
nicks | map | Information about nicknames that belong to the account keyed by the nickname.
|
||||
nicks.\*.extensions | map | A key-value map of the extensions set on this nickname by modules.
|
||||
nicks.\*.lastseen | int | The time at which this nickname was last used.
|
||||
nicks.\*.registered | int | The time at which this nickname was registered.
|
||||
nicks.\*.vhost | map or null | The vhost associated with the account or null if the user has no vhost.
|
||||
nicks.\*.vhost.created | int | The time at which the vhost was created.
|
||||
nicks.\*.vhost.creator | string | The nickname of the creator of the vhost.
|
||||
nicks.\*.vhost.host | string | The host segment of the vhost.
|
||||
nicks.\*.vhost.ident | string or null | The ident segment of the vhost or null if there is not one.
|
||||
nicks.\*.vhost.mask | string | The user@host or host mask of the vhost.
|
||||
opertype | map or null | The oper type associated with the account or null if they are not a services operator.
|
||||
opertype.commands | array[string] | The commands that the services operator type can use.
|
||||
opertype.name | string | The name of the services operator type.
|
||||
opertype.privileges | array[string] | The privileges that the services operator type has.
|
||||
registered | int | The time at which the account was registered.
|
||||
uniqueid | uint | The unique immutable identifier of the account.
|
||||
users | array[string] | The IRC users who are currently logged in to this account.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"display": "foo",
|
||||
"email": "example@example.com",
|
||||
"extensions": {
|
||||
"AUTOOP": true,
|
||||
"HIDE_EMAIL": true,
|
||||
"HIDE_MASK": true,
|
||||
"MEMO_RECEIVE": true,
|
||||
"MEMO_SIGNON": true,
|
||||
"NS_PRIVATE": true,
|
||||
"PROTECT": true,
|
||||
"PROTECT_AFTER": 69
|
||||
},
|
||||
"language": null,
|
||||
"lastmail": 1745071858,
|
||||
"nicks": {
|
||||
"foo": {
|
||||
"extensions": {
|
||||
"NS_NO_EXPIRE": true
|
||||
},
|
||||
"lastseen": 1745074153,
|
||||
"registered": 1745071857,
|
||||
"vhost": null
|
||||
},
|
||||
"bar": {
|
||||
"extensions": {},
|
||||
"lastseen": 1745072602,
|
||||
"registered": 1745071857,
|
||||
"vhost": {
|
||||
"created": 1745072653,
|
||||
"creator": "foo",
|
||||
"host": "bar.baz",
|
||||
"ident": "foo",
|
||||
"mask": "foo@bar.baz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"opertype": {
|
||||
"commands": ["hostserv/*", "operserv/session"],
|
||||
"name": "Helper",
|
||||
"privileges": ["chanserv/no-register-limit"]
|
||||
},
|
||||
"registered": 1745071857,
|
||||
"uniqueid": 11085415958920757000,
|
||||
"users": [
|
||||
"foo"
|
||||
]
|
||||
}
|
||||
```
|
||||
## `anope.listChannels`
|
||||
|
||||
Lists all channels that exist on the network.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the channel names. Defaults to "name".
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified detail level does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
If the detail level is not specified or is "name" then an array of channel names.
|
||||
|
||||
If the detail level is "full" then a mapping of channel names to information about the channel. See `anope.channel` for more information on the data structure.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
["#chan1", "#chan2", "#chan3"]
|
||||
```
|
||||
|
||||
## `anope.channel`
|
||||
|
||||
Retrieves information about the specified channel.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | The name of the channel.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified channel does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
Returns a map containing information about the channel.
|
||||
|
||||
Key | Type | Description
|
||||
--- | ---- | -----------
|
||||
created | int | The UNIX time at which the channel was originally created.
|
||||
listmodes | map | List modes which are set on the channel keyed by the mode character.
|
||||
modes | array[string] | Flag and parameter modes which are set on the channel.
|
||||
name | string | The name of the channel.
|
||||
registered | boolean | Whether the channel is registered.
|
||||
topic | map or null | The channel topic or null if no topic is set.
|
||||
topic.setat | int | The time at which the topic was set.
|
||||
topic.setby | string | The nick or nuh of the user who set the topic.
|
||||
topic.value | string | The text of the topic.
|
||||
users | array[string] | The users that are current in the channel prefixed by their status mode prefixes.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"created": 1740402691,
|
||||
"listmodes": {
|
||||
"b": ["foo!bar@baz", "account:bax"],
|
||||
},
|
||||
"modes": ["+knrt", "secret"],
|
||||
"name": "#chan1",
|
||||
"registered": true,
|
||||
"topic": {
|
||||
"setat": 1740404706,
|
||||
"setby": "nick1",
|
||||
"value": "Example channel topic"
|
||||
},
|
||||
"users": ["@nick1", "nick2"]
|
||||
}
|
||||
```
|
||||
|
||||
## `anope.listOpers`
|
||||
|
||||
Lists all services operators that exist on the network.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the services operator nicknames. Defaults to "name".
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified detail level does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
If the detail level is not specified or is "name" then an array of services operator names.
|
||||
|
||||
If the detail level is "full" then a mapping of services operator names to information about the services operator. See `anope.oper` for more information on the data structure.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
["nick1", "nick2", "nick3"]
|
||||
```
|
||||
|
||||
## `anope.oper`
|
||||
|
||||
Retrieves information about the specified services operator.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | The name of the services operator.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified services operator does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
Returns a map containing information about the services operator.
|
||||
|
||||
Key | Type | Description
|
||||
--- | ---- | -----------
|
||||
fingerprints | array[string] or null | The client certificate fingerprints that a user must be using to log in as this services operator or null if there are no client certificate restrictions.
|
||||
hosts | array[string] or null | The user@ip and user@ip masks that a user must be connecting from to log in as this services operator or null if there are no host restrictions.
|
||||
name | string | The name of the services operator.
|
||||
operonly | boolean | Whether a user has to be a server operator to log in as this services operator.
|
||||
opertype | map | The oper type associated with the services operator.
|
||||
opertype.commands | array[string] | The commands that the services operator type can use.
|
||||
opertype.name | string | The name of the services operator type.
|
||||
opertype.privileges | array[string] | The privileges that the services operator type has.
|
||||
password | boolean | Whether a user has to specify a password to log in as the services operator.
|
||||
vhost | string or null | The vhost of the services operator or null if there is no vhost.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"fingerprints": null,
|
||||
"hosts": ["*@*.example.com"],
|
||||
"name": "stest",
|
||||
"operonly": true,
|
||||
"opertype": {
|
||||
"commands": ["hostserv/*", "operserv/session"],
|
||||
"name": "Helper",
|
||||
"privileges": ["chanserv/no-register-limit"]
|
||||
},
|
||||
"password": false,
|
||||
"vhost": null
|
||||
}
|
||||
```
|
||||
|
||||
## `anope.listServers`
|
||||
|
||||
Lists all servers that exist on the network.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the server names. Defaults to "name".
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified detail level does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
If the detail level is not specified or is "name" then an array of server names.
|
||||
|
||||
If the detail level is "full" then a mapping of server names to information about the server. See `anope.server` for more information on the data structure.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
["irc1.example.com", "irc2.example.com", "services.example.com"]
|
||||
```
|
||||
|
||||
## `anope.server`
|
||||
|
||||
Retrieves information about the specified server.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | The name of the server.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified server does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
Returns a map containing information about the server.
|
||||
|
||||
Key | Type | Description
|
||||
--- | ---- | -----------
|
||||
description | string | The description of the server.
|
||||
downlinks | array[string] | The servers which are behind this server
|
||||
juped | boolean | Whether the server has been juped.
|
||||
name | string | The name of the server.
|
||||
sid | string or null | The unique immutable identifier of the server or null if the IRCd does not use SIDs.
|
||||
synced | boolean | Whether the server has finished syncing.
|
||||
ulined | boolean | Whether the server is U-lined.
|
||||
uplink | string or null | The server in front of this server or null if it is the services server.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "Anope IRC Services",
|
||||
"downlinks": ["irc.example.com"],
|
||||
"juped": false,
|
||||
"name": "services.example.com",
|
||||
"sid": "00B",
|
||||
"synced": true,
|
||||
"ulined": true,
|
||||
"uplink": null
|
||||
}
|
||||
```
|
||||
|
||||
## `anope.listUsers`
|
||||
|
||||
Lists all users that exist on the network.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the user nicknames. Defaults to "name".
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified detail level does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
If the detail level is not specified or is "name" then an array of user nicknames.
|
||||
|
||||
If the detail level is "full" then a mapping of user nicknames to information about the user. See `anope.user` for more information on the data structure.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
["nick1", "nick2", "nick3"]
|
||||
```
|
||||
|
||||
## `anope.user`
|
||||
|
||||
Retrieves information about the specified user.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | The nickname of the user.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified user does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
Returns a map containing information about the user.
|
||||
|
||||
Key | Type | Description
|
||||
--- | ---- | -----------
|
||||
account | map or null | The user's account or null if they are not logged in to an account.
|
||||
account.display | string | The display nickname of the account.
|
||||
account.opertype | string or null | The account's oper type or null if the account is not a services operator.
|
||||
account.uniqueid | uint | The unique immutable identifier of the account.
|
||||
address | string | The IP address the user is connecting from.
|
||||
channels | array[string] | The channels that the user is in prefixed by their status mode prefixes.
|
||||
chost | string or null | The cloaked hostname of the user or null if they have no cloak.
|
||||
fingerprint | string or null | The fingerprint of the user's client certificate or null if they are not using one.
|
||||
host | string | The real hostname of the user.
|
||||
ident | string | The username (ident) of the user.
|
||||
modes | array[string] | Flag and parameter modes which are set on the user.
|
||||
nick | string | The nickname of the user.
|
||||
nickchanged | int | The time at which the user last changed their nickname.
|
||||
real | string | The real name of the user.
|
||||
server | string | The server that the user is connected to.
|
||||
signon | int | The time at which the user connected to the network.
|
||||
uid | string or null | The unique immutable identifier of the user or null if the IRCd does not use UIDs.
|
||||
vhost | string or null | The virtual host of the user or null if they have no vhost.
|
||||
vident | string or null | The virtual ident (username) of the user or null if they have no vident.
|
||||
|
||||
#### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"account": {
|
||||
"display": "nick1",
|
||||
"opertype": "Services Root",
|
||||
"uniqueid": "17183514657819486040"
|
||||
},
|
||||
"address": "127.0.0.1",
|
||||
"channels": ["@#chan1", "#chan2"],
|
||||
"chost": "localhost",
|
||||
"fingerprint": null,
|
||||
"host": "localhost",
|
||||
"id": "9TSAAAAAA",
|
||||
"ident": "user1",
|
||||
"modes": ["+r"],
|
||||
"nick": "nick1",
|
||||
"nickchanged": 1740408318,
|
||||
"real": "An IRC User",
|
||||
"server": "irc.example.com",
|
||||
"signon": 1740408296,
|
||||
"vhost": "staff.example.com",
|
||||
"vident": null,
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,67 @@
|
||||
# Anope `rpc_message` RPC interface
|
||||
|
||||
## `anope.messageNetwork`
|
||||
|
||||
Sends a message to all users on the network.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0+ | One or more messages to send.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The global service is not available.
|
||||
|
||||
### Result
|
||||
|
||||
This procedure returns no result.
|
||||
|
||||
## `anope.messageServer`
|
||||
|
||||
Sends a message to all users on the specified server.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | The name of the server to message users on.
|
||||
1+ | One or more messages to send.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The global service is not available.
|
||||
-32098 | The specified server does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
This procedure returns no result.
|
||||
|
||||
## `anope.messageUser`
|
||||
|
||||
Sends a message to the specified user.
|
||||
|
||||
### Parameters
|
||||
|
||||
Index | Description
|
||||
----- | -----------
|
||||
0 | The source pseudoclient to send the message from.
|
||||
1 | The target user to send the message to.
|
||||
2+ | One or more messages to send.
|
||||
|
||||
### Errors
|
||||
|
||||
Code | Description
|
||||
------ | -----------
|
||||
-32099 | The specified source does not exist.
|
||||
-32098 | The specified target does not exist.
|
||||
|
||||
### Result
|
||||
|
||||
This procedure returns no result.
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
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 enable debug mode by passing the --debug flag after the server
|
||||
address. This should generate a log file of what happened when it tried
|
||||
to connect to the SMTP server.
|
||||
|
||||
Credits:
|
||||
Originally written by Dominick Meglio <codemastr@unrealircd.com>
|
||||
Ported to *nix by Trystan Scott Lee <trystan@nomadirc.net>
|
||||
+3
-3
@@ -70,7 +70,7 @@ 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
|
||||
Some Anope modules require third party libraries, such as mysql and
|
||||
the SSL modules. If these libraries are installed in nonstandard
|
||||
locations, cmake will probably not find them and should be told where
|
||||
they are by passing their location to Config.
|
||||
@@ -103,7 +103,7 @@ Anope for Windows
|
||||
INSTALL within the Solution Explorer. Right-click on INSTALL and choose Build.
|
||||
|
||||
When you have done this, all the files will be installed to where they belong.
|
||||
The only thing you need to do is rename "data/example.conf" to be "data/services.conf",
|
||||
The only thing you need to do is rename "data/anope.example.conf" to be "data/anope.conf",
|
||||
and then follow the steps to set up Anope.
|
||||
|
||||
You have now completed the building phase of Anope for Windows. You can
|
||||
@@ -120,7 +120,7 @@ Anope for Windows
|
||||
Notepad will cause strange characters to appear, and you may not be able to
|
||||
edit the file correctly.
|
||||
|
||||
Open services.conf, and read through it carefully and adjust the settings
|
||||
Open anope.conf, and read through it carefully and adjust the settings
|
||||
you think you need to adjust.
|
||||
|
||||
If you are unsure of the settings, you can go to the dos command prompt
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
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:
|
||||
|
||||
checkAuthentication - 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 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.
|
||||
|
||||
opers - Takes no parameters, returns opertypes, their privileges and commands.
|
||||
|
||||
notice - Takes three parameters, source user, target user, and message. Sends a message to the user.
|
||||
|
||||
XMLRPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL
|
||||
database, such as accounts and registered channel information. It is instead used for pulling realtime data such
|
||||
as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/XMLRPC.
|
||||
|
||||
Also note that the parameter named "id" is reserved for query ID. If you pass a query to Anope containing a value for id. it will
|
||||
be stored by Anope and the same id will be passed back in the result.
|
||||
+2
-44
@@ -16,49 +16,7 @@ add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
|
||||
if(NOT WIN32)
|
||||
add_to_cpack_ignored_files("version.h$" TRUE)
|
||||
add_to_cpack_ignored_files("build.h$" TRUE)
|
||||
endif(NOT WIN32)
|
||||
|
||||
set(PCH_SOURCES_GCH "")
|
||||
if(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
string(REPLACE " " ";" PCH_CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
file(GLOB PCH_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
|
||||
sort_list(PCH_SOURCES)
|
||||
|
||||
foreach(PCH_SOURCE ${PCH_SOURCES})
|
||||
find_includes(${PCH_SOURCE} INCLUDES)
|
||||
set(INCLUDES_LIST)
|
||||
append_to_list(INCLUDES_LIST ${PCH_SOURCE})
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
|
||||
if(QUOTE_TYPE STREQUAL "quotes")
|
||||
find_in_list(PCH_SOURCES "${FILENAME}" FOUND)
|
||||
if(NOT FOUND EQUAL -1)
|
||||
append_to_list(INCLUDES_LIST ${FILENAME})
|
||||
endif(NOT FOUND EQUAL -1)
|
||||
endif(QUOTE_TYPE STREQUAL "quotes")
|
||||
endforeach(INCLUDE)
|
||||
|
||||
set(PCH_EXTRAFLAGS "")
|
||||
if(DEBUG_BUILD)
|
||||
set(PCH_EXTRAFLAGS "-g")
|
||||
endif(DEBUG_BUILD)
|
||||
if(PCH_SOURCE STREQUAL "module.h")
|
||||
set(PCH_EXTRAFLAGS ${PCH_EXTRAFLAGS} -fPIC)
|
||||
endif(PCH_SOURCE STREQUAL "module.h")
|
||||
if(GETTEXT_INCLUDE)
|
||||
set(PCH_GETTEXT_INCLUDE "-I${GETTEXT_INCLUDE}")
|
||||
endif(GETTEXT_INCLUDE)
|
||||
|
||||
set(PCH_SOURCES_GCH "${PCH_SOURCES_GCH};${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch")
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ARGS ${PCH_CXXFLAGS} ${PCH_EXTRAFLAGS}
|
||||
${PCH_GETTEXT_INCLUDE} -I${CMAKE_CURRENT_BINARY_DIR} -I${Anope_SOURCE_DIR}/modules/pseudoclients ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
|
||||
DEPENDS ${INCLUDES_LIST} VERBATIM
|
||||
)
|
||||
endforeach(PCH_SOURCE ${PCH_SOURCES})
|
||||
endif(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif()
|
||||
|
||||
# Add a custom target to the above file
|
||||
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h ${PCH_SOURCES_GCH})
|
||||
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h)
|
||||
|
||||
+26
-19
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef ACCESS_H
|
||||
#define ACCESS_H
|
||||
#pragma once
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
@@ -28,7 +27,7 @@ enum
|
||||
* backing each ChanAccess determines whether that ChanAccess has a given
|
||||
* privilege.
|
||||
*/
|
||||
struct CoreExport Privilege
|
||||
struct CoreExport Privilege final
|
||||
{
|
||||
Anope::string name;
|
||||
Anope::string desc;
|
||||
@@ -39,10 +38,10 @@ struct CoreExport Privilege
|
||||
bool operator==(const Privilege &other) const;
|
||||
};
|
||||
|
||||
class CoreExport PrivilegeManager
|
||||
class CoreExport PrivilegeManager final
|
||||
{
|
||||
static std::vector<Privilege> Privileges;
|
||||
public:
|
||||
public:
|
||||
static void AddPrivilege(Privilege p);
|
||||
static void RemovePrivilege(Privilege &p);
|
||||
static Privilege *FindPrivilege(const Anope::string &name);
|
||||
@@ -53,9 +52,10 @@ class CoreExport PrivilegeManager
|
||||
/* A provider of access. Only used for creating ChanAccesses, as
|
||||
* they contain pure virtual functions.
|
||||
*/
|
||||
class CoreExport AccessProvider : public Service
|
||||
class CoreExport AccessProvider
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
AccessProvider(Module *owner, const Anope::string &name);
|
||||
virtual ~AccessProvider();
|
||||
|
||||
@@ -64,20 +64,31 @@ class CoreExport AccessProvider : public Service
|
||||
*/
|
||||
virtual ChanAccess *Create() = 0;
|
||||
|
||||
private:
|
||||
private:
|
||||
static std::list<AccessProvider *> Providers;
|
||||
public:
|
||||
public:
|
||||
static const std::list<AccessProvider *>& GetProviders();
|
||||
};
|
||||
|
||||
/* Represents one entry of an access list on a channel. */
|
||||
class CoreExport ChanAccess : public Serializable
|
||||
class CoreExport ChanAccess
|
||||
: public Serializable
|
||||
{
|
||||
public:
|
||||
struct Type final
|
||||
: public Serialize::Type
|
||||
{
|
||||
Type();
|
||||
void Serialize(const Serializable *obj, Serialize::Data &data) const override;
|
||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
|
||||
};
|
||||
|
||||
private:
|
||||
Anope::string mask;
|
||||
/* account this access entry is for, if any */
|
||||
Serialize::Reference<NickCore> nc;
|
||||
|
||||
public:
|
||||
public:
|
||||
typedef std::vector<ChanAccess *> Path;
|
||||
|
||||
/* The provider that created this access entry */
|
||||
@@ -85,6 +96,7 @@ class CoreExport ChanAccess : public Serializable
|
||||
/* Channel this access entry is on */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
Anope::string creator;
|
||||
Anope::string description;
|
||||
time_t last_seen;
|
||||
time_t created;
|
||||
|
||||
@@ -95,9 +107,6 @@ class CoreExport ChanAccess : public Serializable
|
||||
const Anope::string &Mask() const;
|
||||
NickCore *GetAccount() const;
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
static const unsigned int MAX_DEPTH = 4;
|
||||
|
||||
/** Check if this access entry matches the given user or account
|
||||
@@ -105,7 +114,7 @@ class CoreExport ChanAccess : public Serializable
|
||||
* @param nc The account
|
||||
* @param next Next channel to check if any
|
||||
*/
|
||||
virtual bool Matches(const User *u, const NickCore *nc, ChannelInfo* &next) const;
|
||||
virtual bool Matches(const User *u, const NickCore *nc, ChannelInfo *&next) const;
|
||||
|
||||
/** Check if this access entry has the given privilege.
|
||||
* @param name The privilege name
|
||||
@@ -133,9 +142,9 @@ class CoreExport ChanAccess : public Serializable
|
||||
/* A group of access entries. This is used commonly, for example with ChannelInfo::AccessFor,
|
||||
* to show what access a user has on a channel because users can match multiple access entries.
|
||||
*/
|
||||
class CoreExport AccessGroup
|
||||
class CoreExport AccessGroup final
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/* access entries + paths */
|
||||
std::vector<ChanAccess::Path> paths;
|
||||
/* Channel these access entries are on */
|
||||
@@ -170,5 +179,3 @@ class CoreExport AccessGroup
|
||||
|
||||
inline bool empty() const { return paths.empty(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+69
-95
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef ACCOUNT_H
|
||||
#define ACCOUNT_H
|
||||
#pragma once
|
||||
|
||||
#include "extensible.h"
|
||||
#include "serialize.h"
|
||||
@@ -18,23 +17,35 @@
|
||||
#include "memo.h"
|
||||
#include "base.h"
|
||||
|
||||
typedef Anope::hash_map<NickAlias *> nickalias_map;
|
||||
typedef Anope::hash_map<NickCore *> nickcore_map;
|
||||
typedef TR1NS::unordered_map<uint64_t, NickCore *> nickcoreid_map;
|
||||
typedef Anope::unordered_map<NickAlias *> nickalias_map;
|
||||
typedef Anope::unordered_map<NickCore *> nickcore_map;
|
||||
typedef std::unordered_map<uint64_t, NickCore *> nickcoreid_map;
|
||||
|
||||
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
|
||||
extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
|
||||
extern CoreExport nickcoreid_map NickCoreIdList;
|
||||
extern CoreExport Serialize::Checker<nickcoreid_map> NickCoreIdList;
|
||||
|
||||
/* A registered nickname.
|
||||
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*/
|
||||
class CoreExport NickAlias : public Serializable, public Extensible
|
||||
class CoreExport NickAlias final
|
||||
: public Serializable
|
||||
, public Extensible
|
||||
{
|
||||
Anope::string vhost_ident, vhost_host, vhost_creator;
|
||||
time_t vhost_created;
|
||||
public:
|
||||
struct Type final
|
||||
: public Serialize::Type
|
||||
{
|
||||
Type();
|
||||
void Serialize(const Serializable *obj, Serialize::Data &data) const override;
|
||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
|
||||
};
|
||||
|
||||
public:
|
||||
private:
|
||||
Anope::string vhost_ident, vhost_host, vhost_creator;
|
||||
time_t vhost_created = 0;
|
||||
|
||||
public:
|
||||
Anope::string nick;
|
||||
Anope::string last_quit;
|
||||
Anope::string last_realname;
|
||||
@@ -42,8 +53,9 @@ class CoreExport NickAlias : public Serializable, public Extensible
|
||||
Anope::string last_usermask;
|
||||
/* Last uncloaked usermask, requires nickserv/auspex to see */
|
||||
Anope::string last_realhost;
|
||||
time_t time_registered;
|
||||
time_t last_seen;
|
||||
time_t registered = Anope::CurTime;
|
||||
time_t last_seen = Anope::CurTime;
|
||||
|
||||
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
|
||||
Serialize::Reference<NickCore> nc;
|
||||
|
||||
@@ -54,64 +66,79 @@ class CoreExport NickAlias : public Serializable, public Extensible
|
||||
NickAlias(const Anope::string &nickname, NickCore *nickcore);
|
||||
~NickAlias();
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Set a vhost for the user
|
||||
* @param ident The ident
|
||||
* @param host The host
|
||||
* @param creator Who created the vhost
|
||||
* @param time When the vhost was created
|
||||
*/
|
||||
void SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
|
||||
void SetVHost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
|
||||
|
||||
/** Remove a users vhost
|
||||
**/
|
||||
void RemoveVhost();
|
||||
void RemoveVHost();
|
||||
|
||||
/** Check if the user has a vhost
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasVhost() const;
|
||||
bool HasVHost() const;
|
||||
|
||||
/** Retrieve the vhost ident
|
||||
* @return the ident
|
||||
*/
|
||||
const Anope::string &GetVhostIdent() const;
|
||||
const Anope::string &GetVHostIdent() const;
|
||||
|
||||
/** Retrieve the vhost host
|
||||
* @return the host
|
||||
*/
|
||||
const Anope::string &GetVhostHost() const;
|
||||
const Anope::string &GetVHostHost() const;
|
||||
|
||||
/** Retrieve the vhost mask
|
||||
* @param the mask
|
||||
*/
|
||||
Anope::string GetVHostMask() const;
|
||||
|
||||
/** Retrieve the vhost creator
|
||||
* @return the creator
|
||||
*/
|
||||
const Anope::string &GetVhostCreator() const;
|
||||
const Anope::string &GetVHostCreator() const;
|
||||
|
||||
/** Retrieve when the vhost was created
|
||||
* @return the time it was created
|
||||
*/
|
||||
time_t GetVhostCreated() const;
|
||||
time_t GetVHostCreated() const;
|
||||
|
||||
/** Finds a registered nick
|
||||
* @param nick The nick to lookup
|
||||
* @return the nick, if found
|
||||
*/
|
||||
static NickAlias *Find(const Anope::string &nick);
|
||||
static NickAlias *FindId(uint64_t id);
|
||||
};
|
||||
|
||||
/* A registered account. Each account must have a NickAlias with the same nick as the
|
||||
* account's display.
|
||||
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*/
|
||||
class CoreExport NickCore : public Serializable, public Extensible
|
||||
class CoreExport NickCore final
|
||||
: public Serializable
|
||||
, public Extensible
|
||||
{
|
||||
public:
|
||||
struct Type final
|
||||
: public Serialize::Type
|
||||
{
|
||||
Type();
|
||||
void Serialize(const Serializable *obj, Serialize::Data &data) const override;
|
||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
|
||||
};
|
||||
|
||||
private:
|
||||
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
|
||||
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
|
||||
/* Unique identifier for the account. */
|
||||
uint64_t id;
|
||||
public:
|
||||
public:
|
||||
/* Name of the account. Find(display)->nc == this. */
|
||||
Anope::string display;
|
||||
/* User password in form of hashm:data */
|
||||
@@ -119,9 +146,10 @@ class CoreExport NickCore : public Serializable, public Extensible
|
||||
Anope::string email;
|
||||
/* Locale name of the language of the user. Empty means default language */
|
||||
Anope::string language;
|
||||
/* Access list, contains user@host masks of users who get certain privileges based
|
||||
* on if NI_SECURE is set and what (if any) kill protection is enabled. */
|
||||
std::vector<Anope::string> access;
|
||||
/* Last time an email was sent to this user */
|
||||
time_t lastmail = 0;
|
||||
/* The time this account was registered */
|
||||
time_t registered = Anope::CurTime;
|
||||
MemoInfo memos;
|
||||
std::map<Anope::string, Anope::string> last_modes;
|
||||
|
||||
@@ -131,14 +159,14 @@ class CoreExport NickCore : public Serializable, public Extensible
|
||||
Serialize::Checker<std::vector<NickAlias *> > aliases;
|
||||
|
||||
/* Set if this user is a services operator. o->ot must exist. */
|
||||
Oper *o;
|
||||
Oper *o = nullptr;
|
||||
|
||||
/* Unsaved data */
|
||||
|
||||
/** The display nick for this account. */
|
||||
NickAlias *na = nullptr;
|
||||
/* Number of channels registered by this account */
|
||||
uint16_t channelcount;
|
||||
/* Last time an email was sent to this user */
|
||||
time_t lastmail;
|
||||
uint16_t channelcount = 0;
|
||||
/* Users online now logged into this account */
|
||||
std::list<User *> users;
|
||||
|
||||
@@ -149,79 +177,25 @@ class CoreExport NickCore : public Serializable, public Extensible
|
||||
NickCore(const Anope::string &nickdisplay, uint64_t nickid = 0);
|
||||
~NickCore();
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Changes the display for this account
|
||||
* @param na The new display, must be grouped to this account.
|
||||
*/
|
||||
void SetDisplay(const NickAlias *na);
|
||||
void SetDisplay(NickAlias *na);
|
||||
|
||||
/** Checks whether this account is a services oper or not.
|
||||
* @return True if this account is a services oper, false otherwise.
|
||||
*/
|
||||
virtual bool IsServicesOper() const;
|
||||
|
||||
/** 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;
|
||||
|
||||
/** Get the number of entries on the access list for this account.
|
||||
*/
|
||||
unsigned GetAccessCount() const;
|
||||
|
||||
/** Retrieves the account id for this user */
|
||||
uint64_t GetId();
|
||||
|
||||
/** 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();
|
||||
|
||||
/** Is the given user on this accounts access list?
|
||||
*
|
||||
* @param u The user
|
||||
*
|
||||
* @return true if the user is on the access list
|
||||
*/
|
||||
bool IsOnAccess(const User *u) const;
|
||||
|
||||
/** Finds an account
|
||||
* @param nick The account name to find
|
||||
* @return The account, if it exists
|
||||
*/
|
||||
static NickCore* Find(const Anope::string &nick);
|
||||
static NickCore *Find(const Anope::string &nick);
|
||||
static NickCore *FindId(uint64_t id);
|
||||
|
||||
void AddChannelReference(ChannelInfo *ci);
|
||||
void RemoveChannelReference(ChannelInfo *ci);
|
||||
@@ -238,18 +212,19 @@ class CoreExport IdentifyRequest
|
||||
Module *owner;
|
||||
Anope::string account;
|
||||
Anope::string password;
|
||||
Anope::string address;
|
||||
|
||||
std::set<Module *> holds;
|
||||
bool dispatched;
|
||||
bool success;
|
||||
bool dispatched = false;
|
||||
bool success = false;
|
||||
|
||||
static std::set<IdentifyRequest *> Requests;
|
||||
|
||||
protected:
|
||||
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass);
|
||||
protected:
|
||||
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass, const Anope::string &ip);
|
||||
virtual ~IdentifyRequest();
|
||||
|
||||
public:
|
||||
public:
|
||||
/* One of these is called when the request goes through */
|
||||
virtual void OnSuccess() = 0;
|
||||
virtual void OnFail() = 0;
|
||||
@@ -257,6 +232,7 @@ class CoreExport IdentifyRequest
|
||||
Module *GetOwner() const { return owner; }
|
||||
const Anope::string &GetAccount() const { return account; }
|
||||
const Anope::string &GetPassword() const { return password; }
|
||||
const Anope::string &GetAddress() const { return address; }
|
||||
|
||||
/* Holds this request. When a request is held it must be Released later
|
||||
* for the request to complete. Multiple modules may hold a request at any time,
|
||||
@@ -286,5 +262,3 @@ class CoreExport IdentifyRequest
|
||||
|
||||
static void ModuleUnload(Module *m);
|
||||
};
|
||||
|
||||
#endif // ACCOUNT_H
|
||||
|
||||
+139
-135
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef ANOPE_H
|
||||
#define ANOPE_H
|
||||
#pragma once
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
@@ -23,15 +22,15 @@ namespace Anope
|
||||
* allow us to only require one type of string everywhere that can be converted
|
||||
* at any time to a specific type of string.
|
||||
*/
|
||||
class CoreExport string
|
||||
class CoreExport string final
|
||||
{
|
||||
private:
|
||||
private:
|
||||
/**
|
||||
* The actual string is stored in an std::string as it can be converted to
|
||||
* ci::string, or a C-style string at any time.
|
||||
*/
|
||||
std::string _string;
|
||||
public:
|
||||
public:
|
||||
/**
|
||||
* Extras.
|
||||
*/
|
||||
@@ -40,6 +39,7 @@ namespace Anope
|
||||
typedef std::string::reverse_iterator reverse_iterator;
|
||||
typedef std::string::const_reverse_iterator const_reverse_iterator;
|
||||
typedef std::string::size_type size_type;
|
||||
typedef std::string::value_type value_type;
|
||||
static const size_type npos = static_cast<size_type>(-1);
|
||||
|
||||
/**
|
||||
@@ -54,9 +54,7 @@ namespace Anope
|
||||
string(const ci::string &_str) : _string(_str.c_str()) { }
|
||||
string(const string &_str, size_type pos, size_type n = npos) : _string(_str._string, pos, n) { }
|
||||
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
|
||||
#if __cplusplus >= 201103L
|
||||
string(const string &) = default;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Assignment operators, so any type of string can be assigned to this class.
|
||||
@@ -143,8 +141,8 @@ namespace Anope
|
||||
*/
|
||||
inline void push_back(char c) { return this->_string.push_back(c); }
|
||||
|
||||
inline string& append(const string &s) { this->_string.append(s.str()); return *this; }
|
||||
inline string& append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||
inline string &append(const string &s) { this->_string.append(s.str()); return *this; }
|
||||
inline string &append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||
|
||||
/**
|
||||
* Resizes the string content to n characters.
|
||||
@@ -162,21 +160,21 @@ namespace Anope
|
||||
* Trim leading and trailing white spaces from the string.
|
||||
*/
|
||||
|
||||
inline string& ltrim(const Anope::string &what = " \t\r\n")
|
||||
inline string <rim(const Anope::string &what = " \t\r\n")
|
||||
{
|
||||
while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
|
||||
this->_string.erase(this->_string.begin());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& rtrim(const Anope::string &what = " \t\r\n")
|
||||
inline string &rtrim(const Anope::string &what = " \t\r\n")
|
||||
{
|
||||
while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos)
|
||||
this->_string.erase(this->_string.length() - 1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& trim(const Anope::string &what = " \t\r\n")
|
||||
inline string &trim(const Anope::string &what = " \t\r\n")
|
||||
{
|
||||
this->ltrim(what);
|
||||
this->rtrim(what);
|
||||
@@ -213,12 +211,24 @@ namespace Anope
|
||||
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); }
|
||||
|
||||
inline int compare(size_t pos, size_t len, const string &str) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str())); }
|
||||
inline int compare(size_t pos, size_t len, const string &str, size_t subpos, size_type sublen = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str()), subpos, sublen); }
|
||||
inline int compare(size_t pos, size_t len, const char *s, size_type n = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, s, n); }
|
||||
|
||||
/**
|
||||
* 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; }
|
||||
|
||||
/**
|
||||
* In IRC messages we use a substitute (ASCII 0x1A) instead of a space
|
||||
* (ASCII 0x20) so it doesn't get line wrapped when put into a message.
|
||||
* The line wrapper will convert this to a space before it is sent to
|
||||
* clients.
|
||||
*/
|
||||
inline Anope::string nobreak() const { return this->replace_all_cs("\x20", "\x1A"); }
|
||||
|
||||
/**
|
||||
* Replace parts of the string.
|
||||
*/
|
||||
@@ -257,8 +267,8 @@ namespace Anope
|
||||
inline string lower() const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
for (size_type i = 0; i < new_string.length(); ++i)
|
||||
new_string[i] = Anope::tolower(new_string[i]);
|
||||
for (auto &chr : new_string)
|
||||
chr = Anope::tolower(chr);
|
||||
return new_string;
|
||||
}
|
||||
|
||||
@@ -268,8 +278,8 @@ namespace Anope
|
||||
inline string upper() const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
for (size_type i = 0; i < new_string.length(); ++i)
|
||||
new_string[i] = Anope::toupper(new_string[i]);
|
||||
for (auto &chr : new_string)
|
||||
chr = Anope::toupper(chr);
|
||||
return new_string;
|
||||
}
|
||||
|
||||
@@ -311,23 +321,23 @@ namespace Anope
|
||||
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; }
|
||||
|
||||
struct hash_ci
|
||||
struct hash_ci final
|
||||
{
|
||||
inline size_t operator()(const string &s) const
|
||||
{
|
||||
return TR1NS::hash<std::string>()(s.lower().str());
|
||||
return std::hash<std::string>()(s.lower().str());
|
||||
}
|
||||
};
|
||||
|
||||
struct hash_cs
|
||||
struct hash_cs final
|
||||
{
|
||||
inline size_t operator()(const string &s) const
|
||||
{
|
||||
return TR1NS::hash<std::string>()(s.str());
|
||||
return std::hash<std::string>()(s.str());
|
||||
}
|
||||
};
|
||||
|
||||
struct compare
|
||||
struct compare final
|
||||
{
|
||||
inline bool operator()(const string &s1, const string &s2) const
|
||||
{
|
||||
@@ -335,11 +345,16 @@ namespace Anope
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> class map : public std::map<string, T, ci::less> { };
|
||||
template<typename T> class multimap : public std::multimap<string, T, ci::less> { };
|
||||
template<typename T> class hash_map : public TR1NS::unordered_map<string, T, hash_ci, compare> { };
|
||||
template<typename T>
|
||||
using map = std::map<string, T, ci::less>;
|
||||
|
||||
#ifndef REPRODUCIBLE_BUILD
|
||||
template<typename T>
|
||||
using multimap = std::multimap<string, T, ci::less>;
|
||||
|
||||
template<typename T>
|
||||
using unordered_map = std::unordered_map<string, T, hash_ci, compare>;
|
||||
|
||||
#if !REPRODUCIBLE_BUILD
|
||||
static const char *const compiled = __TIME__ " " __DATE__;
|
||||
#endif
|
||||
|
||||
@@ -360,6 +375,7 @@ namespace Anope
|
||||
* Use this unless you need very specific time checks
|
||||
*/
|
||||
extern CoreExport time_t CurTime;
|
||||
extern CoreExport long long CurTimeNs;
|
||||
|
||||
/** The debug level we are running at.
|
||||
*/
|
||||
@@ -367,13 +383,13 @@ namespace Anope
|
||||
|
||||
/** Other command line options.
|
||||
*/
|
||||
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
|
||||
extern CoreExport bool ReadOnly, NoFork, NoThird, NoPID, NoExpire, ProtocolDebug;
|
||||
|
||||
/** The root of the services installation. Usually ~/services
|
||||
/** The root of the Anope installation. Usually ~/anope
|
||||
*/
|
||||
extern CoreExport Anope::string ServicesDir;
|
||||
|
||||
/** Services binary name (eg services)
|
||||
/** Anope binary name (eg anope)
|
||||
*/
|
||||
extern CoreExport Anope::string ServicesBin;
|
||||
|
||||
@@ -387,7 +403,7 @@ namespace Anope
|
||||
|
||||
/** The uplink we are currently connected to
|
||||
*/
|
||||
extern CoreExport int CurrentUplink;
|
||||
extern CoreExport size_t CurrentUplink;
|
||||
|
||||
/** Various methods to determine the Anope version running
|
||||
*/
|
||||
@@ -419,7 +435,7 @@ namespace Anope
|
||||
* initializing language support, loading modules, and loading databases.
|
||||
* @throws CoreException if something bad went wrong
|
||||
*/
|
||||
extern void Init(int ac, char **av);
|
||||
extern bool Init(int ac, char **av);
|
||||
|
||||
/** Calls the save database event
|
||||
*/
|
||||
@@ -463,22 +479,7 @@ namespace Anope
|
||||
* @param src The source string to encrypt
|
||||
* @param dest The destination where the encrypted string is placed
|
||||
*/
|
||||
extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/** Decrypts what is in 'src' to 'dest'.
|
||||
* @param src The source string to decrypt
|
||||
* @param dest The destination where the decrypted string is placed
|
||||
* @return true if decryption was successful. This is usually not the case
|
||||
* as most encryption methods we use are one way.
|
||||
*/
|
||||
extern CoreExport bool Decrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/** Hashes a buffer with SipHash-2-4
|
||||
* @param src The start of the buffer to hash
|
||||
* @param src_sz The total number of bytes in the buffer
|
||||
* @param key A 16 byte key to hash the buffer with.
|
||||
*/
|
||||
extern CoreExport uint64_t SipHash24(const void *src, unsigned long src_sz, const char key[16]);
|
||||
extern CoreExport bool Encrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/** Returns a sequence of data formatted as the format argument specifies.
|
||||
** After the format parameter, the function expects at least as many
|
||||
@@ -487,7 +488,7 @@ namespace Anope
|
||||
* @param ... any number of parameters
|
||||
* @return a Anope::string
|
||||
*/
|
||||
extern CoreExport string printf(const char *fmt, ...);
|
||||
extern CoreExport string printf(const char *fmt, ...) ATTR_FORMAT(1, 2);
|
||||
|
||||
/** Return the last error code
|
||||
* @return The error code
|
||||
@@ -497,7 +498,7 @@ namespace Anope
|
||||
/** Return the last error, uses errno/GetLastError() to determine this
|
||||
* @return An error message
|
||||
*/
|
||||
extern CoreExport const string LastError();
|
||||
extern CoreExport string LastError();
|
||||
|
||||
/** Determines if a path is a file
|
||||
*/
|
||||
@@ -536,10 +537,18 @@ namespace Anope
|
||||
*/
|
||||
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
|
||||
|
||||
/** Main processing routine. Parses the message and takes the appropriate action.
|
||||
* @param Raw message from the uplink
|
||||
/** Parses a raw message from the uplink and calls its command handler.
|
||||
* @param message Raw message from the uplink
|
||||
*/
|
||||
extern void Process(const Anope::string &);
|
||||
extern void Process(const Anope::string &message);
|
||||
|
||||
/** Calls the command handler for an already parsed message.
|
||||
* @param source Source of the message.
|
||||
* @param command Command name.
|
||||
* @param params Any extra parameters.
|
||||
* @param tags IRCv3 message tags.
|
||||
*/
|
||||
extern CoreExport void ProcessInternal(MessageSource &src, const Anope::string &command, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> & tags);
|
||||
|
||||
/** Does a blocking dns query and returns the first IP.
|
||||
* @param host host to look up
|
||||
@@ -559,6 +568,61 @@ namespace Anope
|
||||
* @param len The length of the string returned
|
||||
*/
|
||||
extern CoreExport Anope::string Random(size_t len);
|
||||
|
||||
/** Generate a random number. */
|
||||
extern CoreExport int RandomNumber();
|
||||
|
||||
/** Calculates the levenshtein distance between two strings.
|
||||
* @param s1 The first string.
|
||||
* @param s2 The second string.
|
||||
*/
|
||||
extern CoreExport size_t Distance(const Anope::string &s1, const Anope::string &s2);
|
||||
|
||||
/** Update the current time. */
|
||||
extern CoreExport void UpdateTime();
|
||||
|
||||
/** Expands a path fragment that is relative to the base directory.
|
||||
* @param base The base directory that it is relative to.
|
||||
* @param fragment The fragment to expand.
|
||||
*/
|
||||
extern CoreExport Anope::string Expand(const Anope::string &base, const Anope::string &fragment);
|
||||
|
||||
/** Expands a config path. */
|
||||
inline auto ExpandConfig(const Anope::string &path) { return Expand(ConfigDir, path); }
|
||||
|
||||
/** Expands a data path. */
|
||||
inline auto ExpandData(const Anope::string &path) { return Expand(DataDir, path); }
|
||||
|
||||
/** Expands a locale path. */
|
||||
inline auto ExpandLocale(const Anope::string &path) { return Expand(LocaleDir, path); }
|
||||
|
||||
/** Expands a log path. */
|
||||
inline auto ExpandLog(const Anope::string &path) { return Expand(LogDir, path); }
|
||||
|
||||
/** Expands a module path. */
|
||||
inline auto ExpandModule(const Anope::string &path) { return Expand(ModuleDir, path); }
|
||||
|
||||
/** Formats a CTCP message for sending to a client.
|
||||
* @param name The name of the CTCP.
|
||||
* @param body If present then the body of the CTCP.
|
||||
* @return A formatted CTCP ready to send to a client.
|
||||
*/
|
||||
extern CoreExport Anope::string FormatCTCP(const Anope::string &name, const Anope::string &body = "");
|
||||
|
||||
/** Parses a CTCP message received from a client.
|
||||
* @param text The raw message to parse.
|
||||
* @param name The location to store the name of the CTCP.
|
||||
* @param body The location to store body of the CTCP if one is present.
|
||||
* @return True if the message was a well formed CTCP; otherwise, false.
|
||||
*/
|
||||
extern CoreExport bool ParseCTCP(const Anope::string &text, Anope::string &name, Anope::string &body);
|
||||
|
||||
/** Replaces template variables within a string with values from a map.
|
||||
* @param str The string to template from.
|
||||
* @param vars The variables to replace within the string.
|
||||
* @return The specified string with all variables replaced within it.
|
||||
*/
|
||||
extern CoreExport Anope::string Template(const Anope::string &str, const Anope::map<Anope::string> &vars);
|
||||
}
|
||||
|
||||
/** sepstream allows for splitting token separated lists.
|
||||
@@ -568,7 +632,7 @@ namespace Anope
|
||||
*/
|
||||
class CoreExport sepstream
|
||||
{
|
||||
private:
|
||||
private:
|
||||
/** Original string.
|
||||
*/
|
||||
Anope::string tokens;
|
||||
@@ -577,15 +641,18 @@ class CoreExport sepstream
|
||||
char sep;
|
||||
/** Current string position
|
||||
*/
|
||||
size_t pos;
|
||||
size_t pos = 0;
|
||||
/** If set then GetToken() can return an empty string
|
||||
*/
|
||||
bool allow_empty;
|
||||
public:
|
||||
public:
|
||||
/** Create a sepstream and fill it with the provided data
|
||||
*/
|
||||
sepstream(const Anope::string &source, char separator, bool allowempty = false);
|
||||
|
||||
/** Retrieves the underlying string. */
|
||||
const auto &GetString() const { return tokens; }
|
||||
|
||||
/** 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
|
||||
@@ -602,7 +669,7 @@ class CoreExport sepstream
|
||||
/** Gets every token from this stream
|
||||
* @param token Tokens are pushed back here
|
||||
*/
|
||||
template<typename T> void GetTokens(T& token)
|
||||
template<typename T> void GetTokens(T &token)
|
||||
{
|
||||
token.clear();
|
||||
Anope::string t;
|
||||
@@ -625,7 +692,7 @@ class CoreExport sepstream
|
||||
/** Fetch the entire remaining stream, without tokenizing
|
||||
* @return The remaining part of the stream
|
||||
*/
|
||||
const Anope::string GetRemaining();
|
||||
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
|
||||
@@ -635,9 +702,10 @@ class CoreExport sepstream
|
||||
|
||||
/** A derived form of sepstream, which separates on commas
|
||||
*/
|
||||
class commasepstream : public sepstream
|
||||
class commasepstream final
|
||||
: public sepstream
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** Initialize with comma separator
|
||||
*/
|
||||
commasepstream(const Anope::string &source, bool allowempty = false) : sepstream(source, ',', allowempty) { }
|
||||
@@ -645,9 +713,10 @@ class commasepstream : public sepstream
|
||||
|
||||
/** A derived form of sepstream, which separates on spaces
|
||||
*/
|
||||
class spacesepstream : public sepstream
|
||||
class spacesepstream final
|
||||
: public sepstream
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** Initialize with space separator
|
||||
*/
|
||||
spacesepstream(const Anope::string &source) : sepstream(source, ' ') { }
|
||||
@@ -659,19 +728,17 @@ class spacesepstream : public sepstream
|
||||
* 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 CoreException : public std::exception
|
||||
class CoreExport CoreException
|
||||
: public std::exception
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
/** Holds the error message to be displayed
|
||||
*/
|
||||
Anope::string err;
|
||||
/** Source of the exception
|
||||
*/
|
||||
Anope::string source;
|
||||
public:
|
||||
/** Default constructor, just uses the error message 'Core threw an exception'.
|
||||
*/
|
||||
CoreException() : err("Core threw an exception"), source("The core") { }
|
||||
public:
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
CoreException(const Anope::string &message) : err(message), source("The core") { }
|
||||
@@ -683,7 +750,7 @@ class CoreException : public std::exception
|
||||
* Actually no, it does nothing. Never mind.
|
||||
* @throws Nothing!
|
||||
*/
|
||||
virtual ~CoreException() throw() { }
|
||||
virtual ~CoreException() noexcept = default;
|
||||
/** Returns the reason for the exception.
|
||||
* The module should probably put something informative here as the user will see this upon failure.
|
||||
*/
|
||||
@@ -698,13 +765,10 @@ class CoreException : public std::exception
|
||||
}
|
||||
};
|
||||
|
||||
class ModuleException : public CoreException
|
||||
class CoreExport ModuleException
|
||||
: public CoreException
|
||||
{
|
||||
public:
|
||||
/** Default constructor, just uses the error message 'Module threw an exception'.
|
||||
*/
|
||||
ModuleException() : CoreException("Module threw an exception", "A Module") { }
|
||||
|
||||
public:
|
||||
/** This constructor can be used to specify an error message before throwing.
|
||||
*/
|
||||
ModuleException(const Anope::string &message) : CoreException(message, "A Module") { }
|
||||
@@ -712,69 +776,9 @@ class ModuleException : public CoreException
|
||||
* Actually no, it does nothing. Never mind.
|
||||
* @throws Nothing!
|
||||
*/
|
||||
virtual ~ModuleException() throw() { }
|
||||
virtual ~ModuleException() noexcept = default;
|
||||
};
|
||||
|
||||
class ConvertException : public CoreException
|
||||
{
|
||||
public:
|
||||
ConvertException(const Anope::string &reason = "") : CoreException(reason) { }
|
||||
|
||||
virtual ~ConvertException() throw() { }
|
||||
};
|
||||
|
||||
/** Convert something to a string
|
||||
*/
|
||||
template<typename T> inline Anope::string stringify(const T &x)
|
||||
{
|
||||
std::ostringstream stream;
|
||||
|
||||
if (!(stream << x))
|
||||
throw ConvertException("Stringify fail");
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
template<typename T> inline void convert(const Anope::string &s, T &x, Anope::string &leftover, bool failIfLeftoverChars = true)
|
||||
{
|
||||
leftover.clear();
|
||||
std::istringstream i(s.str());
|
||||
char c;
|
||||
if (!(i >> x))
|
||||
throw ConvertException("Convert fail");
|
||||
if (failIfLeftoverChars)
|
||||
{
|
||||
if (i.get(c))
|
||||
throw ConvertException("Convert fail");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string left;
|
||||
getline(i, left);
|
||||
leftover = left;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T> inline void convert(const Anope::string &s, T &x, bool failIfLeftoverChars = true)
|
||||
{
|
||||
Anope::string Unused;
|
||||
convert(s, x, Unused, failIfLeftoverChars);
|
||||
}
|
||||
|
||||
template<typename T> inline T convertTo(const Anope::string &s, Anope::string &leftover, bool failIfLeftoverChars = true)
|
||||
{
|
||||
T x;
|
||||
convert(s, x, leftover, failIfLeftoverChars);
|
||||
return x;
|
||||
}
|
||||
|
||||
template<typename T> inline T convertTo(const Anope::string &s, bool failIfLeftoverChars = true)
|
||||
{
|
||||
T x;
|
||||
convert(s, x, failIfLeftoverChars);
|
||||
return x;
|
||||
}
|
||||
|
||||
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
|
||||
* for debug builds and static_cast on release builds
|
||||
* to speed up the program because dynamic_cast relies on RTTI.
|
||||
@@ -795,4 +799,4 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ANOPE_H
|
||||
#include "convert.h"
|
||||
|
||||
+16
-21
@@ -6,8 +6,7 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef BASE_H
|
||||
#define BASE_H
|
||||
#pragma once
|
||||
|
||||
#include "services.h"
|
||||
|
||||
@@ -16,9 +15,8 @@
|
||||
class CoreExport Base
|
||||
{
|
||||
/* References to this base class */
|
||||
std::set<ReferenceBase *> *references;
|
||||
public:
|
||||
Base();
|
||||
std::set<ReferenceBase *> *references = nullptr;
|
||||
public:
|
||||
virtual ~Base();
|
||||
|
||||
/** Adds a reference to this object. Eg, when a Reference
|
||||
@@ -32,12 +30,12 @@ class CoreExport Base
|
||||
|
||||
class ReferenceBase
|
||||
{
|
||||
protected:
|
||||
bool invalid;
|
||||
public:
|
||||
ReferenceBase() : invalid(false) { }
|
||||
protected:
|
||||
bool invalid = false;
|
||||
public:
|
||||
ReferenceBase() = default;
|
||||
ReferenceBase(const ReferenceBase &other) : invalid(other.invalid) { }
|
||||
virtual ~ReferenceBase() { }
|
||||
virtual ~ReferenceBase() = default;
|
||||
inline void Invalidate() { this->invalid = true; }
|
||||
};
|
||||
|
||||
@@ -45,14 +43,13 @@ class ReferenceBase
|
||||
* no longer be valid once the object it refers is destructed.
|
||||
*/
|
||||
template<typename T>
|
||||
class Reference : public ReferenceBase
|
||||
class Reference
|
||||
: public ReferenceBase
|
||||
{
|
||||
protected:
|
||||
T *ref;
|
||||
public:
|
||||
Reference() : ref(NULL)
|
||||
{
|
||||
}
|
||||
protected:
|
||||
T *ref = nullptr;
|
||||
public:
|
||||
Reference() = default;
|
||||
|
||||
Reference(T *obj) : ref(obj)
|
||||
{
|
||||
@@ -106,14 +103,14 @@ class Reference : public ReferenceBase
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator->()
|
||||
inline T *operator->()
|
||||
{
|
||||
if (operator bool())
|
||||
return this->ref;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator*()
|
||||
inline T *operator*()
|
||||
{
|
||||
if (operator bool())
|
||||
return this->ref;
|
||||
@@ -139,5 +136,3 @@ class Reference : public ReferenceBase
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // BASE_H
|
||||
|
||||
+25
-10
@@ -6,8 +6,7 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef BOTS_H
|
||||
#define BOTS_H
|
||||
#pragma once
|
||||
|
||||
#include "users.h"
|
||||
#include "anope.h"
|
||||
@@ -20,16 +19,30 @@ typedef Anope::map<BotInfo *> botinfo_map;
|
||||
extern CoreExport Serialize::Checker<botinfo_map> BotListByNick, BotListByUID;
|
||||
|
||||
/* A service bot (NickServ, ChanServ, a BotServ bot, etc). */
|
||||
class CoreExport BotInfo : public User, public Serializable
|
||||
class CoreExport BotInfo final
|
||||
: public User
|
||||
, public Serializable
|
||||
{
|
||||
public:
|
||||
struct Type final
|
||||
: public Serialize::Type
|
||||
{
|
||||
Type();
|
||||
void Serialize(const Serializable *obj, Serialize::Data &data) const override;
|
||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
|
||||
};
|
||||
|
||||
private:
|
||||
/* Channels this bot is assigned to */
|
||||
Serialize::Checker<std::set<ChannelInfo *> > channels;
|
||||
public:
|
||||
public:
|
||||
time_t created;
|
||||
/* Last time this bot said something (via privmsg) */
|
||||
time_t lastmsg;
|
||||
/* Map of actual command names -> service name/permission required */
|
||||
CommandInfo::map commands;
|
||||
/* The server-side alias used to message this bot. */
|
||||
Anope::string alias;
|
||||
/* Modes the bot should have as configured in service:modes */
|
||||
Anope::string botmodes;
|
||||
/* Channels the bot should be in as configured in service:channels */
|
||||
@@ -55,7 +68,7 @@ class CoreExport BotInfo : public User, public Serializable
|
||||
virtual ~BotInfo();
|
||||
|
||||
void Serialize(Serialize::Data &data) const;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
void GenerateUID();
|
||||
|
||||
@@ -107,8 +120,9 @@ class CoreExport BotInfo : public User, public Serializable
|
||||
/** Called when a user messages this bot
|
||||
* @param u The user
|
||||
* @param message The users' message
|
||||
* @params tags Message tags
|
||||
*/
|
||||
virtual void OnMessage(User *u, const Anope::string &message);
|
||||
virtual void OnMessage(User *u, const Anope::string &message, const Anope::map<Anope::string> &tags);
|
||||
|
||||
/** Link a command name to a command in services
|
||||
* @param cname The command name
|
||||
@@ -116,7 +130,7 @@ class CoreExport BotInfo : public User, public Serializable
|
||||
* @param permission Permission required to execute the command, if any
|
||||
* @return The commandinfo for the newly created command
|
||||
*/
|
||||
CommandInfo& SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
|
||||
CommandInfo &SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
|
||||
|
||||
/** Get command info for a command
|
||||
* @param cname The command name
|
||||
@@ -124,12 +138,13 @@ class CoreExport BotInfo : public User, public Serializable
|
||||
*/
|
||||
CommandInfo *GetCommand(const Anope::string &cname);
|
||||
|
||||
/** Get the command that users can use to send a message to this bot. */
|
||||
Anope::string GetQueryCommand(const Anope::string &command = "", const Anope::string &extra = "") const;
|
||||
|
||||
/** Find a bot by nick
|
||||
* @param nick The nick
|
||||
* @param nick_only True to only look by nick, and not by UID
|
||||
* @return The bot, if it exists
|
||||
*/
|
||||
static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
|
||||
static BotInfo *Find(const Anope::string &nick, bool nick_only = false);
|
||||
};
|
||||
|
||||
#endif // BOTS_H
|
||||
|
||||
+29
-27
@@ -6,20 +6,20 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef CHANNELS_H
|
||||
#define CHANNELS_H
|
||||
#pragma once
|
||||
|
||||
#include "anope.h"
|
||||
#include "extensible.h"
|
||||
#include "modes.h"
|
||||
#include "serialize.h"
|
||||
|
||||
typedef Anope::hash_map<Channel *> channel_map;
|
||||
typedef Anope::unordered_map<Channel *> channel_map;
|
||||
|
||||
extern CoreExport channel_map ChannelList;
|
||||
|
||||
/* A user container, there is one of these per user per channel. */
|
||||
struct ChanUserContainer : public Extensible
|
||||
struct ChanUserContainer final
|
||||
: public Extensible
|
||||
{
|
||||
User *user;
|
||||
Channel *chan;
|
||||
@@ -29,28 +29,30 @@ struct ChanUserContainer : public Extensible
|
||||
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
|
||||
};
|
||||
|
||||
class CoreExport Channel : public Base, public Extensible
|
||||
class CoreExport Channel final
|
||||
: public Base
|
||||
, public Extensible
|
||||
{
|
||||
static std::vector<Channel *> deleting;
|
||||
|
||||
public:
|
||||
public:
|
||||
typedef std::multimap<Anope::string, Anope::string> ModeList;
|
||||
private:
|
||||
private:
|
||||
/** A map of channel modes with their parameters set on this channel
|
||||
*/
|
||||
ModeList modes;
|
||||
|
||||
public:
|
||||
public:
|
||||
/* Channel name */
|
||||
Anope::string name;
|
||||
/* Set if this channel is registered. ci->c == this. Contains information relevant to the registered channel */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
/* When the channel was created */
|
||||
time_t creation_time;
|
||||
time_t created;
|
||||
/* If the channel has just been created in a netjoin */
|
||||
bool syncing;
|
||||
bool syncing = false;
|
||||
/* Is configured in the conf as a channel bots should be in */
|
||||
bool botchannel;
|
||||
bool botchannel = false;
|
||||
|
||||
/* Users in the channel */
|
||||
typedef std::map<User *, ChanUserContainer *> ChanUserList;
|
||||
@@ -64,24 +66,24 @@ class CoreExport Channel : public Base, public Extensible
|
||||
* This is the time the topic was *originally set*. When we restore the topic we want to change the TS back
|
||||
* to this, but we can only do this on certain IRCds.
|
||||
*/
|
||||
time_t topic_ts;
|
||||
time_t topic_ts = 0;
|
||||
/* The actual time the topic was set, probably close to Anope::CurTime */
|
||||
time_t topic_time;
|
||||
time_t topic_time = 0;
|
||||
|
||||
time_t server_modetime; /* Time of last server MODE */
|
||||
time_t chanserv_modetime; /* Time of last check_modes() */
|
||||
int16_t server_modecount; /* Number of server MODEs this second */
|
||||
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
|
||||
int16_t bouncy_modes; /* Did we fail to set modes here? */
|
||||
time_t server_modetime = 0; /* Time of last server MODE */
|
||||
time_t chanserv_modetime = 0; /* Time of last check_modes() */
|
||||
int16_t server_modecount = 0; /* Number of server MODEs this second */
|
||||
int16_t chanserv_modecount = 0; /* Number of check_mode()'s this sec */
|
||||
bool bouncy_modes = false; /* Did we fail to set modes here? */
|
||||
|
||||
private:
|
||||
private:
|
||||
/** Constructor
|
||||
* @param name The channel name
|
||||
* @param ts The time the channel was created
|
||||
*/
|
||||
Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
|
||||
|
||||
public:
|
||||
public:
|
||||
/** Destructor
|
||||
*/
|
||||
~Channel();
|
||||
@@ -108,7 +110,7 @@ class CoreExport Channel : public Base, public Extensible
|
||||
* @param status The status to give the user, if any
|
||||
* @return The UserContainer for the user
|
||||
*/
|
||||
ChanUserContainer* JoinUser(User *u, const ChannelStatus *status);
|
||||
ChanUserContainer *JoinUser(User *u, const ChannelStatus *status);
|
||||
|
||||
/** Remove a user internally from the channel
|
||||
* @param u The user
|
||||
@@ -205,14 +207,15 @@ class CoreExport Channel : public Base, public Extensible
|
||||
* @param enforce_mlock Should mlock be enforced on this mode change
|
||||
* @param cmodes The modes to set
|
||||
*/
|
||||
void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...);
|
||||
void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...) ATTR_FORMAT(4, 5);
|
||||
void SetModes(BotInfo *bi, bool enforce_mlock, const Anope::string &cmodes);
|
||||
|
||||
/** Set a string of modes internally on a channel
|
||||
* @param source The setter
|
||||
* @param mode the modes
|
||||
* @param enforce_mlock true to enforce mlock
|
||||
*/
|
||||
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts = 0, bool enforce_mlock = true);
|
||||
void SetModesInternal(MessageSource &source, const Anope::string &modes, const std::vector<Anope::string> ¶ms, time_t ts = 0, bool enforce_mlock = true);
|
||||
|
||||
/** Does the given user match the given list? (CMODE_BAN, CMODE_EXCEPT, etc, a list mode)
|
||||
* @param u The user
|
||||
@@ -234,7 +237,8 @@ class CoreExport Channel : public Base, public Extensible
|
||||
* @param reason The reason for the kick
|
||||
* @return true if the kick was successful, false if a module blocked the kick
|
||||
*/
|
||||
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
|
||||
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...) ATTR_FORMAT(4, 5);
|
||||
bool Kick(BotInfo *bi, User *u, const Anope::string &reason);
|
||||
|
||||
/** Get all modes set on this channel, excluding status modes.
|
||||
* @return a map of modes and their optional parameters.
|
||||
@@ -298,7 +302,7 @@ class CoreExport Channel : public Base, public Extensible
|
||||
* @param name The channel to find
|
||||
* @return The channel, if found
|
||||
*/
|
||||
static Channel* Find(const Anope::string &name);
|
||||
static Channel *Find(const Anope::string &name);
|
||||
|
||||
/** Finds or creates a channel
|
||||
* @param name The channel name
|
||||
@@ -311,5 +315,3 @@ class CoreExport Channel : public Base, public Extensible
|
||||
|
||||
static void DeleteChannels();
|
||||
};
|
||||
|
||||
#endif // CHANNELS_H
|
||||
|
||||
+29
-28
@@ -9,25 +9,23 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef COMMAND_H
|
||||
#define COMMAND_H
|
||||
#pragma once
|
||||
|
||||
#include "service.h"
|
||||
#include "anope.h"
|
||||
#include "channels.h"
|
||||
#include "textproc.h"
|
||||
|
||||
struct CommandGroup
|
||||
struct CommandGroup final
|
||||
{
|
||||
Anope::string name, description;
|
||||
};
|
||||
|
||||
/* Used in BotInfo::commands */
|
||||
struct CommandInfo
|
||||
struct CommandInfo final
|
||||
{
|
||||
typedef Anope::map<CommandInfo> map;
|
||||
|
||||
CommandInfo() : hide(false), prepend_channel(false) { }
|
||||
|
||||
/* Service name of the command */
|
||||
Anope::string name;
|
||||
/* Permission required to execute the command */
|
||||
@@ -35,9 +33,9 @@ struct CommandInfo
|
||||
/* Group this command is in */
|
||||
Anope::string group;
|
||||
/* whether or not to hide this command in help output */
|
||||
bool hide;
|
||||
bool hide = false;
|
||||
/* Only used with fantasy */
|
||||
bool prepend_channel;
|
||||
bool prepend_channel = false;
|
||||
};
|
||||
|
||||
/* Where the replies from commands go to. User inherits from this and is the normal
|
||||
@@ -45,18 +43,19 @@ struct CommandInfo
|
||||
*/
|
||||
struct CoreExport CommandReply
|
||||
{
|
||||
virtual ~CommandReply() { }
|
||||
virtual ~CommandReply() = default;
|
||||
virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
|
||||
virtual void SendMessage(CommandSource &source, const Anope::string &msg);
|
||||
};
|
||||
|
||||
/* The source for a command */
|
||||
class CoreExport CommandSource
|
||||
class CoreExport CommandSource final
|
||||
{
|
||||
/* The nick executing the command */
|
||||
Anope::string nick;
|
||||
/* User executing the command, may be NULL */
|
||||
Reference<User> u;
|
||||
public:
|
||||
public:
|
||||
/* The account executing the command */
|
||||
Reference<NickCore> nc;
|
||||
/* for web clients */
|
||||
@@ -64,15 +63,17 @@ class CoreExport CommandSource
|
||||
/* Where the reply should go */
|
||||
CommandReply *reply;
|
||||
/* Channel the command was executed on (fantasy) */
|
||||
Reference<Channel> c;
|
||||
Reference<Channel> c = nullptr;
|
||||
/* The service this command is on */
|
||||
Reference<BotInfo> service;
|
||||
/* The actual name of the command being executed */
|
||||
Anope::string command;
|
||||
/* The permission of the command being executed */
|
||||
Anope::string permission;
|
||||
/* The unique identifier of the executing message. */
|
||||
Anope::string msgid;
|
||||
|
||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi);
|
||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi, const Anope::string &m = "");
|
||||
|
||||
const Anope::string &GetNick() const;
|
||||
User *GetUser();
|
||||
@@ -80,7 +81,8 @@ class CoreExport CommandSource
|
||||
AccessGroup AccessFor(ChannelInfo *ci);
|
||||
bool IsFounder(ChannelInfo *ci);
|
||||
|
||||
void Reply(const char *message, ...);
|
||||
void Reply(const char *message, ...) ATTR_FORMAT(2, 3);
|
||||
void Reply(int count, const char *singular, const char *plural, ...) ATTR_FORMAT(4, 5);
|
||||
void Reply(const Anope::string &message);
|
||||
|
||||
bool HasCommand(const Anope::string &cmd);
|
||||
@@ -91,16 +93,17 @@ class CoreExport CommandSource
|
||||
|
||||
/** Every services command is a class, inheriting from Command.
|
||||
*/
|
||||
class CoreExport Command : public Service
|
||||
class CoreExport Command
|
||||
: public Service
|
||||
{
|
||||
Anope::string desc;
|
||||
std::vector<Anope::string> syntax;
|
||||
std::vector<std::pair<Anope::string, std::function<bool(CommandSource&)>>> syntax;
|
||||
/* Allow unregistered users to use this command */
|
||||
bool allow_unregistered;
|
||||
/* Command requires that a user is executing it */
|
||||
bool require_user;
|
||||
|
||||
public:
|
||||
public:
|
||||
/* Maximum parameters accepted by this command */
|
||||
size_t max_params;
|
||||
/* Minimum parameters required to use this command */
|
||||
@@ -109,7 +112,7 @@ class CoreExport Command : public Service
|
||||
/* Module which owns us */
|
||||
Module *module;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/** Create a new command.
|
||||
* @param owner The owner of the command
|
||||
* @param sname The command name
|
||||
@@ -119,20 +122,20 @@ class CoreExport Command : public Service
|
||||
*/
|
||||
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
|
||||
|
||||
public:
|
||||
virtual ~Command();
|
||||
public:
|
||||
virtual ~Command() = default;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void SetDesc(const Anope::string &d);
|
||||
|
||||
void ClearSyntax();
|
||||
void SetSyntax(const Anope::string &s);
|
||||
void SetSyntax(const Anope::string &s, const std::function<bool(CommandSource&)> &p = nullptr);
|
||||
void SendSyntax(CommandSource &);
|
||||
|
||||
void AllowUnregistered(bool b);
|
||||
void RequireUser(bool b);
|
||||
|
||||
public:
|
||||
public:
|
||||
bool AllowUnregistered() const;
|
||||
bool RequireUser() const;
|
||||
|
||||
@@ -148,10 +151,10 @@ class CoreExport Command : public Service
|
||||
*/
|
||||
virtual void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) = 0;
|
||||
|
||||
/** Called when HELP is requested for the client this command is on.
|
||||
/** Called when help is requested for the client this command is on.
|
||||
* @param source The source
|
||||
*/
|
||||
virtual void OnServHelp(CommandSource &source);
|
||||
virtual void OnServHelp(CommandSource &source, HelpWrapper &help);
|
||||
|
||||
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
|
||||
* @param source The source
|
||||
@@ -181,7 +184,5 @@ class CoreExport Command : public Service
|
||||
* @param name If found, is set to the command name, eg REGISTER
|
||||
* @return true if the given command service exists
|
||||
*/
|
||||
static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name);
|
||||
static bool FindCommandFromService(const Anope::string &command_service, BotInfo *&bi, Anope::string &name);
|
||||
};
|
||||
|
||||
#endif // COMMANDS_H
|
||||
|
||||
+35
-55
@@ -9,28 +9,24 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include "account.h"
|
||||
#include "regchannel.h"
|
||||
#include "users.h"
|
||||
#include "opertype.h"
|
||||
#include <stack>
|
||||
|
||||
namespace Configuration
|
||||
{
|
||||
namespace Internal
|
||||
{
|
||||
class CoreExport Block
|
||||
{
|
||||
friend struct Configuration::Conf;
|
||||
friend class Configuration::Conf;
|
||||
|
||||
public:
|
||||
public:
|
||||
typedef Anope::map<Anope::string> item_map;
|
||||
typedef Anope::multimap<Block> block_map;
|
||||
|
||||
private:
|
||||
private:
|
||||
Anope::string name;
|
||||
item_map items;
|
||||
block_map blocks;
|
||||
@@ -39,52 +35,34 @@ namespace Configuration
|
||||
/* Represents a missing tag. */
|
||||
static Block EmptyBlock;
|
||||
|
||||
public:
|
||||
public:
|
||||
Block(const Anope::string &);
|
||||
const Anope::string &GetName() const;
|
||||
int CountBlock(const Anope::string &name) const;
|
||||
const Block* GetBlock(const Anope::string &name, int num = 0) const;
|
||||
Block* GetMutableBlock(const Anope::string &name, int num = 0);
|
||||
const Block &GetBlock(const Anope::string &name, int num = 0) const;
|
||||
Block *GetMutableBlock(const Anope::string &name, int num = 0);
|
||||
|
||||
template<typename T> inline T Get(const Anope::string &tag) const
|
||||
template<typename T> T Get(const Anope::string &tag, const Anope::string &def = "") const
|
||||
{
|
||||
return this->Get<T>(tag, "");
|
||||
}
|
||||
/* VS 2008 has an issue with having a default argument here (def = ""), which is why the above
|
||||
* function exists.
|
||||
*/
|
||||
template<typename T> T Get(const Anope::string &tag, const Anope::string &def) const
|
||||
{
|
||||
const Anope::string &value = this->Get<const Anope::string>(tag, def);
|
||||
if (!value.empty())
|
||||
try
|
||||
{
|
||||
return convertTo<T>(value);
|
||||
}
|
||||
catch (const ConvertException &) { }
|
||||
return T();
|
||||
return Anope::TryConvert<T>(this->Get<const Anope::string>(tag, def)).value_or(T());
|
||||
}
|
||||
|
||||
bool Set(const Anope::string &tag, const Anope::string &value);
|
||||
const item_map* GetItems() const;
|
||||
const item_map &GetItems() const;
|
||||
};
|
||||
|
||||
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const;
|
||||
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
} // namespace Internal
|
||||
|
||||
typedef const Internal::Block Block;
|
||||
typedef Internal::Block MutableBlock;
|
||||
|
||||
/** Represents a configuration file
|
||||
*/
|
||||
class File
|
||||
class File final
|
||||
{
|
||||
Anope::string name;
|
||||
bool executable;
|
||||
FILE *fp;
|
||||
public:
|
||||
FILE *fp = nullptr;
|
||||
public:
|
||||
File(const Anope::string &, bool);
|
||||
~File();
|
||||
const Anope::string &GetName() const;
|
||||
@@ -99,25 +77,27 @@ namespace Configuration
|
||||
|
||||
struct Uplink;
|
||||
|
||||
struct CoreExport Conf : Block
|
||||
class CoreExport Conf final
|
||||
: public Block
|
||||
{
|
||||
private:
|
||||
/** Replaces defined variables within a string. */
|
||||
Anope::string ReplaceVars(const Anope::string &str, const File &file, int linenumber);
|
||||
|
||||
public:
|
||||
/* options:readtimeout */
|
||||
time_t ReadTimeout;
|
||||
/* options:useprivmsg */
|
||||
bool UsePrivmsg;
|
||||
/* If we should default to privmsging clients */
|
||||
bool DefPrivmsg;
|
||||
/* Default language */
|
||||
Anope::string DefLanguage;
|
||||
/* options:timeoutcheck */
|
||||
time_t TimeoutCheck;
|
||||
/* options:usestrictprivmsg */
|
||||
bool UseStrictPrivmsg;
|
||||
/* options:servicealias */
|
||||
bool ServiceAlias;
|
||||
/* networkinfo:nickchars */
|
||||
Anope::string NickChars;
|
||||
|
||||
/* either "/msg " or "/" */
|
||||
Anope::string StrictPrivmsg;
|
||||
/* List of uplink servers to try and connect to */
|
||||
std::vector<Uplink> Uplinks;
|
||||
/* A vector of our logfile options */
|
||||
@@ -145,24 +125,25 @@ namespace Configuration
|
||||
void LoadConf(File &file);
|
||||
void Post(Conf *old);
|
||||
|
||||
Block *GetModule(Module *);
|
||||
Block *GetModule(const Anope::string &name);
|
||||
Block &GetModule(const Module *);
|
||||
Block &GetModule(const Anope::string &name);
|
||||
|
||||
BotInfo *GetClient(const Anope::string &name);
|
||||
|
||||
const Block *GetCommand(CommandSource &);
|
||||
const Block &GetCommand(CommandSource &);
|
||||
};
|
||||
|
||||
struct Uplink
|
||||
struct Uplink final
|
||||
{
|
||||
Anope::string host;
|
||||
unsigned port;
|
||||
Anope::string password;
|
||||
bool ipv6;
|
||||
int protocol;
|
||||
|
||||
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, bool _ipv6) : host(_host), port(_port), password(_password), ipv6(_ipv6) { }
|
||||
inline bool operator==(const Uplink &other) const { return host == other.host && port == other.port && password == other.password && ipv6 == other.ipv6; }
|
||||
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, int _protocol) : host(_host), port(_port), password(_password), protocol(_protocol) { }
|
||||
inline bool operator==(const Uplink &other) const { return host == other.host && port == other.port && password == other.password && protocol == other.protocol; }
|
||||
inline bool operator!=(const Uplink &other) const { return !(*this == other); }
|
||||
Anope::string str() const;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -172,9 +153,10 @@ namespace Configuration
|
||||
* 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
|
||||
class CoreExport ConfigException final
|
||||
: public CoreException
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** Default constructor, just uses the error message 'Config threw an exception'.
|
||||
*/
|
||||
ConfigException() : CoreException("Config threw an exception", "Config Parser") { }
|
||||
@@ -185,10 +167,8 @@ class ConfigException : public CoreException
|
||||
* Actually no, it does nothing. Never mind.
|
||||
* @throws Nothing!
|
||||
*/
|
||||
virtual ~ConfigException() throw() { }
|
||||
virtual ~ConfigException() noexcept = default;
|
||||
};
|
||||
|
||||
extern Configuration::File ServicesConf;
|
||||
extern CoreExport Configuration::Conf *Config;
|
||||
|
||||
#endif // CONFIG_H
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2025 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace Anope
|
||||
{
|
||||
/** Attempts to convert a string to any type.
|
||||
* @param in The value to convert.
|
||||
* @param leftover If non-nullptr then the location to store leftover data.
|
||||
*/
|
||||
template<typename T>
|
||||
inline std::optional<T> TryConvert(const Anope::string &in, Anope::string *leftover = nullptr)
|
||||
{
|
||||
std::istringstream tmp(in.str());
|
||||
T out;
|
||||
if (!(tmp >> out))
|
||||
return std::nullopt;
|
||||
|
||||
if (leftover)
|
||||
{
|
||||
leftover->clear();
|
||||
std::getline(tmp, leftover->str());
|
||||
}
|
||||
else
|
||||
{
|
||||
char extra;
|
||||
if (tmp >> extra)
|
||||
return std::nullopt;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Converts a string to any type.
|
||||
* @param in The value to convert.
|
||||
* @param def The default to use if the conversion failed.
|
||||
* @param leftover If non-nullptr then the location to store leftover data.
|
||||
*/
|
||||
template<typename T>
|
||||
inline T Convert(const Anope::string &in, T def, Anope::string *leftover = nullptr)
|
||||
{
|
||||
return TryConvert<T>(in, leftover).value_or(def);
|
||||
}
|
||||
|
||||
/** Attempts to convert any type to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
template <class T>
|
||||
inline std::optional<Anope::string> TryString(const T &in)
|
||||
{
|
||||
std::ostringstream tmp;
|
||||
if (!(tmp << in))
|
||||
return std::nullopt;
|
||||
return tmp.str();
|
||||
}
|
||||
|
||||
/** No-op function that returns the string that was passed to it.
|
||||
* @param in The string to return.
|
||||
*/
|
||||
inline const string &ToString(const string &in)
|
||||
{
|
||||
return in;
|
||||
}
|
||||
|
||||
/** Converts a std::string to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
inline string ToString(const std::string &in)
|
||||
{
|
||||
return in;
|
||||
}
|
||||
|
||||
/** Converts a char array to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
inline string ToString(const char *in)
|
||||
{
|
||||
return string(in);
|
||||
}
|
||||
|
||||
/** Converts a char to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
inline string ToString(char in)
|
||||
{
|
||||
return string(1, static_cast<string::value_type>(in));
|
||||
}
|
||||
|
||||
/** Converts an unsigned char to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
inline string ToString(unsigned char in)
|
||||
{
|
||||
return string(1, static_cast<string::value_type>(in));
|
||||
}
|
||||
|
||||
/** Converts a bool to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
inline string ToString(bool in)
|
||||
{
|
||||
return (in ? "1" : "0");
|
||||
}
|
||||
|
||||
/** Converts a type that std::to_string is implemented for to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
template<typename Stringable>
|
||||
inline std::enable_if_t<std::is_arithmetic_v<Stringable>, string> ToString(const Stringable &in)
|
||||
{
|
||||
return std::to_string(in);
|
||||
}
|
||||
|
||||
/** Converts any type to a string.
|
||||
* @param in The value to convert.
|
||||
*/
|
||||
template <class T>
|
||||
inline std::enable_if_t<!std::is_arithmetic_v<T>, string> ToString(const T &in)
|
||||
{
|
||||
return TryString(in).value_or(Anope::string());
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -9,6 +9,8 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class AccessGroup;
|
||||
class AutoKick;
|
||||
class BotInfo;
|
||||
@@ -21,7 +23,7 @@ struct ChanUserContainer;
|
||||
class ClientSocket;
|
||||
class Command;
|
||||
class CommandSource;
|
||||
namespace Configuration { struct Conf; }
|
||||
namespace Configuration { class Conf; }
|
||||
class ConnectionSocket;
|
||||
namespace DNS { struct Query; }
|
||||
class Entry;
|
||||
|
||||
+53
-51
@@ -6,8 +6,7 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef EXTENSIBLE_H
|
||||
#define EXTENSIBLE_H
|
||||
#pragma once
|
||||
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
@@ -16,15 +15,16 @@
|
||||
|
||||
class Extensible;
|
||||
|
||||
class CoreExport ExtensibleBase : public Service
|
||||
class CoreExport ExtensibleBase
|
||||
: public Service
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
std::map<Extensible *, void *> items;
|
||||
|
||||
ExtensibleBase(Module *m, const Anope::string &n);
|
||||
~ExtensibleBase();
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual void Unset(Extensible *obj) = 0;
|
||||
|
||||
/* called when an object we are keep track of is serializing */
|
||||
@@ -34,19 +34,19 @@ class CoreExport ExtensibleBase : public Service
|
||||
|
||||
class CoreExport Extensible
|
||||
{
|
||||
public:
|
||||
public:
|
||||
std::set<ExtensibleBase *> extension_items;
|
||||
|
||||
virtual ~Extensible();
|
||||
|
||||
void UnsetExtensibles();
|
||||
|
||||
template<typename T> T* GetExt(const Anope::string &name) const;
|
||||
template<typename T> T *GetExt(const Anope::string &name) const;
|
||||
bool HasExt(const Anope::string &name) const;
|
||||
|
||||
template<typename T> T* Extend(const Anope::string &name, const T &what);
|
||||
template<typename T> T* Extend(const Anope::string &name);
|
||||
template<typename T> T* Require(const Anope::string &name);
|
||||
template<typename T> T *Extend(const Anope::string &name, const T &what);
|
||||
template<typename T> T *Extend(const Anope::string &name);
|
||||
template<typename T> T *Require(const Anope::string &name);
|
||||
template<typename T> void Shrink(const Anope::string &name);
|
||||
|
||||
static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
|
||||
@@ -54,12 +54,13 @@ class CoreExport Extensible
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class BaseExtensibleItem : public ExtensibleBase
|
||||
class BaseExtensibleItem
|
||||
: public ExtensibleBase
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
virtual T *Create(Extensible *) = 0;
|
||||
|
||||
public:
|
||||
public:
|
||||
BaseExtensibleItem(Module *m, const Anope::string &n) : ExtensibleBase(m, n) { }
|
||||
|
||||
~BaseExtensibleItem()
|
||||
@@ -76,24 +77,24 @@ class BaseExtensibleItem : public ExtensibleBase
|
||||
}
|
||||
}
|
||||
|
||||
T* Set(Extensible *obj, const T &value)
|
||||
T *Set(Extensible *obj, const T &value)
|
||||
{
|
||||
T* t = Set(obj);
|
||||
T *t = Set(obj);
|
||||
if (t)
|
||||
*t = value;
|
||||
return t;
|
||||
}
|
||||
|
||||
T* Set(Extensible *obj)
|
||||
T *Set(Extensible *obj)
|
||||
{
|
||||
T* t = Create(obj);
|
||||
T *t = Create(obj);
|
||||
Unset(obj);
|
||||
items[obj] = t;
|
||||
obj->extension_items.insert(this);
|
||||
return t;
|
||||
}
|
||||
|
||||
void Unset(Extensible *obj) anope_override
|
||||
void Unset(Extensible *obj) override
|
||||
{
|
||||
T *value = Get(obj);
|
||||
items.erase(obj);
|
||||
@@ -101,7 +102,7 @@ class BaseExtensibleItem : public ExtensibleBase
|
||||
delete value;
|
||||
}
|
||||
|
||||
T* Get(const Extensible *obj) const
|
||||
T *Get(const Extensible *obj) const
|
||||
{
|
||||
std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
|
||||
if (it != items.end())
|
||||
@@ -114,9 +115,9 @@ class BaseExtensibleItem : public ExtensibleBase
|
||||
return items.find(const_cast<Extensible *>(obj)) != items.end();
|
||||
}
|
||||
|
||||
T* Require(Extensible *obj)
|
||||
T *Require(Extensible *obj)
|
||||
{
|
||||
T* t = Get(obj);
|
||||
T *t = Get(obj);
|
||||
if (t)
|
||||
return t;
|
||||
|
||||
@@ -125,54 +126,57 @@ class BaseExtensibleItem : public ExtensibleBase
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class ExtensibleItem : public BaseExtensibleItem<T>
|
||||
class ExtensibleItem
|
||||
: public BaseExtensibleItem<T>
|
||||
{
|
||||
protected:
|
||||
T* Create(Extensible *obj) anope_override
|
||||
protected:
|
||||
T *Create(Extensible *obj) override
|
||||
{
|
||||
return new T(obj);
|
||||
}
|
||||
public:
|
||||
public:
|
||||
ExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class PrimitiveExtensibleItem : public BaseExtensibleItem<T>
|
||||
class PrimitiveExtensibleItem
|
||||
: public BaseExtensibleItem<T>
|
||||
{
|
||||
protected:
|
||||
T* Create(Extensible *obj) anope_override
|
||||
protected:
|
||||
T *Create(Extensible *obj) override
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
public:
|
||||
public:
|
||||
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
|
||||
};
|
||||
|
||||
template<>
|
||||
class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool>
|
||||
{
|
||||
protected:
|
||||
bool* Create(Extensible *) anope_override
|
||||
protected:
|
||||
bool *Create(Extensible *) override
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
public:
|
||||
public:
|
||||
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<bool>(m, n) { }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
|
||||
class SerializableExtensibleItem
|
||||
: public PrimitiveExtensibleItem<T>
|
||||
{
|
||||
public:
|
||||
public:
|
||||
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<T>(m, n) { }
|
||||
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
||||
{
|
||||
T* t = this->Get(e);
|
||||
data[this->name] << *t;
|
||||
T *t = this->Get(e);
|
||||
data.Store(this->name, *t);
|
||||
}
|
||||
|
||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
|
||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||
{
|
||||
T t;
|
||||
if (data[this->name] >> t)
|
||||
@@ -185,16 +189,15 @@ class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
|
||||
template<>
|
||||
class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool>
|
||||
{
|
||||
public:
|
||||
public:
|
||||
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<bool>(m, n) { }
|
||||
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
||||
{
|
||||
data.SetType(this->name, Serialize::Data::DT_INT);
|
||||
data[this->name] << this->HasExt(e);
|
||||
data.Store(this->name, this->HasExt(e));
|
||||
}
|
||||
|
||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
|
||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||
{
|
||||
bool b = false;
|
||||
data[this->name] >> b;
|
||||
@@ -206,13 +209,14 @@ class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool>
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct ExtensibleRef : ServiceReference<BaseExtensibleItem<T> >
|
||||
struct ExtensibleRef final
|
||||
: ServiceReference<BaseExtensibleItem<T> >
|
||||
{
|
||||
ExtensibleRef(const Anope::string &n) : ServiceReference<BaseExtensibleItem<T> >("Extensible", n) { }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::GetExt(const Anope::string &name) const
|
||||
T *Extensible::GetExt(const Anope::string &name) const
|
||||
{
|
||||
ExtensibleRef<T> ref(name);
|
||||
if (ref)
|
||||
@@ -223,16 +227,16 @@ T* Extensible::GetExt(const Anope::string &name) const
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Extend(const Anope::string &name, const T &what)
|
||||
T *Extensible::Extend(const Anope::string &name, const T &what)
|
||||
{
|
||||
T* t = Extend<T>(name);
|
||||
T *t = Extend<T>(name);
|
||||
if (t)
|
||||
*t = what;
|
||||
return t;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Extend(const Anope::string &name)
|
||||
T *Extensible::Extend(const Anope::string &name)
|
||||
{
|
||||
ExtensibleRef<T> ref(name);
|
||||
if (ref)
|
||||
@@ -243,7 +247,7 @@ T* Extensible::Extend(const Anope::string &name)
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Require(const Anope::string &name)
|
||||
T *Extensible::Require(const Anope::string &name)
|
||||
{
|
||||
if (HasExt(name))
|
||||
return GetExt<T>(name);
|
||||
@@ -260,5 +264,3 @@ void Extensible::Shrink(const Anope::string &name)
|
||||
else
|
||||
Log(LOG_DEBUG) << "Shrink for nonexistent type " << name << " on " << static_cast<void *>(this);
|
||||
}
|
||||
|
||||
#endif // EXTENSIBLE_H
|
||||
|
||||
+17
-24
@@ -6,19 +6,11 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef HASHCOMP_H
|
||||
#define HASHCOMP_H
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <locale>
|
||||
|
||||
#if defined _LIBCPP_VERSION || defined _WIN32
|
||||
#include <unordered_map>
|
||||
#define TR1NS std
|
||||
#else
|
||||
#include <tr1/unordered_map>
|
||||
#define TR1NS std::tr1
|
||||
#endif
|
||||
|
||||
#include "services.h"
|
||||
|
||||
@@ -29,16 +21,17 @@ namespace Anope
|
||||
/* Casemap in use by Anope. ci::string's comparison functions use this (and thus Anope::string) */
|
||||
extern std::locale casemap;
|
||||
|
||||
extern void CaseMapRebuild();
|
||||
extern unsigned char tolower(unsigned char);
|
||||
extern unsigned char toupper(unsigned char);
|
||||
extern CoreExport void CaseMapRebuild();
|
||||
extern CoreExport unsigned char tolower(unsigned char);
|
||||
extern CoreExport unsigned char toupper(unsigned char);
|
||||
|
||||
/* ASCII case insensitive ctype. */
|
||||
template<typename char_type>
|
||||
class ascii_ctype : public std::ctype<char_type>
|
||||
class ascii_ctype
|
||||
: public std::ctype<char_type>
|
||||
{
|
||||
public:
|
||||
char_type do_toupper(char_type c) const anope_override
|
||||
public:
|
||||
char_type do_toupper(char_type c) const override
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
return c - 32;
|
||||
@@ -46,7 +39,7 @@ namespace Anope
|
||||
return c;
|
||||
}
|
||||
|
||||
char_type do_tolower(char_type c) const anope_override
|
||||
char_type do_tolower(char_type c) const override
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return c + 32;
|
||||
@@ -57,10 +50,11 @@ namespace Anope
|
||||
|
||||
/* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */
|
||||
template<typename char_type>
|
||||
class rfc1459_ctype : public ascii_ctype<char_type>
|
||||
class rfc1459_ctype final
|
||||
: public ascii_ctype<char_type>
|
||||
{
|
||||
public:
|
||||
char_type do_toupper(char_type c) const anope_override
|
||||
public:
|
||||
char_type do_toupper(char_type c) const override
|
||||
{
|
||||
if (c == '{' || c == '}' || c == '|')
|
||||
return c - 32;
|
||||
@@ -68,7 +62,7 @@ namespace Anope
|
||||
return ascii_ctype<char_type>::do_toupper(c);
|
||||
}
|
||||
|
||||
char_type do_tolower(char_type c) const anope_override
|
||||
char_type do_tolower(char_type c) const override
|
||||
{
|
||||
if (c == '[' || c == ']' || c == '\\')
|
||||
return c + 32;
|
||||
@@ -86,7 +80,8 @@ namespace ci
|
||||
* This class is used to implement ci::string, a case-insensitive, ASCII-
|
||||
* comparing string class.
|
||||
*/
|
||||
struct CoreExport ci_char_traits : std::char_traits<char>
|
||||
struct CoreExport ci_char_traits final
|
||||
: std::char_traits<char>
|
||||
{
|
||||
/** Check if two chars match.
|
||||
* @param c1st First character
|
||||
@@ -131,7 +126,7 @@ namespace ci
|
||||
*/
|
||||
typedef std::basic_string<char, ci_char_traits, std::allocator<char> > string;
|
||||
|
||||
struct CoreExport less
|
||||
struct CoreExport less final
|
||||
{
|
||||
/** Compare two Anope::strings as ci::strings and find which one is less
|
||||
* @param s1 The first string
|
||||
@@ -195,5 +190,3 @@ inline bool operator!=(const std::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return !(leftval.c_str() == rightval);
|
||||
}
|
||||
|
||||
#endif // HASHCOMP_H
|
||||
|
||||
+63
-26
@@ -6,12 +6,14 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "anope.h"
|
||||
|
||||
namespace Language
|
||||
{
|
||||
|
||||
/* Languages we support as configured in services.conf. They are
|
||||
/* Languages we support as configured in anope.conf. They are
|
||||
* added to this list if we detect a language exists in the correct
|
||||
* location for each language.
|
||||
*/
|
||||
@@ -53,27 +55,65 @@ namespace Language
|
||||
*/
|
||||
extern CoreExport const char *Translate(const NickCore *nc, const char *string);
|
||||
|
||||
/** Translatesa string to the given language.
|
||||
/** Translates a string to the given language.
|
||||
* @param lang The language to translate to
|
||||
* @param string The string to translate
|
||||
* @return The translated string if found, else the original string.
|
||||
*/
|
||||
extern CoreExport const char *Translate(const char *lang, const char *string);
|
||||
|
||||
/** Translates a plural string to the default language.
|
||||
* @param count The number of items the string is counting.
|
||||
* @param singular The string to translate if there is one of \p count
|
||||
* @param plural The string to translate if there is multiple of \p count
|
||||
* @return The translated string if found, else the original string.
|
||||
*/
|
||||
extern CoreExport const char *Translate(int count, const char *singular, const char *plural);
|
||||
|
||||
/** Translates a plural string to the language of the given user.
|
||||
* @param u The user to translate the string for
|
||||
* @param count The number of items the string is counting.
|
||||
* @param singular The string to translate if there is one of \p count
|
||||
* @param plural The string to translate if there is multiple of \p count
|
||||
* @return The translated string if found, else the original string.
|
||||
*/
|
||||
extern CoreExport const char *Translate(User *u, int count, const char *singular, const char *plural);
|
||||
|
||||
/** Translates a plural string to the language of the given account.
|
||||
* @param nc The account to translate the string for
|
||||
* @param count The number of items the string is counting.
|
||||
* @param singular The string to translate if there is one of \p count
|
||||
* @param plural The string to translate if there is multiple of \p count
|
||||
* @return The translated string if count, else the original string
|
||||
*/
|
||||
extern CoreExport const char *Translate(const NickCore *nc, int count, const char *singular, const char *plural);
|
||||
|
||||
/** Translates a plural string to the given language.
|
||||
* @param lang The language to translate to
|
||||
* @param count The number of items the string is counting.
|
||||
* @param singular The string to translate if there is one of \p count
|
||||
* @param plural The string to translate if there is multiple of \p count
|
||||
* @return The translated string if found, else the original string.
|
||||
*/
|
||||
extern CoreExport const char *Translate(const char *lang, int count, const char *singular, const char *plural);
|
||||
|
||||
} // namespace Language
|
||||
|
||||
/* Commonly used language strings */
|
||||
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
|
||||
#define CONFIRM_DROP _("Please confirm that you want to drop \002%s\002 with \002%s\032%s\032%s\002")
|
||||
#define SERVICE_UNAVAILABLE _("Sorry, %s is temporarily unavailable.")
|
||||
#define MORE_INFO _("\002%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 READ_ONLY_MODE _("Services are temporarily 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\n" \
|
||||
"five characters long, should not be something easily guessed\n" \
|
||||
"(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. It must not exceed %u characters.")
|
||||
#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should not be " \
|
||||
"something that could be easily guessed (e.g. your real name or your nick) and " \
|
||||
"cannot contain the space or tab characters.")
|
||||
#define PASSWORD_TOO_SHORT _("Your password is too short. It must be longer than %u characters.")
|
||||
#define PASSWORD_TOO_LONG _("Your password is too long. It must be shorter than %u characters.")
|
||||
#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.")
|
||||
@@ -83,20 +123,18 @@ namespace Language
|
||||
#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 NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.")
|
||||
#define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.")
|
||||
#define MAIL_X_INVALID _("\002%s\002 is not a valid email address.")
|
||||
#define UNKNOWN _("<unknown>")
|
||||
#define NO_EXPIRE _("does not expire")
|
||||
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
|
||||
#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" \
|
||||
#define NICK_IS_SECURE _("This nickname is registered and protected. If it is your " \
|
||||
"nick, type \002%s\032\037password\037\002. Otherwise, " \
|
||||
"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_DISPLAY_CHANGED _("The new display is now \002%s\002.")
|
||||
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry.")
|
||||
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the email 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.")
|
||||
@@ -105,23 +143,22 @@ namespace Language
|
||||
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
|
||||
#define CHAN_SETTING_UNSET _("%s for %s unset.")
|
||||
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
|
||||
#define CHAN_INFO_HEADER _("Information for channel \002%s\002:")
|
||||
#define CHAN_INFO_HEADER _("Information about channel \002%s\002:")
|
||||
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
|
||||
#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_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s. " \
|
||||
"Type \002%s\032%s\032%zu\002 to read it.")
|
||||
#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s. " \
|
||||
"Type \002%s\032%zu\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_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.")
|
||||
#define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
|
||||
#define HOST_SET_ERROR _("A vHost must be in the format of a valid hostname.")
|
||||
#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 hostname shorter than %d characters.")
|
||||
#define HOST_SET_IDENTTOOLONG _("Error! The vHost 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")
|
||||
#define HOST_SET_ERROR _("A vhost must be in the format of a valid hostname.")
|
||||
#define HOST_SET_IDENT_ERROR _("A vident must be in the format of a valid ident.")
|
||||
#define HOST_SET_TOOLONG _("Error! The vhost is too long, please use a hostname shorter than %zu characters.")
|
||||
#define HOST_SET_IDENTTOOLONG _("Error! The vident is too long, please use an ident shorter than %zu 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 vidents. If this is incorrect please report this as a possible bug.")
|
||||
|
||||
+12
-15
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef LISTS_H
|
||||
#define LISTS_H
|
||||
#pragma once
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
@@ -24,13 +23,13 @@
|
||||
*/
|
||||
class CoreExport NumberList
|
||||
{
|
||||
private:
|
||||
bool is_valid;
|
||||
private:
|
||||
bool is_valid = true;
|
||||
|
||||
std::set<unsigned> numbers;
|
||||
|
||||
bool desc;
|
||||
public:
|
||||
public:
|
||||
/** Processes a numbered list
|
||||
* @param list The list
|
||||
* @param descending True to make HandleNumber get called with numbers in descending order
|
||||
@@ -39,7 +38,7 @@ class CoreExport NumberList
|
||||
|
||||
/** Destructor, does nothing
|
||||
*/
|
||||
virtual ~NumberList();
|
||||
virtual ~NumberList() = default;
|
||||
|
||||
/** Should be called after the constructors are done running. This calls the callbacks.
|
||||
*/
|
||||
@@ -61,15 +60,15 @@ class CoreExport NumberList
|
||||
|
||||
/** This class handles formatting LIST/VIEW replies.
|
||||
*/
|
||||
class CoreExport ListFormatter
|
||||
class CoreExport ListFormatter final
|
||||
{
|
||||
public:
|
||||
public:
|
||||
typedef std::map<Anope::string, Anope::string> ListEntry;
|
||||
private:
|
||||
private:
|
||||
NickCore *nc;
|
||||
std::vector<Anope::string> columns;
|
||||
std::vector<ListEntry> entries;
|
||||
public:
|
||||
public:
|
||||
ListFormatter(NickCore *nc);
|
||||
ListFormatter &AddColumn(const Anope::string &name);
|
||||
void AddEntry(const ListEntry &entry);
|
||||
@@ -79,16 +78,14 @@ class CoreExport ListFormatter
|
||||
|
||||
/** This class handles formatting INFO replies
|
||||
*/
|
||||
class CoreExport InfoFormatter
|
||||
class CoreExport InfoFormatter final
|
||||
{
|
||||
NickCore *nc;
|
||||
std::vector<std::pair<Anope::string, Anope::string> > replies;
|
||||
unsigned longest;
|
||||
public:
|
||||
unsigned longest = 0;
|
||||
public:
|
||||
InfoFormatter(NickCore *nc);
|
||||
void Process(std::vector<Anope::string> &);
|
||||
Anope::string &operator[](const Anope::string &key);
|
||||
void AddOption(const Anope::string &opt);
|
||||
};
|
||||
|
||||
#endif // LISTS_H
|
||||
|
||||
+19
-22
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
#pragma once
|
||||
|
||||
#include "anope.h"
|
||||
#include "defs.h"
|
||||
@@ -38,7 +37,7 @@ enum LogType
|
||||
LOG_DEBUG_4
|
||||
};
|
||||
|
||||
struct LogFile
|
||||
struct LogFile final
|
||||
{
|
||||
Anope::string filename;
|
||||
std::ofstream stream;
|
||||
@@ -49,27 +48,27 @@ struct LogFile
|
||||
};
|
||||
|
||||
/* Represents a single log message */
|
||||
class CoreExport Log
|
||||
class CoreExport Log final
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/* Bot that should log this message */
|
||||
BotInfo *bi;
|
||||
BotInfo *bi = nullptr;
|
||||
/* For commands, the user executing the command, but might not always exist */
|
||||
User *u;
|
||||
User *u = nullptr;
|
||||
/* For commands, the account executing the command, but will not always exist */
|
||||
NickCore *nc;
|
||||
NickCore *nc = nullptr;
|
||||
/* For commands, the command being executed */
|
||||
Command *c;
|
||||
Command *c = nullptr;
|
||||
/* For commands, the command source */
|
||||
CommandSource *source;
|
||||
CommandSource *source = nullptr;
|
||||
/* Used for LOG_CHANNEL */
|
||||
Channel *chan;
|
||||
Channel *chan = nullptr;
|
||||
/* For commands, the channel the command was executed on, will not always exist */
|
||||
const ChannelInfo *ci;
|
||||
const ChannelInfo *ci = nullptr;
|
||||
/* For LOG_SERVER */
|
||||
Server *s;
|
||||
Server *s = nullptr;
|
||||
/* For LOG_MODULE */
|
||||
Module *m;
|
||||
Module *m = nullptr;
|
||||
LogType type;
|
||||
Anope::string category;
|
||||
|
||||
@@ -95,11 +94,11 @@ class CoreExport Log
|
||||
|
||||
~Log();
|
||||
|
||||
private:
|
||||
private:
|
||||
Anope::string FormatSource() const;
|
||||
Anope::string FormatCommand() const;
|
||||
|
||||
public:
|
||||
public:
|
||||
Anope::string BuildPrefix() const;
|
||||
|
||||
template<typename T> Log &operator<<(T val)
|
||||
@@ -110,13 +109,13 @@ class CoreExport Log
|
||||
};
|
||||
|
||||
/* Configured in the configuration file, actually does the message logging */
|
||||
class CoreExport LogInfo
|
||||
class CoreExport LogInfo final
|
||||
{
|
||||
public:
|
||||
BotInfo *bot;
|
||||
public:
|
||||
BotInfo *bot = nullptr;
|
||||
std::vector<Anope::string> targets;
|
||||
std::vector<LogFile *> logfiles;
|
||||
int last_day;
|
||||
int last_day = 0;
|
||||
std::vector<Anope::string> sources;
|
||||
int log_age;
|
||||
std::vector<Anope::string> admin;
|
||||
@@ -140,5 +139,3 @@ class CoreExport LogInfo
|
||||
/* Logs the message l if configured to */
|
||||
void ProcessMessage(const Log *l);
|
||||
};
|
||||
|
||||
#endif // LOGGER_H
|
||||
|
||||
+6
-8
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef MAIL_H
|
||||
#define MAIL_H
|
||||
#pragma once
|
||||
|
||||
#include "anope.h"
|
||||
#include "threadengine.h"
|
||||
@@ -23,9 +22,10 @@ namespace Mail
|
||||
extern CoreExport bool Validate(const Anope::string &email);
|
||||
|
||||
/* A email message being sent */
|
||||
class Message : public Thread
|
||||
class Message final
|
||||
: public Thread
|
||||
{
|
||||
private:
|
||||
private:
|
||||
Anope::string error;
|
||||
Anope::string sendmail_path;
|
||||
Anope::string send_from;
|
||||
@@ -36,7 +36,7 @@ namespace Mail
|
||||
Anope::string content_type;
|
||||
bool dont_quote_addresses;
|
||||
|
||||
public:
|
||||
public:
|
||||
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
|
||||
* @param sf Config->SendFrom
|
||||
* @param mailto Name of person being mailed (u->nick, nc->display, etc)
|
||||
@@ -49,9 +49,7 @@ namespace Mail
|
||||
~Message();
|
||||
|
||||
/* Called from within the thread to actually send the mail */
|
||||
void Run() anope_override;
|
||||
void Run() override;
|
||||
};
|
||||
|
||||
} // namespace Mail
|
||||
|
||||
#endif // MAIL_H
|
||||
|
||||
+15
-12
@@ -9,24 +9,29 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef MEMO_H
|
||||
#define MEMO_H
|
||||
#pragma once
|
||||
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
|
||||
class CoreExport Memo : public Serializable
|
||||
class CoreExport Memo final
|
||||
: public Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
struct Type final
|
||||
: public Serialize::Type
|
||||
{
|
||||
Type();
|
||||
void Serialize(const Serializable *obj, Serialize::Data &data) const override;
|
||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
|
||||
};
|
||||
|
||||
MemoInfo *mi;
|
||||
bool unread;
|
||||
bool receipt;
|
||||
Memo();
|
||||
~Memo();
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
Anope::string owner;
|
||||
/* When it was sent */
|
||||
time_t time;
|
||||
@@ -37,11 +42,11 @@ class CoreExport Memo : public Serializable
|
||||
/* Memo info structures. Since both nicknames and channels can have memos,
|
||||
* we encapsulate memo data in a MemoInfo to make it easier to handle.
|
||||
*/
|
||||
struct CoreExport MemoInfo
|
||||
struct CoreExport MemoInfo final
|
||||
{
|
||||
int16_t memomax;
|
||||
int16_t memomax = 0;
|
||||
Serialize::Checker<std::vector<Memo *> > memos;
|
||||
std::vector<Anope::string> ignores;
|
||||
std::set<Anope::string, ci::less> ignores;
|
||||
|
||||
MemoInfo();
|
||||
Memo *GetMemo(unsigned index) const;
|
||||
@@ -51,5 +56,3 @@ struct CoreExport MemoInfo
|
||||
|
||||
static MemoInfo *GetMemoInfo(const Anope::string &targ, bool &is_chan);
|
||||
};
|
||||
|
||||
#endif // MEMO_H
|
||||
|
||||
+89
-59
@@ -9,6 +9,8 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "protocol.h"
|
||||
|
||||
/* Common IRCD messages.
|
||||
@@ -19,39 +21,51 @@
|
||||
namespace Message
|
||||
{
|
||||
|
||||
struct CoreExport Away : IRCDMessage
|
||||
struct CoreExport Away
|
||||
: IRCDMessage
|
||||
{
|
||||
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Capab : IRCDMessage
|
||||
struct CoreExport Capab
|
||||
: IRCDMessage
|
||||
{
|
||||
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Error : IRCDMessage
|
||||
struct CoreExport Error
|
||||
: IRCDMessage
|
||||
{
|
||||
Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Invite : IRCDMessage
|
||||
struct CoreExport Ignore final
|
||||
: IRCDMessage
|
||||
{
|
||||
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
Ignore(Module *creator, const Anope::string &mname);
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Join : IRCDMessage
|
||||
struct CoreExport Invite
|
||||
: IRCDMessage
|
||||
{
|
||||
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Join
|
||||
: IRCDMessage
|
||||
{
|
||||
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
|
||||
typedef std::pair<ChannelStatus, User *> SJoinUser;
|
||||
|
||||
@@ -59,115 +73,131 @@ namespace Message
|
||||
* @param source The source of the SJOIN
|
||||
* @param chan The channel the users are joining to
|
||||
* @param ts The TS for the channel
|
||||
* @param modes The modes sent with the SJOIN, if any
|
||||
* @param modes The mode letters sent with the SJOIN, if any
|
||||
* @param modeparams The mode parameters sent with the SJOIN, if any
|
||||
* @param users The users and their status, if any
|
||||
*/
|
||||
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
|
||||
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::vector<Anope::string> &modeparams, const std::list<SJoinUser> &users);
|
||||
};
|
||||
|
||||
struct CoreExport Kick : IRCDMessage
|
||||
struct CoreExport Kick
|
||||
: IRCDMessage
|
||||
{
|
||||
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Kill : IRCDMessage
|
||||
struct CoreExport Kill
|
||||
: IRCDMessage
|
||||
{
|
||||
Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Mode : IRCDMessage
|
||||
struct CoreExport Mode
|
||||
: IRCDMessage
|
||||
{
|
||||
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport MOTD : IRCDMessage
|
||||
struct CoreExport MOTD
|
||||
: IRCDMessage
|
||||
{
|
||||
MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Notice : IRCDMessage
|
||||
struct CoreExport Notice
|
||||
: IRCDMessage
|
||||
{
|
||||
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Part : IRCDMessage
|
||||
struct CoreExport Part
|
||||
: IRCDMessage
|
||||
{
|
||||
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Ping : IRCDMessage
|
||||
struct CoreExport Ping
|
||||
: IRCDMessage
|
||||
{
|
||||
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Privmsg : IRCDMessage
|
||||
struct CoreExport Privmsg
|
||||
: IRCDMessage
|
||||
{
|
||||
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Quit : IRCDMessage
|
||||
struct CoreExport Quit
|
||||
: IRCDMessage
|
||||
{
|
||||
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport SQuit : IRCDMessage
|
||||
struct CoreExport SQuit
|
||||
: IRCDMessage
|
||||
{
|
||||
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Stats : IRCDMessage
|
||||
struct CoreExport Stats
|
||||
: IRCDMessage
|
||||
{
|
||||
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Time : IRCDMessage
|
||||
struct CoreExport Time
|
||||
: IRCDMessage
|
||||
{
|
||||
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Topic : IRCDMessage
|
||||
struct CoreExport Topic
|
||||
: IRCDMessage
|
||||
{
|
||||
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Version : IRCDMessage
|
||||
struct CoreExport Version
|
||||
: IRCDMessage
|
||||
{
|
||||
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
struct CoreExport Whois : IRCDMessage
|
||||
struct CoreExport Whois
|
||||
: IRCDMessage
|
||||
{
|
||||
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
} // namespace Message
|
||||
|
||||
+65
-52
@@ -6,8 +6,7 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef MODES_H
|
||||
#define MODES_H
|
||||
#pragma once
|
||||
|
||||
#include "anope.h"
|
||||
#include "base.h"
|
||||
@@ -36,9 +35,10 @@ enum ModeClass
|
||||
|
||||
/** This class is the basis of all modes in Anope
|
||||
*/
|
||||
class CoreExport Mode : public Base
|
||||
class CoreExport Mode
|
||||
: public Base
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/* Mode name */
|
||||
Anope::string name;
|
||||
/* Class of mode this is (user/channel) */
|
||||
@@ -55,7 +55,7 @@ class CoreExport Mode : public Base
|
||||
* @param type The mode type
|
||||
*/
|
||||
Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type);
|
||||
virtual ~Mode();
|
||||
virtual ~Mode() = default;
|
||||
|
||||
/** Can a user set this mode, used for mlock
|
||||
* @param u The user
|
||||
@@ -65,9 +65,10 @@ class CoreExport Mode : public Base
|
||||
|
||||
/** This class is a user mode, all user modes use this/inherit from this
|
||||
*/
|
||||
class CoreExport UserMode : public Mode
|
||||
class CoreExport UserMode
|
||||
: public Mode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
@@ -75,9 +76,10 @@ class CoreExport UserMode : public Mode
|
||||
UserMode(const Anope::string &name, char mc);
|
||||
};
|
||||
|
||||
class CoreExport UserModeParam : public UserMode
|
||||
class CoreExport UserModeParam
|
||||
: public UserMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
@@ -93,9 +95,10 @@ class CoreExport UserModeParam : public UserMode
|
||||
|
||||
/** This class is a channel mode, all channel modes use this/inherit from this
|
||||
*/
|
||||
class CoreExport ChannelMode : public Mode
|
||||
class CoreExport ChannelMode
|
||||
: public Mode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/* channel modes that can possibly unwrap this mode */
|
||||
std::vector<ChannelMode *> listeners;
|
||||
|
||||
@@ -105,7 +108,7 @@ class CoreExport ChannelMode : public Mode
|
||||
*/
|
||||
ChannelMode(const Anope::string &name, char mc);
|
||||
|
||||
bool CanSet(User *u) const anope_override;
|
||||
bool CanSet(User *u) const override;
|
||||
|
||||
virtual void Check() { }
|
||||
|
||||
@@ -124,9 +127,10 @@ class CoreExport ChannelMode : public Mode
|
||||
|
||||
/** This is a mode for lists, eg b/e/I. These modes should inherit from this
|
||||
*/
|
||||
class CoreExport ChannelModeList : public ChannelMode
|
||||
class CoreExport ChannelModeList
|
||||
: public ChannelMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
@@ -162,9 +166,10 @@ class CoreExport ChannelModeList : public ChannelMode
|
||||
|
||||
/** This is a mode with a parameter, eg +k/l. These modes should use/inherit from this
|
||||
*/
|
||||
class CoreExport ChannelModeParam : public ChannelMode
|
||||
class CoreExport ChannelModeParam
|
||||
: public ChannelMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
@@ -184,9 +189,10 @@ class CoreExport ChannelModeParam : public ChannelMode
|
||||
|
||||
/** This is a mode that is a channel status, eg +v/h/o/a/q.
|
||||
*/
|
||||
class CoreExport ChannelModeStatus : public ChannelMode
|
||||
class CoreExport ChannelModeStatus
|
||||
: public ChannelMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
/* The symbol, eg @ % + */
|
||||
char symbol;
|
||||
/* The "level" of the mode, used to compare with other modes.
|
||||
@@ -207,29 +213,33 @@ class CoreExport ChannelModeStatus : public ChannelMode
|
||||
* but we still have a representation for it.
|
||||
*/
|
||||
template<typename T>
|
||||
class CoreExport ChannelModeVirtual : public T
|
||||
class CoreExport ChannelModeVirtual
|
||||
: public T
|
||||
{
|
||||
Anope::string base;
|
||||
private:
|
||||
ChannelMode *basech;
|
||||
|
||||
public:
|
||||
protected:
|
||||
Anope::string base;
|
||||
|
||||
public:
|
||||
ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename);
|
||||
|
||||
~ChannelModeVirtual();
|
||||
|
||||
void Check() anope_override;
|
||||
void Check() override;
|
||||
|
||||
ChannelMode *Wrap(Anope::string ¶m) anope_override;
|
||||
ChannelMode *Wrap(Anope::string ¶m) override;
|
||||
|
||||
ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) anope_override = 0;
|
||||
ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) override = 0;
|
||||
};
|
||||
|
||||
/* The status a user has on a channel (+v, +h, +o) etc */
|
||||
class CoreExport ChannelStatus
|
||||
class CoreExport ChannelStatus final
|
||||
{
|
||||
Anope::string modes;
|
||||
public:
|
||||
ChannelStatus();
|
||||
public:
|
||||
ChannelStatus() = default;
|
||||
ChannelStatus(const Anope::string &modes);
|
||||
void AddMode(char c);
|
||||
void DelMode(char c);
|
||||
@@ -240,51 +250,56 @@ class CoreExport ChannelStatus
|
||||
Anope::string BuildModePrefixList() const;
|
||||
};
|
||||
|
||||
class CoreExport UserModeOperOnly : public UserMode
|
||||
class CoreExport UserModeOperOnly
|
||||
: public UserMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { }
|
||||
|
||||
bool CanSet(User *u) const anope_override;
|
||||
bool CanSet(User *u) const override;
|
||||
};
|
||||
|
||||
class CoreExport UserModeNoone : public UserMode
|
||||
class CoreExport UserModeNoone
|
||||
: public UserMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { }
|
||||
|
||||
bool CanSet(User *u) const anope_override;
|
||||
bool CanSet(User *u) const override;
|
||||
};
|
||||
|
||||
/** Channel mode +k (key)
|
||||
*/
|
||||
class CoreExport ChannelModeKey : public ChannelModeParam
|
||||
class CoreExport ChannelModeKey
|
||||
: public ChannelModeParam
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { }
|
||||
|
||||
bool IsValid(Anope::string &value) const anope_override;
|
||||
bool IsValid(Anope::string &value) const override;
|
||||
};
|
||||
|
||||
/** This class is used for oper only channel modes
|
||||
*/
|
||||
class CoreExport ChannelModeOperOnly : public ChannelMode
|
||||
class CoreExport ChannelModeOperOnly
|
||||
: public ChannelMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
|
||||
|
||||
/* Opers only */
|
||||
bool CanSet(User *u) const anope_override;
|
||||
bool CanSet(User *u) const override;
|
||||
};
|
||||
|
||||
/** This class is used for channel modes only servers may set
|
||||
*/
|
||||
class CoreExport ChannelModeNoone : public ChannelMode
|
||||
class CoreExport ChannelModeNoone
|
||||
: public ChannelMode
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
|
||||
|
||||
bool CanSet(User *u) const anope_override;
|
||||
bool CanSet(User *u) const override;
|
||||
};
|
||||
|
||||
/** This is the mode manager
|
||||
@@ -293,9 +308,9 @@ class CoreExport ChannelModeNoone : public ChannelMode
|
||||
* This also contains a mode stacker that will combine multiple modes and set
|
||||
* them on a channel or user at once
|
||||
*/
|
||||
class CoreExport ModeManager
|
||||
class CoreExport ModeManager final
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
/* Number of generic channel and user modes we are tracking */
|
||||
static unsigned GenericChannelModes;
|
||||
@@ -389,13 +404,13 @@ class CoreExport ModeManager
|
||||
|
||||
/** Represents a mask set on a channel (b/e/I)
|
||||
*/
|
||||
class CoreExport Entry
|
||||
class CoreExport Entry final
|
||||
{
|
||||
Anope::string name;
|
||||
Anope::string mask;
|
||||
public:
|
||||
unsigned short cidr_len;
|
||||
int family;
|
||||
public:
|
||||
unsigned short cidr_len = 0;
|
||||
int family = 0;
|
||||
Anope::string nick, user, host, real;
|
||||
|
||||
/** Constructor
|
||||
@@ -407,9 +422,9 @@ class CoreExport Entry
|
||||
/** Get the banned mask for this entry
|
||||
* @return The mask
|
||||
*/
|
||||
const Anope::string GetMask() const;
|
||||
Anope::string GetMask() const;
|
||||
|
||||
const Anope::string GetNUHMask() const;
|
||||
Anope::string GetNUHMask() const;
|
||||
|
||||
/** Check if this entry matches a user
|
||||
* @param u The user
|
||||
@@ -418,5 +433,3 @@ class CoreExport Entry
|
||||
*/
|
||||
bool Matches(User *u, bool full = false) const;
|
||||
};
|
||||
|
||||
#endif // MODES_H
|
||||
|
||||
+5
-8
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef MODULE_H
|
||||
#define MODULE_H
|
||||
#pragma once
|
||||
|
||||
#include "access.h"
|
||||
#include "account.h"
|
||||
@@ -46,9 +45,7 @@
|
||||
#include "users.h"
|
||||
#include "xline.h"
|
||||
|
||||
#include "modules/pseudoclients/chanserv.h"
|
||||
#include "modules/pseudoclients/global.h"
|
||||
#include "modules/pseudoclients/memoserv.h"
|
||||
#include "modules/pseudoclients/nickserv.h"
|
||||
|
||||
#endif // MODULE_H
|
||||
#include "modules/chanserv/service.h"
|
||||
#include "modules/global/service.h"
|
||||
#include "modules/memoserv/service.h"
|
||||
#include "modules/nickserv/service.h"
|
||||
|
||||
+277
-210
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,8 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/** Flags for badwords
|
||||
*/
|
||||
enum BadWordType
|
||||
@@ -30,27 +32,27 @@ struct BadWord
|
||||
Anope::string word;
|
||||
BadWordType type;
|
||||
|
||||
virtual ~BadWord() { }
|
||||
protected:
|
||||
BadWord() { }
|
||||
virtual ~BadWord() = default;
|
||||
protected:
|
||||
BadWord() = default;
|
||||
};
|
||||
|
||||
struct BadWords
|
||||
{
|
||||
virtual ~BadWords() { }
|
||||
virtual ~BadWords() = default;
|
||||
|
||||
/** Add a badword to the badword list
|
||||
* @param word The badword
|
||||
* @param type The type (SINGLE START END)
|
||||
* @return The badword
|
||||
*/
|
||||
virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0;
|
||||
virtual BadWord *AddBadWord(const Anope::string &word, BadWordType type) = 0;
|
||||
|
||||
/** Get a badword structure by index
|
||||
* @param index The index
|
||||
* @return The badword
|
||||
*/
|
||||
virtual BadWord* GetBadWord(unsigned index) const = 0;
|
||||
virtual BadWord *GetBadWord(unsigned index) const = 0;
|
||||
|
||||
/** Get how many badwords are on this channel
|
||||
* @return The number of badwords in the vector
|
||||
@@ -9,6 +9,8 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Indices for TTB (Times To Ban) */
|
||||
enum
|
||||
{
|
||||
@@ -35,10 +37,10 @@ struct KickerData
|
||||
|
||||
bool dontkickops, dontkickvoices;
|
||||
|
||||
protected:
|
||||
KickerData() { }
|
||||
protected:
|
||||
KickerData() = default;
|
||||
|
||||
public:
|
||||
virtual ~KickerData() { }
|
||||
public:
|
||||
virtual ~KickerData() = default;
|
||||
virtual void Check(ChannelInfo *ci) = 0;
|
||||
};
|
||||
@@ -6,6 +6,8 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct EntryMsg
|
||||
{
|
||||
Anope::string chan;
|
||||
@@ -13,22 +15,23 @@ struct EntryMsg
|
||||
Anope::string message;
|
||||
time_t when;
|
||||
|
||||
virtual ~EntryMsg() { }
|
||||
protected:
|
||||
EntryMsg() { }
|
||||
virtual ~EntryMsg() = default;
|
||||
protected:
|
||||
EntryMsg() = default;
|
||||
};
|
||||
|
||||
struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> >
|
||||
struct EntryMessageList
|
||||
: Serialize::Checker<std::vector<EntryMsg *> >
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
EntryMessageList() : Serialize::Checker<std::vector<EntryMsg *> >("EntryMsg") { }
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual ~EntryMessageList()
|
||||
{
|
||||
for (unsigned i = (*this)->size(); i > 0; --i)
|
||||
delete (*this)->at(i - 1);
|
||||
}
|
||||
|
||||
virtual EntryMsg* Create() = 0;
|
||||
virtual EntryMsg *Create() = 0;
|
||||
};
|
||||
@@ -9,6 +9,8 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct LogSetting
|
||||
{
|
||||
Anope::string chan;
|
||||
@@ -22,21 +24,22 @@ struct LogSetting
|
||||
Anope::string creator;
|
||||
time_t created;
|
||||
|
||||
virtual ~LogSetting() { }
|
||||
protected:
|
||||
LogSetting() { }
|
||||
virtual ~LogSetting() = default;
|
||||
protected:
|
||||
LogSetting() = default;
|
||||
};
|
||||
|
||||
struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
|
||||
struct LogSettings
|
||||
: Serialize::Checker<std::vector<LogSetting *> >
|
||||
{
|
||||
typedef std::vector<LogSetting *>::iterator iterator;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting")
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~LogSettings() { }
|
||||
public:
|
||||
virtual ~LogSettings() = default;
|
||||
virtual LogSetting *Create() = 0;
|
||||
};
|
||||
@@ -9,6 +9,8 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct ModeLock
|
||||
{
|
||||
Anope::string ci;
|
||||
@@ -18,16 +20,16 @@ struct ModeLock
|
||||
Anope::string setter;
|
||||
time_t created;
|
||||
|
||||
virtual ~ModeLock() { }
|
||||
protected:
|
||||
ModeLock() { }
|
||||
virtual ~ModeLock() = default;
|
||||
protected:
|
||||
ModeLock() = default;
|
||||
};
|
||||
|
||||
struct ModeLocks
|
||||
{
|
||||
typedef std::vector<ModeLock *> ModeList;
|
||||
|
||||
virtual ~ModeLocks() { }
|
||||
virtual ~ModeLocks() = default;
|
||||
|
||||
/** Check if a mode is mlocked
|
||||
* @param mode The mode
|
||||
@@ -6,12 +6,12 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef CHANSERV_H
|
||||
#define CHANSERV_H
|
||||
#pragma once
|
||||
|
||||
class ChanServService : public Service
|
||||
class ChanServService
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ChanServService(Module *m) : Service(m, "ChanServService", "ChanServ")
|
||||
{
|
||||
}
|
||||
@@ -21,5 +21,3 @@ class ChanServService : public Service
|
||||
*/
|
||||
virtual void Hold(Channel *c) = 0;
|
||||
};
|
||||
|
||||
#endif // CHANSERV_H
|
||||
+28
-21
@@ -9,8 +9,7 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef DNS_H
|
||||
#define DNS_H
|
||||
#pragma once
|
||||
|
||||
namespace DNS
|
||||
{
|
||||
@@ -73,14 +72,14 @@ namespace DNS
|
||||
struct Question
|
||||
{
|
||||
Anope::string name;
|
||||
QueryType type;
|
||||
unsigned short qclass;
|
||||
QueryType type = QUERY_NONE;
|
||||
unsigned short qclass = 0;
|
||||
|
||||
Question() : type(QUERY_NONE), qclass(0) { }
|
||||
Question() = default;
|
||||
Question(const Anope::string &n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { }
|
||||
inline bool operator==(const Question & other) const { return name == other.name && type == other.type && qclass == other.qclass; }
|
||||
|
||||
struct hash
|
||||
struct hash final
|
||||
{
|
||||
size_t operator()(const Question &q) const
|
||||
{
|
||||
@@ -89,14 +88,15 @@ namespace DNS
|
||||
};
|
||||
};
|
||||
|
||||
struct ResourceRecord : Question
|
||||
struct ResourceRecord final
|
||||
: Question
|
||||
{
|
||||
unsigned int ttl;
|
||||
unsigned int ttl = 0;
|
||||
Anope::string rdata;
|
||||
time_t created;
|
||||
|
||||
ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), ttl(0), created(Anope::CurTime) { }
|
||||
ResourceRecord(const Question &q) : Question(q), ttl(0), created(Anope::CurTime) { }
|
||||
ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), created(Anope::CurTime) { }
|
||||
ResourceRecord(const Question &q) : Question(q), created(Anope::CurTime) { }
|
||||
};
|
||||
|
||||
struct Query
|
||||
@@ -114,11 +114,12 @@ namespace DNS
|
||||
|
||||
/** DNS manager
|
||||
*/
|
||||
class Manager : public Service
|
||||
class Manager
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
Manager(Module *creator) : Service(creator, "DNS::Manager", "dns/manager") { }
|
||||
virtual ~Manager() { }
|
||||
virtual ~Manager() = default;
|
||||
|
||||
virtual void Process(Request *req) = 0;
|
||||
virtual void RemoveRequest(Request *req) = 0;
|
||||
@@ -132,19 +133,27 @@ namespace DNS
|
||||
|
||||
/** A DNS query.
|
||||
*/
|
||||
class Request : public Timer, public Question
|
||||
class Request
|
||||
: public Timer
|
||||
, public Question
|
||||
{
|
||||
Manager *manager;
|
||||
public:
|
||||
public:
|
||||
/* Use result cache if available */
|
||||
bool use_cache;
|
||||
/* Request id */
|
||||
unsigned short id;
|
||||
unsigned short id = 0;
|
||||
/* Creator of this request */
|
||||
Module *creator;
|
||||
|
||||
Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false) : Timer(0), Question(addr, qt), manager(mgr),
|
||||
use_cache(cache), id(0), creator(c) { }
|
||||
Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false)
|
||||
: Timer(0)
|
||||
, Question(addr, qt)
|
||||
, manager(mgr)
|
||||
, use_cache(cache)
|
||||
, creator(c)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~Request()
|
||||
{
|
||||
@@ -164,7 +173,7 @@ namespace DNS
|
||||
/** Used to time out the query, xalls OnError and lets the TimerManager
|
||||
* delete this request.
|
||||
*/
|
||||
void Tick(time_t) anope_override
|
||||
void Tick() override
|
||||
{
|
||||
Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name;
|
||||
Query rr(*this);
|
||||
@@ -174,5 +183,3 @@ namespace DNS
|
||||
};
|
||||
|
||||
} // namespace DNS
|
||||
|
||||
#endif // DNS_H
|
||||
|
||||
+125
-13
@@ -9,27 +9,139 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Encryption
|
||||
{
|
||||
typedef std::pair<const unsigned char *, size_t> Hash;
|
||||
typedef std::pair<const uint32_t *, size_t> IV;
|
||||
|
||||
/** Base class for encryption contexts. */
|
||||
class Context
|
||||
{
|
||||
public:
|
||||
virtual ~Context() { }
|
||||
public:
|
||||
virtual ~Context() = default;
|
||||
|
||||
/** Updates the encryption context with the specified data.
|
||||
* @param str The data to update the context with.
|
||||
*/
|
||||
inline void Update(const Anope::string &str)
|
||||
{
|
||||
Update(reinterpret_cast<const unsigned char *>(str.c_str()), str.length());
|
||||
}
|
||||
|
||||
/** Updates the encryption context with the specified data.
|
||||
* @param data The data to update the context with.
|
||||
* @param len The length of the data.
|
||||
*/
|
||||
virtual void Update(const unsigned char *data, size_t len) = 0;
|
||||
virtual void Finalize() = 0;
|
||||
virtual Hash GetFinalizedHash() = 0;
|
||||
|
||||
/** Finalises the encryption context and returns the digest. */
|
||||
virtual Anope::string Finalize() = 0;
|
||||
};
|
||||
|
||||
class Provider : public Service
|
||||
/** Provider of encryption contexts. */
|
||||
class Provider
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
|
||||
virtual ~Provider() { }
|
||||
public:
|
||||
/** The byte size of the block cipher. */
|
||||
const size_t block_size;
|
||||
|
||||
virtual Context *CreateContext(IV * = NULL) = 0;
|
||||
virtual IV GetDefaultIV() = 0;
|
||||
/** The byte size of the resulting digest. */
|
||||
const size_t digest_size;
|
||||
|
||||
/** Creates a provider of encryption contexts.
|
||||
* @param creator The module that created this provider.
|
||||
* @param algorithm The name of the encryption algorithm.
|
||||
* @param bs The byte size of the block cipher.
|
||||
* @param ds The byte size of the resulting digest.
|
||||
*/
|
||||
Provider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
|
||||
: Service(creator, "Encryption::Provider", algorithm)
|
||||
, block_size(bs)
|
||||
, digest_size(ds)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~Provider() = default;
|
||||
|
||||
/** Checks whether a plain text value matches a hash created by this provider. */
|
||||
virtual bool Compare(const Anope::string &hash, const Anope::string &plain)
|
||||
{
|
||||
return !hash.empty() && hash.equals_cs(ToPrintable(Encrypt(plain)));
|
||||
}
|
||||
|
||||
/** Called on initialising a encryption provider to check it works properly. */
|
||||
void Check(const Anope::map<Anope::string> &checks)
|
||||
{
|
||||
for (const auto &[hash, plain] : checks)
|
||||
{
|
||||
if (!Compare(hash, plain))
|
||||
throw ModuleException("BUG: unable to generate " + this->name + " hashes safely! Please report this!");
|
||||
}
|
||||
Log(LOG_DEBUG) << "The " << this->name << " encryption provider appears to be working correctly.";
|
||||
}
|
||||
|
||||
/** Creates a new encryption context. */
|
||||
virtual std::unique_ptr<Context> CreateContext() = 0;
|
||||
|
||||
/** Quickly encrypts the specified values and returns the digest. */
|
||||
template<typename... Args>
|
||||
Anope::string Encrypt(Args &&...args)
|
||||
{
|
||||
auto context = CreateContext();
|
||||
context->Update(std::forward<Args>(args)...);
|
||||
return context->Finalize();
|
||||
}
|
||||
|
||||
/** Calculates the RFC 2104 hash-based message authentication code for the specified data. */
|
||||
inline Anope::string HMAC(const Anope::string &key, const Anope::string &data)
|
||||
{
|
||||
if (!block_size)
|
||||
return {};
|
||||
|
||||
auto keybuf = key.length() > block_size ? Encrypt(key) : key;
|
||||
keybuf.resize(block_size);
|
||||
|
||||
Anope::string hmac1;
|
||||
Anope::string hmac2;
|
||||
for (size_t i = 0; i < block_size; ++i)
|
||||
{
|
||||
hmac1.push_back(static_cast<char>(keybuf[i] ^ 0x5C));
|
||||
hmac2.push_back(static_cast<char>(keybuf[i] ^ 0x36));
|
||||
}
|
||||
hmac2.append(data);
|
||||
hmac1.append(Encrypt(hmac2));
|
||||
|
||||
return Encrypt(hmac1);
|
||||
}
|
||||
|
||||
/** Converts a hash to its printable form. */
|
||||
virtual Anope::string ToPrintable(const Anope::string &hash)
|
||||
{
|
||||
return Anope::Hex(hash);
|
||||
}
|
||||
};
|
||||
|
||||
/** Helper template for creating simple providers of encryption contexts. */
|
||||
template <typename T>
|
||||
class SimpleProvider final
|
||||
: public Provider
|
||||
{
|
||||
public:
|
||||
/** Creates a simple provider of encryption contexts.
|
||||
* @param creator The module that created this provider.
|
||||
* @param algorithm The name of the encryption algorithm.
|
||||
* @param bs The byte size of the block cipher.
|
||||
* @param ds The byte size of the resulting digest.
|
||||
*/
|
||||
SimpleProvider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
|
||||
: Provider(creator, algorithm, bs, ds)
|
||||
{
|
||||
}
|
||||
|
||||
/** @copydoc Encryption::Provider::CreateContext. */
|
||||
std::unique_ptr<Context> CreateContext() override
|
||||
{
|
||||
return std::make_unique<T>();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2011-2025 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define GLOBAL_NO_MESSAGE _("You do not have any messages queued and did not specify a message to send.")
|
||||
#define GLOBAL_QUEUE_CONFLICT _("You can not send a single message while you have messages queued.")
|
||||
|
||||
class GlobalService
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
GlobalService(Module *m)
|
||||
: Service(m, "GlobalService", "Global")
|
||||
{
|
||||
}
|
||||
|
||||
/** Retrieves the bot which sends global messages unless otherwise specified. */
|
||||
virtual Reference<BotInfo> GetDefaultSender() const = 0;
|
||||
|
||||
/** Clears any queued messages for the specified account.
|
||||
* @param nc The account to clear queued messages for.
|
||||
*/
|
||||
virtual void ClearQueue(NickCore *nc) = 0;
|
||||
|
||||
/** Retrieves the size of the messages queue for the specified user.
|
||||
* @param nc The account to count queued messages for.
|
||||
*/
|
||||
inline size_t CountQueue(NickCore* nc) const
|
||||
{
|
||||
auto *q = GetQueue(nc);
|
||||
return q ? q->size() : 0;
|
||||
}
|
||||
|
||||
/** Retrieves the messages queue for the specified user.
|
||||
* @param nc The account to retrieve queued messages for.
|
||||
*/
|
||||
virtual const std::vector<Anope::string> *GetQueue(NickCore* nc) const = 0;
|
||||
|
||||
/** Queues a message to be sent later.
|
||||
* @param nc The account to queue the message for.
|
||||
* @param message The message to queue.
|
||||
* @return The new number of messages in the queue.
|
||||
*/
|
||||
virtual size_t Queue(NickCore *nc, const Anope::string &message) = 0;
|
||||
|
||||
/** Sends a single message to all users on the network.
|
||||
* @param message The message to send.
|
||||
* @param source If non-nullptr then the source of the message.
|
||||
* @param sender If non-nullptr then the bot to send the message from.
|
||||
* @param server If non-nullptr then the server to send messages to.
|
||||
* @return If the message was sent then true; otherwise, false.
|
||||
*/
|
||||
virtual bool SendSingle(const Anope::string &message, CommandSource *source = nullptr, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
|
||||
|
||||
/** Sends a message queue to all users on the network.
|
||||
* @param source The source of the message.
|
||||
* @param sender If non-nullptr then the bot to send the message from.
|
||||
* @param server If non-nullptr then the server to send messages to.
|
||||
* @return If the message queue was sent then true; otherwise, false.
|
||||
*/
|
||||
virtual bool SendQueue(CommandSource &source, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
|
||||
|
||||
/** Unqueues a message from the message queue.
|
||||
* @param nc The account to unqueue the message from.
|
||||
* @param idx The index of the item to remove.
|
||||
* @return Whether the message was removed from the queue.
|
||||
*/
|
||||
virtual bool Unqueue(NickCore *nc, size_t idx) = 0;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2025 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class HostRequest
|
||||
{
|
||||
protected:
|
||||
HostRequest() = default;
|
||||
|
||||
public:
|
||||
Anope::string nick;
|
||||
Anope::string ident;
|
||||
Anope::string host;
|
||||
time_t time = 0;
|
||||
|
||||
virtual ~HostRequest() = default;
|
||||
};
|
||||
+32
-30
@@ -6,8 +6,7 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef ANOPE_HTTPD_H
|
||||
#define ANOPE_HTTPD_H
|
||||
#pragma once
|
||||
|
||||
enum HTTPError
|
||||
{
|
||||
@@ -19,34 +18,35 @@ enum HTTPError
|
||||
};
|
||||
|
||||
/* A message to someone */
|
||||
struct HTTPReply
|
||||
struct HTTPReply final
|
||||
{
|
||||
HTTPError error;
|
||||
HTTPError error = HTTP_ERROR_OK;
|
||||
Anope::string content_type;
|
||||
std::map<Anope::string, Anope::string, ci::less> headers;
|
||||
typedef std::list<std::pair<Anope::string, Anope::string> > cookie;
|
||||
std::vector<cookie> cookies;
|
||||
|
||||
HTTPReply() : error(HTTP_ERROR_OK), length(0) { }
|
||||
HTTPReply() = default;
|
||||
HTTPReply &operator=(const HTTPReply &) = default;
|
||||
|
||||
HTTPReply(const HTTPReply& other) : error(other.error), length(other.length)
|
||||
HTTPReply(const HTTPReply &other) : error(other.error), length(other.length)
|
||||
{
|
||||
content_type = other.content_type;
|
||||
headers = other.headers;
|
||||
cookies = other.cookies;
|
||||
|
||||
for (unsigned i = 0; i < other.out.size(); ++i)
|
||||
out.push_back(new Data(other.out[i]->buf, other.out[i]->len));
|
||||
for (const auto &datum : other.out)
|
||||
out.push_back(new Data(datum->buf, datum->len));
|
||||
}
|
||||
|
||||
~HTTPReply()
|
||||
{
|
||||
for (unsigned i = 0; i < out.size(); ++i)
|
||||
delete out[i];
|
||||
for (const auto *datum : out)
|
||||
delete datum;
|
||||
out.clear();
|
||||
}
|
||||
|
||||
struct Data
|
||||
struct Data final
|
||||
{
|
||||
char *buf;
|
||||
size_t len;
|
||||
@@ -65,7 +65,7 @@ struct HTTPReply
|
||||
};
|
||||
|
||||
std::deque<Data *> out;
|
||||
size_t length;
|
||||
size_t length = 0;
|
||||
|
||||
void Write(const Anope::string &message)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ struct HTTPReply
|
||||
};
|
||||
|
||||
/* A message from someone */
|
||||
struct HTTPMessage
|
||||
struct HTTPMessage final
|
||||
{
|
||||
std::map<Anope::string, Anope::string> headers;
|
||||
std::map<Anope::string, Anope::string> cookies;
|
||||
@@ -93,12 +93,13 @@ struct HTTPMessage
|
||||
class HTTPClient;
|
||||
class HTTPProvider;
|
||||
|
||||
class HTTPPage : public Base
|
||||
class HTTPPage
|
||||
: public virtual Base
|
||||
{
|
||||
Anope::string url;
|
||||
Anope::string content_type;
|
||||
|
||||
public:
|
||||
public:
|
||||
HTTPPage(const Anope::string &u, const Anope::string &ct = "text/html") : url(u), content_type(ct) { }
|
||||
|
||||
const Anope::string &GetURL() const { return this->url; }
|
||||
@@ -115,15 +116,18 @@ class HTTPPage : public Base
|
||||
virtual bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0;
|
||||
};
|
||||
|
||||
class HTTPClient : public ClientSocket, public BinarySocket, public Base
|
||||
class HTTPClient
|
||||
: public ClientSocket
|
||||
, public BinarySocket
|
||||
, public Base
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
void WriteClient(const Anope::string &message)
|
||||
{
|
||||
BinarySocket::Write(message + "\r\n");
|
||||
}
|
||||
|
||||
public:
|
||||
public:
|
||||
HTTPClient(ListenSocket *l, int f, const sockaddrs &a) : ClientSocket(l, a), BinarySocket() { }
|
||||
|
||||
virtual const Anope::string GetIP()
|
||||
@@ -135,12 +139,14 @@ class HTTPClient : public ClientSocket, public BinarySocket, public Base
|
||||
virtual void SendReply(HTTPReply *) = 0;
|
||||
};
|
||||
|
||||
class HTTPProvider : public ListenSocket, public Service
|
||||
class HTTPProvider
|
||||
: public ListenSocket
|
||||
, public Service
|
||||
{
|
||||
Anope::string ip;
|
||||
unsigned short port;
|
||||
bool ssl;
|
||||
public:
|
||||
public:
|
||||
std::vector<Anope::string> ext_ips;
|
||||
std::vector<Anope::string> ext_headers;
|
||||
|
||||
@@ -163,7 +169,7 @@ class HTTPProvider : public ListenSocket, public Service
|
||||
|
||||
virtual bool RegisterPage(HTTPPage *page) = 0;
|
||||
virtual void UnregisterPage(HTTPPage *page) = 0;
|
||||
virtual HTTPPage* FindPage(const Anope::string &name) = 0;
|
||||
virtual HTTPPage *FindPage(const Anope::string &name) = 0;
|
||||
};
|
||||
|
||||
namespace HTTPUtils
|
||||
@@ -174,7 +180,7 @@ namespace HTTPUtils
|
||||
|
||||
for (unsigned i = 0; i < url.length(); ++i)
|
||||
{
|
||||
const char& c = url[i];
|
||||
const char &c = url[i];
|
||||
|
||||
if (c == '%' && i + 2 < url.length())
|
||||
{
|
||||
@@ -196,10 +202,8 @@ namespace HTTPUtils
|
||||
{
|
||||
Anope::string encoded;
|
||||
|
||||
for (unsigned i = 0; i < url.length(); ++i)
|
||||
for (const auto c : url)
|
||||
{
|
||||
const char& c = url[i];
|
||||
|
||||
if (isalnum(c) || c == '.' || c == '-' || c == '*' || c == '_')
|
||||
encoded += c;
|
||||
else if (c == ' ')
|
||||
@@ -215,9 +219,9 @@ namespace HTTPUtils
|
||||
{
|
||||
Anope::string dst;
|
||||
|
||||
for (unsigned i = 0; i < src.length(); ++i)
|
||||
for (const auto c : src)
|
||||
{
|
||||
switch (src[i])
|
||||
switch (c)
|
||||
{
|
||||
case '<':
|
||||
dst += "<";
|
||||
@@ -232,12 +236,10 @@ namespace HTTPUtils
|
||||
dst += "&";
|
||||
break;
|
||||
default:
|
||||
dst += src[i];
|
||||
dst += c;
|
||||
}
|
||||
}
|
||||
|
||||
return dst;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ANOPE_HTTPD_H
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2025 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class OperInfo
|
||||
{
|
||||
protected:
|
||||
OperInfo() = default;
|
||||
|
||||
OperInfo(const Anope::string &t, const Anope::string &i, const Anope::string &a, time_t c)
|
||||
: target(t)
|
||||
, info(i)
|
||||
, adder(a)
|
||||
, created(c)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
Anope::string target;
|
||||
Anope::string info;
|
||||
Anope::string adder;
|
||||
time_t created = 0;
|
||||
|
||||
virtual ~OperInfo() = default;
|
||||
};
|
||||
|
||||
class OperInfoList
|
||||
: public Serialize::Checker<std::vector<OperInfo *>>
|
||||
{
|
||||
public:
|
||||
OperInfoList()
|
||||
: Serialize::Checker<std::vector<OperInfo *>>("OperInfo")
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~OperInfoList()
|
||||
{
|
||||
for (auto *info : *(*this))
|
||||
delete info;
|
||||
}
|
||||
|
||||
virtual OperInfo *Create() = 0;
|
||||
};
|
||||
+15
-16
@@ -6,18 +6,17 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef ANOPE_LDAP_H
|
||||
#define ANOPE_LDAP_H
|
||||
#pragma once
|
||||
|
||||
class LDAPException : public ModuleException
|
||||
class DllExport LDAPException : public ModuleException
|
||||
{
|
||||
public:
|
||||
public:
|
||||
LDAPException(const Anope::string &reason) : ModuleException(reason) { }
|
||||
|
||||
virtual ~LDAPException() throw() { }
|
||||
virtual ~LDAPException() noexcept = default;
|
||||
};
|
||||
|
||||
struct LDAPModification
|
||||
struct LDAPModification final
|
||||
{
|
||||
enum LDAPOperation
|
||||
{
|
||||
@@ -32,7 +31,8 @@ struct LDAPModification
|
||||
};
|
||||
typedef std::vector<LDAPModification> LDAPMods;
|
||||
|
||||
struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string> >
|
||||
struct LDAPAttributes final
|
||||
: public std::map<Anope::string, std::vector<Anope::string>>
|
||||
{
|
||||
size_t size(const Anope::string &attr) const
|
||||
{
|
||||
@@ -43,8 +43,8 @@ struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string
|
||||
const std::vector<Anope::string> keys() const
|
||||
{
|
||||
std::vector<Anope::string> k;
|
||||
for (const_iterator it = this->begin(), it_end = this->end(); it != it_end; ++it)
|
||||
k.push_back(it->first);
|
||||
for (const auto &[key, _] : *this)
|
||||
k.push_back(key);
|
||||
return k;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ enum QueryType
|
||||
QUERY_MODIFY
|
||||
};
|
||||
|
||||
struct LDAPResult
|
||||
struct LDAPResult final
|
||||
{
|
||||
std::vector<LDAPAttributes> messages;
|
||||
Anope::string error;
|
||||
@@ -112,20 +112,21 @@ struct LDAPResult
|
||||
|
||||
class LDAPInterface
|
||||
{
|
||||
public:
|
||||
public:
|
||||
Module *owner;
|
||||
|
||||
LDAPInterface(Module *m) : owner(m) { }
|
||||
virtual ~LDAPInterface() { }
|
||||
virtual ~LDAPInterface() = default;
|
||||
|
||||
virtual void OnResult(const LDAPResult &r) = 0;
|
||||
virtual void OnError(const LDAPResult &err) = 0;
|
||||
virtual void OnDelete() { }
|
||||
};
|
||||
|
||||
class LDAPProvider : public Service
|
||||
class LDAPProvider
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
LDAPProvider(Module *c, const Anope::string &n) : Service(c, "LDAPProvider", n) { }
|
||||
|
||||
/** Attempt to bind to the LDAP server as an admin
|
||||
@@ -167,5 +168,3 @@ class LDAPProvider : public Service
|
||||
*/
|
||||
virtual void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
|
||||
};
|
||||
|
||||
#endif // ANOPE_LDAP_H
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef MEMOSERV_H
|
||||
#define MEMOSERV_H
|
||||
#pragma once
|
||||
|
||||
class MemoServService : public Service
|
||||
class MemoServService
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum MemoResult
|
||||
{
|
||||
MEMO_SUCCESS,
|
||||
@@ -37,5 +37,3 @@ class MemoServService : public Service
|
||||
*/
|
||||
virtual void Check(User *u) = 0;
|
||||
};
|
||||
|
||||
#endif // MEMOSERV_H
|
||||
@@ -9,12 +9,14 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct NSCertList
|
||||
{
|
||||
protected:
|
||||
NSCertList() { }
|
||||
public:
|
||||
virtual ~NSCertList() { }
|
||||
protected:
|
||||
NSCertList() = default;
|
||||
public:
|
||||
virtual ~NSCertList() = default;
|
||||
|
||||
/** Add an entry to the nick's certificate list
|
||||
*
|
||||
@@ -52,6 +54,15 @@ struct NSCertList
|
||||
*/
|
||||
virtual void EraseCert(const Anope::string &entry) = 0;
|
||||
|
||||
/** Replaces a fingerprint in the nick's certificate list
|
||||
*
|
||||
* @param oldentry The old fingerprint to remove
|
||||
* @param newentry The new fingerprint to add
|
||||
*
|
||||
* Replaces the specified fingerprint in the cert list.
|
||||
*/
|
||||
virtual void ReplaceCert(const Anope::string &oldentry, const Anope::string &newentry) = 0;
|
||||
|
||||
/** Clears the entire nick's cert list
|
||||
*
|
||||
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
||||
@@ -61,10 +72,12 @@ struct NSCertList
|
||||
virtual void Check() = 0;
|
||||
};
|
||||
|
||||
class CertService : public Service
|
||||
class CertService
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
CertService(Module *c) : Service(c, "CertService", "certs") { }
|
||||
|
||||
virtual NickCore* FindAccountFromCert(const Anope::string &cert) = 0;
|
||||
virtual NickCore *FindAccountFromCert(const Anope::string &cert) = 0;
|
||||
virtual void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) = 0;
|
||||
};
|
||||
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2014-2025 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace SASL
|
||||
{
|
||||
class Mechanism;
|
||||
struct Message;
|
||||
class ProtocolInterface;
|
||||
struct Service;
|
||||
struct Session;
|
||||
|
||||
/** The SASL interface implemented by the protocol modules. */
|
||||
static ServiceReference<SASL::ProtocolInterface> protocol_interface("SASL::ProtocolInterface", "sasl");
|
||||
|
||||
/** The SASL interface implemented by ns_sasl. */
|
||||
static ServiceReference<SASL::Service> service("SASL::Service", "sasl");
|
||||
}
|
||||
|
||||
/** Represents a single SASL message. */
|
||||
struct SASL::Message final
|
||||
{
|
||||
/** The source UID or name. */
|
||||
Anope::string source;
|
||||
|
||||
/** The target UID or name. */
|
||||
Anope::string target;
|
||||
|
||||
/** The type of message. */
|
||||
Anope::string type;
|
||||
|
||||
/** One or more data parameters. */
|
||||
std::vector<Anope::string> data;
|
||||
};
|
||||
|
||||
/** Sends IRCd messages used by the SASL module. */
|
||||
class SASL::ProtocolInterface
|
||||
: public ::Service
|
||||
{
|
||||
protected:
|
||||
ProtocolInterface(Module *o)
|
||||
: ::Service(o, "SASL::ProtocolInterface", "sasl")
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
/** Sends the list of SASL mechanisms to the IRCd
|
||||
* @param mechs The list of SASL mechanisms.
|
||||
*/
|
||||
virtual void SendSASLMechanisms(std::vector<Anope::string> &mechs) { };
|
||||
|
||||
/** Sends a SASL message to the IRCd.
|
||||
* @param message The SASL message to send.
|
||||
*/
|
||||
virtual void SendSASLMessage(const SASL::Message &message) = 0;
|
||||
|
||||
/** Sends a login or logout for \p uid to \p na.
|
||||
* @param uid The uid of the user to log in.
|
||||
* @param na The nick alias to log the user in as or logout if nullptr.
|
||||
*/
|
||||
virtual void SendSVSLogin(const Anope::string &uid, NickAlias *na) = 0;
|
||||
};
|
||||
|
||||
/** SASL service interface. */
|
||||
struct SASL::Service
|
||||
: ::Service
|
||||
{
|
||||
Service(Module *o)
|
||||
: ::Service(o, "SASL::Service", "sasl")
|
||||
{
|
||||
}
|
||||
|
||||
virtual void DeleteSessions(Mechanism *mech, bool da = false) = 0;
|
||||
|
||||
/** Fails a SASL session. This notifies the client and increments the
|
||||
* failed attempt counter which may kill the client if the bad password
|
||||
* limit has been reached.
|
||||
*
|
||||
* @param sess The session to fail.
|
||||
*/
|
||||
virtual void Fail(Session *sess) = 0;
|
||||
|
||||
/** Retrieves the session for the specified user identifier. */
|
||||
virtual Session *GetSession(const Anope::string &uid) = 0;
|
||||
|
||||
/** Processes a SASL authentication message from the uplink.
|
||||
* @param m The message to process.
|
||||
*/
|
||||
virtual void ProcessMessage(const Message &m) = 0;
|
||||
|
||||
/** Removes the specified SASL session from the service.
|
||||
* @param sess The session to remove.
|
||||
*/
|
||||
virtual void RemoveSession(Session *sess) = 0;
|
||||
|
||||
/** Sends a SASL message for the specified session.
|
||||
* @param type The type of message to send.
|
||||
* @param data The contents of the SASL message.
|
||||
*/
|
||||
virtual void SendMessage(SASL::Session *sess, const Anope::string &type, const Anope::string &data) = 0;
|
||||
|
||||
/** Completes a successful authentication.
|
||||
* @param sess The session which finished authentication.
|
||||
* @param nc The account which has been logged into.
|
||||
*/
|
||||
virtual void Succeed(Session *sess, NickCore *nc) = 0;
|
||||
};
|
||||
|
||||
/** Represents a single SASL session. */
|
||||
struct SASL::Session
|
||||
{
|
||||
/** The time at which the session was created. */
|
||||
const time_t created;
|
||||
|
||||
/** The hostname and IP address of the authenticating user. */
|
||||
Anope::string hostname, ip;
|
||||
|
||||
/** A reference to the mechanism that the session is authenticating using. */
|
||||
Reference<Mechanism> mech;
|
||||
|
||||
/** The unique identifier of the authenticating user. */
|
||||
const Anope::string uid;
|
||||
|
||||
/** Creates a new authentication session.
|
||||
* @param m The mechanism that the session is authenticating with.
|
||||
* @param u The unique identifier of the authenticating user.
|
||||
*/
|
||||
Session(Mechanism *m, const Anope::string &u)
|
||||
: created(Anope::CurTime)
|
||||
, mech(m)
|
||||
, uid(u)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~Session()
|
||||
{
|
||||
if (service)
|
||||
service->RemoveSession(this);
|
||||
}
|
||||
|
||||
/** Retrieves a description of the user this session is associated with. */
|
||||
inline Anope::string GetUserInfo()
|
||||
{
|
||||
auto *u = User::Find(uid);
|
||||
if (u)
|
||||
return u->GetMask();
|
||||
if (!hostname.empty() && !ip.empty())
|
||||
return Anope::printf("%s (%s)", hostname.c_str(), ip.c_str());
|
||||
return "A user";
|
||||
};
|
||||
};
|
||||
|
||||
/* Represents an authentication mechanism. */
|
||||
class SASL::Mechanism
|
||||
: public ::Service
|
||||
{
|
||||
protected:
|
||||
/** Creates a new authentication mechanism.
|
||||
* @param o The module that owns this instance.
|
||||
* @param sname The name of the authentication mechanism (e.g. PLAIN).
|
||||
*/
|
||||
Mechanism(Module *o, const Anope::string &sname)
|
||||
: Service(o, "SASL::Mechanism", sname)
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~Mechanism()
|
||||
{
|
||||
if (service)
|
||||
service->DeleteSessions(this, true);
|
||||
}
|
||||
|
||||
/** Creates a new SASL session.
|
||||
* @param uid The unique identifier of the authenticating user.
|
||||
*/
|
||||
virtual Session *CreateSession(const Anope::string &uid)
|
||||
{
|
||||
return new Session(this, uid);
|
||||
}
|
||||
|
||||
/** Processes an authentication message from the authenticating user.
|
||||
* @param session The session for which the message applies.
|
||||
* @param m The message sent by the user.
|
||||
* @return True if the message was processed successfully or false if
|
||||
* the session should be aborted.
|
||||
*/
|
||||
virtual bool ProcessMessage(Session *sess, const Message &m) = 0;
|
||||
};
|
||||
@@ -6,12 +6,12 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef NICKSERV_H
|
||||
#define NICKSERV_H
|
||||
#pragma once
|
||||
|
||||
class NickServService : public Service
|
||||
class NickServService
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
NickServService(Module *m) : Service(m, "NickServService", "NickServ")
|
||||
{
|
||||
}
|
||||
@@ -19,6 +19,5 @@ class NickServService : public Service
|
||||
virtual void Validate(User *u) = 0;
|
||||
virtual void Collide(User *u, NickAlias *na) = 0;
|
||||
virtual void Release(NickAlias *na) = 0;
|
||||
virtual bool IsGuestNick(const Anope::string &nick) const = 0;
|
||||
};
|
||||
|
||||
#endif // NICKSERV_H
|
||||
@@ -6,8 +6,7 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef OS_FORBID_H
|
||||
#define OS_FORBID_H
|
||||
#pragma once
|
||||
|
||||
enum ForbidType
|
||||
{
|
||||
@@ -23,25 +22,26 @@ struct ForbidData
|
||||
Anope::string mask;
|
||||
Anope::string creator;
|
||||
Anope::string reason;
|
||||
time_t created;
|
||||
time_t expires;
|
||||
time_t created = 0;
|
||||
time_t expires = 0;
|
||||
ForbidType type;
|
||||
|
||||
virtual ~ForbidData() { }
|
||||
protected:
|
||||
ForbidData() : created(0), expires(0) { }
|
||||
virtual ~ForbidData() = default;
|
||||
protected:
|
||||
ForbidData() = default;
|
||||
};
|
||||
|
||||
class ForbidService : public Service
|
||||
class ForbidService
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ForbidService(Module *m) : Service(m, "ForbidService", "forbid") { }
|
||||
|
||||
virtual void AddForbid(ForbidData *d) = 0;
|
||||
|
||||
virtual void RemoveForbid(ForbidData *d) = 0;
|
||||
|
||||
virtual ForbidData* CreateForbid() = 0;
|
||||
virtual ForbidData *CreateForbid() = 0;
|
||||
|
||||
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
|
||||
|
||||
@@ -51,5 +51,3 @@ class ForbidService : public Service
|
||||
};
|
||||
|
||||
static ServiceReference<ForbidService> forbid_service("ForbidService", "forbid");
|
||||
|
||||
#endif
|
||||
@@ -9,24 +9,27 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct IgnoreData
|
||||
{
|
||||
Anope::string mask;
|
||||
Anope::string creator;
|
||||
Anope::string reason;
|
||||
time_t time; /* When do we stop ignoring them? */
|
||||
time_t time = 0; /* When do we stop ignoring them? */
|
||||
|
||||
virtual ~IgnoreData() { }
|
||||
protected:
|
||||
IgnoreData() : time(0) { }
|
||||
virtual ~IgnoreData() = default;
|
||||
protected:
|
||||
IgnoreData() = default;
|
||||
};
|
||||
|
||||
class IgnoreService : public Service
|
||||
class IgnoreService
|
||||
: public Service
|
||||
{
|
||||
protected:
|
||||
protected:
|
||||
IgnoreService(Module *c) : Service(c, "IgnoreService", "ignore") { }
|
||||
|
||||
public:
|
||||
public:
|
||||
virtual void AddIgnore(IgnoreData *) = 0;
|
||||
|
||||
virtual void DelIgnore(IgnoreData *) = 0;
|
||||
@@ -6,8 +6,7 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#ifndef OS_NEWS
|
||||
#define OS_NEWS
|
||||
#pragma once
|
||||
|
||||
enum NewsType
|
||||
{
|
||||
@@ -16,14 +15,15 @@ enum NewsType
|
||||
NEWS_OPER
|
||||
};
|
||||
|
||||
struct NewsMessages
|
||||
struct NewsMessages final
|
||||
{
|
||||
NewsType type;
|
||||
Anope::string name;
|
||||
const char *msgs[10];
|
||||
};
|
||||
|
||||
struct NewsItem : Serializable
|
||||
struct NewsItem
|
||||
: Serializable
|
||||
{
|
||||
NewsType type;
|
||||
Anope::string text;
|
||||
@@ -33,9 +33,10 @@ struct NewsItem : Serializable
|
||||
NewsItem() : Serializable("NewsItem") { }
|
||||
};
|
||||
|
||||
class NewsService : public Service
|
||||
class NewsService
|
||||
: public Service
|
||||
{
|
||||
public:
|
||||
public:
|
||||
NewsService(Module *m) : Service(m, "NewsService", "news") { }
|
||||
|
||||
virtual NewsItem *CreateNewsItem() = 0;
|
||||
@@ -48,5 +49,3 @@ class NewsService : public Service
|
||||
};
|
||||
|
||||
static ServiceReference<NewsService> news_service("NewsService", "news");
|
||||
|
||||
#endif // OS_NEWS
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2011-2025 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct MyOper final
|
||||
: Oper
|
||||
, Serializable
|
||||
{
|
||||
MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { }
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user