mirror of
https://github.com/anope/anope.git
synced 2026-07-07 16:03:15 +02:00
Compare commits
1331 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a762391446 | |||
| c070a00114 | |||
| e7c3090a70 | |||
| 5dd6326eff | |||
| 535ad6fd70 | |||
| 5df4ac9a98 | |||
| 4c54a3939f | |||
| 3d09748d1c | |||
| 36a4be7623 | |||
| 5fc72660e4 | |||
| 303e652a35 | |||
| e5447a8024 | |||
| 1bee18fcf4 | |||
| a57e41304f | |||
| e0e8147ee0 | |||
| 41a24afa4f | |||
| 4266d17e8c | |||
| 8d3fa47ab2 | |||
| 64781817ac | |||
| 69c18f131f | |||
| e030771cbc | |||
| 03f05d3948 | |||
| 32c4908c8c | |||
| c5ff7c6868 | |||
| 89257d9bce | |||
| e47aacad0e | |||
| 72ade225a7 | |||
| a52af0d260 | |||
| 92920f5a1c | |||
| bf727285bc | |||
| 310e95a92e | |||
| 78bff86dab | |||
| 3f093d708f | |||
| c3cc5804c3 | |||
| dc58239c8a | |||
| b67963353f | |||
| a899c04ec2 | |||
| fb17bc85ea | |||
| 474cd7a99b | |||
| 7de4b86b7f | |||
| 76337bc04a | |||
| abe232601b | |||
| 6ada3ec871 | |||
| 61a8dd57f7 | |||
| 94427b234c | |||
| fb3c819bee | |||
| f0c23e80a2 | |||
| 1e86c46000 | |||
| 2f49065500 | |||
| 41ae2dbefb | |||
| f44280a9c9 | |||
| d147db9023 | |||
| f484a68dee | |||
| 8550e22167 | |||
| 9834518b28 | |||
| 64ca357b13 | |||
| dc5039e994 | |||
| 845ca576b4 | |||
| 2264a206d2 | |||
| d324e91520 | |||
| 9ac1b4ba01 | |||
| 7e0cb6d8ef | |||
| 3055b7272b | |||
| 969cd5dd6c | |||
| 1f02278a1c | |||
| 32007f81cf | |||
| 609f87d39f | |||
| e88925e587 | |||
| c46ec39e50 | |||
| 9b2202dfee | |||
| 03f6e26550 | |||
| c554e85063 | |||
| 2892c9580f | |||
| 3c0994a89e | |||
| e800afcfac | |||
| 2ad697898f | |||
| e4068249dd | |||
| d45cb5451e | |||
| d9c9f2a407 | |||
| 7213413f8b | |||
| 516211c88a | |||
| d576137f28 | |||
| e1f5e030bc | |||
| afffeb0a1d | |||
| 4fc71bb22f | |||
| d4732faf41 | |||
| 95684187b6 | |||
| 4f33b17f96 | |||
| 0cdab86978 | |||
| 4f76bee273 | |||
| 8557a4161a | |||
| c9008cdafa | |||
| 8a7793da0c | |||
| 64b332730e | |||
| 36837330ae | |||
| 8b64e46ef1 | |||
| c4460784c2 | |||
| 408ec02406 | |||
| 67fc8c3416 | |||
| fb2fd9e9d3 | |||
| 527e04275f | |||
| c895bd2e59 | |||
| 94b2d1ac12 | |||
| a76e074f6d | |||
| 2f004c2aab | |||
| b940077553 | |||
| c8ded08b43 | |||
| 62a01dcc87 | |||
| 0cd3bfa24f | |||
| e46bcff324 | |||
| 67719e8db1 | |||
| 48be41cf7b | |||
| 5ceee5df38 | |||
| 1c12976958 | |||
| 96583892c6 | |||
| 0991d4e199 | |||
| 58233fb8bc | |||
| be928b5bbc | |||
| 31bc1d6b82 | |||
| 829ef1b7bd | |||
| b068874f40 | |||
| 18b3c572f4 | |||
| af034928cb | |||
| 8d40a750cc | |||
| 6a3f7c01b1 | |||
| 4c2bf72cb6 | |||
| 8e7b742ec7 | |||
| 19b47c7bae | |||
| 3bdc81348a | |||
| bf8f62c32d | |||
| d417241a5b | |||
| e5cb2018e5 | |||
| df6095fed2 | |||
| 8210e82a5e | |||
| d6d72cd803 | |||
| 063d9bf5f6 | |||
| 830e8617e6 | |||
| cf89e10a4c | |||
| 6842ad36f7 | |||
| 24f17de4aa | |||
| bbb04d4662 | |||
| 20052247c3 | |||
| 8b61a529a2 | |||
| 1137c50095 | |||
| 52d422d020 | |||
| 43c460e593 | |||
| 17ba13bc95 | |||
| 60229b15d2 | |||
| 3c88f3b8cf | |||
| 93cb5d06db | |||
| 7a64d95f7c | |||
| ff66e15f38 | |||
| 07902c03fd | |||
| d9949320c7 | |||
| b0ec178e85 | |||
| f753a925ad | |||
| 74dbfe0699 | |||
| 3bea089793 | |||
| ff93355af8 | |||
| 8fecad3039 | |||
| 37bd2c238e | |||
| 9a947fa435 | |||
| 4f7868b125 | |||
| 8066378471 | |||
| ab27b792b0 | |||
| f1c3bdd55e | |||
| 08edb15bea | |||
| 56c6ef4449 | |||
| 6526d2d8b3 | |||
| 76ab5c2c38 | |||
| 54e98f017c | |||
| bb7706d0f7 | |||
| 16e0b72d2d | |||
| b578e32531 | |||
| 4d8e3b847d | |||
| eaade23f9b | |||
| f20bac996d | |||
| 93bfd4cbe1 | |||
| 6620f9e9bd | |||
| dc64cfc940 | |||
| f8829783d2 | |||
| d6e600f74b | |||
| 5f7113bc0e | |||
| dc4daa25a7 | |||
| 0cadaedfbe | |||
| 11ad788dfd | |||
| 38a60d9142 | |||
| e8ad509aa5 | |||
| 37b3ed8ef3 | |||
| a6af422184 | |||
| 53acb73193 | |||
| 57f6d4f49c | |||
| d0467adea2 | |||
| 16924f68c0 | |||
| d280c48e6b | |||
| f0c0daa644 | |||
| 7a2d027e1d | |||
| f627a3bacd | |||
| 5a1257b7f0 | |||
| 866f3f32ab | |||
| 20ce170024 | |||
| 4034b3054a | |||
| e581158645 | |||
| 01021131ca | |||
| 13ea98a02e | |||
| db56a61f86 | |||
| df321a118e | |||
| 1931fcf0e5 | |||
| 63b02b8c97 | |||
| 1c8a77ab9f | |||
| 0c7d53f81e | |||
| bcc3ae5742 | |||
| 4e67e0897a | |||
| 76a9538441 | |||
| 91c7862579 | |||
| 6b6bc81999 | |||
| 1f2c385bb9 | |||
| d79dd0b7d7 | |||
| 8b2e8137f6 | |||
| 732466d8f4 | |||
| 3049916ade | |||
| 0afd666f22 | |||
| 8021a53ac4 | |||
| 0663f5e412 | |||
| 2ee496b8ac | |||
| 3abb18721b | |||
| 4eb0a3bdb7 | |||
| 6a03eb69eb | |||
| 4fa2a00bd5 | |||
| 82008d507c | |||
| 2ab4f175a8 | |||
| c9473bcc67 | |||
| 75ed5a9b59 | |||
| f010ab7dbf | |||
| 00b2cc9ce6 | |||
| d52cc7bcbc | |||
| 63838fa77d | |||
| e36f8143e3 | |||
| 72b26043b2 | |||
| f369157906 | |||
| ba46b8e4ab | |||
| 254901aace | |||
| c1c45a5db9 | |||
| a65e95837f | |||
| 43219d3906 | |||
| 1f8dec4c24 | |||
| fb5c5e3442 | |||
| e357c39774 | |||
| 10732baec2 | |||
| 068c6989de | |||
| 317d55f3f1 | |||
| 1397fda786 | |||
| 4ccc478830 | |||
| 100ecbb9be | |||
| cdf636e696 | |||
| 45878bf182 | |||
| f1bec3999d | |||
| a259244297 | |||
| c1da009de3 | |||
| 4f412bc213 | |||
| 1882916dc4 | |||
| f436ce9912 | |||
| ef9729fb02 | |||
| 296a75f2a9 | |||
| bce7237d9f | |||
| 85834e19dc | |||
| ca6b3723a9 | |||
| 23b1086072 | |||
| 860deb14ce | |||
| 62885fa462 | |||
| 3fef01e35b | |||
| b0597e35ec | |||
| 8d1ad6fbe5 | |||
| 750569201a | |||
| 1a1a781b72 | |||
| 4b5ce8a972 | |||
| 98cfdd26c4 | |||
| 051a42b547 | |||
| 220e278213 | |||
| 547fe0da1a | |||
| 09bec79b47 | |||
| 55a5affcb8 | |||
| a8b4297023 | |||
| 5969362425 | |||
| 3ceae33b16 | |||
| 5de4c1fc97 | |||
| fd109048dd | |||
| a0747516ce | |||
| 605e1f2a03 | |||
| dc23c58869 | |||
| b7e646ec83 | |||
| 4d54358745 | |||
| ed0882ec04 | |||
| 526c4e4659 | |||
| b70f72bf2b | |||
| 2ad4c1906e | |||
| 049760cc7e | |||
| e2ecec31b5 | |||
| fee016bb84 | |||
| d24fb03917 | |||
| 5adc8bfefc | |||
| abcf0cde5a | |||
| 8f3bd314ed | |||
| e2d456d4ce | |||
| 96202ae545 | |||
| 2b0229d4e2 | |||
| beaa3196b3 | |||
| b6d771a114 | |||
| d3ed756bd0 | |||
| f8308841a6 | |||
| 1dfdf36fc3 | |||
| 4ac3ade126 | |||
| 212abeb986 | |||
| 7d4427c313 | |||
| e836be489e | |||
| 1db5c555d6 | |||
| bb1b015103 | |||
| e42684ac39 | |||
| d7de7eee60 | |||
| 0a390ad392 | |||
| aa6b12c5eb | |||
| e2bd08fbff | |||
| 2047934060 | |||
| e07dcbff08 | |||
| e3a8a45a61 | |||
| f1ad7fd582 | |||
| 43f2645b32 | |||
| b6935e706c | |||
| a3c845894d | |||
| 5933a5e9b1 | |||
| 109d8f431f | |||
| 1edb7e776b | |||
| 928e2e1b7c | |||
| 5a140e4898 | |||
| f64393941e | |||
| 0db81ca46a | |||
| 7f7144de1f | |||
| 3883716883 | |||
| 5beea4eb7e | |||
| 2d0fdb74d1 | |||
| 80588fba81 | |||
| ef7dc94f88 | |||
| 7b4eec9748 | |||
| baff417652 | |||
| 7074944810 | |||
| 1c39d25cca | |||
| f1c5c27f3f | |||
| 9c0134ee2c | |||
| 959fee5937 | |||
| 3854a5570f | |||
| ab1e0ebfb3 | |||
| cffe864900 | |||
| bc1575318b | |||
| a71d0f6757 | |||
| 50d7bf710e | |||
| d44bcef31b | |||
| c0ce71e55a | |||
| 0eeb0caf08 | |||
| b13bded620 | |||
| 1b1180fda6 | |||
| a4ecfa5bc0 | |||
| 3c8009b495 | |||
| ca85df2d74 | |||
| 5dfa6598c2 | |||
| f428d61045 | |||
| fc50edf046 | |||
| 269c2786e9 | |||
| 96fc940af7 | |||
| 8c8e6d464a | |||
| 22976b8a7c | |||
| 4dff710361 | |||
| fe80d2cded | |||
| 16dac87841 | |||
| 30c59562e0 | |||
| 6d61a84286 | |||
| f6b8596c7b | |||
| da6760f606 | |||
| ad962ad759 | |||
| 5327becf41 | |||
| f43c99c5cc | |||
| c0a491cb06 | |||
| 66cc965fd7 | |||
| 2440514a7b | |||
| fad1da81a3 | |||
| bb0e2a9a07 | |||
| 4f8c4f8fef | |||
| 25957111b2 | |||
| 9a8895359a | |||
| 53f8db0198 | |||
| f94cb7fb11 | |||
| c30fb13a0c | |||
| 7926238fd2 | |||
| 211a944210 | |||
| cff61617e1 | |||
| 4455d4346c | |||
| 405b41ec87 | |||
| bacb276181 | |||
| 4c1f6b48d8 | |||
| 53a78c2688 | |||
| e61a283c02 | |||
| c3302194eb | |||
| cd184596a2 | |||
| f28b1142f5 | |||
| 87230c17b7 | |||
| a29b7897f0 | |||
| e965bc3049 | |||
| 01780c9e7a | |||
| 4d3363f83f | |||
| 75e27b6a47 | |||
| fbaca3f7a1 | |||
| 81b01bb55b | |||
| 1027ec667a | |||
| 4d9273efa4 | |||
| 67c13b41ee | |||
| 10386a39f0 | |||
| dc19ea3993 | |||
| 2261fa3fe7 | |||
| fab9f0fecc | |||
| df8d85d80a | |||
| 4b192addd2 | |||
| d27594f8a6 | |||
| 43aaaeab7e | |||
| ccae59430a | |||
| 974adb7ce1 | |||
| f3531e7564 | |||
| 15a27c69ba | |||
| 0b0db75ba5 | |||
| b90a9a339a | |||
| 64f9aed761 | |||
| 56f2cbeb62 | |||
| 9a9ca41750 | |||
| e19661e1de | |||
| 09879c5c15 | |||
| 12f55e4711 | |||
| 43c56541d5 | |||
| d3078850d2 | |||
| d4f7db122d | |||
| 201ad9c191 | |||
| 45c0bf8f32 | |||
| d64855b35b | |||
| 4617fdbf3d | |||
| ac204745c8 | |||
| e1ce6174ce | |||
| 2781b6946d | |||
| 1e502c8450 | |||
| 004c4cbe5f | |||
| 072202c181 | |||
| 595dad4ec1 | |||
| a374e245fd | |||
| 6e6543d3ed | |||
| 6124af68cc | |||
| f21b40bfb4 | |||
| 567700b5a6 | |||
| 3b80da9cbd | |||
| c519119197 | |||
| 780bc7ca14 | |||
| 3d12752655 | |||
| 9c0ceed36a | |||
| 187973c16a | |||
| 072631aa38 | |||
| b638b653d2 | |||
| 0fb2b60cff | |||
| 16f3f0cbc0 | |||
| b28db7bc55 | |||
| 9bf9cfcf5e | |||
| 0c9750a22b | |||
| 69c5aeca57 | |||
| 59c3c1326b | |||
| 5829d7da39 | |||
| 2f29c1388c | |||
| fc0e8264c0 | |||
| 19eccf0cae | |||
| dbf5106c09 | |||
| 3029a2db1a | |||
| 53df61b4c2 | |||
| 7d27689d05 | |||
| 421e194c5a | |||
| c442bc18af | |||
| 1c02961b60 | |||
| 268d529078 | |||
| 4bc4b98ac7 | |||
| e8b42607e6 | |||
| e792865a04 | |||
| 2b5a1d8c8f | |||
| 7cf21342f4 | |||
| ba8a646a33 | |||
| fa50252c77 | |||
| 46bb2de866 | |||
| c2e9b8080b | |||
| c0cd76a0a5 | |||
| ab6cd3b26c | |||
| 275f2fd374 | |||
| c4d4107412 | |||
| ae5da11389 | |||
| e6544a06f4 | |||
| 1ab7d53649 | |||
| d709c819d2 | |||
| 2ad4a8667f | |||
| 6ff83c3407 | |||
| adbc5a0e65 | |||
| f9a4a0fbef | |||
| a282a5c9c4 | |||
| 3ddfa2fc1d | |||
| 50f430fb23 | |||
| 1b4d62e2bc | |||
| 43f608ff2b | |||
| f0313a45cb | |||
| 96af354ad5 | |||
| b5966cf99e | |||
| faab2c6793 | |||
| c6f85b9312 | |||
| 5e4d52ad47 | |||
| 6628e714c7 | |||
| 0f9e931fa6 | |||
| 1f6385c095 | |||
| be044c9d6e | |||
| 90aa576fb3 | |||
| 77e5744341 | |||
| e1264a5913 | |||
| 18f423226c | |||
| c967a4ce88 | |||
| 1542937d64 | |||
| 3b8f1cd59f | |||
| fbbdedf17e | |||
| b75faefea4 | |||
| 676db0ba6f | |||
| b2802d0beb | |||
| 826ae9b6c0 | |||
| 2c3e8a76c9 | |||
| 0bb23f3f4d | |||
| b36498149d | |||
| f6cf978d0c | |||
| aeebaed4b2 | |||
| faabff0261 | |||
| cba811bc6b | |||
| dcae3d7bda | |||
| fc69b68891 | |||
| 15e527fa70 | |||
| 3ccf26fda4 | |||
| c0b0ee1b39 | |||
| b353e1db79 | |||
| 3edce88698 | |||
| 9e1fb11f93 | |||
| 316c280a57 | |||
| cc2a999b4e | |||
| 51a9f64adb | |||
| 332fd23927 | |||
| 1aca2922af | |||
| b65fd34a39 | |||
| c9f4c2db1f | |||
| d1248d1249 | |||
| afc5c91a09 | |||
| aa6c3f3474 | |||
| 2a35151d12 | |||
| fa7cee9759 | |||
| 431b2e6768 | |||
| 853e926920 | |||
| 8267407a78 | |||
| a831e5d306 | |||
| b901dfee84 | |||
| 6e8d2bf09d | |||
| 70e9b20274 | |||
| 4ee9021adb | |||
| c8db362bca | |||
| c710625cd3 | |||
| ac2f8bf64d | |||
| 04e7fa493a | |||
| f7692ec77f | |||
| 4a1d32c5fd | |||
| 498da95205 | |||
| 710d4848bd | |||
| bd3bed2118 | |||
| fe31b0a666 | |||
| 1f97d6d879 | |||
| 4bd5649105 | |||
| b5af310f8a | |||
| 2cfc97053f | |||
| 6cde65a57f | |||
| 7cb35eeedf | |||
| f0318fdbe8 | |||
| 93a83da771 | |||
| 0ff1bb9d5b | |||
| c0dea5ef30 | |||
| fd4ac7f6fc | |||
| e635f547d6 | |||
| 7167cff703 | |||
| b844154857 | |||
| 5e56dfdb1a | |||
| e1d460e211 | |||
| 9ea6fb25b9 | |||
| 7755668679 | |||
| 569efbb66b | |||
| 696801430b | |||
| 1b08ba8f41 | |||
| 277f735505 | |||
| f63a2bdfb4 | |||
| feb412bdb1 | |||
| ab856683c7 | |||
| 97d7c21193 | |||
| e5b8435769 | |||
| e589080827 | |||
| 257b10ee91 | |||
| 353ee5cc93 | |||
| b094132c9d | |||
| 82006b868f | |||
| ba5a3f5f00 | |||
| 7b6c08b53a | |||
| 47b692f9ae | |||
| ed06609ae1 | |||
| 32a57150ec | |||
| 2a5e8f1890 | |||
| a04c320b4b | |||
| 4221a507cc | |||
| 44dd8d07d9 | |||
| f7aa69b596 | |||
| d5ecc39104 | |||
| 84a02d2709 | |||
| 4b059beb24 | |||
| b319fb089c | |||
| 17196887ad | |||
| 02d67f682a | |||
| b306108740 | |||
| 12a0311aaa | |||
| cf653fc084 | |||
| 5cc7fc0387 | |||
| 832bc35135 | |||
| 06c5914820 | |||
| bf67b9ee5c | |||
| 829c169063 | |||
| 4948120b69 | |||
| 994471f5a7 | |||
| 80c02740d0 | |||
| df3c0b7b52 | |||
| 45702992ac | |||
| 9756f96b85 | |||
| 6ac0364f74 | |||
| 4f820a7d41 | |||
| 5f7127dd92 | |||
| dcb3ff7d34 | |||
| 1107b92699 | |||
| 3b0b1bc80e | |||
| b60b23fd48 | |||
| 5aac6377c2 | |||
| 20856fb59c | |||
| 7545763cd4 | |||
| 1818b19eba | |||
| abc7e4b423 | |||
| e5ece18ee7 | |||
| 8641b995c4 | |||
| b880240d72 | |||
| 5ce90ba7d1 | |||
| 98bae827e1 | |||
| e3c05efe5e | |||
| 8cbaf7e990 | |||
| 339f41aebc | |||
| 55e4ef9d3a | |||
| f63e4ceebe | |||
| b005089f2f | |||
| 1b42e26642 | |||
| 4691351167 | |||
| 404debf789 | |||
| 752a5ca1b7 | |||
| e1a1cf0e6f | |||
| 3fabc2f831 | |||
| 59ea36c831 | |||
| fac880664c | |||
| 7f890ce98d | |||
| 50e1a3e96c | |||
| 6b79349e6c | |||
| 678f54903d | |||
| 714a4a3004 | |||
| 34826f71c7 | |||
| 847cceaba3 | |||
| 09046e3c99 | |||
| 00a19529c3 | |||
| 446b3a910d | |||
| 76f5d4b316 | |||
| 9b59925144 | |||
| 243d781e99 | |||
| 8be5f53f1f | |||
| cd49bb40c2 | |||
| ef3d115bae | |||
| 9f1178ec58 | |||
| 3bc2db561b | |||
| fad603e7a4 | |||
| 5f006bf139 | |||
| aaa12cc018 | |||
| 2238db8338 | |||
| 4d1492d444 | |||
| 5c4414e4a5 | |||
| 6f9b77e336 | |||
| 154fa25e8f | |||
| 9793062007 | |||
| f86dc247e5 | |||
| 2b1f75a313 | |||
| 5ac0c9a327 | |||
| e8763d5b3c | |||
| ce7a32a994 | |||
| 0c1cc08e28 | |||
| e12e4e6956 | |||
| 52535cf6fb | |||
| 121d0a6e5b | |||
| 34535814e4 | |||
| 8bcc6840ce | |||
| 08d113332c | |||
| 765943062e | |||
| 17cca42d48 | |||
| 760fdc4049 | |||
| ead4aa7ed9 | |||
| 65911dd1be | |||
| 4abfdcbb9c | |||
| de5c8c0d38 | |||
| 8e011bbb78 | |||
| f15a9749f9 | |||
| f1956b039d | |||
| 53d5b7c29e | |||
| 812cb04fde | |||
| 1314d5b4f1 | |||
| 490601de3a | |||
| c7aab50bff | |||
| c507c78d5a | |||
| 58c05687bf | |||
| f8cdcc65c6 | |||
| 10a918f9e1 | |||
| e4d1769a8b | |||
| 7cd80a2131 | |||
| 9d6f88de39 | |||
| b93d650b1f | |||
| c480695369 | |||
| 7f1b5552dc | |||
| 4865a8cfff | |||
| 1efd289488 | |||
| 83e4b183ea | |||
| 1e625b6837 | |||
| 402c624e45 | |||
| fde83f6564 | |||
| f0f43cf426 | |||
| 3dc64bac4d | |||
| 2450a64bf4 | |||
| b48293a632 | |||
| e908dc0dc7 | |||
| 378c9203df | |||
| 779f3788c9 | |||
| 604da89813 | |||
| e11abdc4f0 | |||
| 5aac04dffe | |||
| 7480fbda2b | |||
| 9629ccb374 | |||
| cb70d976ba | |||
| 6db0186947 | |||
| 492eac20a8 | |||
| c8511a625d | |||
| f6b915a169 | |||
| 02c1724d75 | |||
| 7e87bb69fc | |||
| aae522d72b | |||
| 0a821640bb | |||
| 37733dea65 | |||
| eabb9c0c11 | |||
| b103d16eb1 | |||
| e3b6ae3649 | |||
| 0ff48e1538 | |||
| 53038d83bf | |||
| 2ea594d677 | |||
| e957c7b2d2 | |||
| 9a4f27e0a3 | |||
| fccc4a4fa6 | |||
| 4325073524 | |||
| 55199f0a4c | |||
| 7edc76f7fb | |||
| 3fbdde5e18 | |||
| 9f8b4ac382 | |||
| 998925c90a | |||
| 7f971043bc | |||
| c2e1a8a3e2 | |||
| c62b3cb275 | |||
| 1a3d9a016d | |||
| 518182ac92 | |||
| 7d0e063300 | |||
| 5e36d848d5 | |||
| fee461f3d0 | |||
| 1773eef143 | |||
| 7704ee7107 | |||
| 5ac1e9175d | |||
| 5695c9e079 | |||
| f92b0d6ea0 | |||
| fc527b464a | |||
| a93b315bd3 | |||
| 5246424dc0 | |||
| 1316147a8c | |||
| 70319ab8be | |||
| 7dd358972a | |||
| d463ae3b1e | |||
| ebda113f44 | |||
| 6ab6eca0a6 | |||
| b1ba1ec8ac | |||
| 9956da18e3 | |||
| b56e71ab14 | |||
| 6f45d72497 | |||
| f5c01bf617 | |||
| 06bad31b18 | |||
| 576aaff3da | |||
| c5bc8fab32 | |||
| f6e2ebe145 | |||
| 37b3535543 | |||
| c21e8d9204 | |||
| 22658d63bd | |||
| f2dee1e1d6 | |||
| 968ef349d6 | |||
| d6640ed5ee | |||
| aabc217a6b | |||
| d82391e46d | |||
| 7aa02864d2 | |||
| 2a8202c832 | |||
| be4a39ceb6 | |||
| a3dc75c61c | |||
| 14dc142a92 | |||
| 51b7d53108 | |||
| 3253455792 | |||
| 879b310580 | |||
| 5ff3aa7209 | |||
| ca93122a68 | |||
| 2428264315 | |||
| cc4a14b0ba | |||
| 934b584374 | |||
| 4237d49d41 | |||
| 1c36de5ab1 | |||
| da948be089 | |||
| 9384a4f088 | |||
| 4d62c673fa | |||
| 7426b3b04a | |||
| 735e234c2c | |||
| 735f0ba6cf | |||
| 9ee7c825e1 | |||
| 912103ec13 | |||
| f843e7bd90 | |||
| d7e2ab688b | |||
| 5e7085130e | |||
| 9b07e163c0 | |||
| 6859decfb8 | |||
| e23baf4297 | |||
| c7f77b3b66 | |||
| 6578829fa6 | |||
| ef06226521 | |||
| 4c669b947f | |||
| 3fbb493d57 | |||
| 223aa65cfa | |||
| fe54dfb37f | |||
| 3f5f84c92c | |||
| 5b3f81ea78 | |||
| 3e8752fe66 | |||
| 57c2b65f08 | |||
| a118946e65 | |||
| ee2dcf11b8 | |||
| e91de41278 | |||
| 10b5b00db4 | |||
| 2044b4d3ad | |||
| 1d0bb9b26b | |||
| 781defb707 | |||
| 16c124d34e | |||
| f08dbced60 | |||
| baabc91ead | |||
| 81483ae5e7 | |||
| 003140bf60 | |||
| b405484fb9 | |||
| 9a45626379 | |||
| 10d10d057e | |||
| aa2844a3fc | |||
| 42c640a9b5 | |||
| 066fc5801b | |||
| 416eaa1e66 | |||
| ac19a5c24b | |||
| 6f9dd282d2 | |||
| c56d72ba84 | |||
| db4ed1cfaf | |||
| cb64d806c1 | |||
| 4f9b7874d6 | |||
| 207c46c871 | |||
| 957cb2bf93 | |||
| b244c74479 | |||
| b76b2e11c8 | |||
| b35665bb54 | |||
| c3eb5b885d | |||
| 6faf4e3823 | |||
| 325b018ed0 | |||
| 0a3d27a91f | |||
| bcd85ca682 | |||
| ac40c53fe4 | |||
| 2eae82da5c | |||
| 72493b7305 | |||
| 1a37e1c048 | |||
| fb7fef7a84 | |||
| 36602224b8 | |||
| ccecfdf445 | |||
| 32d1184c00 | |||
| 6a46a08a85 | |||
| 7a2e6aa5c2 | |||
| 34b5f9ce6e | |||
| f77eb0a282 | |||
| 302a409136 | |||
| 0b3b9fe128 | |||
| f71c7865fc | |||
| 4ecf20b3f5 | |||
| a5b8788014 | |||
| 3cc7950c4b | |||
| 854bc4db0c | |||
| dbc77279bf | |||
| c4ef566a65 | |||
| 66376335ab | |||
| 823bc01f66 | |||
| 947ad6f73a | |||
| 06c8a1ef50 | |||
| b3fd861b3e | |||
| 62262f4b0d | |||
| 6e0dc0e210 | |||
| 7e7556f064 | |||
| 111d6a9178 | |||
| d23817604c | |||
| 4694c7afb4 | |||
| a52293336f | |||
| f24e17f8b4 | |||
| 2b208de02f | |||
| 4eb5d153c0 | |||
| 0451dd3d0d | |||
| c3e4f1bf7e | |||
| f122f104c4 | |||
| deedb3bdd7 | |||
| d27aa03500 | |||
| dcffa5da6f | |||
| 221e79f50d | |||
| d5a453b663 | |||
| a2d69fa431 | |||
| 6a0e4418f4 | |||
| 68eeac67c9 | |||
| 731912f01e | |||
| 51963915ba | |||
| 810685cb73 | |||
| 1a0e6b0be3 | |||
| 81c89bb708 | |||
| 01620e849a | |||
| 4c74020a69 | |||
| b95b8f0aae | |||
| 1ff7a7c1f1 | |||
| 1d16629a6d | |||
| 72aa27ede5 | |||
| 05223dbe6d | |||
| 06d43baf93 | |||
| 5f74662100 | |||
| 2c68312d72 | |||
| ce094f4d01 | |||
| 178056096f | |||
| a32c897bf9 | |||
| 367b662c83 | |||
| 75999e05b9 | |||
| 45c02f8e4e | |||
| ae4421b8a2 | |||
| 2d309da0f6 | |||
| b9bbb3747b | |||
| 0b05eaa020 | |||
| 91ad9d22ca | |||
| 6aa9ad938a | |||
| 6808498ead | |||
| 8561941e22 | |||
| 5d4db2b854 | |||
| 501503b7a5 | |||
| a980e32581 | |||
| da2fea338a | |||
| 7cb70f5fa1 | |||
| d04db3d38b | |||
| 35c260877f | |||
| 8cf7ec9cfe | |||
| c67087d750 | |||
| 2336b4723c | |||
| da61734860 | |||
| a911354f24 | |||
| ae902443db | |||
| 5547c3ed24 | |||
| e844cdf4f6 | |||
| 2fa5cfa508 | |||
| 59792173e7 | |||
| ed68482b4e | |||
| 32592987c8 | |||
| a1f92638e3 | |||
| 7d50818ee1 | |||
| d0e1f3b66a | |||
| cb91f991a3 | |||
| a49d7b12cb | |||
| eda7b55bac | |||
| bcf99d5998 | |||
| 3ab6706993 | |||
| c40e9c3996 | |||
| 7be23b7e37 | |||
| d9c18a6072 | |||
| 73099b82e8 | |||
| fc1d7ea89b | |||
| 391f2822c8 | |||
| f0875c5d85 | |||
| f6ef706909 | |||
| 7656c25e38 | |||
| 5cf1edeb6e | |||
| 9e544a6443 | |||
| 225b7c38c1 | |||
| 994866461c | |||
| fc4b884d0e | |||
| 9b3ecfe777 | |||
| 20794981b3 | |||
| 01413dd3cc | |||
| 9d1fe6102c | |||
| 2472a41561 | |||
| 65fbdcfa87 | |||
| 25cec015e8 | |||
| 62e3c8c4f8 | |||
| 8902c1f038 | |||
| 6c43bcc3e0 | |||
| 15b37c1e38 | |||
| 29fcdc5f40 | |||
| 1075bb1dbc | |||
| dccb0ee313 | |||
| aea86906f4 | |||
| a62698a14a | |||
| 47af43c281 | |||
| ae2c82adbc | |||
| 594b1a136d | |||
| ae46cc7f73 | |||
| 6b2aad734e | |||
| 98ccbe2b06 | |||
| 5ae100fea2 | |||
| 0052dd29a7 | |||
| 50a42d2cbf | |||
| 49cb6a07a2 | |||
| ed7c4dc2e1 | |||
| c376fb0a2b | |||
| 76d9e58ae5 | |||
| 3769cc1a35 | |||
| 74ace7d4b9 | |||
| 647245a71f | |||
| a634c7be65 | |||
| f656e3195f | |||
| 8811545472 | |||
| cad3850f3d | |||
| 7de058ba35 | |||
| ddaa001daf | |||
| 51c049e1a7 | |||
| 93472f84bd | |||
| 678d27fdb7 | |||
| 369ca89c2e | |||
| 421db75528 | |||
| 846b56c724 | |||
| e62d2fe56e | |||
| bb3abab784 | |||
| da6543d17b | |||
| 29a018088e | |||
| 7e7fc757d5 | |||
| d3a6bdc68b | |||
| 402e42fd15 | |||
| 5007b72b28 | |||
| 9931ec2994 | |||
| 5f3dfc2960 | |||
| dc9e81a6fc | |||
| ed719c80e7 | |||
| 77dc2e4746 | |||
| c5f4c8d174 | |||
| 6ba49642d0 | |||
| 9a2ef9dc00 | |||
| 6ccf0a3428 | |||
| 23e303aaa2 | |||
| 098157dca8 | |||
| 827469600e | |||
| bf718e8698 | |||
| 326f1a9c8b | |||
| 793c438286 | |||
| 6b1f323bb5 | |||
| 761849083d | |||
| ae6ddf295a | |||
| b591e8cdc8 | |||
| 379b2ccf92 | |||
| 3fb4cf56b6 | |||
| fdc62daa8b | |||
| 05094b0da5 | |||
| 4ab8a70b21 | |||
| c88a3fffd5 | |||
| 7b1ae9602d | |||
| c7a22dff87 | |||
| 45ee7c12d0 | |||
| 392b591d09 | |||
| 556a4375e2 | |||
| eab583310d | |||
| 077ae27369 | |||
| d4e1c958e2 | |||
| 33ae442aa1 | |||
| 1285c7f0ca | |||
| 8c72892de1 | |||
| dc751bd2f1 | |||
| 0cde0aee34 | |||
| 503bda5b28 | |||
| a4d5c40d63 | |||
| 8e219bdd77 | |||
| 5acc93dd34 | |||
| 276247b463 | |||
| d277f49423 | |||
| 67bd2c6b2d | |||
| 784683a68d | |||
| 3b2094301d | |||
| 6572754c10 | |||
| f157ea3fdb | |||
| ddd7fe6f05 | |||
| 47a351acb2 | |||
| ff9f670871 | |||
| f33f7d98c4 | |||
| c49f03f985 | |||
| 6b5f583ff3 | |||
| 8e3ab0d10b | |||
| a049092526 | |||
| b6407afa06 | |||
| fbd3cda320 | |||
| 05341828b5 | |||
| 280ba89b26 | |||
| fe7fcc2dc3 | |||
| dcd34d3728 | |||
| dced01fc24 | |||
| cdec0a3f96 | |||
| 1075f3b457 | |||
| c1077faa28 | |||
| 76ba147c22 | |||
| 1c1a216df1 | |||
| 04f96a54b8 | |||
| 5f72d1fda5 | |||
| dfff54425b | |||
| 0edd26467e | |||
| e71c890cf5 | |||
| eada35df36 | |||
| 8d4a08ccc1 | |||
| 9dec093676 | |||
| f711dd3460 | |||
| 7a865b6b28 | |||
| faaaae365a | |||
| 705d1efeab | |||
| c0f60d56a1 | |||
| a4468dd56e | |||
| 337f361526 | |||
| 26a048e5c4 | |||
| ccd41e7efe | |||
| a1a5ba0723 | |||
| 8a6962fc36 | |||
| f23bad140b | |||
| 1bfafd9eb6 | |||
| 1bdb756b25 | |||
| 80c573eed7 | |||
| 78607ea60c | |||
| 0110214abc | |||
| 54d8695e70 | |||
| a2441fd326 | |||
| 831a1d15d5 | |||
| 6b5df8e62f | |||
| 0210cf2b17 | |||
| f0708340ef | |||
| a44bf31d27 | |||
| 002f00d7eb | |||
| ded89b0d49 | |||
| 36b1166cf6 | |||
| 0e7bd9f3ba | |||
| 7963534940 | |||
| d33a0f75a5 | |||
| 368d469631 | |||
| efd3c04f37 | |||
| 5fe6f0b2ec | |||
| 5d6fb2427e | |||
| ad3d1d381a | |||
| b51f60cc1e | |||
| 504232b388 | |||
| 8f36f65f39 | |||
| ff3e396e92 | |||
| 2fe387b4f0 | |||
| 9ec482b7c2 | |||
| 53e8cd18dc | |||
| ac57f41c87 | |||
| 8b78b6bb10 | |||
| 52fa66820c | |||
| 72eb2ccf50 | |||
| 4cfd468863 | |||
| 0cf8d73395 | |||
| 53b2bdfe5e | |||
| 27ab6a686c | |||
| 22c8297a03 | |||
| d22e86376b | |||
| fb56b3a53f | |||
| 0c47017046 | |||
| 792091b23c | |||
| b917361de8 | |||
| a0a54fdfe0 | |||
| d90d5d538b | |||
| c2ae76248e | |||
| 9aa71af1e5 | |||
| b64abebd24 | |||
| 90930619bc | |||
| 5b1c823019 | |||
| b2b4f21e39 | |||
| 22e55165c9 | |||
| 35c2256849 | |||
| 3a10fca75f | |||
| a39947cd3c | |||
| 1730bfb2bc | |||
| 26a4a13cdf | |||
| 36f357c354 | |||
| b07928eea9 | |||
| 1ef7480380 | |||
| e4c2dcc0c7 | |||
| 7bdad857e4 | |||
| c2a8ad26af | |||
| fedf235c83 | |||
| e88d2c2031 | |||
| 20e4685057 | |||
| ca55e15d44 | |||
| bb5e4127d7 | |||
| 30028a2404 | |||
| 6883309927 | |||
| 9c8570ac68 | |||
| 4dfc0f952f | |||
| d6e1b92059 | |||
| bb5f4555dc | |||
| 32d33ca8e5 | |||
| e1dcf24c98 | |||
| 3b24311db6 | |||
| 8fd3fc7c13 | |||
| 8d27b25bf8 | |||
| 727b35536f | |||
| bbe667dc74 | |||
| 3608d42ae9 | |||
| 8f33933dd8 | |||
| e5efe42ecb | |||
| 10e21bfeda | |||
| 00256fdba8 | |||
| 3b8fb7bb88 | |||
| 1057fa8421 | |||
| fca9ec085e | |||
| ef5c6684c7 | |||
| e0438e3a7e | |||
| 04632bd381 | |||
| 0b9db15efc | |||
| d5b2f9cfa7 | |||
| 727c3d5b75 | |||
| eddb7684c1 | |||
| 484baba6ad | |||
| 88f10a2c3c | |||
| ffa1c976f5 | |||
| 4fdc157f68 | |||
| 0a950669cb | |||
| 1232018332 | |||
| 6237613439 | |||
| 4424abd15d | |||
| 76a0471c29 | |||
| e08422a4ea | |||
| 757ff06011 | |||
| 06defe014b | |||
| 63bf134321 | |||
| 2113494274 | |||
| 912f068fe4 | |||
| 8f5d786f0e | |||
| 1dacc648a0 | |||
| 3af786d4c9 | |||
| e57b470e83 | |||
| b8b63ff115 | |||
| 959a3f3cca | |||
| 0a111c1976 | |||
| 4b68f0447c | |||
| 31914b200b | |||
| ebb3fca698 | |||
| 7f72b466ac | |||
| 4751c735ec | |||
| bda3b1fa3a | |||
| 4ec10d798b | |||
| 3dd21e4dcd | |||
| 682d76835e | |||
| 42aa367f16 | |||
| ec8a1bcc82 | |||
| 2d9541c4c8 | |||
| e747ba6c26 | |||
| 4431a34987 | |||
| 14d7de0cf3 | |||
| cd28fdc192 | |||
| 25fe9c7084 | |||
| 94fc2ba9c9 | |||
| 2f87b8e430 | |||
| eff61c7a97 | |||
| 7c96227cd3 | |||
| dcfae6332e | |||
| 69437bb324 | |||
| 7551245f57 | |||
| 47bc551485 | |||
| 87478187af | |||
| 7042223f2e | |||
| 93698f0d61 | |||
| f7aa837696 | |||
| e1d1d18288 | |||
| 20a6f82753 | |||
| aec6cac8ca | |||
| ffca6a762d | |||
| 2d2ab4fec4 | |||
| a434baed91 | |||
| f14a3dfb8a | |||
| b19a3af4db | |||
| 89428a9d10 | |||
| b937d6310d | |||
| ad37bc9639 | |||
| 56df1abdd8 | |||
| 0ea5e57298 | |||
| 3838eb1f05 | |||
| 9ba7196881 | |||
| 1e71303ffa | |||
| 74117a1e1e | |||
| 38ad523f91 | |||
| a71e2fb64e | |||
| 1b20ec8747 | |||
| d30e53ee2c | |||
| aa57ad6082 | |||
| 097893bfbf | |||
| 16019c9827 | |||
| f391100586 | |||
| c4a1e1bb0c | |||
| 7e3b5bed50 | |||
| c9c477ff9d | |||
| 4eb7db80a6 | |||
| 9d6626f70c | |||
| 5c07863ad5 | |||
| 3060375251 | |||
| 3c63e44d32 | |||
| 02d943bfb0 | |||
| 4c8fef264e | |||
| 082cf8ace8 | |||
| 1fd193840d | |||
| b1f8e910eb |
@@ -0,0 +1,37 @@
|
|||||||
|
Adam <adam@anope.org> <adam-@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Adam <adam@anope.org> <adam@adam-laptop.(none)>
|
||||||
|
Adam <adam@anope.org> <Adam@anope.org>
|
||||||
|
Adam <adam@anope.org> <Adam@drink-coca-cola.info>
|
||||||
|
Adam <adam@anope.org> <Adam@sigterm.info>
|
||||||
|
Adam Kramer <ribosome@anope.org> <ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Alvaro Toledo <atoledo@keldon.org> <atoledo atoledo@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Björn Stiddien <keeper@anope.org> <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Charles Kingsley <chaz@anope.org>
|
||||||
|
Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Fabio Scotoni <cculex@gmail.com>
|
||||||
|
Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Jan Milants <viper@anope.org>
|
||||||
|
Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Jens Voss <dukepyrolator@anope.org> <anope@s15355730.onlinehome-server.info>
|
||||||
|
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
|
||||||
|
Jens Voss <dukepyrolator@anope.org> Jens Voß <jens@pyrobook.(none)>
|
||||||
|
Lee Holmes <lethality@anope.org>
|
||||||
|
Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
|
||||||
|
Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Robby <robby@chat.be>
|
||||||
|
Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Sebastian V. <hal9000@denorastats.org>
|
||||||
|
Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
(svnadmin) <svn@localhost> <svn svn@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
|
Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
language: cpp
|
||||||
|
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
- cmake -DINSTDIR:STRING=~/services -DDEFUMASK:STRING=077 -DCMAKE_BUILD_TYPE:STRING=DEBUG -DUSE_RUN_CC_PL:BOOLEAN=ON ..
|
||||||
|
|
||||||
|
script:
|
||||||
|
- make
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
irc:
|
||||||
|
- "irc.anope.org#anope-devel"
|
||||||
+47
-32
@@ -2,6 +2,12 @@
|
|||||||
cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
|
cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
|
||||||
if(COMMAND cmake_policy)
|
if(COMMAND cmake_policy)
|
||||||
cmake_policy(SET CMP0003 NEW)
|
cmake_policy(SET CMP0003 NEW)
|
||||||
|
if(POLICY CMP0026)
|
||||||
|
cmake_policy(SET CMP0026 OLD)
|
||||||
|
endif(POLICY CMP0026)
|
||||||
|
if(POLICY CMP0007)
|
||||||
|
cmake_policy(SET CMP0007 OLD)
|
||||||
|
endif(POLICY CMP0007)
|
||||||
endif(COMMAND cmake_policy)
|
endif(COMMAND cmake_policy)
|
||||||
|
|
||||||
# If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows)
|
# If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows)
|
||||||
@@ -80,7 +86,7 @@ set(DEFAULT_LIBRARY_DIRS)
|
|||||||
set(DEFAULT_INCLUDE_DIRS)
|
set(DEFAULT_INCLUDE_DIRS)
|
||||||
|
|
||||||
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
|
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||||
# First look for the compiler's default library directories
|
# First look for the compiler's default library directories
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
# Find only the part after "libraries: "
|
# Find only the part after "libraries: "
|
||||||
@@ -132,6 +138,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
string(LENGTH ${LINE} LINE_LENGTH)
|
string(LENGTH ${LINE} LINE_LENGTH)
|
||||||
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
|
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
|
||||||
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
|
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
|
||||||
|
# For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
|
||||||
|
string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${INCLUDE})
|
||||||
# Convert the path to an absolute one, just in case it wasn't
|
# Convert the path to an absolute one, just in case it wasn't
|
||||||
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
|
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
|
||||||
# Add that directory to the list of default include directories
|
# Add that directory to the list of default include directories
|
||||||
@@ -144,7 +152,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
if(DEFAULT_INCLUDE_DIRS)
|
if(DEFAULT_INCLUDE_DIRS)
|
||||||
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
|
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
|
||||||
endif(DEFAULT_INCLUDE_DIRS)
|
endif(DEFAULT_INCLUDE_DIRS)
|
||||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
endif(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||||
|
|
||||||
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
|
# If 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(MSVC)
|
||||||
@@ -160,12 +168,12 @@ if(MSVC)
|
|||||||
if(WSDK2008_PATH STREQUAL "/registry")
|
if(WSDK2008_PATH STREQUAL "/registry")
|
||||||
# If not found, look for the 2003 SDK under HKCU
|
# 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)
|
get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
|
||||||
if(WSDK2003_PATH STREQUAL "/regsitry")
|
if(WSDK2003_PATH STREQUAL "/registry")
|
||||||
# The SDK was never found, set the path to nothing
|
# The SDK was never found, set the path to nothing
|
||||||
set(WSDK_PATH "")
|
set(WSDK_PATH "")
|
||||||
else(WSDK2003_PATH STREQUAL "/regsitry")
|
else(WSDK2003_PATH STREQUAL "/registry")
|
||||||
set(WSDK_PATH "${WSDK2003_PATH}")
|
set(WSDK_PATH "${WSDK2003_PATH}")
|
||||||
endif(WSDK2003_PATH STREQUAL "/regsitry")
|
endif(WSDK2003_PATH STREQUAL "/registry")
|
||||||
else(WSDK2008_PATH STREQUAL "/registry")
|
else(WSDK2008_PATH STREQUAL "/registry")
|
||||||
set(WSDK_PATH "${WSDK2008_PATH}")
|
set(WSDK_PATH "${WSDK2008_PATH}")
|
||||||
endif(WSDK2008_PATH STREQUAL "/registry")
|
endif(WSDK2008_PATH STREQUAL "/registry")
|
||||||
@@ -207,12 +215,16 @@ else(CMAKE244_OR_BETTER)
|
|||||||
include(TestCXXAcceptsFlag)
|
include(TestCXXAcceptsFlag)
|
||||||
endif(CMAKE244_OR_BETTER)
|
endif(CMAKE244_OR_BETTER)
|
||||||
|
|
||||||
# If extra directories were specified, tell cmake about them.
|
# If extra include directories were specified, tell cmake about them.
|
||||||
if(EXTRA_INCLUDE)
|
if(EXTRA_INCLUDE)
|
||||||
include_directories(${EXTRA_INCLUDE})
|
include_directories(${EXTRA_INCLUDE})
|
||||||
link_directories(${EXTRA_INCLUDE})
|
|
||||||
endif(EXTRA_INCLUDE)
|
endif(EXTRA_INCLUDE)
|
||||||
|
|
||||||
|
# If extra library directories were specified, tell cmake about them.
|
||||||
|
if(EXTRA_LIBS)
|
||||||
|
link_directories(${EXTRA_LIBS})
|
||||||
|
endif(EXTRA_LIBS)
|
||||||
|
|
||||||
# Find gettext
|
# Find gettext
|
||||||
find_package(Gettext)
|
find_package(Gettext)
|
||||||
|
|
||||||
@@ -308,7 +320,9 @@ if(NOT MSVC)
|
|||||||
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
|
# 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)
|
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
|
||||||
if(HAVE_PTHREAD)
|
if(HAVE_PTHREAD)
|
||||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
if(NOT APPLE)
|
||||||
|
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||||
|
endif(NOT APPLE)
|
||||||
else(HAVE_PTHREAD)
|
else(HAVE_PTHREAD)
|
||||||
message(FATAL_ERROR "The pthread library is required to build Anope")
|
message(FATAL_ERROR "The pthread library is required to build Anope")
|
||||||
endif(HAVE_PTHREAD)
|
endif(HAVE_PTHREAD)
|
||||||
@@ -335,7 +349,6 @@ check_include_file(stdint.h HAVE_STDINT_H)
|
|||||||
check_include_file(strings.h HAVE_STRINGS_H)
|
check_include_file(strings.h HAVE_STRINGS_H)
|
||||||
|
|
||||||
# Check for the existance of the following functions
|
# Check for the existance of the following functions
|
||||||
check_function_exists(setgrent HAVE_SETGRENT)
|
|
||||||
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
||||||
check_function_exists(stricmp HAVE_STRICMP)
|
check_function_exists(stricmp HAVE_STRICMP)
|
||||||
check_function_exists(umask HAVE_UMASK)
|
check_function_exists(umask HAVE_UMASK)
|
||||||
@@ -343,13 +356,6 @@ check_function_exists(epoll_wait HAVE_EPOLL)
|
|||||||
check_function_exists(poll HAVE_POLL)
|
check_function_exists(poll HAVE_POLL)
|
||||||
check_function_exists(kqueue HAVE_KQUEUE)
|
check_function_exists(kqueue HAVE_KQUEUE)
|
||||||
|
|
||||||
# Check if eventfd works
|
|
||||||
try_run(EVENTFD_TEST_RUN_RESULT EVENTFD_TEST_COMPILE_RESULT ${CMAKE_CURRENT_BINARY_DIR} ${Anope_SOURCE_DIR}/cmake/eventfd_test.cpp)
|
|
||||||
set(HAVE_EVENTFD FALSE)
|
|
||||||
if (EVENTFD_TEST_COMPILE_RESULT AND EVENTFD_TEST_RUN_RESULT EQUAL 1)
|
|
||||||
set(HAVE_EVENTFD TRUE)
|
|
||||||
endif(EVENTFD_TEST_COMPILE_RESULT AND EVENTFD_TEST_RUN_RESULT EQUAL 1)
|
|
||||||
|
|
||||||
# Strip the leading and trailing spaces from the compile flags
|
# Strip the leading and trailing spaces from the compile flags
|
||||||
if(CXXFLAGS)
|
if(CXXFLAGS)
|
||||||
strip_string(${CXXFLAGS} CXXFLAGS)
|
strip_string(${CXXFLAGS} CXXFLAGS)
|
||||||
@@ -408,16 +414,14 @@ endif(NOT LOGS_DIR)
|
|||||||
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
|
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
|
||||||
# Iterate through the strings found
|
# Iterate through the strings found
|
||||||
foreach(VERSION_STR ${VERSIONS})
|
foreach(VERSION_STR ${VERSIONS})
|
||||||
# Get the length of the string
|
string(REGEX REPLACE "^VERSION_([A-Z]+)=\"?([^\"]*)\"?$" "\\1;\\2" VERSION_OUT ${VERSION_STR})
|
||||||
string(LENGTH ${VERSION_STR} VERSION_LEN)
|
# Depends on CMP0007 OLD
|
||||||
# Subtract 16 from the string's length (8 for VERSION_, 5 more for the type, 2 for the space and leading quote, 1 for the trailing quote)
|
list(LENGTH VERSION_OUT VERSION_LEN)
|
||||||
math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - 16")
|
list(GET VERSION_OUT 0 VERSION_TYPE)
|
||||||
# Extract the type from the string
|
if(${VERSION_LEN} GREATER 1)
|
||||||
string(SUBSTRING ${VERSION_STR} 8 5 VERSION_TYPE)
|
list(GET VERSION_OUT 1 VERSION_DATA)
|
||||||
# Extract the actual value from the string
|
set(VERSION_${VERSION_TYPE} ${VERSION_DATA})
|
||||||
string(SUBSTRING ${VERSION_STR} 15 ${VERSION_NUM_LEN} VERSION)
|
endif(${VERSION_LEN} GREATER 1)
|
||||||
# Set the version type to the value extract from above
|
|
||||||
set(VERSION_${VERSION_TYPE} ${VERSION})
|
|
||||||
endforeach(VERSION_STR ${VERSIONS})
|
endforeach(VERSION_STR ${VERSIONS})
|
||||||
|
|
||||||
# Default build version to 0
|
# Default build version to 0
|
||||||
@@ -481,14 +485,15 @@ get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
|
|||||||
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
|
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
|
||||||
|
|
||||||
# At install time, create the following additional directories
|
# At install time, create the following additional directories
|
||||||
install(CODE "file(MAKE_DIRECTORY \"${DB_DIR}/backups\")")
|
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
|
||||||
install(CODE "file(MAKE_DIRECTORY \"${LOGS_DIR}\")")
|
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
|
||||||
install(CODE "file(MAKE_DIRECTORY \"${LIB_DIR}/modules/runtime\")")
|
if(WIN32)
|
||||||
|
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
|
||||||
|
endif(WIN32)
|
||||||
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
|
# 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)
|
if(NOT WIN32 AND RUNGROUP)
|
||||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${DB_DIR}/backups\")")
|
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
|
||||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LOGS_DIR}\")")
|
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
|
||||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LIB_DIR}/modules/runtime\")")
|
|
||||||
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
|
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
|
||||||
endif(NOT WIN32 AND RUNGROUP)
|
endif(NOT WIN32 AND RUNGROUP)
|
||||||
# On Windows platforms, install extra files
|
# On Windows platforms, install extra files
|
||||||
@@ -496,8 +501,14 @@ if(WIN32)
|
|||||||
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
|
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
|
||||||
DESTINATION ${BIN_DIR}
|
DESTINATION ${BIN_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Package any DLLs in src/win/
|
||||||
|
file(GLOB EXTRA_DLLS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${Anope_SOURCE_DIR}/src/win32/*.dll")
|
||||||
|
install(FILES ${EXTRA_DLLS} DESTINATION ${BIN_DIR})
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
|
install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
|
||||||
|
|
||||||
# Only process the CPack section if we have CPack
|
# Only process the CPack section if we have CPack
|
||||||
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||||
# Various options for CPack
|
# Various options for CPack
|
||||||
@@ -512,6 +523,10 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
|||||||
#set(CPACK_RESOURCE_FILE_README "${Anope_SOURCE_DIR}/docs/README")
|
#set(CPACK_RESOURCE_FILE_README "${Anope_SOURCE_DIR}/docs/README")
|
||||||
# The following is primarily for NSIS
|
# The following is primarily for NSIS
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
# By default, do not warn when built on machines using only VS Express:
|
||||||
|
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||||
|
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
||||||
|
ENDIF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||||
# Also for Windows, include installing the MSVCRT library
|
# Also for Windows, include installing the MSVCRT library
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
set(CPACK_GENERATOR "NSIS")
|
set(CPACK_GENERATOR "NSIS")
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Configuration script for Services.
|
# Configuration script for Services.
|
||||||
#
|
#
|
||||||
# Anope (c) 2003-2011 Anope team
|
# Anope (c) 2003-2014 Anope Team
|
||||||
# Contact us at team@anope.org
|
# Contact us at team@anope.org
|
||||||
#
|
#
|
||||||
# This program is free but copyrighted software; see the file COPYING for
|
# This program is free but copyrighted software; see the file COPYING for
|
||||||
@@ -40,7 +40,8 @@ Run_Build_System () {
|
|||||||
WITH_INST=""
|
WITH_INST=""
|
||||||
WITH_RUN=""
|
WITH_RUN=""
|
||||||
WITH_PERM=""
|
WITH_PERM=""
|
||||||
RUN_CC_PL=""
|
EXTRA_INCLUDE=""
|
||||||
|
EXTRA_LIBS=""
|
||||||
GEN_TYPE=""
|
GEN_TYPE=""
|
||||||
|
|
||||||
if [ "$INSTDIR" != "" ] ; then
|
if [ "$INSTDIR" != "" ] ; then
|
||||||
@@ -73,6 +74,14 @@ Run_Build_System () {
|
|||||||
PCH="-DUSE_PCH:BOOLEAN=OFF"
|
PCH="-DUSE_PCH:BOOLEAN=OFF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
|
||||||
|
EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$EXTRA_LIB_DIRS" != "" ] ; then
|
||||||
|
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
||||||
|
fi
|
||||||
|
|
||||||
case `uname -s` in
|
case `uname -s` in
|
||||||
MINGW*)
|
MINGW*)
|
||||||
GEN_TYPE="-G\"MSYS Makefiles\""
|
GEN_TYPE="-G\"MSYS Makefiles\""
|
||||||
@@ -88,9 +97,9 @@ Run_Build_System () {
|
|||||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
REAL_SOURCE_DIR="$SOURCE_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
||||||
|
|
||||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
if [ "$SOURCE_DIR" = "." ] ; then
|
if [ "$SOURCE_DIR" = "." ] ; then
|
||||||
@@ -121,9 +130,11 @@ export ECHO2 ECHO2SUF
|
|||||||
INSTDIR=$HOME/services
|
INSTDIR=$HOME/services
|
||||||
RUNGROUP=
|
RUNGROUP=
|
||||||
UMASK=
|
UMASK=
|
||||||
DEBUG="yes"
|
DEBUG="no"
|
||||||
USE_RUN_CC_PL="no"
|
USE_RUN_CC_PL="no"
|
||||||
USE_PCH="no"
|
USE_PCH="no"
|
||||||
|
EXTRA_INCLUDE_DIRS=
|
||||||
|
EXTRA_LIB_DIRS=
|
||||||
EXTRA_CONFIG_ARGS=
|
EXTRA_CONFIG_ARGS=
|
||||||
CAN_QUICK="no"
|
CAN_QUICK="no"
|
||||||
SOURCE_DIR=`dirname $0`
|
SOURCE_DIR=`dirname $0`
|
||||||
@@ -165,42 +176,9 @@ done
|
|||||||
which cmake > /dev/null
|
which cmake > /dev/null
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
clear
|
clear
|
||||||
if exists "cmake-bin" ; then :
|
echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org or through your system's package manager."
|
||||||
else
|
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
|
||||||
echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org"
|
exit 0
|
||||||
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
|
|
||||||
|
|
||||||
if [ `uname` = "Linux" ] ; then
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "Config can attempt to install CMake for you now, which"
|
|
||||||
echo "will take approximately 50 MB of disk space."
|
|
||||||
echo "Would you like to install CMake now?"
|
|
||||||
echo2 "[y] "
|
|
||||||
read YN
|
|
||||||
if [ "$YN" = "n" ] ; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Downloading CMake... this may take a minute or two."
|
|
||||||
wget -q http://anope.org/cmake/linux-i386.php -O cmake-bin.tar.gz
|
|
||||||
if [ $? -ne 0 ] ; then
|
|
||||||
rm -f cmake-bin.tar.gz
|
|
||||||
echo "Unable to download CMake"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
mkdir -p cmake-bin
|
|
||||||
tar zxf cmake-bin.tar.gz -C cmake-bin
|
|
||||||
rm -f cmake-bin.tar.gz
|
|
||||||
echo "Done!"
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
CMAKE_BIN=`find cmake-bin -name cmake`
|
|
||||||
CMAKE_BIN="`pwd`/`dirname $CMAKE_BIN`"
|
|
||||||
PATH="$PATH:$CMAKE_BIN"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
@@ -240,7 +218,7 @@ export ok INPUT
|
|||||||
####
|
####
|
||||||
|
|
||||||
ok=0
|
ok=0
|
||||||
echo "In what directory do you want the binaries to be installed?"
|
echo "In what directory should Anope be installed?"
|
||||||
while [ $ok -eq 0 ] ; do
|
while [ $ok -eq 0 ] ; do
|
||||||
echo2 "[$INSTDIR] "
|
echo2 "[$INSTDIR] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
@@ -386,14 +364,52 @@ echo ""
|
|||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
echo "Are there any extra arguments you wish to pass to cmake?"
|
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 "You may only need to do this if CMake is unable to locate"
|
||||||
echo "missing dependencies without hints."
|
echo "missing dependencies without hints."
|
||||||
echo "You can do this by: -DEXTRA_INCLUDE:STRING=/path/to/files;/path/to/more/files"
|
echo "Separate directories with semicolons."
|
||||||
|
echo "If you need no extra include directories, enter NONE in all caps."
|
||||||
|
echo2 "[$EXTRA_INCLUDE_DIRS] "
|
||||||
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
|
if [ "$INPUT" ] ; then
|
||||||
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
|
EXTRA_INCLUDE_DIRS=""
|
||||||
|
else
|
||||||
|
EXTRA_INCLUDE_DIRS=$INPUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
echo "Are there any extra library directories you wish to use?"
|
||||||
|
echo "You may only need to do this if CMake is unable to locate"
|
||||||
|
echo "missing dependencies without hints."
|
||||||
|
echo "Separate directories with semicolons."
|
||||||
|
echo "If you need no extra library directories, enter NONE in all caps."
|
||||||
|
echo2 "[$EXTRA_LIB_DIRS] "
|
||||||
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
|
if [ "$INPUT" ] ; then
|
||||||
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
|
EXTRA_LIB_DIRS=""
|
||||||
|
else
|
||||||
|
EXTRA_LIB_DIRS=$INPUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
echo "Are there any extra arguments you wish to pass to CMake?"
|
||||||
|
echo "If you need no extra arugments to CMake, enter NONE in all caps."
|
||||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
echo2 "[$EXTRA_CONFIG_ARGS] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
EXTRA_CONFIG_ARGS=$INPUT
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
|
EXTRA_CONFIG_ARGS=""
|
||||||
|
else
|
||||||
|
EXTRA_CONFIG_ARGS=$INPUT
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
@@ -412,6 +428,8 @@ UMASK=$UMASK
|
|||||||
DEBUG="$DEBUG"
|
DEBUG="$DEBUG"
|
||||||
USE_RUN_CC_PL="$USE_RUN_CC_PL"
|
USE_RUN_CC_PL="$USE_RUN_CC_PL"
|
||||||
USE_PCH="$USE_PCH"
|
USE_PCH="$USE_PCH"
|
||||||
|
EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
|
||||||
|
EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
|
||||||
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
|
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
|
||||||
EOT
|
EOT
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|||||||
BIN
Binary file not shown.
+53
-47
@@ -208,7 +208,7 @@ macro(read_from_file FILE REGEX STRINGS)
|
|||||||
endif(REGEX STREQUAL "")
|
endif(REGEX STREQUAL "")
|
||||||
else(CMAKE26_OR_BETTER)
|
else(CMAKE26_OR_BETTER)
|
||||||
# For CMake 2.4.x, we need to do this manually, firstly we read the file in
|
# For CMake 2.4.x, we need to do this manually, firstly we read the file in
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
|
execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/cmake/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
|
||||||
# Next we replace all newlines with semicolons
|
# Next we replace all newlines with semicolons
|
||||||
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
||||||
if(REGEX STREQUAL "")
|
if(REGEX STREQUAL "")
|
||||||
@@ -359,24 +359,22 @@ macro(find_includes SRC INCLUDES)
|
|||||||
endmacro(find_includes)
|
endmacro(find_includes)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# calculate_depends(<source filename> <output variable set to TRUE on fail> [<optional output variable for includes>])
|
# calculate_depends(<source filename> [<optional output variable for includes>])
|
||||||
#
|
#
|
||||||
# This macro is used in most of the src (sub)directories to calculate the
|
# This macro is used in most of the src (sub)directories to calculate the
|
||||||
# header file dependencies for the given source file.
|
# header file dependencies for the given source file.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
macro(calculate_depends SRC SKIP)
|
macro(calculate_depends SRC)
|
||||||
# Temporarily set that we didn't get a 3nd argument before we actually check if we did get one or not
|
# 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)
|
set(CHECK_ANGLE_INCLUDES FALSE)
|
||||||
# Check for a third argument
|
# Check for a third argument
|
||||||
if(${ARGC} GREATER 2)
|
if(${ARGC} GREATER 1)
|
||||||
set(CHECK_ANGLE_INCLUDES TRUE)
|
set(CHECK_ANGLE_INCLUDES TRUE)
|
||||||
endif(${ARGC} GREATER 2)
|
endif(${ARGC} GREATER 1)
|
||||||
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on
|
# Find 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)
|
find_includes(${SRC} INCLUDES)
|
||||||
# Reset the list of headers to empty
|
# Reset the list of headers to empty
|
||||||
set(HEADERS)
|
set(HEADERS)
|
||||||
# Reset skip
|
|
||||||
set(${SKIP} FALSE)
|
|
||||||
# Iterate through the strings containing #include (if any)
|
# Iterate through the strings containing #include (if any)
|
||||||
foreach(INCLUDE ${INCLUDES})
|
foreach(INCLUDE ${INCLUDES})
|
||||||
# Extract the filename from the #include line
|
# Extract the filename from the #include line
|
||||||
@@ -392,16 +390,26 @@ macro(calculate_depends SRC SKIP)
|
|||||||
endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
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 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)
|
if(FOUND_${FILENAME}_INCLUDE)
|
||||||
find_in_list(DEFAULT_INCLUDE_DIRS "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_DEFAULTS)
|
# This used to be find_in_list, but it was changed to this loop to do a find on each default include directory, this fixes Mac OS X trying to get it's framework directories in here
|
||||||
|
set(FOUND_IN_DEFAULTS -1)
|
||||||
|
foreach(DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIRS})
|
||||||
|
string(REGEX REPLACE "\\+" "\\\\+" DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIR})
|
||||||
|
string(REGEX MATCH ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT ${FOUND_${FILENAME}_INCLUDE})
|
||||||
|
if(FOUND_DEFAULT)
|
||||||
|
set(FOUND_IN_DEFAULTS 0)
|
||||||
|
endif(FOUND_DEFAULT)
|
||||||
|
endforeach(DEFAULT_INCLUDE_DIR)
|
||||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||||
find_in_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||||
if(FOUND_IN_INCLUDES EQUAL -1)
|
if(FOUND_IN_INCLUDES EQUAL -1)
|
||||||
append_to_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}")
|
append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}")
|
||||||
endif(FOUND_IN_INCLUDES EQUAL -1)
|
endif(FOUND_IN_INCLUDES EQUAL -1)
|
||||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||||
else(FOUND_${FILENAME}_INCLUDE)
|
else(FOUND_${FILENAME}_INCLUDE)
|
||||||
set(${SKIP} TRUE)
|
# XXX
|
||||||
message("${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.")
|
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(FOUND_${FILENAME}_INCLUDE)
|
||||||
endif(CHECK_ANGLE_INCLUDES)
|
endif(CHECK_ANGLE_INCLUDES)
|
||||||
endif(QUOTE_TYPE STREQUAL "angle brackets")
|
endif(QUOTE_TYPE STREQUAL "angle brackets")
|
||||||
@@ -409,12 +417,12 @@ macro(calculate_depends SRC SKIP)
|
|||||||
endmacro(calculate_depends)
|
endmacro(calculate_depends)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# calculate_libraries(<source filename> <output variable set to TRUE on fail> <output variable for linker flags> <output variable for extra depends>)
|
# calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
|
||||||
#
|
#
|
||||||
# This macro is used in most of the module (sub)directories to calculate the
|
# This macro is used in most of the module (sub)directories to calculate the
|
||||||
# library dependencies for the given source file.
|
# library dependencies for the given source file.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
|
||||||
# Set up a temporary LDFLAGS for this file
|
# Set up a temporary LDFLAGS for this file
|
||||||
set(THIS_LDFLAGS "${LDFLAGS}")
|
set(THIS_LDFLAGS "${LDFLAGS}")
|
||||||
# Reset extra dependencies
|
# Reset extra dependencies
|
||||||
@@ -423,23 +431,25 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
|||||||
set(LIBRARY_PATHS)
|
set(LIBRARY_PATHS)
|
||||||
# Reset libraries
|
# Reset libraries
|
||||||
set(LIBRARIES)
|
set(LIBRARIES)
|
||||||
# Default to not skipping this file
|
|
||||||
set(${SKIP} FALSE)
|
|
||||||
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
|
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
|
||||||
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
|
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)
|
||||||
# Iterate through those lines
|
# Iterate through those lines
|
||||||
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
|
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
|
||||||
# Strip off the /* RequiredLibraries: and */ from the line
|
# Strip off the /* RequiredLibraries: and */ from the line
|
||||||
string(REGEX REPLACE "/\\*[ \t]*RequiredLibraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
string(REGEX REPLACE "/\\*[ \t]*Required.*Libraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
||||||
# Replace all commas with semicolons
|
# Replace all commas with semicolons
|
||||||
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
||||||
# Iterate through the libraries given
|
# Iterate through the libraries given
|
||||||
foreach(LIBRARY ${REQUIRED_LIBRARY})
|
foreach(LIBRARY ${REQUIRED_LIBRARY})
|
||||||
# Locate the library to see if it exists
|
# Locate the library to see if it exists
|
||||||
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE})
|
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||||
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE})
|
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||||
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||||
# If the library was found, we will add it to the linker flags
|
# If the library was found, we will add it to the linker flags
|
||||||
if(FOUND_${LIBRARY}_LIBRARY)
|
if(FOUND_${LIBRARY}_LIBRARY)
|
||||||
@@ -454,36 +464,32 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
|||||||
append_to_list(LIBRARIES "${LIBRARY}")
|
append_to_list(LIBRARIES "${LIBRARY}")
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
else(FOUND_${LIBRARY}_LIBRARY)
|
else(FOUND_${LIBRARY}_LIBRARY)
|
||||||
# Skip this file
|
|
||||||
set(${SKIP} TRUE)
|
|
||||||
# In the case of the library not being found, we fatally error so CMake stops trying to generate
|
# In the case of the library not being found, we fatally error so CMake stops trying to generate
|
||||||
message("${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
|
message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
|
||||||
endif(FOUND_${LIBRARY}_LIBRARY)
|
endif(FOUND_${LIBRARY}_LIBRARY)
|
||||||
endforeach(LIBRARY)
|
endforeach(LIBRARY)
|
||||||
endforeach(REQUIRED_LIBRARY)
|
endforeach(REQUIRED_LIBRARY)
|
||||||
if(NOT ${SKIP})
|
# Remove duplicates from the library paths
|
||||||
# Remove duplicates from the library paths
|
if(LIBRARY_PATHS)
|
||||||
if(LIBRARY_PATHS)
|
remove_list_duplicates(LIBRARY_PATHS)
|
||||||
remove_list_duplicates(LIBRARY_PATHS)
|
endif(LIBRARY_PATHS)
|
||||||
endif(LIBRARY_PATHS)
|
# Remove diplicates from the libraries
|
||||||
# Remove diplicates from the libraries
|
if(LIBRARIES)
|
||||||
if(LIBRARIES)
|
remove_list_duplicates(LIBRARIES)
|
||||||
remove_list_duplicates(LIBRARIES)
|
endif(LIBRARIES)
|
||||||
endif(LIBRARIES)
|
# Iterate through library paths and add them to the linker flags
|
||||||
# Iterate through library paths and add them to the linker flags
|
foreach(LIBRARY_PATH ${LIBRARY_PATHS})
|
||||||
foreach(LIBRARY_PATH ${LIBRARY_PATHS})
|
find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS)
|
||||||
find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS)
|
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
|
||||||
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
|
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
endforeach(LIBRARY_PATH)
|
||||||
endforeach(LIBRARY_PATH)
|
# Iterate through libraries and add them to the linker flags
|
||||||
# Iterate through libraries and add them to the linker flags
|
foreach(LIBRARY ${LIBRARIES})
|
||||||
foreach(LIBRARY ${LIBRARIES})
|
append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}")
|
||||||
append_to_list(EXTRA_DEPENDENCIES "${LIBRARY}")
|
endforeach(LIBRARY)
|
||||||
endforeach(LIBRARY)
|
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
|
||||||
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
|
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
|
||||||
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
|
|
||||||
endif(NOT ${SKIP})
|
|
||||||
endmacro(calculate_libraries)
|
endmacro(calculate_libraries)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
+8
-15
@@ -1,33 +1,26 @@
|
|||||||
# Find the header files, libs, and executables for gettext
|
# Find the header files, libs, and executables for gettext
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE})
|
find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE})
|
||||||
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_INCLUDE})
|
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
|
||||||
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
|
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
|
||||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||||
set(GETTEXT_FOUND TRUE)
|
set(GETTEXT_FOUND TRUE)
|
||||||
|
if(GETTEXT_LIBRARY)
|
||||||
|
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||||
|
endif(GETTEXT_LIBRARY)
|
||||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||||
else(NOT WIN32)
|
else(NOT WIN32)
|
||||||
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
|
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
|
||||||
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||||
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
|
||||||
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
|
||||||
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
|
||||||
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
|
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
|
||||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
|
if(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
|
||||||
set(GETTEXT_FOUND TRUE)
|
set(GETTEXT_FOUND TRUE)
|
||||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
|
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||||
|
endif(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
|
||||||
endif(NOT WIN32)
|
endif(NOT WIN32)
|
||||||
|
|
||||||
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use
|
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use
|
||||||
if(GETTEXT_FOUND)
|
if(GETTEXT_FOUND)
|
||||||
include_directories("${GETTEXT_INCLUDE}")
|
include_directories("${GETTEXT_INCLUDE}")
|
||||||
set(GETTEXT_MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT})
|
set(GETTEXT_MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT})
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
set(GETTEXT_LIBRARIES libiconv libintl libmingwex libgcc)
|
|
||||||
else(WIN32)
|
|
||||||
if(GETTEXT_LIBRARY)
|
|
||||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
|
||||||
endif(GETTEXT_LIBRARY)
|
|
||||||
endif(WIN32)
|
|
||||||
endif(GETTEXT_FOUND)
|
endif(GETTEXT_FOUND)
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ FunctionEnd
|
|||||||
|
|
||||||
!insertmacro MUI_PAGE_INSTFILES
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
|
||||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt"
|
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.txt"
|
||||||
!insertmacro MUI_PAGE_FINISH
|
!insertmacro MUI_PAGE_FINISH
|
||||||
|
|
||||||
!insertmacro MUI_UNPAGE_CONFIRM
|
!insertmacro MUI_UNPAGE_CONFIRM
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#include <sys/eventfd.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
int i = eventfd(0, EFD_NONBLOCK);
|
|
||||||
return i >= 0 ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# Only install example.chk and example.conf from this directory
|
# Only install example.chk and example.conf from this directory
|
||||||
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
|
# 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)
|
set(DATA example.chk botserv.example.conf example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
||||||
install(FILES ${DATA}
|
install(FILES ${DATA}
|
||||||
DESTINATION ${CONF_DIR}
|
DESTINATION ${CONF_DIR}
|
||||||
)
|
)
|
||||||
|
|||||||
+187
-93
@@ -3,13 +3,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First, create the service.
|
* First, create the service. If you do not want to have a 'BotServ', but do want the ability to have
|
||||||
* Note that an easy way to rename this service is to define{} the client name to something else.
|
* ChanServ assigned to channels for the use of fantasy commands, you may delete the below 'service' block.
|
||||||
|
*
|
||||||
|
* Note that deleting a 'service' block for a pseudoclient that is already online will not remove the
|
||||||
|
* client, the client becomes no different from a normal service bot, so you will have to use botserv/bot
|
||||||
|
* to manually delete the client.
|
||||||
|
*
|
||||||
|
* You may then want to map some of the below commands to other services, like placing botserv/bot on
|
||||||
|
* OperServ so you can delete the below client, and mapping assign and unassign to ChanServ so users are
|
||||||
|
* able to control whether or not ChanServ is in the channel. You may also want to map botserv/set/nobot
|
||||||
|
* to OperServ so you can restrict who can assign the other core service clients.
|
||||||
*/
|
*/
|
||||||
service
|
service
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The name of the BotServ client
|
* The name of the BotServ client.
|
||||||
|
* If you change this value, you probably want to change the client directive in the configuration for the botserv module too.
|
||||||
*/
|
*/
|
||||||
nick = "BotServ"
|
nick = "BotServ"
|
||||||
|
|
||||||
@@ -35,8 +45,8 @@ service
|
|||||||
* These modes are very IRCd specific. If left commented, sane defaults
|
* These modes are very IRCd specific. If left commented, sane defaults
|
||||||
* are used based on what protocol module you have loaded.
|
* are used based on what protocol module you have loaded.
|
||||||
*
|
*
|
||||||
* Note that setting this option incorrectly could potentially BREAK some if
|
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||||
* not all usefulness of the client. We will not support you if this client is
|
* not all, usefulness of the client. We will not support you if this client is
|
||||||
* unable to do certain things if this option is enabled.
|
* unable to do certain things if this option is enabled.
|
||||||
*/
|
*/
|
||||||
#modes = "+o"
|
#modes = "+o"
|
||||||
@@ -46,7 +56,7 @@ service
|
|||||||
* of log channels this is not very useful, as the service will just idle in the
|
* of log channels this is not very useful, as the service will just idle in the
|
||||||
* specified channels, and will not accept any types of commands.
|
* specified channels, and will not accept any types of commands.
|
||||||
*
|
*
|
||||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||||
*/
|
*/
|
||||||
#channels = "@#services,#mychan"
|
#channels = "@#services,#mychan"
|
||||||
}
|
}
|
||||||
@@ -56,17 +66,16 @@ service
|
|||||||
*
|
*
|
||||||
* Provides essential functionality for BotServ.
|
* Provides essential functionality for BotServ.
|
||||||
*/
|
*/
|
||||||
module { name = "botserv" }
|
module
|
||||||
|
|
||||||
/*
|
|
||||||
* Configuration for BotServ provided by bs_main.
|
|
||||||
*/
|
|
||||||
botserv
|
|
||||||
{
|
{
|
||||||
|
name = "botserv"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The name of the client that should be BotServ.
|
* The name of the client that should be BotServ.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
name = "BotServ"
|
client = "BotServ"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The default bot options for newly registered channels. Note that changing these options
|
* The default bot options for newly registered channels. Note that changing these options
|
||||||
@@ -82,7 +91,7 @@ botserv
|
|||||||
*
|
*
|
||||||
* This directive is optional, if left blank, there will be no defaults.
|
* This directive is optional, if left blank, there will be no defaults.
|
||||||
*/
|
*/
|
||||||
defaults="greet fantasy"
|
defaults = "greet fantasy"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The minimum number of users there must be in a channel before the bot joins it. The best
|
* The minimum number of users there must be in a channel before the bot joins it. The best
|
||||||
@@ -91,19 +100,6 @@ botserv
|
|||||||
*/
|
*/
|
||||||
minusers = 1
|
minusers = 1
|
||||||
|
|
||||||
/*
|
|
||||||
* The maximum number of entries a single bad words list can have. Setting it too high can
|
|
||||||
* reduce performance slightly.
|
|
||||||
*/
|
|
||||||
badwordsmax = 32
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The amount of time that data for a user is valid in BotServ. If the data exceeds this time,
|
|
||||||
* it is reset or deleted depending on the case. Do not set it too high, otherwise your
|
|
||||||
* resources will be slightly affected.
|
|
||||||
*/
|
|
||||||
keepdata = 10m
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The bots are currently not affected by any modes or bans when they try to join a channel.
|
* The bots are currently not affected by any modes or bans when they try to join a channel.
|
||||||
* But some people may want to make it act like a real bot, that is, for example, remove all
|
* But some people may want to make it act like a real bot, that is, for example, remove all
|
||||||
@@ -116,26 +112,17 @@ botserv
|
|||||||
#smartjoin = yes
|
#smartjoin = yes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, the bots will use a kick reason that does not state the word when it is kicking.
|
* Modes to set on service bots when they join channels, comment this out for no modes
|
||||||
* This is especially useful if you have young people on your network.
|
|
||||||
*
|
*
|
||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
gentlebadwordreason = yes
|
botmodes = "ao"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, BotServ will use case sensitive checking for badwords.
|
* User modes to set on service bots. Read the comment about the service:modes directive
|
||||||
*
|
* on why this can be a bad idea to set.
|
||||||
* This directive is optional.
|
|
||||||
*/
|
*/
|
||||||
#casesensitive = yes
|
#botumodes = "i"
|
||||||
|
|
||||||
/*
|
|
||||||
* Defines the prefixs for fantasy commands in channels. One of these characters will have to be prepended
|
|
||||||
* to all fantasy commands. If you choose "!", for example, fantasy commands will be "!kick",
|
|
||||||
* "!op", etc. This directive is optional, if left out, the default fantasy character is "!".
|
|
||||||
*/
|
|
||||||
#fantasycharacter = "!."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -149,28 +136,33 @@ botserv
|
|||||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Give it a help command */
|
/* Give it a help command. */
|
||||||
command { service = "BotServ"; name = "HELP"; command = "generic/help"; }
|
command { service = "BotServ"; name = "HELP"; command = "generic/help"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_assign
|
* bs_assign
|
||||||
*
|
*
|
||||||
* Provides the commands botserv/assign and botserv/unassign.
|
* Provides the commands:
|
||||||
|
* botserv/assign - Used to assign BotServ bots to channels
|
||||||
|
* botserv/unassign - Used to unassign BotServ bots
|
||||||
|
* botserv/set/nobot - Used to prohibit channels from being assigned BotServ bots.
|
||||||
*
|
*
|
||||||
* Used for assigning and unassigning bots to channels.
|
* Used for assigning and unassigning bots to channels.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_assign" }
|
module { name = "bs_assign" }
|
||||||
command { service = "BotServ"; name = "ASSIGN"; command = "botserv/assign"; }
|
command { service = "BotServ"; name = "ASSIGN"; command = "botserv/assign"; }
|
||||||
command { service = "BotServ"; name = "UNASSIGN"; command = "botserv/unassign"; }
|
command { service = "BotServ"; name = "UNASSIGN"; command = "botserv/unassign"; }
|
||||||
|
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_autoassign
|
* bs_autoassign
|
||||||
*
|
*
|
||||||
* Allows service bots to be automatically assigned to channels upon registration.
|
* Allows service bots to be automatically assigned to channels upon registration.
|
||||||
*/
|
*/
|
||||||
#module { name = "bs_autoassign" }
|
#module
|
||||||
bs_autoassign
|
|
||||||
{
|
{
|
||||||
|
name = "bs_autoassign"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Automatically assign ChanServ to channels upon registration.
|
* Automatically assign ChanServ to channels upon registration.
|
||||||
*/
|
*/
|
||||||
@@ -184,7 +176,22 @@ bs_autoassign
|
|||||||
*
|
*
|
||||||
* Used for controlling the channel badword list.
|
* Used for controlling the channel badword list.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_badwords" }
|
module
|
||||||
|
{
|
||||||
|
name = "bs_badwords"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of entries a single bad words list can have.
|
||||||
|
*/
|
||||||
|
badwordsmax = 32
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, BotServ will use case sensitive checking for badwords.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
#casesensitive = yes
|
||||||
|
}
|
||||||
command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords"; }
|
command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -195,7 +202,7 @@ command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords";
|
|||||||
* Used for administrating BotServ bots.
|
* Used for administrating BotServ bots.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_bot" }
|
module { name = "bs_bot" }
|
||||||
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; }
|
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; permission = "botserv/bot"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_botlist
|
* bs_botlist
|
||||||
@@ -231,80 +238,167 @@ command { service = "BotServ"; name = "INFO"; command = "botserv/info"; }
|
|||||||
/*
|
/*
|
||||||
* bs_kick
|
* bs_kick
|
||||||
*
|
*
|
||||||
* Provides the command botserv/kick.
|
* Provides the commands:
|
||||||
|
* botserv/kick - Dummy help wrapper for the KICK command.
|
||||||
|
* botserv/kick/amsg - Configures BotServ's AMSG kicker.
|
||||||
|
* botserv/kick/badwords - Configures BotServ's badwords kicker.
|
||||||
|
* botserv/kick/bolds - Configures BotServ's bold text kiceker.
|
||||||
|
* botserv/kick/caps - Configures BotServ's capital letters kicker.
|
||||||
|
* botserv/kick/colors - Configures BotServ's color kicker.
|
||||||
|
* botserv/kick/flood - Configures BotServ's flood kicker.
|
||||||
|
* botserv/kick/italics - Configures BotServ's italics kicker.
|
||||||
|
* botserv/kick/repeat - Configures BotServ's repeat kicker.
|
||||||
|
* botserv/kick/reverses - Configures BotServ's reverse kicker.
|
||||||
|
* botserv/kick/underlines - Configures BotServ's reverse kicker.
|
||||||
|
* botserv/set/dontkickops - Used for preventing BotServ from kicking channel operators.
|
||||||
|
* botserv/set/dontkickvoices - Used for preventing BotServ from kicking voices.
|
||||||
*
|
*
|
||||||
* Used for configuring what bots should kick for.
|
* Used for configuring what bots should kick for.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_kick" }
|
module
|
||||||
|
{
|
||||||
|
name = "bs_kick"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The amount of time that data for a user is valid in BotServ. If the data exceeds this time,
|
||||||
|
* it is reset or deleted depending on the case. Do not set it too high, otherwise your
|
||||||
|
* resources will be slightly affected.
|
||||||
|
*/
|
||||||
|
keepdata = 10m
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, the bots will use a kick reason that does not state the word when it is kicking.
|
||||||
|
* This is especially useful if you have young people on your network.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
gentlebadwordreason = yes
|
||||||
|
}
|
||||||
command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; }
|
command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; }
|
||||||
|
command { service = "BotServ"; name = "KICK AMSG"; command = "botserv/kick/amsg"; }
|
||||||
|
command { service = "BotServ"; name = "KICK BADWORDS"; command = "botserv/kick/badwords"; }
|
||||||
|
command { service = "BotServ"; name = "KICK BOLDS"; command = "botserv/kick/bolds"; }
|
||||||
|
command { service = "BotServ"; name = "KICK CAPS"; command = "botserv/kick/caps"; }
|
||||||
|
command { service = "BotServ"; name = "KICK COLORS"; command = "botserv/kick/colors"; }
|
||||||
|
command { service = "BotServ"; name = "KICK FLOOD"; command = "botserv/kick/flood"; }
|
||||||
|
command { service = "BotServ"; name = "KICK ITALICS"; command = "botserv/kick/italics"; }
|
||||||
|
command { service = "BotServ"; name = "KICK REPEAT"; command = "botserv/kick/repeat"; }
|
||||||
|
command { service = "BotServ"; name = "KICK REVERSES"; command = "botserv/kick/reverses"; }
|
||||||
|
command { service = "BotServ"; name = "KICK UNDERLINES"; command = "botserv/kick/underlines"; }
|
||||||
|
|
||||||
|
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; }
|
||||||
|
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_set
|
* bs_set
|
||||||
*
|
*
|
||||||
* Provides the command botserv/set.
|
* Provides the commands:
|
||||||
*
|
* botserv/set/private - Used to prohibit specific BotServ bots from being assigned to channels.
|
||||||
* Used for setting options such as kickers and fantasy replies.
|
|
||||||
*/
|
*/
|
||||||
module { name = "bs_set" }
|
module { name = "bs_set" }
|
||||||
command { service = "BotServ"; name = "SET"; command = "botserv/set"; }
|
command { service = "BotServ"; name = "SET"; command = "botserv/set"; }
|
||||||
|
command { service = "BotServ"; name = "SET BANEXPIRE"; command = "botserv/set/banexpire"; }
|
||||||
|
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_set_dontkickops
|
* greet
|
||||||
*
|
*
|
||||||
* Provides the command botserv/set/dontkickops.
|
* Provides the commands:
|
||||||
*
|
* botserv/set/greet - Used for enabling or disabling BotServ's greet messages in a channel.
|
||||||
* Used for preventing BotServ from kicking channel operators.
|
* nickserv/set/greet, nickserv/saset/greet - Used for changing a users greet message, which is displayed when they enter channels.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_set_dontkickops" }
|
module { name = "greet" }
|
||||||
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; }
|
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
|
||||||
|
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; }
|
||||||
|
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_set_dontkickvoices
|
* GREET privilege.
|
||||||
*
|
*
|
||||||
* Provides the command botserv/set/dontkickvoices.
|
* Used by 'greet'.
|
||||||
*
|
*
|
||||||
* Used for preventing BotServ from kicking voices.
|
* Users with this privilege have their greet shown when they join channels.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_set_dontkickvoices" }
|
privilege
|
||||||
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
|
{
|
||||||
|
name = "GREET"
|
||||||
|
rank = 40
|
||||||
|
level = 5
|
||||||
|
flag = "g"
|
||||||
|
xop = "AOP"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_set_fantasy
|
* fantasy
|
||||||
*
|
*
|
||||||
* Provides the command botserv/set/fantasy.
|
* Allows 'fantaisist' commands to be used in channels.
|
||||||
*
|
*
|
||||||
* Used for enabling or disabling BotServ's fantaisist commands.
|
* Provides the commands:
|
||||||
|
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_set_fantasy" }
|
module
|
||||||
|
{
|
||||||
|
name = "fantasy"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the prefixes for fantasy commands in channels. One of these characters will have to be prepended
|
||||||
|
* to all fantasy commands. If you choose "!", for example, fantasy commands will be "!kick",
|
||||||
|
* "!op", etc. This directive is optional, if left out, the default fantasy character is "!".
|
||||||
|
*/
|
||||||
|
#fantasycharacter = "!."
|
||||||
|
}
|
||||||
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
|
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bs_set_greet
|
* Fantasy commands
|
||||||
*
|
*
|
||||||
* Provides the command botserv/set/greet.
|
* Fantasy commands can be executed in channels that have a BotServ bot by prefixing the
|
||||||
|
* command with one of the fantasy characters configured in botserv's fantasycharacter
|
||||||
|
* directive.
|
||||||
*
|
*
|
||||||
* Used for enabling or disabling BotServ's greet messages in a channel.
|
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||||
*/
|
*/
|
||||||
module { name = "bs_set_greet" }
|
fantasy { name = "ACCESS"; command = "chanserv/access"; }
|
||||||
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
|
fantasy { name = "AKICK"; command = "chanserv/akick"; }
|
||||||
|
fantasy { name = "AOP"; command = "chanserv/xop"; }
|
||||||
/*
|
fantasy { name = "BAN"; command = "chanserv/ban"; }
|
||||||
* bs_set_nobot
|
fantasy { name = "CLONE"; command = "chanserv/clone"; }
|
||||||
*
|
fantasy { name = "DEHALFOP"; command = "chanserv/modes"; }
|
||||||
* Provides the command botserv/set/nobot.
|
fantasy { name = "DEOP"; command = "chanserv/modes"; }
|
||||||
*
|
fantasy { name = "DEOWNER"; command = "chanserv/modes"; }
|
||||||
* Used by Services Operators to prohibit specific channels from being assigned BotServ bots.
|
fantasy { name = "DEPROTECT"; command = "chanserv/modes"; }
|
||||||
*/
|
fantasy { name = "DEVOICE"; command = "chanserv/modes"; }
|
||||||
module { name = "bs_set_nobot" }
|
fantasy { name = "DOWN"; command = "chanserv/down"; }
|
||||||
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; }
|
fantasy { name = "ENFORCE"; command = "chanserv/enforce"; }
|
||||||
|
fantasy { name = "ENTRYMSG"; command = "chanserv/entrymsg"; }
|
||||||
/*
|
fantasy { name = "FLAGS"; command = "chanserv/flags"; }
|
||||||
* bs_set_private
|
fantasy { name = "HALFOP"; command = "chanserv/modes"; }
|
||||||
*
|
fantasy { name = "HELP"; command = "generic/help"; prepend_channel = false; }
|
||||||
* Provides the command botserv/set/private.
|
fantasy { name = "HOP"; command = "chanserv/xop"; }
|
||||||
*
|
fantasy { name = "INFO"; command = "chanserv/info"; prepend_channel = false; }
|
||||||
* Used by Services Operators to prohibit specific BotServ bots from being assigned to channels.
|
fantasy { name = "INVITE"; command = "chanserv/invite"; }
|
||||||
*/
|
fantasy { name = "K"; command = "chanserv/kick"; }
|
||||||
module { name = "bs_set_private" }
|
fantasy { name = "KB"; command = "chanserv/ban"; }
|
||||||
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; }
|
fantasy { name = "KICK"; command = "chanserv/kick"; }
|
||||||
|
fantasy { name = "LEVELS"; command = "chanserv/levels"; }
|
||||||
|
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; }
|
||||||
|
fantasy { name = "LOG"; command = "chanserv/log"; }
|
||||||
|
fantasy { name = "MODE"; command = "chanserv/mode"; }
|
||||||
|
fantasy { name = "MUTE"; command = "chanserv/ban"; kick = no; mode = "QUIET"; }
|
||||||
|
fantasy { name = "OP"; command = "chanserv/modes"; }
|
||||||
|
fantasy { name = "OWNER"; command = "chanserv/modes"; }
|
||||||
|
fantasy { name = "PROTECT"; command = "chanserv/modes"; }
|
||||||
|
fantasy { name = "QOP"; command = "chanserv/xop"; }
|
||||||
|
fantasy { name = "SEEN"; command = "chanserv/seen"; prepend_channel = false; }
|
||||||
|
fantasy { name = "SOP"; command = "chanserv/xop"; }
|
||||||
|
fantasy { name = "STATUS"; command = "chanserv/status"; }
|
||||||
|
fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; }
|
||||||
|
fantasy { name = "SYNC"; command = "chanserv/sync"; }
|
||||||
|
fantasy { name = "TOPIC"; command = "chanserv/topic"; }
|
||||||
|
fantasy { name = "UNBAN"; command = "chanserv/unban"; }
|
||||||
|
fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
|
||||||
|
fantasy { name = "UP"; command = "chanserv/up"; }
|
||||||
|
fantasy { name = "VOICE"; command = "chanserv/modes"; }
|
||||||
|
fantasy { name = "VOP"; command = "chanserv/xop"; }
|
||||||
|
|||||||
+408
-425
File diff suppressed because it is too large
Load Diff
+18
-17
@@ -1,15 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Example configuration file for chanstats
|
* Example configuration file for Chanstats.
|
||||||
* Make sure BotServ, ChanServ and NickServ are running.
|
* Make sure BotServ, ChanServ and NickServ are running.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module { name = "m_chanstats" }
|
module
|
||||||
|
|
||||||
chanstats
|
|
||||||
{
|
{
|
||||||
/*
|
name = "m_chanstats"
|
||||||
|
|
||||||
|
/*
|
||||||
* The name of this engine.
|
* The name of this engine.
|
||||||
* This must match with the name of a SQL engine block
|
* This must match with the name of an SQL engine block.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
engine = "mysql/main"
|
engine = "mysql/main"
|
||||||
@@ -20,31 +20,32 @@ chanstats
|
|||||||
*/
|
*/
|
||||||
prefix = "anope_"
|
prefix = "anope_"
|
||||||
|
|
||||||
smileyshappy = ":) :-) ;) :D :-D"
|
smileyshappy = ":) :-) ;) ;-) :D :-D :P :-P"
|
||||||
smileyssad = ":( :-( ;( ;-("
|
smileyssad = ":( :-( ;( ;-("
|
||||||
smileysother = ":/"
|
smileysother = ":/ :-/"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable Chanstats for new registered nicks / channels
|
* Enable Chanstats for newly registered nicks / channels.
|
||||||
* set it to 0 to disable it.
|
|
||||||
*/
|
*/
|
||||||
NSDefChanstats = 1
|
ns_def_chanstats = yes
|
||||||
CSDefChanstats = 1
|
cs_def_chanstats = yes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module { name = "cs_set_chanstats" }
|
|
||||||
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
|
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
|
||||||
|
|
||||||
module { name = "ns_set_chanstats" }
|
|
||||||
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
|
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
|
||||||
|
command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/saset/chanstats"; }
|
||||||
|
|
||||||
module { name = "cs_fantasy_stats" }
|
module { name = "cs_fantasy_stats" }
|
||||||
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; }
|
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; }
|
||||||
command { service = "ChanServ"; name = "GSTATS"; command = "chanserv/gstats"; }
|
command { service = "ChanServ"; name = "GSTATS"; command = "chanserv/gstats"; }
|
||||||
|
fantasy { name = "STATS"; command = "chanserv/stats"; }
|
||||||
|
fantasy { name = "GSTATS"; command = "chanserv/gstats"; }
|
||||||
|
|
||||||
module { name = "cs_fantasy_top" }
|
module { name = "cs_fantasy_top" }
|
||||||
command { service = "ChanServ"; name = "TOP"; command = "chanserv/top"; }
|
command { service = "ChanServ"; name = "TOP"; command = "chanserv/top"; }
|
||||||
command { service = "ChanServ"; name = "TOP10"; command = "chanserv/top10"; }
|
command { service = "ChanServ"; name = "TOP10"; command = "chanserv/top10"; }
|
||||||
command { service = "ChanServ"; name = "GTOP"; command = "chanserv/gtop"; }
|
command { service = "ChanServ"; name = "GTOP"; command = "chanserv/gtop"; }
|
||||||
command { service = "ChanServ"; name = "GTOP10"; command = "chanserv/gtop10"; }
|
command { service = "ChanServ"; name = "GTOP10"; command = "chanserv/gtop10"; }
|
||||||
|
fantasy { name = "TOP"; command = "chanserv/top"; }
|
||||||
|
fantasy { name = "TOP10"; command = "chanserv/top10"; }
|
||||||
|
fantasy { name = "GTOP"; command = "chanserv/gtop"; }
|
||||||
|
fantasy { name = "GTOP10"; command = "chanserv/gtop10"; }
|
||||||
|
|||||||
+2
-1
@@ -37,7 +37,8 @@ cd $ANOPATH
|
|||||||
if [ -f "$ANODATA/$ANOPIDF" ]
|
if [ -f "$ANODATA/$ANOPIDF" ]
|
||||||
then
|
then
|
||||||
ANOPID=`cat "$ANODATA/$ANOPIDF"`
|
ANOPID=`cat "$ANODATA/$ANOPIDF"`
|
||||||
if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ]
|
kill -0 $ANOPID 2>/dev/null
|
||||||
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|||||||
+357
-290
File diff suppressed because it is too large
Load Diff
+19
-29
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* First, create the service.
|
* First, create the service.
|
||||||
* Note that an easy way to rename this service is to define{} the client name to something else.
|
|
||||||
*/
|
*/
|
||||||
service
|
service
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The name of the Global client
|
* The name of the Global client.
|
||||||
|
* If you change this value, you probably want to change the client directive in the configuration for the global module too.
|
||||||
*/
|
*/
|
||||||
nick = "Global"
|
nick = "Global"
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ service
|
|||||||
* These modes are very IRCd specific. If left commented, sane defaults
|
* These modes are very IRCd specific. If left commented, sane defaults
|
||||||
* are used based on what protocol module you have loaded.
|
* are used based on what protocol module you have loaded.
|
||||||
*
|
*
|
||||||
* Note that setting this option incorrectly could potentially BREAK some if
|
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||||
* not all usefulness of the client. We will not support you if this client is
|
* not all, usefulness of the client. We will not support you if this client is
|
||||||
* unable to do certain things if this option is enabled.
|
* unable to do certain things if this option is enabled.
|
||||||
*/
|
*/
|
||||||
#modes = "+o"
|
#modes = "+o"
|
||||||
@@ -46,7 +46,7 @@ service
|
|||||||
* of log channels this is not very useful, as the service will just idle in the
|
* of log channels this is not very useful, as the service will just idle in the
|
||||||
* specified channels, and will not accept any types of commands.
|
* specified channels, and will not accept any types of commands.
|
||||||
*
|
*
|
||||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||||
*/
|
*/
|
||||||
#channels = "@#services,#mychan"
|
#channels = "@#services,#mychan"
|
||||||
}
|
}
|
||||||
@@ -56,41 +56,33 @@ service
|
|||||||
*
|
*
|
||||||
* Provides essential functionality for Global.
|
* Provides essential functionality for Global.
|
||||||
*/
|
*/
|
||||||
module { name = "global" }
|
module
|
||||||
|
|
||||||
/*
|
|
||||||
* Configuration for Global provided by gl_main.
|
|
||||||
*/
|
|
||||||
global
|
|
||||||
{
|
{
|
||||||
|
name = "global"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The name of the client that should be Global.
|
* The name of the client that should be Global.
|
||||||
*/
|
*/
|
||||||
name = "Global"
|
client = "Global"
|
||||||
|
|
||||||
/*
|
|
||||||
* If set, Services will send global messages on starting up and shutting
|
|
||||||
* down/restarting.
|
|
||||||
*
|
|
||||||
* This directive is optional.
|
|
||||||
*/
|
|
||||||
#globaloncycle = yes
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the global message that will be sent when Services are being
|
* This is the global message that will be sent when Services are being
|
||||||
* shutdown/restarted. This directive is only required if you enable
|
* shutdown/restarted.
|
||||||
* globaloncycle above.
|
*
|
||||||
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
globaloncycledown = "Services are restarting, they will be back shortly - please be good while we're gone"
|
#globaloncycledown = "Services are restarting, they will be back shortly - please be good while we're gone"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the global message that will be sent when Services (re)join the
|
* This is the global message that will be sent when Services (re)join the
|
||||||
* network. This directive is only required if you enable globaloncycle above.
|
* network.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
globaloncycleup = "Services are now back online - have a nice day"
|
#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, Services will hide the IRC Operator's nick in a global
|
||||||
* message/notice.
|
* message/notice.
|
||||||
*
|
*
|
||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
@@ -109,7 +101,7 @@ global
|
|||||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Give it a help command */
|
/* Give it a help command. */
|
||||||
command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -120,6 +112,4 @@ command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
|||||||
* Used for sending a message to every online user.
|
* Used for sending a message to every online user.
|
||||||
*/
|
*/
|
||||||
module { name = "gl_global" }
|
module { name = "gl_global" }
|
||||||
command { service = "OperServ"; name = "GLOBAL"; command = "global/global"; permission = "operserv/global"; }
|
|
||||||
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
|
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
|
||||||
|
|
||||||
|
|||||||
+37
-50
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* First, create the service.
|
* First, create the service.
|
||||||
* Note that an easy way to rename this service is to define{} the client name to something else.
|
|
||||||
*/
|
*/
|
||||||
service
|
service
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The name of the HostServ client
|
* The name of the HostServ client.
|
||||||
|
* If you change this value, you probably want to change the client directive in the configuration for the hostserv module too.
|
||||||
*/
|
*/
|
||||||
nick = "HostServ"
|
nick = "HostServ"
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ service
|
|||||||
* These modes are very IRCd specific. If left commented, sane defaults
|
* These modes are very IRCd specific. If left commented, sane defaults
|
||||||
* are used based on what protocol module you have loaded.
|
* are used based on what protocol module you have loaded.
|
||||||
*
|
*
|
||||||
* Note that setting this option incorrectly could potentially BREAK some if
|
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||||
* not all usefulness of the client. We will not support you if this client is
|
* not all, usefulness of the client. We will not support you if this client is
|
||||||
* unable to do certain things if this option is enabled.
|
* unable to do certain things if this option is enabled.
|
||||||
*/
|
*/
|
||||||
#modes = "+o"
|
#modes = "+o"
|
||||||
@@ -46,7 +46,7 @@ service
|
|||||||
* of log channels this is not very useful, as the service will just idle in the
|
* of log channels this is not very useful, as the service will just idle in the
|
||||||
* specified channels, and will not accept any types of commands.
|
* specified channels, and will not accept any types of commands.
|
||||||
*
|
*
|
||||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||||
*/
|
*/
|
||||||
#channels = "@#services,#mychan"
|
#channels = "@#services,#mychan"
|
||||||
}
|
}
|
||||||
@@ -56,45 +56,19 @@ service
|
|||||||
*
|
*
|
||||||
* Provides essential functionality for HostServ.
|
* Provides essential functionality for HostServ.
|
||||||
*/
|
*/
|
||||||
module { name = "hostserv" }
|
module
|
||||||
|
|
||||||
/*
|
|
||||||
* Configuration for HostServ provided by hs_main.
|
|
||||||
*/
|
|
||||||
hostserv
|
|
||||||
{
|
{
|
||||||
|
name = "hostserv"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The name of the client that should be HostServ.
|
* The name of the client that should be HostServ.
|
||||||
*/
|
*/
|
||||||
name = "HostServ"
|
client = "HostServ"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The characters allowed in a vhost. Changing this is not recommended unless
|
* If enabled, vhosts are activated on users immediately when they are set.
|
||||||
* 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. Note these are 1 byte characters, so
|
|
||||||
* UTF-8 characters will not work.
|
|
||||||
*
|
|
||||||
* It is recommended you DON'T change this.
|
|
||||||
*/
|
*/
|
||||||
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
|
activate_on_set = false
|
||||||
|
|
||||||
/*
|
|
||||||
* If set, allows vhosts to not contain dots (.).
|
|
||||||
* Newer IRCds generally do not have a problem with this, but the same warning as
|
|
||||||
* vhost_chars applies.
|
|
||||||
*
|
|
||||||
* It is recommended you DON'T change this.
|
|
||||||
*/
|
|
||||||
allow_undotted_vhosts = false
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The characters that are not allowed to be at the very beginning or very ending
|
|
||||||
* of a vhost. The same warning as vhost_chars applies.
|
|
||||||
*
|
|
||||||
* It is recommended you DON'T change this.
|
|
||||||
*/
|
|
||||||
disallow_start_or_end = ".-"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -108,7 +82,7 @@ hostserv
|
|||||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Give it a help command */
|
/* Give it a help command. */
|
||||||
command { service = "HostServ"; name = "HELP"; command = "generic/help"; }
|
command { service = "HostServ"; name = "HELP"; command = "generic/help"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -116,7 +90,7 @@ command { service = "HostServ"; name = "HELP"; command = "generic/help"; }
|
|||||||
*
|
*
|
||||||
* Provides the commands hostserv/del and hostserv/delall.
|
* Provides the commands hostserv/del and hostserv/delall.
|
||||||
*
|
*
|
||||||
* Used for removing users vHosts.
|
* Used for removing users' vHosts.
|
||||||
*/
|
*/
|
||||||
module { name = "hs_del" }
|
module { name = "hs_del" }
|
||||||
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; permission = "hostserv/del"; }
|
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; permission = "hostserv/del"; }
|
||||||
@@ -129,7 +103,20 @@ command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; pe
|
|||||||
*
|
*
|
||||||
* Used for grouping one vHost to many nicks.
|
* Used for grouping one vHost to many nicks.
|
||||||
*/
|
*/
|
||||||
module { name = "hs_group" }
|
module
|
||||||
|
{
|
||||||
|
name = "hs_group"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Upon nickserv/group, this option syncs the nick's main vHost to the grouped nick.
|
||||||
|
*/
|
||||||
|
syncongroup = false
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This makes vhosts act as if they are per account.
|
||||||
|
*/
|
||||||
|
synconset = false
|
||||||
|
}
|
||||||
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
|
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -165,17 +152,14 @@ command { service = "HostServ"; name = "ON"; command = "hostserv/on"; }
|
|||||||
/*
|
/*
|
||||||
* hs_request
|
* hs_request
|
||||||
*
|
*
|
||||||
* Provides the commands hostserv/request, hostserv/active, hostserv/reject, and hostserv/waiting.
|
* Provides the commands hostserv/request, hostserv/activate, hostserv/reject, and hostserv/waiting.
|
||||||
*
|
*
|
||||||
* Used to manage vhosts requested by users.
|
* Used to manage vHosts requested by users.
|
||||||
*/
|
*/
|
||||||
module { name = "hs_request" }
|
module
|
||||||
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request"; }
|
|
||||||
command { service = "HostServ"; name = "ACTIVATE"; command = "hostserv/activate"; permission = "hostserv/set"; }
|
|
||||||
command { service = "HostServ"; name = "REJECT"; command = "hostserv/reject"; permission = "hostserv/set"; }
|
|
||||||
command { service = "HostServ"; name = "WAITING"; command = "hostserv/waiting"; permission = "hostserv/set"; }
|
|
||||||
hs_request
|
|
||||||
{
|
{
|
||||||
|
name = "hs_request"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, Services will send a memo to the user requesting a vHost when it's been
|
* If set, Services will send a memo to the user requesting a vHost when it's been
|
||||||
* approved or rejected.
|
* approved or rejected.
|
||||||
@@ -187,15 +171,18 @@ hs_request
|
|||||||
*/
|
*/
|
||||||
#memooper = yes
|
#memooper = yes
|
||||||
}
|
}
|
||||||
|
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request"; }
|
||||||
|
command { service = "HostServ"; name = "ACTIVATE"; command = "hostserv/activate"; permission = "hostserv/set"; }
|
||||||
|
command { service = "HostServ"; name = "REJECT"; command = "hostserv/reject"; permission = "hostserv/set"; }
|
||||||
|
command { service = "HostServ"; name = "WAITING"; command = "hostserv/waiting"; permission = "hostserv/set"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* hs_set
|
* hs_set
|
||||||
*
|
*
|
||||||
* Provides the commands hostserv/set and hostserv/setall.
|
* Provides the commands hostserv/set and hostserv/setall.
|
||||||
*
|
*
|
||||||
* Used for setting users vhosts.
|
* Used for setting users' vHosts.
|
||||||
*/
|
*/
|
||||||
module { name = "hs_set" }
|
module { name = "hs_set" }
|
||||||
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; permission = "hostserv/set"; }
|
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; permission = "hostserv/set"; }
|
||||||
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; permission = "hostserv/set"; }
|
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; permission = "hostserv/set"; }
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
* Example configuration file for the irc2sql gateway
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
service
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The name of the StatServ client.
|
||||||
|
*/
|
||||||
|
nick = "StatServ"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The username of the StatServ client.
|
||||||
|
*/
|
||||||
|
user = "StatServ"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The hostname of the StatServ client.
|
||||||
|
*/
|
||||||
|
host = "services.host"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The realname of the StatServ client.
|
||||||
|
*/
|
||||||
|
gecos = "Statistical Service"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The modes this client should use.
|
||||||
|
* Do not modify this unless you know what you are doing.
|
||||||
|
*
|
||||||
|
* These modes are very IRCd specific. If left commented, sane defaults
|
||||||
|
* are used based on what protocol module you have loaded.
|
||||||
|
*
|
||||||
|
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||||
|
* not all, usefulness of the client. We will not support you if this client is
|
||||||
|
* unable to do certain things if this option is enabled.
|
||||||
|
*/
|
||||||
|
#modes = "+o"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* An optional comma separated list of channels this service should join. Outside
|
||||||
|
* of log channels this is not very useful, as the service will just idle in the
|
||||||
|
* specified channels, and will not accept any types of commands.
|
||||||
|
*
|
||||||
|
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||||
|
*/
|
||||||
|
#channels = "@#services,#mychan"
|
||||||
|
}
|
||||||
|
|
||||||
|
module
|
||||||
|
{
|
||||||
|
name = "irc2sql"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The name of the client that should send the CTCP VERSION requests.
|
||||||
|
* It must already exist or must be defined in the following service block.
|
||||||
|
*/
|
||||||
|
client = "StatServ"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The name of the SQL engine to use.
|
||||||
|
* This must be MySQL and must match the name in the mysql{} block
|
||||||
|
*/
|
||||||
|
engine = "mysql/main"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* An optional prefix to prepended to the name of each created table.
|
||||||
|
* Do not use the same prefix for other programs.
|
||||||
|
*/
|
||||||
|
prefix = "anope_"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GeoIP - Automatically adds users geoip location to the user table.
|
||||||
|
* Tables are created by irc2sql, you have to run the
|
||||||
|
* geoipupdate script after you started Anope to download
|
||||||
|
* and import the GeoIP database.
|
||||||
|
*
|
||||||
|
* The geoip database can be the smaller "country" database or the
|
||||||
|
* larger "city" database. Comment to disable geoip lookup.
|
||||||
|
*/
|
||||||
|
geoip_database = "country"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get the CTCP version from users
|
||||||
|
* The users connecting to the network will receive a CTCP VERSION
|
||||||
|
* request from the above configured services client
|
||||||
|
*/
|
||||||
|
ctcpuser = "yes"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send out CTCP VERSION requests to users during burst.
|
||||||
|
* Disable this if you restart Anope often and don't want to
|
||||||
|
* annoy your users.
|
||||||
|
*/
|
||||||
|
ctcpeob = "yes"
|
||||||
|
}
|
||||||
|
|
||||||
+34
-29
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* First, create the service.
|
* First, create the service.
|
||||||
* Note that an easy way to rename this service is to define{} the client name to something else.
|
|
||||||
*/
|
*/
|
||||||
service
|
service
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The name of the MemoServ client
|
* The name of the MemoServ client.
|
||||||
|
* If you change this value, you probably want to change the client directive in the configuration for the memoserv module too.
|
||||||
*/
|
*/
|
||||||
nick = "MemoServ"
|
nick = "MemoServ"
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ service
|
|||||||
* These modes are very IRCd specific. If left commented, sane defaults
|
* These modes are very IRCd specific. If left commented, sane defaults
|
||||||
* are used based on what protocol module you have loaded.
|
* are used based on what protocol module you have loaded.
|
||||||
*
|
*
|
||||||
* Note that setting this option incorrectly could potentially BREAK some if
|
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||||
* not all usefulness of the client. We will not support you if this client is
|
* not all, usefulness of the client. We will not support you if this client is
|
||||||
* unable to do certain things if this option is enabled.
|
* unable to do certain things if this option is enabled.
|
||||||
*/
|
*/
|
||||||
#modes = "+o"
|
#modes = "+o"
|
||||||
@@ -46,7 +46,7 @@ service
|
|||||||
* of log channels this is not very useful, as the service will just idle in the
|
* of log channels this is not very useful, as the service will just idle in the
|
||||||
* specified channels, and will not accept any types of commands.
|
* specified channels, and will not accept any types of commands.
|
||||||
*
|
*
|
||||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||||
*/
|
*/
|
||||||
#channels = "@#services,#mychan"
|
#channels = "@#services,#mychan"
|
||||||
}
|
}
|
||||||
@@ -56,18 +56,14 @@ service
|
|||||||
*
|
*
|
||||||
* Provides essential functionality for MemoServ.
|
* Provides essential functionality for MemoServ.
|
||||||
*/
|
*/
|
||||||
module { name = "memoserv" }
|
module
|
||||||
|
|
||||||
/*
|
|
||||||
* Configuration for MemoServ provided by ms_main.
|
|
||||||
*/
|
|
||||||
memoserv
|
|
||||||
{
|
{
|
||||||
|
name = "memoserv"
|
||||||
/*
|
/*
|
||||||
* The name of the client that should be MemoServ. Clients are configured
|
* The name of the client that should be MemoServ. Clients are configured
|
||||||
* with the service blocks.
|
* with the service blocks.
|
||||||
*/
|
*/
|
||||||
name = "MemoServ"
|
client = "MemoServ"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The maximum number of memos a user is allowed to keep by default. Normal users may set the
|
* The maximum number of memos a user is allowed to keep by default. Normal users may set the
|
||||||
@@ -88,16 +84,6 @@ memoserv
|
|||||||
* This directive is optional, but recommended.
|
* This directive is optional, but recommended.
|
||||||
*/
|
*/
|
||||||
senddelay = 3s
|
senddelay = 3s
|
||||||
|
|
||||||
/*
|
|
||||||
* Allow the use of memo receipts for the following groups:
|
|
||||||
*
|
|
||||||
* 1 - Opers Only
|
|
||||||
* 2 - Everybody
|
|
||||||
*
|
|
||||||
* This directive is optional.
|
|
||||||
*/
|
|
||||||
#memoreceipt = 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -111,7 +97,7 @@ memoserv
|
|||||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Give it a help command */
|
/* Give it a help command. */
|
||||||
command { service = "MemoServ"; name = "HELP"; command = "generic/help"; }
|
command { service = "MemoServ"; name = "HELP"; command = "generic/help"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -151,7 +137,17 @@ command { service = "MemoServ"; name = "DEL"; command = "memoserv/del"; }
|
|||||||
*
|
*
|
||||||
* Used to ignore memos from specific users.
|
* Used to ignore memos from specific users.
|
||||||
*/
|
*/
|
||||||
module { name = "ms_ignore" }
|
module
|
||||||
|
{
|
||||||
|
name = "ms_ignore"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of entries that may be on a memo ignore list.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
max = 32
|
||||||
|
}
|
||||||
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
|
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -190,16 +186,26 @@ command { service = "MemoServ"; name = "READ"; command = "memoserv/read"; }
|
|||||||
* Provides the command memoserv/rsend.
|
* Provides the command memoserv/rsend.
|
||||||
*
|
*
|
||||||
* Used to send a memo requiring a receipt be sent back once it is read.
|
* Used to send a memo requiring a receipt be sent back once it is read.
|
||||||
*
|
*
|
||||||
* Requires configuring memoserv:memoreceipt.
|
* Requires configuring memoserv:memoreceipt.
|
||||||
*/
|
*/
|
||||||
#module { name = "ms_rsend" }
|
#module
|
||||||
|
{
|
||||||
|
name = "ms_rsend"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Only allow Services Operators to use ms_rsend.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
operonly = false
|
||||||
|
}
|
||||||
#command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend"; }
|
#command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ms_send
|
* ms_send
|
||||||
*
|
*
|
||||||
* Provides the command memoserv/send
|
* Provides the command memoserv/send.
|
||||||
*
|
*
|
||||||
* Used to send memos.
|
* Used to send memos.
|
||||||
*/
|
*/
|
||||||
@@ -209,7 +215,7 @@ command { service = "MemoServ"; name = "SEND"; command = "memoserv/send"; }
|
|||||||
/*
|
/*
|
||||||
* ms_sendall
|
* ms_sendall
|
||||||
*
|
*
|
||||||
* Provides the command memoserv/sendall
|
* Provides the command memoserv/sendall.
|
||||||
*
|
*
|
||||||
* Used to send a mass memo to every registered user.
|
* Used to send a mass memo to every registered user.
|
||||||
*/
|
*/
|
||||||
@@ -235,4 +241,3 @@ command { service = "MemoServ"; name = "SET"; command = "memoserv/set"; }
|
|||||||
*/
|
*/
|
||||||
module { name = "ms_staff" }
|
module { name = "ms_staff" }
|
||||||
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; permission = "memoserv/staff"; }
|
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; permission = "memoserv/staff"; }
|
||||||
|
|
||||||
|
|||||||
+526
-228
@@ -1,21 +1,84 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* [OPTIONAL] Non-Core Modules
|
* [OPTIONAL] Non-Core Modules
|
||||||
*
|
*
|
||||||
* The following blocks are used to load all non-core modules, including 3rd-party modules.
|
* The following blocks are used to load all non-core modules, including 3rd-party modules.
|
||||||
* Modules can be prevented from loading by commenting out the line, other modules can be added by
|
* 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 Services connecting to your network.
|
||||||
|
*
|
||||||
|
* Note that some of these modules are labeled EXTRA, and must be enabled prior to compiling by
|
||||||
|
* running the 'extras' script on Linux and UNIX.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* help
|
* help
|
||||||
*
|
*
|
||||||
* Provides commands generic/help
|
* Provides the command generic/help.
|
||||||
*
|
*
|
||||||
* Is a generic help command that can be used with any client.
|
* This is a generic help command that can be used with any client.
|
||||||
*/
|
*/
|
||||||
module { name = "help" }
|
module { name = "help" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_dns
|
||||||
|
*
|
||||||
|
* Adds support for the DNS protocol. By itself this module does nothing useful,
|
||||||
|
* but other modules such as m_dnsbl and os_dns require this.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "m_dns"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file.
|
||||||
|
* The below should work fine on all unix like systems. Windows users will have to find their nameservers
|
||||||
|
* from ipconfig /all and put the IP here.
|
||||||
|
*/
|
||||||
|
nameserver = "/etc/resolv.conf"
|
||||||
|
#nameserver = "127.0.0.1"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* How long to wait in seconds before a DNS query has timed out.
|
||||||
|
*/
|
||||||
|
timeout = 5
|
||||||
|
|
||||||
|
|
||||||
|
/* Only edit below if you are expecting to use os_dns or otherwise answer DNS queries. */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The IP and port services use to listen for DNS queries.
|
||||||
|
* Note that ports less than 1024 are privileged on UNIX/Linux systems, and
|
||||||
|
* require Anope to be started as root. If you do this, it is recommended you
|
||||||
|
* set options:user and options:group so Anope can change users after binding
|
||||||
|
* to this port.
|
||||||
|
*/
|
||||||
|
ip = "0.0.0.0"
|
||||||
|
port = 53
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SOA record information.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* E-mail address of the DNS administrator. */
|
||||||
|
admin = "admin@example.com"
|
||||||
|
|
||||||
|
/* This should be the names of the public facing nameservers serving the records. */
|
||||||
|
nameservers = "ns1.example.com ns2.example.com"
|
||||||
|
|
||||||
|
/* The time slave servers are allowed to cache. This should be reasonably low
|
||||||
|
* if you want your records to be updated without much delay.
|
||||||
|
*/
|
||||||
|
refresh = 3600
|
||||||
|
|
||||||
|
/* A notify block. There should probably be one per nameserver listed in 'nameservers'.
|
||||||
|
*/
|
||||||
|
notify
|
||||||
|
{
|
||||||
|
ip = "192.0.2.0"
|
||||||
|
port = 53
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* m_dnsbl
|
* m_dnsbl
|
||||||
*
|
*
|
||||||
@@ -23,9 +86,10 @@ module { name = "help" }
|
|||||||
* is found on the blacklist they will be immediately banned. This is a crucial module
|
* is found on the blacklist they will be immediately banned. This is a crucial module
|
||||||
* to prevent bot attacks.
|
* to prevent bot attacks.
|
||||||
*/
|
*/
|
||||||
module { name = "m_dnsbl" }
|
#module
|
||||||
m_dnsbl
|
|
||||||
{
|
{
|
||||||
|
name = "m_dnsbl"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, Services will check clients against the DNSBLs when services connect to its uplink.
|
* If set, Services will check clients against the DNSBLs when services connect to its uplink.
|
||||||
* This is not recommended, and on large networks will open a very large amount of DNS queries.
|
* This is not recommended, and on large networks will open a very large amount of DNS queries.
|
||||||
@@ -45,39 +109,73 @@ m_dnsbl
|
|||||||
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
|
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
|
||||||
*/
|
*/
|
||||||
add_to_akill = yes
|
add_to_akill = yes
|
||||||
}
|
|
||||||
blacklist
|
|
||||||
{
|
|
||||||
/* Name of the blacklist */
|
|
||||||
name = "rbl.efnetrbl.org"
|
|
||||||
|
|
||||||
/* How long to set the ban for */
|
blacklist
|
||||||
time = 4h
|
{
|
||||||
|
/* Name of the blacklist. */
|
||||||
|
name = "rbl.efnetrbl.org"
|
||||||
|
|
||||||
/* Reason for akill.
|
/* How long to set the ban for. */
|
||||||
* %n is the nick of the user
|
time = 4h
|
||||||
* %u is the ident/username of the user
|
|
||||||
* %g is the realname of the user
|
|
||||||
* %h is the hostname of the user
|
|
||||||
* %i is the IP of the user
|
|
||||||
* %r is the reason (configured below). Will be nothing if not configured.
|
|
||||||
* %N is the network name set in networkinfo:networkname
|
|
||||||
*/
|
|
||||||
reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
|
|
||||||
|
|
||||||
/* Replies to ban and their reason. If this is totally ommited all replies get banned */
|
/* Reason for akill.
|
||||||
1 = "Open Proxy"
|
* %n is the nick of the user
|
||||||
/* Don't ban for result 2 or 3 */
|
* %u is the ident/username of the user
|
||||||
#2 = "spamtrap666"
|
* %g is the realname of the user
|
||||||
#3 = "spamtrap50"
|
* %h is the hostname of the user
|
||||||
4 = "TOR"
|
* %i is the IP of the user
|
||||||
5 = "Drones / Flooding"
|
* %r is the reply reason (configured below). Will be nothing if not configured.
|
||||||
}
|
* %N is the network name set in networkinfo:networkname
|
||||||
blacklist
|
*/
|
||||||
{
|
reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
|
||||||
name = "dnsbl.dronebl.org"
|
|
||||||
time = 4h
|
/* Replies to ban and their reason. If no relies are configured, all replies get banned. */
|
||||||
reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded.do?ip=%i&network=%N"
|
reply
|
||||||
|
{
|
||||||
|
code = 1
|
||||||
|
reason = "Open Proxy"
|
||||||
|
}
|
||||||
|
|
||||||
|
#reply
|
||||||
|
{
|
||||||
|
code = 2
|
||||||
|
reason = "spamtrap666"
|
||||||
|
}
|
||||||
|
|
||||||
|
#reply
|
||||||
|
{
|
||||||
|
code = 3
|
||||||
|
reason = "spamtrap50"
|
||||||
|
}
|
||||||
|
|
||||||
|
reply
|
||||||
|
{
|
||||||
|
code = 4
|
||||||
|
reason = "TOR"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, users identified to services at the time the result comes back
|
||||||
|
* will not be banned.
|
||||||
|
*/
|
||||||
|
#allow_account = yes
|
||||||
|
}
|
||||||
|
|
||||||
|
reply
|
||||||
|
{
|
||||||
|
code = 5
|
||||||
|
reason = "Drones / Flooding"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#blacklist
|
||||||
|
{
|
||||||
|
name = "dnsbl.dronebl.org"
|
||||||
|
time = 4h
|
||||||
|
reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded?ip=%i&network=%N"
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Exempt localhost from DNSBL checks */
|
||||||
|
exempt { ip = "127.0.0.1" }
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -85,9 +183,10 @@ blacklist
|
|||||||
*
|
*
|
||||||
* Gives users who are op in the specified help channel usermode +h (helpop).
|
* Gives users who are op in the specified help channel usermode +h (helpop).
|
||||||
*/
|
*/
|
||||||
#module { name = "m_helpchan" }
|
#module
|
||||||
m_helpchan
|
|
||||||
{
|
{
|
||||||
|
name = "m_helpchan"
|
||||||
|
|
||||||
helpchannel = "#help"
|
helpchannel = "#help"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,57 +198,71 @@ m_helpchan
|
|||||||
* Note that using this will allow users to get the IP of your services.
|
* Note that using this will allow users to get the IP of your services.
|
||||||
* To prevent this we recommend using a reverse proxy or a tunnel.
|
* To prevent this we recommend using a reverse proxy or a tunnel.
|
||||||
*/
|
*/
|
||||||
#module { name = "m_httpd" }
|
#module
|
||||||
httpd
|
|
||||||
{
|
{
|
||||||
/* Name of this service */
|
name = "m_httpd"
|
||||||
name = "httpd/main"
|
|
||||||
|
|
||||||
/* IP to listen on */
|
|
||||||
ip = "0.0.0.0"
|
|
||||||
/* Port to listen on */
|
|
||||||
port = 8080
|
|
||||||
/* Time before connections to this server are timed out */
|
|
||||||
timeout = 30
|
|
||||||
|
|
||||||
/* If you are using a reverse proxy that sends one of the
|
httpd
|
||||||
* extforward_headers set below, set this to its IP.
|
{
|
||||||
* This allows services to obtain the real IP of users by
|
/* Name of this service. */
|
||||||
* reading the forwarded-for HTTP header.
|
name = "httpd/main"
|
||||||
*/
|
|
||||||
#extforward_ip = "192.168.0.255"
|
|
||||||
|
|
||||||
/* The header to look for. These probably work as is. */
|
/* IP to listen on. */
|
||||||
extforward_header = "X-Forwarded-For Forwarded-For"
|
ip = "0.0.0.0"
|
||||||
|
|
||||||
|
/* Port to listen on. */
|
||||||
|
port = 8080
|
||||||
|
|
||||||
|
/* Time before connections to this server are timed out. */
|
||||||
|
timeout = 30
|
||||||
|
|
||||||
|
/* Listen using SSL. Requires an SSL module. */
|
||||||
|
#ssl = yes
|
||||||
|
|
||||||
|
/* If you are using a reverse proxy that sends one of the
|
||||||
|
* extforward_headers set below, set this to its IP.
|
||||||
|
* This allows services to obtain the real IP of users by
|
||||||
|
* reading the forwarded-for HTTP header.
|
||||||
|
*/
|
||||||
|
#extforward_ip = "192.168.0.255"
|
||||||
|
|
||||||
|
/* The header to look for. These probably work as is. */
|
||||||
|
extforward_header = "X-Forwarded-For Forwarded-For"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* m_ldap
|
* m_ldap [EXTRA]
|
||||||
*
|
*
|
||||||
* This module allows other modules to use LDAP. By itself, this module does nothing useful.
|
* This module allows other modules to use LDAP. By itself, this module does nothing useful.
|
||||||
*/
|
*/
|
||||||
#module { name = "m_ldap" }
|
#module
|
||||||
ldap
|
|
||||||
{
|
{
|
||||||
server = "ldap://127.0.0.1"
|
name = "m_ldap"
|
||||||
port = 389
|
|
||||||
|
|
||||||
/*
|
ldap
|
||||||
* Admin credentials used for performing searches and adding users.
|
{
|
||||||
*/
|
server = "ldap://127.0.0.1"
|
||||||
admin_binddn = "cn=Manager,dc=anope,dc=org"
|
port = 389
|
||||||
admin_password = "secret"
|
|
||||||
|
/*
|
||||||
|
* Admin credentials used for performing searches and adding users.
|
||||||
|
*/
|
||||||
|
admin_binddn = "cn=Manager,dc=anope,dc=org"
|
||||||
|
admin_password = "secret"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* m_ldap_authentication
|
* m_ldap_authentication [EXTRA]
|
||||||
*
|
*
|
||||||
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
|
* 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 m_ldap.
|
||||||
*/
|
*/
|
||||||
#module { name = "m_ldap_authentication" }
|
#module
|
||||||
m_ldap_authentication
|
|
||||||
{
|
{
|
||||||
|
name = "m_ldap_authentication"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The distinguished name used for searching for users's accounts.
|
* The distinguished name used for searching for users's accounts.
|
||||||
*/
|
*/
|
||||||
@@ -157,14 +270,14 @@ m_ldap_authentication
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The search filter used to look up users's accounts.
|
* The search filter used to look up users's accounts.
|
||||||
* %account is replaced with the user's account
|
* %account is replaced with the user's account.
|
||||||
* %object_class is replaced with the object_class configured below.
|
* %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.
|
* The object class used by LDAP to store user account information.
|
||||||
* Used for adding new users to LDAP if disable_ns_register is false
|
* This is used for adding new users to LDAP if registration is allowed.
|
||||||
*/
|
*/
|
||||||
object_class = "anopeUser"
|
object_class = "anopeUser"
|
||||||
|
|
||||||
@@ -186,28 +299,32 @@ m_ldap_authentication
|
|||||||
password_attribute = "userPassword"
|
password_attribute = "userPassword"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable to have this module disable /nickserv register.
|
* If set, the reason to give the users who try to register with nickserv,
|
||||||
|
* including nick registration from grouping.
|
||||||
|
*
|
||||||
|
* If not set, then registration is not blocked.
|
||||||
*/
|
*/
|
||||||
disable_ns_register = false
|
#disable_register_reason = "To register on this network visit http://some.misconfigured.site/register"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The reason to give the users who try to /ns register if
|
* If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
|
||||||
* disable_ns_register is enabled.
|
* If not set, then email changing is not blocked.
|
||||||
*/
|
*/
|
||||||
#disable_reason = "To register on this network visit http://some.misconfigured.site/register"
|
#disable_email_reason = "To change your email address visit http://some.misconfigured.site"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* m_ldap_oper
|
* m_ldap_oper [EXTRA]
|
||||||
*
|
*
|
||||||
* This module dynamically ties users to Anope opertypes when they identify
|
* This module dynamically ties users to Anope opertypes when they identify
|
||||||
* via LDAP group membership. Requires m_ldap.
|
* via LDAP group membership. Requires m_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 Services.
|
||||||
*/
|
*/
|
||||||
#module { name = "m_ldap_oper" }
|
#module
|
||||||
m_ldap_oper
|
|
||||||
{
|
{
|
||||||
|
name = "m_ldap_oper"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An optional binddn to use when searching for groups.
|
* An optional binddn to use when searching for groups.
|
||||||
* %a is replaced with the account name of the user.
|
* %a is replaced with the account name of the user.
|
||||||
@@ -238,20 +355,100 @@ m_ldap_oper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* m_mysql
|
* m_mysql [EXTRA]
|
||||||
*
|
*
|
||||||
* This module allows other modules to use MySQL.
|
* This module allows other modules to use MySQL.
|
||||||
*/
|
*/
|
||||||
#module { name = "m_mysql" }
|
#module
|
||||||
mysql
|
|
||||||
{
|
{
|
||||||
/* The name of this service */
|
name = "m_mysql"
|
||||||
name = "mysql/main"
|
|
||||||
database = "anope"
|
mysql
|
||||||
server = "127.0.0.1"
|
{
|
||||||
username = "anope"
|
/* The name of this service. */
|
||||||
password = "mypassword"
|
name = "mysql/main"
|
||||||
port = 3306
|
database = "anope"
|
||||||
|
server = "127.0.0.1"
|
||||||
|
username = "anope"
|
||||||
|
password = "mypassword"
|
||||||
|
port = 3306
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* m_redis
|
||||||
|
*
|
||||||
|
* This module allows other modules to use Redis.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "m_redis"
|
||||||
|
|
||||||
|
/* A redis database */
|
||||||
|
redis
|
||||||
|
{
|
||||||
|
/* The name of this service */
|
||||||
|
name = "redis/main"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The redis database to use. New connections default to 0.
|
||||||
|
*/
|
||||||
|
db = 0
|
||||||
|
|
||||||
|
ip = "127.0.0.1"
|
||||||
|
port = 6379
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_regex_pcre [EXTRA]
|
||||||
|
*
|
||||||
|
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
|
||||||
|
*/
|
||||||
|
#module { name = "m_regex_pcre" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_regex_posix [EXTRA]
|
||||||
|
*
|
||||||
|
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
|
||||||
|
* This is likely the only regex module you will not need extra libraries for.
|
||||||
|
*/
|
||||||
|
#module { name = "m_regex_posix" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_regex_tre [EXTRA]
|
||||||
|
*
|
||||||
|
* Provides the regex engine regex/tre, which uses the TRE regex library.
|
||||||
|
*/
|
||||||
|
#module { name = "m_regex_tre" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_rewrite
|
||||||
|
*
|
||||||
|
* Allows rewriting commands sent to/from clients.
|
||||||
|
*/
|
||||||
|
#module { name = "m_rewrite" }
|
||||||
|
#command
|
||||||
|
{
|
||||||
|
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
|
||||||
|
|
||||||
|
/* Enable m_rewrite. */
|
||||||
|
rewrite = true
|
||||||
|
|
||||||
|
/* Source message to match. A $ can be used to match anything. */
|
||||||
|
rewrite_source = "CLEAR $ USERS"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Message to rewrite the source message to. A $ followed by a number, eg $0, gets
|
||||||
|
* replaced by the number-th word from the source_message, starting from 0.
|
||||||
|
*/
|
||||||
|
rewrite_target = "KICK $1 *"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The command description. This only shows up in HELP's output.
|
||||||
|
* Comment this option to prevent the command from showing in the
|
||||||
|
* HELP command.
|
||||||
|
*/
|
||||||
|
rewrite_description = "Clears all users from a channel"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -267,15 +464,16 @@ mysql
|
|||||||
* back to services. If services are able to connect through the proxy to itself
|
* back to services. If services are able to connect through the proxy to itself
|
||||||
* then it knows it is an insecure proxy, and will ban it.
|
* then it knows it is an insecure proxy, and will ban it.
|
||||||
*/
|
*/
|
||||||
#module { name = "m_proxyscan" }
|
#module
|
||||||
m_proxyscan
|
|
||||||
{
|
{
|
||||||
|
name = "m_proxyscan"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The target IP services tells the proxy to connect back to. This must be a publicly
|
* The target IP services tells the proxy to connect back to. This must be a publicly
|
||||||
* avaiable IP that remote proxies can connect to.
|
* available IP that remote proxies can connect to.
|
||||||
*/
|
*/
|
||||||
#target_ip = "127.0.0.1"
|
#target_ip = "127.0.0.1"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The port services tells the proxy to connect to.
|
* The port services tells the proxy to connect to.
|
||||||
*/
|
*/
|
||||||
@@ -296,7 +494,7 @@ m_proxyscan
|
|||||||
/*
|
/*
|
||||||
* An optional notice sent to clients upon connect.
|
* An optional notice sent to clients upon connect.
|
||||||
*/
|
*/
|
||||||
#connect_notice = "We will now scan your host for insecure proxies. If you do not consent to this scan please disconnect immediately"
|
#connect_notice = "We will now scan your host for insecure proxies. If you do not consent to this scan please disconnect immediately."
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Who the notice should be sent from.
|
* Who the notice should be sent from.
|
||||||
@@ -305,7 +503,7 @@ m_proxyscan
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, OperServ will add infected clients to the akill list. Without it, OperServ simply sends
|
* If set, OperServ will add infected clients to the akill list. Without it, OperServ simply sends
|
||||||
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
|
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being filled up by bots.
|
||||||
*/
|
*/
|
||||||
add_to_akill = yes
|
add_to_akill = yes
|
||||||
|
|
||||||
@@ -313,99 +511,109 @@ m_proxyscan
|
|||||||
* How long before connections should be timed out.
|
* How long before connections should be timed out.
|
||||||
*/
|
*/
|
||||||
timeout = 5
|
timeout = 5
|
||||||
|
|
||||||
|
proxyscan
|
||||||
|
{
|
||||||
|
/* The type of proxy to check for. A comma separated list is allowed. */
|
||||||
|
type = "HTTP"
|
||||||
|
|
||||||
|
/* The ports to check. */
|
||||||
|
port = "80,8080"
|
||||||
|
|
||||||
|
/* How long to set the ban for. */
|
||||||
|
time = 4h
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The reason to ban the user for.
|
||||||
|
* %h is replaced with the type of proxy found.
|
||||||
|
* %i is replaced with the IP of proxy found.
|
||||||
|
* %p is replaced with the port.
|
||||||
|
*/
|
||||||
|
reason = "You have an open proxy running on your host (%t:%i:%p)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A proxyscan block (must have m_proxyscan loaded).
|
* m_sasl
|
||||||
* You may have multiple proxyscan blocks.
|
*
|
||||||
|
* 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.
|
||||||
*/
|
*/
|
||||||
proxyscan
|
#module { name = "m_sasl" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_sasl_dh-aes [EXTRA]
|
||||||
|
*
|
||||||
|
* Add the DH-AES mechanism to SASL.
|
||||||
|
* Requires m_sasl to be loaded.
|
||||||
|
* Requires openssl.
|
||||||
|
*/
|
||||||
|
#module { name = "m_sasl_dh-aes" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_sasl_dh-blowfish [EXTRA]
|
||||||
|
*
|
||||||
|
* Add the DH-BLOWFISH mechanism to SASL.
|
||||||
|
* Requires m_sasl to be loaded.
|
||||||
|
* Requires openssl.
|
||||||
|
*/
|
||||||
|
#module { name = "m_sasl_dh-blowfish" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_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, bot not both.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
{
|
{
|
||||||
/* The type of proxy to check for. A comma separated list is allowed */
|
name = "m_ssl_gnutls"
|
||||||
type = "HTTP"
|
|
||||||
|
|
||||||
/* The ports to check */
|
|
||||||
port = "80,8080"
|
|
||||||
|
|
||||||
/* How long to set the ban for */
|
|
||||||
time = 4h
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The reason to ban the user for.
|
* An optional certificate and key for m_ssl_gnutls to give to the uplink.
|
||||||
* %h is replaced with the type of proxy found.
|
*
|
||||||
* %i is replaced with the IP of proxy found.
|
* You can generate your own certificate and key pair by using:
|
||||||
* %p is replaced with the port.
|
*
|
||||||
|
* certtool --generate-privkey --bits 2048 --outfile anope.key
|
||||||
|
* certtool --generate-self-signed --load-privkey anope.key --outfile anope.crt
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
reason = "You have an open proxy running on your host (%t:%i:%p)"
|
cert = "data/anope.crt"
|
||||||
}
|
key = "data/anope.key"
|
||||||
|
|
||||||
/*
|
|
||||||
* m_sqlite
|
|
||||||
*
|
|
||||||
* This module allows other modules to use SQLite.
|
|
||||||
*/
|
|
||||||
#module { name = "m_sqlite" }
|
|
||||||
sqlite
|
|
||||||
{
|
|
||||||
/* The name of this service */
|
|
||||||
name = "sqlite/main"
|
|
||||||
/* The database name, it will be created if it does not exist. */
|
|
||||||
database = "anope.db"
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* m_regex_pcre
|
|
||||||
*
|
|
||||||
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
|
|
||||||
*/
|
|
||||||
module { name = "m_regex_pcre" }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* m_regex_posix
|
|
||||||
*
|
|
||||||
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
|
|
||||||
* This is likely the only regex module you will not need extra libraries for.
|
|
||||||
*/
|
|
||||||
#module { name = "m_regex_posix" }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* m_regex_tre
|
|
||||||
*
|
|
||||||
* Provides the regex engine regex/tre, which uses the TRE regex library.
|
|
||||||
*/
|
|
||||||
#module { name = "m_regex_tre" }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* m_rewrite
|
|
||||||
*
|
|
||||||
* Allows rewriting commands sent to clients.
|
|
||||||
*/
|
|
||||||
#module { name = "m_rewrite" }
|
|
||||||
rewrite
|
|
||||||
{
|
|
||||||
/* The client to apply this rewrite to. */
|
|
||||||
client = "ChanServ"
|
|
||||||
|
|
||||||
/* Source message to match. A $ can be used to match anything. */
|
|
||||||
source_message = "CLEAR $ USERS"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Message to rewrite the source message to. A $ followed by a number, eg $0, gets
|
* Diffie-Hellman parameters to use when acting as a server. This is only
|
||||||
* replaced by the number-th word from the source_message, starting from 0.
|
* required for TLS servers that want to use ephemeral DH cipher suites.
|
||||||
|
*
|
||||||
|
* This is NOT required for Anope to connect to the uplink server(s) via SSL.
|
||||||
|
*
|
||||||
|
* You can generate DH parameters by using:
|
||||||
|
*
|
||||||
|
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
target_message = "CLEARUSERS $1"
|
# dhparams = "data/dhparams.pem"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* m_ssl
|
* m_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, bot not both.
|
||||||
*
|
*
|
||||||
* This module uses SSL to connect to the uplink server(s)
|
|
||||||
*/
|
*/
|
||||||
module { name = "m_ssl" }
|
#module
|
||||||
ssl
|
|
||||||
{
|
{
|
||||||
|
name = "m_ssl_openssl"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An optional certificate and key for m_ssl to give to the uplink.
|
* An optional certificate and key for m_ssl_openssl to give to the uplink.
|
||||||
*
|
*
|
||||||
* You can generate your own certificate and key pair by using:
|
* You can generate your own certificate and key pair by using:
|
||||||
*
|
*
|
||||||
@@ -414,62 +622,131 @@ ssl
|
|||||||
*/
|
*/
|
||||||
cert = "data/anope.crt"
|
cert = "data/anope.crt"
|
||||||
key = "data/anope.key"
|
key = "data/anope.key"
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* m_statusupdate
|
|
||||||
*
|
|
||||||
* This module automatically updates users status on channels when the
|
|
||||||
* channel's access list is modified.
|
|
||||||
*/
|
|
||||||
module { name = "m_statusupdate" }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 (m_xmlrpc_main) to receive and send XMLRPC queries.
|
|
||||||
*/
|
|
||||||
#module { name = "m_xmlrpc" }
|
|
||||||
m_xmlrpc
|
|
||||||
{
|
|
||||||
/* IP to listen on */
|
|
||||||
bindip = "127.0.0.1"
|
|
||||||
/* Port to listen on */
|
|
||||||
port = 26673
|
|
||||||
/* Enable for IPv6 */
|
|
||||||
ipv6 = no
|
|
||||||
/* If enabled, requires m_ssl to be loaded */
|
|
||||||
ssl = no
|
|
||||||
/* IPs allowed to connect (separate with spaces), this should be secured. We also recommend you firewall this
|
|
||||||
* with an outside program to increase security.
|
|
||||||
*/
|
|
||||||
allowed = "127.0.0.0/24"
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* m_xmlrpc_main
|
|
||||||
*
|
|
||||||
* Adds the main XMLRPC core functions.
|
|
||||||
* Requires m_xmlrpc.
|
|
||||||
*/
|
|
||||||
#module { name = "m_xmlrpc_main" }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_maxemail
|
|
||||||
*
|
|
||||||
* Limits how many times the same email address may be used in Anope
|
|
||||||
* to register accounts.
|
|
||||||
*/
|
|
||||||
module { name = "ns_maxemail" }
|
|
||||||
ns_maxemail
|
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
|
* As of 2014 SSL 3.0 is considered insecure, but it might be enabled
|
||||||
* commented, there will be no limit enforced when registering new accounts or using
|
* on some systems by default for compatibility reasons.
|
||||||
* /msg NickServ SET EMAIL.
|
* You can use the following option to enable or disable it explicitly.
|
||||||
|
* Leaving this option not set defaults to the default system behavior.
|
||||||
*/
|
*/
|
||||||
#maxemails = 1
|
#sslv3 = no
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_sql_authentication [EXTRA]
|
||||||
|
*
|
||||||
|
* This module allows authenticating users against an external SQL database using a custom
|
||||||
|
* query.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "m_sql_authentication"
|
||||||
|
|
||||||
|
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||||
|
engine = "mysql/main"
|
||||||
|
|
||||||
|
/* Query to execute to authenticate. A non empty result from this query is considered a success,
|
||||||
|
* and the user will be authenticated.
|
||||||
|
*
|
||||||
|
* @a@ is replaced with the user's account name
|
||||||
|
* @p@ is replaced with the user's password
|
||||||
|
* @n@ is replaced with the user's nickname
|
||||||
|
* @i@ is replaced with the user's IP
|
||||||
|
*
|
||||||
|
* Note that @n@ and @i@ may not always exist in the case of a user identifying outside of the normal
|
||||||
|
* nickserv/identify command, such as through the web panel.
|
||||||
|
*
|
||||||
|
* Furthermore, if a field named email is returned from this query the user's email is
|
||||||
|
* set to its value.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* We've included some example queries for some popular website/forum systems.
|
||||||
|
*
|
||||||
|
* Drupal 6: "SELECT `mail` AS `email` FROM `users` WHERE `name` = @a@ AND `pass` = MD5(@p@) AND `status` = 1"
|
||||||
|
* e107 cms: "SELECT `user_email` AS `email` FROM `e107_user` WHERE `user_loginname` = @a@ AND `user_password` = MD5(@p@)"
|
||||||
|
* SMF Forum: "SELECT `email_address` AS `email` FROM `smf_members` WHERE `member_name` = @a@ AND `passwd` = SHA1(CONCAT(LOWER(@a@), @p@))"
|
||||||
|
* vBulletin: "SELECT `email` FROM `user` WHERE `username` = @a@ AND `password` = MD5(CONCAT(MD5(@p@), `salt`))"
|
||||||
|
* IP.Board: "SELECT `email` FROM `ibf_members` WHERE `name` = @a@ AND `members_pass_hash` = MD5(CONCAT(MD5(`members_pass_salt`), MD5(@p@)))"
|
||||||
|
*/
|
||||||
|
query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, the reason to give the users who try to "/msg NickServ REGISTER".
|
||||||
|
* If not set, then registration is not blocked.
|
||||||
|
*/
|
||||||
|
#disable_reason = "To register on this network visit http://some.misconfigured.site/register"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
|
||||||
|
* If not set, then email changing is not blocked.
|
||||||
|
*/
|
||||||
|
#disable_email_reason = "To change your email address visit http://some.misconfigured.site"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_sql_log [EXTRA]
|
||||||
|
*
|
||||||
|
* This module adds an additional target option to log{} blocks
|
||||||
|
* that allows logging Service's logs to SQL. To log to SQL, add
|
||||||
|
* the SQL service name to log:targets prefixed by sql_log:. For
|
||||||
|
* example:
|
||||||
|
*
|
||||||
|
* log
|
||||||
|
* {
|
||||||
|
* targets = "services.log sql_log:mysql/main"
|
||||||
|
* ...
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* By default this module logs to the table `logs`, and will create
|
||||||
|
* it if it doesn't exist. This module does not create any indexes (keys)
|
||||||
|
* on the table and it is recommended you add them yourself as necessary.
|
||||||
|
*/
|
||||||
|
#module { name = "m_sql_log" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_sql_oper [EXTRA]
|
||||||
|
*
|
||||||
|
* This module allows granting users services operator privileges and possibly IRC Operator
|
||||||
|
* privileges based on an external SQL database using a custom query.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "m_sql_oper"
|
||||||
|
|
||||||
|
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||||
|
engine = "mysql/main"
|
||||||
|
|
||||||
|
/* Query to execute to determine if a user should have operator privileges.
|
||||||
|
* A field named opertype must be returned in order to link the user to their oper type.
|
||||||
|
* The oper types must be configured earlier in services.conf.
|
||||||
|
*
|
||||||
|
* If a field named modes is returned from this query then those modes are set on the user.
|
||||||
|
* Without this, only a simple +o is sent.
|
||||||
|
*
|
||||||
|
* @a@ is replaced with the user's account name
|
||||||
|
* @i@ is replaced with the user's IP
|
||||||
|
*/
|
||||||
|
query = "SELECT `opertype` FROM `my_users` WHERE `user_name` = @a@"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_sqlite [EXTRA]
|
||||||
|
*
|
||||||
|
* This module allows other modules to use SQLite.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "m_sqlite"
|
||||||
|
|
||||||
|
/* A SQLite database */
|
||||||
|
sqlite
|
||||||
|
{
|
||||||
|
/* The name of this service. */
|
||||||
|
name = "sqlite/main"
|
||||||
|
|
||||||
|
/* The database name, it will be created if it does not exist. */
|
||||||
|
database = "anope.db"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -481,17 +758,38 @@ ns_maxemail
|
|||||||
*
|
*
|
||||||
* This module requires m_httpd.
|
* This module requires m_httpd.
|
||||||
*/
|
*/
|
||||||
#module { name = "webcpanel" }
|
#module
|
||||||
webcpanel
|
|
||||||
{
|
{
|
||||||
/* Web server to use */
|
name = "webcpanel"
|
||||||
|
|
||||||
|
/* Web server to use. */
|
||||||
server = "httpd/main";
|
server = "httpd/main";
|
||||||
|
|
||||||
/* Template to use */
|
/* Template to use. */
|
||||||
template = "default";
|
template = "default";
|
||||||
|
|
||||||
/* Page title */
|
/* Page title. */
|
||||||
title = "Anope IRC Services";
|
title = "Anope IRC Services";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 (m_xmlrpc_main) to receive and send XMLRPC queries.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "m_xmlrpc"
|
||||||
|
|
||||||
|
/* Web service to use. Requires m_httpd. */
|
||||||
|
server = "httpd/main"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* m_xmlrpc_main
|
||||||
|
*
|
||||||
|
* Adds the main XMLRPC core functions.
|
||||||
|
* Requires m_xmlrpc.
|
||||||
|
*/
|
||||||
|
#module { name = "m_xmlrpc_main" }
|
||||||
|
|||||||
+324
-310
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* First, create the service.
|
* First, create the service.
|
||||||
* Note that an easy way to rename this service is to define{} the client name to something else.
|
|
||||||
*/
|
*/
|
||||||
service
|
service
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The name of the NickServ client
|
* The name of the NickServ client.
|
||||||
|
* If you change this value, you probably want to change the client directive in the configuration for the nickserv module too.
|
||||||
*/
|
*/
|
||||||
nick = "NickServ"
|
nick = "NickServ"
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ service
|
|||||||
* These modes are very IRCd specific. If left commented, sane defaults
|
* These modes are very IRCd specific. If left commented, sane defaults
|
||||||
* are used based on what protocol module you have loaded.
|
* are used based on what protocol module you have loaded.
|
||||||
*
|
*
|
||||||
* Note that setting this option incorrectly could potentially BREAK some if
|
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||||
* not all usefulness of the client. We will not support you if this client is
|
* not all, usefulness of the client. We will not support you if this client is
|
||||||
* unable to do certain things if this option is enabled.
|
* unable to do certain things if this option is enabled.
|
||||||
*/
|
*/
|
||||||
#modes = "+o"
|
#modes = "+o"
|
||||||
@@ -46,7 +46,7 @@ service
|
|||||||
* of log channels this is not very useful, as the service will just idle in the
|
* of log channels this is not very useful, as the service will just idle in the
|
||||||
* specified channels, and will not accept any types of commands.
|
* specified channels, and will not accept any types of commands.
|
||||||
*
|
*
|
||||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||||
*/
|
*/
|
||||||
#channels = "@#services,#mychan"
|
#channels = "@#services,#mychan"
|
||||||
}
|
}
|
||||||
@@ -56,44 +56,34 @@ service
|
|||||||
*
|
*
|
||||||
* Provides essential functionality for NickServ.
|
* Provides essential functionality for NickServ.
|
||||||
*/
|
*/
|
||||||
module { name = "nickserv" }
|
module
|
||||||
|
|
||||||
/*
|
|
||||||
* Configuration for NickServ provided by ns_main.
|
|
||||||
*/
|
|
||||||
nickserv
|
|
||||||
{
|
{
|
||||||
|
name = "nickserv"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The name of the client that should be NickServ.
|
* The name of the client that should be NickServ.
|
||||||
*/
|
*/
|
||||||
name = "NickServ"
|
client = "NickServ"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Force users to give an e-mail address when they register a nick.
|
* Force users to give an e-mail address when they register a nick.
|
||||||
*
|
*
|
||||||
* This directive is recommended to be enabled, and required if e-mail registration is enabled.
|
* This directive defaults to "yes" and is recommended to be enabled. This is required if e-mail registration is enabled.
|
||||||
*/
|
*/
|
||||||
forceemail = yes
|
forceemail = yes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Require users who change their email address to confirm they
|
* Require users who change their email address to confirm they
|
||||||
* own it.
|
* own their new email.
|
||||||
*/
|
*/
|
||||||
confirmemailchanges = no
|
confirmemailchanges = no
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Registration confirmation setting. Set to "none" for no registration confirmation,
|
* A message sent to users on connect if they use an unregistered nick.
|
||||||
* "mail" for email confirmation, and "admin" to have services operators manually confirm
|
|
||||||
* every registration. Set to "disable" to completely disable all registrations.
|
|
||||||
*/
|
|
||||||
registration = "none"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A message sent to users on connect if they user an unregistered nick.
|
|
||||||
*
|
*
|
||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
#unregistered_notice = "Your nickname is not registered. To register it use /nickserv register password email."
|
#unregistered_notice = "Your nickname is not registered. To register it, use: /msg NickServ REGISTER password email"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The default options for newly registered nicks. Note that changing these options
|
* The default options for newly registered nicks. Note that changing these options
|
||||||
@@ -101,38 +91,27 @@ nickserv
|
|||||||
* by spaces.
|
* by spaces.
|
||||||
*
|
*
|
||||||
* The options are:
|
* The options are:
|
||||||
* - kill: Kill nick if not identified within 60 seconds
|
* - killprotect: Kill nick if not identified within 60 seconds
|
||||||
* - killquick: Kill nick if not identified within 20 seconds, this one overrides the above
|
* - kill_quick: Kill nick if not identified within 20 seconds, this one overrides the above
|
||||||
* option and the above must be specified with this one
|
* option and the above must be specified with this one
|
||||||
* - secure: Enable nickname security, requiring the nick's password before any operations
|
* - ns_secure: Enable nickname security, requiring the nick's password before any operations
|
||||||
* can be done on it
|
* can be done on it
|
||||||
* - private: Hide the nick from NickServ's LIST command
|
* - ns_private: Hide the nick from NickServ's LIST command
|
||||||
* - hideemail: Hide's the nick's e-mail address from NickServ's INFO command
|
* - hide_email: Hide's the nick's e-mail address from NickServ's INFO command
|
||||||
* - hideusermask: Hide's the nick's last or current user@host from NickServ's INFO command
|
* - hide_mask: Hide's the nick's last or current user@host from NickServ's INFO command
|
||||||
* - hidequit: Hide's the nick's last quit message
|
* - hide_quit: Hide's the nick's last quit message
|
||||||
* - memosignon: Notify user if they have a new memo when they sign into the nick
|
* - memo_signon: Notify user if they have a new memo when they sign into the nick
|
||||||
* - memoreceive: Notify user if they have a new memo as soon as it's received
|
* - memo_receive: Notify user if they have a new memo as soon as it's received
|
||||||
* - autoop: User will be automatically opped in channels they enter and have access to
|
* - memo_mail: Notify user if they have a new memo by mail
|
||||||
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires UsePrivmsg
|
* - autoop: User will be automatically opped in channels they enter and have access to
|
||||||
* to be enabled as well
|
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires
|
||||||
|
* options:useprivmsg to be enabled as well
|
||||||
|
* - ns_keepmodes: Enables keepmodes, which retains user modes across sessions
|
||||||
*
|
*
|
||||||
* This directive is optional, if left blank, the options will default to secure, memosignon, and
|
* This directive is optional, if left blank, the options will default to ns_secure, memo_signon, and
|
||||||
* memoreceive. If you really want no defaults, use "none" by itself as the option.
|
* memo_receive. If you really want no defaults, use "none" by itself as the option.
|
||||||
*/
|
*/
|
||||||
defaults="secure private hideemail hideusermask memosignon memoreceive autoop"
|
defaults = "ns_secure ns_private hide_email hide_mask memo_signon memo_receive autoop"
|
||||||
|
|
||||||
/*
|
|
||||||
* A list of languages to load on startup that will be available in /nickserv set language.
|
|
||||||
* Useful if you translate Anope to your language. (Explained further in docs/LANGUAGE).
|
|
||||||
* Note that english should not be listed here because it is the base language.
|
|
||||||
*/
|
|
||||||
languages = "ca_ES de_DE el_GR es_ES fr_FR hu_HU it_IT nl_NL pl_PL pt_PT ru_RU tr_TR"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default language that non- and newly-registered nicks will receive messages in.
|
|
||||||
* Leave empty to default to English.
|
|
||||||
*/
|
|
||||||
#defaultlanguage = "es_ES"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
|
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
|
||||||
@@ -141,101 +120,20 @@ nickserv
|
|||||||
regdelay = 30s
|
regdelay = 30s
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The minimum length of time between consecutive uses of NickServ's RESEND command.
|
* The length of time before a nick's registration expires.
|
||||||
*
|
|
||||||
* This directive is optional, but recommended. If not set, this restriction will be disabled.
|
|
||||||
*/
|
|
||||||
resenddelay = 90s
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The length of time before a nick 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 21 days.
|
||||||
*/
|
*/
|
||||||
expire = 21d
|
expire = 21d
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The length of time before a suspended nick becomes unsuspended.
|
* Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND,
|
||||||
*
|
|
||||||
* This directive is optional. If not set, the default is to never.
|
|
||||||
*/
|
|
||||||
#suspendexpire = 90d
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The length of time a user using an unconfirmed account has
|
|
||||||
* before the account will be released for general use again.
|
|
||||||
*
|
|
||||||
* This directive is only required if the e-mail registration option is enabled.
|
|
||||||
*/
|
|
||||||
#unconfirmedexpire = 1d
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The maximum number of nicks allowed in a group.
|
|
||||||
*
|
|
||||||
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
|
|
||||||
*/
|
|
||||||
maxaliases = 16
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The maximum number of entries allowed on a nickname's access list.
|
|
||||||
*/
|
|
||||||
accessmax = 32
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The username (and possibly hostname) used for the fake user created when NickServ collides
|
|
||||||
* a user. Should be in the user@host format.
|
|
||||||
*/
|
|
||||||
enforceruser = "enforcer"
|
|
||||||
enforcerhost = "localhost.net"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The delay before a NickServ collided nick is released.
|
|
||||||
*/
|
|
||||||
releasetimeout = 1m
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Allow the use of the IMMED option in the NickServ SET KILL command.
|
|
||||||
*
|
|
||||||
* This directive is optional.
|
|
||||||
*/
|
|
||||||
#allowkillimmed = yes
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If set, the NickServ GROUP command won't allow any group change. This is recommended for
|
|
||||||
* better performance and to protect against nick stealing, however users will have less
|
|
||||||
* flexibility.
|
|
||||||
*
|
|
||||||
* This directive is optional, but recommended.
|
|
||||||
*/
|
|
||||||
#nogroupchange = yes
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The maximum number of nicks to be returned for a NickServ LIST command.
|
|
||||||
*/
|
|
||||||
listmax = 50
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
guestnickprefix = "Guest"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Prevents the use of the ACCESS (excluding the LIST subcommand), DROP, FORBID, SUSPEND,
|
|
||||||
* GETPASS and SET PASSWORD commands by services operators on other services operators.
|
* GETPASS and SET PASSWORD commands by services operators on other services operators.
|
||||||
*
|
*
|
||||||
* This directive is optional, but recommended.
|
* This directive is optional, but recommended.
|
||||||
*/
|
*/
|
||||||
secureadmins = yes
|
secureadmins = yes
|
||||||
|
|
||||||
/*
|
|
||||||
* If set, any user wanting to use the privileges of Services Root, Services Admin, or Services
|
|
||||||
* Operator must have been logged as an IRC Operator with the /oper command.
|
|
||||||
*
|
|
||||||
* This directive is optional, but recommended.
|
|
||||||
*/
|
|
||||||
strictprivileges = yes
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, Services will set the channel modes a user has access to upon identifying, assuming
|
* If set, Services will set the channel modes a user has access to upon identifying, assuming
|
||||||
* they are not already set.
|
* they are not already set.
|
||||||
@@ -245,17 +143,73 @@ nickserv
|
|||||||
modeonid = yes
|
modeonid = yes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, Services will add the usermask of registering users to the access list of their
|
* If set, Services will set these user modes on any user who identifies.
|
||||||
* 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.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
addaccessonreg = yes
|
#modesonid = "+R"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The maximum number of channels a user can have on NickServ's AJOIN command.
|
* If set, Services will not show netsplits in the last quit message field
|
||||||
|
* of NickServ's INFO command.
|
||||||
*/
|
*/
|
||||||
ajoinmax = 10
|
hidenetsplitquit = no
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, is the length of time NickServ's killquick and kill options wait before
|
||||||
|
* forcing users off of protected nicknames.
|
||||||
|
*/
|
||||||
|
killquick = 20s
|
||||||
|
kill = 60s
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, forbids the registration of nicks that contain an existing
|
||||||
|
* nick with Services access. For example, if Tester is a Services Oper,
|
||||||
|
* you can't register NewTester or Tester123 unless you are an IRC
|
||||||
|
* Operator.
|
||||||
|
*
|
||||||
|
* NOTE: If you enable this, you will have to be logged in as an IRC
|
||||||
|
* operator in order to register a Services Root nick when setting up
|
||||||
|
* Anope for the first time.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
#restrictopernicks = yes
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The username, and possibly hostname, used for fake users created when Services needs to
|
||||||
|
* hold a nickname.
|
||||||
|
*/
|
||||||
|
enforceruser = "enforcer"
|
||||||
|
enforcerhost = "services.host"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The length of time Services hold nicknames.
|
||||||
|
*
|
||||||
|
* This directive is optional, but recommended. If not set it defaults to 1 minute.
|
||||||
|
*/
|
||||||
|
releasetimeout = 1m
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When a user's nick is forcibly changed to enforce a "nick kill", their new nick will start
|
||||||
|
* with this value. The rest will be made up of 6 or 7 digits.
|
||||||
|
* Make sure this is a valid nick and Nicklen+7 is not longer than the allowed Nicklen on your ircd.
|
||||||
|
*
|
||||||
|
* This directive is optional. If not set it defaults to "Guest"
|
||||||
|
*/
|
||||||
|
guestnickprefix = "Guest"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, Services do not allow ownership of nick names, only ownership of accounts.
|
||||||
|
*/
|
||||||
|
nonicknameownership = no
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum length of passwords
|
||||||
|
*
|
||||||
|
* This directive is optional. If not set it defaults to 32.
|
||||||
|
*/
|
||||||
|
passlen = 32
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -266,10 +220,21 @@ nickserv
|
|||||||
*
|
*
|
||||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||||
*
|
*
|
||||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behaviour.
|
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Give it a help command */
|
/* Command group configuration for NickServ.
|
||||||
|
*
|
||||||
|
* Commands may optionally be placed into groups to make NickServ's HELP output easier to understand.
|
||||||
|
* Remove the following groups to use the old behavior of simply listing all NickServ commands from HELP.
|
||||||
|
*/
|
||||||
|
command_group
|
||||||
|
{
|
||||||
|
name = "nickserv/admin"
|
||||||
|
description = _("Services Operator commands")
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Give it a help command. */
|
||||||
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -279,7 +244,24 @@ command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
|||||||
*
|
*
|
||||||
* Used for configuring what hosts have access to your account.
|
* Used for configuring what hosts have access to your account.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_access" }
|
module
|
||||||
|
{
|
||||||
|
name = "ns_access"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of entries allowed on a nickname's access list.
|
||||||
|
* If not set, the default is 32. This number cannot be set to 0.
|
||||||
|
*/
|
||||||
|
accessmax = 32
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, Services will add the usermask of registering users to the access list of their
|
||||||
|
* newly created account. If not set, users will always have to identify to NickServ before
|
||||||
|
* being recognized, unless they manually add an address to the access list of their account.
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
addaccessonreg = yes
|
||||||
|
}
|
||||||
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
|
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -289,7 +271,15 @@ command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
|
|||||||
*
|
*
|
||||||
* Used for configuring channels to join once you identify.
|
* Used for configuring channels to join once you identify.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_ajoin" }
|
module
|
||||||
|
{
|
||||||
|
name = "ns_ajoin"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of channels a user can have on NickServ's AJOIN command.
|
||||||
|
*/
|
||||||
|
ajoinmax = 10
|
||||||
|
}
|
||||||
command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
|
command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -309,7 +299,16 @@ command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
|
|||||||
*
|
*
|
||||||
* Used for configuring your SSL certificate list, which can be used to automatically identify you.
|
* Used for configuring your SSL certificate list, which can be used to automatically identify you.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_cert" }
|
module
|
||||||
|
{
|
||||||
|
name = "ns_cert"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
|
||||||
|
* The default is 5. This number cannot be set to 0.
|
||||||
|
*/
|
||||||
|
max = 5
|
||||||
|
}
|
||||||
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
|
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -330,7 +329,7 @@ command { service = "NickServ"; name = "DROP"; command = "nickserv/drop"; }
|
|||||||
* Used for getting registered accounts by searching for emails.
|
* Used for getting registered accounts by searching for emails.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_getemail" }
|
module { name = "ns_getemail" }
|
||||||
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; }
|
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; group = "nickserv/admin"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_getpass
|
* ns_getpass
|
||||||
@@ -344,16 +343,6 @@ command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"
|
|||||||
#module { name = "ns_getpass" }
|
#module { name = "ns_getpass" }
|
||||||
#command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; permission = "nickserv/getpass"; }
|
#command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; permission = "nickserv/getpass"; }
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_ghost
|
|
||||||
*
|
|
||||||
* Provides the command nickserv/ghost.
|
|
||||||
*
|
|
||||||
* Used for disconnecting "ghost" sessions.
|
|
||||||
*/
|
|
||||||
module { name = "ns_ghost" }
|
|
||||||
command { service = "NickServ"; name = "GHOST"; command = "nickserv/ghost"; }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_group
|
* ns_group
|
||||||
*
|
*
|
||||||
@@ -361,7 +350,26 @@ command { service = "NickServ"; name = "GHOST"; command = "nickserv/ghost"; }
|
|||||||
*
|
*
|
||||||
* Used for controlling nick groups.
|
* Used for controlling nick groups.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_group" }
|
module
|
||||||
|
{
|
||||||
|
name = "ns_group"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of nicks allowed in a group.
|
||||||
|
*
|
||||||
|
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
|
||||||
|
*/
|
||||||
|
maxaliases = 16
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
|
||||||
|
* prevent users from accidentally dropping their nicks, as it forces users to explicitly
|
||||||
|
* drop their nicks before adding it to another group.
|
||||||
|
*
|
||||||
|
* This directive is optional, but recommended.
|
||||||
|
*/
|
||||||
|
nogroupchange = yes
|
||||||
|
}
|
||||||
command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist"; }
|
command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist"; }
|
||||||
command { service = "NickServ"; name = "GROUP"; command = "nickserv/group"; }
|
command { service = "NickServ"; name = "GROUP"; command = "nickserv/group"; }
|
||||||
command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup"; }
|
command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup"; }
|
||||||
@@ -374,29 +382,47 @@ command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup";
|
|||||||
* Used for identifying to accounts.
|
* Used for identifying to accounts.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_identify" }
|
module { name = "ns_identify" }
|
||||||
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; }
|
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; hide = true; }
|
||||||
command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"; }
|
command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_info
|
* ns_info
|
||||||
*
|
*
|
||||||
* Provides the command nickserv/info.
|
* Provides the commands:
|
||||||
|
* nickserv/info. - Used for gathering information about an account.
|
||||||
|
* nickserv/set/hide, nickserv/saset/hide - Used for configuring which options are publically shown in nickserv/info.
|
||||||
*
|
*
|
||||||
* Used for gathering information about an account.
|
|
||||||
*/
|
*/
|
||||||
module { name = "ns_info" }
|
module { name = "ns_info" }
|
||||||
command { service = "NickServ"; name = "INFO"; command = "nickserv/info"; }
|
command { service = "NickServ"; name = "INFO"; command = "nickserv/info"; }
|
||||||
|
|
||||||
|
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
|
||||||
|
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; }
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_list
|
* ns_list
|
||||||
*
|
*
|
||||||
* Provides the command nickserv/list.
|
* Provides the commands:
|
||||||
|
* nickserv/list - Used for retrieving and searching the registered account list.
|
||||||
|
* nickserv/set/private, nickserv/saset/private - Used for configuring whether or a users account shows up in nickserv/list.
|
||||||
*
|
*
|
||||||
* Used for retrieving and searching the registered account list.
|
|
||||||
*/
|
*/
|
||||||
module { name = "ns_list" }
|
module
|
||||||
|
{
|
||||||
|
name = "ns_list"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum number of nicks to be returned for a NickServ LIST command.
|
||||||
|
*/
|
||||||
|
listmax = 50
|
||||||
|
}
|
||||||
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; }
|
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; }
|
||||||
|
|
||||||
|
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
|
||||||
|
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; }
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_logout
|
* ns_logout
|
||||||
*
|
*
|
||||||
@@ -412,10 +438,24 @@ command { service = "NickServ"; name = "LOGOUT"; command = "nickserv/logout"; }
|
|||||||
*
|
*
|
||||||
* Provides the command nickserv/recover.
|
* Provides the command nickserv/recover.
|
||||||
*
|
*
|
||||||
* Used for forcing someone on your nick to a guest nick.
|
* Used for recovering your nick from services or another user.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_recover" }
|
module
|
||||||
|
{
|
||||||
|
name = "ns_recover"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, Services will svsnick and svsjoin users who use the recover
|
||||||
|
* command on an identified user to the nick and channels of the recovered user.
|
||||||
|
*
|
||||||
|
* This directive is opional.
|
||||||
|
*/
|
||||||
|
restoreonrecover = yes
|
||||||
|
}
|
||||||
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
|
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
|
||||||
|
# Uncomment below to emulate 1.8's behavior of ghost and release.
|
||||||
|
#command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; }
|
||||||
|
#command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_register
|
* ns_register
|
||||||
@@ -424,21 +464,42 @@ command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover";
|
|||||||
*
|
*
|
||||||
* Used for registering accounts.
|
* Used for registering accounts.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_register" }
|
module
|
||||||
|
{
|
||||||
|
name = "ns_register"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Registration confirmation setting. Set to "none" for no registration confirmation,
|
||||||
|
* "mail" for email confirmation, and "admin" to have services operators manually confirm
|
||||||
|
* every registration. Set to "disable" to completely disable all registrations.
|
||||||
|
*/
|
||||||
|
registration = "none"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The minimum length of time between consecutive uses of NickServ's RESEND command.
|
||||||
|
*
|
||||||
|
* This directive is optional, but recommended. If not set, this restriction will be disabled.
|
||||||
|
*/
|
||||||
|
resenddelay = 90s
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prevents users from registering their nick if they are not connected
|
||||||
|
* for at least the given number of seconds.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
#nickregdelay = 30s
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The length of time a user using an unconfirmed account has
|
||||||
|
* before the account will be released for general use again.
|
||||||
|
*/
|
||||||
|
#unconfirmedexpire = 1d
|
||||||
|
}
|
||||||
command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm"; }
|
command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm"; }
|
||||||
command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register"; }
|
command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register"; }
|
||||||
command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; }
|
command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; }
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_release
|
|
||||||
*
|
|
||||||
* Provides the command nickserv/release.
|
|
||||||
*
|
|
||||||
* Used for releasing names held by nickserv/recover.
|
|
||||||
*/
|
|
||||||
module { name = "ns_release" }
|
|
||||||
command { service = "NickServ"; name = "RELEASE"; command = "nickserv/release"; }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_resetpass
|
* ns_resetpass
|
||||||
*
|
*
|
||||||
@@ -449,159 +510,66 @@ command { service = "NickServ"; name = "RELEASE"; command = "nickserv/release";
|
|||||||
module { name = "ns_resetpass" }
|
module { name = "ns_resetpass" }
|
||||||
command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass"; }
|
command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass"; }
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_saset
|
|
||||||
*
|
|
||||||
* Provides commands nickserv/saset, nickserv/saset/password.
|
|
||||||
*
|
|
||||||
* Used as a help wrapper for SASET commands, and used to force change users password.
|
|
||||||
*/
|
|
||||||
module { name = "ns_saset" }
|
|
||||||
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; }
|
|
||||||
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_saset_noexpire
|
|
||||||
*
|
|
||||||
* Provides the command nickserv/saset/noexpire.
|
|
||||||
*
|
|
||||||
* Used for configuring noexpire, which prevents nicks from expiring.
|
|
||||||
*/
|
|
||||||
module { name = "ns_saset_noexpire" }
|
|
||||||
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire" }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_set
|
* ns_set
|
||||||
*
|
*
|
||||||
* Provides the commands nickserv/set, nickserv/set/password.
|
* Provides the commands:
|
||||||
*
|
* nickserv/set, nickserv/saset - Dummy help wrappers for the SET and SASET commands.
|
||||||
* Used as a help wrapper for SET commands, and used for users to change their password.
|
* nickserv/set/autoop, nickserv/saset/autoop - Determines whether or not modes are automatically set users when joining a channel.
|
||||||
|
* nickserv/set/display, nickserv/saset/display - Used for setting a users display name.
|
||||||
|
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
|
||||||
|
* nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
|
||||||
|
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
|
||||||
|
* nickserv/set/language, nickserv/saset/language - Used for configuring what language services use.
|
||||||
|
* nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you.
|
||||||
|
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
|
||||||
|
* nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access.
|
||||||
|
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_set" }
|
module
|
||||||
command { service = "NickServ"; name = "SET"; command = "nickserv/set"; }
|
{
|
||||||
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
|
name = "ns_set"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allow the use of the IMMED option in the NickServ SET KILL command.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
#allowkillimmed = yes
|
||||||
|
}
|
||||||
|
|
||||||
|
command { service = "NickServ"; name = "SET"; command = "nickserv/set"; }
|
||||||
|
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin"; }
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_set_autoop
|
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/autoop and nickserv/saset/autoop.
|
|
||||||
*
|
|
||||||
* Used for setting autoop, which determines whether or not modes are automatically set on you when joining a channel.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_autoop" }
|
|
||||||
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; }
|
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; }
|
||||||
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; }
|
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; }
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_set_display
|
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/display and nickserv/saset/display.
|
|
||||||
*
|
|
||||||
* Used for setting users display names.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_display" }
|
|
||||||
command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; }
|
command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; }
|
||||||
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; }
|
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; }
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_set_email
|
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/email and nickserv/saset/email.
|
|
||||||
*
|
|
||||||
* Used for setting users email addresses.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_email" }
|
|
||||||
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; }
|
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 = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; }
|
||||||
|
|
||||||
/*
|
command { service = "NickServ"; name = "SET KEEPMODES"; command = "nickserv/set/keepmodes"; }
|
||||||
* ns_set_greet
|
command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/saset/keepmodes"; permission = "nickserv/saset/keepmodes"; }
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/greet and nickserv/saset/greet.
|
|
||||||
*
|
|
||||||
* Used for changing users greet message, which is displayed when they enter channels.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_greet" }
|
|
||||||
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; }
|
|
||||||
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_set_hide
|
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/hide and nickserv/saset/hide.
|
|
||||||
*
|
|
||||||
* Used for configuring which options are publically shown in nickserv/info for your account.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_hide" }
|
|
||||||
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
|
|
||||||
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_set_kill
|
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/kill and nickserv/saset/kill.
|
|
||||||
*
|
|
||||||
* Used for configuring if and for how long other users are allowed to use your nick.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_kill" }
|
|
||||||
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
|
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 = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_set_language
|
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/language and nickserv/saset/language.
|
|
||||||
*
|
|
||||||
* Used for configuring what language services use when messaging you.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_language" }
|
|
||||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/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"; }
|
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.
|
|
||||||
*
|
|
||||||
* Used to configure how services send messages to you.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_message" }
|
|
||||||
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/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"; }
|
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
||||||
|
|
||||||
/*
|
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
|
||||||
* ns_set_private
|
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; }
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/private and nickserv/saset/private.
|
|
||||||
*
|
|
||||||
* Used for configuring whether or not your account shows up in nickserv/list.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_private" }
|
|
||||||
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
|
|
||||||
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ns_set_secure
|
|
||||||
*
|
|
||||||
* Provides the commands nickserv/set/secure and nickserv/saset/secure.
|
|
||||||
*
|
|
||||||
* Used for configuring whether you can gain access to your nick by simply being recognized by nickserv/access.
|
|
||||||
*/
|
|
||||||
module { name = "ns_set_secure" }
|
|
||||||
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
|
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
|
||||||
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
|
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
|
||||||
|
|
||||||
/*
|
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
|
||||||
* ns_sendpass
|
|
||||||
*
|
|
||||||
* Provides the command nickserv/sendpass.
|
|
||||||
*
|
|
||||||
* Used to send users their password via email.
|
|
||||||
*
|
|
||||||
* Requires that no encryption is being used.
|
|
||||||
*/
|
|
||||||
module { name = "ns_sendpass" }
|
|
||||||
command { service = "NickServ"; name = "SENDPASS"; command = "nickserv/sendpass"; permission = "nickserv/sendpass"; }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_set_misc
|
* ns_set_misc
|
||||||
@@ -609,10 +577,17 @@ command { service = "NickServ"; name = "SENDPASS"; command = "nickserv/sendpass"
|
|||||||
* Provides the command nickserv/set/misc.
|
* Provides the command nickserv/set/misc.
|
||||||
*
|
*
|
||||||
* Allows you to create arbitrary commands to set data, and have that data show up in nickserv/info.
|
* Allows you to create arbitrary commands to set data, and have that data show up in nickserv/info.
|
||||||
|
* A field named misc_description may be given for use with help output.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_set_misc" }
|
module { name = "ns_set_misc" }
|
||||||
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; }
|
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; misc_description = _("Associate a URL with your account"); }
|
||||||
command { service = "NickServ"; name = "SET ICQ"; 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 ICQ"; command = "nickserv/set/misc"; misc_description = _("Associate an ICQ account with your account"); }
|
||||||
|
#command { service = "NickServ"; name = "SASET ICQ"; command = "nickserv/saset/misc"; misc_description = _("Associate an ICQ account with this account"); permission = "nickserv/saset/icq"; group = "nickserv/admin"; }
|
||||||
|
#command { service = "NickServ"; name = "SET TWITTER"; command = "nickserv/set/misc"; misc_description = _("Associate a Twitter account with your account"); }
|
||||||
|
#command { service = "NickServ"; name = "SASET TWITTER"; command = "nickserv/saset/misc"; misc_description = _("Associate a Twitter account with this account"); permission = "nickserv/saset/twitter"; group = "nickserv/admin"; }
|
||||||
|
#command { service = "NickServ"; name = "SET FACEBOOK"; command = "nickserv/set/misc"; misc_description = _("Associate a Facebook URL with your account"); }
|
||||||
|
#command { service = "NickServ"; name = "SASET FACEBOOK"; command = "nickserv/saset/misc"; misc_description = _("Associate a Facebook URL with this account"); permission = "nickserv/saset/facebook"; group = "nickserv/admin"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_status
|
* ns_status
|
||||||
@@ -629,11 +604,28 @@ command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
|
|||||||
*
|
*
|
||||||
* Provides the commands nickserv/suspend and nickserv/unsuspend.
|
* Provides the commands nickserv/suspend and nickserv/unsuspend.
|
||||||
*
|
*
|
||||||
* Used to suspend and unsuspend nicknames. Suspended nicknames can not be used but their settings are stored.
|
* Used to suspend and unsuspend nicknames. Suspended nicknames can not be used but their settings are preserved.
|
||||||
*/
|
*/
|
||||||
module { name = "ns_suspend" }
|
module
|
||||||
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; }
|
{
|
||||||
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; }
|
name = "ns_suspend"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The length of time before a suspended nick becomes unsuspended.
|
||||||
|
*
|
||||||
|
* This directive is optional. If not set, the default is never.
|
||||||
|
*/
|
||||||
|
#suspendexpire = 90d
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Settings to show to non-opers in NickServ's INFO output.
|
||||||
|
* Comment to completely disable showing any information about
|
||||||
|
* suspended nicknames to non-opers.
|
||||||
|
*/
|
||||||
|
show = "suspended, by, reason, on, expires"
|
||||||
|
}
|
||||||
|
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
|
||||||
|
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_update
|
* ns_update
|
||||||
@@ -645,3 +637,25 @@ command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspen
|
|||||||
module { name = "ns_update" }
|
module { name = "ns_update" }
|
||||||
command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
|
command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Extra NickServ related modules.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ns_maxemail
|
||||||
|
*
|
||||||
|
* Limits how many times the same email address may be used in Anope
|
||||||
|
* to register accounts.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "ns_maxemail"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
|
||||||
|
* commented, there will be no limit enforced when registering new accounts or using
|
||||||
|
* /msg NickServ SET EMAIL.
|
||||||
|
*/
|
||||||
|
maxemails = 1
|
||||||
|
}
|
||||||
|
|||||||
+237
-129
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* First, create the service.
|
* First, create the service.
|
||||||
* Note that an easy way to rename this service is to define{} the client name to something else.
|
|
||||||
*/
|
*/
|
||||||
service
|
service
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The name of the OperServ client
|
* The name of the OperServ client.
|
||||||
|
* If you change this value, you probably want to change the client directive in the configuration for the operserv module too.
|
||||||
*/
|
*/
|
||||||
nick = "OperServ"
|
nick = "OperServ"
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ service
|
|||||||
* These modes are very IRCd specific. If left commented, sane defaults
|
* These modes are very IRCd specific. If left commented, sane defaults
|
||||||
* are used based on what protocol module you have loaded.
|
* are used based on what protocol module you have loaded.
|
||||||
*
|
*
|
||||||
* Note that setting this option incorrectly could potentially BREAK some if
|
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||||
* not all usefulness of the client. We will not support you if this client is
|
* not all, usefulness of the client. We will not support you if this client is
|
||||||
* unable to do certain things if this option is enabled.
|
* unable to do certain things if this option is enabled.
|
||||||
*/
|
*/
|
||||||
#modes = "+o"
|
#modes = "+o"
|
||||||
@@ -46,7 +46,7 @@ service
|
|||||||
* of log channels this is not very useful, as the service will just idle in the
|
* of log channels this is not very useful, as the service will just idle in the
|
||||||
* specified channels, and will not accept any types of commands.
|
* specified channels, and will not accept any types of commands.
|
||||||
*
|
*
|
||||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||||
*/
|
*/
|
||||||
#channels = "@#services,#mychan"
|
#channels = "@#services,#mychan"
|
||||||
}
|
}
|
||||||
@@ -56,25 +56,14 @@ service
|
|||||||
*
|
*
|
||||||
* Provides essential functionality for OperServ.
|
* Provides essential functionality for OperServ.
|
||||||
*/
|
*/
|
||||||
module { name = "operserv" }
|
module
|
||||||
|
|
||||||
/*
|
|
||||||
* Configuration for OperServ provided by os_main.
|
|
||||||
*/
|
|
||||||
operserv
|
|
||||||
{
|
{
|
||||||
|
name = "operserv"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The name of the client that should be OperServ.
|
* The name of the client that should be OperServ.
|
||||||
*/
|
*/
|
||||||
name = "OperServ"
|
client = "OperServ"
|
||||||
|
|
||||||
/*
|
|
||||||
* If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant
|
|
||||||
* them extra privileges such as being a founder on ALL channels.
|
|
||||||
*
|
|
||||||
* This directive is optional.
|
|
||||||
*/
|
|
||||||
#superadmin = yes
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These define the default expiration times for, respectively, AKILLs, CHANKILLs, SNLINEs,
|
* These define the default expiration times for, respectively, AKILLs, CHANKILLs, SNLINEs,
|
||||||
@@ -84,7 +73,6 @@ operserv
|
|||||||
chankillexpiry = 30d
|
chankillexpiry = 30d
|
||||||
snlineexpiry = 30d
|
snlineexpiry = 30d
|
||||||
sqlineexpiry = 30d
|
sqlineexpiry = 30d
|
||||||
szlineexpiry = 30d
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, this option will make Services send an AKILL command immediately after it has been
|
* If set, this option will make Services send an AKILL command immediately after it has been
|
||||||
@@ -99,9 +87,9 @@ operserv
|
|||||||
* If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD.
|
* If set, this option will make Services send an (SVS)KILL command immediately after SNLINE ADD.
|
||||||
* This eliminates the need for killing the user after the SNLINE has been added.
|
* This eliminates the need for killing the user after the SNLINE has been added.
|
||||||
*
|
*
|
||||||
*This directive is optional.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
#killonsnline = yes
|
killonsnline = yes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD.
|
* If set, this option will make Services send an (SVS)KILL command immediately after SQLINE ADD.
|
||||||
@@ -109,80 +97,7 @@ operserv
|
|||||||
*
|
*
|
||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
#killonsqline = yes
|
killonsqline = yes
|
||||||
|
|
||||||
/*
|
|
||||||
* Enables session limiting. Session limiting prevents users from connecting more than a certain
|
|
||||||
* number of times from the same host at the same time - thus preventing most types of cloning.
|
|
||||||
* Once a host reaches it's session limit, all clients attempting to connect from that host will
|
|
||||||
* be killed. Exceptions to the default session limit can be defined via the exception list. It
|
|
||||||
* should be noted that session limiting, along with a large exception list, can degrade Services'
|
|
||||||
* performance.
|
|
||||||
*
|
|
||||||
* See the online help for more information about session limiting.
|
|
||||||
*
|
|
||||||
* This directive is optional.
|
|
||||||
*/
|
|
||||||
limitsessions = yes
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Default session limit per host. Once a host reaches it's session limit, all clients attempting
|
|
||||||
* to connect from that host will be killed. A value of zero means an unlimited session limit.
|
|
||||||
*
|
|
||||||
* This directive is optional.
|
|
||||||
* If not given and session limiting is enabled, it will default to no limit.
|
|
||||||
*/
|
|
||||||
defaultsessionlimit = 3
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The maximum session limit that may be set for a host in an exception.
|
|
||||||
*
|
|
||||||
* This directive is only required if session limiting is enabled.
|
|
||||||
*/
|
|
||||||
maxsessionlimit = 100
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sets the default expiry time for session exceptions.
|
|
||||||
*
|
|
||||||
* This directive is only required if session limiting is enabled.
|
|
||||||
*/
|
|
||||||
exceptionexpiry = 1d
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The message that will be NOTICE'd to a user just before they are removed from the network because
|
|
||||||
* their host's session limit has been exceeded. It may be used to give a slightly more descriptive
|
|
||||||
* reason for the impending kill as opposed to simply "Session limit exceeded".
|
|
||||||
*
|
|
||||||
* This directive is optional, if not set, nothing will be sent.
|
|
||||||
*/
|
|
||||||
sessionlimitexceeded = "The session limit for your host %s has been exceeded."
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Same as above, but should be used to provide a website address where users can find out more
|
|
||||||
* about session limits and how to go about applying for an exception.
|
|
||||||
*
|
|
||||||
* Note: This directive has been intentionally commented out in an effort to remind you to change
|
|
||||||
* the URL it contains. It is recommended that you supply an address/URL where people can get help
|
|
||||||
* regarding session limits.
|
|
||||||
*
|
|
||||||
* This directive is optional, if not set, nothing will be sent.
|
|
||||||
*/
|
|
||||||
#sessionlimitdetailsloc = "Please visit http://your.website.url/ for more information about session limits."
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If set and is not 0, this directive tells Services to add an AKILL the number of subsequent kills
|
|
||||||
* for the same host exceeds this value, preventing the network from experiencing KILL floods.
|
|
||||||
*
|
|
||||||
* This directive is optional.
|
|
||||||
*/
|
|
||||||
maxsessionkill = 15
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Sets the expiry time for AKILLs set for hosts exceeding the maxsessionkill directive limit.
|
|
||||||
*
|
|
||||||
* This directive is optional, if not set, defaults to 30 minutes.
|
|
||||||
*/
|
|
||||||
sessionautokillexpiry = 30m
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adds the nickname of the IRC Operator issuing an AKILL to the kill reason.
|
* Adds the nickname of the IRC Operator issuing an AKILL to the kill reason.
|
||||||
@@ -198,8 +113,7 @@ operserv
|
|||||||
akillids = yes
|
akillids = yes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, only IRC Operators will be permitted to use OperServ, regardless of module-based command
|
* If set, only IRC Operators will be permitted to use OperServ, regardless of command access restrictions.
|
||||||
* access restrictions.
|
|
||||||
*
|
*
|
||||||
* This directive is optional, but recommended.
|
* This directive is optional, but recommended.
|
||||||
*/
|
*/
|
||||||
@@ -217,7 +131,7 @@ operserv
|
|||||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Give it a help command */
|
/* Give it a help command. */
|
||||||
command { service = "OperServ"; name = "HELP"; command = "generic/help"; }
|
command { service = "OperServ"; name = "HELP"; command = "generic/help"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -248,10 +162,10 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
|
|||||||
* Allows you to set services in defcon mode, which can be used to restrict services access
|
* Allows you to set services in defcon mode, which can be used to restrict services access
|
||||||
* during bot attacks.
|
* during bot attacks.
|
||||||
*/
|
*/
|
||||||
#module { name = "os_defcon" }
|
#module
|
||||||
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; }
|
|
||||||
defcon
|
|
||||||
{
|
{
|
||||||
|
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 Services up. Level 5 constitutes normal operation
|
||||||
* while level 1 constitutes the most restrictive operation. If this setting is left out or set to
|
* while level 1 constitutes the most restrictive operation. If this setting is left out or set to
|
||||||
@@ -298,7 +212,7 @@ defcon
|
|||||||
* the mode setting selected, Services will set the reverse on all channels, e.g. if this setting
|
* the mode setting selected, Services will set the reverse on all channels, e.g. if this setting
|
||||||
* is +RN when DefCon is used, all channels will be set to +RN, when DefCon is removed, all
|
* 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
|
* channels will be set to -RN. You don't want to set this to +k for example, because when DefCon
|
||||||
* is removed all channels with -k.
|
* is removed, all channels are set -k, removing the key from previously keyed channels.
|
||||||
*
|
*
|
||||||
* Note 2: MLOCKed modes will not be lost.
|
* Note 2: MLOCKed modes will not be lost.
|
||||||
*/
|
*/
|
||||||
@@ -332,7 +246,7 @@ defcon
|
|||||||
*
|
*
|
||||||
* This directive is required only when globalondefconmore is set.
|
* This directive is required only when globalondefconmore is set.
|
||||||
*/
|
*/
|
||||||
#message = "Put your message to send your users here. Dont forget to uncomment globalondefconmore"
|
#message = "Put your message to send your users here. Don't forget to uncomment globalondefconmore"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Defines the message that will be sent when DefCon is returned to level 5. This directive is optional,
|
* Defines the message that will be sent when DefCon is returned to level 5. This directive is optional,
|
||||||
@@ -344,19 +258,70 @@ defcon
|
|||||||
* Defines the reason to use when clients are KILLed or AKILLed from the network while the proper
|
* Defines the reason to use when clients are KILLed or AKILLed from the network while the proper
|
||||||
* DefCon operation is in effect.
|
* DefCon operation is in effect.
|
||||||
*/
|
*/
|
||||||
#akillreason = "This network is currently not accepting connections, please try again later"
|
#akillreason = "This network is currently not accepting connections, please try again later."
|
||||||
}
|
}
|
||||||
|
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; permission = "operserv/defcon"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_list
|
* os_dns
|
||||||
*
|
*
|
||||||
* Provides the commands operserv/chanlist and operserv/userlist.
|
* Provides the command operserv/dns.
|
||||||
*
|
*
|
||||||
* Used to list and search the channels and users currently on the network.
|
* This module requires that m_dns is loaded.
|
||||||
|
*
|
||||||
|
* This module allows controlling a DNS zone. This is useful for
|
||||||
|
* controlling what servers users are placed on for load balancing,
|
||||||
|
* and to automatically remove split servers.
|
||||||
|
*
|
||||||
|
* To use this module you must set a nameserver record for services
|
||||||
|
* so that DNS queries go to services.
|
||||||
|
*
|
||||||
|
* Alternatively, you may use a slave DNS server to hide service's IP,
|
||||||
|
* provide query caching, and provide better fault tolerance.
|
||||||
|
*
|
||||||
|
* To do this using BIND, configure similar to:
|
||||||
|
*
|
||||||
|
* options { max-refresh-time 60; };
|
||||||
|
* zone "irc.example.com" IN {
|
||||||
|
* type slave;
|
||||||
|
* masters { 127.0.0.1 port 5353; };
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* Where 127.0.0.1:5353 is the IP and port services are listening on.
|
||||||
|
* We recommend you externally firewall both UDP and TCP to the port
|
||||||
|
* Anope is listening on.
|
||||||
|
*
|
||||||
|
* Finally set a NS record for irc.example.com. to BIND or services.
|
||||||
*/
|
*/
|
||||||
module { name = "os_list" }
|
#module
|
||||||
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; }
|
{
|
||||||
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; }
|
name = "os_dns"
|
||||||
|
|
||||||
|
/* TTL for records. This should be very low if your records change often. */
|
||||||
|
ttl = 1m
|
||||||
|
|
||||||
|
/* If a server drops this many users the server is automatically removed from the DNS zone.
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
user_drop_mark = 50
|
||||||
|
|
||||||
|
/* The time used for user_drop_mark. */
|
||||||
|
user_drop_time = 1m
|
||||||
|
|
||||||
|
/* When a server is removed from the zone for dropping users, it is readded after this time.
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
user_drop_readd_time = 5m
|
||||||
|
|
||||||
|
/* If set, when a server splits, it is automatically removed from the zone. */
|
||||||
|
remove_split_servers = yes
|
||||||
|
|
||||||
|
/* If set, when a server connects to the network, it will be automatically added to
|
||||||
|
* the zone if it is a known server.
|
||||||
|
*/
|
||||||
|
readd_connected_servers = no
|
||||||
|
}
|
||||||
|
#command { service = "OperServ"; name = "DNS"; command = "operserv/dns"; permission = "operserv/dns"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_config
|
* os_config
|
||||||
@@ -388,6 +353,16 @@ command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; pe
|
|||||||
module { name = "os_ignore" }
|
module { name = "os_ignore" }
|
||||||
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
|
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* os_info
|
||||||
|
*
|
||||||
|
* Provides the command operserv/info.
|
||||||
|
*
|
||||||
|
* Used to add oper only notes to users and channels.
|
||||||
|
*/
|
||||||
|
module { name = "os_info" }
|
||||||
|
command { service = "OperServ"; name = "INFO"; command = "operserv/info"; permission = "operserv/info"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_jupe
|
* os_jupe
|
||||||
*
|
*
|
||||||
@@ -418,6 +393,17 @@ command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; permis
|
|||||||
module { name = "os_kill" }
|
module { name = "os_kill" }
|
||||||
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permission = "operserv/kill"; }
|
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permission = "operserv/kill"; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* os_list
|
||||||
|
*
|
||||||
|
* Provides the commands operserv/chanlist and operserv/userlist.
|
||||||
|
*
|
||||||
|
* Used to list and search the channels and users currently on the network.
|
||||||
|
*/
|
||||||
|
module { name = "os_list" }
|
||||||
|
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; permission = "operserv/chanlist"; }
|
||||||
|
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; permission = "operserv/userlist"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_login
|
* os_login
|
||||||
*
|
*
|
||||||
@@ -429,6 +415,24 @@ module { name = "os_login" }
|
|||||||
command { service = "OperServ"; name = "LOGIN"; command = "operserv/login"; }
|
command { service = "OperServ"; name = "LOGIN"; command = "operserv/login"; }
|
||||||
command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
|
command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* os_logsearch
|
||||||
|
*
|
||||||
|
* Provides the command operserv/logsearch.
|
||||||
|
*
|
||||||
|
* Used to search services log files.
|
||||||
|
*/
|
||||||
|
module
|
||||||
|
{
|
||||||
|
name = "os_logsearch"
|
||||||
|
|
||||||
|
/* The log file name to search. There should be a log{} block configured to log
|
||||||
|
* to a file of this name.
|
||||||
|
*/
|
||||||
|
logname = "services.log"
|
||||||
|
}
|
||||||
|
command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearch"; permission = "operserv/logsearch"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_mode
|
* os_mode
|
||||||
*
|
*
|
||||||
@@ -437,8 +441,8 @@ command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
|
|||||||
* Used to change user and channel modes.
|
* Used to change user and channel modes.
|
||||||
*/
|
*/
|
||||||
module { name = "os_mode" }
|
module { name = "os_mode" }
|
||||||
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode"; }
|
|
||||||
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; permission = "operserv/umode"; }
|
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; permission = "operserv/umode"; }
|
||||||
|
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_modinfo
|
* os_modinfo
|
||||||
@@ -448,8 +452,8 @@ command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; perm
|
|||||||
* Used to show information about loaded modules.
|
* Used to show information about loaded modules.
|
||||||
*/
|
*/
|
||||||
module { name = "os_modinfo" }
|
module { name = "os_modinfo" }
|
||||||
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; }
|
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; permission = "operserv/modinfo"; }
|
||||||
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modlist"; }
|
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modinfo"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_module
|
* os_module
|
||||||
@@ -470,7 +474,24 @@ command { service = "OperServ"; name = "MODUNLOAD"; command = "operserv/modunloa
|
|||||||
*
|
*
|
||||||
* Used to configure news notices shown to users when they connect, and opers when they oper.
|
* Used to configure news notices shown to users when they connect, and opers when they oper.
|
||||||
*/
|
*/
|
||||||
module { name = "os_news" }
|
module
|
||||||
|
{
|
||||||
|
name = "os_news"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The service bot names to use to send news to users on connection
|
||||||
|
* and to opers when they oper.
|
||||||
|
*/
|
||||||
|
announcer = "Global"
|
||||||
|
oper_announcer = "OperServ"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The number of LOGON/OPER news items to display when a user logs on.
|
||||||
|
*
|
||||||
|
* This directive is optional, if not set it will default to 3.
|
||||||
|
*/
|
||||||
|
#newscount = 3
|
||||||
|
}
|
||||||
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; }
|
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; }
|
||||||
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; }
|
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; }
|
||||||
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news"; }
|
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news"; }
|
||||||
@@ -498,7 +519,7 @@ command { service = "OperServ"; name = "OLINE"; command = "operserv/oline"; perm
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* os_oper
|
* os_oper
|
||||||
*
|
*
|
||||||
* Provides the command operserv/oper.
|
* Provides the command operserv/oper.
|
||||||
*
|
*
|
||||||
* Used to configure opers and show information about opertypes.
|
* Used to configure opers and show information about opertypes.
|
||||||
@@ -509,7 +530,7 @@ command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permis
|
|||||||
/*
|
/*
|
||||||
* os_reload
|
* os_reload
|
||||||
*
|
*
|
||||||
* Provides the command operserv/relad.
|
* Provides the command operserv/reload.
|
||||||
*
|
*
|
||||||
* Used to reload the services.conf configuration file.
|
* Used to reload the services.conf configuration file.
|
||||||
*/
|
*/
|
||||||
@@ -521,9 +542,84 @@ command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; pe
|
|||||||
*
|
*
|
||||||
* Provides the commands operserv/exception and operserv/session.
|
* Provides the commands operserv/exception and operserv/session.
|
||||||
*
|
*
|
||||||
|
* This module enables session limiting. Session limiting prevents users from connecting more than a certain
|
||||||
|
* number of times from the same IP at the same time - thus preventing most types of cloning.
|
||||||
|
* Once a host reaches it's session limit, all clients attempting to connect from that host will
|
||||||
|
* be killed. Exceptions to the default session limit can be defined via the exception list.
|
||||||
|
*
|
||||||
* Used to manage the session limit exception list, and view currently active sessions.
|
* Used to manage the session limit exception list, and view currently active sessions.
|
||||||
*/
|
*/
|
||||||
module { name = "os_session" }
|
module
|
||||||
|
{
|
||||||
|
name = "os_session"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Default session limit per host. Once a host reaches its session limit, all clients attempting
|
||||||
|
* to connect from that host will be killed.
|
||||||
|
*
|
||||||
|
* This directive is required if os_session is loaded.
|
||||||
|
*/
|
||||||
|
defaultsessionlimit = 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The maximum session limit that may be set for a host in an exception.
|
||||||
|
*
|
||||||
|
* This directive is required if os_session is loaded.
|
||||||
|
*/
|
||||||
|
maxsessionlimit = 100
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the default expiry time for session exceptions.
|
||||||
|
*
|
||||||
|
* This directive is required if os_session is loaded.
|
||||||
|
*/
|
||||||
|
exceptionexpiry = 1d
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The message that will be NOTICE'd to a user just before they are removed from the network because
|
||||||
|
* their host's session limit has been exceeded. It may be used to give a slightly more descriptive
|
||||||
|
* reason for the impending kill as opposed to simply "Session limit exceeded".
|
||||||
|
*
|
||||||
|
* This directive is optional, if not set, nothing will be sent.
|
||||||
|
*/
|
||||||
|
sessionlimitexceeded = "The session limit for your IP %IP% has been exceeded."
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Same as above, but should be used to provide a website address where users can find out more
|
||||||
|
* about session limits and how to go about applying for an exception.
|
||||||
|
*
|
||||||
|
* Note: This directive has been intentionally commented out in an effort to remind you to change
|
||||||
|
* the URL it contains. It is recommended that you supply an address/URL where people can get help
|
||||||
|
* regarding session limits.
|
||||||
|
*
|
||||||
|
* This directive is optional, if not set, nothing will be sent.
|
||||||
|
*/
|
||||||
|
#sessionlimitdetailsloc = "Please visit http://your.website.url/ for more information about session limits."
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set and is not 0, this directive tells Services to add an AKILL if the number of subsequent kills
|
||||||
|
* for the same host exceeds this value, preventing the network from experiencing KILL floods.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
maxsessionkill = 15
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the expiry time for AKILLs set for hosts exceeding the maxsessionkill directive limit.
|
||||||
|
*
|
||||||
|
* This directive is optional, if not set, defaults to 30 minutes.
|
||||||
|
*/
|
||||||
|
sessionautokillexpiry = 30m
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the CIDR value used to determine which IP addresses represent the same person.
|
||||||
|
* By default this would limit 3 connections per IPv4 IP and 3 connections per IPv6 IP.
|
||||||
|
* If you are receiving IPv6 clone attacks it may be useful to set session_ipv6_cidr to
|
||||||
|
* 64 or 48.
|
||||||
|
*/
|
||||||
|
session_ipv4_cidr = 32
|
||||||
|
session_ipv6_cidr = 128
|
||||||
|
}
|
||||||
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception"; }
|
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception"; }
|
||||||
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session"; }
|
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session"; }
|
||||||
|
|
||||||
@@ -534,7 +630,18 @@ command { service = "OperServ"; name = "SESSION"; command = "operserv/session";
|
|||||||
*
|
*
|
||||||
* Used to set various settings such as superadmin, debug mode, etc.
|
* Used to set various settings such as superadmin, debug mode, etc.
|
||||||
*/
|
*/
|
||||||
module { name = "os_set" }
|
module
|
||||||
|
{
|
||||||
|
name = "os_set"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant
|
||||||
|
* them extra privileges such as being a founder on ALL channels.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
#superadmin = yes
|
||||||
|
}
|
||||||
command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set"; }
|
command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -560,21 +667,23 @@ module { name = "os_stats" }
|
|||||||
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; permission = "operserv/stats"; }
|
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; permission = "operserv/stats"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_svsnick
|
* os_svs
|
||||||
*
|
|
||||||
* Provides the operserv/svsnick command.
|
|
||||||
*
|
*
|
||||||
* Used to force change user's nicks.
|
* Provides the commands operserv/svsnick, operserv/svsjoin, and operserv/svspart.
|
||||||
|
*
|
||||||
|
* Used to force users to change nicks, join and part channels.
|
||||||
*/
|
*/
|
||||||
module { name = "os_svsnick" }
|
module { name = "os_svs" }
|
||||||
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svsnick"; }
|
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svs"; }
|
||||||
|
command { service = "OperServ"; name = "SVSJOIN"; command = "operserv/svsjoin"; permission = "operserv/svs"; }
|
||||||
|
command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart"; permission = "operserv/svs"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* os_sxline
|
* os_sxline
|
||||||
*
|
*
|
||||||
* Provides the operserv/snline and operserv/sqline commands.
|
* Provides the operserv/snline and operserv/sqline commands.
|
||||||
*
|
*
|
||||||
* Used to ban different things such as realnames, nicknames, and IPs.
|
* Used to ban real names, nick names, and possibly channels.
|
||||||
*/
|
*/
|
||||||
module { name = "os_sxline" }
|
module { name = "os_sxline" }
|
||||||
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; }
|
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; }
|
||||||
@@ -583,10 +692,9 @@ command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; pe
|
|||||||
/*
|
/*
|
||||||
* os_update
|
* os_update
|
||||||
*
|
*
|
||||||
* Provides the opersev/update command.
|
* Provides the operserv/update command.
|
||||||
*
|
*
|
||||||
* Use to immediately update the databases.
|
* Use to immediately update the databases.
|
||||||
*/
|
*/
|
||||||
module { name = "os_update" }
|
module { name = "os_update" }
|
||||||
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update"; }
|
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update"; }
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,513 @@
|
|||||||
|
/*
|
||||||
|
* Example configuration file for Services. After making the appropriate
|
||||||
|
* changes to this file, place it in the Services conf directory (as
|
||||||
|
* specified in the "configure" script, default /home/username/services/conf)
|
||||||
|
* under the name "services.conf".
|
||||||
|
*
|
||||||
|
* The format of this file is fairly simple: three types of comments are supported:
|
||||||
|
* - All text after a '#' on a line is ignored, as in shell scripting
|
||||||
|
* - All text after '//' on a line is ignored, as in C++
|
||||||
|
* - A block of text like this one is ignored, as in C
|
||||||
|
*
|
||||||
|
* Outside of comments, there are three structures: blocks, keys, and values.
|
||||||
|
*
|
||||||
|
* A block is a named container, which contains a number of key to value pairs
|
||||||
|
* - you may think of this as an array.
|
||||||
|
*
|
||||||
|
* A block is created like so:
|
||||||
|
* foobar
|
||||||
|
* {
|
||||||
|
* moo = "cow"
|
||||||
|
* foo = bar
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* Note that nameless blocks are allowed and are often used with comments to allow
|
||||||
|
* easily commenting an entire block, for example:
|
||||||
|
* #foobar
|
||||||
|
* {
|
||||||
|
* moo = "cow"
|
||||||
|
* foo = bar
|
||||||
|
* }
|
||||||
|
* is an entirely commented block.
|
||||||
|
*
|
||||||
|
* Keys are case insensitive. Values depend on what key - generally, information is
|
||||||
|
* given in the key comment. The quoting of values (and most other syntax) is quite
|
||||||
|
* flexible, however, please do not forget to quote your strings:
|
||||||
|
*
|
||||||
|
* "This is a parameter string with spaces in it"
|
||||||
|
*
|
||||||
|
* If you need to include a double quote inside a quoted string, precede it
|
||||||
|
* by a backslash:
|
||||||
|
*
|
||||||
|
* "This string has \"double quotes\" in it"
|
||||||
|
*
|
||||||
|
* Time parameters can be specified either as an integer representing a
|
||||||
|
* number of seconds (e.g. "3600" = 1 hour), or as an integer with a unit
|
||||||
|
* specifier: "s" = seconds, "m" = minutes, "h" = hours, "d" = days.
|
||||||
|
* Combinations (such as "1h30m") are not permitted. Examples (all of which
|
||||||
|
* represent the same length of time, one day):
|
||||||
|
*
|
||||||
|
* "86400", "86400s", "1440m", "24h", "1d"
|
||||||
|
*
|
||||||
|
* In the documentation for each directive, one of the following will be
|
||||||
|
* included to indicate whether an option is required:
|
||||||
|
*
|
||||||
|
* [REQUIRED]
|
||||||
|
* Indicates a directive which must be given. Without it, Services will
|
||||||
|
* not start.
|
||||||
|
*
|
||||||
|
* [RECOMMENDED]
|
||||||
|
* Indicates a directive which may be omitted, but omitting it may cause
|
||||||
|
* undesirable side effects.
|
||||||
|
*
|
||||||
|
* [OPTIONAL]
|
||||||
|
* Indicates a directive which is optional. If not given, the feature
|
||||||
|
* will typically be disabled. If this is not the case, more
|
||||||
|
* information will be given in the documentation.
|
||||||
|
*
|
||||||
|
* [DISCOURAGED]
|
||||||
|
* Indicates a directive which may cause undesirable side effects if
|
||||||
|
* specified.
|
||||||
|
*
|
||||||
|
* [DEPRECATED]
|
||||||
|
* Indicates a directive which will disappear in a future version of
|
||||||
|
* Services, usually because its functionality has been either
|
||||||
|
* superseded by that of other directives or incorporated into the main
|
||||||
|
* program.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [OPTIONAL] Defines
|
||||||
|
*
|
||||||
|
* You can define values to other values, which can be used to easily change
|
||||||
|
* many values in the configuration. at once.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The services.host define is used in multiple different locations throughout the
|
||||||
|
* configuration for services clients hostnames.
|
||||||
|
*/
|
||||||
|
define
|
||||||
|
{
|
||||||
|
name = "services.host"
|
||||||
|
value = "services.localhost.net"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [OPTIONAL] Additional Includes
|
||||||
|
*
|
||||||
|
* You can include additional configuration files here.
|
||||||
|
* You may also include executable files, which will be executed and
|
||||||
|
* the output from it will be included into your configuration.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include
|
||||||
|
{
|
||||||
|
type = "file"
|
||||||
|
name = "some.conf"
|
||||||
|
}
|
||||||
|
|
||||||
|
#include
|
||||||
|
{
|
||||||
|
type = "executable"
|
||||||
|
name = "/usr/bin/wget -q -O - http://some.misconfigured.network.com/services.conf"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [REQUIRED] IRCd Config
|
||||||
|
*
|
||||||
|
* This section is used to set up Anope to connect to your IRC network.
|
||||||
|
* This section can be included multiple times, and Anope will attempt to
|
||||||
|
* connect to each server until it finally connects.
|
||||||
|
*
|
||||||
|
* Each uplink IRCd should have a corresponding configuration to allow Services
|
||||||
|
* to link to it.
|
||||||
|
*
|
||||||
|
* An example configuration for InspIRCd that is compatible with the below uplink
|
||||||
|
* and serverinfo configuration would look like:
|
||||||
|
*
|
||||||
|
* <link name="services.localhost.net"
|
||||||
|
* ipaddr="127.0.0.1"
|
||||||
|
* port="7000"
|
||||||
|
* sendpass="mypassword"
|
||||||
|
* recvpass="mypassword">
|
||||||
|
* <uline server="services.localhost.net" silent="yes">
|
||||||
|
* <bind address="127.0.0.1" port="7000" type="servers">
|
||||||
|
*
|
||||||
|
* An example configuration for UnrealIRCd that is compatible with the below uplink
|
||||||
|
* and serverinfo configuration would look like:
|
||||||
|
*
|
||||||
|
* link services.localhost.net
|
||||||
|
* {
|
||||||
|
* username *;
|
||||||
|
* hostname *;
|
||||||
|
* bind-ip "127.0.0.1";
|
||||||
|
* port 7000;
|
||||||
|
* hub *;
|
||||||
|
* password-connect "mypassword";
|
||||||
|
* password-receive "mypassword";
|
||||||
|
* class servers;
|
||||||
|
* };
|
||||||
|
* ulines { services.localhost.net; };
|
||||||
|
* listen 127.0.0.1:7000;
|
||||||
|
*/
|
||||||
|
uplink
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The IP or hostname of the IRC server you wish to connect Services to.
|
||||||
|
* Usually, you will want to connect Services over 127.0.0.1 (aka localhost).
|
||||||
|
*
|
||||||
|
* NOTE: On some shell providers, this will not be an option.
|
||||||
|
*/
|
||||||
|
host = "127.0.0.1"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enable if Services should connect using IPv6.
|
||||||
|
*/
|
||||||
|
ipv6 = no
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enable if Services should connect using SSL.
|
||||||
|
* You must have an SSL module loaded for this to work.
|
||||||
|
*/
|
||||||
|
ssl = no
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The port to connect to.
|
||||||
|
* The IRCd *MUST* be configured to listen on this port, and to accept
|
||||||
|
* server connections.
|
||||||
|
*
|
||||||
|
* Refer to your IRCd documentation for how this is to be done.
|
||||||
|
*/
|
||||||
|
port = 7000
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The password to send to the IRC server for authentication.
|
||||||
|
* This must match the link block on your IRCd.
|
||||||
|
*
|
||||||
|
* Refer to your IRCd documentation for more information on link blocks.
|
||||||
|
*/
|
||||||
|
password = "mypassword"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [REQUIRED] Server Information
|
||||||
|
*
|
||||||
|
* This section contains information about the Services server.
|
||||||
|
*/
|
||||||
|
serverinfo
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The hostname that Services will be seen as, it must have no conflicts with any
|
||||||
|
* other server names on the rest of your IRC network. Note that it does not have
|
||||||
|
* to be an existing hostname, just one that isn't on your network already.
|
||||||
|
*/
|
||||||
|
name = "stats.localhost.net"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The text which should appear as the server's information in /whois and similar
|
||||||
|
* queries.
|
||||||
|
*/
|
||||||
|
description = "Stats for IRC Networks"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The local address that Services will bind to before connecting to the remote
|
||||||
|
* server. This may be useful for multihomed hosts. If omitted, Services will let
|
||||||
|
* the Operating System choose the local address. This directive is optional.
|
||||||
|
*
|
||||||
|
* If you don't know what this means or don't need to use it, just leave this
|
||||||
|
* directive commented out.
|
||||||
|
*/
|
||||||
|
#localhost = "nowhere."
|
||||||
|
|
||||||
|
/*
|
||||||
|
* What Server ID to use for this connection?
|
||||||
|
* Note: This should *ONLY* be used for TS6/P10 IRCds. Refer to your IRCd documentation
|
||||||
|
* to see if this is needed.
|
||||||
|
*/
|
||||||
|
#id = "00A"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The filename containing the Services process ID. The path is relative to the
|
||||||
|
* services root directory.
|
||||||
|
*/
|
||||||
|
pid = "data/services.pid"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The filename containing the Message of the Day. The path is relative to the
|
||||||
|
* services root directory.
|
||||||
|
*/
|
||||||
|
motd = "conf/services.motd"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [REQUIRED] Protocol module
|
||||||
|
*
|
||||||
|
* This directive tells Anope which IRCd Protocol to speak when connecting.
|
||||||
|
* You MUST modify this to match the IRCd you run.
|
||||||
|
*
|
||||||
|
* Supported:
|
||||||
|
* - bahamut
|
||||||
|
* - charybdis
|
||||||
|
* - hybrid
|
||||||
|
* - inspircd12
|
||||||
|
* - inspircd20
|
||||||
|
* - ngircd
|
||||||
|
* - plexus
|
||||||
|
* - ratbox
|
||||||
|
* - unreal
|
||||||
|
*/
|
||||||
|
module
|
||||||
|
{
|
||||||
|
name = "inspircd20"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [REQUIRED] Network Information
|
||||||
|
*
|
||||||
|
* This section contains information about the IRC network that Services will be
|
||||||
|
* connecting to.
|
||||||
|
*/
|
||||||
|
networkinfo
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This is the name of the network that Services will be running on.
|
||||||
|
*/
|
||||||
|
networkname = "LocalNet"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set this to the maximum allowed nick length on your network.
|
||||||
|
* Be sure to set this correctly, as setting this wrong can result in
|
||||||
|
* Services being disconnected from the network.
|
||||||
|
*/
|
||||||
|
nicklen = 31
|
||||||
|
|
||||||
|
/* Set this to the maximum allowed ident length on your network.
|
||||||
|
* Be sure to set this correctly, as setting this wrong can result in
|
||||||
|
* Services being disconnected from the network.
|
||||||
|
*/
|
||||||
|
userlen = 10
|
||||||
|
|
||||||
|
/* Set this to the maximum allowed hostname length on your network.
|
||||||
|
* Be sure to set this correctly, as setting this wrong can result in
|
||||||
|
* Services being disconnected from the network.
|
||||||
|
*/
|
||||||
|
hostlen = 64
|
||||||
|
|
||||||
|
/* Set this to the maximum allowed channel length on your network.
|
||||||
|
*/
|
||||||
|
chanlen = 32
|
||||||
|
|
||||||
|
/* The maximum number of list modes settable on a channel (such as b, e, I).
|
||||||
|
* Comment out or set to 0 to disable.
|
||||||
|
*/
|
||||||
|
modelistsize = 100
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The characters allowed in hostnames. This is used for validating hostnames given
|
||||||
|
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
|
||||||
|
* recommended unless you know for sure your IRCd supports whatever characters you are
|
||||||
|
* wanting to use. Telling services to set a vHost containing characters your IRCd
|
||||||
|
* disallows could potentially break the IRCd and/or Services.
|
||||||
|
*
|
||||||
|
* It is recommended you DON'T change this.
|
||||||
|
*/
|
||||||
|
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set to true, allows vHosts to not contain dots (.).
|
||||||
|
* Newer IRCds generally do not have a problem with this, but the same warning as
|
||||||
|
* vhost_chars applies.
|
||||||
|
*
|
||||||
|
* It is recommended you DON'T change this.
|
||||||
|
*/
|
||||||
|
allow_undotted_vhosts = false
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The characters that are not allowed to be at the very beginning or very ending
|
||||||
|
* of a vHost. The same warning as vhost_chars applies.
|
||||||
|
*
|
||||||
|
* It is recommended you DON'T change this.
|
||||||
|
*/
|
||||||
|
disallow_start_or_end = ".-"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [REQUIRED] Services Options
|
||||||
|
*
|
||||||
|
* This section contains various options which determine how Services will operate.
|
||||||
|
*/
|
||||||
|
options
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* On Linux/UNIX systems Anope can setuid and setgid to this user and group
|
||||||
|
* after starting up. This is useful if Anope has to bind to privileged ports
|
||||||
|
*/
|
||||||
|
#user = "anope"
|
||||||
|
#group = "anope"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The case mapping used by services. This must be set to a valid locale name
|
||||||
|
* installed on your machine. Services use this case map to compare, with
|
||||||
|
* case insensitivity, things such as nick names, channel names, etc.
|
||||||
|
*
|
||||||
|
* We provide two special casemaps shipped with Anope, ascii and rfc1459.
|
||||||
|
*
|
||||||
|
* This value should be set to what your IRCd uses, which is probably rfc1459,
|
||||||
|
* however Anope has always used ascii for comparison, so the default is ascii.
|
||||||
|
*
|
||||||
|
* Changing this value once set is not recommended.
|
||||||
|
*/
|
||||||
|
casemap = "ascii"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the timeout period for reading from the uplink.
|
||||||
|
*/
|
||||||
|
readtimeout = 5s
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets the interval between sending warning messages for program errors via
|
||||||
|
* WALLOPS/GLOBOPS.
|
||||||
|
*/
|
||||||
|
warningtimeout = 4h
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If set, Services will only show /stats o to IRC Operators. This directive
|
||||||
|
* is optional.
|
||||||
|
*/
|
||||||
|
#hidestatso = yes
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A space-separated list of ulined servers on your network, it is assumed that
|
||||||
|
* the servers in this list are allowed to set channel modes and Services will
|
||||||
|
* not attempt to reverse their mode changes.
|
||||||
|
*
|
||||||
|
* WARNING: Do NOT put your normal IRC user servers in this directive.
|
||||||
|
*
|
||||||
|
* This directive is optional.
|
||||||
|
*/
|
||||||
|
#ulineservers = "services.your.network"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* How long to wait between connection retries with the uplink(s).
|
||||||
|
*/
|
||||||
|
retrywait = 60s
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [RECOMMENDED] Logging Configuration
|
||||||
|
*
|
||||||
|
* This section is used for configuring what is logged and where it is logged to.
|
||||||
|
* You may have multiple log blocks if you wish. Remember to properly secure any
|
||||||
|
* channels you choose to have Anope log to!
|
||||||
|
*/
|
||||||
|
log
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Target(s) to log to, which may be one of the following:
|
||||||
|
* - a channel name
|
||||||
|
* - a filename
|
||||||
|
* - globops
|
||||||
|
*/
|
||||||
|
target = "stats.log"
|
||||||
|
|
||||||
|
/* Log to both services.log and the channel #services
|
||||||
|
*
|
||||||
|
* Note that some older IRCds, such as Ratbox, require services to be in the
|
||||||
|
* log channel to be able to message it. To do this, configure service:channels to
|
||||||
|
* join your logging channel.
|
||||||
|
*/
|
||||||
|
#target = "stats.log #services"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The source(s) to only accept log messages from. Leave commented to allow all sources.
|
||||||
|
* This can be a users name, a channel name, one of our clients (eg, OperServ), or a server name.
|
||||||
|
*/
|
||||||
|
#source = ""
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The bot used to log generic messages which have no predefined sender if there
|
||||||
|
* is a channel in the target directive.
|
||||||
|
*/
|
||||||
|
bot = "Global"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The number of days to keep logfiles, only useful if you are logging to a file.
|
||||||
|
* Set to 0 to never delete old logfiles.
|
||||||
|
*
|
||||||
|
* Note that Anope must run 24 hours a day for this feature to work correctly.
|
||||||
|
*/
|
||||||
|
logage = 7
|
||||||
|
|
||||||
|
/*
|
||||||
|
* What types of log messages should be logged by this block. There are nine general categories:
|
||||||
|
*
|
||||||
|
* servers - Server actions, linking, squitting, etc.
|
||||||
|
* channels - Actions in channels such as joins, parts, kicks, etc.
|
||||||
|
* users - User actions such as connecting, disconnecting, changing name, etc.
|
||||||
|
* other - All other messages without a category.
|
||||||
|
* rawio - Logs raw input and output from services
|
||||||
|
* debug - Debug messages (log files can become VERY large from this).
|
||||||
|
*
|
||||||
|
* These options determine what messages from the categories should be logged. Wildcards are accepted, and
|
||||||
|
* you can also negate values with a ~. For example, "~operserv/akill operserv/*" would log all operserv
|
||||||
|
* messages except for operserv/akill. Note that processing stops at the first matching option, which
|
||||||
|
* means "* ~operserv/*" would log everything because * matches everything.
|
||||||
|
*
|
||||||
|
* Valid server options are:
|
||||||
|
* connect, quit, sync, squit
|
||||||
|
*
|
||||||
|
* Valid channel options are:
|
||||||
|
* create, destroy, join, part, kick, leave, mode
|
||||||
|
*
|
||||||
|
* Valid user options are:
|
||||||
|
* connect, disconnect, quit, nick, ident, host, mode, maxusers, oper
|
||||||
|
*
|
||||||
|
* Rawio and debug are simple yes/no answers, there are no types for them.
|
||||||
|
*
|
||||||
|
* Note that modules may add their own values to these options.
|
||||||
|
*/
|
||||||
|
servers = "*"
|
||||||
|
#channels = "~mode *"
|
||||||
|
users = "connect disconnect nick"
|
||||||
|
other = "*"
|
||||||
|
rawio = no
|
||||||
|
debug = no
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [REQUIRED] MySQL Database configuration.
|
||||||
|
*
|
||||||
|
* m_mysql
|
||||||
|
*
|
||||||
|
* This module allows other modules to use MySQL.
|
||||||
|
*/
|
||||||
|
module
|
||||||
|
{
|
||||||
|
name = "m_mysql"
|
||||||
|
|
||||||
|
mysql
|
||||||
|
{
|
||||||
|
/* The name of this service. */
|
||||||
|
name = "mysql/main"
|
||||||
|
database = "anope"
|
||||||
|
server = "127.0.0.1"
|
||||||
|
username = "anope"
|
||||||
|
password = "mypassword"
|
||||||
|
port = 3306
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IRC2SQL Gateway
|
||||||
|
* This module collects data about users, channels and servers. It doesn't build stats
|
||||||
|
* itself, however, it gives you the database, it's up to you how you use it.
|
||||||
|
*
|
||||||
|
* Requires a MySQL Database and MySQL version 5.5 or higher
|
||||||
|
*/
|
||||||
|
include
|
||||||
|
{
|
||||||
|
type = "file"
|
||||||
|
name = "irc2sql.example.conf"
|
||||||
|
}
|
||||||
|
|
||||||
-3822
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
|||||||
git log --pretty=format:"Revision %h - %cD - %s" > version.log
|
|
||||||
+260
-252
@@ -1,339 +1,347 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
675 Mass Ave, Cambridge, MA 02139, USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
of this license document, but changing it is not allowed.
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
Preamble
|
||||||
General Public License applies to most of the Free Software
|
|
||||||
Foundation's software and to any other program whose authors commit to
|
The licenses for most software are designed to take away your
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
the GNU Library General Public License instead.) You can apply it to
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
your programs, too.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
When we speak of free software, we are referring to freedom, not
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
have the freedom to distribute copies of free software (and charge for
|
have the freedom to distribute copies of free software (and charge for
|
||||||
this service if you wish), that you receive source code or can get it
|
this service if you wish), that you receive source code or can get it
|
||||||
if you want it, that you can change the software or use pieces of it
|
if you want it, that you can change the software or use pieces of it
|
||||||
in new free programs; and that you know you can do these things.
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
To protect your rights, we need to make restrictions that forbid
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
These restrictions translate to certain responsibilities for you if you
|
These restrictions translate to certain responsibilities for you if you
|
||||||
distribute copies of the software, or if you modify it.
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
For example, if you distribute copies of such a program, whether
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
you have. You must make sure that they, too, receive or can get the
|
you have. You must make sure that they, too, receive or can get the
|
||||||
source code. And you must show them these terms so they know their
|
source code. And you must show them these terms so they know their
|
||||||
rights.
|
rights.
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
distribute and/or modify the software.
|
distribute and/or modify the software.
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
Also, for each author's protection and ours, we want to make certain
|
||||||
that everyone understands that there is no warranty for this free
|
that everyone understands that there is no warranty for this free
|
||||||
software. If the software is modified by someone else and passed on, we
|
software. If the software is modified by someone else and passed on, we
|
||||||
want its recipients to know that what they have is not the original, so
|
want its recipients to know that what they have is not the original, so
|
||||||
that any problems introduced by others will not reflect on the original
|
that any problems introduced by others will not reflect on the original
|
||||||
authors' reputations.
|
authors' reputations.
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
Finally, any free program is threatened constantly by software
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
program will individually obtain patent licenses, in effect making the
|
program will individually obtain patent licenses, in effect making the
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
0. This License applies to any program or other work which contains
|
||||||
covered by this License; they are outside its scope. The act of
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
running the Program is not restricted, and the output from the Program
|
under the terms of this General Public License. The "Program", below,
|
||||||
is covered only if its contents constitute a work based on the
|
refers to any such program or work, and a "work based on the Program"
|
||||||
Program (independent of having been made by running the Program).
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
Whether that is true depends on what the Program does.
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
source code as you receive it, in any medium, provided that you
|
source code as you receive it, in any medium, provided that you
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
notices that refer to this License and to the absence of any warranty;
|
notices that refer to this License and to the absence of any warranty;
|
||||||
and give any other recipients of the Program a copy of this License
|
and give any other recipients of the Program a copy of this License
|
||||||
along with the Program.
|
along with the Program.
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
of it, thus forming a work based on the Program, and copy and
|
of it, thus forming a work based on the Program, and copy and
|
||||||
distribute such modifications or work under the terms of Section 1
|
distribute such modifications or work under the terms of Section 1
|
||||||
above, provided that you also meet all of these conditions:
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
a) You must cause the modified files to carry prominent notices
|
||||||
stating that you changed the files and the date of any change.
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
b) You must cause any work that you distribute or publish, that in
|
||||||
whole or in part contains or is derived from the Program or any
|
whole or in part contains or is derived from the Program or any
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
parties under the terms of this License.
|
parties under the terms of this License.
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
c) If the modified program normally reads commands interactively
|
||||||
when run, you must cause it, when started running for such
|
when run, you must cause it, when started running for such
|
||||||
interactive use in the most ordinary way, to print or display an
|
interactive use in the most ordinary way, to print or display an
|
||||||
announcement including an appropriate copyright notice and a
|
announcement including an appropriate copyright notice and a
|
||||||
notice that there is no warranty (or else, saying that you provide
|
notice that there is no warranty (or else, saying that you provide
|
||||||
a warranty) and that users may redistribute the program under
|
a warranty) and that users may redistribute the program under
|
||||||
these conditions, and telling the user how to view a copy of this
|
these conditions, and telling the user how to view a copy of this
|
||||||
License. (Exception: if the Program itself is interactive but
|
License. (Exception: if the Program itself is interactive but
|
||||||
does not normally print such an announcement, your work based on
|
does not normally print such an announcement, your work based on
|
||||||
the Program is not required to print an announcement.)
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
These requirements apply to the modified work as a whole. If
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
identifiable sections of that work are not derived from the Program,
|
||||||
exercise the right to control the distribution of derivative or
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the entire
|
||||||
|
whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
collective works based on the Program.
|
collective works based on the Program.
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
In addition, mere aggregation of another work not based on the Program
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
a storage or distribution medium does not bring the other work under
|
a storage or distribution medium does not bring the other work under
|
||||||
the scope of this License.
|
the scope of this License.
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
under Section 2) in object code or executable form under the terms of
|
under Section 2) in object code or executable form under the terms of
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
source code, which must be distributed under the terms of Sections
|
source code, which must be distributed under the terms of Sections
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
b) Accompany it with a written offer, valid for at least three years,
|
||||||
years, to give any third party, for a charge no more than your
|
to give any third party, for a charge no more than your cost of
|
||||||
cost of physically performing source distribution, a complete
|
physically performing source distribution, a complete machine-readable
|
||||||
machine-readable copy of the corresponding source code, to be
|
copy of the corresponding source code, to be distributed under the terms
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
of Sections 1 and 2 above on a medium customarily used for software
|
||||||
customarily used for software interchange; or,
|
interchange; or,
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
c) Accompany it with the information you received as to the offer
|
||||||
to distribute corresponding source code. (This alternative is
|
to distribute corresponding source code. (This alternative is allowed
|
||||||
allowed only for noncommercial distribution and only if you
|
only for noncommercial distribution and only if you received the program
|
||||||
received the program in object code or executable form with such
|
in object code or executable form with such an offer, in accord with
|
||||||
an offer, in accord with Subsection b above.)
|
Subsection b above.)
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
The source code for a work means the preferred form of the work for
|
||||||
making modifications to it. For an executable work, complete source
|
making modifications to it. For an executable work, complete source
|
||||||
code means all the source code for all modules it contains, plus any
|
code means all the source code for all modules it contains, plus any
|
||||||
associated interface definition files, plus the scripts used to
|
associated interface definition files, plus the scripts used to
|
||||||
control compilation and installation of the executable. However, as a
|
control compilation and installation of the executable. However, as a
|
||||||
special exception, the source code distributed need not include
|
special exception, the source code distributed need not include
|
||||||
anything that is normally distributed (in either source or binary
|
anything that is normally distributed (in either source or binary
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
operating system on which the executable runs, unless that component
|
operating system on which the executable runs, unless that component
|
||||||
itself accompanies the executable.
|
itself accompanies the executable.
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
If distribution of executable or object code is made by offering
|
||||||
access to copy from a designated place, then offering equivalent
|
access to copy from a designated place, then offering equivalent
|
||||||
access to copy the source code from the same place counts as
|
access to copy the source code from the same place counts as
|
||||||
distribution of the source code, even though third parties are not
|
distribution of the source code, even though third parties are not
|
||||||
compelled to copy the source along with the object code.
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
except as expressly provided under this License. Any attempt
|
except as expressly provided under this License. Any attempt
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
void, and will automatically terminate your rights under this License.
|
void, and will automatically terminate your rights under this License.
|
||||||
However, parties who have received copies, or rights, from you under
|
However, parties who have received copies, or rights, from you under
|
||||||
this License will not have their licenses terminated so long as such
|
this License will not have their licenses terminated so long as such
|
||||||
parties remain in full compliance.
|
parties remain in full compliance.
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
5. You are not required to accept this License, since you have not
|
||||||
signed it. However, nothing else grants you permission to modify or
|
signed it. However, nothing else grants you permission to modify or
|
||||||
distribute the Program or its derivative works. These actions are
|
distribute the Program or its derivative works. These actions are
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
modifying or distributing the Program (or any work based on the
|
modifying or distributing the Program (or any work based on the
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
all its terms and conditions for copying, distributing or modifying
|
all its terms and conditions for copying, distributing or modifying
|
||||||
the Program or works based on it.
|
the Program or works based on it.
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
Program), the recipient automatically receives a license from the
|
Program), the recipient automatically receives a license from the
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
these terms and conditions. You may not impose any further
|
these terms and conditions. You may not impose any further
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
You are not responsible for enforcing compliance by third parties to
|
You are not responsible for enforcing compliance by third parties to
|
||||||
this License.
|
this License.
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
infringement or for any other reason (not limited to patent issues),
|
infringement or for any other reason (not limited to patent issues),
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
excuse you from the conditions of this License. If you cannot
|
excuse you from the conditions of this License. If you cannot
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
License and any other pertinent obligations, then as a consequence you
|
License and any other pertinent obligations, then as a consequence you
|
||||||
may not distribute the Program at all. For example, if a patent
|
may not distribute the Program at all. For example, if a patent license
|
||||||
license would not permit royalty-free redistribution of the Program by
|
would not permit royalty-free redistribution of the Program by all those
|
||||||
all those who receive copies directly or indirectly through you, then
|
who receive copies directly or indirectly through you, then the only way
|
||||||
the only way you could satisfy both it and this License would be to
|
you could satisfy both it and this License would be to refrain entirely
|
||||||
refrain entirely from distribution of the Program.
|
from distribution of the Program.
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
If any portion of this section is held invalid or unenforceable under
|
||||||
any particular circumstance, the balance of the section is intended to
|
any particular circumstance, the balance of the section is intended to
|
||||||
apply and the section as a whole is intended to apply in other
|
apply and the section as a whole is intended to apply in other
|
||||||
circumstances.
|
circumstances.
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
It is not the purpose of this section to induce you to infringe any
|
||||||
patents or other property right claims or to contest validity of any
|
patents or other property right claims or to contest validity of any
|
||||||
such claims; this section has the sole purpose of protecting the
|
such claims; this section has the sole purpose of protecting the
|
||||||
integrity of the free software distribution system, which is
|
integrity of the free software distribution system, which is implemented
|
||||||
implemented by public license practices. Many people have made
|
by public license practices. Many people have made generous contributions
|
||||||
generous contributions to the wide range of software distributed
|
to the wide range of software distributed through that system in reliance
|
||||||
through that system in reliance on consistent application of that
|
on consistent application of that system; it is up to the author/donor to
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
decide if he or she is willing to distribute software through any other
|
||||||
to distribute software through any other system and a licensee cannot
|
system and a licensee cannot impose that choice.
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
This section is intended to make thoroughly clear what is believed to be
|
||||||
be a consequence of the rest of this License.
|
a consequence of the rest of this License.
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
original copyright holder who places the Program under this License
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
may add an explicit geographical distribution limitation excluding
|
original copyright holder who places the Program under this License
|
||||||
those countries, so that distribution is permitted only in or among
|
may add an explicit geographical distribution limitation excluding
|
||||||
countries not thus excluded. In such case, this License incorporates
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
the limitation as if written in the body of this License.
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
of the General Public License from time to time. Such new versions will
|
of the General Public License from time to time. Such new versions will
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
address new problems or concerns.
|
address new problems or concerns.
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
Each version is given a distinguishing version number. If the Program
|
||||||
specifies a version number of this License which applies to it and "any
|
specifies a version number of this License which applies to it and "any
|
||||||
later version", you have the option of following the terms and conditions
|
later version", you have the option of following the terms and conditions
|
||||||
either of that version or of any later version published by the Free
|
either of that version or of any later version published by the Free
|
||||||
Software Foundation. If the Program does not specify a version number of
|
Software Foundation. If the Program does not specify a version number of
|
||||||
this License, you may choose any version ever published by the Free Software
|
this License, you may choose any version ever published by the Free Software
|
||||||
Foundation.
|
Foundation.
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
programs whose distribution conditions are different, write to the author
|
programs whose distribution conditions are different, write to the author
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
of preserving the free status of all derivatives of our free software and
|
of preserving the free status of all derivatives of our free software and
|
||||||
of promoting the sharing and reuse of software generally.
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
NO WARRANTY
|
NO WARRANTY
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
REPAIR OR CORRECTION.
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
Appendix: How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
How to Apply These Terms to Your New Programs
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
If you develop a new program, and you want it to be of the greatest
|
||||||
to attach them to the start of each source file to most effectively
|
possible use to the public, the best way to achieve this is to make
|
||||||
convey the exclusion of warranty; and each file should have at least
|
it free software which everyone can redistribute and change under
|
||||||
|
these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
<one line to give the program's name and an idea of what it does.>
|
||||||
Copyright (C) 19yy <name of author>
|
Copyright (C) yyyy name of author
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU General Public License
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
as published by the Free Software Foundation; either version 2
|
||||||
(at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
02110-1301, USA.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
If the program is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
|
||||||
This is free software, and you are welcome to redistribute it
|
type `show w'. This is free software, and you are welcome
|
||||||
under certain conditions; type `show c' for details.
|
to redistribute it under certain conditions; type `show c'
|
||||||
|
for details.
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
parts of the General Public License. Of course, the commands you use may
|
parts of the General Public License. Of course, the commands you use may
|
||||||
be called something other than `show w' and `show c'; they could even be
|
be called something other than `show w' and `show c'; they could even be
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
You should also get your employer (if you work as a programmer) or your
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
necessary. Here is a sample; alter the names:
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
<signature of Ty Coon>, 1 April 1989
|
||||||
Ty Coon, President of Vice
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
This General Public License does not permit incorporating your program into
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
consider it more useful to permit linking proprietary applications with the
|
consider it more useful to permit linking proprietary applications with the
|
||||||
library. If this is what you want to do, use the GNU Library General
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,68 @@
|
|||||||
|
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 langauge file, from Isaac Fontal <i_fontal@hotmail.com>
|
||||||
|
F Fix build on Solaris and OSX
|
||||||
|
F Fixed setting BotServ's default settings in the config
|
||||||
|
F Fixed some names of config items, including NickServ's kill protect
|
||||||
|
|
||||||
|
Anope Version 1.9.8
|
||||||
|
--------------------
|
||||||
|
A Ability to configure fantasy commands in the config
|
||||||
|
A Add SVSJOIN and SVSPART commands
|
||||||
|
F Fix "leave" channel log level from not logging
|
||||||
|
F Fix users able to "resend" their registration mail with registration set to admin only
|
||||||
|
F Fix build on OpenBSD
|
||||||
|
F Fix not logging debug logs to the logfile when debug mode is enabled
|
||||||
|
F Fix defcon timeout timer
|
||||||
|
F Fix crash in os_forbid with expiring entries
|
||||||
|
F Fix several issues with db_sql_live
|
||||||
|
|
||||||
Anope Version 1.9.7
|
Anope Version 1.9.7
|
||||||
--------------------
|
--------------------
|
||||||
A Added ability for using regex as patterns for various commands
|
A Added ability for using regex as patterns for various commands
|
||||||
|
|||||||
@@ -1,3 +1,44 @@
|
|||||||
|
Anope Version 2.0.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
|
||||||
|
|
||||||
|
Anope Version 2.0.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
|
||||||
|
|
||||||
|
Anope Version 2.0.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 betewen 1.9.8 and 1.9.9, however many of the
|
||||||
|
options have been moved around to make more sense, too many to list here,
|
||||||
|
so get a new config.
|
||||||
|
|
||||||
|
Anope Version 1.9.8
|
||||||
|
-------------------
|
||||||
|
networkinfo:chanlen added
|
||||||
|
options:user and options:group added
|
||||||
|
nickserv:modesonid added to set modes on everyone who identifies
|
||||||
|
nickserv:kill and nickserv:killquick added to configure NickServ's kill timeout
|
||||||
|
nickserv:restoreonrecover added to try to restore a user's session after a ghost
|
||||||
|
command:group added
|
||||||
|
fantasy block added
|
||||||
|
dns block has been moved to modules.conf as a part of m_dns
|
||||||
|
|
||||||
Anope Version 1.9.7
|
Anope Version 1.9.7
|
||||||
-------------------
|
-------------------
|
||||||
operserv:notifications removed in favor of log{} blocks
|
operserv:notifications removed in favor of log{} blocks
|
||||||
|
|||||||
+14
-21
@@ -9,34 +9,27 @@ Anope Internal Events
|
|||||||
Internal Events are setup to give module developers more information
|
Internal Events are setup to give module developers more information
|
||||||
about what the core is doing at different times. This information can
|
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
|
be as complex as data we are feeding to the uplink, to simple triggered
|
||||||
events such as the databases being saved.
|
events such as the databases being saved.
|
||||||
|
|
||||||
Additionally there is a module included with the core
|
Additionally there is a module included with the core
|
||||||
which can provide some clue as to how to use the code in your modules.
|
which can provide some clue as to how to use the code in your modules.
|
||||||
The rest of this document assumes that you are used to writing modules.
|
The rest of this document assumes that you are used to writing modules.
|
||||||
|
|
||||||
2) Using Events
|
2) Using Events
|
||||||
|
|
||||||
Anope is told about modules wanting to hook to events by the function
|
Each Event in Anope calls a function.
|
||||||
ModuleManager::Attach(EventName, Module*);, eg:
|
You must override these functions in your main modules class.
|
||||||
|
|
||||||
ModuleManager::Attach(I_OnJoinChannel, this);
|
|
||||||
|
|
||||||
You can also specifcy an array of events:
|
|
||||||
|
|
||||||
Implementation i[] = { I_OnJoinChannel, I_OnPartChannel };
|
|
||||||
ModuleManager::Attach(i, this, 2);
|
|
||||||
Where 2 is the number of events in the list
|
|
||||||
|
|
||||||
You must then overload these functions in your main modules class.
|
|
||||||
The full list of functions and parameters are in modules.h. In this
|
The full list of functions and parameters are in modules.h. In this
|
||||||
case, you would be overloading OnJoinChannel() and OnPartChannel() like so:
|
case, you would be overriding OnJoinChannel() and OnPartChannel() like so:
|
||||||
|
|
||||||
void OnJoinChannel(User *u, Channel *c) { }
|
void OnJoinChannel(User *u, Channel *c) anope_override { }
|
||||||
void OnPartChannel(User *u, Channel *c) { }
|
void OnPartChannel(User *u, Channel *c) anope_override { }
|
||||||
|
|
||||||
Some of these events can be used to prevent or allow things to happen that
|
Some of these event overrides can be used to prevent or allow things to
|
||||||
would normally not be allowed or denied. You can also use ModuleManager
|
happen that would normally not be allowed or denied. You can also use
|
||||||
(not explained here) to set control which order the modules are queried
|
ModuleManager (not explained here) to set control which order the modules
|
||||||
(when multiple modules hook to the same event).
|
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.
|
||||||
|
|
||||||
|
|||||||
+23
-90
@@ -21,74 +21,51 @@ Note: You should also read the README and FAQ files!
|
|||||||
|
|
||||||
http://www.anope.org/
|
http://www.anope.org/
|
||||||
|
|
||||||
Anope can be built one of two ways. The recommended way is to use CMake.
|
Anope requires cmake to build. You can check if CMake is already
|
||||||
You can check if CMake is already installed on your system using the
|
installed on your system using the command:
|
||||||
command:
|
|
||||||
|
|
||||||
cmake --version
|
cmake --version
|
||||||
|
|
||||||
If it's installed, you will get a line that says something similar to
|
If it's installed, you will get a line that says something similar to
|
||||||
"cmake version 2.6-patch 1". If the version is less than 2.4 or you get
|
"cmake version 2.8.12.2". If the version is less than 2.4 or you get
|
||||||
an error saying the command was not found, you will not be able to use
|
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
|
CMake unless you install it yourself into your home directory. CMake
|
||||||
can be downloaded from:
|
can be downloaded from:
|
||||||
|
|
||||||
http://www.cmake.org/cmake/resources/software.html
|
http://www.cmake.org/cmake/resources/software.html
|
||||||
|
|
||||||
If you are unable to install CMake yourself (either due to lack of space
|
|
||||||
or restrictions by your hosting provider), you still have the alternative
|
|
||||||
to use the provided configure script. This option is not recommended and
|
|
||||||
will eventually be phased out, but is provided for compatibility for those
|
|
||||||
lacking CMake.
|
|
||||||
|
|
||||||
Next, unpack the package in your home directory, and go into the created
|
Next, unpack the package in your home directory, and go into the created
|
||||||
directory.
|
directory.
|
||||||
|
|
||||||
|
If there are any extra modules you want to enable, such as m_mysql, run
|
||||||
|
the 'extras' script to enable them. If you do not know you can come back
|
||||||
|
later and enable them.
|
||||||
|
|
||||||
Now type ./Config to start the configuration script. It will ask you a
|
Now type ./Config to start the configuration script. It will ask you a
|
||||||
few questions, and figure out how to compile Anope on your system. If
|
few questions, and figure out how to compile Anope on your system. If
|
||||||
you are unsure about the answer to a question, use the default value.
|
you are unsure about the answer to a question, use the default value.
|
||||||
The question to using configure or cmake depends on your decision from
|
|
||||||
above. If you have CMake and wish to use it, answer with cmake, otherwise
|
|
||||||
answer with configure.
|
|
||||||
|
|
||||||
You can now type make to compile Anope. If there are errors in the
|
Now cd build and type make and make install. This will install
|
||||||
Makefile, *try to use gmake* instead. If it still doesn't work, you (or
|
|
||||||
the system administrator if it's a shell) must install GNU make. You may
|
|
||||||
find it at ftp://prep.ai.mit.edu/pub/gnu/.
|
|
||||||
|
|
||||||
Now type make install (or gmake install; see above). This will install
|
|
||||||
all the needed files in the paths you specified with the configure
|
all the needed files in the paths you specified with the configure
|
||||||
script, and setup file permissions. You should ensure that the data
|
script, and setup file permissions. You should ensure that the data
|
||||||
directory is not accessible by other users, as malicious users may
|
directory is not accessible by other users, as malicious users may
|
||||||
cause trouble on your network if passwords are not encrypted, or read
|
cause trouble on your network if passwords are not encrypted, or read
|
||||||
the memos of any user.
|
the memos of any user.
|
||||||
|
|
||||||
If you see errors during this process, please mail us with the *complete*
|
Now go into the conf directory (by default, ~/services/conf). Copy the example
|
||||||
error output, and don't forget to mention your OS, compiler and C++ library
|
|
||||||
versions.
|
|
||||||
|
|
||||||
Now go into the data directory (by default, ~/services/data). Copy the example
|
|
||||||
configuration file (example.conf) to services.conf, and open the latter
|
configuration file (example.conf) to services.conf, and open the latter
|
||||||
with your favorite text editor. It contains all the configuration
|
with your favorite text editor. It contains all the configuration
|
||||||
directives Anope will use at startup. Read the instructions contained in
|
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
|
the file carefully. Using the default values is NOT a good idea, and will
|
||||||
most likely not work!
|
most likely not work!
|
||||||
|
|
||||||
If you need help, you should subscribe to the Anope mailing list and mail
|
If you need help, you should visit http://forum.anope.org/ or #anope on
|
||||||
there to get help from other users. See the README file for more
|
irc.anope.org. Provide *complete* error output, along with other relevant
|
||||||
information.
|
information eg. OS, compiler and C++ library versions.
|
||||||
|
See the README file for more information.
|
||||||
|
|
||||||
2) Upgrading Anope
|
2) Upgrading Anope
|
||||||
|
|
||||||
If you got a .diff file and want to patch the old Anope sources with it,
|
|
||||||
do the following:
|
|
||||||
|
|
||||||
* Copy the .diff file into the root Anope sources directory.
|
|
||||||
* Type patch -p1 <file.diff
|
|
||||||
|
|
||||||
Note that upgrading anope with a patchfile isn't recommended. You should
|
|
||||||
download a new, clean source package, as this will give the best results.
|
|
||||||
|
|
||||||
To upgrade Anope, just follow the installation instructions described in
|
To upgrade Anope, just follow the installation instructions described in
|
||||||
section 1. There are however a few specific guidelines:
|
section 1. There are however a few specific guidelines:
|
||||||
|
|
||||||
@@ -99,63 +76,19 @@ Note: You should also read the README and FAQ files!
|
|||||||
3) Setting up the IRCd
|
3) Setting up the IRCd
|
||||||
|
|
||||||
Services acts as an IRC server with pseudo-clients on it. To link them to
|
Services acts as an IRC server with pseudo-clients on it. To link them to
|
||||||
your network, you'll need to add some lines in the ircd.conf of their hub
|
your network, you'll need to configure your IRCd to allow services to link.
|
||||||
server (as stated in the RemoteServer configuration directive).
|
|
||||||
|
|
||||||
For samples below we'll take services.localhost.net as the name of the
|
The configuration varies depending on the IRCd, but you will probably need
|
||||||
Services (as stated in the ServerName configuration directive). Note that
|
a link block (also called connect block, or C line), a U line (also called
|
||||||
this samples are made to be as generic as possible, but there might be
|
a shared block), and be sure that the IRCd is listneing on the given port
|
||||||
small variations, depending on your IRCd. For IRCd-specific help with
|
in the link block.
|
||||||
configuration, read near the end of this section.
|
|
||||||
|
|
||||||
First, the C/N lines, that allow Services to link. They also need a
|
Example link configurations can be found in example.conf for some of the
|
||||||
Y:line to work correctly.
|
popular IRCds.
|
||||||
|
|
||||||
Y:27:180:0:0:4000000
|
|
||||||
C:127.0.0.1:mypass:services.localhost.net::30
|
|
||||||
N:127.0.0.1:mypass:services.localhost.net::30
|
|
||||||
|
|
||||||
"mypass" is the same password you mentioned in the RemoteServer
|
|
||||||
configuration directive. 127.0.0.1 is the IP from which Services connect
|
|
||||||
from (linking in localhost is the most efficient way to run Services).
|
|
||||||
|
|
||||||
Then, you have to set-up an U:line, that will allow Services to change
|
|
||||||
channel modes, topics, and much more without being opped in the channel.
|
|
||||||
|
|
||||||
U:services.localhost.net:*:*
|
|
||||||
|
|
||||||
NOTE: if you have more than one server in your network, this line MUST
|
|
||||||
be added on ALL servers, or things won't work correctly.
|
|
||||||
|
|
||||||
Finally, you'll need to add an H:line, to make the OperServ JUPE command
|
|
||||||
work correctly.
|
|
||||||
|
|
||||||
H:*::Services.LocalHost.Net
|
|
||||||
|
|
||||||
Don't forget to /rehash your IRCd to apply changes.
|
Don't forget to /rehash your IRCd to apply changes.
|
||||||
|
|
||||||
A new trend in ircd configuration is popping all over the place, good
|
You may also try our interactive link maker, which is located at:
|
||||||
examples are the latest Hybrid, Unreal and Bahamut, which use a more
|
|
||||||
"readable" form of configuration. For those, use something like:
|
|
||||||
|
|
||||||
link services.localhost.net
|
|
||||||
{
|
|
||||||
username *;
|
|
||||||
hostname localhost;
|
|
||||||
bind-ip *;
|
|
||||||
port 6667;
|
|
||||||
hub *;
|
|
||||||
password-connect "mypass";
|
|
||||||
password-receive "mypass";
|
|
||||||
class servers;
|
|
||||||
};
|
|
||||||
|
|
||||||
Note that this block-style configuration files differ heavily, depending
|
|
||||||
on the IRCd. Consult the interactive link maker (link is below) for more
|
|
||||||
details on the exact configuration used by your IRCd.
|
|
||||||
|
|
||||||
If you're unable to get a link with your IRCd after reading this section,
|
|
||||||
you might try the interactive link maker, which is located at:
|
|
||||||
|
|
||||||
http://anope.org/ilm.php
|
http://anope.org/ilm.php
|
||||||
|
|
||||||
@@ -183,7 +116,7 @@ Note: You should also read the README and FAQ files!
|
|||||||
still running, and restart it if not.
|
still running, and restart it if not.
|
||||||
|
|
||||||
First rename the example.chk script that is in Anope path (by default,
|
First rename the example.chk script that is in Anope path (by default,
|
||||||
this is ~/services/data) to services.chk and edit it. You'll need to
|
this is ~/services/conf) to services.chk and edit it. You'll need to
|
||||||
modify the CONFIGURATION part of the file. Then ensure that the file is
|
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 services.chk, and try to launch the
|
||||||
script to see if it works (Anope must not be running when you do this ;))
|
script to see if it works (Anope must not be running when you do this ;))
|
||||||
@@ -192,7 +125,7 @@ Note: You should also read the README and FAQ files!
|
|||||||
This will open the default text editor with the crontab file. Enter the
|
This will open the default text editor with the crontab file. Enter the
|
||||||
following (with correct path):
|
following (with correct path):
|
||||||
|
|
||||||
*/5 * * * * /home/ircd/services/data/services.chk >/dev/null 2>&1
|
*/5 * * * * /home/ircd/services/conf/services.chk >/dev/null 2>&1
|
||||||
|
|
||||||
The */5 at the beginning means "check every 5 minutes". You may replace
|
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
|
the 5 with other another number if you want (but less than 60). Consult
|
||||||
|
|||||||
+109
-169
@@ -1,209 +1,149 @@
|
|||||||
Installation et instructions d'anope
|
Instructions d'installation d'Anope
|
||||||
------------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
1) Instalation d'anope
|
1) Installation d'Anope
|
||||||
2) Mise à jour d'anope
|
2) Mettre à jour Anope
|
||||||
3) Configuration de l'ircd
|
3) Configuration de l'IRCd
|
||||||
4) Mise en route de anope
|
4) Mettre en route Anope
|
||||||
5) Mise en place d'un fichier crontab
|
5) Mettre en place un crontab
|
||||||
|
|
||||||
Note: Vous devrez également lire les fichiers README et FAQ !
|
Note : Vous devrez également lire les fichiers README et FAQ !
|
||||||
|
|
||||||
1) Installation de anope
|
1) Installation d'Anope
|
||||||
|
|
||||||
Note importante: il n'est pas recommandé d'utiliser (et même d'installer)
|
NOTE IMPORTANTE : il est déconseillé d'utiliser (et même d'installer)
|
||||||
Anope en tant que root.
|
Anope en tant que root. Utilisez un utilisateur non
|
||||||
Utilisez un utilisateur non privilégié,
|
privilégié. Celui que vous utilisez pour l'IRCd ou
|
||||||
|
un utilisateur dédié suffira.
|
||||||
|
|
||||||
|
La première chose que vous devez faire est d'obtenir le package Anope
|
||||||
|
(si ce n'est déjà fait). Vous pouvez le trouver ici :
|
||||||
|
|
||||||
La première chose que vous devez faire est d'obtenir le package Anope (si ce n'est déjà fait).
|
http://www.anope.org/
|
||||||
|
|
||||||
Vous pouvez le trouver ici http://www.anope.org/
|
Anope nécessite cmake pour être compilé. Vous pouvez vérifier si CMake
|
||||||
|
est déjà installé sur votre système avec la commande :
|
||||||
|
|
||||||
|
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
|
||||||
|
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 :
|
||||||
|
|
||||||
Anope peut être installer de deux façons.
|
http://www.cmake.org/cmake/resources/software.html
|
||||||
|
|
||||||
1. La méthode recommandée est d'utiliser CMake.
|
Ensuite, décompressez le package dans votre répertoire home, et allez
|
||||||
Vous pouvez vérifier si CMake est déjà installé sur votre système en utilisant la
|
dans le répértoire qui vient d'être créé.
|
||||||
|
|
||||||
commande: cmake --version ( sur votre vps ou dedier etre loggué en root )
|
Si il y a des modules facultatifs que vous voulez activer comme m_mysql,
|
||||||
|
exécuter le script 'extras' pour les activer. Si vous ne savez pas, vous
|
||||||
|
pouvez les activer plus tard.
|
||||||
|
|
||||||
|
Maintenant, tapez ./Config pour lancer le script de configuration. Il
|
||||||
|
va vous poser quelques questions, et déterminer comment compiler Anope
|
||||||
|
sur votre système. Si vous ne savez pas comment répondre à une question,
|
||||||
|
utilisez la valeur par défaut.
|
||||||
|
|
||||||
Si c'est installé, vous aurez une ligne qui dit quelque chose qui ressemble à
|
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
|
||||||
|
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.
|
||||||
|
|
||||||
«version 2.6 cmake-patch 1".
|
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.
|
||||||
|
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
|
||||||
|
recommandée, et Anope ne fonctionnera probablement pas !
|
||||||
|
|
||||||
Si la version est inférieure à 2,4 ou si vous obtenez une erreur disant que la commande n'a pas été trouvé,
|
Si vous avez besoin d'aide, vous pouvez aller sur le site
|
||||||
vous ne serez pas en mesure d'utiliser CMake,
|
http://forum.anope.org/ ou le canal #anope sur irc.anope.org.
|
||||||
|
Fournissez *l'essemble* des erreurs qui apparaîssent, en plus de
|
||||||
|
toutes informations utiles, comme les versions de votre OS, du
|
||||||
|
compilateur utilisé et de la librairie C++. Lisez le fichier README
|
||||||
|
pour plus d'informations.
|
||||||
|
|
||||||
sauf si vous installez vous-même dans votre répertoire home. CMake
|
2) Mettre à jour Anope
|
||||||
vous pouvez le téléchargé ici > http://www.cmake.org/cmake/resources/software.html
|
|
||||||
|
|
||||||
|
Pour mettre à jour Anope, suivez simplement les instructions
|
||||||
|
d'installation décrites dans la section 1. Prenez garde cependant :
|
||||||
|
|
||||||
Si vous n'arrivez pas à installer (soit en raison du manque d'espace
|
* IMPORTANT : Sauvegardez vos anciennes bases de données !
|
||||||
ou de restrictions par votre fournisseur d'hébergement),
|
* Si vous mettez à jour vers une nouvelle version majeure,
|
||||||
vous pouvez encore utiliser le script de configuration fournis.
|
recommencez *toujours* toute votre configuration à partir du
|
||||||
Cette option n'est pas recommandée et finira par être retiré, mais il est fourni pour la compatibilité de ces
|
fichier example.conf.
|
||||||
manque de CMake.
|
|
||||||
|
|
||||||
|
3) Configuration de l'IRCd
|
||||||
|
|
||||||
|
Les Services agissent comme un serveur IRC avec des pseudo-clients.
|
||||||
|
Pour les relier à votre réseau, vous aurez besoin de configurer votre
|
||||||
|
IRCd pour permettre aux services de se connecter.
|
||||||
|
|
||||||
Ensuite, décompressez le package dans votre répertoire home, et allez dans le répértoire
|
La configuration dépend de l'IRCd utilisé, mais vous aurez probablement
|
||||||
qui viens d'être crée.
|
besoin d'un bloc link (aussi appelé connect block, ou C:line) et un
|
||||||
|
U:line (aussi appelé shared block). Assurez-vous que l'IRCd écoute
|
||||||
|
sur le port donné dans le bloc link.
|
||||||
|
|
||||||
Maintenant, tapez ./Config pour lancer le script de configuration. Il va vous poser
|
Des exemples de configurations de bloc link peuvent être trouvés dans
|
||||||
quelques questions, et compiler Anope sur votre système.
|
le fichier example.conf pour certains des IRCd les plus populaires.
|
||||||
|
|
||||||
Si vous ne savez pas repondre à une question, utilisez la valeur par défaut.
|
Souvenez-vous de /rehash votre IRCd pour appliquer les changements.
|
||||||
|
|
||||||
|
Vous pouvez également essayer notre créateur de bloc link interactif
|
||||||
Vous pouvez maintenant taper make pour compiler Anope. S'il ya des erreurs dans la
|
situé ici :
|
||||||
Makefile, * essayez d'utiliser * gmake au lieu. Si cela ne fonctionne toujours pas, vous (ou
|
|
||||||
votre fournisseur ) doit installer GNU make. Vous pouvez
|
|
||||||
le Trouvez sur ftp://prep.ai.mit.edu/pub/gnu/.
|
|
||||||
|
|
||||||
Maintenant, tapez make install (ou gmake install; voir ci-dessus). Cela permet d'installer
|
|
||||||
tous les fichiers nécessaires dans les chemins que vous avez spécifié dans la configuration
|
|
||||||
script, et les permissions du fichier de configuration. Vous devez vous assurer que les données
|
|
||||||
répertoire ne sont pas accessible par d'autres utilisateurs, que des utilisateurs malveillants peuvent
|
|
||||||
causer des problèmes sur votre réseau, si les mots de passe ne sont pas cryptés, ou de lire
|
|
||||||
les mémos de tout utilisateur.
|
|
||||||
|
|
||||||
Si vous voyez des erreurs lors de ce processus, s'il vous plaît nous envoyer un mail avec le * complet *
|
|
||||||
sortie d'erreur, et n'oubliez pas de mentionner votre OS, compilateur et bibliothèque C + +
|
|
||||||
versions.
|
|
||||||
|
|
||||||
Maintenant, allez dans le répertoire de données (par défaut, cd ~/services/data). ouvrer exemple.conf
|
|
||||||
avec votre éditeur de texte favori. Il contient toute la configuration
|
|
||||||
directives. Anope va l'utiliser au démarrage. Lisez attentivement les instructions contenues dans
|
|
||||||
le fichier. l'utilisation des valeurs par defauld n'est pas recomment et anope ne risque pas de fonctionner
|
|
||||||
|
|
||||||
|
|
||||||
Si vous avez besoin d'aide, vous devez vous abonner à la mailing list et par courrier Anope
|
|
||||||
pour se faire aider par d'autres utilisateurs. Voir le fichier README pour plus de
|
|
||||||
informations.
|
|
||||||
|
|
||||||
2) Mise à jour Anope
|
|
||||||
|
|
||||||
Si vous avez un fichier .Diff et que vous voulez patcher les ancienne sources Anope avec,
|
|
||||||
effectuer les opérations suivantes:
|
|
||||||
|
|
||||||
* Copiez le fichier .Diff dans le répertoire racine des sources Anope.
|
|
||||||
* Type de patch-p1 <file.diff
|
|
||||||
|
|
||||||
Notez que la mise à jour anope avec un fichier patch n'est pas recommandé.
|
|
||||||
Vous devez télécharger une nouvelle source propre, car cela vous donnera les meilleurs résultats..
|
|
||||||
|
|
||||||
Pour mettre à jour Anope, suivez simplement les instructions d'installation décrites dans
|
|
||||||
l'article 1. Il y a cependant quelques règles spécifiques:
|
|
||||||
|
|
||||||
* IMPORTANT: Sauvegardez vos anciennes bases de données!
|
|
||||||
* Si vous mettez à jour vers une nouvelle version majeure, toujours redémarrer avec un
|
|
||||||
fichier de configuration neuve example.conf.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3) Mise en place du IRCd
|
|
||||||
|
|
||||||
Ce Services agit comme un serveur IRC avec des pseudo-clients sur elle. Pour les relier à
|
|
||||||
votre réseau, vous aurez besoin d'ajouter quelques lignes dans le ircd.conf de leur plate-forme
|
|
||||||
serveur (comme indiqué dans la directive de configuration RemoteServer).
|
|
||||||
|
|
||||||
Pour les échantillons ci-dessous, nous allons prendre services.localhost.net que le nom de la
|
|
||||||
Services (comme indiqué dans la directive de configuration ServerName). Notez que
|
|
||||||
présente des échantillons sont faites pour être aussi générique que possible, mais il pourrait y avoir
|
|
||||||
de petites variations, en fonction de votre IRCd. Pour IRCd aide spécifique aux
|
|
||||||
de configuration, lire près de la fin de cette section.
|
|
||||||
|
|
||||||
Tout d'abord, les lignes C / N, qui permettent aux services de crée un lien. Ils ont également besoin d'un
|
|
||||||
Y: ligne fonctionne correctement.
|
|
||||||
|
|
||||||
Y: 27:180:0:0:4000000
|
|
||||||
C: 127.0.0.1: mypass: services.localhost.net: 30
|
|
||||||
N: 127.0.0.1: mypass: services.localhost.net: 30
|
|
||||||
|
|
||||||
"mot de pass" est le même mot de passe que vous avez mentionné dans le RemoteServer
|
|
||||||
directive de configuration. 127.0.0.1 est l'adresse IP à partir de laquelle les services se connecterons
|
|
||||||
à partir de (reliant en localhost est le moyen le plus efficace pour exécuter les services).
|
|
||||||
|
|
||||||
Ensuite, vous avez à mettre en place un U:ligne, qui permettra aux services de changer
|
|
||||||
modes de canal, de sujets, et bien plus encore, sans être op sur le canal.
|
|
||||||
|
|
||||||
U: services.localhost.net: *: *
|
|
||||||
|
|
||||||
REMARQUE: si vous avez plus d'un serveur dans votre réseau, cette ligne doit
|
|
||||||
être ajouté sur tous les autres serveurs, où cela ne risque pas de fonctionner correctement.
|
|
||||||
|
|
||||||
Enfin, vous aurez besoin d'ajouter un H:ligne, pour permttre la commande OperServ JUPE
|
|
||||||
de fonctionner correctement.
|
|
||||||
|
|
||||||
H:*::Services.LocalHost.Net
|
|
||||||
|
|
||||||
Ne pas oublier de /rehash votre IRCd pour appliquer les modifications.
|
|
||||||
|
|
||||||
Une nouvelle tendance dans la configuration ircd hybride, Unreal et Bahamut, qui utilisent une approche plus
|
|
||||||
«Lisibles» sous forme de configuration. Pour ceux, utiliser quelque chose comme:
|
|
||||||
|
|
||||||
link services.localhost.net
|
|
||||||
{
|
|
||||||
username *;
|
|
||||||
hostname localhost;
|
|
||||||
bind-ip *;
|
|
||||||
port 6667;
|
|
||||||
hub *;
|
|
||||||
password-connect "mypass";
|
|
||||||
password-receive "mypass";
|
|
||||||
class servers;
|
|
||||||
};
|
|
||||||
|
|
||||||
Notez que ce bloc de fichiers de configuration de style est diffèrent
|
|
||||||
sur le IRCd. Consultez le fabricant de lien interactif (le lien est ci-dessous) pour plus
|
|
||||||
détails sur la configuration exacte utilisée par votre IRCd.
|
|
||||||
|
|
||||||
Si vous êtes incapable d'obtenir un lien avec votre IRCd après la lecture de cet article,
|
|
||||||
vous pouvez essayer le fabricant lien interactif, qui est situé au:
|
|
||||||
|
|
||||||
http://anope.org/ilm.php
|
http://anope.org/ilm.php
|
||||||
|
|
||||||
4) A partir Anope
|
4) Mettre en route Anope
|
||||||
|
|
||||||
Allez dans le répertoire où les fichiers binaires ont été installés (par défaut, ce n'est
|
Allez dans le répertoire où les fichiers binaires ont été installés
|
||||||
~/ Services/ bin). Tapez. /Services à lancer Anope.
|
(par défaut, ~/services/bin). Tapez ./services pour lancer Anope.
|
||||||
|
|
||||||
S'il ya des erreurs de syntaxe dans le fichier de configuration, ils seront
|
S'il y a des erreurs de syntaxe dans le fichier de configuration, elles
|
||||||
affiche sur l'écran. Corrigez-les jusqu'à ce qu'il n'y à plus d'erreur.
|
seront affichées à l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait
|
||||||
Un démarrage réussi ne générera pas de message.
|
plus. Un démarrage réussi ne générera pas de message.
|
||||||
|
|
||||||
Donner aux services au moins une minute pour se connecté à votre réseau, comme certains
|
Donnez aux services au moins une minute pour se connecter à votre
|
||||||
IRCds sur certains OS peut être très lent pour le processus de liaison. Si rien n'arrive après environ une minute,
|
réseau, car certains IRCds sur certains systèmes peuvent être très
|
||||||
il y a probablement un problème de configuration. Essayez
|
lents pour le processus de liaison. Si rien ne se passe après environ
|
||||||
de lancer Anope en mode debug ./services-debug-nofork pour voir toutes les erreurs qu'il
|
une minute, il y a probablement un problème de configuration. Essayez
|
||||||
rencontres, et d'essayer de les corriger.
|
de lancer Anope en mode debug avec ./services -debug -nofork pour voir
|
||||||
|
toutes les erreurs rencontrées et essayez de les corriger.
|
||||||
|
|
||||||
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à vous abonner à la Anope
|
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à
|
||||||
liste de diffusion et de poser là. Voir le fichier README pour plus de détails.
|
vous abonner à la liste de diffusion Anope et d'y poser vos question.
|
||||||
|
Voir le fichier README pour plus de détails.
|
||||||
|
|
||||||
5) Mettre en place un crontab
|
5) Mettre en place un crontab
|
||||||
|
|
||||||
Une entrée crontab vous permettra de vérifier périodiquement que Anope est
|
Une entrée crontab vous permettra de vérifier périodiquement si Anope
|
||||||
toujours en cours, et redémarrez-le s'il n'est pas.
|
est toujours en cours d'exécution et de le redémarrer s'il n'est pas.
|
||||||
|
|
||||||
D'abord renommer le script example.chk qui est dans le chemin de Anope (par défaut,
|
D'abord renommez le script example.chk qui est dans les dossiers
|
||||||
cela est ~/services/data) pour services.chk et le modifier. Vous aurez besoin de
|
d'Anope (par défaut, ~/services/conf) en services.chk et modifiez-le.
|
||||||
modifier la partie configuration du fichier. Assurez-vous ensuite que le fichier est
|
Vous aurez besoin de modifier la partie CONFIGURATION du fichier.
|
||||||
marqué comme exécutable en tapant chmod + x services.chk, et essayer de lancer le
|
Assurez-vous ensuite que le fichier est marqué comme exécutable en
|
||||||
script pour voir si cela fonctionne (Anope ne doit pas être en marche lorsque vous faites cela ;))
|
tapant chmod +x services.chk et essayez de lancer le script pour voir
|
||||||
|
si cela fonctionne (Anope ne doit pas être en marche lorsque vous
|
||||||
|
testez cela ;))
|
||||||
|
|
||||||
Lorsque cela est fait, vous devrez ajouter l'entrée crontab. Type de crontab-e.
|
Lorsque c'est fait, vous devrez ajouter l'entrée crontab. Entrez
|
||||||
Cela va ouvrir l'éditeur de texte par défaut avec le fichier crontab. Entrez le chemin
|
crontab -e. Cela va ouvrir l'éditeur de texte par défaut avec le
|
||||||
suivant (avec le chemin correct):
|
fichier crontab. Entrez la ligne suivante (avec le chemin correct) :
|
||||||
|
|
||||||
* / 5 * * * * /home/ircd/services/data/services.chk> /dev/nul 2> & 1
|
*/5 * * * * /home/ircd/services/conf/services.chk > /dev/null 2>&1
|
||||||
|
|
||||||
Le * / 5 au commencement signifie "vérifier toutes les 5 minutes". Vous pouvez remplacer
|
Le */5 au début signifie "vérifier toutes les 5 minutes". Vous pouvez
|
||||||
le 5 avec un autre numéro si vous voulez (mais moins de 60). Consulter
|
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
|
||||||
pages de manuel de votre système pour plus de détails sur la syntaxe de la crontab
|
Consultez les pages de manuel de votre système pour plus de détails sur
|
||||||
fichier. Intéressant pages de manuel sont crontab (5), crontab (1) et cron (8).
|
la syntaxe du fichier crontab. Les pages de manuel intéressantes sont
|
||||||
|
crontab(5), crontab(1) et cron(8).
|
||||||
|
|
||||||
Sauvegarder et quitter, et il est installé.
|
Sauvegardez, quittez, et c'est installé !
|
||||||
|
|||||||
@@ -1,202 +0,0 @@
|
|||||||
How To Add IRCd Support
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
1) Files to Edit
|
|
||||||
2) The Code
|
|
||||||
3) The IRCDVar struct
|
|
||||||
4) Modes
|
|
||||||
5) Functions / Events
|
|
||||||
6) CAPAB/PROTOCTL
|
|
||||||
7) IRCDProto Class
|
|
||||||
|
|
||||||
1) Files to Edit
|
|
||||||
|
|
||||||
When preparing to add supprt to Anope for your IRCd, you need to edit
|
|
||||||
the following files
|
|
||||||
|
|
||||||
A) Make a copy of the .cpp file of the IRCd that matches the IRCd that
|
|
||||||
you are attempting to add support for best.
|
|
||||||
B) Add your IRCd into the supported IRCds in example.conf
|
|
||||||
|
|
||||||
2) The Code
|
|
||||||
|
|
||||||
Here is where the code of the .cpp file comes in. Be prepared to spend at
|
|
||||||
least an hour, if not longer, going over the code and getting it right;
|
|
||||||
Especially if you are setting up an ircd that is completely different
|
|
||||||
than the one you used as a base. This section covers the majority of the
|
|
||||||
code that is in use.
|
|
||||||
|
|
||||||
The first bit of code you will face is the IRCDVar structure, This is one
|
|
||||||
of two structs which holds your IRCd information; This allows you to quickly
|
|
||||||
setup your specific ircd.
|
|
||||||
|
|
||||||
IRCDVar myIrcd[] = { };
|
|
||||||
|
|
||||||
This struct contains your basic IRCd functions. Your base source file has
|
|
||||||
the list of all available variables; note that you should not swap any
|
|
||||||
around, or you will break stuff. Here is a brief description of the usage
|
|
||||||
of each.
|
|
||||||
|
|
||||||
1) Name: This member tells Anope about the IRCD's name. It may contain
|
|
||||||
text about it's name and version. This is used to identify the
|
|
||||||
build on startup.
|
|
||||||
|
|
||||||
2) Pseudo Client Mode: This is the user mode set by Anope on all BotServ
|
|
||||||
bots. Normally you want this to be a some form of
|
|
||||||
service or bot flag; you can use + for no mode at
|
|
||||||
all.
|
|
||||||
|
|
||||||
3) Max Channelmode Symbols: This is the total number of possible channel
|
|
||||||
modes that can appear before a nick. Do
|
|
||||||
remember to count each possible mode, so +ov
|
|
||||||
is 2.
|
|
||||||
|
|
||||||
4) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise,
|
|
||||||
KILL is used. Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
5) VHOST: Can a user's host be changed on the fly? Enabling this allow
|
|
||||||
HostServ online. Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
6) SNLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
|
|
||||||
0 for no.
|
|
||||||
|
|
||||||
7) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
8) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
10) Join to Message: Services must join a channel to send any message to
|
|
||||||
that channel (cannot override +n). Use 1 for yes,
|
|
||||||
0 for no.
|
|
||||||
|
|
||||||
11) SQline Channels: The IRCd's supports banning channel names via
|
|
||||||
SQLINES. Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
12) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a
|
|
||||||
QUIT message for that user? Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
13) SVSMODE UNBAN: We can use SVSMODE to unban hosts from a channel. Use
|
|
||||||
1 for yes, 0 for no.
|
|
||||||
|
|
||||||
14) Reverse: We can do a reverse check when unbanning. For use with
|
|
||||||
DreamForge based IRCd's. Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
15) vIdent: Support for including a user's ident in their vHost. Use
|
|
||||||
1 for yes, 0 for no.
|
|
||||||
|
|
||||||
16) SVSHOLD: Support for temporarily 'holding' a nick, instead of using
|
|
||||||
a nick enforcer client. Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
17) TS on MODE: We need to send a timestamp when modes are being changed.
|
|
||||||
Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
18) Umode: We can use OperServ to change a user's mode. Use 1 for yes,
|
|
||||||
0 for no.
|
|
||||||
|
|
||||||
19) OMODE: We can use OperServ to give some user a temporary O:LINE.
|
|
||||||
Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
20) No Knock Requires +i: Does the No Knock channel mode require invite
|
|
||||||
only channels? Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
21) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
|
|
||||||
1 for yes, 0 for no.
|
|
||||||
|
|
||||||
22) SGline Enforce: Does the IRCd enforce SNLINES for us or do we need to
|
|
||||||
do so? Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
23) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
|
|
||||||
|
|
||||||
24) Global TLD Prefix: Prefix used to send global messages, should probably
|
|
||||||
be "$"
|
|
||||||
|
|
||||||
25) Max Modes: The max number of mode changes we can send in one line
|
|
||||||
|
|
||||||
3) Modes
|
|
||||||
|
|
||||||
Anope is told about modes in the protocol module.
|
|
||||||
For the most part, the syntax for adding channel and user modes are:
|
|
||||||
|
|
||||||
ModeManager::AddUserMode(new UserMode(UMODE_NETADMIN, "UMODE_NETADMIN", 'N'));
|
|
||||||
Where 'N' is the char for the mode, and UMODE_NETADMIN shows what the
|
|
||||||
mode does. Or:
|
|
||||||
|
|
||||||
ModeManager::AddChannelMode(new ChannelMode(CMODE_BLOCKCOLOR, "CMODE_BLOCKCOLOR", 'c'));
|
|
||||||
Where 'c' is the char for the mode and CMODE_BLOCKCOLOR shows what
|
|
||||||
the mode does
|
|
||||||
|
|
||||||
A full list of valid mode names for the second param can be found
|
|
||||||
in services.h in the enum for ChannelModeName and UserModeName
|
|
||||||
If necessary, you can add additional modes to this list.
|
|
||||||
|
|
||||||
Adding simple modes with parameters is similar, instead adding a
|
|
||||||
'new ChannelMode', use 'new ChannelModeParam', set the third optional
|
|
||||||
arg of ChannelModeParam to false if the param should NOT be sent when unsetting
|
|
||||||
it. Eg:
|
|
||||||
|
|
||||||
ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, "CMODE_JOINFLOOD", 'j', true));
|
|
||||||
|
|
||||||
Anope will internally track the params, and they can be retrieved through
|
|
||||||
Channel::GetParam();
|
|
||||||
|
|
||||||
If you want to make param validity checking for a mode, you must create a new
|
|
||||||
class which inherits from ChannelModeParam and overload the IsValid function.
|
|
||||||
Modes CMODE_OPERONLY, CMODE_ADMINONLY, and CMODE_REGISTERED already exist
|
|
||||||
internally as classes, to overload the CanSet function to disable non opers
|
|
||||||
from mlocking (or in CMODE_REGISTERED's case, anyone) from setting them.
|
|
||||||
This should be added like:
|
|
||||||
|
|
||||||
ModeManager::AddChannelMode(new ChannelModeOper('O'));
|
|
||||||
|
|
||||||
4) Functions and Events
|
|
||||||
|
|
||||||
A brief word about functions and events. All events are captured by creating a Message struct
|
|
||||||
with the name of the message and the callback function:
|
|
||||||
|
|
||||||
Message my_message("MESSAGE", do_my_messsage);
|
|
||||||
|
|
||||||
Each message should have a message handler if its important enough to be
|
|
||||||
processed by services. All event functions should be formed like this:
|
|
||||||
|
|
||||||
bool do_my_message(const Anope::string &source, const std::vector<Anope::string> ¶ms)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
They will receive the source; this can be empty at times depending on the
|
|
||||||
event. Next, params holds the arguments for the event. Events are likely to
|
|
||||||
pass to various upper level event handlers; see the previous ircd source for
|
|
||||||
how they handle these events.
|
|
||||||
|
|
||||||
5) CAPAB/PROTOCTL
|
|
||||||
|
|
||||||
Most IRCDs send a CAPAB or PROTOCTL line so that they can work out what
|
|
||||||
the other end of the connection is capable of doing. The protocol module should
|
|
||||||
handle all of these without the cores knowledge with the exception of the following:
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
|
||||||
Define | Description
|
|
||||||
----------------|---------------------------------------------------------
|
|
||||||
CAPAB_NOQUIT | NOQUIT protocol support
|
|
||||||
CAPAB_TSMODE | Chanmodes are timestamped
|
|
||||||
CAPAB_UNCONNECT | UNCONNECT protocol support
|
|
||||||
CAPAB_QS | Quitstorm - same as NOQUIT
|
|
||||||
|
|
||||||
You can override the default OnCapab method in IRCdMessage if required.
|
|
||||||
|
|
||||||
6) IRCDProto Class
|
|
||||||
|
|
||||||
The IRCDProto class is set up like:
|
|
||||||
|
|
||||||
class MyIRCdProto : public IRCDProto { } ircdproto;
|
|
||||||
|
|
||||||
And told to Anope through the
|
|
||||||
|
|
||||||
pmodule_ircd_proto(&ircd_proto);
|
|
||||||
|
|
||||||
function.
|
|
||||||
|
|
||||||
This is used for sending out specific messages from Anope to your IRCd.
|
|
||||||
A list of all of the valid function names to overload and their args
|
|
||||||
are in services.h. If the protocol module you are editing is similar enough
|
|
||||||
to the IRCd you are adding support for, many of these probably won't need to
|
|
||||||
be changed.
|
|
||||||
+12
-5
@@ -8,8 +8,15 @@ Anope Mutli Language Support
|
|||||||
1) Building Anope with gettext support
|
1) Building Anope with gettext support
|
||||||
|
|
||||||
To build Anope with gettext support, gettext and its development libraries must be installed on the system.
|
To build Anope with gettext support, gettext and its development libraries must be installed on the system.
|
||||||
Anope does not require locales to be installed or enabled on the system, but does require the locales-all
|
|
||||||
package on Debian and Debian based systems.
|
On Debian install the locales-all package.
|
||||||
|
|
||||||
|
On Ubuntu run locale-gen for each language you want to enable.
|
||||||
|
For example:
|
||||||
|
locale-gen es_ES.UTF-8
|
||||||
|
|
||||||
|
Then execute:
|
||||||
|
dpkg-reconfigure locales
|
||||||
|
|
||||||
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
||||||
|
|
||||||
@@ -31,16 +38,16 @@ Anope Mutli Language Support
|
|||||||
|
|
||||||
3) Using langages with modules
|
3) Using langages with modules
|
||||||
|
|
||||||
Module authors can easially add the ability to have their modules translated by adding _() around the strings they
|
Module authors can easily add the ability to have their modules translated by adding _() around the strings they
|
||||||
want translated (messages to the user, etc).
|
want translated (messages to the user, etc).
|
||||||
|
|
||||||
If you want to translate a module someone has made, first generate a .pot file if there isn't one already using
|
If you want to translate a module someone has made, first generate a .pot file if there isn't one already using
|
||||||
`xgettext -s -d modulename -o modulename.pot --from-code=utf-8 modulename.cpp`.
|
`xgettext -s -d modulename -o modulename.pot --from-code=utf-8 --keyword --keyword=_ modulename.cpp`.
|
||||||
The .pot file is a template of all of the language strings extracted from the source file.
|
The .pot file is a template of all of the language strings extracted from the source file.
|
||||||
|
|
||||||
Next, run msginit on the .pot file with
|
Next, run msginit on the .pot file with
|
||||||
`msginit -l language -o modulename.language.po -i modulename.pot`.
|
`msginit -l language -o modulename.language.po -i modulename.pot`.
|
||||||
Translate the new .po file and rerun ./Config; make && make install.
|
Translate the new .po file and rerun ./Config; make && make install.
|
||||||
|
|
||||||
All .po and .pot files should be placed in modules/language/third. Additionally an update script is provided there
|
All .po and .pot files should be placed in modules/third/language. Additionally an update script is provided there
|
||||||
that will create .pot files and merge any changes to it with existing .po files.
|
that will create .pot files and merge any changes to it with existing .po files.
|
||||||
|
|||||||
+20
-13
@@ -1,7 +1,7 @@
|
|||||||
Anope -- a set of IRC services for IRC networks
|
Anope -- a set of IRC services for IRC networks
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
|
|
||||||
Anope is 2003-2012 Anope Team <team@anope.org>.
|
Anope is 2003-2014 Anope Team <team@anope.org>.
|
||||||
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
|
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
|
||||||
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
|
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
|
||||||
|
|
||||||
@@ -107,14 +107,18 @@ Table of Contents
|
|||||||
|
|
||||||
Anope Translations:
|
Anope Translations:
|
||||||
|
|
||||||
* GeniusDex <geniusdex@anope.org> (nl.l)
|
* Robby <robby@chat.be> (nl_NL)
|
||||||
* Kein <kein-of@yandex.ru> (ru.l)
|
* Kein <kein-of@yandex.ru> (ru_RU)
|
||||||
* Maik Funke <Han@mefalcon.org> (de.l)
|
* Maik Funke <Han@mefalcon.org> (de_DE)
|
||||||
* Gabriel Acevedo H. <drstein@anope.org> (es.l)
|
* Isaac Fontal <i_fontal@hotmail.com> (es_ES)
|
||||||
* Janos Kapitany <sarkanyka@cjbchat.hu> (hun.l)
|
* Janos Kapitany <sarkanyka@cjbchat.hu> (hu_HU)
|
||||||
* Szymon S'wierkosz <szymek@adres.pl> (pl.l)
|
* Szymon S'wierkosz <szymek@adres.pl> (pl_PL)
|
||||||
* Christopher N. <saka@epiknet.org> (fr.l)
|
* Christopher N. <saka@epiknet.org> (fr_FR)
|
||||||
* Yusuf Kurekci <ysfm.20@gmail.com> (tr.l)
|
* Yusuf Kurekci <ysfm.20@gmail.com> (tr_TR)
|
||||||
|
|
||||||
|
Anope Web panel:
|
||||||
|
|
||||||
|
* Denis M. (Phr33d0m) <god@politeia.in>
|
||||||
|
|
||||||
2) Presentation
|
2) Presentation
|
||||||
|
|
||||||
@@ -165,10 +169,13 @@ Table of Contents
|
|||||||
Anope currently works with:
|
Anope currently works with:
|
||||||
|
|
||||||
* Bahamut 1.4.27 or later (including 1.8)
|
* Bahamut 1.4.27 or later (including 1.8)
|
||||||
* InspIRCd 1.1, 1.2, or 2.0
|
* Charybdis 3.4 or later
|
||||||
|
* Hybrid 8.1 or later
|
||||||
|
* InspIRCd 1.2 or 2.0
|
||||||
|
* ngIRCd 19.2 or later
|
||||||
|
* Plexus 3 or later
|
||||||
* Ratbox 2.0.6 or later
|
* Ratbox 2.0.6 or later
|
||||||
* UnrealIRCd 3.2 or later
|
* UnrealIRCd 3.2 or later
|
||||||
* Plexus 3 or later
|
|
||||||
|
|
||||||
Anope could also work with some of the daemons derived by the ones listed
|
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.
|
above, but there's no support for them if they work or don't work.
|
||||||
@@ -195,10 +202,10 @@ Table of Contents
|
|||||||
--version Display the version of Anope
|
--version Display the version of Anope
|
||||||
--nothird Do not load the non-core modules specified
|
--nothird Do not load the non-core modules specified
|
||||||
--protocoldebug Debug each incoming message after protocol parsing
|
--protocoldebug Debug each incoming message after protocol parsing
|
||||||
--support Used for support, same as -debug -nofork -nothird
|
--support Used for support, same as --debug --nofork --nothird
|
||||||
|
|
||||||
Upon starting, Anope will parse its command-line parameters then
|
Upon starting, Anope will parse its command-line parameters then
|
||||||
(assuming the -nofork option is not given) detach itself and run in the
|
(assuming the --nofork option is not given) detach itself and run in the
|
||||||
background. If Anope encounters a problem reading the database files or
|
background. If Anope encounters a problem reading the database files or
|
||||||
cannot connect to its uplink server, it will terminate immediately;
|
cannot connect to its uplink server, it will terminate immediately;
|
||||||
otherwise, it will run until the connection is terminated (or a QUIT,
|
otherwise, it will run until the connection is terminated (or a QUIT,
|
||||||
|
|||||||
+160
@@ -0,0 +1,160 @@
|
|||||||
|
Starting in Anope 1.9.9, Anope has Redis database support (http://redis.io/).
|
||||||
|
This document explains the data structure used by Anope, and explains how
|
||||||
|
keyspace notification works.
|
||||||
|
|
||||||
|
This is not a tutorial on how to use Redis, see http://redis.io/documentation
|
||||||
|
for that.
|
||||||
|
|
||||||
|
Table of Contents
|
||||||
|
-----------------
|
||||||
|
1) Data structure
|
||||||
|
2) Keyspace notifications
|
||||||
|
3) Examples of modifying, deleting, and creating objects
|
||||||
|
|
||||||
|
1) Data structure
|
||||||
|
|
||||||
|
There are 4 key namespaces in Anope, they are:
|
||||||
|
|
||||||
|
id - The keys in id are used to atomically create object ids for new
|
||||||
|
objects. For example, if I were to create a new BotInfo I would first:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> INCR id:BotInfo
|
||||||
|
|
||||||
|
To get the object ID of the new object.
|
||||||
|
|
||||||
|
ids - The keys in ids contain a set of all object ids of the given type.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> SMEMBERS ids:BotInfo
|
||||||
|
|
||||||
|
Returns "1", "2", "3", "4", "5", "6", "7", "8" because I have 8 bots that
|
||||||
|
have IDs 1, 2, 3, 4, 5, 6, 7, and 8, respectively.
|
||||||
|
|
||||||
|
hash - The keys in hash are the actual objects, stored as hashes. For
|
||||||
|
example, if I had just looked up all BotInfo ids and wanted to iterate
|
||||||
|
over all of them, I woulld start by:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> HGETALL hash:BotInfo:1
|
||||||
|
|
||||||
|
Which gets all keys and values from the hash of type BotInfo with id 1.
|
||||||
|
This may return:
|
||||||
|
|
||||||
|
"nick" -> "BotServ"
|
||||||
|
"user" -> "services"
|
||||||
|
"host" -> "services.anope.org"
|
||||||
|
"created" -> "1368704765"
|
||||||
|
|
||||||
|
value - The keys in value only exist to aid looking up object IDs. They
|
||||||
|
are sets of object IDs and are used to map key+value pairs to objects.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nick:Adam
|
||||||
|
|
||||||
|
Returns a set of object ids of NickAlias objects that have the key
|
||||||
|
'nick' set to the value 'Adam' in its hash. Clearly this can only
|
||||||
|
ever contain at most one object, since it is not possible to have
|
||||||
|
more than one registered nick with the same name, but other keys
|
||||||
|
will contain more than one, such as:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> SMEMBERS value:NickCore:email:adam@anope.org
|
||||||
|
|
||||||
|
Which would return all accounts with the email "adam@anope.org".
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> SMEMBERS value:ChanAccess:mask:Adam
|
||||||
|
|
||||||
|
Which would return all access entries set on the account "Adam".
|
||||||
|
|
||||||
|
Behavior similar to SQL's AND, can be achieved using the
|
||||||
|
SINTER command, which does set intersection on one or more sets.
|
||||||
|
|
||||||
|
2) Keyspace notifications
|
||||||
|
|
||||||
|
Redis 2.7 (unstable) and 2.8 (stable) and newer support keyspace notifications
|
||||||
|
(http://redis.io/topics/notifications). This allows Redis to notify Anope of
|
||||||
|
any external changes to objects in the database. Once notified, Anope will
|
||||||
|
immediately update the object. Otherwise, Anope keeps all objects in memory
|
||||||
|
and will not regularly read from the databaes once started.
|
||||||
|
|
||||||
|
You can use this to modify objects in Redis and have them immediately reflected
|
||||||
|
back into Anope. Additionally you can use this feature to run multiple Anope
|
||||||
|
instances simultaneously from the same database (see also, Redis database
|
||||||
|
replication).
|
||||||
|
|
||||||
|
To use keyspace notifications you MUST execute
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> CONFIG SET notify-keyspace-events KA
|
||||||
|
OK
|
||||||
|
|
||||||
|
or set notify-keyspace-events in redis.conf properly. Anope always executes
|
||||||
|
CONFIG SET when it first connects.
|
||||||
|
|
||||||
|
If you do not enable keyspace events properly Anope will be UNABLE to see any
|
||||||
|
object modifications you do.
|
||||||
|
|
||||||
|
The key space ids and value are managed entirely by Anope, you do
|
||||||
|
not (and should not) modify them. Once you modify the object (hash), Anope will
|
||||||
|
update them for you to correctly refelect any changes made to the object.
|
||||||
|
|
||||||
|
Finally, always use atomic operations. If you are inserting a new object with
|
||||||
|
multiple commands, or inserting multiple objects at once, specifically if the
|
||||||
|
objects depend on each other, you MUST use a transaction.
|
||||||
|
|
||||||
|
3) Examples of modifying, deleting, and creating objects
|
||||||
|
|
||||||
|
These examples will ONLY work if you meet the criteria in section 2.
|
||||||
|
|
||||||
|
If I want to change the email account 'Adam' to 'Adam@anope.org', I would execute the following:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
|
||||||
|
|
||||||
|
Which returns a value of "1", which is the object id I want to modify.
|
||||||
|
Now to change the email:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> HSET hash:NickCore:1 email Adam@anope.org
|
||||||
|
|
||||||
|
You can now see this in NickServ's INFO command:
|
||||||
|
-NickServ- Email address: Adam@anope.org
|
||||||
|
|
||||||
|
If I want to drop the account "Adam", I would execute the following:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
|
||||||
|
|
||||||
|
Which returns a value of "1". I would then check:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nc:Adam
|
||||||
|
|
||||||
|
To see what nicknames depend on this account to exist, as I will
|
||||||
|
have to remove those too. This returns the values "2", and "3".
|
||||||
|
|
||||||
|
Finally, I can drop the nick using a transaction via:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> MULTI
|
||||||
|
OK
|
||||||
|
redis 127.0.0.1:6379> DEL hash:NickAlias:2
|
||||||
|
QUEUED
|
||||||
|
redis 127.0.0.1:6379> DEL hash:NickAlias:3
|
||||||
|
QUEUED
|
||||||
|
redis 127.0.0.1:6379> DEL hash:NickCore:1
|
||||||
|
QUEUED
|
||||||
|
redis 127.0.0.1:6379> EXEC
|
||||||
|
|
||||||
|
Or alternatively simply:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> DEL hash:NickAlias:2 hash:NickAlias:3 hash:NickCore:1
|
||||||
|
|
||||||
|
If I wanted to create a BotServ bot, I would execute the following:
|
||||||
|
|
||||||
|
redis 127.0.0.1:6379> INCR id:BotInfo
|
||||||
|
|
||||||
|
Which returns a new object ID for me, in this example it will be "8".
|
||||||
|
Now I can create the object:
|
||||||
|
|
||||||
|
HMSET hash:BotInfo:8 nick redis user redis host services.anope.org realname "Services for IRC Networks"
|
||||||
|
|
||||||
|
Note if you are using HSET instead of HMSET you will need to use a transaction, as shown in the above example.
|
||||||
|
If you are watching your services logs you will immediatly see:
|
||||||
|
|
||||||
|
USERS: redis!redis@services.anope.org (Services for IRC Networks) connected to the network (services.anope.org)
|
||||||
|
|
||||||
|
And the bot redis will be in BotServ's bot list.
|
||||||
|
Notice how ids:BotInfo and the value keys are updated automatically.
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
Legend:
|
|
||||||
x = done
|
|
||||||
? = unsure
|
|
||||||
+ = in progress
|
|
||||||
|
|
||||||
Future
|
|
||||||
------
|
|
||||||
[ ] NS IDENTIFY changes
|
|
||||||
[?] Last failed identify? Maybe more useful for sopers only, so users don't get unnecessarily worried
|
|
||||||
[?] Last successful login time/ip? perhaps both of these should be a new nick setting
|
|
||||||
[ ] NS SUSPEND: show suspender and reason, probably to sopers only (see CS SUSPEND)
|
|
||||||
[ ] Allow channel founders to change the fantasy trigger for their channel.
|
|
||||||
[+] CIDR Akills, session exceptions, etc
|
|
||||||
[?] Language charset stuff, including collation (1.9.1? phoenix?)
|
|
||||||
[?] a way for a module to queue itself (or even another module) for unloading
|
|
||||||
[+] Useful/common "third party" modules to core distro
|
|
||||||
[x] NS AJOIN
|
|
||||||
[x] CS ENTRYMSG
|
|
||||||
[?] Don't allow soper accounts to expire
|
|
||||||
[?] Reason for CS SET RESTRICTED
|
|
||||||
[ ] Unique IDs on each AKILL/blah so that networks may use them as ticket IDs
|
|
||||||
[ ] HS ACTIVATE -ALL (rob sez this all needs reviewing)
|
|
||||||
[ ] No nickname ownership?
|
|
||||||
[ ] More commands need to be split up such as /bs bot, /ms set, /bs kick, /bs set, /os set? etc.
|
|
||||||
[ ] Customize email messages
|
|
||||||
+2
-3
@@ -16,9 +16,8 @@ Anope Bundled Tools
|
|||||||
sendmailpath = "/home/anope/services/bin/anopesmtp 127.0.0.1"
|
sendmailpath = "/home/anope/services/bin/anopesmtp 127.0.0.1"
|
||||||
|
|
||||||
If the SMTP client doesn't send mail, or if there's an other problem with
|
If the SMTP client doesn't send mail, or if there's an other problem with
|
||||||
it, you can compile it in debug mode. To do this, open anopesmtp.cpp, and look
|
it, you can enable debug mode by passing the --debug flag after the server
|
||||||
for "smtp_debug" near the top. Change this from 0 to 1 and recompile
|
address. This should generate a log file of what happened when it tried
|
||||||
the code. This should generate a log file of what happened when it tried
|
|
||||||
to connect to the SMTP server.
|
to connect to the SMTP server.
|
||||||
|
|
||||||
Credits:
|
Credits:
|
||||||
|
|||||||
+8
-18
@@ -25,12 +25,11 @@ Anope for Windows
|
|||||||
|
|
||||||
(NOTE: When installing, tell CMake to add itself to the PATH.)
|
(NOTE: When installing, tell CMake to add itself to the PATH.)
|
||||||
|
|
||||||
If you have Visual C++ 10 (2010) skip ahead to step 2, else you
|
If you have Visual C++ 10 or 11 (2010/2012) skip ahead to step 2, else you
|
||||||
need to download the following free component from Microsoft. Once
|
need to download and install the following free component from Microsoft.
|
||||||
downloaded, install these packages.
|
|
||||||
|
|
||||||
* Microsoft Visual C++ 2010 Express Edition:
|
* Microsoft Visual C++ 2010 Express Edition:
|
||||||
http://www.microsoft.com/express/vc/
|
http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
|
||||||
|
|
||||||
2) Unpack the Anope tarball with your favorite uncompression program
|
2) Unpack the Anope tarball with your favorite uncompression program
|
||||||
(WinZip or WinRAR, etc).
|
(WinZip or WinRAR, etc).
|
||||||
@@ -72,21 +71,12 @@ Anope for Windows
|
|||||||
our IRC Support channel for assistance.
|
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 m_mysql and
|
||||||
m_ssl. If these libraries are installed in nonstandard locations, cmake
|
the SSL modules. If these libraries are installed in nonstandard
|
||||||
will probably not find them and should be told where they are by passing
|
locations, cmake will probably not find them and should be told where
|
||||||
additional search paths to the last question in Config, such as:
|
they are by passing their location to Config.
|
||||||
|
|
||||||
-DEXTRA_INCLUDES:STRING=c:/openssl/include;c:/openssl/lib
|
The libraries used to build the 'extra' modules are available at
|
||||||
|
https://github.com/Adam-/windows-scripts.
|
||||||
Which would have cmake search both C:\openssl\include and
|
|
||||||
C:\openssl\lib.
|
|
||||||
|
|
||||||
Building Anope with gettext requires libintl, libiconv, libgcc and
|
|
||||||
libmingex. We have precompiled these libraries for you that you may
|
|
||||||
use if you want. They are avaiable at http://anope.org/downloads/anope-extra.zip
|
|
||||||
The OpenSSL, MySQL, and OpenLDAP header files and libraries are also included in
|
|
||||||
this package. Once downloaded and extracted, you should run install.bat
|
|
||||||
then give Config the path to the new 'installed' directory.
|
|
||||||
|
|
||||||
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
|
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
|
||||||
at the prompt type:
|
at the prompt type:
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@ This allows external applications, such as websites, to execute remote procedure
|
|||||||
|
|
||||||
Currently there are 5 supported XMLRPC calls, provided by m_xmlrpc_main:
|
Currently there are 5 supported XMLRPC calls, provided by m_xmlrpc_main:
|
||||||
|
|
||||||
checkAuthetication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password
|
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.
|
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
|
command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command
|
||||||
to execute. This will execute a the given command to Anope using the given service name. If the user given is online, the
|
to execute. This will execute a the given command to Anope using the given service name. If the user given is online, the
|
||||||
|
|||||||
+11
-22
@@ -1,33 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
/* XMLRPC Functions
|
/* XMLRPC Functions
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AnopeXMLRPC
|
class AnopeXMLRPC
|
||||||
{
|
{
|
||||||
private $Host, $Bind, $Port;
|
private $Host;
|
||||||
|
|
||||||
private $Socket;
|
function __construct($Host)
|
||||||
|
|
||||||
function __construct($Host, $Port, $Bind = NULL)
|
|
||||||
{
|
{
|
||||||
$this->Host = $Host;
|
$this->Host = $Host;
|
||||||
$this->Port = $Port;
|
|
||||||
$this->Bind = $Bind;
|
|
||||||
|
|
||||||
$this->Socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
|
||||||
if ($Bind && socket_bind($this->Socket, $this->Bind) == false)
|
|
||||||
$his->Socket = false;
|
|
||||||
if (socket_connect($this->Socket, $this->Host, $this->Port) == false)
|
|
||||||
$this->Socket = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function __destruct()
|
|
||||||
{
|
|
||||||
@socket_close($this->Socket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
|
/** Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
|
||||||
@@ -40,10 +25,12 @@ class AnopeXMLRPC
|
|||||||
function RunXMLRPC($name, $params)
|
function RunXMLRPC($name, $params)
|
||||||
{
|
{
|
||||||
$xmlquery = xmlrpc_encode_request($name, $params);
|
$xmlquery = xmlrpc_encode_request($name, $params);
|
||||||
socket_write($this->Socket, $xmlquery);
|
$context = stream_context_create(array("http" => array(
|
||||||
|
"method" => "POST",
|
||||||
|
"header" => "Content-Type: text/xml",
|
||||||
|
"content" => $xmlquery)));
|
||||||
|
|
||||||
$inbuf = socket_read($this->Socket, 4096);
|
$inbuf = file_get_contents($this->Host, false, $context);
|
||||||
$inbuf = substr($inbuf, strpos($inbuf, "\r\n\r\n") + 4);
|
|
||||||
$response = xmlrpc_decode($inbuf);
|
$response = xmlrpc_decode($inbuf);
|
||||||
|
|
||||||
if (isset($response[0]))
|
if (isset($response[0]))
|
||||||
@@ -87,7 +74,7 @@ class AnopeXMLRPC
|
|||||||
*/
|
*/
|
||||||
function DoChannel($Channel)
|
function DoChannel($Channel)
|
||||||
{
|
{
|
||||||
return $this->RunXMLRPC("channel", NULL);
|
return $this->RunXMLRPC("channel", array($Channel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Like DoChannel(), but different.
|
/* Like DoChannel(), but different.
|
||||||
@@ -98,4 +85,6 @@ class AnopeXMLRPC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$anopexmlrpc = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -0,0 +1,173 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
#
|
||||||
|
# Script taken from InspIRCd, www.inspircd.org
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN { require 5.8.0; }
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings FATAL => qw(all);
|
||||||
|
|
||||||
|
use File::Copy ();
|
||||||
|
use Cwd;
|
||||||
|
|
||||||
|
sub list_extras ();
|
||||||
|
sub enable_extras (@);
|
||||||
|
sub disable_extras (@);
|
||||||
|
|
||||||
|
# Routine to list out the extra/ modules that have been enabled.
|
||||||
|
# Note: when getting any filenames out and comparing, it's important to lc it if the
|
||||||
|
# file system is not case-sensitive (== Epoc, MacOS, OS/2 (incl DOS/DJGPP), VMS, Win32
|
||||||
|
# (incl NetWare, Symbian)). Cygwin may or may not be case-sensitive, depending on
|
||||||
|
# configuration, however, File::Spec does not currently tell us (it assumes Unix behavior).
|
||||||
|
sub list_extras () {
|
||||||
|
use File::Spec;
|
||||||
|
# @_ not used
|
||||||
|
my $srcdir = File::Spec->catdir("modules");
|
||||||
|
my $abs_srcdir = File::Spec->rel2abs($srcdir);
|
||||||
|
local $_;
|
||||||
|
my $dd;
|
||||||
|
opendir $dd, File::Spec->catdir($abs_srcdir, "extra") or die (File::Spec->catdir($abs_srcdir, "extra") . ": $!\n");
|
||||||
|
my @extras = map { File::Spec->case_tolerant() ? lc($_) : $_ } (readdir($dd));
|
||||||
|
closedir $dd;
|
||||||
|
undef $dd;
|
||||||
|
opendir $dd, $abs_srcdir or die "$abs_srcdir: $!\n";
|
||||||
|
my @sources = map { File::Spec->case_tolerant() ? lc($_) : $_ } (readdir($dd));
|
||||||
|
closedir $dd;
|
||||||
|
undef $dd;
|
||||||
|
my $maxlen = (sort { $b <=> $a } (map {length($_)} (@extras)))[0];
|
||||||
|
my %extras = ();
|
||||||
|
EXTRA: for my $extra (@extras) {
|
||||||
|
next if (File::Spec->curdir() eq $extra || File::Spec->updir() eq $extra);
|
||||||
|
my $abs_extra = File::Spec->catfile($abs_srcdir, "extra", $extra);
|
||||||
|
my $abs_source = File::Spec->catfile($abs_srcdir, $extra);
|
||||||
|
next unless ($extra =~ m/\.(cpp|h)$/ || (-d $abs_extra)); # C++ Source/Header, or directory
|
||||||
|
if (-l $abs_source) {
|
||||||
|
# Symlink, is it in the right place?
|
||||||
|
my $targ = readlink($abs_source);
|
||||||
|
my $abs_targ = File::Spec->rel2abs($targ, $abs_srcdir);
|
||||||
|
if ($abs_targ eq $abs_extra) {
|
||||||
|
$extras{$extra} = "\e[32;1menabled\e[0m";
|
||||||
|
} else {
|
||||||
|
$extras{$extra} = sprintf("\e[31;1mwrong symlink target (%s)\e[0m", $abs_targ);
|
||||||
|
}
|
||||||
|
} elsif (-e $abs_source) {
|
||||||
|
my ($devext, $inoext) = stat($abs_extra);
|
||||||
|
my ($devsrc, $inosrc, undef, $lnksrc) = stat($abs_source);
|
||||||
|
if ($lnksrc > 1) {
|
||||||
|
if ($devsrc == $devext && $inosrc == $inoext) {
|
||||||
|
$extras{$extra} = "\e[32;1menabled\e[0m";
|
||||||
|
} else {
|
||||||
|
$extras{$extra} = sprintf("\e[31;1mwrong hardlink target (%d:%d)\e[0m", $devsrc, $inosrc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
open my $extfd, "<", $abs_extra;
|
||||||
|
open my $srcfd, "<", $abs_source;
|
||||||
|
local $/ = undef;
|
||||||
|
if (scalar(<$extfd>) eq scalar(<$srcfd>)) {
|
||||||
|
$extras{$extra} = "\e[32;1menabled\e[0m";
|
||||||
|
} else {
|
||||||
|
$extras{$extra} = sprintf("\e[31;1mout of synch (re-copy)\e[0m");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$extras{$extra} = "\e[33;1mdisabled\e[0m";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for my $extra (sort {$a cmp $b} keys(%extras)) {
|
||||||
|
my $text = $extras{$extra};
|
||||||
|
if ($text =~ m/needed by/ && $text !~ m/enabled/) {
|
||||||
|
printf "\e[31;1;5m%-*s = %s%s\e[0m\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? ")" : "");
|
||||||
|
} else {
|
||||||
|
printf "%-*s = %s%s\n", $maxlen, $extra, $text, ($text =~ m/needed by/ ? "\e[0m)" : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return keys(%extras) if wantarray; # Can be used by manage_extras.
|
||||||
|
}
|
||||||
|
|
||||||
|
sub enable_extras (@) {
|
||||||
|
my (@extras) = @_;
|
||||||
|
for my $extra (@extras) {
|
||||||
|
my $extrapath = "modules/extra/$extra";
|
||||||
|
if (!-e $extrapath) {
|
||||||
|
print STDERR "Cannot enable \e[32;1m$extra\e[0m : No such file or directory in modules/extra\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
my $source = "modules/$extra";
|
||||||
|
if (-e $source) {
|
||||||
|
print STDERR "Cannot enable \e[32;1m$extra\e[0m : destination in modules exists (might already be enabled?)\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
print "Enabling $extra ... \n";
|
||||||
|
symlink "extra/$extra", $source or print STDERR "$source: Cannot link to 'extra/$extra': $!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub disable_extras (@)
|
||||||
|
{
|
||||||
|
opendir my $dd, "modules/extra/";
|
||||||
|
my @files = readdir($dd);
|
||||||
|
closedir $dd;
|
||||||
|
my (@extras) = @_;
|
||||||
|
EXTRA: for my $extra (@extras) {
|
||||||
|
my $extrapath = "modules/extra/$extra";
|
||||||
|
my $source = "modules/$extra";
|
||||||
|
if (!-e $extrapath) {
|
||||||
|
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Is not an extra\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ((! -l $source) || readlink($source) ne "extra/$extra") {
|
||||||
|
print STDERR "Cannot disable \e[32;1m$extra\e[0m : Source is not a link or doesn't refer to the right file. Remove manually if this is in error.\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
# Now remove.
|
||||||
|
print "Disabling $extra ... \n";
|
||||||
|
unlink "modules/$extra" or print STDERR "Cannot disable \e[32;1m$extra\e[0m : $!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
my $clearscreen = `clear`;
|
||||||
|
print $clearscreen;
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
list_extras; # print the module list
|
||||||
|
print "\nPlease enter the name of the module or type 'q' to quit.: ";
|
||||||
|
my $input = <STDIN>;
|
||||||
|
chop($input); # remove the trailing \n from the user input
|
||||||
|
|
||||||
|
if ($input eq "q") {
|
||||||
|
if (-e "build/CMakeFiles") {
|
||||||
|
if (-e "cmake-bin") {
|
||||||
|
my $cmake_path = `find cmake-bin -name cmake -print0`;
|
||||||
|
system($cmake_path, "build/.");
|
||||||
|
} else {
|
||||||
|
system("cmake", "build/.");
|
||||||
|
}
|
||||||
|
print "\nNow cd build, then run make to build Anope.\n\n";
|
||||||
|
} else {
|
||||||
|
print "\nBuild directory not found. You should run ./Config now.\n\n"
|
||||||
|
}
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
print $clearscreen;
|
||||||
|
if ($input eq "") {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-e "modules/$input") {
|
||||||
|
disable_extras($input)
|
||||||
|
} else {
|
||||||
|
enable_extras($input)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ get_target_property(version_BINARY version LOCATION)
|
|||||||
# Modify version.h from the above executable, with dependencies to version.cpp
|
# Modify version.h from the above executable, with dependencies to version.cpp
|
||||||
# and all of the source files in the main build
|
# and all of the source files in the main build
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build
|
||||||
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h
|
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
|
||||||
DEPENDS version ${SRC_SRCS}
|
DEPENDS version ${SRC_SRCS}
|
||||||
)
|
)
|
||||||
# Add version to list of files for CPack to ignore
|
# Add version to list of files for CPack to ignore
|
||||||
@@ -15,6 +15,7 @@ get_filename_component(version_BINARY ${version_BINARY} NAME)
|
|||||||
add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
|
add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
add_to_cpack_ignored_files("version.h$" TRUE)
|
add_to_cpack_ignored_files("version.h$" TRUE)
|
||||||
|
add_to_cpack_ignored_files("build.h$" TRUE)
|
||||||
endif(NOT WIN32)
|
endif(NOT WIN32)
|
||||||
|
|
||||||
set(PCH_SOURCES_GCH "")
|
set(PCH_SOURCES_GCH "")
|
||||||
|
|||||||
+89
-19
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ACCESS_H
|
#ifndef ACCESS_H
|
||||||
@@ -25,19 +24,25 @@ enum
|
|||||||
ACCESS_FOUNDER = 10001
|
ACCESS_FOUNDER = 10001
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* A privilege, probably configured using a privilege{} block. Most
|
||||||
|
* commands require specific privileges to be executed. The AccessProvider
|
||||||
|
* backing each ChanAccess determines whether that ChanAccess has a given
|
||||||
|
* privilege.
|
||||||
|
*/
|
||||||
struct CoreExport Privilege
|
struct CoreExport Privilege
|
||||||
{
|
{
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
Anope::string desc;
|
Anope::string desc;
|
||||||
|
/* Rank relative to other privileges */
|
||||||
int rank;
|
int rank;
|
||||||
|
|
||||||
Privilege(const Anope::string &n, const Anope::string &d, int r);
|
Privilege(const Anope::string &name, const Anope::string &desc, int rank);
|
||||||
bool operator==(const Privilege &other) const;
|
bool operator==(const Privilege &other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport PrivilegeManager
|
class CoreExport PrivilegeManager
|
||||||
{
|
{
|
||||||
static std::vector<Privilege> privs;
|
static std::vector<Privilege> Privileges;
|
||||||
public:
|
public:
|
||||||
static void AddPrivilege(Privilege p);
|
static void AddPrivilege(Privilege p);
|
||||||
static void RemovePrivilege(Privilege &p);
|
static void RemovePrivilege(Privilege &p);
|
||||||
@@ -46,26 +51,45 @@ class CoreExport PrivilegeManager
|
|||||||
static void ClearPrivileges();
|
static void ClearPrivileges();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* 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 *o, const Anope::string &n);
|
AccessProvider(Module *owner, const Anope::string &name);
|
||||||
virtual ~AccessProvider();
|
virtual ~AccessProvider();
|
||||||
|
|
||||||
|
/** Creates a new ChanAccess entry using this provider.
|
||||||
|
* @return The new entry
|
||||||
|
*/
|
||||||
virtual ChanAccess *Create() = 0;
|
virtual ChanAccess *Create() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::list<AccessProvider *> providers;
|
static std::list<AccessProvider *> Providers;
|
||||||
public:
|
public:
|
||||||
static const std::list<AccessProvider *>& GetProviders();
|
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:
|
|
||||||
AccessProvider *provider;
|
|
||||||
serialize_obj<ChannelInfo> ci;
|
|
||||||
Anope::string mask;
|
Anope::string mask;
|
||||||
|
/* account this access entry is for, if any */
|
||||||
|
Serialize::Reference<NickCore> nc;
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef std::multimap<const ChanAccess *, const ChanAccess *> Set;
|
||||||
|
/* shows the 'path' taken to determine if an access entry matches a user
|
||||||
|
* .first are access entries checked
|
||||||
|
* .second are access entries which match
|
||||||
|
*/
|
||||||
|
typedef std::pair<Set, Set> Path;
|
||||||
|
|
||||||
|
/* The provider that created this access entry */
|
||||||
|
AccessProvider *provider;
|
||||||
|
/* Channel this access entry is on */
|
||||||
|
Serialize::Reference<ChannelInfo> ci;
|
||||||
Anope::string creator;
|
Anope::string creator;
|
||||||
time_t last_seen;
|
time_t last_seen;
|
||||||
time_t created;
|
time_t created;
|
||||||
@@ -73,30 +97,76 @@ class CoreExport ChanAccess : public Serializable
|
|||||||
ChanAccess(AccessProvider *p);
|
ChanAccess(AccessProvider *p);
|
||||||
virtual ~ChanAccess();
|
virtual ~ChanAccess();
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
void SetMask(const Anope::string &mask, ChannelInfo *ci);
|
||||||
Serialize::Data serialize() const anope_override;
|
const Anope::string &Mask() const;
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
NickCore *GetAccount() const;
|
||||||
|
|
||||||
virtual bool Matches(const User *u, const NickCore *nc) const;
|
void Serialize(Serialize::Data &data) const anope_override;
|
||||||
|
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
|
|
||||||
|
/** Check if this access entry matches the given user or account
|
||||||
|
* @param u The user
|
||||||
|
* @param nc The account
|
||||||
|
* @param p The path to the access object which matches will be put here
|
||||||
|
*/
|
||||||
|
virtual bool Matches(const User *u, const NickCore *nc, Path &p) const;
|
||||||
|
|
||||||
|
/** Check if this access entry has the given privilege.
|
||||||
|
* @param name The privilege name
|
||||||
|
*/
|
||||||
virtual bool HasPriv(const Anope::string &name) const = 0;
|
virtual bool HasPriv(const Anope::string &name) const = 0;
|
||||||
virtual Anope::string Serialize() const = 0;
|
|
||||||
virtual void Unserialize(const Anope::string &data) = 0;
|
|
||||||
|
|
||||||
bool operator>(const ChanAccess &other) const;
|
/** Serialize the access given by this access entry into a human
|
||||||
bool operator<(const ChanAccess &other) const;
|
* readable form. chanserv/access will return a number, chanserv/xop
|
||||||
|
* will be AOP, SOP, etc.
|
||||||
|
*/
|
||||||
|
virtual Anope::string AccessSerialize() const = 0;
|
||||||
|
|
||||||
|
/** Unserialize this access entry from the given data. This data
|
||||||
|
* will be fetched from AccessSerialize.
|
||||||
|
*/
|
||||||
|
virtual void AccessUnserialize(const Anope::string &data) = 0;
|
||||||
|
|
||||||
|
/* Comparison operators to other Access entries */
|
||||||
|
virtual bool operator>(const ChanAccess &other) const;
|
||||||
|
virtual bool operator<(const ChanAccess &other) const;
|
||||||
bool operator>=(const ChanAccess &other) const;
|
bool operator>=(const ChanAccess &other) const;
|
||||||
bool operator<=(const ChanAccess &other) const;
|
bool operator<=(const ChanAccess &other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* A group of access entries. This is used commonly, for example with ChannelInfo::AccessFor,
|
||||||
|
* to show what access a user has on a channel because users can match multiple access entries.
|
||||||
|
*/
|
||||||
class CoreExport AccessGroup : public std::vector<ChanAccess *>
|
class CoreExport AccessGroup : public std::vector<ChanAccess *>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/* Channel these access entries are on */
|
||||||
const ChannelInfo *ci;
|
const ChannelInfo *ci;
|
||||||
|
/* Path from these entries to other entries that they depend on */
|
||||||
|
ChanAccess::Path path;
|
||||||
|
/* Account these entries affect, if any */
|
||||||
const NickCore *nc;
|
const NickCore *nc;
|
||||||
bool SuperAdmin, Founder;
|
/* super_admin always gets all privs. founder is a special case where ci->founder == nc */
|
||||||
|
bool super_admin, founder;
|
||||||
|
|
||||||
AccessGroup();
|
AccessGroup();
|
||||||
|
|
||||||
|
/** Check if this access group has a certain privilege. Eg, it
|
||||||
|
* will check every ChanAccess entry of this group for any that
|
||||||
|
* has the given privilege.
|
||||||
|
* @param priv The privilege
|
||||||
|
* @return true if any entry has the given privilege
|
||||||
|
*/
|
||||||
bool HasPriv(const Anope::string &priv) const;
|
bool HasPriv(const Anope::string &priv) const;
|
||||||
|
|
||||||
|
/** Get the "highest" access entry from this group of entries.
|
||||||
|
* The highest entry is determined by the entry that has the privilege
|
||||||
|
* with the highest rank (see Privilege::rank).
|
||||||
|
* @return The "highest" entry
|
||||||
|
*/
|
||||||
const ChanAccess *Highest() const;
|
const ChanAccess *Highest() const;
|
||||||
|
|
||||||
|
/* Comparison operators to other AccessGroups */
|
||||||
bool operator>(const AccessGroup &other) const;
|
bool operator>(const AccessGroup &other) const;
|
||||||
bool operator<(const AccessGroup &other) const;
|
bool operator<(const AccessGroup &other) const;
|
||||||
bool operator>=(const AccessGroup &other) const;
|
bool operator>=(const AccessGroup &other) const;
|
||||||
|
|||||||
+146
-183
@@ -1,14 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
*
|
*
|
||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ACCOUNT_H
|
#ifndef ACCOUNT_H
|
||||||
@@ -20,135 +19,42 @@
|
|||||||
#include "memo.h"
|
#include "memo.h"
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
|
|
||||||
typedef Anope::insensitive_map<NickAlias *> nickalias_map;
|
typedef Anope::hash_map<NickAlias *> nickalias_map;
|
||||||
typedef Anope::insensitive_map<NickCore *> nickcore_map;
|
typedef Anope::hash_map<NickCore *> nickcore_map;
|
||||||
|
|
||||||
extern CoreExport serialize_checker<nickalias_map> NickAliasList;
|
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
|
||||||
extern CoreExport serialize_checker<nickcore_map> NickCoreList;
|
extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
|
||||||
|
|
||||||
/* NickServ nickname structures. */
|
/* A registered nickname.
|
||||||
|
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||||
/** Flags set on NickAliases
|
|
||||||
*/
|
*/
|
||||||
enum NickNameFlag
|
class CoreExport NickAlias : public Serializable, public Extensible
|
||||||
{
|
|
||||||
NS_BEGIN,
|
|
||||||
|
|
||||||
/* Nick never expires */
|
|
||||||
NS_NO_EXPIRE,
|
|
||||||
/* This nick is being held after a kill by an enforcer client
|
|
||||||
* or is being SVSHeld. Used by ns_release to determin if something
|
|
||||||
* should be allowed to be released
|
|
||||||
*/
|
|
||||||
NS_HELD,
|
|
||||||
/* We are taking over this nick, either by SVSNICK or KILL.
|
|
||||||
* We are waiting for the confirmation of either of these actions to
|
|
||||||
* proceed. This is checked in NickAlias::OnCancel
|
|
||||||
*/
|
|
||||||
NS_COLLIDED,
|
|
||||||
|
|
||||||
NS_END
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string NickNameFlagStrings[] = {
|
|
||||||
"BEGIN", "NO_EXPIRE", "HELD", "COLLIDED", ""
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Flags set on NickCores
|
|
||||||
*/
|
|
||||||
enum NickCoreFlag
|
|
||||||
{
|
|
||||||
NI_BEGIN,
|
|
||||||
|
|
||||||
/* Kill others who take this nick */
|
|
||||||
NI_KILLPROTECT,
|
|
||||||
/* Dont recognize unless IDENTIFIED */
|
|
||||||
NI_SECURE,
|
|
||||||
/* Use PRIVMSG instead of NOTICE */
|
|
||||||
NI_MSG,
|
|
||||||
/* Don't allow user to change memo limit */
|
|
||||||
NI_MEMO_HARDMAX,
|
|
||||||
/* Notify of memos at signon and un-away */
|
|
||||||
NI_MEMO_SIGNON,
|
|
||||||
/* Notify of new memos when sent */
|
|
||||||
NI_MEMO_RECEIVE,
|
|
||||||
/* Don't show in LIST to non-servadmins */
|
|
||||||
NI_PRIVATE,
|
|
||||||
/* Don't show email in INFO */
|
|
||||||
NI_HIDE_EMAIL,
|
|
||||||
/* Don't show last seen address in INFO */
|
|
||||||
NI_HIDE_MASK,
|
|
||||||
/* Don't show last quit message in INFO */
|
|
||||||
NI_HIDE_QUIT,
|
|
||||||
/* Kill in 20 seconds instead of in 60 */
|
|
||||||
NI_KILL_QUICK,
|
|
||||||
/* Kill immediatly */
|
|
||||||
NI_KILL_IMMED,
|
|
||||||
/* User gets email on memo */
|
|
||||||
NI_MEMO_MAIL,
|
|
||||||
/* Don't show services access status */
|
|
||||||
NI_HIDE_STATUS,
|
|
||||||
/* Nickname is suspended */
|
|
||||||
NI_SUSPENDED,
|
|
||||||
/* Autoop nickname in channels */
|
|
||||||
NI_AUTOOP,
|
|
||||||
/* This nickcore is forbidden, which means the nickalias for it is aswell */
|
|
||||||
NI_FORBIDDEN,
|
|
||||||
/* If set means the nick core does not have their email addrses confirmed.
|
|
||||||
*/
|
|
||||||
NI_UNCONFIRMED,
|
|
||||||
/* Chanstats are enabled for this user */
|
|
||||||
NI_STATS,
|
|
||||||
|
|
||||||
NI_END
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string NickCoreFlagStrings[] = {
|
|
||||||
"BEGIN", "KILLPROTECT", "SECURE", "MSG", "MEMO_HARDMAX", "MEMO_SIGNON", "MEMO_RECEIVE",
|
|
||||||
"PRIVATE", "HIDE_EMAIL", "HIDE_MASK", "HIDE_QUIT", "KILL_QUICK", "KILL_IMMED",
|
|
||||||
"MEMO_MAIL", "HIDE_STATUS", "SUSPENDED", "AUTOOP", "FORBIDDEN", "UNCONFIRMED", "STATS", ""
|
|
||||||
};
|
|
||||||
|
|
||||||
class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_END>, public Serializable
|
|
||||||
{
|
{
|
||||||
Anope::string vhost_ident, vhost_host, vhost_creator;
|
Anope::string vhost_ident, vhost_host, vhost_creator;
|
||||||
time_t vhost_created;
|
time_t vhost_created;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default constructor
|
Anope::string nick;
|
||||||
|
Anope::string last_quit;
|
||||||
|
Anope::string last_realname;
|
||||||
|
/* Last usermask this nick was seen on, eg user@host */
|
||||||
|
Anope::string last_usermask;
|
||||||
|
/* Last uncloaked usermask, requires nickserv/auspex to see */
|
||||||
|
Anope::string last_realhost;
|
||||||
|
time_t time_registered;
|
||||||
|
time_t last_seen;
|
||||||
|
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
|
||||||
|
Serialize::Reference<NickCore> nc;
|
||||||
|
|
||||||
|
/** Constructor
|
||||||
* @param nickname The nick
|
* @param nickname The nick
|
||||||
* @param nickcore The nickcore for this nick
|
* @param nickcore The nickcore for this nick
|
||||||
*/
|
*/
|
||||||
NickAlias(const Anope::string &nickname, NickCore *nickcore);
|
NickAlias(const Anope::string &nickname, NickCore *nickcore);
|
||||||
|
|
||||||
/** Default destructor
|
|
||||||
*/
|
|
||||||
~NickAlias();
|
~NickAlias();
|
||||||
|
|
||||||
Anope::string nick; /* Nickname */
|
void Serialize(Serialize::Data &data) const anope_override;
|
||||||
Anope::string last_quit; /* Last quit message */
|
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
Anope::string last_realname; /* Last realname */
|
|
||||||
Anope::string last_usermask; /* Last usermask */
|
|
||||||
Anope::string last_realhost; /* Last uncloaked usermask, requires nickserv/auspex to see */
|
|
||||||
time_t time_registered; /* When the nick was registered */
|
|
||||||
time_t last_seen; /* When it was seen online for the last time */
|
|
||||||
serialize_obj<NickCore> nc; /* I'm an alias of this */
|
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
|
||||||
Serialize::Data serialize() const anope_override;
|
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
|
||||||
|
|
||||||
/** Release a nick
|
|
||||||
* See the comment in users.cpp
|
|
||||||
*/
|
|
||||||
void Release();
|
|
||||||
|
|
||||||
/** This function is called when a user on this nick either disconnects or changes nick.
|
|
||||||
* Note that the user isnt necessarially identified to this nick
|
|
||||||
* See the comment in users.cpp
|
|
||||||
* @param u The user
|
|
||||||
*/
|
|
||||||
void OnCancel(User *u);
|
|
||||||
|
|
||||||
/** Set a vhost for the user
|
/** Set a vhost for the user
|
||||||
* @param ident The ident
|
* @param ident The ident
|
||||||
@@ -186,41 +92,66 @@ class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_EN
|
|||||||
* @return the time it 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);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END>, public Serializable
|
/* A registered account. Each account must have a NickAlias with the same nick as the
|
||||||
|
* account's display.
|
||||||
|
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||||
|
*/
|
||||||
|
class CoreExport NickCore : public Serializable, public Extensible
|
||||||
{
|
{
|
||||||
|
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
|
||||||
|
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
|
||||||
public:
|
public:
|
||||||
/** Default constructor
|
/* Name of the account. Find(display)->nc == this. */
|
||||||
* @param display The display nick
|
Anope::string display;
|
||||||
*/
|
/* User password in form of hashm:data */
|
||||||
NickCore(const Anope::string &nickdisplay);
|
Anope::string pass;
|
||||||
|
Anope::string email;
|
||||||
/** Default destructor
|
/* Locale name of the language of the user. Empty means default language */
|
||||||
*/
|
Anope::string language;
|
||||||
~NickCore();
|
/* 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::list<User *> Users;
|
std::vector<Anope::string> access;
|
||||||
|
|
||||||
Anope::string display; /* How the nick is displayed */
|
|
||||||
Anope::string pass; /* Password of the nicks */
|
|
||||||
Anope::string email; /* E-mail associated to the nick */
|
|
||||||
Anope::string greet; /* Greet associated to the nick */
|
|
||||||
Anope::string language; /* Language name */
|
|
||||||
std::vector<Anope::string> access; /* Access list, vector of strings */
|
|
||||||
std::vector<Anope::string> cert; /* ssl certificate list, vector of strings */
|
|
||||||
MemoInfo memos;
|
MemoInfo memos;
|
||||||
|
std::map<Anope::string, Anope::string> last_modes;
|
||||||
|
|
||||||
|
/* Nicknames registered that are grouped to this account.
|
||||||
|
* for n in aliases, n->nc == this.
|
||||||
|
*/
|
||||||
|
Serialize::Checker<std::vector<NickAlias *> > aliases;
|
||||||
|
|
||||||
|
/* Set if this user is a services operattor. o->ot must exist. */
|
||||||
Oper *o;
|
Oper *o;
|
||||||
|
|
||||||
/* Unsaved data */
|
/* Unsaved data */
|
||||||
uint16_t channelcount; /* Number of channels currently registered */
|
|
||||||
time_t lastmail; /* Last time this nick record got a mail */
|
|
||||||
std::list<serialize_obj<NickAlias> > aliases; /* List of aliases */
|
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
/* Number of channels registered by this account */
|
||||||
Serialize::Data serialize() const anope_override;
|
uint16_t channelcount;
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
/* Last time an email was sent to this user */
|
||||||
|
time_t lastmail;
|
||||||
|
/* Users online now logged into this account */
|
||||||
|
std::list<User *> users;
|
||||||
|
|
||||||
|
/** Constructor
|
||||||
|
* @param display The display nick
|
||||||
|
*/
|
||||||
|
NickCore(const Anope::string &nickdisplay);
|
||||||
|
~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);
|
||||||
|
|
||||||
/** Checks whether this account is a services oper or not.
|
/** Checks whether this account is a services oper or not.
|
||||||
* @return True if this account is a services oper, false otherwise.
|
* @return True if this account is a services oper, false otherwise.
|
||||||
@@ -244,6 +175,10 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END
|
|||||||
*/
|
*/
|
||||||
Anope::string GetAccess(unsigned entry) const;
|
Anope::string GetAccess(unsigned entry) const;
|
||||||
|
|
||||||
|
/** Get the number of entries on the access list for this account.
|
||||||
|
*/
|
||||||
|
unsigned GetAccessCount() const;
|
||||||
|
|
||||||
/** Find an entry in the nick's access list
|
/** Find an entry in the nick's access list
|
||||||
*
|
*
|
||||||
* @param entry The nick!ident@host entry to search for
|
* @param entry The nick!ident@host entry to search for
|
||||||
@@ -267,53 +202,81 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END
|
|||||||
*/
|
*/
|
||||||
void ClearAccess();
|
void ClearAccess();
|
||||||
|
|
||||||
/** Add an entry to the nick's certificate list
|
/** Is the given user on this accounts access list?
|
||||||
*
|
*
|
||||||
* @param entry The fingerprint to add to the cert list
|
* @param u The user
|
||||||
*
|
*
|
||||||
* Adds a new entry into the cert list.
|
* @return true if the user is on the access list
|
||||||
*/
|
*/
|
||||||
void AddCert(const Anope::string &entry);
|
bool IsOnAccess(const User *u) const;
|
||||||
|
|
||||||
/** Get an entry from the nick's cert list by index
|
/** Finds an account
|
||||||
*
|
* @param nick The account name to find
|
||||||
* @param entry Index in the certificaate list vector to retrieve
|
* @return The account, if it exists
|
||||||
* @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
|
|
||||||
*
|
|
||||||
* Retrieves an entry from the certificate list corresponding to the given index.
|
|
||||||
*/
|
*/
|
||||||
Anope::string GetCert(unsigned entry) const;
|
static NickCore* Find(const Anope::string &nick);
|
||||||
|
|
||||||
/** Find an entry in the nick's cert list
|
void AddChannelReference(ChannelInfo *ci);
|
||||||
*
|
void RemoveChannelReference(ChannelInfo *ci);
|
||||||
* @param entry The fingerprint to search for
|
void GetChannelReferences(std::deque<ChannelInfo *> &queue);
|
||||||
* @return True if the fingerprint is found in the cert list, false otherwise
|
|
||||||
*
|
|
||||||
* Search for an fingerprint within the cert list.
|
|
||||||
*/
|
|
||||||
bool FindCert(const Anope::string &entry) const;
|
|
||||||
|
|
||||||
/** Erase a fingerprint from the nick's certificate list
|
|
||||||
*
|
|
||||||
* @param entry The fingerprint to remove
|
|
||||||
*
|
|
||||||
* Removes the specified fingerprint from the cert list.
|
|
||||||
*/
|
|
||||||
void EraseCert(const Anope::string &entry);
|
|
||||||
|
|
||||||
/** Clears the entire nick's cert list
|
|
||||||
*
|
|
||||||
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
|
||||||
*/
|
|
||||||
void ClearCert();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CoreExport void change_core_display(NickCore *nc);
|
/* A request to check if an account/password is valid. These can exist for
|
||||||
extern CoreExport void change_core_display(NickCore *nc, const Anope::string &newdisplay);
|
* extended periods due to the time some authentication modules take.
|
||||||
|
*/
|
||||||
|
class CoreExport IdentifyRequest
|
||||||
|
{
|
||||||
|
/* Owner of this request, used to cleanup requests if a module is unloaded
|
||||||
|
* while a reqyest us pending */
|
||||||
|
Module *owner;
|
||||||
|
Anope::string account;
|
||||||
|
Anope::string password;
|
||||||
|
|
||||||
extern CoreExport NickAlias *findnick(const Anope::string &nick);
|
std::set<Module *> holds;
|
||||||
extern CoreExport NickCore *findcore(const Anope::string &nick);
|
bool dispatched;
|
||||||
extern CoreExport bool is_on_access(const User *u, const NickCore *nc);
|
bool success;
|
||||||
|
|
||||||
|
static std::set<IdentifyRequest *> Requests;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass);
|
||||||
|
virtual ~IdentifyRequest();
|
||||||
|
|
||||||
|
public:
|
||||||
|
/* One of these is called when the request goes through */
|
||||||
|
virtual void OnSuccess() = 0;
|
||||||
|
virtual void OnFail() = 0;
|
||||||
|
|
||||||
|
const Anope::string &GetAccount() const { return account; }
|
||||||
|
const Anope::string &GetPassword() const { return password; }
|
||||||
|
|
||||||
|
/* Holds this request. When a request is held it must be Released later
|
||||||
|
* for the request to complete. Multiple modules may hold a request at any time,
|
||||||
|
* but the request is not complete until every module has released it. If you do not
|
||||||
|
* require holding this (eg, your password check is done in this thread and immediately)
|
||||||
|
* then you don't need to hold the request before Successing it.
|
||||||
|
* @param m The module holding this request
|
||||||
|
*/
|
||||||
|
void Hold(Module *m);
|
||||||
|
|
||||||
|
/** Releases a held request
|
||||||
|
* @param m The module releaseing the hold
|
||||||
|
*/
|
||||||
|
void Release(Module *m);
|
||||||
|
|
||||||
|
/** Called by modules when this IdentifyRequest has successeded successfully.
|
||||||
|
* If this request is behind held it must still be Released after calling this.
|
||||||
|
* @param m The module confirming authentication
|
||||||
|
*/
|
||||||
|
void Success(Module *m);
|
||||||
|
|
||||||
|
/** Used to either finalize this request or marks
|
||||||
|
* it as dispatched and begins waiting for the module(s)
|
||||||
|
* that have holds to finish.
|
||||||
|
*/
|
||||||
|
void Dispatch();
|
||||||
|
|
||||||
|
static void ModuleUnload(Module *m);
|
||||||
|
};
|
||||||
|
|
||||||
#endif // ACCOUNT_H
|
#endif // ACCOUNT_H
|
||||||
|
|||||||
+249
-170
@@ -1,23 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* (C) 2003-2012 Anope Team
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
*
|
*
|
||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ANOPE_H
|
#ifndef ANOPE_H
|
||||||
#define ANOPE_H
|
#define ANOPE_H
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include "hashcomp.h"
|
#include "hashcomp.h"
|
||||||
|
|
||||||
namespace Anope
|
namespace Anope
|
||||||
{
|
{
|
||||||
template<typename T> class map : public std::map<string, T> { };
|
|
||||||
template<typename T> class insensitive_map : public std::map<string, T, ci::less> { };
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper string class around all the other string classes, this class will
|
* A wrapper string class around all the other string classes, this class will
|
||||||
* allow us to only require one type of string everywhere that can be converted
|
* allow us to only require one type of string everywhere that can be converted
|
||||||
@@ -49,9 +50,10 @@ namespace Anope
|
|||||||
string(char chr) : _string() { _string = chr; }
|
string(char chr) : _string() { _string = chr; }
|
||||||
string(size_type n, char chr) : _string(n, chr) { }
|
string(size_type n, char chr) : _string(n, chr) { }
|
||||||
string(const char *_str) : _string(_str) { }
|
string(const char *_str) : _string(_str) { }
|
||||||
|
string(const char *_str, size_type n) : _string(_str, n) { }
|
||||||
string(const std::string &_str) : _string(_str) { }
|
string(const std::string &_str) : _string(_str) { }
|
||||||
string(const ci::string &_str) : _string(_str.c_str()) { }
|
string(const ci::string &_str) : _string(_str.c_str()) { }
|
||||||
string(const string &_str, size_type pos = 0, size_type n = npos) : _string(_str._string, pos, n) { }
|
string(const string &_str, size_type pos, size_type n = npos) : _string(_str._string, pos, n) { }
|
||||||
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
|
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +115,7 @@ namespace Anope
|
|||||||
* The following functions return the various types of strings.
|
* The following functions return the various types of strings.
|
||||||
*/
|
*/
|
||||||
inline const char *c_str() const { return this->_string.c_str(); }
|
inline const char *c_str() const { return this->_string.c_str(); }
|
||||||
|
inline const char *data() const { return this->_string.data(); }
|
||||||
inline std::string &str() { return this->_string; }
|
inline std::string &str() { return this->_string; }
|
||||||
inline const std::string &str() const { return this->_string; }
|
inline const std::string &str() const { return this->_string; }
|
||||||
inline ci::string ci_str() const { return ci::string(this->_string.c_str()); }
|
inline ci::string ci_str() const { return ci::string(this->_string.c_str()); }
|
||||||
@@ -138,6 +141,9 @@ namespace Anope
|
|||||||
*/
|
*/
|
||||||
inline void push_back(char c) { return this->_string.push_back(c); }
|
inline void push_back(char c) { return this->_string.push_back(c); }
|
||||||
|
|
||||||
|
inline string& append(const string &s) { this->_string.append(s.str()); return *this; }
|
||||||
|
inline string& append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes the string content to n characters.
|
* Resizes the string content to n characters.
|
||||||
*/
|
*/
|
||||||
@@ -153,12 +159,26 @@ namespace Anope
|
|||||||
/**
|
/**
|
||||||
* Trim leading and trailing white spaces from the string.
|
* Trim leading and trailing white spaces from the string.
|
||||||
*/
|
*/
|
||||||
inline void trim()
|
|
||||||
|
inline string& ltrim(const Anope::string &what = " \t\r\n")
|
||||||
{
|
{
|
||||||
while (!this->_string.empty() && isspace(this->_string[0]))
|
while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
|
||||||
this->_string.erase(this->_string.begin());
|
this->_string.erase(this->_string.begin());
|
||||||
while (!this->_string.empty() && isspace(this->_string[this->_string.length() - 1]))
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
this->_string.erase(this->_string.length() - 1);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline string& trim(const Anope::string &what = " \t\r\n")
|
||||||
|
{
|
||||||
|
this->ltrim(what);
|
||||||
|
this->rtrim(what);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -206,7 +226,7 @@ namespace Anope
|
|||||||
inline string replace(iterator first, iterator last, const string &_str) { return string(this->_string.replace(first, last, _str._string)); }
|
inline string replace(iterator first, iterator last, const string &_str) { return string(this->_string.replace(first, last, _str._string)); }
|
||||||
inline string replace(iterator first, iterator last, size_type n, char chr) { return string(this->_string.replace(first, last, n, chr)); }
|
inline string replace(iterator first, iterator last, size_type n, char chr) { return string(this->_string.replace(first, last, n, chr)); }
|
||||||
template <class InputIterator> inline string replace(iterator first, iterator last, InputIterator f, InputIterator l) { return string(this->_string.replace(first, last, f, l)); }
|
template <class InputIterator> inline string replace(iterator first, iterator last, InputIterator f, InputIterator l) { return string(this->_string.replace(first, last, f, l)); }
|
||||||
inline string replace_all_cs(const string &_orig, const string &_repl)
|
inline string replace_all_cs(const string &_orig, const string &_repl) const
|
||||||
{
|
{
|
||||||
Anope::string new_string = *this;
|
Anope::string new_string = *this;
|
||||||
size_type pos = new_string.find(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
size_type pos = new_string.find(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
||||||
@@ -217,7 +237,7 @@ namespace Anope
|
|||||||
}
|
}
|
||||||
return new_string;
|
return new_string;
|
||||||
}
|
}
|
||||||
inline string replace_all_ci(const string &_orig, const string &_repl)
|
inline string replace_all_ci(const string &_orig, const string &_repl) const
|
||||||
{
|
{
|
||||||
Anope::string new_string = *this;
|
Anope::string new_string = *this;
|
||||||
size_type pos = new_string.find_ci(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
size_type pos = new_string.find_ci(_orig), orig_length = _orig.length(), repl_length = _repl.length();
|
||||||
@@ -232,22 +252,22 @@ namespace Anope
|
|||||||
/**
|
/**
|
||||||
* Get the string in lowercase.
|
* Get the string in lowercase.
|
||||||
*/
|
*/
|
||||||
inline string lower()
|
inline string lower() const
|
||||||
{
|
{
|
||||||
Anope::string new_string = *this;
|
Anope::string new_string = *this;
|
||||||
for (size_type i = 0; i < new_string.length(); ++i)
|
for (size_type i = 0; i < new_string.length(); ++i)
|
||||||
new_string[i] = std::tolower(new_string[i], Anope::casemap);
|
new_string[i] = Anope::tolower(new_string[i]);
|
||||||
return new_string;
|
return new_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the string in uppercase.
|
* Get the string in uppercase.
|
||||||
*/
|
*/
|
||||||
inline string upper()
|
inline string upper() const
|
||||||
{
|
{
|
||||||
Anope::string new_string = *this;
|
Anope::string new_string = *this;
|
||||||
for (size_type i = 0; i < new_string.length(); ++i)
|
for (size_type i = 0; i < new_string.length(); ++i)
|
||||||
new_string[i] = std::toupper(new_string[i], Anope::casemap);
|
new_string[i] = Anope::toupper(new_string[i]);
|
||||||
return new_string;
|
return new_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,37 +298,95 @@ namespace Anope
|
|||||||
* Stream insertion operator, must be friend because they cannot be inside the class.
|
* Stream insertion operator, must be friend because they cannot be inside the class.
|
||||||
*/
|
*/
|
||||||
friend std::ostream &operator<<(std::ostream &os, const string &_str);
|
friend std::ostream &operator<<(std::ostream &os, const string &_str);
|
||||||
};
|
friend std::istream &operator>>(std::istream &is, string &_str);
|
||||||
|
|
||||||
/** Hash an Anope::string for unorderd_map, passed as the third template arg to unordered_map
|
|
||||||
*/
|
|
||||||
struct hash
|
|
||||||
{
|
|
||||||
/* VS 2008 specific code */
|
|
||||||
enum { bucket_size = 4, min_buckets = 8 };
|
|
||||||
bool operator()(const string &s1, const string &s2) const;
|
|
||||||
/* End of 2008 specific code */
|
|
||||||
|
|
||||||
/** Hash an Anope::string for unordered_map
|
|
||||||
* @param s The string
|
|
||||||
* @return A hash value for the string
|
|
||||||
*/
|
|
||||||
bool operator()(const string &s) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::ostream &operator<<(std::ostream &os, const string &_str) { return os << _str._string; }
|
inline std::ostream &operator<<(std::ostream &os, const string &_str) { return os << _str._string; }
|
||||||
|
/* This is not standard to make operator>> behave like operator<< in that it will allow extracting a whole line, not just one word */
|
||||||
|
inline std::istream &operator>>(std::istream &is, string &_str) { return std::getline(is, _str._string); }
|
||||||
|
|
||||||
inline const string operator+(char chr, const string &str) { string tmp(chr); tmp += str; return tmp; }
|
inline const string operator+(char chr, const string &str) { string tmp(chr); tmp += str; return tmp; }
|
||||||
inline const string operator+(const char *_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
inline const string operator+(const char *_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||||
inline const string operator+(const std::string &_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
inline const string operator+(const std::string &_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||||
|
|
||||||
|
struct hash_ci
|
||||||
|
{
|
||||||
|
inline size_t operator()(const string &s) const
|
||||||
|
{
|
||||||
|
return TR1NS::hash<std::string>()(s.lower().str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct hash_cs
|
||||||
|
{
|
||||||
|
inline size_t operator()(const string &s) const
|
||||||
|
{
|
||||||
|
return TR1NS::hash<std::string>()(s.str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct compare
|
||||||
|
{
|
||||||
|
inline bool operator()(const string &s1, const string &s2) const
|
||||||
|
{
|
||||||
|
return s1.equals_ci(s2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> class map : public std::map<string, T, ci::less> { };
|
||||||
|
template<typename T> class multimap : public std::multimap<string, T, ci::less> { };
|
||||||
|
template<typename T> class hash_map : public TR1NS::unordered_map<string, T, hash_ci, compare> { };
|
||||||
|
|
||||||
static const char *const compiled = __TIME__ " " __DATE__;
|
static const char *const compiled = __TIME__ " " __DATE__;
|
||||||
|
|
||||||
|
/** The time Anope started.
|
||||||
|
*/
|
||||||
|
extern CoreExport time_t StartTime;
|
||||||
|
|
||||||
|
/** The value to return from main()
|
||||||
|
*/
|
||||||
|
extern int ReturnValue;
|
||||||
|
|
||||||
|
extern sig_atomic_t Signal;
|
||||||
|
extern CoreExport bool Quitting;
|
||||||
|
extern CoreExport bool Restarting;
|
||||||
|
extern CoreExport Anope::string QuitReason;
|
||||||
|
|
||||||
/** The current system time, which is pretty close to being accurate.
|
/** The current system time, which is pretty close to being accurate.
|
||||||
* Use this unless you need very specific time checks
|
* Use this unless you need very specific time checks
|
||||||
*/
|
*/
|
||||||
extern CoreExport time_t CurTime;
|
extern CoreExport time_t CurTime;
|
||||||
|
|
||||||
|
/** The debug level we are running at.
|
||||||
|
*/
|
||||||
|
extern CoreExport int Debug;
|
||||||
|
|
||||||
|
/** Other comand line options.
|
||||||
|
*/
|
||||||
|
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
|
||||||
|
|
||||||
|
/** The root of the services installation. Usually ~/services
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string ServicesDir;
|
||||||
|
|
||||||
|
/** Services binary name (eg services)
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string ServicesBin;
|
||||||
|
|
||||||
|
/** Various directory paths. These can be set at runtime by command line args
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string ConfigDir;
|
||||||
|
extern CoreExport Anope::string DataDir;
|
||||||
|
extern CoreExport Anope::string ModuleDir;
|
||||||
|
extern CoreExport Anope::string LocaleDir;
|
||||||
|
extern CoreExport Anope::string LogDir;
|
||||||
|
|
||||||
|
/** The uplink we are currently connected to
|
||||||
|
*/
|
||||||
|
extern CoreExport int CurrentUplink;
|
||||||
|
|
||||||
|
/** Various methods to determine the Anope version running
|
||||||
|
*/
|
||||||
extern CoreExport string Version();
|
extern CoreExport string Version();
|
||||||
extern CoreExport string VersionShort();
|
extern CoreExport string VersionShort();
|
||||||
extern CoreExport string VersionBuildString();
|
extern CoreExport string VersionBuildString();
|
||||||
@@ -316,6 +394,33 @@ namespace Anope
|
|||||||
extern CoreExport int VersionMinor();
|
extern CoreExport int VersionMinor();
|
||||||
extern CoreExport int VersionPatch();
|
extern CoreExport int VersionPatch();
|
||||||
|
|
||||||
|
/** Determines if we are still attached to the terminal, and can print
|
||||||
|
* messages to the user via stderr/stdout.
|
||||||
|
* @return true if still attached
|
||||||
|
*/
|
||||||
|
extern bool AtTerm();
|
||||||
|
|
||||||
|
/** Used to "fork" the process and go into the background during initial startup
|
||||||
|
* while we are AtTerm(). The actual fork is not done here, but earlier, and this
|
||||||
|
* simply notifys the parent via kill() to exit().
|
||||||
|
*/
|
||||||
|
extern void Fork();
|
||||||
|
|
||||||
|
/** Does something with the signal in Anope::Signal
|
||||||
|
*/
|
||||||
|
extern void HandleSignal();
|
||||||
|
|
||||||
|
/** One of the first functions called, does general initialization such as reading
|
||||||
|
* command line args, loading the configuration, doing the initial fork() if necessary,
|
||||||
|
* initializating language support, loading modules, and loading databases.
|
||||||
|
* @throws CoreException if something bad went wrong
|
||||||
|
*/
|
||||||
|
extern void Init(int ac, char **av);
|
||||||
|
|
||||||
|
/** Calls the save database event
|
||||||
|
*/
|
||||||
|
extern CoreExport void SaveDatabases();
|
||||||
|
|
||||||
/** Check whether two strings match.
|
/** Check whether two strings match.
|
||||||
* @param str The string to check against the pattern (e.g. foobar)
|
* @param str The string to check against the pattern (e.g. foobar)
|
||||||
* @param mask The pattern to check (e.g. foo*bar)
|
* @param mask The pattern to check (e.g. foo*bar)
|
||||||
@@ -324,12 +429,6 @@ namespace Anope
|
|||||||
*/
|
*/
|
||||||
extern CoreExport bool Match(const string &str, const string &mask, bool case_sensitive = false, bool use_regex = false);
|
extern CoreExport bool Match(const string &str, const string &mask, bool case_sensitive = false, bool use_regex = false);
|
||||||
|
|
||||||
/** Find a message in the message table
|
|
||||||
* @param name The name of the message were looking for
|
|
||||||
* @return NULL if we cant find it, or a pointer to the Message if we can
|
|
||||||
*/
|
|
||||||
extern CoreExport std::vector<Message *> FindMessage(const string &name);
|
|
||||||
|
|
||||||
/** Converts a string to hex
|
/** Converts a string to hex
|
||||||
* @param the data to be converted
|
* @param the data to be converted
|
||||||
* @return a anope::string containing the hex value
|
* @return a anope::string containing the hex value
|
||||||
@@ -356,6 +455,20 @@ namespace Anope
|
|||||||
*/
|
*/
|
||||||
extern CoreExport void B64Decode(const string &src, string &target);
|
extern CoreExport void B64Decode(const string &src, string &target);
|
||||||
|
|
||||||
|
/** Encrypts what is in 'src' to 'dest'
|
||||||
|
* @param src The source string to encrypt
|
||||||
|
* @param dest The destination where the encrypted string is placed
|
||||||
|
*/
|
||||||
|
extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest);
|
||||||
|
|
||||||
|
/** Decrypts what is in 'src' to 'dest'.
|
||||||
|
* @param src The source string to decrypt
|
||||||
|
* @param dest The destination where the decrypted string is placed
|
||||||
|
* @return true if decryption was successful. This is usually not the case
|
||||||
|
* as most encryption methods we use are one way.
|
||||||
|
*/
|
||||||
|
extern CoreExport bool Decrypt(const Anope::string &src, Anope::string &dest);
|
||||||
|
|
||||||
/** Returns a sequence of data formatted as the format argument specifies.
|
/** Returns a sequence of data formatted as the format argument specifies.
|
||||||
** After the format parameter, the function expects at least as many
|
** After the format parameter, the function expects at least as many
|
||||||
** additional arguments as specified in format.
|
** additional arguments as specified in format.
|
||||||
@@ -374,6 +487,60 @@ namespace Anope
|
|||||||
* @return An error message
|
* @return An error message
|
||||||
*/
|
*/
|
||||||
extern CoreExport const string LastError();
|
extern CoreExport const string LastError();
|
||||||
|
|
||||||
|
/** Determines if a path is a file
|
||||||
|
*/
|
||||||
|
extern CoreExport bool IsFile(const Anope::string &file);
|
||||||
|
|
||||||
|
/** Converts a string into seconds
|
||||||
|
* @param s The string, eg 3d
|
||||||
|
* @return The time represented by the string, eg 259,200
|
||||||
|
*/
|
||||||
|
extern CoreExport time_t DoTime(const Anope::string &s);
|
||||||
|
|
||||||
|
/** Retrieves a human readable string representing the time in seconds
|
||||||
|
* @param seconds The time on seconds, eg 60
|
||||||
|
* @param nc The account to use language settings for to translate this string, if applicable
|
||||||
|
* @return A human readable string, eg "1 minute"
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = NULL);
|
||||||
|
|
||||||
|
/** Generates a human readable string of type "expires in ..."
|
||||||
|
* @param expires time in seconds
|
||||||
|
* @param nc The account to use language settings for to translate this string, if applicable
|
||||||
|
* @return A human readable string, eg "expires in 5 days"
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string Expires(time_t seconds, const NickCore *nc = NULL);
|
||||||
|
|
||||||
|
/** Converts a time in seconds (epoch) to a human readable format.
|
||||||
|
* @param t The time
|
||||||
|
* @param nc The account to use language settings for to translate this string, if applicable
|
||||||
|
* @param short_output If true, the output is just a date (eg, "Apr 12 20:18:22 2009 MSD"), else it includes the date and how long ago/from now that date is, (eg "Apr 12 20:18:22 2009 MSD (1313 days, 9 hours, 32 minutes ago)"
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false);
|
||||||
|
|
||||||
|
/** Normalize buffer, stripping control characters and colors
|
||||||
|
* @param A string to be parsed for control and color codes
|
||||||
|
* @return A string stripped of control and color codes
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
|
||||||
|
|
||||||
|
/** Main processing routine. Parses the message and takes the appropriate action.
|
||||||
|
* @param Raw message from the uplink
|
||||||
|
*/
|
||||||
|
extern void Process(const Anope::string &);
|
||||||
|
|
||||||
|
/** Does a blocking dns query and returns the first IP.
|
||||||
|
* @param host host to look up
|
||||||
|
* @param type inet addr type
|
||||||
|
* @return the IP if it was found, else the host
|
||||||
|
*/
|
||||||
|
extern Anope::string Resolve(const Anope::string &host, int type);
|
||||||
|
|
||||||
|
/** Generate a string of random letters and numbers
|
||||||
|
* @param len The length of the string returned
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string Random(size_t len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** sepstream allows for splitting token seperated lists.
|
/** sepstream allows for splitting token seperated lists.
|
||||||
@@ -387,36 +554,65 @@ class CoreExport sepstream
|
|||||||
/** Original string.
|
/** Original string.
|
||||||
*/
|
*/
|
||||||
Anope::string tokens;
|
Anope::string tokens;
|
||||||
/** Last position of a seperator token
|
|
||||||
*/
|
|
||||||
Anope::string::iterator last_starting_position;
|
|
||||||
/** Current string position
|
|
||||||
*/
|
|
||||||
Anope::string::iterator n;
|
|
||||||
/** Seperator value
|
/** Seperator value
|
||||||
*/
|
*/
|
||||||
char sep;
|
char sep;
|
||||||
|
/** Current string position
|
||||||
|
*/
|
||||||
|
size_t pos;
|
||||||
|
/** If set then GetToken() can return an empty string
|
||||||
|
*/
|
||||||
|
bool allow_empty;
|
||||||
public:
|
public:
|
||||||
/** Create a sepstream and fill it with the provided data
|
/** Create a sepstream and fill it with the provided data
|
||||||
*/
|
*/
|
||||||
sepstream(const Anope::string &source, char seperator);
|
sepstream(const Anope::string &source, char seperator, bool allowempty = false);
|
||||||
virtual ~sepstream() { }
|
|
||||||
|
|
||||||
/** Fetch the next token from the stream
|
/** Fetch the next token from the stream
|
||||||
* @param token The next token from the stream is placed here
|
* @param token The next token from the stream is placed here
|
||||||
* @return True if tokens still remain, false if there are none left
|
* @return True if tokens still remain, false if there are none left
|
||||||
*/
|
*/
|
||||||
virtual bool GetToken(Anope::string &token);
|
bool GetToken(Anope::string &token);
|
||||||
|
|
||||||
|
/** Gets token number 'num' from the stream
|
||||||
|
* @param token The token is placed here
|
||||||
|
* @param num The token number to featch
|
||||||
|
* @return True if the token was able to be fetched
|
||||||
|
*/
|
||||||
|
bool GetToken(Anope::string &token, int num);
|
||||||
|
|
||||||
|
/** Gets every token from this stream
|
||||||
|
* @param token Tokens are pushed back here
|
||||||
|
*/
|
||||||
|
template<typename T> void GetTokens(T& token)
|
||||||
|
{
|
||||||
|
token.clear();
|
||||||
|
Anope::string t;
|
||||||
|
while (this->GetToken(t))
|
||||||
|
token.push_back(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Gets token number 'num' from the stream and all remaining tokens.
|
||||||
|
* @param token The token is placed here
|
||||||
|
* @param num The token number to featch
|
||||||
|
* @return True if the token was able to be fetched
|
||||||
|
*/
|
||||||
|
bool GetTokenRemainder(Anope::string &token, int num);
|
||||||
|
|
||||||
|
/** Determines the number of tokens in this stream.
|
||||||
|
* @return The number of tokens in this stream
|
||||||
|
*/
|
||||||
|
int NumTokens();
|
||||||
|
|
||||||
/** Fetch the entire remaining stream, without tokenizing
|
/** Fetch the entire remaining stream, without tokenizing
|
||||||
* @return The remaining part of the stream
|
* @return The remaining part of the stream
|
||||||
*/
|
*/
|
||||||
virtual const Anope::string GetRemaining();
|
const Anope::string GetRemaining();
|
||||||
|
|
||||||
/** Returns true if the end of the stream has been reached
|
/** Returns true if the end of the stream has been reached
|
||||||
* @return True if the end of the stream has been reached, otherwise false
|
* @return True if the end of the stream has been reached, otherwise false
|
||||||
*/
|
*/
|
||||||
virtual bool StreamEnd();
|
bool StreamEnd();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A derived form of sepstream, which seperates on commas
|
/** A derived form of sepstream, which seperates on commas
|
||||||
@@ -426,7 +622,7 @@ class commasepstream : public sepstream
|
|||||||
public:
|
public:
|
||||||
/** Initialize with comma seperator
|
/** Initialize with comma seperator
|
||||||
*/
|
*/
|
||||||
commasepstream(const Anope::string &source) : sepstream(source, ',') { }
|
commasepstream(const Anope::string &source, bool allowempty = false) : sepstream(source, ',', allowempty) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A derived form of sepstream, which seperates on spaces
|
/** A derived form of sepstream, which seperates on spaces
|
||||||
@@ -484,14 +680,6 @@ class CoreException : public std::exception
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class FatalException : public CoreException
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
FatalException(const Anope::string &reason = "") : CoreException(reason) { }
|
|
||||||
|
|
||||||
virtual ~FatalException() throw() { }
|
|
||||||
};
|
|
||||||
|
|
||||||
class ModuleException : public CoreException
|
class ModuleException : public CoreException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -534,8 +722,7 @@ template<typename T> inline void convert(const Anope::string &s, T &x, Anope::st
|
|||||||
leftover.clear();
|
leftover.clear();
|
||||||
std::istringstream i(s.str());
|
std::istringstream i(s.str());
|
||||||
char c;
|
char c;
|
||||||
bool res = i >> x;
|
if (!(i >> x))
|
||||||
if (!res)
|
|
||||||
throw ConvertException("Convert fail");
|
throw ConvertException("Convert fail");
|
||||||
if (failIfLeftoverChars)
|
if (failIfLeftoverChars)
|
||||||
{
|
{
|
||||||
@@ -571,131 +758,23 @@ template<typename T> inline T convertTo(const Anope::string &s, bool failIfLefto
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
|
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
|
||||||
* for debug builds and static_cast/reinterpret_cast on releass builds
|
* for debug builds and static_cast on releass builds
|
||||||
* to speed up the program because dynamic_cast relies on RTTI.
|
* to speed up the program because dynamic_cast relies on RTTI.
|
||||||
*/
|
*/
|
||||||
#ifdef DEBUG_BUILD
|
#ifdef DEBUG_BUILD
|
||||||
# include <typeinfo>
|
# include <typeinfo>
|
||||||
#endif
|
|
||||||
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_BUILD
|
|
||||||
T ret = dynamic_cast<T>(ptr);
|
T ret = dynamic_cast<T>(ptr);
|
||||||
if (ptr != NULL && ret == NULL)
|
if (ptr != NULL && ret == NULL)
|
||||||
throw CoreException(Anope::string("anope_dynamic_static_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
|
throw CoreException(Anope::string("anope_dynamic_static_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
|
template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
||||||
|
{
|
||||||
return static_cast<T>(ptr);
|
return static_cast<T>(ptr);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename O> inline T anope_dynamic_reinterpret_cast(O ptr)
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_BUILD
|
|
||||||
T ret = dynamic_cast<T>(ptr);
|
|
||||||
if (ptr != NULL && ret == NULL)
|
|
||||||
throw CoreException(Anope::string("anope_dynamic_reinterpret_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
|
|
||||||
return ret;
|
|
||||||
#else
|
|
||||||
return reinterpret_cast<T>(ptr);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
|
|
||||||
/** Class with the ability to keep flags on items, they should extend from this
|
|
||||||
* where T is an enum.
|
|
||||||
*/
|
|
||||||
template<typename T, size_t Size = 32> class Flags
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
std::bitset<Size> Flag_Values;
|
|
||||||
const Anope::string *Flag_Strings;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Flags() : Flag_Strings(NULL) { }
|
|
||||||
Flags(const Anope::string *flag_strings) : Flag_Strings(flag_strings) { }
|
|
||||||
|
|
||||||
/** Add a flag to this item
|
|
||||||
* @param Value The flag
|
|
||||||
*/
|
|
||||||
void SetFlag(T Value)
|
|
||||||
{
|
|
||||||
Flag_Values[Value] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Remove a flag from this item
|
|
||||||
* @param Value The flag
|
|
||||||
*/
|
|
||||||
void UnsetFlag(T Value)
|
|
||||||
{
|
|
||||||
Flag_Values[Value] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Check if this item has a flag
|
|
||||||
* @param Value The flag
|
|
||||||
* @return true or false
|
|
||||||
*/
|
|
||||||
bool HasFlag(T Value) const
|
|
||||||
{
|
|
||||||
return Flag_Values.test(Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Check how many flags are set
|
|
||||||
* @return The number of flags set
|
|
||||||
*/
|
|
||||||
size_t FlagCount() const
|
|
||||||
{
|
|
||||||
return Flag_Values.count();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Unset all of the flags
|
|
||||||
*/
|
|
||||||
void ClearFlags()
|
|
||||||
{
|
|
||||||
Flag_Values.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
Anope::string ToString() const
|
|
||||||
{
|
|
||||||
std::vector<Anope::string> v = ToVector();
|
|
||||||
Anope::string flag_buf;
|
|
||||||
for (unsigned i = 0; i < v.size(); ++i)
|
|
||||||
flag_buf += v[i] + " ";
|
|
||||||
flag_buf.trim();
|
|
||||||
return flag_buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FromString(const Anope::string &str)
|
|
||||||
{
|
|
||||||
spacesepstream sep(str);
|
|
||||||
Anope::string buf;
|
|
||||||
std::vector<Anope::string> v;
|
|
||||||
|
|
||||||
while (sep.GetToken(buf))
|
|
||||||
v.push_back(buf);
|
|
||||||
|
|
||||||
FromVector(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<Anope::string> ToVector() const
|
|
||||||
{
|
|
||||||
std::vector<Anope::string> ret;
|
|
||||||
for (unsigned i = 0; this->Flag_Strings && !this->Flag_Strings[i].empty(); ++i)
|
|
||||||
if (this->HasFlag(static_cast<T>(i)))
|
|
||||||
ret.push_back(this->Flag_Strings[i]);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FromVector(const std::vector<Anope::string> &strings)
|
|
||||||
{
|
|
||||||
this->ClearFlags();
|
|
||||||
|
|
||||||
for (unsigned i = 0; this->Flag_Strings && !this->Flag_Strings[i].empty(); ++i)
|
|
||||||
for (unsigned j = 0; j < strings.size(); ++j)
|
|
||||||
if (this->Flag_Strings[i] == strings[j])
|
|
||||||
this->SetFlag(static_cast<T>(i));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // ANOPE_H
|
#endif // ANOPE_H
|
||||||
|
|||||||
+54
-24
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
||||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
* Copyright (C) 2008-2014 Anope Team <team@anope.org>
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BASE_H
|
#ifndef BASE_H
|
||||||
@@ -16,53 +17,78 @@
|
|||||||
class CoreExport Base
|
class CoreExport Base
|
||||||
{
|
{
|
||||||
/* References to this base class */
|
/* References to this base class */
|
||||||
std::set<dynamic_reference_base *> References;
|
std::set<ReferenceBase *> *references;
|
||||||
public:
|
public:
|
||||||
Base();
|
Base();
|
||||||
virtual ~Base();
|
virtual ~Base();
|
||||||
void AddReference(dynamic_reference_base *r);
|
|
||||||
void DelReference(dynamic_reference_base *r);
|
/** Adds a reference to this object. Eg, when a Reference
|
||||||
|
* is created referring to this object this is called. It is used to
|
||||||
|
* cleanup references when this object is destructed.
|
||||||
|
*/
|
||||||
|
void AddReference(ReferenceBase *r);
|
||||||
|
|
||||||
|
void DelReference(ReferenceBase *r);
|
||||||
};
|
};
|
||||||
|
|
||||||
class dynamic_reference_base
|
class ReferenceBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
bool invalid;
|
bool invalid;
|
||||||
public:
|
public:
|
||||||
dynamic_reference_base() : invalid(false) { }
|
ReferenceBase() : invalid(false) { }
|
||||||
dynamic_reference_base(const dynamic_reference_base &other) : invalid(other.invalid) { }
|
ReferenceBase(const ReferenceBase &other) : invalid(other.invalid) { }
|
||||||
virtual ~dynamic_reference_base() { }
|
virtual ~ReferenceBase() { }
|
||||||
inline void Invalidate() { this->invalid = true; }
|
inline void Invalidate() { this->invalid = true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Used to hold pointers to objects that may be deleted. A Reference will
|
||||||
|
* no longer be valid once the object it refers is destructed.
|
||||||
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class dynamic_reference : public dynamic_reference_base
|
class Reference : public ReferenceBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
T *ref;
|
T *ref;
|
||||||
public:
|
public:
|
||||||
dynamic_reference() : ref(NULL)
|
Reference() : ref(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic_reference(T *obj) : ref(obj)
|
Reference(T *obj) : ref(obj)
|
||||||
{
|
{
|
||||||
if (ref)
|
if (ref)
|
||||||
ref->AddReference(this);
|
ref->AddReference(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic_reference(const dynamic_reference<T> &other) : dynamic_reference_base(other), ref(other.ref)
|
Reference(const Reference<T> &other) : ReferenceBase(other), ref(other.ref)
|
||||||
{
|
{
|
||||||
if (operator bool())
|
if (operator bool())
|
||||||
ref->AddReference(this);
|
ref->AddReference(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~dynamic_reference()
|
virtual ~Reference()
|
||||||
{
|
{
|
||||||
if (operator bool())
|
if (operator bool())
|
||||||
ref->DelReference(this);
|
ref->DelReference(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Reference<T>& operator=(const Reference<T> &other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
|
{
|
||||||
|
if (*this)
|
||||||
|
this->ref->DelReference(this);
|
||||||
|
|
||||||
|
this->ref = other.ref;
|
||||||
|
this->invalid = other.invalid;
|
||||||
|
|
||||||
|
if (*this)
|
||||||
|
this->ref->AddReference(this);
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/* We explicitly call operator bool here in several places to prevent other
|
/* We explicitly call operator bool here in several places to prevent other
|
||||||
* operators, such operator T*, from being called instead, which will mess
|
* operators, such operator T*, from being called instead, which will mess
|
||||||
* with any class inheriting from this that overloads this operator.
|
* with any class inheriting from this that overloads this operator.
|
||||||
@@ -88,22 +114,26 @@ class dynamic_reference : public dynamic_reference_base
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator=(T *newref)
|
inline T* operator*()
|
||||||
{
|
{
|
||||||
if (operator bool())
|
if (operator bool())
|
||||||
this->ref->DelReference(this);
|
return this->ref;
|
||||||
this->ref = newref;
|
return NULL;
|
||||||
this->invalid = false;
|
|
||||||
if (operator bool())
|
|
||||||
this->ref->AddReference(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator<(const dynamic_reference<T> &other) const
|
/** Note that we can't have an operator< that returns this->ref < other.ref
|
||||||
{
|
* because this function is used to sort objects in containers (such as set
|
||||||
return this < &other;
|
* or map), and if the references themselves can change if the object they
|
||||||
}
|
* refer to is invalidated or changed, then this screws with the order that
|
||||||
|
* the objects would be in the container without properly adjusting the
|
||||||
|
* container, resulting in weird stuff.
|
||||||
|
*
|
||||||
|
* As such, we don't allow storing references in containers that require
|
||||||
|
* operator<, because they would not be able to compare what the references
|
||||||
|
* actually referred to.
|
||||||
|
*/
|
||||||
|
|
||||||
inline bool operator==(const dynamic_reference<T> &other)
|
inline bool operator==(const Reference<T> &other)
|
||||||
{
|
{
|
||||||
if (!this->invalid)
|
if (!this->invalid)
|
||||||
return this->ref == other;
|
return this->ref == other;
|
||||||
|
|||||||
+39
-43
@@ -1,8 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
|
*
|
||||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
* Copyright (C) 2008-2014 Anope Team <team@anope.org>
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BOTS_H
|
#ifndef BOTS_H
|
||||||
@@ -14,40 +16,31 @@
|
|||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
|
|
||||||
typedef Anope::insensitive_map<BotInfo *> botinfo_map;
|
typedef Anope::map<BotInfo *> botinfo_map;
|
||||||
typedef Anope::map<BotInfo *> botinfouid_map;
|
|
||||||
|
|
||||||
extern CoreExport serialize_checker<botinfo_map> BotListByNick;
|
extern CoreExport Serialize::Checker<botinfo_map> BotListByNick, BotListByUID;
|
||||||
extern CoreExport serialize_checker<botinfouid_map> BotListByUID;
|
|
||||||
|
|
||||||
/** Flags settable on a bot
|
/* A service bot (NickServ, ChanServ, a BotServ bot, etc). */
|
||||||
*/
|
class CoreExport BotInfo : public User, public Serializable
|
||||||
enum BotFlag
|
|
||||||
{
|
|
||||||
BI_BEGIN,
|
|
||||||
|
|
||||||
/* This bot is a core bot. NickServ, ChanServ, etc */
|
|
||||||
BI_CORE,
|
|
||||||
/* This bot can only be assigned by IRCops */
|
|
||||||
BI_PRIVATE,
|
|
||||||
/* This bot is defined in the config */
|
|
||||||
BI_CONF,
|
|
||||||
|
|
||||||
BI_END
|
|
||||||
};
|
|
||||||
|
|
||||||
static const Anope::string BotFlagString[] = { "BEGIN", "CORE", "PRIVATE", "CONF", "" };
|
|
||||||
|
|
||||||
class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Serializable
|
|
||||||
{
|
{
|
||||||
|
/* Channels this bot is assigned to */
|
||||||
|
Serialize::Checker<std::set<ChannelInfo *> > channels;
|
||||||
public:
|
public:
|
||||||
time_t created; /* Birth date ;) */
|
time_t created;
|
||||||
time_t lastmsg; /* Last time we said something */
|
/* Last time this bot said something (via privmsg) */
|
||||||
typedef Anope::insensitive_map<CommandInfo> command_map;
|
time_t lastmsg;
|
||||||
command_map commands; /* Commands, actual name to service name */
|
/* Map of actual command names -> service name/permission required */
|
||||||
Anope::string botmodes; /* Modes the bot should have as configured in service:modes */
|
CommandInfo::map commands;
|
||||||
std::vector<Anope::string> botchannels; /* Channels the bot should be in as configured in service:channels */
|
/* Modes the bot should have as configured in service:modes */
|
||||||
bool introduced; /* Whether or not this bot is introduced */
|
Anope::string botmodes;
|
||||||
|
/* Channels the bot should be in as configured in service:channels */
|
||||||
|
std::vector<Anope::string> botchannels;
|
||||||
|
/* Whether or not this bot is introduced to the network */
|
||||||
|
bool introduced;
|
||||||
|
/* Bot can only be assigned by irc ops */
|
||||||
|
bool oper_only;
|
||||||
|
/* Bot is defined in the configuration file */
|
||||||
|
bool conf;
|
||||||
|
|
||||||
/** Create a new bot.
|
/** Create a new bot.
|
||||||
* @param nick The nickname to assign to the bot.
|
* @param nick The nickname to assign to the bot.
|
||||||
@@ -62,21 +55,21 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Se
|
|||||||
*/
|
*/
|
||||||
virtual ~BotInfo();
|
virtual ~BotInfo();
|
||||||
|
|
||||||
const Anope::string serialize_name() const;
|
void Serialize(Serialize::Data &data) const;
|
||||||
Serialize::Data serialize() const;
|
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
|
||||||
|
|
||||||
void GenerateUID();
|
void GenerateUID();
|
||||||
|
|
||||||
|
void OnKill();
|
||||||
|
|
||||||
/** Change the nickname for the bot.
|
/** Change the nickname for the bot.
|
||||||
* @param newnick The nick to change to
|
* @param newnick The nick to change to
|
||||||
*/
|
*/
|
||||||
void SetNewNick(const Anope::string &newnick);
|
void SetNewNick(const Anope::string &newnick);
|
||||||
|
|
||||||
/** Rejoins all channels that this bot is assigned to.
|
/** Return the channels this bot is assigned to
|
||||||
* Used on /kill, rename, etc.
|
|
||||||
*/
|
*/
|
||||||
void RejoinAll();
|
const std::set<ChannelInfo *> &GetChannels() const;
|
||||||
|
|
||||||
/** Assign this bot to a given channel, removing the existing assigned bot if one exists.
|
/** Assign this bot to a given channel, removing the existing assigned bot if one exists.
|
||||||
* @param u The user assigning the bot, or NULL
|
* @param u The user assigning the bot, or NULL
|
||||||
@@ -122,19 +115,22 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Se
|
|||||||
* @param cname The command name
|
* @param cname The command name
|
||||||
* @param sname The service name
|
* @param sname The service name
|
||||||
* @param permission Permission required to execute the command, if any
|
* @param permission Permission required to execute the command, if any
|
||||||
|
* @return The commandinfo for the newly created command
|
||||||
*/
|
*/
|
||||||
void 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
|
/** Get command info for a command
|
||||||
* @param cname The command name
|
* @param cname The command name
|
||||||
* @return A struct containing service name and permission
|
* @return A struct containing service name and permission
|
||||||
*/
|
*/
|
||||||
CommandInfo *GetCommand(const Anope::string &cname);
|
CommandInfo *GetCommand(const Anope::string &cname);
|
||||||
|
|
||||||
|
/** Find a bot by nick
|
||||||
|
* @param nick The nick
|
||||||
|
* @param nick_only True to only look by nick, and not by UID
|
||||||
|
* @return The bot, if it exists
|
||||||
|
*/
|
||||||
|
static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CoreExport BotInfo *findbot(const Anope::string &nick);
|
|
||||||
|
|
||||||
extern CoreExport void bot_raw_ban(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
|
|
||||||
extern CoreExport void bot_raw_kick(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
|
|
||||||
|
|
||||||
#endif // BOTS_H
|
#endif // BOTS_H
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* (C) 2003-2012 Anope Team
|
|
||||||
* Contact us at team@anope.org
|
|
||||||
*
|
|
||||||
* Please read COPYING and README for further details.
|
|
||||||
*
|
|
||||||
* Based on the original code of Epona by Lara.
|
|
||||||
* Based on the original code of Services by Andy Church.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOTSERV_H
|
|
||||||
#define BOTSERV_H
|
|
||||||
|
|
||||||
#include "anope.h"
|
|
||||||
|
|
||||||
/* BotServ SET flags */
|
|
||||||
enum BotServFlag
|
|
||||||
{
|
|
||||||
BS_BEGIN,
|
|
||||||
/* BotServ won't kick ops */
|
|
||||||
BS_DONTKICKOPS,
|
|
||||||
/* BotServ won't kick voices */
|
|
||||||
BS_DONTKICKVOICES,
|
|
||||||
/* BotServ bot accepts fantasy commands */
|
|
||||||
BS_FANTASY,
|
|
||||||
/* BotServ should show greets */
|
|
||||||
BS_GREET,
|
|
||||||
/* BotServ bots are not allowed to be in this channel */
|
|
||||||
BS_NOBOT,
|
|
||||||
/* BotServ kicks for bolds */
|
|
||||||
BS_KICK_BOLDS,
|
|
||||||
/* BotServ kicks for colors */
|
|
||||||
BS_KICK_COLORS,
|
|
||||||
/* BOtServ kicks for reverses */
|
|
||||||
BS_KICK_REVERSES,
|
|
||||||
/* BotServ kicks for underlines */
|
|
||||||
BS_KICK_UNDERLINES,
|
|
||||||
/* BotServ kicks for badwords */
|
|
||||||
BS_KICK_BADWORDS,
|
|
||||||
/* BotServ kicks for caps */
|
|
||||||
BS_KICK_CAPS,
|
|
||||||
/* BotServ kicks for flood */
|
|
||||||
BS_KICK_FLOOD,
|
|
||||||
/* BotServ kicks for repeating */
|
|
||||||
BS_KICK_REPEAT,
|
|
||||||
/* BotServ kicks for italics */
|
|
||||||
BS_KICK_ITALICS,
|
|
||||||
/* BotServ kicks for amsgs */
|
|
||||||
BS_KICK_AMSGS,
|
|
||||||
BS_END
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string BotServFlagStrings[] = {
|
|
||||||
"BEGIN", "DONTKICKOPS", "DONTKICKVOICES", "FANTASY", "GREET", "NOBOT",
|
|
||||||
"KICK_BOLDs", "KICK_COLORS", "KICK_REVERSES", "KICK_UNDERLINES", "KICK_BADWORDS", "KICK_CAPS",
|
|
||||||
"KICK_FLOOD", "KICK_REPEAT", "KICK_ITALICS", "KICK_AMSGS", "MSG_PRIVMSG", "MSG_NOTICE",
|
|
||||||
"MSG_NOTICEOPS", ""
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Indices for TTB (Times To Ban) */
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
TTB_BOLDS,
|
|
||||||
TTB_COLORS,
|
|
||||||
TTB_REVERSES,
|
|
||||||
TTB_UNDERLINES,
|
|
||||||
TTB_BADWORDS,
|
|
||||||
TTB_CAPS,
|
|
||||||
TTB_FLOOD,
|
|
||||||
TTB_REPEAT,
|
|
||||||
TTB_ITALICS,
|
|
||||||
TTB_AMSGS,
|
|
||||||
TTB_SIZE
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // BOTSERV_H
|
|
||||||
+139
-94
@@ -1,9 +1,10 @@
|
|||||||
/* Channel support
|
/* Channel support
|
||||||
*
|
*
|
||||||
* (C) 2008-2012 Anope Team
|
* (C) 2008-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CHANNELS_H
|
#ifndef CHANNELS_H
|
||||||
@@ -14,62 +15,57 @@
|
|||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
|
|
||||||
typedef Anope::insensitive_map<Channel *> channel_map;
|
typedef Anope::hash_map<Channel *> channel_map;
|
||||||
|
|
||||||
extern CoreExport channel_map ChannelList;
|
extern CoreExport channel_map ChannelList;
|
||||||
|
|
||||||
struct UserContainer : public Extensible
|
/* A user container, there is one of these per user per channel. */
|
||||||
|
struct ChanUserContainer : public Extensible
|
||||||
{
|
{
|
||||||
User *user;
|
User *user;
|
||||||
ChannelStatus *Status;
|
Channel *chan;
|
||||||
|
/* Status the user has in the channel */
|
||||||
|
ChannelStatus status;
|
||||||
|
|
||||||
UserContainer(User *u) : user(u) { }
|
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
|
||||||
virtual ~UserContainer() { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<UserContainer *> CUserList;
|
class CoreExport Channel : public Base, public Extensible
|
||||||
|
|
||||||
enum ChannelFlag
|
|
||||||
{
|
|
||||||
/* ChanServ is currently holding the channel */
|
|
||||||
CH_INHABIT,
|
|
||||||
/* Channel still exists when emptied */
|
|
||||||
CH_PERSIST,
|
|
||||||
/* If set the channel is syncing users (channel was just created) and it should not be deleted */
|
|
||||||
CH_SYNCING
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string ChannelFlagString[] = { "CH_INABIT", "CH_PERSIST", "CH_SYNCING", "" };
|
|
||||||
|
|
||||||
class CoreExport Channel : public virtual Base, public Extensible, public Flags<ChannelFlag, 3>
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::multimap<ChannelModeName, Anope::string> ModeList;
|
typedef std::multimap<Anope::string, Anope::string> ModeList;
|
||||||
private:
|
private:
|
||||||
/** A map of channel modes with their parameters set on this channel
|
/** A map of channel modes with their parameters set on this channel
|
||||||
*/
|
*/
|
||||||
ModeList modes;
|
ModeList modes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default constructor
|
/* Channel name */
|
||||||
* @param name The channel name
|
Anope::string name;
|
||||||
* @param ts The time the channel was created
|
/* Set if this channel is registered. ci->c == this. Contains information relevant to the registered channel */
|
||||||
|
Serialize::Reference<ChannelInfo> ci;
|
||||||
|
/* When the channel was created */
|
||||||
|
time_t creation_time;
|
||||||
|
/* If the channel has just been created in a netjoin */
|
||||||
|
bool syncing;
|
||||||
|
/* Is configured in the conf as a channel bots should be in */
|
||||||
|
bool botchannel;
|
||||||
|
|
||||||
|
/* Users in the channel */
|
||||||
|
typedef std::map<User *, ChanUserContainer *> ChanUserList;
|
||||||
|
ChanUserList users;
|
||||||
|
|
||||||
|
/* Current topic of the channel */
|
||||||
|
Anope::string topic;
|
||||||
|
/* Who set the topic */
|
||||||
|
Anope::string topic_setter;
|
||||||
|
/* The timestamp associated with the topic. Not necessarually anywhere close to Anope::CurTime.
|
||||||
|
* This is the time the topic was *originally set*. When we restore the topic we want to change the TS back
|
||||||
|
* to this, but we can only do this on certain IRCds.
|
||||||
*/
|
*/
|
||||||
Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
|
time_t topic_ts;
|
||||||
|
/* The actual time the topic was set, probably close to Anope::CurTime */
|
||||||
/** Default destructor
|
time_t topic_time;
|
||||||
*/
|
|
||||||
~Channel();
|
|
||||||
|
|
||||||
Anope::string name; /* Channel name */
|
|
||||||
serialize_obj<ChannelInfo> ci; /* Corresponding ChannelInfo */
|
|
||||||
time_t creation_time; /* When channel was created */
|
|
||||||
|
|
||||||
/* List of users in the channel */
|
|
||||||
CUserList users;
|
|
||||||
|
|
||||||
Anope::string topic; /* Current topic of the channel */
|
|
||||||
Anope::string topic_setter; /* Who set the topic */
|
|
||||||
time_t topic_time; /* When the topic was set*/
|
|
||||||
|
|
||||||
time_t server_modetime; /* Time of last server MODE */
|
time_t server_modetime; /* Time of last server MODE */
|
||||||
time_t chanserv_modetime; /* Time of last check_modes() */
|
time_t chanserv_modetime; /* Time of last check_modes() */
|
||||||
@@ -77,6 +73,18 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
|||||||
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
|
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
|
||||||
int16_t bouncy_modes; /* Did we fail to set modes here? */
|
int16_t bouncy_modes; /* Did we fail to set modes here? */
|
||||||
|
|
||||||
|
private:
|
||||||
|
/** Constructor
|
||||||
|
* @param name The channel name
|
||||||
|
* @param ts The time the channel was created
|
||||||
|
*/
|
||||||
|
Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** Destructor
|
||||||
|
*/
|
||||||
|
~Channel();
|
||||||
|
|
||||||
/** Call if we need to unset all modes and clear all user status (internally).
|
/** Call if we need to unset all modes and clear all user status (internally).
|
||||||
* Only useful if we get a SJOIN with a TS older than what we have here
|
* Only useful if we get a SJOIN with a TS older than what we have here
|
||||||
*/
|
*/
|
||||||
@@ -90,10 +98,16 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
|||||||
*/
|
*/
|
||||||
void CheckModes();
|
void CheckModes();
|
||||||
|
|
||||||
|
/** Check if this channel should be deleted
|
||||||
|
*/
|
||||||
|
bool CheckDelete();
|
||||||
|
|
||||||
/** Join a user internally to the channel
|
/** Join a user internally to the channel
|
||||||
* @param u The user
|
* @param u The user
|
||||||
|
* @param status The status to give the user, if any
|
||||||
|
* @return The UserContainer for the user
|
||||||
*/
|
*/
|
||||||
void JoinUser(User *u);
|
ChanUserContainer* JoinUser(User *u, const ChannelStatus *status);
|
||||||
|
|
||||||
/** Remove a user internally from the channel
|
/** Remove a user internally from the channel
|
||||||
* @param u The user
|
* @param u The user
|
||||||
@@ -104,113 +118,114 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
|||||||
* @param u The user
|
* @param u The user
|
||||||
* @return A user container if found, else NULL
|
* @return A user container if found, else NULL
|
||||||
*/
|
*/
|
||||||
UserContainer *FindUser(const User *u) const;
|
ChanUserContainer *FindUser(User *u) const;
|
||||||
|
|
||||||
/** Check if a user has a status on a channel
|
/** Check if a user has a status on a channel
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param cms The status mode, or NULL to represent no status
|
* @param cms The status mode, or NULL to represent no status
|
||||||
* @return true or false
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
bool HasUserStatus(const User *u, ChannelModeStatus *cms) const;
|
bool HasUserStatus(User *u, ChannelModeStatus *cms);
|
||||||
|
|
||||||
/** Check if a user has a status on a channel
|
/** Check if a user has a status on a channel
|
||||||
* Use the overloaded function for ChannelModeStatus* to check for no status
|
* Use the overloaded function for ChannelModeStatus* to check for no status
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param Name The Mode name, eg CMODE_OP, CMODE_VOICE
|
* @param name The mode name, eg CMODE_OP, CMODE_VOICE
|
||||||
* @return true or false
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
bool HasUserStatus(const User *u, ChannelModeName Name) const;
|
bool HasUserStatus(User *u, const Anope::string &name);
|
||||||
|
|
||||||
/** See if a channel has a mode
|
/** See if a channel has a mode
|
||||||
* @param Name The mode name
|
* @param name The mode name
|
||||||
* @return The number of modes set
|
* @return The number of modes set
|
||||||
* @param param The optional mode param
|
* @param param The optional mode param
|
||||||
*/
|
*/
|
||||||
size_t HasMode(ChannelModeName Name, const Anope::string ¶m = "");
|
size_t HasMode(const Anope::string &name, const Anope::string ¶m = "");
|
||||||
|
|
||||||
/** Get a list of modes on a channel
|
|
||||||
* @param Name A mode name to get the list of
|
|
||||||
* @return a pair of iterators for the beginning and end of the list
|
|
||||||
*/
|
|
||||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(ChannelModeName Name);
|
|
||||||
|
|
||||||
/** Set a mode internally on a channel, this is not sent out to the IRCd
|
/** Set a mode internally on a channel, this is not sent out to the IRCd
|
||||||
* @param setter The setter
|
* @param setter The setter
|
||||||
* @param cm The mode
|
* @param cm The mode
|
||||||
* @param param The param
|
* @param param The param
|
||||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||||
*/
|
*/
|
||||||
void SetModeInternal(User *setter, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
void SetModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||||
|
|
||||||
/** Remove a mode internally on a channel, this is not sent out to the IRCd
|
/** Remove a mode internally on a channel, this is not sent out to the IRCd
|
||||||
* @param setter The Setter
|
* @param setter The Setter
|
||||||
* @param cm The mode
|
* @param cm The mode
|
||||||
* @param param The param
|
* @param param The param
|
||||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||||
*/
|
*/
|
||||||
void RemoveModeInternal(User *setter, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
void RemoveModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||||
|
|
||||||
/** Set a mode on a channel
|
/** Set a mode on a channel
|
||||||
* @param bi The client setting the modes
|
* @param bi The client setting the modes
|
||||||
* @param cm The mode
|
* @param cm The mode
|
||||||
* @param param Optional param arg for the mode
|
* @param param Optional param arg for the mode
|
||||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||||
*/
|
*/
|
||||||
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a mode on a channel
|
* Set a mode on a channel
|
||||||
* @param bi The client setting the modes
|
* @param bi The client setting the modes
|
||||||
* @param Name The mode name
|
* @param name The mode name
|
||||||
* @param param Optional param arg for the mode
|
* @param param Optional param arg for the mode
|
||||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||||
*/
|
*/
|
||||||
void SetMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
void SetMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||||
|
|
||||||
/** Remove a mode from a channel
|
/** Remove a mode from a channel
|
||||||
* @param bi The client setting the modes
|
* @param bi The client setting the modes
|
||||||
* @param cm The mode
|
* @param cm The mode
|
||||||
* @param param Optional param arg for the mode
|
* @param param Optional param arg for the mode
|
||||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||||
*/
|
*/
|
||||||
void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a mode from a channel
|
* Remove a mode from a channel
|
||||||
* @param bi The client setting the modes
|
* @param bi The client setting the modes
|
||||||
* @param Name The mode name
|
* @param name The mode name
|
||||||
* @param param Optional param arg for the mode
|
* @param param Optional param arg for the mode
|
||||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||||
*/
|
*/
|
||||||
void RemoveMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
void RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||||
|
|
||||||
/** Get a param from the channel
|
/** Get a modes parameter for the channel
|
||||||
* @param Name The mode
|
* @param name The mode
|
||||||
* @param Target a string to put the param into
|
* @param target a string to put the param into
|
||||||
* @return true on success
|
* @return true if the parameter was fetched, false if on error (mode not set) etc.
|
||||||
*/
|
*/
|
||||||
bool GetParam(ChannelModeName Name, Anope::string &Target) const;
|
bool GetParam(const Anope::string &name, Anope::string &target) const;
|
||||||
|
|
||||||
/** Set a string of modes on the channel
|
/** Set a string of modes on the channel
|
||||||
* @param bi The client setting the modes
|
* @param bi The client setting the modes
|
||||||
* @param EnforceMLock Should mlock be enforced on this mode change
|
* @param enforce_mlock Should mlock be enforced on this mode change
|
||||||
* @param cmodes The modes to set
|
* @param cmodes The modes to set
|
||||||
*/
|
*/
|
||||||
void SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...);
|
void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...);
|
||||||
|
|
||||||
/** Set a string of modes internally on a channel
|
/** Set a string of modes internally on a channel
|
||||||
* @param setter the setter (if it is a user)
|
* @param source The setter
|
||||||
* @param mode the modes
|
* @param mode the modes
|
||||||
* @param EnforceMLock true to enforce mlock
|
* @param enforce_mlock true to enforce mlock
|
||||||
*/
|
*/
|
||||||
void SetModesInternal(User *setter, const Anope::string &mode, bool EnforceMLock = true);
|
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts = 0, bool enforce_mlock = true);
|
||||||
|
|
||||||
|
/** Does the given user match the given list? (CMODE_BAN, CMODE_EXCEPT, etc, a list mode)
|
||||||
|
* @param u The user
|
||||||
|
* @param list The mode of the list to check (eg CMODE_BAN)
|
||||||
|
* @return true if the user matches the list
|
||||||
|
*/
|
||||||
|
bool MatchesList(User *u, const Anope::string &list);
|
||||||
|
|
||||||
/** Kick a user from a channel internally
|
/** Kick a user from a channel internally
|
||||||
* @param source The sender of the kick
|
* @param source The sender of the kick
|
||||||
* @param nick The nick being kicked
|
* @param nick The nick being kicked
|
||||||
* @param reason The reason for the kick
|
* @param reason The reason for the kick
|
||||||
*/
|
*/
|
||||||
void KickInternal(const Anope::string &source, const Anope::string &nick, const Anope::string &reason);
|
void KickInternal(const MessageSource &source, const Anope::string &nick, const Anope::string &reason);
|
||||||
|
|
||||||
/** Kick a user from the channel
|
/** Kick a user from the channel
|
||||||
* @param bi The sender, can be NULL for the service bot for this channel
|
* @param bi The sender, can be NULL for the service bot for this channel
|
||||||
@@ -220,6 +235,17 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
|||||||
*/
|
*/
|
||||||
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
|
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
|
||||||
|
|
||||||
|
/** Get all modes set on this channel, excluding status modes.
|
||||||
|
* @return a map of modes and their optional parameters.
|
||||||
|
*/
|
||||||
|
const ModeList &GetModes() const;
|
||||||
|
|
||||||
|
/** Get a list of modes on a channel
|
||||||
|
* @param name A mode name to get the list of
|
||||||
|
* @return a vector of the list mode entries
|
||||||
|
*/
|
||||||
|
std::vector<Anope::string> GetModeList(const Anope::string &name);
|
||||||
|
|
||||||
/** Get a string of the modes set on this channel
|
/** Get a string of the modes set on this channel
|
||||||
* @param complete Include mode parameters
|
* @param complete Include mode parameters
|
||||||
* @param plus If set to false (with complete), mode parameters will not be given for modes requring no parameters to be unset
|
* @param plus If set to false (with complete), mode parameters will not be given for modes requring no parameters to be unset
|
||||||
@@ -228,11 +254,11 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
|||||||
Anope::string GetModes(bool complete, bool plus);
|
Anope::string GetModes(bool complete, bool plus);
|
||||||
|
|
||||||
/** Update the topic of the channel internally, and reset it if topiclock etc says to
|
/** Update the topic of the channel internally, and reset it if topiclock etc says to
|
||||||
* @param user THe user setting the new topic
|
* @param user The user setting the new topic
|
||||||
* @param newtopic The new topic
|
* @param newtopic The new topic
|
||||||
* @param ts The time the new topic is being set
|
* @param ts The time the new topic is being set
|
||||||
*/
|
*/
|
||||||
void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
|
void ChangeTopicInternal(User *u, const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
|
||||||
|
|
||||||
/** Update the topic of the channel, and reset it if topiclock etc says to
|
/** Update the topic of the channel, and reset it if topiclock etc says to
|
||||||
* @param user The user setting the topic
|
* @param user The user setting the topic
|
||||||
@@ -241,20 +267,39 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
|||||||
*/
|
*/
|
||||||
void ChangeTopic(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
|
void ChangeTopic(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
|
||||||
|
|
||||||
/** Hold the channel open using ChanServ
|
/** Set the correct modes, or remove the ones granted without permission,
|
||||||
|
* for the specified user.
|
||||||
|
* @param user The user to give/remove modes to/from
|
||||||
|
* @param give_modes if true modes may be given to the user
|
||||||
*/
|
*/
|
||||||
void Hold();
|
void SetCorrectModes(User *u, bool give_modes);
|
||||||
|
|
||||||
|
/** Unbans a user from this channel.
|
||||||
|
* @param u The user to unban
|
||||||
|
* @param mode The mode to unban
|
||||||
|
* @param full Whether or not to match using the user's real host and IP
|
||||||
|
* @return whether or not a ban was removed
|
||||||
|
*/
|
||||||
|
bool Unban(User *u, const Anope::string &mode, bool full = false);
|
||||||
|
|
||||||
|
/** Check whether a user is permitted to be on this channel
|
||||||
|
* @param u The user
|
||||||
|
* @return true if they are allowed, false if they aren't and were kicked
|
||||||
|
*/
|
||||||
|
bool CheckKick(User *user);
|
||||||
|
|
||||||
|
/** Finds a channel
|
||||||
|
* @param name The channel to find
|
||||||
|
* @return The channel, if found
|
||||||
|
*/
|
||||||
|
static Channel* Find(const Anope::string &name);
|
||||||
|
|
||||||
|
/** Finds or creates a channel
|
||||||
|
* @param name The channel name
|
||||||
|
* @param created Set to true if the channel was just created
|
||||||
|
* @param ts The time the channel was created
|
||||||
|
*/
|
||||||
|
static Channel *FindOrCreate(const Anope::string &name, bool &created, time_t ts = Anope::CurTime);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CoreExport Channel *findchan(const Anope::string &chan);
|
|
||||||
|
|
||||||
extern CoreExport User *nc_on_chan(Channel *c, const NickCore *nc);
|
|
||||||
|
|
||||||
extern CoreExport void do_cmode(const Anope::string &source, const Anope::string &channel, const Anope::string &modes, const Anope::string &ts);
|
|
||||||
extern CoreExport void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts);
|
|
||||||
extern CoreExport void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason);
|
|
||||||
extern CoreExport void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason);
|
|
||||||
|
|
||||||
extern CoreExport void chan_set_correct_modes(const User *user, Channel *c, int give_modes);
|
|
||||||
|
|
||||||
#endif // CHANNELS_H
|
#endif // CHANNELS_H
|
||||||
|
|||||||
+69
-31
@@ -1,6 +1,6 @@
|
|||||||
/* Declarations for command data.
|
/* Declarations for command data.
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -14,28 +14,39 @@
|
|||||||
|
|
||||||
#include "service.h"
|
#include "service.h"
|
||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
|
#include "channels.h"
|
||||||
|
|
||||||
enum CommandFlag
|
struct CommandGroup
|
||||||
{
|
{
|
||||||
CFLAG_ALLOW_UNREGISTERED,
|
Anope::string name, description;
|
||||||
CFLAG_STRIP_CHANNEL
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string CommandFlagStrings[] = {
|
|
||||||
"CFLAG_ALLOW_UNREGISTERED",
|
|
||||||
"CFLAG_STRIP_CHANNEL",
|
|
||||||
""
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Used in BotInfo::commands */
|
||||||
struct CommandInfo
|
struct CommandInfo
|
||||||
{
|
{
|
||||||
|
typedef Anope::map<CommandInfo> map;
|
||||||
|
|
||||||
|
CommandInfo() : hide(false), prepend_channel(false) { }
|
||||||
|
|
||||||
|
/* Service name of the command */
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
|
/* Permission required to execute the command */
|
||||||
Anope::string permission;
|
Anope::string permission;
|
||||||
|
/* Group this command is in */
|
||||||
|
Anope::string group;
|
||||||
|
/* whether or not to hide this command in help output */
|
||||||
|
bool hide;
|
||||||
|
/* Only used with fantasy */
|
||||||
|
bool prepend_channel;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CommandReply
|
/* Where the replies from commands go to. User inheits from this and is the normal
|
||||||
|
* source of a CommandReply
|
||||||
|
*/
|
||||||
|
struct CoreExport CommandReply
|
||||||
{
|
{
|
||||||
virtual void SendMessage(const BotInfo *source, const Anope::string &msg) = 0;
|
virtual ~CommandReply() { }
|
||||||
|
virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The source for a command */
|
/* The source for a command */
|
||||||
@@ -44,55 +55,59 @@ class CoreExport CommandSource
|
|||||||
/* The nick executing the command */
|
/* The nick executing the command */
|
||||||
Anope::string nick;
|
Anope::string nick;
|
||||||
/* User executing the command, may be NULL */
|
/* User executing the command, may be NULL */
|
||||||
User *u;
|
Reference<User> u;
|
||||||
public:
|
public:
|
||||||
/* The account executing the command */
|
/* The account executing the command */
|
||||||
NickCore *nc;
|
Reference<NickCore> nc;
|
||||||
/* Where the reply should go */
|
/* Where the reply should go */
|
||||||
CommandReply *reply;
|
CommandReply *reply;
|
||||||
/* Channel the command was executed on (fantasy) */
|
/* Channel the command was executed on (fantasy) */
|
||||||
Channel *c;
|
Reference<Channel> c;
|
||||||
/* The service this command is on */
|
/* The service this command is on */
|
||||||
BotInfo *owner;
|
Reference<BotInfo> service;
|
||||||
/* The service the reply should come from, *not* necessarily the service the command is on */
|
|
||||||
BotInfo *service;
|
|
||||||
/* The actual name of the command being executed */
|
/* The actual name of the command being executed */
|
||||||
Anope::string command;
|
Anope::string command;
|
||||||
/* The permission of the command being executed */
|
/* The permission of the command being executed */
|
||||||
Anope::string permission;
|
Anope::string permission;
|
||||||
|
|
||||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply);
|
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi);
|
||||||
|
|
||||||
const Anope::string &GetNick() const;
|
const Anope::string &GetNick() const;
|
||||||
User *GetUser() const;
|
User *GetUser();
|
||||||
AccessGroup AccessFor(ChannelInfo *ci) const;
|
NickCore *GetAccount();
|
||||||
bool IsFounder(ChannelInfo *ci) const;
|
AccessGroup AccessFor(ChannelInfo *ci);
|
||||||
|
bool IsFounder(ChannelInfo *ci);
|
||||||
|
|
||||||
void Reply(const char *message, ...);
|
void Reply(const char *message, ...);
|
||||||
void Reply(const Anope::string &message);
|
void Reply(const Anope::string &message);
|
||||||
|
|
||||||
bool HasCommand(const Anope::string &cmd);
|
bool HasCommand(const Anope::string &cmd);
|
||||||
bool HasPriv(const Anope::string &cmd);
|
bool HasPriv(const Anope::string &cmd);
|
||||||
bool IsServicesOper() const;
|
bool IsServicesOper();
|
||||||
bool IsOper() const;
|
bool IsOper();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Every services command is a class, inheriting from Command.
|
/** Every services command is a class, inheriting from Command.
|
||||||
*/
|
*/
|
||||||
class CoreExport Command : public Service, public Flags<CommandFlag>
|
class CoreExport Command : public Service
|
||||||
{
|
{
|
||||||
Anope::string desc;
|
Anope::string desc;
|
||||||
std::vector<Anope::string> syntax;
|
std::vector<Anope::string> syntax;
|
||||||
|
/* Allow unregistered users to use this command */
|
||||||
|
bool allow_unregistered;
|
||||||
|
/* Command requires that a user is executing it */
|
||||||
|
bool require_user;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* Maximum paramaters accepted by this command */
|
/* Maximum paramaters accepted by this command */
|
||||||
size_t MaxParams;
|
size_t max_params;
|
||||||
/* Minimum parameters required to use this command */
|
/* Minimum parameters required to use this command */
|
||||||
size_t MinParams;
|
size_t min_params;
|
||||||
|
|
||||||
/* Module which owns us */
|
/* Module which owns us */
|
||||||
Module *module;
|
Module *module;
|
||||||
|
|
||||||
|
protected:
|
||||||
/** Create a new command.
|
/** Create a new command.
|
||||||
* @param owner The owner of the command
|
* @param owner The owner of the command
|
||||||
* @param sname The command name
|
* @param sname The command name
|
||||||
@@ -102,6 +117,7 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
|
|||||||
*/
|
*/
|
||||||
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
|
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
|
||||||
|
|
||||||
|
public:
|
||||||
virtual ~Command();
|
virtual ~Command();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -110,12 +126,19 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
|
|||||||
void ClearSyntax();
|
void ClearSyntax();
|
||||||
void SetSyntax(const Anope::string &s);
|
void SetSyntax(const Anope::string &s);
|
||||||
void SendSyntax(CommandSource &);
|
void SendSyntax(CommandSource &);
|
||||||
void SendSyntax(CommandSource &, const Anope::string &syntax);
|
|
||||||
|
void AllowUnregistered(bool b);
|
||||||
|
void RequireUser(bool b);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool AllowUnregistered() const;
|
||||||
|
bool RequireUser() const;
|
||||||
|
|
||||||
/** Get the command description
|
/** Get the command description
|
||||||
|
* @param source The source wanting the command description
|
||||||
* @return The commands description
|
* @return The commands description
|
||||||
*/
|
*/
|
||||||
const Anope::string &GetDesc() const;
|
virtual const Anope::string GetDesc(CommandSource &source) const;
|
||||||
|
|
||||||
/** Execute this command.
|
/** Execute this command.
|
||||||
* @param source The source
|
* @param source The source
|
||||||
@@ -140,8 +163,23 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
|
|||||||
* @param subcommand The subcommand the user tried to use
|
* @param subcommand The subcommand the user tried to use
|
||||||
*/
|
*/
|
||||||
virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand);
|
virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand);
|
||||||
|
|
||||||
|
/** Runs a command
|
||||||
|
* @param source The source of the command
|
||||||
|
* @param message The full message to run, the command is at the beginning of the message
|
||||||
|
*/
|
||||||
|
static void Run(CommandSource &source, const Anope::string &message);
|
||||||
|
|
||||||
|
void Run(CommandSource &source, const Anope::string &, const CommandInfo &, std::vector<Anope::string> ¶ms);
|
||||||
|
|
||||||
|
/** Looks up a command name from the service name.
|
||||||
|
* Note that if the same command exists multiple places this will return the first one encountered
|
||||||
|
* @param command_service The command service to lookup, eg, nickserv/register
|
||||||
|
* @param bot If found, is set to the bot the command is on, eg NickServ
|
||||||
|
* @param name If found, is set to the comand name, eg REGISTER
|
||||||
|
* @return true if the given command service exists
|
||||||
|
*/
|
||||||
|
static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CoreExport void RunCommand(CommandSource &source, const Anope::string &message);
|
|
||||||
|
|
||||||
#endif // COMMANDS_H
|
#endif // COMMANDS_H
|
||||||
|
|||||||
+118
-744
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
@@ -17,336 +16,132 @@
|
|||||||
#include "account.h"
|
#include "account.h"
|
||||||
#include "regchannel.h"
|
#include "regchannel.h"
|
||||||
#include "users.h"
|
#include "users.h"
|
||||||
|
#include "opertype.h"
|
||||||
|
#include <stack>
|
||||||
|
|
||||||
/** A configuration key and value pair
|
namespace Configuration
|
||||||
*/
|
|
||||||
typedef std::pair<Anope::string, Anope::string> KeyVal;
|
|
||||||
|
|
||||||
/** A list of related configuration keys and values
|
|
||||||
*/
|
|
||||||
typedef std::vector<KeyVal> KeyValList;
|
|
||||||
|
|
||||||
/** An entire config file, built up of KeyValLists
|
|
||||||
*/
|
|
||||||
typedef std::multimap<Anope::string, KeyValList> ConfigDataHash;
|
|
||||||
|
|
||||||
// Required forward definitions
|
|
||||||
|
|
||||||
/** Types of data in the core config
|
|
||||||
*/
|
|
||||||
enum ConfigDataType
|
|
||||||
{
|
{
|
||||||
DT_NOTHING, // No data
|
class CoreExport Block
|
||||||
DT_INTEGER, // Integer
|
|
||||||
DT_UINTEGER, // Unsigned Integer
|
|
||||||
DT_LUINTEGER, // Long Unsigned Integer
|
|
||||||
DT_STRING, // Anope::string
|
|
||||||
DT_BOOLEAN, // Boolean
|
|
||||||
DT_HOSTNAME, // Hostname syntax
|
|
||||||
DT_NOSPACES, // No spaces
|
|
||||||
DT_IPADDRESS, // IP address (v4, v6)
|
|
||||||
DT_TIME, // Time value
|
|
||||||
DT_NORELOAD = 32, // Item can't be reloaded after startup
|
|
||||||
DT_ALLOW_WILD = 64, // Allow wildcards/CIDR in DT_IPADDRESS
|
|
||||||
DT_ALLOW_NEWLINE = 128, // New line characters allowed in DT_STRING
|
|
||||||
DT_ALLOW_EMPTY = 256 // Allow empty value
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Holds a config value, either string, integer or boolean.
|
|
||||||
* Callback functions receive one or more of these, either on
|
|
||||||
* their own as a reference, or in a reference to a deque of them.
|
|
||||||
* The callback function can then alter the values of the ValueItem
|
|
||||||
* classes to validate the settings.
|
|
||||||
*/
|
|
||||||
class CoreExport ValueItem
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/** Actual data */
|
|
||||||
Anope::string v;
|
|
||||||
public:
|
|
||||||
/** Initialize with nothing */
|
|
||||||
ValueItem();
|
|
||||||
/** Initialize with an int */
|
|
||||||
ValueItem(int);
|
|
||||||
/** Initialize with a bool */
|
|
||||||
ValueItem(bool);
|
|
||||||
/** Initialize with an Anope::string */
|
|
||||||
ValueItem(const Anope::string &);
|
|
||||||
/** Initialize with a long */
|
|
||||||
ValueItem(long);
|
|
||||||
/** Change value to an Anope::string */
|
|
||||||
void Set(const Anope::string &);
|
|
||||||
/** Change value to an int */
|
|
||||||
void Set(int);
|
|
||||||
/** Get value as an int */
|
|
||||||
int GetInteger() const;
|
|
||||||
/** Get value as a string */
|
|
||||||
const char *GetString() const;
|
|
||||||
/** Get value as an Anope::string */
|
|
||||||
inline const Anope::string &GetValue() const { return v; }
|
|
||||||
/** Get value as a bool */
|
|
||||||
bool GetBool() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** The base class of the container 'ValueContainer'
|
|
||||||
* used internally by the core to hold core values.
|
|
||||||
*/
|
|
||||||
class ValueContainerBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/** Constructor */
|
|
||||||
ValueContainerBase() { }
|
|
||||||
/** Destructor */
|
|
||||||
virtual ~ValueContainerBase() { }
|
|
||||||
};
|
|
||||||
|
|
||||||
/** ValueContainer is used to contain pointers to different
|
|
||||||
* core values such as the server name, maximum number of
|
|
||||||
* clients etc.
|
|
||||||
* It is specialized to hold a data type, then pointed at
|
|
||||||
* a value in the ServerConfig class. When the value has been
|
|
||||||
* read and validated, the Set method is called to write the
|
|
||||||
* value safely in a type-safe manner.
|
|
||||||
*/
|
|
||||||
template<typename T> class ValueContainer : public ValueContainerBase
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/** Contained item */
|
|
||||||
T val;
|
|
||||||
public:
|
|
||||||
/** Initialize with nothing */
|
|
||||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
|
||||||
/** Initialize with a value of type T */
|
|
||||||
ValueContainer(T Val) : ValueContainerBase(), val(Val) { }
|
|
||||||
/** Initialize with a copy */
|
|
||||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
|
||||||
ValueContainer &operator=(const ValueContainer &Val)
|
|
||||||
{
|
{
|
||||||
val = Val.val;
|
friend struct Conf;
|
||||||
return *this;
|
|
||||||
}
|
public:
|
||||||
/** Change value to type T of size s */
|
typedef Anope::map<Anope::string> item_map;
|
||||||
void Set(const T newval, size_t s)
|
typedef Anope::multimap<Block> block_map;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Anope::string name;
|
||||||
|
item_map items;
|
||||||
|
block_map blocks;
|
||||||
|
int linenum;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Block(const Anope::string &);
|
||||||
|
const Anope::string &GetName() const;
|
||||||
|
int CountBlock(const Anope::string &name);
|
||||||
|
Block* GetBlock(const Anope::string &name, int num = 0);
|
||||||
|
|
||||||
|
template<typename T> inline T Get(const Anope::string &tag)
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Set(const Anope::string &tag, const Anope::string &value);
|
||||||
|
const item_map* GetItems() 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;
|
||||||
|
|
||||||
|
/** Represents a configuration file
|
||||||
|
*/
|
||||||
|
class File
|
||||||
{
|
{
|
||||||
memcpy(val, newval, s);
|
Anope::string name;
|
||||||
}
|
bool executable;
|
||||||
};
|
FILE *fp;
|
||||||
|
public:
|
||||||
|
File(const Anope::string &, bool);
|
||||||
|
~File();
|
||||||
|
const Anope::string &GetName() const;
|
||||||
|
|
||||||
/** This a specific version of ValueContainer to handle Anope::string specially
|
bool IsOpen() const;
|
||||||
*/
|
bool Open();
|
||||||
template<> class ValueContainer<Anope::string *> : public ValueContainerBase
|
void Close();
|
||||||
{
|
bool End() const;
|
||||||
private:
|
Anope::string Read();
|
||||||
/** Contained item */
|
};
|
||||||
Anope::string *val;
|
|
||||||
public:
|
struct Uplink;
|
||||||
/** Initialize with nothing */
|
|
||||||
ValueContainer() : ValueContainerBase(), val(NULL) { }
|
struct CoreExport Conf : Block
|
||||||
/** Initialize with an std::string */
|
|
||||||
ValueContainer(Anope::string *Val) : ValueContainerBase(), val(Val) { }
|
|
||||||
/** Initialize with a copy */
|
|
||||||
ValueContainer(const ValueContainer &Val) : ValueContainerBase(), val(Val.val) { }
|
|
||||||
ValueContainer &operator=(const ValueContainer &Val)
|
|
||||||
{
|
{
|
||||||
val = Val.val;
|
/* options:readtimeout */
|
||||||
return *this;
|
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;
|
||||||
|
/* networkinfo:nickchars */
|
||||||
|
Anope::string NickChars;
|
||||||
|
|
||||||
/** Change value to given Anope::string */
|
/* either "/msg " or "/" */
|
||||||
void Set(const Anope::string &newval)
|
Anope::string StrictPrivmsg;
|
||||||
{
|
/* List of uplink servers to try and connect to */
|
||||||
*val = newval;
|
std::vector<Uplink> Uplinks;
|
||||||
}
|
/* A vector of our logfile options */
|
||||||
/** Change value to given char pointer */
|
std::vector<LogInfo> LogInfos;
|
||||||
void Set(const char *newval)
|
/* Array of ulined servers */
|
||||||
{
|
std::vector<Anope::string> Ulines;
|
||||||
*val = newval;
|
/* List of available opertypes */
|
||||||
}
|
std::vector<OperType *> MyOperTypes;
|
||||||
};
|
/* List of pairs of opers and their opertype from the config */
|
||||||
|
std::vector<Oper *> Opers;
|
||||||
|
/* Map of fantasy commands */
|
||||||
|
CommandInfo::map Fantasy;
|
||||||
|
/* Command groups */
|
||||||
|
std::vector<CommandGroup> CommandGroups;
|
||||||
|
/* List of modules to autoload */
|
||||||
|
std::vector<Anope::string> ModulesAutoLoad;
|
||||||
|
|
||||||
/** A specialization of ValueContainer to hold a pointer to a bool
|
/* module configuration blocks */
|
||||||
*/
|
std::map<Anope::string, Block *> modules;
|
||||||
typedef ValueContainer<bool *> ValueContainerBool;
|
Anope::map<Anope::string> bots;
|
||||||
|
|
||||||
/** A specialization of ValueContainer to hold a pointer to
|
Conf();
|
||||||
* an unsigned int
|
~Conf();
|
||||||
*/
|
|
||||||
typedef ValueContainer<unsigned *> ValueContainerUInt;
|
|
||||||
|
|
||||||
/** A specialization of ValueContainer to hold a pointer to
|
void LoadConf(File &file);
|
||||||
* a long unsigned int
|
void Post(Conf *old);
|
||||||
*/
|
|
||||||
typedef ValueContainer<long unsigned *> ValueContainerLUInt;
|
|
||||||
|
|
||||||
/** A specialization of ValueContainer to hold a pointer to
|
Block *GetModule(Module *);
|
||||||
* an int
|
Block *GetModule(const Anope::string &name);
|
||||||
*/
|
|
||||||
typedef ValueContainer<int *> ValueContainerInt;
|
|
||||||
|
|
||||||
/** A specialization of ValueContainer to hold a pointer to
|
BotInfo *GetClient(const Anope::string &name);
|
||||||
* a time_t
|
|
||||||
*/
|
|
||||||
typedef ValueContainer<time_t *> ValueContainerTime;
|
|
||||||
|
|
||||||
/** A specialization of ValueContainer to hold a pointer to
|
Block *GetCommand(CommandSource &);
|
||||||
* an Anope::string
|
};
|
||||||
*/
|
|
||||||
typedef ValueContainer<Anope::string *> ValueContainerString;
|
|
||||||
|
|
||||||
/** A set of ValueItems used by multi-value validator functions
|
|
||||||
*/
|
|
||||||
typedef std::deque<ValueItem> ValueList;
|
|
||||||
|
|
||||||
/** A callback for validating a single value
|
|
||||||
*/
|
|
||||||
typedef bool (*Validator)(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &);
|
|
||||||
/** A callback for validating multiple value entries
|
|
||||||
*/
|
|
||||||
typedef bool (*MultiValidator)(ServerConfig *, const Anope::string &, const Anope::string *, ValueList &, int *);
|
|
||||||
/** A callback indicating the end of a group of entries
|
|
||||||
*/
|
|
||||||
typedef bool (*MultiNotify)(ServerConfig *, const Anope::string &);
|
|
||||||
|
|
||||||
bool ValidateNotEmpty(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateNotZero(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateEmailReg(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidatePort(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateGuestPrefix(ServerConfig *conf, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateBantype(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data);
|
|
||||||
bool ValidateChanServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateMemoServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateBotServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateHostServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateLimitSessions(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateOperServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateGlobal(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateNickLen(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data);
|
|
||||||
bool ValidateMail(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
bool ValidateGlobalOnCycle(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
|
||||||
|
|
||||||
/** Represents a configuration file
|
|
||||||
*/
|
|
||||||
class ConfigurationFile
|
|
||||||
{
|
|
||||||
Anope::string name;
|
|
||||||
bool executable;
|
|
||||||
FILE *fp;
|
|
||||||
public:
|
|
||||||
ConfigurationFile(const Anope::string &, bool);
|
|
||||||
~ConfigurationFile();
|
|
||||||
const Anope::string &GetName() const;
|
|
||||||
|
|
||||||
bool IsOpen() const;
|
|
||||||
bool Open();
|
|
||||||
void Close();
|
|
||||||
bool End() const;
|
|
||||||
Anope::string Read();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Holds all of the core configuration items
|
|
||||||
*/
|
|
||||||
class CoreExport ConfigItems
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/** Holds a core configuration item and its callbacks
|
|
||||||
*/
|
|
||||||
struct Item
|
|
||||||
{
|
|
||||||
/** Tag name */
|
|
||||||
Anope::string tag;
|
|
||||||
/** Value name */
|
|
||||||
Anope::string value;
|
|
||||||
/** Default, if not defined */
|
|
||||||
Anope::string default_value;
|
|
||||||
/** Value containers */
|
|
||||||
ValueContainerBase *val;
|
|
||||||
/** Data types */
|
|
||||||
int datatype;
|
|
||||||
/** Validation function */
|
|
||||||
Validator validation_function;
|
|
||||||
} *Values;
|
|
||||||
|
|
||||||
/** Holds a core configuration item and its callbacks
|
|
||||||
* where there may be more than one item
|
|
||||||
*/
|
|
||||||
struct MultiItem
|
|
||||||
{
|
|
||||||
/** Tag name */
|
|
||||||
Anope::string tag;
|
|
||||||
/** One or more items within tag */
|
|
||||||
Anope::string items[17];
|
|
||||||
/** One or more defaults for items within tags */
|
|
||||||
Anope::string items_default[17];
|
|
||||||
/** One or more data types */
|
|
||||||
int datatype[17];
|
|
||||||
/** Initialization function */
|
|
||||||
MultiNotify init_function;
|
|
||||||
/** Validation function */
|
|
||||||
MultiValidator validation_function;
|
|
||||||
/** Completion function */
|
|
||||||
MultiNotify finish_function;
|
|
||||||
} *MultiValues;
|
|
||||||
|
|
||||||
ConfigItems(ServerConfig *conf);
|
|
||||||
~ConfigItems();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** This class holds the bulk of the runtime configuration for Anope.
|
|
||||||
* It allows for reading new config values, accessing configuration files,
|
|
||||||
* and storage of the configuration data needed to run Anope.
|
|
||||||
*/
|
|
||||||
class CoreExport ServerConfig
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/** Check that there is only one of each configuration item
|
|
||||||
*/
|
|
||||||
bool CheckOnce(const Anope::string &);
|
|
||||||
public:
|
|
||||||
/** This holds all the information in the config file,
|
|
||||||
* it's indexed by tag name to a vector of key/values.
|
|
||||||
*/
|
|
||||||
ConfigDataHash config_data;
|
|
||||||
/** Construct a new ServerConfig
|
|
||||||
*/
|
|
||||||
ServerConfig();
|
|
||||||
|
|
||||||
/** Read the entire configuration into memory
|
|
||||||
* and initialize this class. All other methods
|
|
||||||
* should be used only by the core.
|
|
||||||
*/
|
|
||||||
void Read();
|
|
||||||
/** Load the configuration file into 'this'. With the new config parser everything is parsed into
|
|
||||||
* tag/key/value at load-time rather than at read-value time.
|
|
||||||
*/
|
|
||||||
void LoadConf(ConfigurationFile &file);
|
|
||||||
// Both these return true if the value existed or false otherwise
|
|
||||||
/** Writes 'length' chars into 'result' as a string
|
|
||||||
*/
|
|
||||||
bool ConfValue(ConfigDataHash &, const Anope::string &, const Anope::string &, int, Anope::string &, bool = false);
|
|
||||||
/** Writes 'length' chars into 'result' as a string
|
|
||||||
*/
|
|
||||||
bool ConfValue(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, Anope::string &, bool = false);
|
|
||||||
/** Tries to convert the value to an integer and write it to 'result'
|
|
||||||
*/
|
|
||||||
bool ConfValueInteger(ConfigDataHash &, const Anope::string &, const Anope::string &, int, int &);
|
|
||||||
/** Tries to convert the value to an integer and write it to 'result'
|
|
||||||
*/
|
|
||||||
bool ConfValueInteger(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, int &);
|
|
||||||
/** Returns true if the value exists and has a true value, false otherwise
|
|
||||||
*/
|
|
||||||
bool ConfValueBool(ConfigDataHash &, const Anope::string &, const Anope::string &, int);
|
|
||||||
/** Returns true if the value exists and has a true value, false otherwise
|
|
||||||
*/
|
|
||||||
bool ConfValueBool(ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int);
|
|
||||||
/** Returns the number of occurences of tag in the config file
|
|
||||||
*/
|
|
||||||
int ConfValueEnum(const ConfigDataHash &, const Anope::string &);
|
|
||||||
/** Returns the numbers of vars inside the index'th 'tag in the config file
|
|
||||||
*/
|
|
||||||
int ConfVarEnum(ConfigDataHash &, const Anope::string &, int);
|
|
||||||
void ValidateHostname(const Anope::string &, const Anope::string &, const Anope::string &) const;
|
|
||||||
void ValidateIP(const Anope::string &p, const Anope::string &, const Anope::string &, bool) const;
|
|
||||||
void ValidateNoSpaces(const Anope::string &, const Anope::string &, const Anope::string &) const;
|
|
||||||
|
|
||||||
struct Uplink
|
struct Uplink
|
||||||
{
|
{
|
||||||
@@ -356,329 +151,10 @@ class CoreExport ServerConfig
|
|||||||
bool ipv6;
|
bool ipv6;
|
||||||
|
|
||||||
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, bool _ipv6) : host(_host), port(_port), password(_password), ipv6(_ipv6) { }
|
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, bool _ipv6) : host(_host), port(_port), password(_password), ipv6(_ipv6) { }
|
||||||
bool operator==(const Uplink &other) const
|
inline bool operator==(const Uplink &other) const { return host == other.host && port == other.port && password == other.password && ipv6 == other.ipv6; }
|
||||||
{
|
|
||||||
if (this->host != other.host)
|
|
||||||
return false;
|
|
||||||
if (this->port != other.port)
|
|
||||||
return false;
|
|
||||||
if (this->password != other.password)
|
|
||||||
return false;
|
|
||||||
if (this->ipv6 != other.ipv6)
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
inline bool operator!=(const Uplink &other) const { return !(*this == other); }
|
inline bool operator!=(const Uplink &other) const { return !(*this == other); }
|
||||||
};
|
};
|
||||||
|
}
|
||||||
/** Below here is a list of variables which contain the config files values
|
|
||||||
*/
|
|
||||||
/* Host to bind to */
|
|
||||||
Anope::string LocalHost;
|
|
||||||
/* List of uplink servers to try and connect to */
|
|
||||||
std::vector<Uplink *> Uplinks;
|
|
||||||
|
|
||||||
/* Our server name */
|
|
||||||
Anope::string ServerName;
|
|
||||||
/* Our servers description */
|
|
||||||
Anope::string ServerDesc;
|
|
||||||
|
|
||||||
/* Name of the network were on */
|
|
||||||
Anope::string NetworkName;
|
|
||||||
/* The max legnth of nicks */
|
|
||||||
unsigned NickLen;
|
|
||||||
/* Max length of idents */
|
|
||||||
unsigned UserLen;
|
|
||||||
/* Max lenght of hostnames */
|
|
||||||
unsigned HostLen;
|
|
||||||
|
|
||||||
/* Casemapping to use */
|
|
||||||
Anope::string CaseMap;
|
|
||||||
|
|
||||||
/* Max length of passwords */
|
|
||||||
unsigned PassLen;
|
|
||||||
|
|
||||||
/* Filename for the PID file */
|
|
||||||
Anope::string PIDFilename;
|
|
||||||
/* MOTD filename */
|
|
||||||
Anope::string MOTDFilename;
|
|
||||||
|
|
||||||
Anope::string BotServ;
|
|
||||||
Anope::string ChanServ;
|
|
||||||
Anope::string Global;
|
|
||||||
Anope::string HostServ;
|
|
||||||
Anope::string NickServ;
|
|
||||||
Anope::string OperServ;
|
|
||||||
Anope::string MemoServ;
|
|
||||||
|
|
||||||
/* True if its ok to not be able to save backs */
|
|
||||||
bool NoBackupOkay;
|
|
||||||
/* Do password checking when new people register */
|
|
||||||
bool StrictPasswords;
|
|
||||||
/* How many times you're allowed to give a bad password before being killed */
|
|
||||||
unsigned BadPassLimit;
|
|
||||||
/* How long before bad passwords are forgotten */
|
|
||||||
time_t BadPassTimeout;
|
|
||||||
/* Delay between automatic database updates */
|
|
||||||
time_t UpdateTimeout;
|
|
||||||
/* Delay between checks for expired nicks and channels */
|
|
||||||
time_t ExpireTimeout;
|
|
||||||
/* How long to wait for something from the uplink, this is passed to select() */
|
|
||||||
time_t ReadTimeout;
|
|
||||||
/* How often to send program errors */
|
|
||||||
time_t WarningTimeout;
|
|
||||||
/* How long to process things such as timers to see if there is anything to calll */
|
|
||||||
time_t TimeoutCheck;
|
|
||||||
/* Number of days backups are kept */
|
|
||||||
int KeepBackups;
|
|
||||||
/* Forbidding requires a reason */
|
|
||||||
bool ForceForbidReason;
|
|
||||||
/* Services should use privmsgs instead of notices */
|
|
||||||
bool UsePrivmsg;
|
|
||||||
/* Services only respond to full PRIVMSG client@services.server.name messages */
|
|
||||||
bool UseStrictPrivMsg;
|
|
||||||
/* This is not a configurable option.
|
|
||||||
* Config::Config will set it depending on the value of UseStrictPrivMsg */
|
|
||||||
Anope::string UseStrictPrivMsgString;
|
|
||||||
/* Number of seconds between consecutive uses of the REGISTER command
|
|
||||||
* Not to be confused with NSRegDelay */
|
|
||||||
unsigned NickRegDelay;
|
|
||||||
/* Max number if news items allowed in the list */
|
|
||||||
unsigned NewsCount;
|
|
||||||
/* Default mlock modes */
|
|
||||||
Anope::string MLock;
|
|
||||||
/* Unmlockable modes */
|
|
||||||
Anope::string NoMLock;
|
|
||||||
/* Modes that are required to be on registered channels */
|
|
||||||
Anope::string CSRequire;
|
|
||||||
/* Use server side mlock */
|
|
||||||
bool UseServerSideMLock;
|
|
||||||
/* Default botmodes on channels, defaults to ao */
|
|
||||||
Anope::string BotModes;
|
|
||||||
/* THe actual modes */
|
|
||||||
ChannelStatus BotModeList;
|
|
||||||
/* How long to wait between connection attempts */
|
|
||||||
int RetryWait;
|
|
||||||
/* If services should hide unprivileged commands */
|
|
||||||
bool HidePrivilegedCommands;
|
|
||||||
/* If set, nicks cant be owned/everything is entirely account based */
|
|
||||||
bool NoNicknameOwnership;
|
|
||||||
/* Regex engine to use */
|
|
||||||
Anope::string RegexEngine;
|
|
||||||
|
|
||||||
/* A vector of our logfile options */
|
|
||||||
std::vector<LogInfo *> LogInfos;
|
|
||||||
|
|
||||||
/* Services can use email */
|
|
||||||
bool UseMail;
|
|
||||||
/* Path to the sendmail executable */
|
|
||||||
Anope::string SendMailPath;
|
|
||||||
/* Address to send from */
|
|
||||||
Anope::string SendFrom;
|
|
||||||
/* Only opers can have services send mail */
|
|
||||||
bool RestrictMail;
|
|
||||||
/* Delay between sending mail */
|
|
||||||
time_t MailDelay;
|
|
||||||
/* Don't quote the To: address */
|
|
||||||
bool DontQuoteAddresses;
|
|
||||||
/* Mail messages to send */
|
|
||||||
Anope::string MailRegistrationSubject, MailRegistrationMessage;
|
|
||||||
Anope::string MailResetSubject, MailResetMessage;
|
|
||||||
Anope::string MailSendpassSubject, MailSendpassMessage;
|
|
||||||
Anope::string MailEmailchangeSubject, MailEmailchangeMessage;
|
|
||||||
Anope::string MailMemoSubject, MailMemoMessage;
|
|
||||||
|
|
||||||
/* Nameserver to use for resolving hostnames */
|
|
||||||
Anope::string NameServer;
|
|
||||||
/* TIme before a DNS query is considered dead */
|
|
||||||
time_t DNSTimeout;
|
|
||||||
|
|
||||||
/* Prefix of guest nicks when a user gets forced off of a nick */
|
|
||||||
Anope::string NSGuestNickPrefix;
|
|
||||||
/* Allow users to set kill immed on */
|
|
||||||
bool NSAllowKillImmed;
|
|
||||||
/* Don't allow nicks to use /ns group to regroup nicks */
|
|
||||||
bool NSNoGroupChange;
|
|
||||||
/* Default flags for newly registered nicks */
|
|
||||||
Flags<NickCoreFlag, NI_END> NSDefFlags;
|
|
||||||
/* All languages Anope is aware about */
|
|
||||||
Anope::string Languages;
|
|
||||||
/* Default language used by services */
|
|
||||||
Anope::string NSDefLanguage;
|
|
||||||
/* Users must be connected this long before they can register
|
|
||||||
* Not to be confused with NickRegDelay */
|
|
||||||
time_t NSRegDelay;
|
|
||||||
/* Time before the registering mail will be resent */
|
|
||||||
time_t NSResendDelay;
|
|
||||||
/* How long before nicks expire */
|
|
||||||
time_t NSExpire;
|
|
||||||
/* How long before suspended nicks expire */
|
|
||||||
time_t NSSuspendExpire;
|
|
||||||
/* Time before unconfirmed nicks expire */
|
|
||||||
time_t NSUnconfirmedExpire;
|
|
||||||
/* Force email when registering */
|
|
||||||
bool NSForceEmail;
|
|
||||||
/* Force users to validate new email addresses */
|
|
||||||
bool NSConfirmEmailChanges;
|
|
||||||
/* Max number of nicks in a group */
|
|
||||||
unsigned NSMaxAliases;
|
|
||||||
/* Max number of allowed strings on the access list */
|
|
||||||
unsigned NSAccessMax;
|
|
||||||
/* Enforcer client user name */
|
|
||||||
Anope::string NSEnforcerUser;
|
|
||||||
/* Enforcer client hostname */
|
|
||||||
Anope::string NSEnforcerHost;
|
|
||||||
/* How long before recovered nicks are released */
|
|
||||||
time_t NSReleaseTimeout;
|
|
||||||
/* Max number of entries that can be returned from the list command */
|
|
||||||
unsigned NSListMax;
|
|
||||||
/* Only allow usermode +a etc on real services admins */
|
|
||||||
bool NSSecureAdmins;
|
|
||||||
/* Services opers must be /operd on the ircd aswell */
|
|
||||||
bool NSStrictPrivileges;
|
|
||||||
/* Type of confirmation to use, or to disable registration completely */
|
|
||||||
Anope::string NSRegistration;
|
|
||||||
/* A message sent to unregistered users on connect */
|
|
||||||
Anope::string NSUnregisteredNotice;
|
|
||||||
/* Core NickServ modules */
|
|
||||||
Anope::string NickCoreModules;
|
|
||||||
/* Set the proper channel modes on users when they identify */
|
|
||||||
bool NSModeOnID;
|
|
||||||
/* Add the users hostnask their access list when they register */
|
|
||||||
bool NSAddAccessOnReg;
|
|
||||||
/* Maximum number of channels on AJoin */
|
|
||||||
unsigned AJoinMax;
|
|
||||||
|
|
||||||
/* Core ChanServ modules */
|
|
||||||
Anope::string ChanCoreModules;
|
|
||||||
/* Default flags for newly registered channels */
|
|
||||||
Flags<ChannelInfoFlag, CI_END> CSDefFlags;
|
|
||||||
/* Max number of channels a user can own */
|
|
||||||
unsigned CSMaxReg;
|
|
||||||
/* Time before a channel expires */
|
|
||||||
time_t CSExpire;
|
|
||||||
/* How long before suspended channels expire */
|
|
||||||
time_t CSSuspendExpire;
|
|
||||||
/* How long before forbidden channels expire */
|
|
||||||
time_t CSForbidExpire;
|
|
||||||
/* Default ban type to use for channels */
|
|
||||||
int CSDefBantype;
|
|
||||||
/* Max number of entries allowed on channel access lists */
|
|
||||||
unsigned CSAccessMax;
|
|
||||||
/* Max number of entries allowed on autokick lists */
|
|
||||||
unsigned CSAutokickMax;
|
|
||||||
/* Default autokick reason */
|
|
||||||
Anope::string CSAutokickReason;
|
|
||||||
/* Time ChanServ should stay in the channel to hold it to keep users from getting in */
|
|
||||||
time_t CSInhabit;
|
|
||||||
/* Max number of entries allowed to be returned from the LIST command */
|
|
||||||
unsigned CSListMax;
|
|
||||||
/* true to make ChanServ oper only */
|
|
||||||
bool CSOpersOnly;
|
|
||||||
|
|
||||||
/* Max number of memos allowed */
|
|
||||||
unsigned MSMaxMemos;
|
|
||||||
/* Time you must wait between sending memos */
|
|
||||||
time_t MSSendDelay;
|
|
||||||
/* Notify all of the aliases of the core the memo was sent to */
|
|
||||||
bool MSNotifyAll;
|
|
||||||
/* Who can use memos reciepts */
|
|
||||||
unsigned MSMemoReceipt;
|
|
||||||
|
|
||||||
/* Valid chars allowed in vhosts */
|
|
||||||
Anope::string VhostChars;
|
|
||||||
/* Allow undotted vhosts? */
|
|
||||||
bool VhostUndotted;
|
|
||||||
/* Chars disallowed at the beginning or end of vhosts */
|
|
||||||
Anope::string VhostDisallowBE;
|
|
||||||
|
|
||||||
/* Core BotServ modules */
|
|
||||||
Anope::string BotCoreModules;
|
|
||||||
/* Default BotServ flags */
|
|
||||||
Flags<BotServFlag> BSDefFlags;
|
|
||||||
/* How long before botserv forgets a user. This is used for flood kickers etc */
|
|
||||||
time_t BSKeepData;
|
|
||||||
/* Min number of users to have in the channel before the service bot joins */
|
|
||||||
unsigned BSMinUsers;
|
|
||||||
/* Max number of words allowed on the badwordslist */
|
|
||||||
unsigned BSBadWordsMax;
|
|
||||||
/* BotServ bot only joins if it would normally allowed to, abides by bans etc */
|
|
||||||
bool BSSmartJoin;
|
|
||||||
/* Dont tell users what badword they used */
|
|
||||||
bool BSGentleBWReason;
|
|
||||||
/* Case sensitive badwords matching */
|
|
||||||
bool BSCaseSensitive;
|
|
||||||
/* Char to use for the fantasy char, eg ! */
|
|
||||||
Anope::string BSFantasyCharacter;
|
|
||||||
|
|
||||||
/* Only show /stats o to opers */
|
|
||||||
bool HideStatsO;
|
|
||||||
/* Send out a global when services shut down or restart */
|
|
||||||
bool GlobalOnCycle;
|
|
||||||
/* Don't include the opers name in globals */
|
|
||||||
bool AnonymousGlobal;
|
|
||||||
/* Dont allow users to register nicks with oper names in them */
|
|
||||||
bool RestrictOperNicks;
|
|
||||||
/* Message to send when shutting down */
|
|
||||||
Anope::string GlobalOnCycleMessage;
|
|
||||||
/* Message to send when starting up */
|
|
||||||
Anope::string GlobalOnCycleUP;
|
|
||||||
/* Super admin is allowed */
|
|
||||||
bool SuperAdmin;
|
|
||||||
/* Default expiry time for akills */
|
|
||||||
time_t AutokillExpiry;
|
|
||||||
/* Default expiry time for chan kills */
|
|
||||||
time_t ChankillExpiry;
|
|
||||||
/* Default expiry time for SNLine Expire */
|
|
||||||
time_t SNLineExpiry;
|
|
||||||
/* Default expiry time for SQLines */
|
|
||||||
time_t SQLineExpiry;
|
|
||||||
/* Actually akill the user when the akill is added */
|
|
||||||
bool AkillOnAdd;
|
|
||||||
/* Kill users on SNLine */
|
|
||||||
bool KillonSNline;
|
|
||||||
/* Kill users on SQline */
|
|
||||||
bool KillonSQline;
|
|
||||||
/* Add the akillers nick to the akill reason */
|
|
||||||
bool AddAkiller;
|
|
||||||
/* Add akill ids to akill reason */
|
|
||||||
bool AkillIds;
|
|
||||||
|
|
||||||
/* Limit sessions */
|
|
||||||
bool LimitSessions;
|
|
||||||
/* The default session limit */
|
|
||||||
unsigned DefSessionLimit;
|
|
||||||
/* How long before exceptions expire */
|
|
||||||
time_t ExceptionExpiry;
|
|
||||||
/* How many times to kill before adding an KILL */
|
|
||||||
unsigned MaxSessionKill;
|
|
||||||
/* Max limit that can be used for exceptions */
|
|
||||||
unsigned MaxSessionLimit;
|
|
||||||
/* How long session akills should last */
|
|
||||||
time_t SessionAutoKillExpiry;
|
|
||||||
/* Reason to use for session kills */
|
|
||||||
Anope::string SessionLimitExceeded;
|
|
||||||
/* Optional second reason */
|
|
||||||
Anope::string SessionLimitDetailsLoc;
|
|
||||||
/* OperServ requires you to be an operator */
|
|
||||||
bool OSOpersOnly;
|
|
||||||
|
|
||||||
/* List of modules to autoload */
|
|
||||||
std::list<Anope::string> ModulesAutoLoad;
|
|
||||||
|
|
||||||
/* Seed to use for RNG */
|
|
||||||
unsigned long Seed;
|
|
||||||
|
|
||||||
/* Numeric */
|
|
||||||
Anope::string Numeric;
|
|
||||||
/* Array of ulined servers */
|
|
||||||
std::list<Anope::string> Ulines;
|
|
||||||
|
|
||||||
/* List of available opertypes */
|
|
||||||
std::list<OperType *> MyOperTypes;
|
|
||||||
/* List of pairs of opers and their opertype from the config */
|
|
||||||
std::vector<Oper *> Opers;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** This class can be used on its own to represent an exception, or derived to represent a module-specific exception.
|
/** This class can be used on its own to represent an exception, or derived to represent a module-specific exception.
|
||||||
* When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or
|
* When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or
|
||||||
@@ -702,109 +178,7 @@ class ConfigException : public CoreException
|
|||||||
virtual ~ConfigException() throw() { }
|
virtual ~ConfigException() throw() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CONF_NO_ERROR 0x000000
|
extern Configuration::File ServicesConf;
|
||||||
#define CONF_NOT_A_NUMBER 0x000010
|
extern CoreExport Configuration::Conf *Config;
|
||||||
#define CONF_INT_NEGATIVE 0x000080
|
|
||||||
#define CONF_VALUE_NOT_FOUND 0x000100
|
|
||||||
#define CONF_FILE_NOT_FOUND 0x000200
|
|
||||||
|
|
||||||
/** Allows reading of values from configuration files
|
|
||||||
* This class allows a module to read from either the main configuration file (inspircd.conf) or from
|
|
||||||
* a module-specified configuration file. It may either be instantiated with one parameter or none.
|
|
||||||
* Constructing the class using one parameter allows you to specify a path to your own configuration
|
|
||||||
* file, otherwise, inspircd.conf is read.
|
|
||||||
*/
|
|
||||||
class CoreExport ConfigReader
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
/** True if an error occured reading the config file
|
|
||||||
*/
|
|
||||||
bool readerror;
|
|
||||||
/** Error code
|
|
||||||
*/
|
|
||||||
long error;
|
|
||||||
public:
|
|
||||||
/** Default constructor.
|
|
||||||
* This constructor initialises the ConfigReader class to read the configuration file(s).
|
|
||||||
*/
|
|
||||||
ConfigReader();
|
|
||||||
/** Overloaded constructor.
|
|
||||||
* This constructor initialises the ConfigReader class to read a user-specified config file
|
|
||||||
*/
|
|
||||||
ConfigReader(const Anope::string &);
|
|
||||||
/** Default destructor.
|
|
||||||
* This method destroys the ConfigReader class.
|
|
||||||
*/
|
|
||||||
~ConfigReader();
|
|
||||||
/** Retrieves a value from the config file.
|
|
||||||
* This method retrieves a value from the config file. Where multiple copies of the tag
|
|
||||||
* exist in the config file, index indicates which of the values to retrieve.
|
|
||||||
*/
|
|
||||||
Anope::string ReadValue(const Anope::string &, const Anope::string &, int, bool = false);
|
|
||||||
/** Retrieves a value from the config file.
|
|
||||||
* This method retrieves a value from the config file. Where multiple copies of the tag
|
|
||||||
* exist in the config file, index indicates which of the values to retrieve. If the
|
|
||||||
* tag is not found the default value is returned instead.
|
|
||||||
*/
|
|
||||||
Anope::string ReadValue(const Anope::string &, const Anope::string &, const Anope::string &, int, bool = false);
|
|
||||||
/** Retrieves a boolean value from the config file.
|
|
||||||
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
|
|
||||||
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
|
|
||||||
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
|
|
||||||
*/
|
|
||||||
bool ReadFlag(const Anope::string &, const Anope::string &, int);
|
|
||||||
/** Retrieves a boolean value from the config file.
|
|
||||||
* This method retrieves a boolean value from the config file. Where multiple copies of the tag
|
|
||||||
* exist in the config file, index indicates which of the values to retrieve. The values "1", "yes"
|
|
||||||
* and "true" in the config file count as true to ReadFlag, and any other value counts as false.
|
|
||||||
* If the tag is not found, the default value is used instead.
|
|
||||||
*/
|
|
||||||
bool ReadFlag(const Anope::string &, const Anope::string &, const Anope::string &, int);
|
|
||||||
/** Retrieves an integer value from the config file.
|
|
||||||
* This method retrieves an integer value from the config file. Where multiple copies of the tag
|
|
||||||
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
|
|
||||||
* values in the tag will cause the objects error value to be set, and any call to GetError() will
|
|
||||||
* return CONF_INVALID_NUMBER to be returned. need_positive is set if the number must be non-negative.
|
|
||||||
* If a negative number is placed into a tag which is specified positive, 0 will be returned and GetError()
|
|
||||||
* will return CONF_INT_NEGATIVE. Note that need_positive is not suitable to get an unsigned int - you
|
|
||||||
* should cast the result to achieve that effect.
|
|
||||||
*/
|
|
||||||
int ReadInteger(const Anope::string &, const Anope::string &, int, bool);
|
|
||||||
/** Retrieves an integer value from the config file.
|
|
||||||
* This method retrieves an integer value from the config file. Where multiple copies of the tag
|
|
||||||
* exist in the config file, index indicates which of the values to retrieve. Any invalid integer
|
|
||||||
* values in the tag will cause the objects error value to be set, and any call to GetError() will
|
|
||||||
* return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned.
|
|
||||||
* If a signed number is placed into a tag which is specified unsigned, 0 will be returned and GetError()
|
|
||||||
* will return CONF_NOT_UNSIGNED. If the tag is not found, the default value is used instead.
|
|
||||||
*/
|
|
||||||
int ReadInteger(const Anope::string &, const Anope::string &, const Anope::string &, int, bool);
|
|
||||||
/** Returns the last error to occur.
|
|
||||||
* Valid errors can be found by looking in modules.h. Any nonzero value indicates an error condition.
|
|
||||||
* A call to GetError() resets the error flag back to 0.
|
|
||||||
*/
|
|
||||||
long GetError();
|
|
||||||
/** Counts the number of times a given tag appears in the config file.
|
|
||||||
* This method counts the number of times a tag appears in a config file, for use where
|
|
||||||
* there are several tags of the same kind, e.g. with opers and connect types. It can be
|
|
||||||
* used with the index value of ConfigReader::ReadValue to loop through all copies of a
|
|
||||||
* multiple instance tag.
|
|
||||||
*/
|
|
||||||
int Enumerate(const Anope::string &) const;
|
|
||||||
/** Returns true if a config file is valid.
|
|
||||||
* This method is partially implemented and will only return false if the config
|
|
||||||
* file does not exist or could not be opened.
|
|
||||||
*/
|
|
||||||
bool Verify();
|
|
||||||
/** Returns the number of items within a tag.
|
|
||||||
* For example if the tag was <test tag="blah" data="foo"> then this
|
|
||||||
* function would return 2. Spaces and newlines both qualify as valid seperators
|
|
||||||
* between values.
|
|
||||||
*/
|
|
||||||
int EnumerateValues(const Anope::string &, int);
|
|
||||||
};
|
|
||||||
|
|
||||||
extern ConfigurationFile services_conf;
|
|
||||||
extern CoreExport ServerConfig *Config;
|
|
||||||
|
|
||||||
#endif // CONFIG_H
|
#endif // CONFIG_H
|
||||||
|
|||||||
+9
-7
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -19,36 +19,38 @@ class ChanAccess;
|
|||||||
class Channel;
|
class Channel;
|
||||||
class ChannelInfo;
|
class ChannelInfo;
|
||||||
class ChannelStatus;
|
class ChannelStatus;
|
||||||
|
struct ChanUserContainer;
|
||||||
class ClientSocket;
|
class ClientSocket;
|
||||||
class Command;
|
class Command;
|
||||||
class CommandSource;
|
class CommandSource;
|
||||||
|
namespace Configuration { struct Conf; }
|
||||||
class ConnectionSocket;
|
class ConnectionSocket;
|
||||||
class DNSPacket;
|
namespace DNS { struct Query; }
|
||||||
class dynamic_reference_base;
|
|
||||||
class Entry;
|
class Entry;
|
||||||
|
class IdentifyRequest;
|
||||||
class InfoFormatter;
|
class InfoFormatter;
|
||||||
|
class IRCDProto;
|
||||||
class ListenSocket;
|
class ListenSocket;
|
||||||
class Log;
|
class Log;
|
||||||
class LogInfo;
|
|
||||||
class Memo;
|
class Memo;
|
||||||
class Message;
|
class MessageSource;
|
||||||
class Module;
|
class Module;
|
||||||
class NickAlias;
|
class NickAlias;
|
||||||
class NickCore;
|
class NickCore;
|
||||||
class OperType;
|
class OperType;
|
||||||
|
class ReferenceBase;
|
||||||
class Regex;
|
class Regex;
|
||||||
class Serializable;
|
class Serializable;
|
||||||
class Server;
|
class Server;
|
||||||
class ServerConfig;
|
|
||||||
class Socket;
|
class Socket;
|
||||||
class Thread;
|
class Thread;
|
||||||
class User;
|
class User;
|
||||||
class XLine;
|
class XLine;
|
||||||
class XLineManager;
|
class XLineManager;
|
||||||
struct BadWord;
|
struct BadWord;
|
||||||
struct DNSQuery;
|
|
||||||
struct Exception;
|
struct Exception;
|
||||||
struct MemoInfo;
|
struct MemoInfo;
|
||||||
struct ModeLock;
|
struct ModeLock;
|
||||||
struct Oper;
|
struct Oper;
|
||||||
|
namespace SASL { struct Message; }
|
||||||
|
|
||||||
|
|||||||
-203
@@ -1,203 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* (C) 2003-2012 Anope Team
|
|
||||||
* Contact us at team@anope.org
|
|
||||||
*
|
|
||||||
* Please read COPYING and README for further details.
|
|
||||||
*
|
|
||||||
* Based on the original code of Epona by Lara.
|
|
||||||
* Based on the original code of Services by Andy Church.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef DNS_H
|
|
||||||
#define DNS_H
|
|
||||||
|
|
||||||
#include "sockets.h"
|
|
||||||
#include "timers.h"
|
|
||||||
#include "extern.h"
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
/** Valid query types
|
|
||||||
*/
|
|
||||||
enum QueryType
|
|
||||||
{
|
|
||||||
/* Nothing */
|
|
||||||
DNS_QUERY_NONE,
|
|
||||||
/* A simple A lookup */
|
|
||||||
DNS_QUERY_A = 1,
|
|
||||||
/* A CNAME lookup */
|
|
||||||
DNS_QUERY_CNAME = 5,
|
|
||||||
/* Reverse DNS lookup */
|
|
||||||
DNS_QUERY_PTR = 12,
|
|
||||||
/* IPv6 AAAA lookup */
|
|
||||||
DNS_QUERY_AAAA = 28
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Flags that can be AND'd into DNSPacket::flags to receive certain values
|
|
||||||
*/
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
DNS_QUERYFLAGS_QR = 0x8000,
|
|
||||||
DNS_QUERYFLAGS_OPCODE = 0x7800,
|
|
||||||
DNS_QUERYFLAGS_AA = 0x400,
|
|
||||||
DBS_QUERYFLAGS_TC = 0x200,
|
|
||||||
DNS_QUERYFLAGS_RD = 0x100,
|
|
||||||
DNS_QUERYFLAGS_RA = 0x80,
|
|
||||||
DNS_QUERYFLAGS_Z = 0x70,
|
|
||||||
DNS_QUERYFLAGS_RCODE = 0xF
|
|
||||||
};
|
|
||||||
|
|
||||||
enum DNSError
|
|
||||||
{
|
|
||||||
DNS_ERROR_NONE,
|
|
||||||
DNS_ERROR_UNKNOWN,
|
|
||||||
DNS_ERROR_UNLOADED,
|
|
||||||
DNS_ERROR_TIMEOUT,
|
|
||||||
DNS_ERROR_NOT_AN_ANSWER,
|
|
||||||
DNS_ERROR_NONSTANDARD_QUERY,
|
|
||||||
DNS_ERROR_FORMAT_ERROR,
|
|
||||||
DNS_ERROR_SERVER_FAILURE,
|
|
||||||
DNS_ERROR_DOMAIN_NOT_FOUND,
|
|
||||||
DNS_ERROR_NOT_IMPLEMENTED,
|
|
||||||
DNS_ERROR_REFUSED,
|
|
||||||
DNS_ERROR_NO_RECORDS,
|
|
||||||
DNS_ERROR_INVALIDTYPE
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct CoreExport Question
|
|
||||||
{
|
|
||||||
Anope::string name;
|
|
||||||
QueryType type;
|
|
||||||
unsigned short qclass;
|
|
||||||
|
|
||||||
Question();
|
|
||||||
Question(const Anope::string &, QueryType, unsigned short = 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CoreExport ResourceRecord : public Question
|
|
||||||
{
|
|
||||||
unsigned int ttl;
|
|
||||||
Anope::string rdata;
|
|
||||||
time_t created;
|
|
||||||
|
|
||||||
ResourceRecord(const Anope::string &, QueryType, unsigned short = 1);
|
|
||||||
ResourceRecord(const Question &);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CoreExport DNSQuery
|
|
||||||
{
|
|
||||||
std::vector<Question> questions;
|
|
||||||
std::vector<ResourceRecord> answers, authorities, additional;
|
|
||||||
DNSError error;
|
|
||||||
|
|
||||||
DNSQuery();
|
|
||||||
DNSQuery(const Question &q);
|
|
||||||
DNSQuery(const DNSPacket &p);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** The request
|
|
||||||
*/
|
|
||||||
class CoreExport DNSRequest : public Timer, public Question
|
|
||||||
{
|
|
||||||
/* Use result cache if available */
|
|
||||||
bool use_cache;
|
|
||||||
|
|
||||||
public:
|
|
||||||
/* Request id */
|
|
||||||
unsigned short id;
|
|
||||||
/* Creator of this request */
|
|
||||||
Module *creator;
|
|
||||||
|
|
||||||
DNSRequest(const Anope::string &addr, QueryType qt, bool cache = false, Module *c = NULL);
|
|
||||||
|
|
||||||
virtual ~DNSRequest();
|
|
||||||
|
|
||||||
void Process();
|
|
||||||
|
|
||||||
virtual void OnLookupComplete(const DNSQuery *r) = 0;
|
|
||||||
|
|
||||||
virtual void OnError(const DNSQuery *r);
|
|
||||||
|
|
||||||
void Tick(time_t) anope_override;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** A full packet sent or recieved to/from the nameserver, may contain multiple queries
|
|
||||||
*/
|
|
||||||
class DNSPacket : public DNSQuery
|
|
||||||
{
|
|
||||||
static const int DNS_POINTER = 0xC0;
|
|
||||||
static const int DNS_LABEL = 0x3F;
|
|
||||||
|
|
||||||
void PackName(unsigned char *output, unsigned short output_size, unsigned short &pos, const Anope::string &name);
|
|
||||||
Anope::string UnpackName(const unsigned char *input, unsigned short input_size, unsigned short &pos);
|
|
||||||
|
|
||||||
Question UnpackQuestion(const unsigned char *input, unsigned short input_size, unsigned short &pos);
|
|
||||||
ResourceRecord UnpackResourceRecord(const unsigned char *input, unsigned short input_size, unsigned short &poss);
|
|
||||||
public:
|
|
||||||
static const int HEADER_LENGTH = 12;
|
|
||||||
|
|
||||||
/* Our 16-bit id for this header */
|
|
||||||
unsigned short id;
|
|
||||||
/* Flags on the query */
|
|
||||||
unsigned short flags;
|
|
||||||
|
|
||||||
DNSPacket();
|
|
||||||
void Fill(const unsigned char *input, const unsigned short len);
|
|
||||||
unsigned short Pack(unsigned char *output, unsigned short output_size);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** DNS manager, manages all requests
|
|
||||||
*/
|
|
||||||
class CoreExport DNSManager : public Timer, public Socket
|
|
||||||
{
|
|
||||||
typedef std::multimap<Anope::string, ResourceRecord, ci::less> cache_map;
|
|
||||||
cache_map cache;
|
|
||||||
sockaddrs addrs;
|
|
||||||
public:
|
|
||||||
std::deque<DNSPacket *> packets;
|
|
||||||
std::map<unsigned short, DNSRequest *> requests;
|
|
||||||
|
|
||||||
static const int DNSPort = 53;
|
|
||||||
|
|
||||||
DNSManager(const Anope::string &nameserver, int port);
|
|
||||||
|
|
||||||
~DNSManager();
|
|
||||||
|
|
||||||
bool ProcessRead();
|
|
||||||
|
|
||||||
bool ProcessWrite();
|
|
||||||
|
|
||||||
/** Add a record to the dns cache
|
|
||||||
* @param r The record
|
|
||||||
*/
|
|
||||||
void AddCache(DNSQuery &r);
|
|
||||||
|
|
||||||
/** Check the DNS cache to see if request can be handled by a cached result
|
|
||||||
* @return true if a cached result was found.
|
|
||||||
*/
|
|
||||||
bool CheckCache(DNSRequest *request);
|
|
||||||
|
|
||||||
/** Tick this timer, used to clear the DNS cache.
|
|
||||||
*/
|
|
||||||
void Tick(time_t now) anope_override;
|
|
||||||
|
|
||||||
/** Cleanup all pending DNS queries for a module
|
|
||||||
* @param mod The module
|
|
||||||
*/
|
|
||||||
void Cleanup(Module *mod);
|
|
||||||
|
|
||||||
/** Does a BLOCKING DNS query and returns the first IP.
|
|
||||||
* Only use this if you know what you are doing. Unless you specifically
|
|
||||||
* need a blocking query use the DNSRequest system
|
|
||||||
*/
|
|
||||||
static DNSQuery BlockingQuery(const Anope::string &mask, QueryType qt);
|
|
||||||
};
|
|
||||||
|
|
||||||
extern DNSManager *DNSEngine;
|
|
||||||
|
|
||||||
#endif // DNS_H
|
|
||||||
|
|
||||||
|
|
||||||
+224
-87
@@ -1,125 +1,262 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EXTENSIBLE_H
|
#ifndef EXTENSIBLE_H
|
||||||
#define EXTENSIBLE_H
|
#define EXTENSIBLE_H
|
||||||
|
|
||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
|
#include "serialize.h"
|
||||||
|
#include "service.h"
|
||||||
|
#include "logger.h"
|
||||||
|
|
||||||
class CoreExport ExtensibleItem
|
class Extensible;
|
||||||
|
|
||||||
|
class CoreExport ExtensibleBase : public Service
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
std::map<Extensible *, void *> items;
|
||||||
|
|
||||||
|
ExtensibleBase(Module *m, const Anope::string &n);
|
||||||
|
~ExtensibleBase();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ExtensibleItem();
|
virtual void Unset(Extensible *obj) = 0;
|
||||||
virtual ~ExtensibleItem();
|
|
||||||
virtual void OnDelete();
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T> struct CoreExport ExtensibleItemClass : T, ExtensibleItem
|
/* called when an object we are keep track of is serializing */
|
||||||
{
|
virtual void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &) const { }
|
||||||
ExtensibleItemClass(const T& t) : T(t) { }
|
virtual void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport Extensible
|
class CoreExport Extensible
|
||||||
{
|
{
|
||||||
private:
|
public:
|
||||||
typedef Anope::map<ExtensibleItem *> extensible_map;
|
std::set<ExtensibleBase *> extension_items;
|
||||||
extensible_map extension_items;
|
|
||||||
|
virtual ~Extensible();
|
||||||
|
|
||||||
|
template<typename T> T* GetExt(const Anope::string &name) const;
|
||||||
|
bool HasExt(const Anope::string &name) const;
|
||||||
|
|
||||||
|
template<typename T> T* Extend(const Anope::string &name, const T &what);
|
||||||
|
template<typename T> T* Extend(const Anope::string &name);
|
||||||
|
template<typename T> T* Require(const Anope::string &name);
|
||||||
|
template<typename T> void Shrink(const Anope::string &name);
|
||||||
|
|
||||||
|
static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
|
||||||
|
static void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &data);
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class BaseExtensibleItem : public ExtensibleBase
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual T *Create(Extensible *) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default constructor, does nothing
|
BaseExtensibleItem(Module *m, const Anope::string &n) : ExtensibleBase(m, n) { }
|
||||||
*/
|
|
||||||
Extensible() { }
|
|
||||||
|
|
||||||
/** Default destructor, deletes all of the extensible items in this object
|
~BaseExtensibleItem()
|
||||||
* then clears the map
|
|
||||||
*/
|
|
||||||
virtual ~Extensible()
|
|
||||||
{
|
{
|
||||||
for (extensible_map::iterator it = extension_items.begin(), it_end = extension_items.end(); it != it_end; ++it)
|
while (!items.empty())
|
||||||
if (it->second)
|
|
||||||
it->second->OnDelete();
|
|
||||||
extension_items.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Extend an Extensible class.
|
|
||||||
*
|
|
||||||
* @param key The key parameter is an arbitary string which identifies the extension data
|
|
||||||
* @param p This parameter is a pointer to an ExtensibleItem or ExtensibleItemBase derived class
|
|
||||||
*
|
|
||||||
* You must provide a key to store the data as via the parameter 'key'.
|
|
||||||
* The data will be inserted into the map. If the data already exists, you may not insert it
|
|
||||||
* twice, Extensible::Extend will return false in this case.
|
|
||||||
*
|
|
||||||
* @return Returns true on success, false if otherwise
|
|
||||||
*/
|
|
||||||
void Extend(const Anope::string &key, ExtensibleItem *p)
|
|
||||||
{
|
|
||||||
this->Shrink(key);
|
|
||||||
this->extension_items[key] = p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Shrink an Extensible class.
|
|
||||||
*
|
|
||||||
* @param key The key parameter is an arbitary string which identifies the extension data
|
|
||||||
*
|
|
||||||
* You must provide a key name. The given key name will be removed from the classes data. If
|
|
||||||
* you provide a nonexistent key (case is important) then the function will return false.
|
|
||||||
* @return Returns true on success.
|
|
||||||
*/
|
|
||||||
bool Shrink(const Anope::string &key)
|
|
||||||
{
|
|
||||||
extensible_map::iterator it = this->extension_items.find(key);
|
|
||||||
if (it != this->extension_items.end())
|
|
||||||
{
|
{
|
||||||
if (it->second != NULL)
|
std::map<Extensible *, void *>::iterator it = items.begin();
|
||||||
it->second->OnDelete();
|
Extensible *obj = it->first;
|
||||||
/* map::size_type map::erase( const key_type& key );
|
T *value = static_cast<T *>(it->second);
|
||||||
* returns the number of elements removed, std::map
|
|
||||||
* is single-associative so this should only be 0 or 1
|
|
||||||
*/
|
|
||||||
return this->extension_items.erase(key) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
obj->extension_items.erase(this);
|
||||||
|
items.erase(it);
|
||||||
|
delete value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get an extension item.
|
T* Set(Extensible *obj, const T &value)
|
||||||
*
|
|
||||||
* @param key The key parameter is an arbitary string which identifies the extension data
|
|
||||||
* @return The item found
|
|
||||||
*/
|
|
||||||
template<typename T> T GetExt(const Anope::string &key) const
|
|
||||||
{
|
{
|
||||||
extensible_map::const_iterator it = this->extension_items.find(key);
|
T* t = Set(obj);
|
||||||
if (it != this->extension_items.end())
|
if (t)
|
||||||
return anope_dynamic_reinterpret_cast<T>(it->second);
|
*t = value;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
T* Set(Extensible *obj)
|
||||||
|
{
|
||||||
|
T* t = Create(obj);
|
||||||
|
Unset(obj);
|
||||||
|
items[obj] = t;
|
||||||
|
obj->extension_items.insert(this);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Unset(Extensible *obj) anope_override
|
||||||
|
{
|
||||||
|
T *value = Get(obj);
|
||||||
|
items.erase(obj);
|
||||||
|
obj->extension_items.erase(this);
|
||||||
|
delete value;
|
||||||
|
}
|
||||||
|
|
||||||
|
T* Get(const Extensible *obj) const
|
||||||
|
{
|
||||||
|
std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
|
||||||
|
if (it != items.end())
|
||||||
|
return static_cast<T *>(it->second);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if an extension item exists.
|
bool HasExt(const Extensible *obj) const
|
||||||
*
|
|
||||||
* @param key The key parameter is an arbitary string which identifies the extension data
|
|
||||||
* @return True if the item was found.
|
|
||||||
*/
|
|
||||||
bool HasExt(const Anope::string &key) const
|
|
||||||
{
|
{
|
||||||
return this->extension_items.count(key) > 0;
|
return items.find(const_cast<Extensible *>(obj)) != items.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get a list of all extension items names.
|
T* Require(Extensible *obj)
|
||||||
* @param list A deque of strings to receive the list
|
|
||||||
* @return This function writes a list of all extension items stored
|
|
||||||
* in this object by name into the given deque and returns void.
|
|
||||||
*/
|
|
||||||
void GetExtList(std::deque<Anope::string> &list) const
|
|
||||||
{
|
{
|
||||||
for (extensible_map::const_iterator it = extension_items.begin(), it_end = extension_items.end(); it != it_end; ++it)
|
T* t = Get(obj);
|
||||||
list.push_back(it->first);
|
if (t)
|
||||||
|
return t;
|
||||||
|
|
||||||
|
return Set(obj);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class ExtensibleItem : public BaseExtensibleItem<T>
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
T* Create(Extensible *obj) anope_override
|
||||||
|
{
|
||||||
|
return new T(obj);
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
ExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class PrimitiveExtensibleItem : public BaseExtensibleItem<T>
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
T* Create(Extensible *obj) anope_override
|
||||||
|
{
|
||||||
|
return new T();
|
||||||
|
}
|
||||||
|
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
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<bool>(m, n) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<T>(m, n) { }
|
||||||
|
|
||||||
|
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
|
||||||
|
{
|
||||||
|
T* t = this->Get(e);
|
||||||
|
data[this->name] << *t;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
|
||||||
|
{
|
||||||
|
T t;
|
||||||
|
if (data[this->name] >> t)
|
||||||
|
this->Set(e, t);
|
||||||
|
else
|
||||||
|
this->Unset(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<bool>(m, n) { }
|
||||||
|
|
||||||
|
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
|
||||||
|
{
|
||||||
|
data[this->name] << true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
|
||||||
|
{
|
||||||
|
bool b = false;
|
||||||
|
data[this->name] >> b;
|
||||||
|
if (b)
|
||||||
|
this->Set(e);
|
||||||
|
else
|
||||||
|
this->Unset(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
struct ExtensibleRef : ServiceReference<BaseExtensibleItem<T> >
|
||||||
|
{
|
||||||
|
ExtensibleRef(const Anope::string &n) : ServiceReference<BaseExtensibleItem<T> >("Extensible", n) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T* Extensible::GetExt(const Anope::string &name) const
|
||||||
|
{
|
||||||
|
ExtensibleRef<T> ref(name);
|
||||||
|
if (ref)
|
||||||
|
return ref->Get(this);
|
||||||
|
|
||||||
|
Log(LOG_DEBUG) << "GetExt for nonexistent type " << name << " on " << static_cast<const void *>(this);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T* Extensible::Extend(const Anope::string &name, const T &what)
|
||||||
|
{
|
||||||
|
T* t = Extend<T>(name);
|
||||||
|
if (t)
|
||||||
|
*t = what;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T* Extensible::Extend(const Anope::string &name)
|
||||||
|
{
|
||||||
|
ExtensibleRef<T> ref(name);
|
||||||
|
if (ref)
|
||||||
|
return ref->Set(this);
|
||||||
|
|
||||||
|
Log(LOG_DEBUG) << "Extend for nonexistent type " << name << " on " << static_cast<void *>(this);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T* Extensible::Require(const Anope::string &name)
|
||||||
|
{
|
||||||
|
if (HasExt(name))
|
||||||
|
return GetExt<T>(name);
|
||||||
|
else
|
||||||
|
return Extend<T>(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void Extensible::Shrink(const Anope::string &name)
|
||||||
|
{
|
||||||
|
ExtensibleRef<T> ref(name);
|
||||||
|
if (ref)
|
||||||
|
ref->Unset(this);
|
||||||
|
else
|
||||||
|
Log(LOG_DEBUG) << "Shrink for nonexistent type " << name << " on " << static_cast<void *>(this);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // EXTENSIBLE_H
|
#endif // EXTENSIBLE_H
|
||||||
|
|||||||
@@ -1,136 +0,0 @@
|
|||||||
/* Prototypes and external variable declarations.
|
|
||||||
*
|
|
||||||
* (C) 2003-2012 Anope Team
|
|
||||||
* Contact us at team@anope.org
|
|
||||||
*
|
|
||||||
* Please read COPYING and README for further details.
|
|
||||||
*
|
|
||||||
* Based on the original code of Epona by Lara.
|
|
||||||
* Based on the original code of Services by Andy Church.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef EXTERN_H
|
|
||||||
#define EXTERN_H
|
|
||||||
|
|
||||||
#include "modes.h"
|
|
||||||
|
|
||||||
#define E extern CoreExport
|
|
||||||
#define EI extern DllExport
|
|
||||||
|
|
||||||
|
|
||||||
/**** actions.c ****/
|
|
||||||
|
|
||||||
E bool bad_password(User *u);
|
|
||||||
E void common_unban(const ChannelInfo *ci, User *u, bool full = false);
|
|
||||||
|
|
||||||
/**** encrypt.c ****/
|
|
||||||
|
|
||||||
E void enc_encrypt(const Anope::string &src, Anope::string &dest);
|
|
||||||
E bool enc_decrypt(const Anope::string &src, Anope::string &dest);
|
|
||||||
|
|
||||||
/**** init.c ****/
|
|
||||||
|
|
||||||
E Anope::string conf_dir, db_dir, modules_dir, locale_dir, log_dir;
|
|
||||||
|
|
||||||
E void introduce_user(const Anope::string &user);
|
|
||||||
E bool GetCommandLineArgument(const Anope::string &name, char shortname = 0);
|
|
||||||
E bool GetCommandLineArgument(const Anope::string &name, char shortname, Anope::string ¶m);
|
|
||||||
E bool AtTerm();
|
|
||||||
E void Fork();
|
|
||||||
E void Init(int ac, char **av);
|
|
||||||
|
|
||||||
/**** language.cpp ****/
|
|
||||||
|
|
||||||
E std::vector<Anope::string> languages;
|
|
||||||
E std::vector<Anope::string> domains;
|
|
||||||
E void InitLanguages();
|
|
||||||
E const char *translate(const char *string);
|
|
||||||
E const char *translate(User *u, const char *string);
|
|
||||||
E const char *translate(const NickCore *nc, const char *string);
|
|
||||||
E const char *anope_gettext(const char *lang, const char *string);
|
|
||||||
|
|
||||||
/**** main.c ****/
|
|
||||||
|
|
||||||
E Anope::string services_dir;
|
|
||||||
E Anope::string services_bin;
|
|
||||||
E int debug;
|
|
||||||
E bool readonly;
|
|
||||||
E bool nofork;
|
|
||||||
E bool nothird;
|
|
||||||
E bool noexpire;
|
|
||||||
E bool protocoldebug;
|
|
||||||
|
|
||||||
E bool quitting;
|
|
||||||
E int return_code;
|
|
||||||
E bool restarting;
|
|
||||||
E Anope::string quitmsg;
|
|
||||||
E time_t start_time;
|
|
||||||
|
|
||||||
E int CurrentUplink;
|
|
||||||
|
|
||||||
E void save_databases();
|
|
||||||
E void sighandler(int signum);
|
|
||||||
|
|
||||||
/**** messages.cpp ****/
|
|
||||||
|
|
||||||
E void init_core_messages();
|
|
||||||
|
|
||||||
E bool OnStats(const Anope::string &source, const std::vector<Anope::string> &);
|
|
||||||
E bool OnTime(const Anope::string &source, const std::vector<Anope::string> &);
|
|
||||||
E bool OnVersion(const Anope::string &source, const std::vector<Anope::string> &);
|
|
||||||
|
|
||||||
E bool On436(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnAway(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnJoin(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnKick(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnKill(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnMode(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnNick(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnUID(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnPart(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnPing(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnPrivmsg(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnQuit(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnServer(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnSQuit(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnTopic(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnWhois(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnCapab(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnSJoin(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
E bool OnError(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
|
|
||||||
/**** misc.c ****/
|
|
||||||
|
|
||||||
E bool IsFile(const Anope::string &filename);
|
|
||||||
|
|
||||||
E time_t dotime(const Anope::string &s);
|
|
||||||
E Anope::string duration(const time_t &seconds, const NickCore *nc = NULL);
|
|
||||||
E Anope::string expire_left(const NickCore *nc, time_t expires);
|
|
||||||
E Anope::string do_strftime(const time_t &t, const NickCore *nc = NULL, bool short_output = false);
|
|
||||||
E bool IsValidIdent(const Anope::string &ident);
|
|
||||||
E bool IsValidHost(const Anope::string &host);
|
|
||||||
|
|
||||||
E Anope::string myStrGetToken(const Anope::string &str, char dilim, int token_number);
|
|
||||||
E Anope::string myStrGetTokenRemainder(const Anope::string &str, char dilim, int token_number);
|
|
||||||
E int myNumToken(const Anope::string &str, char dilim);
|
|
||||||
E bool nickIsServices(const Anope::string &nick, bool bot);
|
|
||||||
|
|
||||||
E std::list<Anope::string> BuildStringList(const Anope::string &, char = ' ');
|
|
||||||
E std::vector<Anope::string> BuildStringVector(const Anope::string &, char = ' ');
|
|
||||||
|
|
||||||
E bool str_is_wildcard(const Anope::string &str);
|
|
||||||
E bool str_is_pure_wildcard(const Anope::string &str);
|
|
||||||
E Anope::string normalizeBuffer(const Anope::string &);
|
|
||||||
|
|
||||||
/**** modes.cpp ****/
|
|
||||||
|
|
||||||
/* Number of generic modes we support */
|
|
||||||
E unsigned GenericChannelModes, GenericUserModes;
|
|
||||||
E std::multimap<ChannelModeName, ModeLock *> def_mode_locks;
|
|
||||||
E void SetDefaultMLock(ServerConfig *config);
|
|
||||||
|
|
||||||
/**** process.c ****/
|
|
||||||
|
|
||||||
E void process(const Anope::string &buf);
|
|
||||||
|
|
||||||
#endif /* EXTERN_H */
|
|
||||||
+28
-16
@@ -1,13 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
|
*
|
||||||
* Copyright (C) 2002-2011 InspIRCd Development Team
|
* Copyright (C) 2002-2011 InspIRCd Development Team
|
||||||
* Copyright (C) 2009-2012 Anope Team <team@anope.org>
|
* Copyright (C) 2009-2014 Anope Team <team@anope.org>
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
*
|
*
|
||||||
* These classes have been copied from InspIRCd and modified
|
|
||||||
* for use in Anope.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HASHCOMP_H
|
#ifndef HASHCOMP_H
|
||||||
@@ -16,19 +13,33 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <locale>
|
#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"
|
#include "services.h"
|
||||||
|
|
||||||
namespace Anope
|
namespace Anope
|
||||||
{
|
{
|
||||||
class string;
|
class string;
|
||||||
|
|
||||||
|
/* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */
|
||||||
extern std::locale casemap;
|
extern std::locale casemap;
|
||||||
|
|
||||||
template<typename charT>
|
extern void CaseMapRebuild();
|
||||||
class ascii_ctype : public std::ctype<charT>
|
extern unsigned char tolower(unsigned char);
|
||||||
|
extern unsigned char toupper(unsigned char);
|
||||||
|
|
||||||
|
/* ASCII case insensitive ctype. */
|
||||||
|
template<typename char_type>
|
||||||
|
class ascii_ctype : public std::ctype<char_type>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
charT do_toupper(charT c) const anope_override
|
char_type do_toupper(char_type c) const anope_override
|
||||||
{
|
{
|
||||||
if (c >= 'a' && c <= 'z')
|
if (c >= 'a' && c <= 'z')
|
||||||
return c - 32;
|
return c - 32;
|
||||||
@@ -36,7 +47,7 @@ namespace Anope
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
charT do_tolower(charT c) const anope_override
|
char_type do_tolower(char_type c) const anope_override
|
||||||
{
|
{
|
||||||
if (c >= 'A' && c <= 'Z')
|
if (c >= 'A' && c <= 'Z')
|
||||||
return c + 32;
|
return c + 32;
|
||||||
@@ -45,29 +56,30 @@ namespace Anope
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename charT>
|
/* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */
|
||||||
class rfc1459_ctype : public ascii_ctype<charT>
|
template<typename char_type>
|
||||||
|
class rfc1459_ctype : public ascii_ctype<char_type>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
charT do_toupper(charT c) const anope_override
|
char_type do_toupper(char_type c) const anope_override
|
||||||
{
|
{
|
||||||
if (c == '{' || c == '}' || c == '|')
|
if (c == '{' || c == '}' || c == '|')
|
||||||
return c - 32;
|
return c - 32;
|
||||||
else
|
else
|
||||||
return ascii_ctype<charT>::do_toupper(c);
|
return ascii_ctype<char_type>::do_toupper(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
charT do_tolower(charT c) const anope_override
|
char_type do_tolower(char_type c) const anope_override
|
||||||
{
|
{
|
||||||
if (c == '[' || c == ']' || c == '\\')
|
if (c == '[' || c == ']' || c == '\\')
|
||||||
return c + 32;
|
return c + 32;
|
||||||
else
|
else
|
||||||
return ascii_ctype<charT>::do_tolower(c);
|
return ascii_ctype<char_type>::do_tolower(c);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The ci namespace contains a number of helper classes.
|
/** The ci namespace contains a number of helper classes relevant to case insensitive strings.
|
||||||
*/
|
*/
|
||||||
namespace ci
|
namespace ci
|
||||||
{
|
{
|
||||||
|
|||||||
+70
-26
@@ -1,11 +1,69 @@
|
|||||||
/* Commonly used language strings
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2008-2012 Anope Team
|
* (C) 2008-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "anope.h"
|
||||||
|
|
||||||
|
namespace Language
|
||||||
|
{
|
||||||
|
|
||||||
|
/* Languages we support as configured in services.conf. They are
|
||||||
|
* added to this list if we detect a language exists in the correct
|
||||||
|
* location for each language.
|
||||||
|
*/
|
||||||
|
extern CoreExport std::vector<Anope::string> Languages;
|
||||||
|
|
||||||
|
/* Domains to search when looking for translations other than the
|
||||||
|
* default "anope domain. This is used by modules who add their own
|
||||||
|
* language files (and thus domains) to Anope. If a module is loaded
|
||||||
|
* and we detect a language file exists for at least one of the supported
|
||||||
|
* languages for the module, then we add the module's domain (its name)
|
||||||
|
* here.
|
||||||
|
*
|
||||||
|
* When strings are translated they are checked against all domains.
|
||||||
|
*/
|
||||||
|
extern std::vector<Anope::string> Domains;
|
||||||
|
|
||||||
|
/** Initialize the language system. Finds valid language files and
|
||||||
|
* populates the Languages list.
|
||||||
|
*/
|
||||||
|
extern void InitLanguages();
|
||||||
|
|
||||||
|
/** Translates a string to the default language.
|
||||||
|
* @param string A string to translate
|
||||||
|
* @return The translated string if found, else the original string.
|
||||||
|
*/
|
||||||
|
extern CoreExport const char *Translate(const char *string);
|
||||||
|
|
||||||
|
/** Translates a string to the language of the given user.
|
||||||
|
* @param u The user to transate the string for
|
||||||
|
* @param string A string to translate
|
||||||
|
* @return The translated string if found, else the original string.
|
||||||
|
*/
|
||||||
|
extern CoreExport const char *Translate(User *u, const char *string);
|
||||||
|
|
||||||
|
/** Translates a string to the language of the given account.
|
||||||
|
* @param nc The account to translate the string for
|
||||||
|
* @param string A string to translate
|
||||||
|
* @return The translated string if count, else the original string
|
||||||
|
*/
|
||||||
|
extern CoreExport const char *Translate(const NickCore *nc, const char *string);
|
||||||
|
|
||||||
|
/** Translatesa 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);
|
||||||
|
|
||||||
|
} // namespace Language
|
||||||
|
|
||||||
|
/* Commonly used language strings */
|
||||||
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
|
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
|
||||||
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
|
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
|
||||||
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
|
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
|
||||||
@@ -16,7 +74,7 @@
|
|||||||
#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should be at least\n" \
|
#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" \
|
"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.")
|
"(e.g. your real name or your nick), and cannot contain the space or tab characters.")
|
||||||
#define PASSWORD_TOO_LONG _("Your password is too long. Please try again with a shorter password.")
|
#define PASSWORD_TOO_LONG _("Your password is too long. It must not exceed %u characters.")
|
||||||
#define NICK_NOT_REGISTERED _("Your nick isn't registered.")
|
#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_REGISTERED _("Nick \002%s\002 isn't registered.")
|
||||||
#define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.")
|
#define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.")
|
||||||
@@ -27,12 +85,9 @@
|
|||||||
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
|
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
|
||||||
#define NICK_IDENTIFY_REQUIRED _("Password authentication required for that command.")
|
#define NICK_IDENTIFY_REQUIRED _("Password authentication required for 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 e-mail address.")
|
||||||
#define NO_REASON _("No reason")
|
|
||||||
#define UNKNOWN _("<unknown>")
|
#define UNKNOWN _("<unknown>")
|
||||||
#define NO_EXPIRE _("does not expire")
|
#define NO_EXPIRE _("does not expire")
|
||||||
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
|
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
|
||||||
#define UNKNOWN_OPTION _("Unknown option \002%s\002.\n" \
|
|
||||||
"Type %s%s HELP %s for more information.")
|
|
||||||
#define NICK_IS_REGISTERED _("This nick is owned by someone else. Please choose another.\n" \
|
#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.)")
|
"(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" \
|
#define NICK_IS_SECURE _("This nickname is registered and protected. If it is your\n" \
|
||||||
@@ -41,45 +96,34 @@
|
|||||||
#define FORCENICKCHANGE_NOW _("This nickname has been registered; you may not use it.")
|
#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_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.")
|
||||||
#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
|
#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
|
||||||
#define NICK_SET_SYNTAX _("SET \037option\037 \037parameters\037")
|
|
||||||
#define NICK_SET_DISABLED _("Sorry, nickname option setting is temporarily disabled.")
|
|
||||||
#define NICK_SET_UNKNOWN_OPTION _("Unknown SET option \002%s%s\002.")
|
|
||||||
#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
|
#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
|
||||||
#define NICK_LIST_SYNTAX _("LIST \037pattern\037")
|
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry.")
|
||||||
#define NICK_RECOVERED _("User claiming your nick has been killed.\n" \
|
|
||||||
"\002%s%s RELEASE %s\002 to get it back before %s timeout.")
|
|
||||||
#define NICK_REQUESTED _("This nick has already been requested, please check your e-mail address for the pass code")
|
|
||||||
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry")
|
|
||||||
#define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.")
|
#define CHAN_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_X_INVALID _("Channel %s is not a valid channel.")
|
||||||
#define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
|
#define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
|
||||||
#define CHAN_EXCEEDED_CHANNEL_LIMIT _("Sorry, you have already exceeded your limit of \002%d\002 channels.")
|
#define CHAN_EXCEEDED_CHANNEL_LIMIT _("Sorry, you have already exceeded your limit of \002%d\002 channels.")
|
||||||
#define CHAN_SYMBOL_REQUIRED _("Please use the symbol of \002#\002 when attempting to register")
|
#define CHAN_SYMBOL_REQUIRED _("Please use the symbol of \002#\002 when attempting to register.")
|
||||||
#define CHAN_SET_DISABLED _("Sorry, channel option setting is temporarily disabled.")
|
|
||||||
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
|
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
|
||||||
#define CHAN_SETTING_UNSET _("%s for %s unset.")
|
#define CHAN_SETTING_UNSET _("%s for %s unset.")
|
||||||
#define CHAN_SET_MLOCK_DEPRECATED _("MLOCK is deprecated. Use \002%s%s HELP MODE\002 instead.")
|
|
||||||
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
|
#define CHAN_ACCESS_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 for channel \002%s\002:")
|
||||||
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except have been removed.")
|
#define CHAN_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" \
|
#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.")
|
"Type \002%s%s READ %s %d\002 to read it.")
|
||||||
#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \
|
#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \
|
||||||
"Type \002%s%s READ %d\002 to read it.")
|
"Type \002%s%s READ %d\002 to read it.")
|
||||||
#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
|
#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
|
||||||
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
|
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
|
||||||
#define MEMO_SEND_SYNTAX _("SEND {\037nick\037 | \037channel\037} \037memo-text\037")
|
|
||||||
#define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.")
|
#define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.")
|
||||||
#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
|
#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
|
||||||
#define MEMO_X_HAS_NO_NEW_MEMOS _("%s has 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_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_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 BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
|
||||||
#define BOT_ASSIGN_READONLY _("Sorry, bot assignment is temporarily disabled.")
|
#define HOST_SET_ERROR _("A vHost must be in the format of a valid hostname.")
|
||||||
#define HOST_SET_ERROR _("A vhost must be in the format of a valid hostmask.")
|
#define HOST_SET_IDENT_ERROR _("A vHost ident must be in the format of a valid ident.")
|
||||||
#define HOST_SET_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_TOOLONG _("Error! The vhost is too long, please use a host 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_SET_IDENTTOOLONG _("Error! The Ident is too long, please use an ident shorter than %d characters.")
|
#define HOST_NOT_ASSIGNED _("Please contact an Operator to get a vHost assigned to this nick.")
|
||||||
#define HOST_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_NO_VIDENT _("Your IRCD does not support vIdent's, if this is incorrect, please report this as a possible bug")
|
|
||||||
|
|
||||||
|
|||||||
+9
-7
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LISTS_H
|
#ifndef LISTS_H
|
||||||
@@ -48,9 +47,9 @@ class CoreExport NumberList
|
|||||||
void Process();
|
void Process();
|
||||||
|
|
||||||
/** Called with a number from the list
|
/** Called with a number from the list
|
||||||
* @param Number The number
|
* @param number The number
|
||||||
*/
|
*/
|
||||||
virtual void HandleNumber(unsigned Number);
|
virtual void HandleNumber(unsigned number);
|
||||||
|
|
||||||
/** Called when there is an error with the numbered list
|
/** Called when there is an error with the numbered list
|
||||||
* Return false to immediatly stop processing the list and return
|
* Return false to immediatly stop processing the list and return
|
||||||
@@ -68,12 +67,14 @@ class CoreExport ListFormatter
|
|||||||
public:
|
public:
|
||||||
typedef std::map<Anope::string, Anope::string> ListEntry;
|
typedef std::map<Anope::string, Anope::string> ListEntry;
|
||||||
private:
|
private:
|
||||||
|
NickCore *nc;
|
||||||
std::vector<Anope::string> columns;
|
std::vector<Anope::string> columns;
|
||||||
std::vector<ListEntry> entries;
|
std::vector<ListEntry> entries;
|
||||||
public:
|
public:
|
||||||
ListFormatter &addColumn(const Anope::string &name);
|
ListFormatter(NickCore *nc);
|
||||||
void addEntry(const ListEntry &entry);
|
ListFormatter &AddColumn(const Anope::string &name);
|
||||||
bool isEmpty() const;
|
void AddEntry(const ListEntry &entry);
|
||||||
|
bool IsEmpty() const;
|
||||||
void Process(std::vector<Anope::string> &);
|
void Process(std::vector<Anope::string> &);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ class CoreExport InfoFormatter
|
|||||||
InfoFormatter(NickCore *nc);
|
InfoFormatter(NickCore *nc);
|
||||||
void Process(std::vector<Anope::string> &);
|
void Process(std::vector<Anope::string> &);
|
||||||
Anope::string &operator[](const Anope::string &key);
|
Anope::string &operator[](const Anope::string &key);
|
||||||
|
void AddOption(const Anope::string &opt);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LISTS_H
|
#endif // LISTS_H
|
||||||
|
|||||||
+57
-32
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -18,12 +18,18 @@
|
|||||||
|
|
||||||
enum LogType
|
enum LogType
|
||||||
{
|
{
|
||||||
|
/* Used whenever an administrator uses an administrative comand */
|
||||||
LOG_ADMIN,
|
LOG_ADMIN,
|
||||||
|
/* Used whenever an administrator overides something, such as adding
|
||||||
|
* access to a channel where they don't have permission to.
|
||||||
|
*/
|
||||||
LOG_OVERRIDE,
|
LOG_OVERRIDE,
|
||||||
|
/* Any other command usage */
|
||||||
LOG_COMMAND,
|
LOG_COMMAND,
|
||||||
LOG_SERVER,
|
LOG_SERVER,
|
||||||
LOG_CHANNEL,
|
LOG_CHANNEL,
|
||||||
LOG_USER,
|
LOG_USER,
|
||||||
|
LOG_MODULE,
|
||||||
LOG_NORMAL,
|
LOG_NORMAL,
|
||||||
LOG_TERMINAL,
|
LOG_TERMINAL,
|
||||||
LOG_RAWIO,
|
LOG_RAWIO,
|
||||||
@@ -36,50 +42,65 @@ enum LogType
|
|||||||
struct LogFile
|
struct LogFile
|
||||||
{
|
{
|
||||||
Anope::string filename;
|
Anope::string filename;
|
||||||
|
|
||||||
public:
|
|
||||||
std::ofstream stream;
|
std::ofstream stream;
|
||||||
|
|
||||||
LogFile(const Anope::string &name);
|
LogFile(const Anope::string &name);
|
||||||
Anope::string GetName() const;
|
~LogFile();
|
||||||
|
const Anope::string &GetName() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Represents a single log message */
|
||||||
class CoreExport Log
|
class CoreExport Log
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const BotInfo *bi;
|
/* Bot that should log this message */
|
||||||
Anope::string nick;
|
BotInfo *bi;
|
||||||
const User *u;
|
/* For commands, the user executing the command, but might not always exist */
|
||||||
const NickCore *nc;
|
User *u;
|
||||||
|
/* For commands, the account executing the command, but will not always exist */
|
||||||
|
NickCore *nc;
|
||||||
|
/* For commands, the command being executed */
|
||||||
Command *c;
|
Command *c;
|
||||||
|
/* For commands, the command source */
|
||||||
|
CommandSource *source;
|
||||||
|
/* Used for LOG_CHANNEL */
|
||||||
Channel *chan;
|
Channel *chan;
|
||||||
|
/* For commands, the channel the command was executed on, will not always exist */
|
||||||
const ChannelInfo *ci;
|
const ChannelInfo *ci;
|
||||||
|
/* For LOG_SERVER */
|
||||||
Server *s;
|
Server *s;
|
||||||
LogType Type;
|
/* For LOG_MODULE */
|
||||||
Anope::string Category;
|
Module *m;
|
||||||
std::list<Anope::string> Sources;
|
LogType type;
|
||||||
|
Anope::string category;
|
||||||
|
|
||||||
std::stringstream buf;
|
std::stringstream buf;
|
||||||
|
|
||||||
Log(LogType type = LOG_NORMAL, const Anope::string &category = "", const BotInfo *bi = NULL);
|
Log(LogType type = LOG_NORMAL, const Anope::string &category = "", BotInfo *bi = NULL);
|
||||||
|
|
||||||
/* LOG_COMMAND/OVERRIDE/ADMIN */
|
/* LOG_COMMAND/OVERRIDE/ADMIN */
|
||||||
Log(LogType type, const CommandSource &source, Command *c, const ChannelInfo *ci = NULL);
|
Log(LogType type, CommandSource &source, Command *c, ChannelInfo *ci = NULL);
|
||||||
|
|
||||||
/* LOG_CHANNEL */
|
/* LOG_CHANNEL */
|
||||||
Log(const User *u, Channel *c, const Anope::string &category = "");
|
Log(User *u, Channel *c, const Anope::string &category = "");
|
||||||
|
|
||||||
/* LOG_USER */
|
/* LOG_USER */
|
||||||
explicit Log(const User *u, const Anope::string &category = "", const BotInfo *bi = NULL);
|
Log(User *u, const Anope::string &category = "", BotInfo *bi = NULL);
|
||||||
|
|
||||||
/* LOG_SERVER */
|
/* LOG_SERVER */
|
||||||
explicit Log(Server *s, const Anope::string &category = "", const BotInfo *bi = NULL);
|
Log(Server *s, const Anope::string &category = "", BotInfo *bi = NULL);
|
||||||
|
|
||||||
explicit Log(const BotInfo *b, const Anope::string &category = "");
|
Log(BotInfo *b, const Anope::string &category = "");
|
||||||
|
|
||||||
|
Log(Module *m, const Anope::string &category = "", BotInfo *bi = NULL);
|
||||||
|
|
||||||
~Log();
|
~Log();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Anope::string FormatSource() const;
|
||||||
|
Anope::string FormatCommand() const;
|
||||||
|
|
||||||
|
public:
|
||||||
Anope::string BuildPrefix() const;
|
Anope::string BuildPrefix() const;
|
||||||
|
|
||||||
template<typename T> Log &operator<<(T val)
|
template<typename T> Log &operator<<(T val)
|
||||||
@@ -89,31 +110,35 @@ class CoreExport Log
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Configured in the configuration file, actually does the message logging */
|
||||||
class CoreExport LogInfo
|
class CoreExport LogInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::list<Anope::string> Targets;
|
BotInfo *bot;
|
||||||
std::map<Anope::string, LogFile *> Logfiles;
|
std::vector<Anope::string> targets;
|
||||||
std::list<Anope::string> Sources;
|
std::vector<LogFile *> logfiles;
|
||||||
int LogAge;
|
int last_day;
|
||||||
std::list<Anope::string> Admin;
|
std::vector<Anope::string> sources;
|
||||||
std::list<Anope::string> Override;
|
int log_age;
|
||||||
std::list<Anope::string> Commands;
|
std::vector<Anope::string> admin;
|
||||||
std::list<Anope::string> Servers;
|
std::vector<Anope::string> override;
|
||||||
std::list<Anope::string> Users;
|
std::vector<Anope::string> commands;
|
||||||
std::list<Anope::string> Channels;
|
std::vector<Anope::string> servers;
|
||||||
std::list<Anope::string> Normal;
|
std::vector<Anope::string> users;
|
||||||
bool RawIO;
|
std::vector<Anope::string> channels;
|
||||||
bool Debug;
|
std::vector<Anope::string> normal;
|
||||||
|
bool raw_io;
|
||||||
|
bool debug;
|
||||||
|
|
||||||
LogInfo(int logage, bool rawio, bool debug);
|
LogInfo(int logage, bool rawio, bool debug);
|
||||||
|
|
||||||
~LogInfo();
|
~LogInfo();
|
||||||
|
|
||||||
void AddType(std::list<Anope::string> &list, const Anope::string &type);
|
void OpenLogFiles();
|
||||||
|
|
||||||
bool HasType(LogType ltype, const Anope::string &type) const;
|
bool HasType(LogType ltype, const Anope::string &type) const;
|
||||||
|
|
||||||
|
/* Logs the message l if configured to */
|
||||||
void ProcessMessage(const Log *l);
|
void ProcessMessage(const Log *l);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+33
-18
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -18,26 +18,41 @@
|
|||||||
#include "threadengine.h"
|
#include "threadengine.h"
|
||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
|
|
||||||
extern CoreExport bool Mail(User *u, NickCore *nc, const BotInfo *service, const Anope::string &subject, const Anope::string &message);
|
namespace Mail
|
||||||
extern CoreExport bool Mail(NickCore *nc, const Anope::string &subject, const Anope::string &message);
|
|
||||||
extern CoreExport bool MailValidate(const Anope::string &email);
|
|
||||||
|
|
||||||
class MailThread : public Thread
|
|
||||||
{
|
{
|
||||||
private:
|
extern CoreExport bool Send(User *from, NickCore *to, BotInfo *service, const Anope::string &subject, const Anope::string &message);
|
||||||
Anope::string MailTo;
|
extern CoreExport bool Send(NickCore *to, const Anope::string &subject, const Anope::string &message);
|
||||||
Anope::string Addr;
|
extern CoreExport bool Validate(const Anope::string &email);
|
||||||
Anope::string Subject;
|
|
||||||
Anope::string Message;
|
|
||||||
bool DontQuoteAddresses;
|
|
||||||
|
|
||||||
bool Success;
|
/* A email message being sent */
|
||||||
public:
|
class Message : public Thread
|
||||||
MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message);
|
{
|
||||||
|
private:
|
||||||
|
Anope::string sendmail_path;
|
||||||
|
Anope::string send_from;
|
||||||
|
Anope::string mail_to;
|
||||||
|
Anope::string addr;
|
||||||
|
Anope::string subject;
|
||||||
|
Anope::string message;
|
||||||
|
bool dont_quote_addresses;
|
||||||
|
|
||||||
~MailThread();
|
bool success;
|
||||||
|
public:
|
||||||
|
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
|
||||||
|
* @param sf Config->SendFrom
|
||||||
|
* @param mailto Name of person being mailed (u->nick, nc->display, etc)
|
||||||
|
* @param addr Destination address to mail
|
||||||
|
* @param subject Message subject
|
||||||
|
* @param message The actual message
|
||||||
|
*/
|
||||||
|
Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message);
|
||||||
|
|
||||||
void Run();
|
~Message();
|
||||||
};
|
|
||||||
|
/* Called from within the thread to actually send the mail */
|
||||||
|
void Run() anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Mail
|
||||||
|
|
||||||
#endif // MAIL_H
|
#endif // MAIL_H
|
||||||
|
|||||||
+15
-25
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MEMO_H
|
#ifndef MEMO_H
|
||||||
@@ -17,49 +16,40 @@
|
|||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
|
|
||||||
/** Memo Flags
|
class CoreExport Memo : public Serializable
|
||||||
*/
|
|
||||||
enum MemoFlag
|
|
||||||
{
|
|
||||||
/* Memo is unread */
|
|
||||||
MF_UNREAD,
|
|
||||||
/* Sender requests a receipt */
|
|
||||||
MF_RECEIPT
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string MemoFlagStrings[] = {
|
|
||||||
"MF_UNREAD", "MF_RECEIPT", ""
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Memo info structures. Since both nicknames and channels can have memos,
|
|
||||||
* we encapsulate memo data in a MemoList to make it easier to handle. */
|
|
||||||
class CoreExport Memo : public Flags<MemoFlag>, public Serializable
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
bool unread;
|
||||||
|
bool receipt;
|
||||||
Memo();
|
Memo();
|
||||||
|
~Memo();
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
void Serialize(Serialize::Data &data) const anope_override;
|
||||||
Serialize::Data serialize() const anope_override;
|
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
|
||||||
|
|
||||||
Anope::string owner;
|
Anope::string owner;
|
||||||
time_t time; /* When it was sent */
|
/* When it was sent */
|
||||||
|
time_t time;
|
||||||
Anope::string sender;
|
Anope::string sender;
|
||||||
Anope::string text;
|
Anope::string text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Memo info structures. Since both nicknames and channels can have memos,
|
||||||
|
* we encapsulate memo data in a MemoInfo to make it easier to handle.
|
||||||
|
*/
|
||||||
struct CoreExport MemoInfo
|
struct CoreExport MemoInfo
|
||||||
{
|
{
|
||||||
int16_t memomax;
|
int16_t memomax;
|
||||||
serialize_checker<std::vector<Memo *> > memos;
|
Serialize::Checker<std::vector<Memo *> > memos;
|
||||||
std::vector<Anope::string> ignores;
|
std::vector<Anope::string> ignores;
|
||||||
|
|
||||||
MemoInfo();
|
MemoInfo();
|
||||||
Memo *GetMemo(unsigned index) const;
|
Memo *GetMemo(unsigned index) const;
|
||||||
unsigned GetIndex(Memo *m) const;
|
unsigned GetIndex(Memo *m) const;
|
||||||
void Del(unsigned index);
|
void Del(unsigned index);
|
||||||
void Del(Memo *m);
|
|
||||||
bool HasIgnore(User *u);
|
bool HasIgnore(User *u);
|
||||||
|
|
||||||
|
static MemoInfo *GetMemoInfo(const Anope::string &targ, bool &is_chan);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MEMO_H
|
#endif // MEMO_H
|
||||||
|
|||||||
@@ -0,0 +1,175 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "protocol.h"
|
||||||
|
|
||||||
|
/* Common IRCD messages.
|
||||||
|
* Protocol modules may chose to include some, none, or all of these handlers
|
||||||
|
* as they see fit.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Message
|
||||||
|
{
|
||||||
|
|
||||||
|
struct CoreExport Away : IRCDMessage
|
||||||
|
{
|
||||||
|
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Capab : IRCDMessage
|
||||||
|
{
|
||||||
|
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Error : IRCDMessage
|
||||||
|
{
|
||||||
|
Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Invite : IRCDMessage
|
||||||
|
{
|
||||||
|
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Join : IRCDMessage
|
||||||
|
{
|
||||||
|
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
|
||||||
|
typedef std::pair<ChannelStatus, User *> SJoinUser;
|
||||||
|
|
||||||
|
/** Handle a SJOIN.
|
||||||
|
* @param source The source of the SJOIN
|
||||||
|
* @param chan The channel the users are joining to
|
||||||
|
* @param ts The TS for the channel
|
||||||
|
* @param modes The modes sent with the SJOIN, if any
|
||||||
|
* @param users The users and their status, if any
|
||||||
|
*/
|
||||||
|
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Kick : IRCDMessage
|
||||||
|
{
|
||||||
|
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Kill : IRCDMessage
|
||||||
|
{
|
||||||
|
Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Mode : IRCDMessage
|
||||||
|
{
|
||||||
|
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport MOTD : IRCDMessage
|
||||||
|
{
|
||||||
|
MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Notice : IRCDMessage
|
||||||
|
{
|
||||||
|
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Part : IRCDMessage
|
||||||
|
{
|
||||||
|
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Ping : IRCDMessage
|
||||||
|
{
|
||||||
|
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Privmsg : IRCDMessage
|
||||||
|
{
|
||||||
|
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Quit : IRCDMessage
|
||||||
|
{
|
||||||
|
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport SQuit : IRCDMessage
|
||||||
|
{
|
||||||
|
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Stats : IRCDMessage
|
||||||
|
{
|
||||||
|
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Time : IRCDMessage
|
||||||
|
{
|
||||||
|
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Topic : IRCDMessage
|
||||||
|
{
|
||||||
|
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Version : IRCDMessage
|
||||||
|
{
|
||||||
|
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CoreExport Whois : IRCDMessage
|
||||||
|
{
|
||||||
|
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||||
|
|
||||||
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Message
|
||||||
|
|
||||||
+177
-270
@@ -1,7 +1,7 @@
|
|||||||
/* Mode support
|
/* Mode support
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
||||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
* Copyright (C) 2008-2014 Anope Team <team@anope.org>
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
*/
|
*/
|
||||||
@@ -12,81 +12,6 @@
|
|||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
|
|
||||||
/** All of the valid user mode names
|
|
||||||
*/
|
|
||||||
enum UserModeName
|
|
||||||
{
|
|
||||||
UMODE_BEGIN,
|
|
||||||
|
|
||||||
UMODE_SERV_ADMIN, UMODE_BOT, UMODE_CO_ADMIN, UMODE_FILTER, UMODE_HIDEOPER, UMODE_NETADMIN,
|
|
||||||
UMODE_REGPRIV, UMODE_PROTECTED, UMODE_NOCTCP, UMODE_WEBTV, UMODE_WEBIRC, UMODE_WHOIS, UMODE_ADMIN, UMODE_DEAF,
|
|
||||||
UMODE_GLOBOPS, UMODE_HELPOP, UMODE_INVIS, UMODE_OPER, UMODE_PRIV, UMODE_GOD, UMODE_REGISTERED,
|
|
||||||
UMODE_SNOMASK, UMODE_VHOST, UMODE_WALLOPS, UMODE_CLOAK, UMODE_SSL, UMODE_SOFTCALLERID, UMODE_CALLERID,
|
|
||||||
UMODE_COMMONCHANS, UMODE_HIDDEN, UMODE_STRIPCOLOR, UMODE_INVISIBLE_OPER, UMODE_RESTRICTED, UMODE_HIDEIDLE,
|
|
||||||
|
|
||||||
UMODE_END
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string UserModeNameStrings[] = {
|
|
||||||
"UMODE_BEGIN",
|
|
||||||
|
|
||||||
"UMODE_SERV_ADMIN", "UMODE_BOT", "UMODE_CO_ADMIN", "UMODE_FILTER", "UMODE_HIDEOPER", "UMODE_NETADMIN",
|
|
||||||
"UMODE_REGPRIV", "UMODE_PROTECTED", "UMODE_NOCTCP", "UMODE_WEBTV", "UMODE_WEBIRC", "UMODE_WHOIS", "UMODE_ADMIN", "UMODE_DEAF",
|
|
||||||
"UMODE_GLOBOPS", "UMODE_HELPOP", "UMODE_INVIS", "UMODE_OPER", "UMODE_PRIV", "UMODE_GOD", "UMODE_REGISTERED",
|
|
||||||
"UMODE_SNOMASK", "UMODE_VHOST", "UMODE_WALLOPS", "UMODE_CLOAK", "UMODE_SSL", "UMODE_SOFTCALLERID", "UMODE_CALLERID",
|
|
||||||
"UMODE_COMMONCHANS", "UMODE_HIDDEN", "UMODE_STRIPCOLOR", "UMODE_INVISIBLE_OPER", "UMODE_RESTRICTED", "UMODE_HIDEIDLE",
|
|
||||||
|
|
||||||
""
|
|
||||||
};
|
|
||||||
|
|
||||||
/** All of the valid channel mode names
|
|
||||||
*/
|
|
||||||
enum ChannelModeName
|
|
||||||
{
|
|
||||||
CMODE_BEGIN,
|
|
||||||
|
|
||||||
/* Channel modes */
|
|
||||||
CMODE_BLOCKCOLOR, CMODE_FLOOD, CMODE_INVITE, CMODE_KEY, CMODE_LIMIT, CMODE_MODERATED, CMODE_NOEXTERNAL,
|
|
||||||
CMODE_PRIVATE, CMODE_REGISTERED, CMODE_SECRET, CMODE_TOPIC, CMODE_AUDITORIUM, CMODE_SSL, CMODE_ADMINONLY,
|
|
||||||
CMODE_NOCTCP, CMODE_FILTER, CMODE_NOKNOCK, CMODE_REDIRECT, CMODE_REGMODERATED, CMODE_NONICK, CMODE_OPERONLY,
|
|
||||||
CMODE_NOKICK, CMODE_REGISTEREDONLY, CMODE_STRIPCOLOR, CMODE_NONOTICE, CMODE_NOINVITE, CMODE_ALLINVITE,
|
|
||||||
CMODE_BLOCKCAPS, CMODE_PERM, CMODE_NICKFLOOD, CMODE_JOINFLOOD, CMODE_DELAYEDJOIN, CMODE_NOREJOIN,
|
|
||||||
CMODE_BANDWIDTH,
|
|
||||||
|
|
||||||
/* b/e/I */
|
|
||||||
CMODE_BAN, CMODE_EXCEPT,
|
|
||||||
CMODE_INVITEOVERRIDE,
|
|
||||||
|
|
||||||
/* v/h/o/a/q */
|
|
||||||
CMODE_VOICE, CMODE_HALFOP, CMODE_OP,
|
|
||||||
CMODE_PROTECT, CMODE_OWNER,
|
|
||||||
|
|
||||||
CMODE_END
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string ChannelModeNameStrings[] = {
|
|
||||||
"CMODE_BEGIN",
|
|
||||||
|
|
||||||
/* Channel modes */
|
|
||||||
"CMODE_BLOCKCOLOR", "CMODE_FLOOD", "CMODE_INVITE", "CMODE_KEY", "CMODE_LIMIT", "CMODE_MODERATED", "CMODE_NOEXTERNAL",
|
|
||||||
"CMODE_PRIVATE", "CMODE_REGISTERED", "CMODE_SECRET", "CMODE_TOPIC", "CMODE_AUDITORIUM", "CMODE_SSL", "CMODE_ADMINONLY",
|
|
||||||
"CMODE_NOCTCP", "CMODE_FILTER", "CMODE_NOKNOCK", "CMODE_REDIRECT", "CMODE_REGMODERATED", "CMODE_NONICK", "CMODE_OPERONLY",
|
|
||||||
"CMODE_NOKICK", "CMODE_REGISTEREDONLY", "CMODE_STRIPCOLOR", "CMODE_NONOTICE", "CMODE_NOINVITE", "CMODE_ALLINVITE",
|
|
||||||
"CMODE_BLOCKCAPS", "CMODE_PERM", "CMODE_NICKFLOOD", "CMODE_JOINFLOOD", "CMODE_DELAYEDJOIN", "CMODE_NOREJOIN",
|
|
||||||
"CMODE_BANDWIDTH",
|
|
||||||
|
|
||||||
/* b/e/I */
|
|
||||||
"CMODE_BAN", "CMODE_EXCEPT",
|
|
||||||
"CMODE_INVITEOVERRIDE",
|
|
||||||
|
|
||||||
/* v/h/o/a/q */
|
|
||||||
"CMODE_VOICE", "CMODE_HALFOP", "CMODE_OP",
|
|
||||||
"CMODE_PROTECT", "CMODE_OWNER",
|
|
||||||
|
|
||||||
""
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/** The different types of modes
|
/** The different types of modes
|
||||||
*/
|
*/
|
||||||
enum ModeType
|
enum ModeType
|
||||||
@@ -105,9 +30,7 @@ enum ModeType
|
|||||||
*/
|
*/
|
||||||
enum ModeClass
|
enum ModeClass
|
||||||
{
|
{
|
||||||
/* Channel mode */
|
|
||||||
MC_CHANNEL,
|
MC_CHANNEL,
|
||||||
/* User mode */
|
|
||||||
MC_USER
|
MC_USER
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,23 +39,28 @@ enum ModeClass
|
|||||||
class CoreExport Mode : public Base
|
class CoreExport Mode : public Base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* Class of mode this is */
|
/* Mode name */
|
||||||
ModeClass Class;
|
Anope::string name;
|
||||||
/* Mode char for this */
|
/* Class of mode this is (user/channel) */
|
||||||
char ModeChar;
|
ModeClass mclass;
|
||||||
/* Type of mode this is */
|
/* Mode char for this, eg 'b' */
|
||||||
ModeType Type;
|
char mchar;
|
||||||
|
/* Type of mode this is, eg MODE_LIST */
|
||||||
|
ModeType type;
|
||||||
|
|
||||||
/** Default constructor
|
/** constructor
|
||||||
* @param mClass The type of mode this is
|
* @param mname The mode name
|
||||||
* @param modeChar The mode char
|
* @param mclass The type of mode this is
|
||||||
|
* @param mc The mode char
|
||||||
* @param type The mode type
|
* @param type The mode type
|
||||||
*/
|
*/
|
||||||
Mode(ModeClass mClass, char modeChar, ModeType type);
|
Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type);
|
||||||
|
|
||||||
/** Default destructor
|
|
||||||
*/
|
|
||||||
virtual ~Mode();
|
virtual ~Mode();
|
||||||
|
|
||||||
|
/** Can a user set this mode, used for mlock
|
||||||
|
* @param u The user
|
||||||
|
*/
|
||||||
|
virtual bool CanSet(User *u) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This class is a user mode, all user modes use this/inherit from this
|
/** This class is a user mode, all user modes use this/inherit from this
|
||||||
@@ -140,38 +68,27 @@ class CoreExport Mode : public Base
|
|||||||
class CoreExport UserMode : public Mode
|
class CoreExport UserMode : public Mode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* Mode name */
|
/** constructor
|
||||||
UserModeName Name;
|
* @param name The mode name
|
||||||
|
* @param mc The mode char
|
||||||
/** Default constructor
|
|
||||||
* @param nName The mode name
|
|
||||||
* @param modeChar The mode char
|
|
||||||
*/
|
*/
|
||||||
UserMode(UserModeName mName, char modeChar);
|
UserMode(const Anope::string &name, char mc);
|
||||||
|
|
||||||
/** Default destructor
|
|
||||||
*/
|
|
||||||
virtual ~UserMode();
|
|
||||||
|
|
||||||
/** Returns the mode name as a string
|
|
||||||
*/
|
|
||||||
const Anope::string NameAsString();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport UserModeParam : public UserMode
|
class CoreExport UserModeParam : public UserMode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Default constructor
|
/** constructor
|
||||||
* @param mName The mode name
|
* @param name The mode name
|
||||||
* @param modeChar The mode char
|
* @param mc The mode char
|
||||||
*/
|
*/
|
||||||
UserModeParam(UserModeName mName, char modeChar);
|
UserModeParam(const Anope::string &name, char mc);
|
||||||
|
|
||||||
/** Check if the param is valid
|
/** Check if the param is valid
|
||||||
* @param value The param
|
* @param value The param
|
||||||
* @return true or false
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
virtual bool IsValid(const Anope::string &value) const { return true; }
|
virtual bool IsValid(Anope::string &value) const { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This class is a channel mode, all channel modes use this/inherit from this
|
/** This class is a channel mode, all channel modes use this/inherit from this
|
||||||
@@ -179,51 +96,48 @@ class CoreExport UserModeParam : public UserMode
|
|||||||
class CoreExport ChannelMode : public Mode
|
class CoreExport ChannelMode : public Mode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* Mode name */
|
/* channel modes that can posssibly unwrap this mode */
|
||||||
ChannelModeName Name;
|
std::vector<ChannelMode *> listeners;
|
||||||
|
|
||||||
/** Default constructor
|
/** constructor
|
||||||
* @param mName The mode name
|
* @param name The mode name
|
||||||
* @param modeChar The mode char
|
* @param mc The mode char
|
||||||
*/
|
*/
|
||||||
ChannelMode(ChannelModeName mName, char modeChar);
|
ChannelMode(const Anope::string &name, char mc);
|
||||||
|
|
||||||
/** Default destructor
|
bool CanSet(User *u) const anope_override;
|
||||||
*/
|
|
||||||
virtual ~ChannelMode();
|
|
||||||
|
|
||||||
/** Can a user set this mode, used for mlock
|
virtual void Check() { }
|
||||||
* NOTE: User CAN be NULL, this is for checking if it can be locked with defcon
|
|
||||||
* @param u The user, or NULL
|
|
||||||
*/
|
|
||||||
virtual bool CanSet(User *u) const;
|
|
||||||
|
|
||||||
/** Returns the mode name as a string
|
/** 'wrap' this channel mode and param to the underlying mode and param
|
||||||
*/
|
*/
|
||||||
const Anope::string NameAsString();
|
virtual ChannelMode *Wrap(Anope::string ¶m);
|
||||||
|
|
||||||
|
/** 'unwrap' this mode to our internal representation
|
||||||
|
*/
|
||||||
|
ChannelMode *Unwrap(Anope::string ¶m);
|
||||||
|
|
||||||
|
/** called when a mode is being unwrapped, and is asking us if we can unwrap it
|
||||||
|
*/
|
||||||
|
virtual ChannelMode *Unwrap(ChannelMode *, Anope::string ¶m);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** This is a mode for lists, eg b/e/I. These modes should inherit from this
|
/** 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:
|
||||||
/** Default constructor
|
/** constructor
|
||||||
* @param mName The mode name
|
* @param name The mode name
|
||||||
* @param modeChar The mode char
|
* @param mc The mode char
|
||||||
*/
|
*/
|
||||||
ChannelModeList(ChannelModeName mName, char modeChar);
|
ChannelModeList(const Anope::string &name, char mc);
|
||||||
|
|
||||||
/** Default destructor
|
|
||||||
*/
|
|
||||||
virtual ~ChannelModeList();
|
|
||||||
|
|
||||||
/** Is the mask valid
|
/** Is the mask valid
|
||||||
* @param mask The mask
|
* @param mask The mask
|
||||||
* @return true for yes, false for no
|
* @return true for yes, false for no
|
||||||
*/
|
*/
|
||||||
virtual bool IsValid(const Anope::string &mask) const { return true; }
|
virtual bool IsValid(Anope::string &mask) const;
|
||||||
|
|
||||||
/** Checks if mask affects user
|
/** Checks if mask affects user
|
||||||
* Should only be used for extbans or other weird ircd-specific things.
|
* Should only be used for extbans or other weird ircd-specific things.
|
||||||
@@ -231,7 +145,7 @@ class CoreExport ChannelModeList : public ChannelMode
|
|||||||
* @param e The entry to match against
|
* @param e The entry to match against
|
||||||
* @return true on match
|
* @return true on match
|
||||||
*/
|
*/
|
||||||
virtual bool Matches(const User *u, const Entry *e) { return false; }
|
virtual bool Matches(User *u, const Entry *e) { return false; }
|
||||||
|
|
||||||
/** Called when a mask is added to a channel
|
/** Called when a mask is added to a channel
|
||||||
* @param chan The channel
|
* @param chan The channel
|
||||||
@@ -251,25 +165,21 @@ class CoreExport ChannelModeList : public ChannelMode
|
|||||||
class CoreExport ChannelModeParam : public ChannelMode
|
class CoreExport ChannelModeParam : public ChannelMode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Default constructor
|
/** constructor
|
||||||
* @param mName The mode name
|
* @param name The mode name
|
||||||
* @param modeChar The mode char
|
* @param mc The mode char
|
||||||
* @param MinusArg true if this mode sends no arg when unsetting
|
* @param minus_no_arg true if this mode sends no arg when unsetting
|
||||||
*/
|
*/
|
||||||
ChannelModeParam(ChannelModeName mName, char modeChar, bool MinusArg = false);
|
ChannelModeParam(const Anope::string &name, char mc, bool minus_no_arg = false);
|
||||||
|
|
||||||
/** Default destructor
|
|
||||||
*/
|
|
||||||
virtual ~ChannelModeParam();
|
|
||||||
|
|
||||||
/* Should we send an arg when unsetting this mode? */
|
/* Should we send an arg when unsetting this mode? */
|
||||||
bool MinusNoArg;
|
bool minus_no_arg;
|
||||||
|
|
||||||
/** Is the param valid
|
/** Is the param valid
|
||||||
* @param value The param
|
* @param value The param
|
||||||
* @return true for yes, false for no
|
* @return true for yes, false for no
|
||||||
*/
|
*/
|
||||||
virtual bool IsValid(const Anope::string &value) const { return true; }
|
virtual bool IsValid(Anope::string &value) const { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This is a mode that is a channel status, eg +v/h/o/a/q.
|
/** This is a mode that is a channel status, eg +v/h/o/a/q.
|
||||||
@@ -278,23 +188,72 @@ class CoreExport ChannelModeStatus : public ChannelMode
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* The symbol, eg @ % + */
|
/* The symbol, eg @ % + */
|
||||||
char Symbol;
|
char symbol;
|
||||||
/* The "level" of the mode, used to compare with other modes.
|
/* The "level" of the mode, used to compare with other modes.
|
||||||
* Used so we know op > halfop > voice etc.
|
* Used so we know op > halfop > voice etc.
|
||||||
*/
|
*/
|
||||||
unsigned short Level;
|
short level;
|
||||||
|
|
||||||
/** Default constructor
|
/** constructor
|
||||||
* @param mName The mode name
|
* @param name The mode name
|
||||||
* @param modeChar The mode char
|
* @param mc The mode char
|
||||||
* @param mSymbol The symbol for the mode, eg @ %
|
* @param msymbol The symbol for the mode, eg @ %
|
||||||
* @param mLevel A level for the mode, which is usually determined by the PREFIX capab
|
* @param mlevel A level for the mode, which is usually determined by the PREFIX capab
|
||||||
*/
|
*/
|
||||||
ChannelModeStatus(ChannelModeName mName, char modeChar, char mSymbol, unsigned short mLevel = 0);
|
ChannelModeStatus(const Anope::string &name, char mc, char msymbol, short mlevel);
|
||||||
|
};
|
||||||
|
|
||||||
/** Default destructor
|
/** A virtual mode. This mode doesn't natively exist on the IRCd (like extbans),
|
||||||
*/
|
* but we still have a representation for it.
|
||||||
virtual ~ChannelModeStatus();
|
*/
|
||||||
|
template<typename T>
|
||||||
|
class CoreExport ChannelModeVirtual : public T
|
||||||
|
{
|
||||||
|
Anope::string base;
|
||||||
|
ChannelMode *basech;
|
||||||
|
|
||||||
|
public:
|
||||||
|
ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename);
|
||||||
|
|
||||||
|
~ChannelModeVirtual();
|
||||||
|
|
||||||
|
void Check() anope_override;
|
||||||
|
|
||||||
|
ChannelMode *Wrap(Anope::string ¶m) anope_override;
|
||||||
|
|
||||||
|
ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The status a user has on a channel (+v, +h, +o) etc */
|
||||||
|
class CoreExport ChannelStatus
|
||||||
|
{
|
||||||
|
Anope::string modes;
|
||||||
|
public:
|
||||||
|
ChannelStatus();
|
||||||
|
ChannelStatus(const Anope::string &modes);
|
||||||
|
void AddMode(char c);
|
||||||
|
void DelMode(char c);
|
||||||
|
bool HasMode(char c) const;
|
||||||
|
bool Empty() const;
|
||||||
|
void Clear();
|
||||||
|
const Anope::string &Modes() const;
|
||||||
|
Anope::string BuildModePrefixList() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CoreExport UserModeOperOnly : public UserMode
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { }
|
||||||
|
|
||||||
|
bool CanSet(User *u) const anope_override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CoreExport UserModeNoone : public UserMode
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { }
|
||||||
|
|
||||||
|
bool CanSet(User *u) const anope_override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Channel mode +k (key)
|
/** Channel mode +k (key)
|
||||||
@@ -302,88 +261,45 @@ class CoreExport ChannelModeStatus : public ChannelMode
|
|||||||
class CoreExport ChannelModeKey : public ChannelModeParam
|
class CoreExport ChannelModeKey : public ChannelModeParam
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChannelModeKey(char modeChar) : ChannelModeParam(CMODE_KEY, modeChar) { }
|
ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { }
|
||||||
|
|
||||||
bool IsValid(const Anope::string &value) const anope_override;
|
bool IsValid(Anope::string &value) const anope_override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This class is used for channel mode +A (Admin only)
|
/** This class is used for oper only channel modes
|
||||||
* Only opers can mlock it
|
|
||||||
*/
|
*/
|
||||||
class CoreExport ChannelModeAdmin : public ChannelMode
|
class CoreExport ChannelModeOperOnly : public ChannelMode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChannelModeAdmin(char modeChar) : ChannelMode(CMODE_ADMINONLY, modeChar) { }
|
ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
|
||||||
|
|
||||||
/* Opers only */
|
/* Opers only */
|
||||||
bool CanSet(User *u) const anope_override;
|
bool CanSet(User *u) const anope_override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This class is used for channel mode +O (Opers only)
|
/** This class is used for channel modes only servers may set
|
||||||
* Only opers can mlock it
|
|
||||||
*/
|
*/
|
||||||
class CoreExport ChannelModeOper : public ChannelMode
|
class CoreExport ChannelModeNoone : public ChannelMode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChannelModeOper(char modeChar) : ChannelMode(CMODE_OPERONLY, modeChar) { }
|
ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
|
||||||
|
|
||||||
/* Opers only */
|
|
||||||
bool CanSet(User *u) const anope_override;
|
bool CanSet(User *u) const anope_override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This class is used for channel mode +r (registered channel)
|
/** This is the mode manager
|
||||||
* No one may mlock r
|
|
||||||
*/
|
|
||||||
class CoreExport ChannelModeRegistered : public ChannelMode
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ChannelModeRegistered(char modeChar) : ChannelMode(CMODE_REGISTERED, modeChar) { }
|
|
||||||
|
|
||||||
/* No one mlocks +r */
|
|
||||||
bool CanSet(User *u) const anope_override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class StackerInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/* Modes to be added */
|
|
||||||
std::list<std::pair<Mode *, Anope::string> > AddModes;
|
|
||||||
/* Modes to be deleted */
|
|
||||||
std::list<std::pair<Mode *, Anope::string> > DelModes;
|
|
||||||
/* Bot this is sent from */
|
|
||||||
const BotInfo *bi;
|
|
||||||
|
|
||||||
/** Add a mode to this object
|
|
||||||
* @param mode The mode
|
|
||||||
* @param Set true if setting, false if unsetting
|
|
||||||
* @param Param The param for the mode
|
|
||||||
*/
|
|
||||||
void AddMode(Mode *mode, bool Set, const Anope::string &Param);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** This is mode manager
|
|
||||||
* It contains functions for adding modes to Anope so Anope can track them
|
* It contains functions for adding modes to Anope so Anope can track them
|
||||||
* and do things such as MLOCK.
|
* and do things such as MLOCK.
|
||||||
* This also contains a mode stacker that will combine multiple modes and set
|
* This also contains a mode stacker that will combine multiple modes and set
|
||||||
* them on a channel all at once
|
* them on a channel or user at once
|
||||||
*/
|
*/
|
||||||
class CoreExport ModeManager
|
class CoreExport ModeManager
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
/* List of pairs of user/channels and their stacker info */
|
|
||||||
static std::map<User *, StackerInfo *> UserStackerObjects;
|
|
||||||
static std::map<Channel *, StackerInfo *> ChannelStackerObjects;
|
|
||||||
|
|
||||||
/** Build a list of mode strings to send to the IRCd from the mode stacker
|
|
||||||
* @param info The stacker info for a channel or user
|
|
||||||
* @return a list of strings
|
|
||||||
*/
|
|
||||||
static std::list<Anope::string> BuildModeStrings(StackerInfo *info);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* List of all modes Anope knows about */
|
|
||||||
static std::vector<ChannelMode *> ChannelModes;
|
/* Number of generic channel and user modes we are tracking */
|
||||||
static std::vector<UserMode *> UserModes;
|
static unsigned GenericChannelModes;
|
||||||
|
static unsigned GenericUserModes;
|
||||||
|
|
||||||
/** Add a user mode to Anope
|
/** Add a user mode to Anope
|
||||||
* @param um A UserMode or UserMode derived class
|
* @param um A UserMode or UserMode derived class
|
||||||
@@ -397,118 +313,109 @@ class CoreExport ModeManager
|
|||||||
*/
|
*/
|
||||||
static bool AddChannelMode(ChannelMode *cm);
|
static bool AddChannelMode(ChannelMode *cm);
|
||||||
|
|
||||||
/** Find a channel mode
|
/** Remove a user mode from Anope
|
||||||
* @param Mode The mode
|
* @param um A UserMode to remove
|
||||||
* @return The mode class
|
|
||||||
*/
|
*/
|
||||||
static ChannelMode *FindChannelModeByChar(char Mode);
|
static void RemoveUserMode(UserMode *um);
|
||||||
|
|
||||||
/** Find a user mode
|
/** Remove a channel mode from Anope
|
||||||
* @param Mode The mode
|
* @param um A ChanneMode to remove
|
||||||
* @return The mode class
|
|
||||||
*/
|
*/
|
||||||
static UserMode *FindUserModeByChar(char Mode);
|
static void RemoveChannelMode(ChannelMode *cm);
|
||||||
|
|
||||||
/** Find a channel mode
|
/** Find a channel mode
|
||||||
* @param Mode The modename
|
* @param mode The mode
|
||||||
* @return The mode class
|
* @return The mode class
|
||||||
*/
|
*/
|
||||||
static ChannelMode *FindChannelModeByName(ChannelModeName Name);
|
static ChannelMode *FindChannelModeByChar(char mode);
|
||||||
|
|
||||||
/** Find a user mode
|
/** Find a user mode
|
||||||
* @param Mode The modename
|
* @param mode The mode
|
||||||
* @return The mode class
|
* @return The mode class
|
||||||
*/
|
*/
|
||||||
static UserMode *FindUserModeByName(UserModeName Name);
|
static UserMode *FindUserModeByChar(char mode);
|
||||||
|
|
||||||
/** Find channel mode by string
|
/** Find a channel mode
|
||||||
* @param name The mode name
|
* @param name The modename
|
||||||
* @return The mode
|
* @return The mode class
|
||||||
*/
|
*/
|
||||||
static ChannelMode *FindChannelModeByString(const Anope::string &name);
|
static ChannelMode *FindChannelModeByName(const Anope::string &name);
|
||||||
|
|
||||||
/** Find user mode by string
|
/** Find a user mode
|
||||||
* @param name The mode name
|
* @param name The modename
|
||||||
* @return The mode
|
* @return The mode class
|
||||||
*/
|
*/
|
||||||
static UserMode *FindUserModeByString(const Anope::string &name);
|
static UserMode *FindUserModeByName(const Anope::string &name);
|
||||||
|
|
||||||
/** Gets the channel mode char for a symbol (eg + returns v)
|
/** Gets the channel mode char for a symbol (eg + returns v)
|
||||||
* @param Value The symbol
|
* @param symbol The symbol
|
||||||
* @return The char
|
* @return The char
|
||||||
*/
|
*/
|
||||||
static char GetStatusChar(char Value);
|
static char GetStatusChar(char symbol);
|
||||||
|
|
||||||
|
static const std::vector<ChannelMode *> &GetChannelModes();
|
||||||
|
static const std::vector<UserMode *> &GetUserModes();
|
||||||
|
static const std::vector<ChannelModeStatus *> &GetStatusChannelModesByRank();
|
||||||
|
static void RebuildStatusModes();
|
||||||
|
|
||||||
/** Add a mode to the stacker to be set on a channel
|
/** Add a mode to the stacker to be set on a channel
|
||||||
* @param bi The client to set the modes from
|
* @param bi The client to set the modes from
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
* @param cm The channel mode
|
* @param cm The channel mode
|
||||||
* @param Set true for setting, false for removing
|
* @param set true for setting, false for removing
|
||||||
* @param Param The param, if there is one
|
* @param param The param, if there is one
|
||||||
*/
|
*/
|
||||||
static void StackerAdd(const BotInfo *bi, Channel *c, ChannelMode *cm, bool Set, const Anope::string &Param = "");
|
static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string ¶m = "");
|
||||||
|
|
||||||
/** Add a mode to the stacker to be set on a user
|
/** Add a mode to the stacker to be set on a user
|
||||||
* @param bi The client to set the modes from
|
* @param bi The client to set the modes from
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param um The user mode
|
* @param um The user mode
|
||||||
* @param Set true for setting, false for removing
|
* @param set true for setting, false for removing
|
||||||
* @param param The param, if there is one
|
* @param param The param, if there is one
|
||||||
*/
|
*/
|
||||||
static void StackerAdd(const BotInfo *bi, User *u, UserMode *um, bool Set, const Anope::string &Param = "");
|
static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string ¶m = "");
|
||||||
|
|
||||||
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
|
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
|
||||||
*/
|
*/
|
||||||
static void ProcessModes();
|
static void ProcessModes();
|
||||||
|
|
||||||
/** Delete a user or channel from the stacker
|
/** Delete a user, channel, or mode from the stacker
|
||||||
*/
|
*/
|
||||||
static void StackerDel(User *u);
|
static void StackerDel(User *u);
|
||||||
static void StackerDel(Channel *c);
|
static void StackerDel(Channel *c);
|
||||||
};
|
static void StackerDel(Mode *m);
|
||||||
|
|
||||||
/** Entry flags
|
|
||||||
*/
|
|
||||||
enum EntryType
|
|
||||||
{
|
|
||||||
ENTRYTYPE_NONE,
|
|
||||||
ENTRYTYPE_CIDR,
|
|
||||||
ENTRYTYPE_NICK_WILD,
|
|
||||||
ENTRYTYPE_NICK,
|
|
||||||
ENTRYTYPE_USER_WILD,
|
|
||||||
ENTRYTYPE_USER,
|
|
||||||
ENTRYTYPE_HOST_WILD,
|
|
||||||
ENTRYTYPE_HOST
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Represents a mask set on a channel (b/e/I)
|
/** Represents a mask set on a channel (b/e/I)
|
||||||
*/
|
*/
|
||||||
class CoreExport Entry : public Flags<EntryType>
|
class CoreExport Entry
|
||||||
{
|
{
|
||||||
ChannelModeName modename;
|
Anope::string name;
|
||||||
|
|
||||||
public:
|
|
||||||
unsigned char cidr_len;
|
|
||||||
Anope::string mask;
|
Anope::string mask;
|
||||||
Anope::string nick, user, host;
|
public:
|
||||||
|
unsigned short cidr_len;
|
||||||
|
Anope::string nick, user, host, real;
|
||||||
|
|
||||||
/** Constructor
|
/** Constructor
|
||||||
* @param _host A full nick!ident@host/cidr mask
|
* @param mode What mode this host is for, can be empty for unknown/no mode
|
||||||
* @param mode What mode this host is for - can be CMODE_BEGIN for unknown/no mode
|
* @param host A full or poartial nick!ident@host/cidr#real name mask
|
||||||
*/
|
*/
|
||||||
Entry(ChannelModeName mode, const Anope::string &_host);
|
Entry(const Anope::string &mode, const Anope::string &host);
|
||||||
|
|
||||||
/** Get the banned mask for this entry
|
/** Get the banned mask for this entry
|
||||||
* @return The mask
|
* @return The mask
|
||||||
*/
|
*/
|
||||||
const Anope::string GetMask();
|
const Anope::string GetMask() const;
|
||||||
|
|
||||||
|
const Anope::string GetNUHMask() const;
|
||||||
|
|
||||||
/** Check if this entry matches a user
|
/** Check if this entry matches a user
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param full True to match against a users real host and IP
|
* @param full True to match against a users real host and IP
|
||||||
* @return true on match
|
* @return true on match
|
||||||
*/
|
*/
|
||||||
bool Matches(const User *u, bool full = false) const;
|
bool Matches(User *u, bool full = false) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MODES_H
|
#endif // MODES_H
|
||||||
|
|||||||
+7
-10
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -12,28 +12,24 @@
|
|||||||
#ifndef MODULE_H
|
#ifndef MODULE_H
|
||||||
#define MODULE_H
|
#define MODULE_H
|
||||||
|
|
||||||
/* Just include everything for now */
|
|
||||||
#include "access.h"
|
#include "access.h"
|
||||||
#include "account.h"
|
#include "account.h"
|
||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
#include "bots.h"
|
#include "bots.h"
|
||||||
#include "botserv.h"
|
|
||||||
#include "channels.h"
|
#include "channels.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "dns.h"
|
|
||||||
#include "extensible.h"
|
#include "extensible.h"
|
||||||
#include "extern.h"
|
|
||||||
#include "hashcomp.h"
|
#include "hashcomp.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "lists.h"
|
#include "lists.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "mail.h"
|
#include "mail.h"
|
||||||
#include "memo.h"
|
#include "memo.h"
|
||||||
|
#include "messages.h"
|
||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
#include "oper.h"
|
|
||||||
#include "opertype.h"
|
#include "opertype.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
#include "regexpr.h"
|
#include "regexpr.h"
|
||||||
@@ -42,16 +38,17 @@
|
|||||||
#include "servers.h"
|
#include "servers.h"
|
||||||
#include "service.h"
|
#include "service.h"
|
||||||
#include "services.h"
|
#include "services.h"
|
||||||
#include "signals.h"
|
|
||||||
#include "socketengine.h"
|
#include "socketengine.h"
|
||||||
#include "sockets.h"
|
#include "sockets.h"
|
||||||
#include "threadengine.h"
|
#include "threadengine.h"
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
#include "uplink.h"
|
#include "uplink.h"
|
||||||
#include "users.h"
|
#include "users.h"
|
||||||
|
#include "xline.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "modules/pseudoclients/chanserv.h"
|
||||||
#include "memoserv.h"
|
#include "modules/pseudoclients/global.h"
|
||||||
#include "nickserv.h"
|
#include "modules/pseudoclients/memoserv.h"
|
||||||
|
#include "modules/pseudoclients/nickserv.h"
|
||||||
|
|
||||||
#endif // MODULE_H
|
#endif // MODULE_H
|
||||||
|
|||||||
+420
-327
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
|||||||
|
/* BotServ core functions
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Flags for badwords
|
||||||
|
*/
|
||||||
|
enum BadWordType
|
||||||
|
{
|
||||||
|
/* Always kicks if the word is said */
|
||||||
|
BW_ANY,
|
||||||
|
/* User must way the entire word */
|
||||||
|
BW_SINGLE,
|
||||||
|
/* The word has to start with the badword */
|
||||||
|
BW_START,
|
||||||
|
/* The word has to end with the badword */
|
||||||
|
BW_END
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Structure used to contain bad words. */
|
||||||
|
struct BadWord
|
||||||
|
{
|
||||||
|
Anope::string chan;
|
||||||
|
Anope::string word;
|
||||||
|
BadWordType type;
|
||||||
|
|
||||||
|
virtual ~BadWord() { }
|
||||||
|
protected:
|
||||||
|
BadWord() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BadWords
|
||||||
|
{
|
||||||
|
virtual ~BadWords() { }
|
||||||
|
|
||||||
|
/** Add a badword to the badword list
|
||||||
|
* @param word The badword
|
||||||
|
* @param type The type (SINGLE START END)
|
||||||
|
* @return The badword
|
||||||
|
*/
|
||||||
|
virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0;
|
||||||
|
|
||||||
|
/** Get a badword structure by index
|
||||||
|
* @param index The index
|
||||||
|
* @return The badword
|
||||||
|
*/
|
||||||
|
virtual BadWord* GetBadWord(unsigned index) const = 0;
|
||||||
|
|
||||||
|
/** Get how many badwords are on this channel
|
||||||
|
* @return The number of badwords in the vector
|
||||||
|
*/
|
||||||
|
virtual unsigned GetBadWordCount() const = 0;
|
||||||
|
|
||||||
|
/** Remove a badword
|
||||||
|
* @param index The index of the badword
|
||||||
|
*/
|
||||||
|
virtual void EraseBadWord(unsigned index) = 0;
|
||||||
|
|
||||||
|
/** Clear all badwords from the channel
|
||||||
|
*/
|
||||||
|
virtual void ClearBadWords() = 0;
|
||||||
|
|
||||||
|
virtual void Check() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/* BotServ core functions
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Indices for TTB (Times To Ban) */
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
TTB_BOLDS,
|
||||||
|
TTB_COLORS,
|
||||||
|
TTB_REVERSES,
|
||||||
|
TTB_UNDERLINES,
|
||||||
|
TTB_BADWORDS,
|
||||||
|
TTB_CAPS,
|
||||||
|
TTB_FLOOD,
|
||||||
|
TTB_REPEAT,
|
||||||
|
TTB_ITALICS,
|
||||||
|
TTB_AMSGS,
|
||||||
|
TTB_SIZE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct KickerData
|
||||||
|
{
|
||||||
|
bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines;
|
||||||
|
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
|
||||||
|
int16_t capsmin, capspercent; /* For CAPS kicker */
|
||||||
|
int16_t floodlines, floodsecs; /* For FLOOD kicker */
|
||||||
|
int16_t repeattimes; /* For REPEAT kicker */
|
||||||
|
|
||||||
|
bool dontkickops, dontkickvoices;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
KickerData() { }
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~KickerData() { }
|
||||||
|
virtual void Check(ChannelInfo *ci) = 0;
|
||||||
|
};
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct EntryMsg
|
||||||
|
{
|
||||||
|
Anope::string chan;
|
||||||
|
Anope::string creator;
|
||||||
|
Anope::string message;
|
||||||
|
time_t when;
|
||||||
|
|
||||||
|
virtual ~EntryMsg() { }
|
||||||
|
protected:
|
||||||
|
EntryMsg() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> >
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
EntryMessageList() : Serialize::Checker<std::vector<EntryMsg *> >("EntryMsg") { }
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~EntryMessageList()
|
||||||
|
{
|
||||||
|
for (unsigned i = (*this)->size(); i > 0; --i)
|
||||||
|
delete (*this)->at(i - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual EntryMsg* Create() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* ChanServ core functions
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct LogSetting
|
||||||
|
{
|
||||||
|
Anope::string chan;
|
||||||
|
/* Our service name of the command */
|
||||||
|
Anope::string service_name;
|
||||||
|
/* The name of the client the command is on */
|
||||||
|
Anope::string command_service;
|
||||||
|
/* Name of the command to the user, can have spaces */
|
||||||
|
Anope::string command_name;
|
||||||
|
Anope::string method, extra;
|
||||||
|
Anope::string creator;
|
||||||
|
time_t created;
|
||||||
|
|
||||||
|
virtual ~LogSetting() { }
|
||||||
|
protected:
|
||||||
|
LogSetting() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
|
||||||
|
{
|
||||||
|
typedef std::vector<LogSetting *>::iterator iterator;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~LogSettings() { }
|
||||||
|
virtual LogSetting *Create() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
/* ChanServ core functions
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct ModeLock
|
||||||
|
{
|
||||||
|
Anope::string ci;
|
||||||
|
bool set;
|
||||||
|
Anope::string name;
|
||||||
|
Anope::string param;
|
||||||
|
Anope::string setter;
|
||||||
|
time_t created;
|
||||||
|
|
||||||
|
virtual ~ModeLock() { }
|
||||||
|
protected:
|
||||||
|
ModeLock() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ModeLocks
|
||||||
|
{
|
||||||
|
typedef std::vector<ModeLock *> ModeList;
|
||||||
|
|
||||||
|
virtual ~ModeLocks() { }
|
||||||
|
|
||||||
|
/** Check if a mode is mlocked
|
||||||
|
* @param mode The mode
|
||||||
|
* @param An optional param
|
||||||
|
* @param status True to check mlock on, false for mlock off
|
||||||
|
* @return true on success, false on fail
|
||||||
|
*/
|
||||||
|
virtual bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const = 0;
|
||||||
|
|
||||||
|
/** Set a mlock
|
||||||
|
* @param mode The mode
|
||||||
|
* @param status True for mlock on, false for mlock off
|
||||||
|
* @param param An optional param arg for + mlocked modes
|
||||||
|
* @param setter Who is setting the mlock
|
||||||
|
* @param created When the mlock was created
|
||||||
|
* @return true on success, false on failure (module blocking)
|
||||||
|
*/
|
||||||
|
virtual bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "", Anope::string setter = "", time_t created = Anope::CurTime) = 0;
|
||||||
|
|
||||||
|
/** Remove a mlock
|
||||||
|
* @param mode The mode
|
||||||
|
* @param status True for mlock on, false for mlock off
|
||||||
|
* @param param The param of the mode, required if it is a list or status mode
|
||||||
|
* @return true on success, false on failure
|
||||||
|
*/
|
||||||
|
virtual bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "") = 0;
|
||||||
|
|
||||||
|
virtual void RemoveMLock(ModeLock *mlock) = 0;
|
||||||
|
|
||||||
|
/** Clear all mlocks on the channel
|
||||||
|
*/
|
||||||
|
virtual void ClearMLock() = 0;
|
||||||
|
|
||||||
|
/** Get all of the mlocks for this channel
|
||||||
|
* @return The mlocks
|
||||||
|
*/
|
||||||
|
virtual const ModeList &GetMLock() const = 0;
|
||||||
|
|
||||||
|
/** Get a list of mode locks on a channel
|
||||||
|
* @param name The mode name to get a list of
|
||||||
|
* @return a list of mlocks for the given mode
|
||||||
|
*/
|
||||||
|
virtual std::list<ModeLock *> GetModeLockList(const Anope::string &name) = 0;
|
||||||
|
|
||||||
|
/** Get details for a specific mlock
|
||||||
|
* @param mname The mode name
|
||||||
|
* @param An optional param to match with
|
||||||
|
* @return The MLock, if any
|
||||||
|
*/
|
||||||
|
virtual const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "") = 0;
|
||||||
|
|
||||||
|
/** Get the current mode locks as a string
|
||||||
|
* @param complete True to show mlock parameters aswell
|
||||||
|
* @return A string of mode locks, eg: +nrt
|
||||||
|
*/
|
||||||
|
virtual Anope::string GetMLockAsString(bool complete) const = 0;
|
||||||
|
|
||||||
|
virtual void Check() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,181 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DNS_H
|
||||||
|
#define DNS_H
|
||||||
|
|
||||||
|
namespace DNS
|
||||||
|
{
|
||||||
|
/** Valid query types
|
||||||
|
*/
|
||||||
|
enum QueryType
|
||||||
|
{
|
||||||
|
/* Nothing */
|
||||||
|
QUERY_NONE,
|
||||||
|
/* A simple A lookup */
|
||||||
|
QUERY_A = 1,
|
||||||
|
/* An authoritative name server */
|
||||||
|
QUERY_NS = 2,
|
||||||
|
/* A CNAME lookup */
|
||||||
|
QUERY_CNAME = 5,
|
||||||
|
/* Start of a zone of authority */
|
||||||
|
QUERY_SOA = 6,
|
||||||
|
/* Reverse DNS lookup */
|
||||||
|
QUERY_PTR = 12,
|
||||||
|
/* IPv6 AAAA lookup */
|
||||||
|
QUERY_AAAA = 28,
|
||||||
|
/* Zone transfer */
|
||||||
|
QUERY_AXFR = 252,
|
||||||
|
/* A lookup for any record */
|
||||||
|
QUERY_ANY = 255
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Flags that can be AND'd into DNSPacket::flags to receive certain values
|
||||||
|
*/
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
QUERYFLAGS_QR = 0x8000,
|
||||||
|
QUERYFLAGS_OPCODE = 0x7800,
|
||||||
|
QUERYFLAGS_OPCODE_NOTIFY = 0x2000,
|
||||||
|
QUERYFLAGS_AA = 0x400,
|
||||||
|
QUERYFLAGS_TC = 0x200,
|
||||||
|
QUERYFLAGS_RD = 0x100,
|
||||||
|
QUERYFLAGS_RA = 0x80,
|
||||||
|
QUERYFLAGS_Z = 0x70,
|
||||||
|
QUERYFLAGS_RCODE = 0xF
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Error
|
||||||
|
{
|
||||||
|
ERROR_NONE,
|
||||||
|
ERROR_UNKNOWN,
|
||||||
|
ERROR_UNLOADED,
|
||||||
|
ERROR_TIMEDOUT,
|
||||||
|
ERROR_NOT_AN_ANSWER,
|
||||||
|
ERROR_NONSTANDARD_QUERY,
|
||||||
|
ERROR_FORMAT_ERROR,
|
||||||
|
ERROR_SERVER_FAILURE,
|
||||||
|
ERROR_DOMAIN_NOT_FOUND,
|
||||||
|
ERROR_NOT_IMPLEMENTED,
|
||||||
|
ERROR_REFUSED,
|
||||||
|
ERROR_NO_RECORDS,
|
||||||
|
ERROR_INVALIDTYPE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Question
|
||||||
|
{
|
||||||
|
Anope::string name;
|
||||||
|
QueryType type;
|
||||||
|
unsigned short qclass;
|
||||||
|
|
||||||
|
Question() : type(QUERY_NONE), qclass(0) { }
|
||||||
|
Question(const Anope::string &n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { }
|
||||||
|
inline bool operator==(const Question & other) const { return name == other.name && type == other.type && qclass == other.qclass; }
|
||||||
|
|
||||||
|
struct hash
|
||||||
|
{
|
||||||
|
size_t operator()(const Question &q) const
|
||||||
|
{
|
||||||
|
return Anope::hash_ci()(q.name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ResourceRecord : Question
|
||||||
|
{
|
||||||
|
unsigned int ttl;
|
||||||
|
Anope::string rdata;
|
||||||
|
time_t created;
|
||||||
|
|
||||||
|
ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), ttl(0), created(Anope::CurTime) { }
|
||||||
|
ResourceRecord(const Question &q) : Question(q), ttl(0), created(Anope::CurTime) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Query
|
||||||
|
{
|
||||||
|
std::vector<Question> questions;
|
||||||
|
std::vector<ResourceRecord> answers, authorities, additional;
|
||||||
|
Error error;
|
||||||
|
|
||||||
|
Query() : error(ERROR_NONE) { }
|
||||||
|
Query(const Question &q) : error(ERROR_NONE) { questions.push_back(q); }
|
||||||
|
};
|
||||||
|
|
||||||
|
class ReplySocket;
|
||||||
|
class Request;
|
||||||
|
|
||||||
|
/** DNS manager
|
||||||
|
*/
|
||||||
|
class Manager : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Manager(Module *creator) : Service(creator, "DNS::Manager", "dns/manager") { }
|
||||||
|
virtual ~Manager() { }
|
||||||
|
|
||||||
|
virtual void Process(Request *req) = 0;
|
||||||
|
virtual void RemoveRequest(Request *req) = 0;
|
||||||
|
|
||||||
|
virtual bool HandlePacket(ReplySocket *s, const unsigned char *const data, int len, sockaddrs *from) = 0;
|
||||||
|
|
||||||
|
virtual void UpdateSerial() = 0;
|
||||||
|
virtual void Notify(const Anope::string &zone) = 0;
|
||||||
|
virtual uint32_t GetSerial() const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** A DNS query.
|
||||||
|
*/
|
||||||
|
class Request : public Timer, public Question
|
||||||
|
{
|
||||||
|
Manager *manager;
|
||||||
|
public:
|
||||||
|
/* Use result cache if available */
|
||||||
|
bool use_cache;
|
||||||
|
/* Request id */
|
||||||
|
unsigned short id;
|
||||||
|
/* Creator of this request */
|
||||||
|
Module *creator;
|
||||||
|
|
||||||
|
Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false) : Timer(0), Question(addr, qt), manager(mgr),
|
||||||
|
use_cache(cache), id(0), creator(c) { }
|
||||||
|
|
||||||
|
virtual ~Request()
|
||||||
|
{
|
||||||
|
manager->RemoveRequest(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called when this request succeeds
|
||||||
|
* @param r The query sent back from the nameserver
|
||||||
|
*/
|
||||||
|
virtual void OnLookupComplete(const Query *r) = 0;
|
||||||
|
|
||||||
|
/** Called when this request fails or times out.
|
||||||
|
* @param r The query sent back from the nameserver, check the error code.
|
||||||
|
*/
|
||||||
|
virtual void OnError(const Query *r) { }
|
||||||
|
|
||||||
|
/** Used to time out the query, xalls OnError and lets the TimerManager
|
||||||
|
* delete this request.
|
||||||
|
*/
|
||||||
|
void Tick(time_t) anope_override
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name;
|
||||||
|
Query rr(*this);
|
||||||
|
rr.error = ERROR_TIMEDOUT;
|
||||||
|
this->OnError(&rr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace DNS
|
||||||
|
|
||||||
|
#endif // DNS_H
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Encryption
|
||||||
|
{
|
||||||
|
typedef std::pair<const unsigned char *, size_t> Hash;
|
||||||
|
typedef std::pair<const uint32_t *, size_t> IV;
|
||||||
|
|
||||||
|
class Context
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Context() { }
|
||||||
|
virtual void Update(const unsigned char *data, size_t len) = 0;
|
||||||
|
virtual void Finalize() = 0;
|
||||||
|
virtual Hash GetFinalizedHash() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Provider : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
|
||||||
|
virtual ~Provider() { }
|
||||||
|
|
||||||
|
virtual Context *CreateContext(IV * = NULL) = 0;
|
||||||
|
virtual IV GetDefaultIV() = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -21,6 +21,23 @@ struct HTTPReply
|
|||||||
|
|
||||||
HTTPReply() : error(HTTP_ERROR_OK), length(0) { }
|
HTTPReply() : error(HTTP_ERROR_OK), length(0) { }
|
||||||
|
|
||||||
|
HTTPReply(const HTTPReply& other) : error(other.error), length(other.length)
|
||||||
|
{
|
||||||
|
content_type = other.content_type;
|
||||||
|
headers = other.headers;
|
||||||
|
cookies = other.cookies;
|
||||||
|
|
||||||
|
for (unsigned i = 0; i < other.out.size(); ++i)
|
||||||
|
out.push_back(new Data(other.out[i]->buf, other.out[i]->len));
|
||||||
|
}
|
||||||
|
|
||||||
|
~HTTPReply()
|
||||||
|
{
|
||||||
|
for (unsigned i = 0; i < out.size(); ++i)
|
||||||
|
delete out[i];
|
||||||
|
out.clear();
|
||||||
|
}
|
||||||
|
|
||||||
struct Data
|
struct Data
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
@@ -87,10 +104,10 @@ class HTTPPage : public Base
|
|||||||
* @param The HTTP header sent from the client to request the page
|
* @param The HTTP header sent from the client to request the page
|
||||||
* @param The HTTP header that will be sent back to the client
|
* @param The HTTP header that will be sent back to the client
|
||||||
*/
|
*/
|
||||||
virtual void OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0;
|
virtual bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class HTTPClient : public ClientSocket, public BufferedSocket, public BinarySocket
|
class HTTPClient : public ClientSocket, public BinarySocket, public Base
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
void WriteClient(const Anope::string &message)
|
void WriteClient(const Anope::string &message)
|
||||||
@@ -99,41 +116,27 @@ class HTTPClient : public ClientSocket, public BufferedSocket, public BinarySock
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HTTPClient(ListenSocket *l, int f, const sockaddrs &a) : ClientSocket(l, a), BufferedSocket(), BinarySocket() { }
|
HTTPClient(ListenSocket *l, int f, const sockaddrs &a) : ClientSocket(l, a), BinarySocket() { }
|
||||||
|
|
||||||
virtual const Anope::string GetIP()
|
virtual const Anope::string GetIP()
|
||||||
{
|
{
|
||||||
return this->clientaddr.addr();
|
return this->clientaddr.addr();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProcessRead() anope_override
|
|
||||||
{
|
|
||||||
return BufferedSocket::ProcessRead();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProcessWrite() anope_override
|
|
||||||
{
|
|
||||||
return !BinarySocket::ProcessWrite() || BinarySocket::WriteBuffer.empty() ? false : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Write(const char *buffer, size_t l) anope_override
|
|
||||||
{
|
|
||||||
BinarySocket::Write(buffer, l);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void SendError(HTTPError err, const Anope::string &msg) = 0;
|
virtual void SendError(HTTPError err, const Anope::string &msg) = 0;
|
||||||
virtual void SendReply(HTTPReply *) = 0;
|
virtual void SendReply(HTTPReply *) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class HTTPProvider : public Service, public ListenSocket
|
class HTTPProvider : public ListenSocket, public Service
|
||||||
{
|
{
|
||||||
Anope::string ip;
|
Anope::string ip;
|
||||||
unsigned short port;
|
unsigned short port;
|
||||||
|
bool ssl;
|
||||||
public:
|
public:
|
||||||
Anope::string ext_ip;
|
Anope::string ext_ip;
|
||||||
std::vector<Anope::string> ext_headers;
|
std::vector<Anope::string> ext_headers;
|
||||||
|
|
||||||
HTTPProvider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p) : Service(c, "HTTPProvider", n), ListenSocket(i, p, i.find(':') != Anope::string::npos), ip(i), port(p) { }
|
HTTPProvider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p, bool s) : ListenSocket(i, p, i.find(':') != Anope::string::npos), Service(c, "HTTPProvider", n), ip(i), port(p), ssl(s) { }
|
||||||
|
|
||||||
const Anope::string &GetIP() const
|
const Anope::string &GetIP() const
|
||||||
{
|
{
|
||||||
@@ -145,6 +148,11 @@ class HTTPProvider : public Service, public ListenSocket
|
|||||||
return this->port;
|
return this->port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsSSL() const
|
||||||
|
{
|
||||||
|
return this->ssl;
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool RegisterPage(HTTPPage *page) = 0;
|
virtual bool RegisterPage(HTTPPage *page) = 0;
|
||||||
virtual void UnregisterPage(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;
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
#ifndef ANOPE_LDAP_H
|
#ifndef ANOPE_LDAP_H
|
||||||
#define ANOPE_LDAP_H
|
#define ANOPE_LDAP_H
|
||||||
|
|
||||||
typedef int LDAPQuery;
|
|
||||||
|
|
||||||
class LDAPException : public ModuleException
|
class LDAPException : public ModuleException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -59,28 +57,26 @@ struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum QueryType
|
||||||
|
{
|
||||||
|
QUERY_UNKNOWN,
|
||||||
|
QUERY_BIND,
|
||||||
|
QUERY_SEARCH,
|
||||||
|
QUERY_ADD,
|
||||||
|
QUERY_DELETE,
|
||||||
|
QUERY_MODIFY
|
||||||
|
};
|
||||||
|
|
||||||
struct LDAPResult
|
struct LDAPResult
|
||||||
{
|
{
|
||||||
std::vector<LDAPAttributes> messages;
|
std::vector<LDAPAttributes> messages;
|
||||||
Anope::string error;
|
Anope::string error;
|
||||||
|
|
||||||
enum QueryType
|
|
||||||
{
|
|
||||||
QUERY_UNKNOWN,
|
|
||||||
QUERY_BIND,
|
|
||||||
QUERY_SEARCH,
|
|
||||||
QUERY_ADD,
|
|
||||||
QUERY_DELETE,
|
|
||||||
QUERY_MODIFY
|
|
||||||
};
|
|
||||||
|
|
||||||
QueryType type;
|
QueryType type;
|
||||||
LDAPQuery id;
|
|
||||||
|
|
||||||
LDAPResult()
|
LDAPResult()
|
||||||
{
|
{
|
||||||
this->type = QUERY_UNKNOWN;
|
this->type = QUERY_UNKNOWN;
|
||||||
this->id = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size() const
|
size_t size() const
|
||||||
@@ -116,6 +112,7 @@ class LDAPInterface
|
|||||||
|
|
||||||
virtual void OnResult(const LDAPResult &r) = 0;
|
virtual void OnResult(const LDAPResult &r) = 0;
|
||||||
virtual void OnError(const LDAPResult &err) = 0;
|
virtual void OnError(const LDAPResult &err) = 0;
|
||||||
|
virtual void OnDelete() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class LDAPProvider : public Service
|
class LDAPProvider : public Service
|
||||||
@@ -125,48 +122,42 @@ class LDAPProvider : public Service
|
|||||||
|
|
||||||
/** Attempt to bind to the LDAP server as an admin
|
/** Attempt to bind to the LDAP server as an admin
|
||||||
* @param i The LDAPInterface the result is sent to
|
* @param i The LDAPInterface the result is sent to
|
||||||
* @return The query ID
|
|
||||||
*/
|
*/
|
||||||
virtual LDAPQuery BindAsAdmin(LDAPInterface *i) = 0;
|
virtual void BindAsAdmin(LDAPInterface *i) = 0;
|
||||||
|
|
||||||
/** Bind to LDAP
|
/** Bind to LDAP
|
||||||
* @param i The LDAPInterface the result is sent to
|
* @param i The LDAPInterface the result is sent to
|
||||||
* @param who The binddn
|
* @param who The binddn
|
||||||
* @param pass The password
|
* @param pass The password
|
||||||
* @return The query ID
|
|
||||||
*/
|
*/
|
||||||
virtual LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0;
|
virtual void Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0;
|
||||||
|
|
||||||
/** Search ldap for the specified filter
|
/** Search ldap for the specified filter
|
||||||
* @param i The LDAPInterface the result is sent to
|
* @param i The LDAPInterface the result is sent to
|
||||||
* @param base The base DN to search
|
* @param base The base DN to search
|
||||||
* @param filter The filter to apply
|
* @param filter The filter to apply
|
||||||
* @return The query ID
|
|
||||||
*/
|
*/
|
||||||
virtual LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0;
|
virtual void Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0;
|
||||||
|
|
||||||
/** Add an entry to LDAP
|
/** Add an entry to LDAP
|
||||||
* @param i The LDAPInterface the result is sent to
|
* @param i The LDAPInterface the result is sent to
|
||||||
* @param dn The dn of the entry to add
|
* @param dn The dn of the entry to add
|
||||||
* @param attributes The attributes
|
* @param attributes The attributes
|
||||||
* @return The query ID
|
|
||||||
*/
|
*/
|
||||||
virtual LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0;
|
virtual void Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0;
|
||||||
|
|
||||||
/** Delete an entry from LDAP
|
/** Delete an entry from LDAP
|
||||||
* @param i The LDAPInterface the result is sent to
|
* @param i The LDAPInterface the result is sent to
|
||||||
* @param dn The dn of the entry to delete
|
* @param dn The dn of the entry to delete
|
||||||
* @return The query ID
|
|
||||||
*/
|
*/
|
||||||
virtual LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) = 0;
|
virtual void Del(LDAPInterface *i, const Anope::string &dn) = 0;
|
||||||
|
|
||||||
/** Modify an existing entry in LDAP
|
/** Modify an existing entry in LDAP
|
||||||
* @param i The LDAPInterface the result is sent to
|
* @param i The LDAPInterface the result is sent to
|
||||||
* @param base The base DN to modify
|
* @param base The base DN to modify
|
||||||
* @param attributes The attributes to modify
|
* @param attributes The attributes to modify
|
||||||
* @return The query ID
|
|
||||||
*/
|
*/
|
||||||
virtual LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
|
virtual void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ANOPE_LDAP_H
|
#endif // ANOPE_LDAP_H
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
/* NickServ core functions
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct NSCertList
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
NSCertList() { }
|
||||||
|
public:
|
||||||
|
virtual ~NSCertList() { }
|
||||||
|
|
||||||
|
/** Add an entry to the nick's certificate list
|
||||||
|
*
|
||||||
|
* @param entry The fingerprint to add to the cert list
|
||||||
|
*
|
||||||
|
* Adds a new entry into the cert list.
|
||||||
|
*/
|
||||||
|
virtual void AddCert(const Anope::string &entry) = 0;
|
||||||
|
|
||||||
|
/** Get an entry from the nick's cert list by index
|
||||||
|
*
|
||||||
|
* @param entry Index in the certificaate list vector to retrieve
|
||||||
|
* @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
|
||||||
|
*
|
||||||
|
* Retrieves an entry from the certificate list corresponding to the given index.
|
||||||
|
*/
|
||||||
|
virtual Anope::string GetCert(unsigned entry) const = 0;
|
||||||
|
|
||||||
|
virtual unsigned GetCertCount() const = 0;
|
||||||
|
|
||||||
|
/** Find an entry in the nick's cert list
|
||||||
|
*
|
||||||
|
* @param entry The fingerprint to search for
|
||||||
|
* @return True if the fingerprint is found in the cert list, false otherwise
|
||||||
|
*
|
||||||
|
* Search for an fingerprint within the cert list.
|
||||||
|
*/
|
||||||
|
virtual bool FindCert(const Anope::string &entry) const = 0;
|
||||||
|
|
||||||
|
/** Erase a fingerprint from the nick's certificate list
|
||||||
|
*
|
||||||
|
* @param entry The fingerprint to remove
|
||||||
|
*
|
||||||
|
* Removes the specified fingerprint from the cert list.
|
||||||
|
*/
|
||||||
|
virtual void EraseCert(const Anope::string &entry) = 0;
|
||||||
|
|
||||||
|
/** Clears the entire nick's cert list
|
||||||
|
*
|
||||||
|
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
||||||
|
*/
|
||||||
|
virtual void ClearCert() = 0;
|
||||||
|
|
||||||
|
virtual void Check() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CertService : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CertService(Module *c) : Service(c, "CertService", "certs") { }
|
||||||
|
|
||||||
|
virtual NickCore* FindAccountFromCert(const Anope::string &cert) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#ifndef OS_FORBID_H
|
||||||
|
#define OS_FORBID_H
|
||||||
|
|
||||||
|
enum ForbidType
|
||||||
|
{
|
||||||
|
FT_NICK = 1,
|
||||||
|
FT_CHAN,
|
||||||
|
FT_EMAIL,
|
||||||
|
FT_REGISTER,
|
||||||
|
FT_SIZE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ForbidData
|
||||||
|
{
|
||||||
|
Anope::string mask;
|
||||||
|
Anope::string creator;
|
||||||
|
Anope::string reason;
|
||||||
|
time_t created;
|
||||||
|
time_t expires;
|
||||||
|
ForbidType type;
|
||||||
|
|
||||||
|
virtual ~ForbidData() { }
|
||||||
|
protected:
|
||||||
|
ForbidData() : created(0), expires(0) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
class ForbidService : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ForbidService(Module *m) : Service(m, "ForbidService", "forbid") { }
|
||||||
|
|
||||||
|
virtual void AddForbid(ForbidData *d) = 0;
|
||||||
|
|
||||||
|
virtual void RemoveForbid(ForbidData *d) = 0;
|
||||||
|
|
||||||
|
virtual ForbidData* CreateForbid() = 0;
|
||||||
|
|
||||||
|
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
|
||||||
|
|
||||||
|
virtual std::vector<ForbidData *> GetForbids() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ServiceReference<ForbidService> forbid_service("ForbidService", "forbid");
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/* OperServ ignore interface
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
struct IgnoreData
|
||||||
|
{
|
||||||
|
Anope::string mask;
|
||||||
|
Anope::string creator;
|
||||||
|
Anope::string reason;
|
||||||
|
time_t time; /* When do we stop ignoring them? */
|
||||||
|
|
||||||
|
virtual ~IgnoreData() { }
|
||||||
|
protected:
|
||||||
|
IgnoreData() : time(0) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
class IgnoreService : public Service
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
IgnoreService(Module *c) : Service(c, "IgnoreService", "ignore") { }
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void AddIgnore(IgnoreData *) = 0;
|
||||||
|
|
||||||
|
virtual void DelIgnore(IgnoreData *) = 0;
|
||||||
|
|
||||||
|
virtual void ClearIgnores() = 0;
|
||||||
|
|
||||||
|
virtual IgnoreData *Create() = 0;
|
||||||
|
|
||||||
|
virtual IgnoreData *Find(const Anope::string &mask) = 0;
|
||||||
|
|
||||||
|
virtual std::vector<IgnoreData *> &GetIgnores() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ServiceReference<IgnoreService> ignore_service("IgnoreService", "ignore");
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#ifndef OS_NEWS
|
||||||
|
#define OS_NEWS
|
||||||
|
|
||||||
|
enum NewsType
|
||||||
|
{
|
||||||
|
NEWS_LOGON,
|
||||||
|
NEWS_RANDOM,
|
||||||
|
NEWS_OPER
|
||||||
|
};
|
||||||
|
|
||||||
|
struct NewsMessages
|
||||||
|
{
|
||||||
|
NewsType type;
|
||||||
|
Anope::string name;
|
||||||
|
const char *msgs[10];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct NewsItem : Serializable
|
||||||
|
{
|
||||||
|
NewsType type;
|
||||||
|
Anope::string text;
|
||||||
|
Anope::string who;
|
||||||
|
time_t time;
|
||||||
|
|
||||||
|
NewsItem() : Serializable("NewsItem") { }
|
||||||
|
};
|
||||||
|
|
||||||
|
class NewsService : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NewsService(Module *m) : Service(m, "NewsService", "news") { }
|
||||||
|
|
||||||
|
virtual NewsItem *CreateNewsItem() = 0;
|
||||||
|
|
||||||
|
virtual void AddNewsItem(NewsItem *n) = 0;
|
||||||
|
|
||||||
|
virtual void DelNewsItem(NewsItem *n) = 0;
|
||||||
|
|
||||||
|
virtual std::vector<NewsItem *> &GetNewsList(NewsType t) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ServiceReference<NewsService> news_service("NewsService", "news");
|
||||||
|
|
||||||
|
#endif // OS_NEWS
|
||||||
|
|
||||||
@@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
struct Session
|
struct Session
|
||||||
{
|
{
|
||||||
Anope::string host; /* Host of the session */
|
cidr addr; /* A cidr (sockaddrs + len) representing this session */
|
||||||
unsigned count; /* Number of clients with this host */
|
unsigned count; /* Number of clients with this host */
|
||||||
unsigned hits; /* Number of subsequent kills for a host */
|
unsigned hits; /* Number of subsequent kills for a host */
|
||||||
|
|
||||||
|
Session(const sockaddrs &ip, int len) : addr(ip, len), count(1), hits(0) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Exception : Serializable
|
struct Exception : Serializable
|
||||||
@@ -17,19 +19,21 @@ struct Exception : Serializable
|
|||||||
time_t time; /* When this exception was added */
|
time_t time; /* When this exception was added */
|
||||||
time_t expires; /* Time when it expires. 0 == no expiry */
|
time_t expires; /* Time when it expires. 0 == no expiry */
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override { return "Exception"; }
|
Exception() : Serializable("Exception") { }
|
||||||
Serialize::Data serialize() const anope_override;
|
void Serialize(Serialize::Data &data) const anope_override;
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &data);
|
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||||
};
|
};
|
||||||
|
|
||||||
class SessionService : public Service
|
class SessionService : public Service
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Anope::map<Session *> SessionMap;
|
typedef TR1NS::unordered_map<cidr, Session *, cidr::hash> SessionMap;
|
||||||
typedef std::vector<Exception *> ExceptionVector;
|
typedef std::vector<Exception *> ExceptionVector;
|
||||||
|
|
||||||
SessionService(Module *m) : Service(m, "SessionService", "session") { }
|
SessionService(Module *m) : Service(m, "SessionService", "session") { }
|
||||||
|
|
||||||
|
virtual Exception *CreateException() = 0;
|
||||||
|
|
||||||
virtual void AddException(Exception *e) = 0;
|
virtual void AddException(Exception *e) = 0;
|
||||||
|
|
||||||
virtual void DelException(Exception *e) = 0;
|
virtual void DelException(Exception *e) = 0;
|
||||||
@@ -40,32 +44,24 @@ class SessionService : public Service
|
|||||||
|
|
||||||
virtual ExceptionVector &GetExceptions() = 0;
|
virtual ExceptionVector &GetExceptions() = 0;
|
||||||
|
|
||||||
virtual void AddSession(Session *s) = 0;
|
virtual Session *FindSession(const Anope::string &ip) = 0;
|
||||||
|
|
||||||
virtual void DelSession(Session *s) = 0;
|
|
||||||
|
|
||||||
virtual Session *FindSession(const Anope::string &mask) = 0;
|
|
||||||
|
|
||||||
virtual SessionMap &GetSessions() = 0;
|
virtual SessionMap &GetSessions() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
static service_reference<SessionService> session_service("SessionService", "session");
|
static ServiceReference<SessionService> session_service("SessionService", "session");
|
||||||
|
|
||||||
Serialize::Data Exception::serialize() const
|
void Exception::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
Serialize::Data data;
|
|
||||||
|
|
||||||
data["mask"] << this->mask;
|
data["mask"] << this->mask;
|
||||||
data["limit"] << this->limit;
|
data["limit"] << this->limit;
|
||||||
data["who"] << this->who;
|
data["who"] << this->who;
|
||||||
data["reason"] << this->reason;
|
data["reason"] << this->reason;
|
||||||
data["time"] << this->time;
|
data["time"] << this->time;
|
||||||
data["expires"] << this->expires;
|
data["expires"] << this->expires;
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable* Exception::unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable* Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
{
|
{
|
||||||
if (!session_service)
|
if (!session_service)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef CHANSERV_H
|
||||||
|
#define CHANSERV_H
|
||||||
|
|
||||||
|
class ChanServService : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ChanServService(Module *m) : Service(m, "ChanServService", "ChanServ")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Have ChanServ hold the channel, that is, join and set +nsti and wait
|
||||||
|
* for a few minutes so no one can join or rejoin.
|
||||||
|
*/
|
||||||
|
virtual void Hold(Channel *c) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CHANSERV_H
|
||||||
|
|
||||||
@@ -4,17 +4,17 @@
|
|||||||
class GlobalService : public Service
|
class GlobalService : public Service
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GlobalService(Module *m) : Service(m, "GlobalService", "Global") { }
|
GlobalService(Module *m) : Service(m, "GlobalService", "Global")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/** Send out a global message to all users
|
/** Send out a global message to all users
|
||||||
* @param sender Our client which should send the global
|
* @param sender Our client which should send the global
|
||||||
* @param source The sender of the global
|
* @param source The sender of the global
|
||||||
* @param message The message
|
* @param message The message
|
||||||
*/
|
*/
|
||||||
virtual void SendGlobal(const BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0;
|
virtual void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
static service_reference<GlobalService> global("GlobalService", "Global");
|
|
||||||
|
|
||||||
#endif // GLOBAL_H
|
#endif // GLOBAL_H
|
||||||
|
|
||||||
@@ -12,14 +12,9 @@ class MemoServService : public Service
|
|||||||
MEMO_TARGET_FULL
|
MEMO_TARGET_FULL
|
||||||
};
|
};
|
||||||
|
|
||||||
MemoServService(Module *m) : Service(m, "MemoServService", "MemoServ") { }
|
MemoServService(Module *m) : Service(m, "MemoServService", "MemoServ")
|
||||||
|
{
|
||||||
/** Retrieve the memo info for a nick or channel
|
}
|
||||||
* @param target Target
|
|
||||||
* @param ischan Set to true if target is a channel
|
|
||||||
* @return A memoinfo structure or NULL
|
|
||||||
*/
|
|
||||||
virtual MemoInfo *GetMemoInfo(const Anope::string &target, bool &ischan) = 0;
|
|
||||||
|
|
||||||
/** Sends a memo.
|
/** Sends a memo.
|
||||||
* @param source The source of the memo, can be anythin.
|
* @param source The source of the memo, can be anythin.
|
||||||
@@ -35,7 +30,5 @@ class MemoServService : public Service
|
|||||||
virtual void Check(User *u) = 0;
|
virtual void Check(User *u) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
static service_reference<MemoServService> memoserv("MemoServService", "MemoServ");
|
|
||||||
|
|
||||||
#endif // MEMOSERV_H
|
#endif // MEMOSERV_H
|
||||||
|
|
||||||
@@ -4,12 +4,14 @@
|
|||||||
class NickServService : public Service
|
class NickServService : public Service
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NickServService(Module *m) : Service(m, "NickServService", "NickServ") { }
|
NickServService(Module *m) : Service(m, "NickServService", "NickServ")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual void Validate(User *u) = 0;
|
virtual void Validate(User *u) = 0;
|
||||||
|
virtual void Collide(User *u, NickAlias *na) = 0;
|
||||||
|
virtual void Release(NickAlias *na) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
static service_reference<NickServService> nickserv("NickServService", "NickServ");
|
|
||||||
|
|
||||||
#endif // NICKSERV_H
|
#endif // NICKSERV_H
|
||||||
|
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Redis
|
||||||
|
{
|
||||||
|
struct Reply
|
||||||
|
{
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
NOT_PARSED,
|
||||||
|
NOT_OK,
|
||||||
|
OK,
|
||||||
|
INT,
|
||||||
|
BULK,
|
||||||
|
MULTI_BULK
|
||||||
|
}
|
||||||
|
type;
|
||||||
|
|
||||||
|
Reply() { Clear(); }
|
||||||
|
~Reply() { Clear(); }
|
||||||
|
|
||||||
|
void Clear()
|
||||||
|
{
|
||||||
|
type = NOT_PARSED;
|
||||||
|
i = 0;
|
||||||
|
bulk.clear();
|
||||||
|
multi_bulk_size = 0;
|
||||||
|
for (unsigned j = 0; j < multi_bulk.size(); ++j)
|
||||||
|
delete multi_bulk[j];
|
||||||
|
multi_bulk.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t i;
|
||||||
|
Anope::string bulk;
|
||||||
|
int multi_bulk_size;
|
||||||
|
std::deque<Reply *> multi_bulk;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Module *owner;
|
||||||
|
|
||||||
|
Interface(Module *m) : owner(m) { }
|
||||||
|
virtual ~Interface() { }
|
||||||
|
|
||||||
|
virtual void OnResult(const Reply &r) = 0;
|
||||||
|
virtual void OnError(const Anope::string &error) { Log(owner) << error; }
|
||||||
|
};
|
||||||
|
|
||||||
|
class Provider : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Provider(Module *c, const Anope::string &n) : Service(c, "Redis::Provider", n) { }
|
||||||
|
|
||||||
|
virtual void SendCommand(Interface *i, const std::vector<Anope::string> &cmds) = 0;
|
||||||
|
virtual void SendCommand(Interface *i, const Anope::string &str) = 0;
|
||||||
|
|
||||||
|
virtual bool BlockAndProcess() = 0;
|
||||||
|
|
||||||
|
virtual void Subscribe(Interface *i, const Anope::string &pattern) = 0;
|
||||||
|
virtual void Unsubscribe(const Anope::string &pattern) = 0;
|
||||||
|
|
||||||
|
virtual void StartTransaction() = 0;
|
||||||
|
virtual void CommitTransaction() = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace SASL
|
||||||
|
{
|
||||||
|
struct Message
|
||||||
|
{
|
||||||
|
Anope::string source;
|
||||||
|
Anope::string target;
|
||||||
|
Anope::string type;
|
||||||
|
Anope::string data;
|
||||||
|
Anope::string ext;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Mechanism;
|
||||||
|
struct Session;
|
||||||
|
|
||||||
|
class Service : public ::Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Service(Module *o) : ::Service(o, "SASL::Service", "sasl") { }
|
||||||
|
|
||||||
|
virtual void ProcessMessage(const Message &) = 0;
|
||||||
|
|
||||||
|
virtual Anope::string GetAgent() = 0;
|
||||||
|
|
||||||
|
virtual Session* GetSession(const Anope::string &uid) = 0;
|
||||||
|
|
||||||
|
virtual void SendMessage(SASL::Session *session, const Anope::string &type, const Anope::string &data) = 0;
|
||||||
|
|
||||||
|
virtual void Succeed(Session *, NickCore *) = 0;
|
||||||
|
virtual void Fail(Session *) = 0;
|
||||||
|
virtual void SendMechs(Session *) = 0;
|
||||||
|
virtual void DeleteSessions(Mechanism *, bool = false) = 0;
|
||||||
|
virtual void RemoveSession(Session *) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ServiceReference<SASL::Service> sasl("SASL::Service", "sasl");
|
||||||
|
|
||||||
|
struct Session
|
||||||
|
{
|
||||||
|
time_t created;
|
||||||
|
Anope::string uid;
|
||||||
|
Reference<Mechanism> mech;
|
||||||
|
|
||||||
|
Session(Mechanism *m, const Anope::string &u) : created(Anope::CurTime), uid(u), mech(m) { }
|
||||||
|
virtual ~Session()
|
||||||
|
{
|
||||||
|
if (sasl)
|
||||||
|
sasl->RemoveSession(this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* PLAIN, EXTERNAL, etc */
|
||||||
|
class Mechanism : public ::Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Mechanism(Module *o, const Anope::string &sname) : Service(o, "SASL::Mechanism", sname) { }
|
||||||
|
|
||||||
|
virtual Session* CreateSession(const Anope::string &uid) { return new Session(this, uid); }
|
||||||
|
|
||||||
|
virtual void ProcessMessage(Session *session, const Message &) = 0;
|
||||||
|
|
||||||
|
virtual ~Mechanism()
|
||||||
|
{
|
||||||
|
if (sasl)
|
||||||
|
sasl->DeleteSessions(this, true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class IdentifyRequest : public ::IdentifyRequest
|
||||||
|
{
|
||||||
|
Anope::string uid;
|
||||||
|
|
||||||
|
public:
|
||||||
|
IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass) : ::IdentifyRequest(m, acc, pass), uid(id) { }
|
||||||
|
|
||||||
|
void OnSuccess() anope_override
|
||||||
|
{
|
||||||
|
if (!sasl)
|
||||||
|
return;
|
||||||
|
|
||||||
|
NickAlias *na = NickAlias::Find(GetAccount());
|
||||||
|
if (!na || na->nc->HasExt("NS_SUSPENDED"))
|
||||||
|
return OnFail();
|
||||||
|
|
||||||
|
Session *s = sasl->GetSession(uid);
|
||||||
|
if (s)
|
||||||
|
{
|
||||||
|
Log(Config->GetClient("NickServ")) << "A user identified to account " << this->GetAccount() << " using SASL";
|
||||||
|
sasl->Succeed(s, na->nc);
|
||||||
|
delete s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnFail() anope_override
|
||||||
|
{
|
||||||
|
if (!sasl)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Session *s = sasl->GetSession(uid);
|
||||||
|
if (s)
|
||||||
|
{
|
||||||
|
sasl->Fail(s);
|
||||||
|
delete s;
|
||||||
|
}
|
||||||
|
|
||||||
|
Anope::string accountstatus;
|
||||||
|
NickAlias *na = NickAlias::Find(GetAccount());
|
||||||
|
if (!na)
|
||||||
|
accountstatus = "nonexistent ";
|
||||||
|
else if (na->nc->HasExt("NS_SUSPENDED"))
|
||||||
|
accountstatus = "suspended ";
|
||||||
|
|
||||||
|
Log(Config->GetClient("NickServ")) << "A user failed to identify for " << accountstatus << "account " << this->GetAccount() << " using SASL";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct MiscData
|
||||||
|
{
|
||||||
|
Anope::string object;
|
||||||
|
Anope::string name;
|
||||||
|
Anope::string data;
|
||||||
|
|
||||||
|
MiscData() { }
|
||||||
|
virtual ~MiscData() { }
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,216 @@
|
|||||||
|
/*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace SQL
|
||||||
|
{
|
||||||
|
|
||||||
|
class Data : public Serialize::Data
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef std::map<Anope::string, std::stringstream *> Map;
|
||||||
|
Map data;
|
||||||
|
std::map<Anope::string, Type> types;
|
||||||
|
|
||||||
|
~Data()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::iostream& operator[](const Anope::string &key) anope_override
|
||||||
|
{
|
||||||
|
std::stringstream *&ss = data[key];
|
||||||
|
if (!ss)
|
||||||
|
ss = new std::stringstream();
|
||||||
|
return *ss;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::set<Anope::string> KeySet() const anope_override
|
||||||
|
{
|
||||||
|
std::set<Anope::string> keys;
|
||||||
|
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||||
|
keys.insert(it->first);
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t Hash() const anope_override
|
||||||
|
{
|
||||||
|
size_t hash = 0;
|
||||||
|
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||||
|
if (!it->second->str().empty())
|
||||||
|
hash ^= Anope::hash_cs()(it->second->str());
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<Anope::string, std::iostream *> GetData() const
|
||||||
|
{
|
||||||
|
std::map<Anope::string, std::iostream *> d;
|
||||||
|
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||||
|
d[it->first] = it->second;
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Clear()
|
||||||
|
{
|
||||||
|
for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it)
|
||||||
|
delete it->second;
|
||||||
|
this->data.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetType(const Anope::string &key, Type t) anope_override
|
||||||
|
{
|
||||||
|
this->types[key] = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
Type GetType(const Anope::string &key) const anope_override
|
||||||
|
{
|
||||||
|
std::map<Anope::string, Type>::const_iterator it = this->types.find(key);
|
||||||
|
if (it != this->types.end())
|
||||||
|
return it->second;
|
||||||
|
return DT_TEXT;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** A SQL exception, can be thrown at various points
|
||||||
|
*/
|
||||||
|
class Exception : public ModuleException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Exception(const Anope::string &reason) : ModuleException(reason) { }
|
||||||
|
|
||||||
|
virtual ~Exception() throw() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
/** A SQL query
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct QueryData
|
||||||
|
{
|
||||||
|
Anope::string data;
|
||||||
|
bool escape;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Query
|
||||||
|
{
|
||||||
|
Anope::string query;
|
||||||
|
std::map<Anope::string, QueryData> parameters;
|
||||||
|
|
||||||
|
Query() { }
|
||||||
|
Query(const Anope::string &q) : query(q) { }
|
||||||
|
|
||||||
|
Query& operator=(const Anope::string &q)
|
||||||
|
{
|
||||||
|
this->query = q;
|
||||||
|
this->parameters.clear();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const Query &other) const
|
||||||
|
{
|
||||||
|
return this->query == other.query;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator!=(const Query &other) const
|
||||||
|
{
|
||||||
|
return !(*this == other);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T> void SetValue(const Anope::string &key, const T& value, bool escape = true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Anope::string string_value = stringify(value);
|
||||||
|
this->parameters[key].data = string_value;
|
||||||
|
this->parameters[key].escape = escape;
|
||||||
|
}
|
||||||
|
catch (const ConvertException &ex) { }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** A result from a SQL query
|
||||||
|
*/
|
||||||
|
class Result
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
/* Rows, column, item */
|
||||||
|
std::vector<std::map<Anope::string, Anope::string> > entries;
|
||||||
|
Query query;
|
||||||
|
Anope::string error;
|
||||||
|
public:
|
||||||
|
unsigned int id;
|
||||||
|
Anope::string finished_query;
|
||||||
|
|
||||||
|
Result() : id(0) { }
|
||||||
|
Result(unsigned int i, const Query &q, const Anope::string &fq, const Anope::string &err = "") : query(q), error(err), id(i), finished_query(fq) { }
|
||||||
|
|
||||||
|
inline operator bool() const { return this->error.empty(); }
|
||||||
|
|
||||||
|
inline const unsigned int GetID() const { return this->id; }
|
||||||
|
inline const Query &GetQuery() const { return this->query; }
|
||||||
|
inline const Anope::string &GetError() const { return this->error; }
|
||||||
|
|
||||||
|
int Rows() const { return this->entries.size(); }
|
||||||
|
|
||||||
|
const std::map<Anope::string, Anope::string> &Row(size_t index) const
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return this->entries.at(index);
|
||||||
|
}
|
||||||
|
catch (const std::out_of_range &)
|
||||||
|
{
|
||||||
|
throw Exception("Out of bounds access to SQLResult");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const Anope::string Get(size_t index, const Anope::string &col) const
|
||||||
|
{
|
||||||
|
const std::map<Anope::string, Anope::string> rows = this->Row(index);
|
||||||
|
|
||||||
|
std::map<Anope::string, Anope::string>::const_iterator it = rows.find(col);
|
||||||
|
if (it == rows.end())
|
||||||
|
throw Exception("Unknown column name in SQLResult: " + col);
|
||||||
|
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* An interface used by modules to retrieve the results
|
||||||
|
*/
|
||||||
|
class Interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Module *owner;
|
||||||
|
|
||||||
|
Interface(Module *m) : owner(m) { }
|
||||||
|
virtual ~Interface() { }
|
||||||
|
|
||||||
|
virtual void OnResult(const Result &r) = 0;
|
||||||
|
virtual void OnError(const Result &r) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Class providing the SQL service, modules call this to execute queries
|
||||||
|
*/
|
||||||
|
class Provider : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Provider(Module *c, const Anope::string &n) : Service(c, "SQL::Provider", n) { }
|
||||||
|
|
||||||
|
virtual void Run(Interface *i, const Query &query) = 0;
|
||||||
|
|
||||||
|
virtual Result RunQuery(const Query &query) = 0;
|
||||||
|
|
||||||
|
virtual std::vector<Query> CreateTable(const Anope::string &table, const Data &data) = 0;
|
||||||
|
|
||||||
|
virtual Query BuildInsert(const Anope::string &table, unsigned int id, Data &data) = 0;
|
||||||
|
|
||||||
|
virtual Query GetTables(const Anope::string &prefix) = 0;
|
||||||
|
|
||||||
|
virtual Anope::string FromUnixtime(time_t) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct SuspendInfo
|
||||||
|
{
|
||||||
|
Anope::string what, by, reason;
|
||||||
|
time_t when, expires;
|
||||||
|
|
||||||
|
SuspendInfo() { }
|
||||||
|
virtual ~SuspendInfo() { }
|
||||||
|
};
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#include "httpd.h"
|
||||||
|
|
||||||
|
class XMLRPCRequest
|
||||||
|
{
|
||||||
|
std::map<Anope::string, Anope::string> replies;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Anope::string name;
|
||||||
|
Anope::string id;
|
||||||
|
std::deque<Anope::string> data;
|
||||||
|
HTTPReply& r;
|
||||||
|
|
||||||
|
XMLRPCRequest(HTTPReply &_r) : r(_r) { }
|
||||||
|
inline void reply(const Anope::string &dname, const Anope::string &ddata) { this->replies.insert(std::make_pair(dname, ddata)); }
|
||||||
|
inline const std::map<Anope::string, Anope::string> &get_replies() { return this->replies; }
|
||||||
|
};
|
||||||
|
|
||||||
|
class XMLRPCServiceInterface;
|
||||||
|
|
||||||
|
class XMLRPCEvent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~XMLRPCEvent() { }
|
||||||
|
virtual bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class XMLRPCServiceInterface : public Service
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
XMLRPCServiceInterface(Module *creator, const Anope::string &sname) : Service(creator, "XMLRPCServiceInterface", sname) { }
|
||||||
|
|
||||||
|
virtual void Register(XMLRPCEvent *event) = 0;
|
||||||
|
|
||||||
|
virtual void Unregister(XMLRPCEvent *event) = 0;
|
||||||
|
|
||||||
|
virtual Anope::string Sanitize(const Anope::string &string) = 0;
|
||||||
|
|
||||||
|
virtual void Reply(XMLRPCRequest &request) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
+12
-5
@@ -1,8 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
* Copyright (C) 2008-2014 Anope Team <team@anope.org>
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef OPERTYPE_H
|
#ifndef OPERTYPE_H
|
||||||
@@ -11,21 +12,27 @@
|
|||||||
#include "services.h"
|
#include "services.h"
|
||||||
#include "account.h"
|
#include "account.h"
|
||||||
|
|
||||||
|
/* A services operator. Usually made by the configuration file, but not always.
|
||||||
|
* NickAlias::Find(name)->nc->o == this
|
||||||
|
*/
|
||||||
struct CoreExport Oper
|
struct CoreExport Oper
|
||||||
{
|
{
|
||||||
|
/* The oper's nick */
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
|
/* The type of operator this operator is */
|
||||||
OperType *ot;
|
OperType *ot;
|
||||||
|
/* Whether the user must be an IRC operator (umode +o) to be considered a services operator */
|
||||||
bool require_oper;
|
bool require_oper;
|
||||||
Anope::string password;
|
Anope::string password;
|
||||||
Anope::string certfp;
|
Anope::string certfp;
|
||||||
bool config;
|
/* Hosts allowed to use this operator block */
|
||||||
|
|
||||||
std::vector<Anope::string> hosts;
|
std::vector<Anope::string> hosts;
|
||||||
Anope::string vhost;
|
Anope::string vhost;
|
||||||
|
|
||||||
Oper(const Anope::string &n, OperType *o) : name(n), ot(o) { this->config = false; }
|
Oper(const Anope::string &n, OperType *o);
|
||||||
|
virtual ~Oper();
|
||||||
|
|
||||||
virtual ~Oper() { }
|
static std::vector<Oper *> opers;
|
||||||
|
|
||||||
/** Find an oper block by name
|
/** Find an oper block by name
|
||||||
* @param name The name
|
* @param name The name
|
||||||
|
|||||||
+240
-107
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PROTOCOL_H
|
#ifndef PROTOCOL_H
|
||||||
@@ -16,140 +15,274 @@
|
|||||||
|
|
||||||
#include "services.h"
|
#include "services.h"
|
||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
|
#include "service.h"
|
||||||
|
|
||||||
/* Protocol tweaks */
|
/* Encapsultes the IRCd protocol we are speaking. */
|
||||||
|
class CoreExport IRCDProto : public Service
|
||||||
struct IRCDVar
|
|
||||||
{
|
{
|
||||||
const char *name; /* Name of the IRCd command */
|
Anope::string proto_name;
|
||||||
const char *pseudoclient_mode; /* Mode used by BotServ Bots */
|
|
||||||
int svsnick; /* Supports SVSNICK */
|
|
||||||
int vhost; /* Supports vhost */
|
|
||||||
int snline; /* Supports SNline */
|
|
||||||
int sqline; /* Supports SQline */
|
|
||||||
int szline; /* Supports SZline */
|
|
||||||
int join2msg; /* Join 2 Message */
|
|
||||||
int chansqline; /* Supports Channel Sqlines */
|
|
||||||
int quitonkill; /* IRCD sends QUIT when kill */
|
|
||||||
int vident; /* Supports vidents */
|
|
||||||
int svshold; /* Supports svshold */
|
|
||||||
int tsonmode; /* Timestamp on mode changes */
|
|
||||||
int omode; /* On the fly o:lines */
|
|
||||||
int umode; /* change user modes */
|
|
||||||
int knock_needs_i; /* Check if we needed +i when setting NOKNOCK */
|
|
||||||
int svsmode_ucmode; /* Can remove User Channel Modes with SVSMODE */
|
|
||||||
int sglineenforce;
|
|
||||||
int ts6; /* ircd is TS6 */
|
|
||||||
const char *globaltldprefix; /* TLD prefix used for Global */
|
|
||||||
unsigned maxmodes; /* Max modes to send per line */
|
|
||||||
int certfp; /* IRCd sends a SSL users certificate fingerprint */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class CoreExport IRCDProto
|
|
||||||
{
|
|
||||||
protected:
|
protected:
|
||||||
virtual void SendSVSKillInternal(const BotInfo *, const User *, const Anope::string &);
|
IRCDProto(Module *creator, const Anope::string &proto_name);
|
||||||
virtual void SendModeInternal(const BotInfo *, const Channel *, const Anope::string &);
|
|
||||||
virtual void SendModeInternal(const BotInfo *, const User *, const Anope::string &) = 0;
|
|
||||||
virtual void SendKickInternal(const BotInfo *, const Channel *, const User *, const Anope::string &);
|
|
||||||
virtual void SendMessageInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
|
|
||||||
virtual void SendNoticeInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &msg);
|
|
||||||
virtual void SendPrivmsgInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
|
|
||||||
virtual void SendQuitInternal(const User *u, const Anope::string &buf);
|
|
||||||
virtual void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf);
|
|
||||||
virtual void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf);
|
|
||||||
virtual void SendCTCPInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
|
|
||||||
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf);
|
|
||||||
public:
|
public:
|
||||||
virtual ~IRCDProto() { }
|
virtual ~IRCDProto();
|
||||||
|
|
||||||
virtual void SendSVSNOOP(const Server *, bool) { }
|
virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &);
|
||||||
virtual void SendTopic(BotInfo *, Channel *);
|
virtual void SendModeInternal(const MessageSource &, const Channel *, const Anope::string &);
|
||||||
|
virtual void SendModeInternal(const MessageSource &, User *, const Anope::string &);
|
||||||
|
virtual void SendKickInternal(const MessageSource &, const Channel *, User *, const Anope::string &);
|
||||||
|
virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg);
|
||||||
|
virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
||||||
|
virtual void SendQuitInternal(User *, const Anope::string &buf);
|
||||||
|
virtual void SendPartInternal(User *, const Channel *chan, const Anope::string &buf);
|
||||||
|
virtual void SendGlobopsInternal(const MessageSource &, const Anope::string &buf);
|
||||||
|
virtual void SendCTCPInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
||||||
|
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf);
|
||||||
|
|
||||||
|
const Anope::string &GetProtocolName();
|
||||||
|
virtual void Parse(const Anope::string &, Anope::string &, Anope::string &, std::vector<Anope::string> &);
|
||||||
|
virtual Anope::string Format(const Anope::string &source, const Anope::string &message);
|
||||||
|
|
||||||
|
/* Modes used by default by our clients */
|
||||||
|
Anope::string DefaultPseudoclientModes;
|
||||||
|
/* Can we force change a users's nick? */
|
||||||
|
bool CanSVSNick;
|
||||||
|
/* Can we force join or part users? */
|
||||||
|
bool CanSVSJoin;
|
||||||
|
/* Can we set vhosts/vidents on users? */
|
||||||
|
bool CanSetVHost, CanSetVIdent;
|
||||||
|
/* Can we ban specific gecos from being used? */
|
||||||
|
bool CanSNLine;
|
||||||
|
/* Can we ban specific nicknames from being used? */
|
||||||
|
bool CanSQLine;
|
||||||
|
/* Can we ban sepcific channel names from being used? */
|
||||||
|
bool CanSQLineChannel;
|
||||||
|
/* Can we ban by IP? */
|
||||||
|
bool CanSZLine;
|
||||||
|
/* Can we place temporary holds on specific nicknames? */
|
||||||
|
bool CanSVSHold;
|
||||||
|
/* See os_oline */
|
||||||
|
bool CanSVSO;
|
||||||
|
/* See ns_cert */
|
||||||
|
bool CanCertFP;
|
||||||
|
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
|
||||||
|
bool RequiresID;
|
||||||
|
/* If this IRCd has unique ids, whether the IDs and nicknames are ambiguous */
|
||||||
|
bool AmbiguousID;
|
||||||
|
/* The maximum number of modes we are allowed to set with one MODE command */
|
||||||
|
unsigned MaxModes;
|
||||||
|
/* The maximum number of bytes a line may have */
|
||||||
|
unsigned MaxLine;
|
||||||
|
|
||||||
|
/* Retrieves the next free UID or SID */
|
||||||
|
virtual Anope::string UID_Retrieve();
|
||||||
|
virtual Anope::string SID_Retrieve();
|
||||||
|
|
||||||
|
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
|
||||||
|
* will be able to oper on the server.
|
||||||
|
* @param s The server
|
||||||
|
* @param mode Whether to turn NOOP on or off
|
||||||
|
*/
|
||||||
|
virtual void SendSVSNOOP(const Server *s, bool mode) { }
|
||||||
|
|
||||||
|
/** Sets the topic on a channel
|
||||||
|
* @param bi The bot to set the topic from
|
||||||
|
* @param c The channel to set the topic on. The topic being set is Channel::topic
|
||||||
|
*/
|
||||||
|
virtual void SendTopic(const MessageSource &, Channel *);
|
||||||
|
|
||||||
|
/** Sets a vhost on a user.
|
||||||
|
* @param u The user
|
||||||
|
* @param vident The ident to set
|
||||||
|
* @param vhost The vhost to set
|
||||||
|
*/
|
||||||
|
virtual void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) { }
|
||||||
virtual void SendVhostDel(User *) { }
|
virtual void SendVhostDel(User *) { }
|
||||||
|
|
||||||
|
/** Sets an akill. This is a recursive function that can be called multiple times
|
||||||
|
* for the same xline, but for different users, if the xline is not one that can be
|
||||||
|
* enforced by the IRCd, such as a nick/user/host/realname combination ban.
|
||||||
|
* @param u The user affected by the akill, if known
|
||||||
|
* @param x The akill
|
||||||
|
*/
|
||||||
virtual void SendAkill(User *, XLine *) = 0;
|
virtual void SendAkill(User *, XLine *) = 0;
|
||||||
virtual void SendAkillDel(const XLine *) = 0;
|
virtual void SendAkillDel(const XLine *) = 0;
|
||||||
virtual void SendSVSKill(const BotInfo *source, const User *user, const char *fmt, ...);
|
|
||||||
virtual void SendMode(const BotInfo *bi, const Channel *dest, const char *fmt, ...);
|
|
||||||
virtual void SendMode(const BotInfo *bi, const User *u, const char *fmt, ...);
|
|
||||||
virtual void SendClientIntroduction(const User *u) = 0;
|
|
||||||
virtual void SendKick(const BotInfo *bi, const Channel *chan, const User *user, const char *fmt, ...);
|
|
||||||
virtual void SendMessage(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
|
||||||
virtual void SendNotice(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
|
||||||
virtual void SendAction(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
|
||||||
virtual void SendPrivmsg(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
|
||||||
virtual void SendGlobalNotice(const BotInfo *bi, const Server *dest, const Anope::string &msg);
|
|
||||||
virtual void SendGlobalPrivmsg(const BotInfo *bi, const Server *desc, const Anope::string &msg);
|
|
||||||
|
|
||||||
virtual void SendQuit(const User *u, const char *fmt, ...);
|
/* Realname ban */
|
||||||
|
virtual void SendSGLine(User *, const XLine *) { }
|
||||||
|
virtual void SendSGLineDel(const XLine *) { }
|
||||||
|
|
||||||
|
/* IP ban */
|
||||||
|
virtual void SendSZLine(User *u, const XLine *) { }
|
||||||
|
virtual void SendSZLineDel(const XLine *) { }
|
||||||
|
|
||||||
|
/* Nick ban (and sometimes channel) */
|
||||||
|
virtual void SendSQLine(User *, const XLine *x) { }
|
||||||
|
virtual void SendSQLineDel(const XLine *x) { }
|
||||||
|
|
||||||
|
virtual void SendKill(const MessageSource &source, const Anope::string &target, const Anope::string &reason);
|
||||||
|
|
||||||
|
/** Kills a user
|
||||||
|
* @param source Who is doing the kill
|
||||||
|
* @param user The user to be killed
|
||||||
|
* @param fmt Kill reason
|
||||||
|
*/
|
||||||
|
virtual void SendSVSKill(const MessageSource &source, User *user, const char *fmt, ...);
|
||||||
|
|
||||||
|
virtual void SendMode(const MessageSource &source, const Channel *dest, const char *fmt, ...);
|
||||||
|
virtual void SendMode(const MessageSource &source, User *u, const char *fmt, ...);
|
||||||
|
|
||||||
|
/** Introduces a client to the rest of the network
|
||||||
|
* @param u The client to introduce
|
||||||
|
*/
|
||||||
|
virtual void SendClientIntroduction(User *u) = 0;
|
||||||
|
|
||||||
|
virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const char *fmt, ...);
|
||||||
|
|
||||||
|
virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||||
|
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||||
|
virtual void SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||||
|
virtual void SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt, ...);
|
||||||
|
|
||||||
|
virtual void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) = 0;
|
||||||
|
virtual void SendGlobalPrivmsg(BotInfo *bi, const Server *desc, const Anope::string &msg) = 0;
|
||||||
|
|
||||||
|
virtual void SendQuit(User *u, const char *fmt, ...);
|
||||||
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
|
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
|
||||||
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
|
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
|
||||||
virtual void SendJoin(const User *, Channel *, const ChannelStatus *) = 0;
|
|
||||||
virtual void SendSQLineDel(const XLine *x) { }
|
/** Joins one of our users to a channel.
|
||||||
virtual void SendInvite(const BotInfo *bi, const Channel *c, const User *u);
|
* @param u The user to join
|
||||||
virtual void SendPart(const BotInfo *bi, const Channel *chan, const char *fmt, ...);
|
* @param c The channel to join the user to
|
||||||
virtual void SendGlobops(const BotInfo *source, const char *fmt, ...);
|
* @param status The status to set on the user after joining. This may or may not already internally
|
||||||
virtual void SendSQLine(User *, const XLine *x) { }
|
* be set on the user. This may include the modes in the join, but will usually place them on the mode
|
||||||
virtual void SendSquit(Server *, const Anope::string &message);
|
* stacker to be set "soon".
|
||||||
virtual void SendSVSO(const BotInfo *, const Anope::string &, const Anope::string &) { }
|
*/
|
||||||
virtual void SendChangeBotNick(const BotInfo *bi, const Anope::string &newnick);
|
virtual void SendJoin(User *u, Channel *c, const ChannelStatus *status) = 0;
|
||||||
virtual void SendForceNickChange(const User *u, const Anope::string &newnick, time_t when);
|
virtual void SendPart(User *u, const Channel *chan, const char *fmt, ...);
|
||||||
virtual void SendVhost(User *, const Anope::string &, const Anope::string &) { }
|
|
||||||
|
/** Force joins a user that isn't ours to a channel.
|
||||||
|
* @param bi The source of the message
|
||||||
|
* @param u The user to join
|
||||||
|
* @param chan The channel to join the user to
|
||||||
|
* @param param Channel key?
|
||||||
|
*/
|
||||||
|
virtual void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
||||||
|
|
||||||
|
/** Force parts a user that isn't ours from a channel.
|
||||||
|
* @param source The source of the message
|
||||||
|
* @param u The user to part
|
||||||
|
* @param chan The channel to part the user from
|
||||||
|
* @param param part reason, some IRCds don't support this
|
||||||
|
*/
|
||||||
|
virtual void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
||||||
|
|
||||||
|
virtual void SendInvite(const MessageSource &source, const Channel *c, User *u);
|
||||||
|
virtual void SendGlobops(const MessageSource &source, const char *fmt, ...);
|
||||||
|
|
||||||
|
/** Sets oper flags on a user, currently only supported by Unreal
|
||||||
|
*/
|
||||||
|
virtual void SendSVSO(BotInfo *, const Anope::string &, const Anope::string &) { }
|
||||||
|
|
||||||
|
/** Sends a nick change of one of our clients.
|
||||||
|
*/
|
||||||
|
virtual void SendNickChange(User *u, const Anope::string &newnick);
|
||||||
|
|
||||||
|
/** Forces a nick change of a user that isn't ours (SVSNICK)
|
||||||
|
*/
|
||||||
|
virtual void SendForceNickChange(User *u, const Anope::string &newnick, time_t when);
|
||||||
|
|
||||||
|
/** Used to introduce ourselves to our uplink. Usually will SendServer(Me) and any other
|
||||||
|
* initial handshake requirements.
|
||||||
|
*/
|
||||||
virtual void SendConnect() = 0;
|
virtual void SendConnect() = 0;
|
||||||
virtual void SendSVSHold(const Anope::string &) { }
|
|
||||||
virtual void SendSVSHoldDel(const Anope::string &) { }
|
/** Called right before we begin our burst, after we have handshaked successfully with the uplink/
|
||||||
virtual void SendSGLineDel(const XLine *) { }
|
* At this point none of our servesr, users, or channels exist on the uplink
|
||||||
virtual void SendSZLineDel(const XLine *) { }
|
*/
|
||||||
virtual void SendSZLine(User *u, const XLine *) { }
|
|
||||||
virtual void SendSGLine(User *, const XLine *) { }
|
|
||||||
virtual void SendCTCP(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
|
||||||
virtual void SendSVSJoin(const BotInfo *bi, const Anope::string &, const Anope::string &, const Anope::string &) { }
|
|
||||||
virtual void SendSWhois(const BotInfo *bi, const Anope::string &, const Anope::string &) { }
|
|
||||||
virtual void SendBOB() { }
|
virtual void SendBOB() { }
|
||||||
virtual void SendEOB() { }
|
virtual void SendEOB() { }
|
||||||
|
|
||||||
|
virtual void SendSVSHold(const Anope::string &, time_t) { }
|
||||||
|
virtual void SendSVSHoldDel(const Anope::string &) { }
|
||||||
|
|
||||||
|
virtual void SendSWhois(const MessageSource &, const Anope::string &, const Anope::string &) { }
|
||||||
|
|
||||||
|
/** Introduces a server to the uplink
|
||||||
|
*/
|
||||||
virtual void SendServer(const Server *) = 0;
|
virtual void SendServer(const Server *) = 0;
|
||||||
virtual bool IsNickValid(const Anope::string &) { return true; }
|
virtual void SendSquit(Server *, const Anope::string &message);
|
||||||
virtual bool IsChannelValid(const Anope::string &);
|
|
||||||
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...);
|
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...);
|
||||||
virtual void SendLogin(User *u) = 0;
|
|
||||||
|
virtual void SendLogin(User *u, NickAlias *na) = 0;
|
||||||
virtual void SendLogout(User *u) = 0;
|
virtual void SendLogout(User *u) = 0;
|
||||||
|
|
||||||
/** Send a channel creation message to the uplink.
|
/** Send a channel creation message to the uplink.
|
||||||
* On most TS6 IRCds this is a SJOIN with no nick
|
* On most TS6 IRCds this is a SJOIN with no nick
|
||||||
*/
|
*/
|
||||||
virtual void SendChannel(Channel *c) { }
|
virtual void SendChannel(Channel *c) { }
|
||||||
|
|
||||||
|
/** Make the user an IRC operator
|
||||||
|
* Normally this is a simple +o, though some IRCds require us to send the oper type
|
||||||
|
*/
|
||||||
|
virtual void SendOper(User *u);
|
||||||
|
|
||||||
|
virtual void SendSASLMessage(const SASL::Message &) { }
|
||||||
|
virtual void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) { }
|
||||||
|
|
||||||
|
virtual bool IsNickValid(const Anope::string &);
|
||||||
|
virtual bool IsChannelValid(const Anope::string &);
|
||||||
|
virtual bool IsIdentValid(const Anope::string &);
|
||||||
|
virtual bool IsHostValid(const Anope::string &);
|
||||||
|
virtual bool IsExtbanValid(const Anope::string &) { return false; }
|
||||||
|
|
||||||
|
/** Retrieve the maximum number of list modes settable on this channel
|
||||||
|
* Defaults to Config->ListSize
|
||||||
|
*/
|
||||||
|
virtual unsigned GetMaxListFor(Channel *c);
|
||||||
|
|
||||||
|
virtual Anope::string NormalizeMask(const Anope::string &mask);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport IRCdMessage
|
class CoreExport MessageSource
|
||||||
{
|
{
|
||||||
|
Anope::string source;
|
||||||
|
User *u;
|
||||||
|
Server *s;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool On436(const Anope::string &, const std::vector<Anope::string> &);
|
MessageSource(const Anope::string &);
|
||||||
virtual bool OnAway(const Anope::string &, const std::vector<Anope::string> &);
|
MessageSource(User *u);
|
||||||
virtual bool OnJoin(const Anope::string &, const std::vector<Anope::string> &);
|
MessageSource(Server *s);
|
||||||
virtual bool OnKick(const Anope::string &, const std::vector<Anope::string> &);
|
const Anope::string &GetName() const;
|
||||||
virtual bool OnKill(const Anope::string &, const std::vector<Anope::string> &);
|
const Anope::string &GetSource() const;
|
||||||
virtual bool OnMode(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
User *GetUser() const;
|
||||||
virtual bool OnUID(const Anope::string &, const std::vector<Anope::string> &);
|
BotInfo *GetBot() const;
|
||||||
virtual bool OnNick(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
Server *GetServer() const;
|
||||||
virtual bool OnPart(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
virtual bool OnPing(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
virtual bool OnPrivmsg(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
virtual bool OnQuit(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
virtual bool OnServer(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
|
||||||
virtual bool OnSQuit(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
virtual bool OnTopic(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
|
||||||
virtual bool OnWhois(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
virtual bool OnCapab(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
virtual bool OnSJoin(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
|
||||||
virtual bool OnError(const Anope::string &, const std::vector<Anope::string> &);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CoreExport IRCDVar *ircd;
|
enum IRCDMessageFlag
|
||||||
extern CoreExport IRCDProto *ircdproto;
|
{
|
||||||
extern CoreExport IRCdMessage *ircdmessage;
|
IRCDMESSAGE_SOFT_LIMIT,
|
||||||
|
IRCDMESSAGE_REQUIRE_SERVER,
|
||||||
|
IRCDMESSAGE_REQUIRE_USER
|
||||||
|
};
|
||||||
|
|
||||||
extern CoreExport void pmodule_ircd_proto(IRCDProto *);
|
class CoreExport IRCDMessage : public Service
|
||||||
extern CoreExport void pmodule_ircd_var(IRCDVar *ircdvar);
|
{
|
||||||
extern CoreExport void pmodule_ircd_message(IRCdMessage *message);
|
Anope::string name;
|
||||||
|
unsigned param_count;
|
||||||
|
std::set<IRCDMessageFlag> flags;
|
||||||
|
public:
|
||||||
|
IRCDMessage(Module *owner, const Anope::string &n, unsigned p = 0);
|
||||||
|
unsigned GetParamCount() const;
|
||||||
|
virtual void Run(MessageSource &, const std::vector<Anope::string> ¶ms) = 0;
|
||||||
|
|
||||||
|
void SetFlag(IRCDMessageFlag f) { flags.insert(f); }
|
||||||
|
bool HasFlag(IRCDMessageFlag f) const { return flags.count(f); }
|
||||||
|
};
|
||||||
|
|
||||||
|
extern CoreExport IRCDProto *IRCD;
|
||||||
|
|
||||||
#endif // PROTOCOL_H
|
#endif // PROTOCOL_H
|
||||||
|
|||||||
+84
-281
@@ -1,15 +1,15 @@
|
|||||||
/* Modular support
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2008-2012 Anope Team
|
* (C) 2008-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef REGCHANNEL_H
|
#ifndef REGCHANNEL_H
|
||||||
#define REGCHANNEL_H
|
#define REGCHANNEL_H
|
||||||
|
|
||||||
#include "botserv.h"
|
|
||||||
#include "memo.h"
|
#include "memo.h"
|
||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
#include "extensible.h"
|
#include "extensible.h"
|
||||||
@@ -18,208 +18,85 @@
|
|||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
#include "bots.h"
|
#include "bots.h"
|
||||||
|
|
||||||
typedef Anope::insensitive_map<ChannelInfo *> registered_channel_map;
|
typedef Anope::hash_map<ChannelInfo *> registered_channel_map;
|
||||||
|
|
||||||
extern CoreExport serialize_checker<registered_channel_map> RegisteredChannelList;
|
extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList;
|
||||||
|
|
||||||
/** Flags used for the ChannelInfo class
|
|
||||||
*/
|
|
||||||
enum ChannelInfoFlag
|
|
||||||
{
|
|
||||||
CI_BEGIN,
|
|
||||||
|
|
||||||
/* Retain the topic even after the channel is emptied */
|
|
||||||
CI_KEEPTOPIC,
|
|
||||||
/* Don't allow non-authorized users to be opped */
|
|
||||||
CI_SECUREOPS,
|
|
||||||
/* Hide channel from ChanServ LIST command */
|
|
||||||
CI_PRIVATE,
|
|
||||||
/* Topic can only be changed by SET TOPIC */
|
|
||||||
CI_TOPICLOCK,
|
|
||||||
/* Only users on the access list may join */
|
|
||||||
CI_RESTRICTED,
|
|
||||||
/* Don't allow ChanServ and BotServ commands to do bad things to users with higher access levels */
|
|
||||||
CI_PEACE,
|
|
||||||
/* Don't allow any privileges unless a user is IDENTIFIED with NickServ */
|
|
||||||
CI_SECURE,
|
|
||||||
/* Channel does not expire */
|
|
||||||
CI_NO_EXPIRE,
|
|
||||||
/* Channel memo limit may not be changed */
|
|
||||||
CI_MEMO_HARDMAX,
|
|
||||||
/* Stricter control of channel founder status */
|
|
||||||
CI_SECUREFOUNDER,
|
|
||||||
/* Sign kicks with the user who did the kick */
|
|
||||||
CI_SIGNKICK,
|
|
||||||
/* Sign kicks if level is < than the one defined by the SIGNKIGK level */
|
|
||||||
CI_SIGNKICK_LEVEL,
|
|
||||||
/* Channel is suspended */
|
|
||||||
CI_SUSPENDED,
|
|
||||||
/* Channel still exists when emptied, this can be caused by setting a perm
|
|
||||||
* channel mode (+P on InspIRCd) or /cs set #chan persist on.
|
|
||||||
* This keeps the service bot in the channel regardless if a +P type mode
|
|
||||||
* is set or not
|
|
||||||
*/
|
|
||||||
CI_PERSIST,
|
|
||||||
/* Chanstats are enabled */
|
|
||||||
CI_STATS,
|
|
||||||
|
|
||||||
CI_END
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string ChannelInfoFlagStrings[] = {
|
|
||||||
"BEGIN", "KEEPTOPIC", "SECUREOPS", "PRIVATE", "TOPICLOCK", "RESTRICTED",
|
|
||||||
"PEACE", "SECURE", "NO_EXPIRE", "MEMO_HARDMAX", "SECUREFOUNDER",
|
|
||||||
"SIGNKICK", "SIGNKICK_LEVEL", "SUSPENDED", "PERSIST", "STATS", ""
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Flags for badwords
|
|
||||||
*/
|
|
||||||
enum BadWordType
|
|
||||||
{
|
|
||||||
/* Always kicks if the word is said */
|
|
||||||
BW_ANY,
|
|
||||||
/* User must way the entire word */
|
|
||||||
BW_SINGLE,
|
|
||||||
/* The word has to start with the badword */
|
|
||||||
BW_START,
|
|
||||||
/* The word has to end with the badword */
|
|
||||||
BW_END
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Structure used to contain bad words. */
|
|
||||||
struct CoreExport BadWord : Serializable
|
|
||||||
{
|
|
||||||
ChannelInfo *ci;
|
|
||||||
Anope::string word;
|
|
||||||
BadWordType type;
|
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
|
||||||
Serialize::Data serialize() const anope_override;
|
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Flags for auto kick
|
|
||||||
*/
|
|
||||||
enum AutoKickFlag
|
|
||||||
{
|
|
||||||
/* Is by nick core, not mask */
|
|
||||||
AK_ISNICK
|
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string AutoKickFlagString[] = { "AK_ISNICK", "" };
|
|
||||||
|
|
||||||
/* AutoKick data. */
|
/* AutoKick data. */
|
||||||
class CoreExport AutoKick : public Flags<AutoKickFlag>, public Serializable
|
class CoreExport AutoKick : public Serializable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AutoKick();
|
/* Channel this autokick is on */
|
||||||
serialize_obj<ChannelInfo> ci;
|
Serialize::Reference<ChannelInfo> ci;
|
||||||
/* Only one of these can be in use */
|
|
||||||
Anope::string mask;
|
Anope::string mask;
|
||||||
serialize_obj<NickCore> nc;
|
Serialize::Reference<NickCore> nc;
|
||||||
|
|
||||||
Anope::string reason;
|
Anope::string reason;
|
||||||
Anope::string creator;
|
Anope::string creator;
|
||||||
time_t addtime;
|
time_t addtime;
|
||||||
time_t last_used;
|
time_t last_used;
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
AutoKick();
|
||||||
Serialize::Data serialize() const anope_override;
|
~AutoKick();
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
void Serialize(Serialize::Data &data) const anope_override;
|
||||||
|
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CoreExport ModeLock : Serializable
|
/* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||||
{
|
*/
|
||||||
public:
|
class CoreExport ChannelInfo : public Serializable, public Extensible
|
||||||
serialize_obj<ChannelInfo> ci;
|
|
||||||
bool set;
|
|
||||||
ChannelModeName name;
|
|
||||||
Anope::string param;
|
|
||||||
Anope::string setter;
|
|
||||||
time_t created;
|
|
||||||
|
|
||||||
ModeLock(ChannelInfo *ch, bool s, ChannelModeName n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime);
|
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
|
||||||
Serialize::Data serialize() const anope_override;
|
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CoreExport LogSetting : Serializable
|
|
||||||
{
|
|
||||||
serialize_obj<ChannelInfo> ci;
|
|
||||||
/* Our service name of the command */
|
|
||||||
Anope::string service_name;
|
|
||||||
/* The name of the client the command is on */
|
|
||||||
Anope::string command_service;
|
|
||||||
/* Name of the command to the user, can have spaces */
|
|
||||||
Anope::string command_name;
|
|
||||||
Anope::string method, extra;
|
|
||||||
Anope::string creator;
|
|
||||||
time_t created;
|
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
|
||||||
Serialize::Data serialize() const anope_override;
|
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
|
||||||
};
|
|
||||||
|
|
||||||
class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, CI_END>, public Serializable
|
|
||||||
{
|
{
|
||||||
|
/* channels who reference this one */
|
||||||
|
Anope::map<int> references;
|
||||||
private:
|
private:
|
||||||
serialize_obj<NickCore> founder; /* Channel founder */
|
Serialize::Reference<NickCore> founder; /* Channel founder */
|
||||||
serialize_checker<std::vector<ChanAccess *> > access; /* List of authorized users */
|
Serialize::Reference<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */
|
||||||
serialize_checker<std::vector<AutoKick *> > akick; /* List of users to kickban */
|
Serialize::Checker<std::vector<ChanAccess *> > access; /* List of authorized users */
|
||||||
serialize_checker<std::vector<BadWord *> > badwords; /* List of badwords */
|
Serialize::Checker<std::vector<AutoKick *> > akick; /* List of users to kickban */
|
||||||
std::map<Anope::string, int16_t> levels;
|
Anope::map<int16_t> levels;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::multimap<ChannelModeName, ModeLock *> ModeList;
|
friend class ChanAccess;
|
||||||
serialize_checker<ModeList> mode_locks;
|
friend class AutoKick;
|
||||||
serialize_checker<std::vector<LogSetting *> > log_settings;
|
|
||||||
|
|
||||||
/** Default constructor
|
Anope::string name; /* Channel name */
|
||||||
* @param chname The channel name
|
|
||||||
*/
|
|
||||||
ChannelInfo(const Anope::string &chname);
|
|
||||||
|
|
||||||
/** Copy constructor
|
|
||||||
* @param ci The ChannelInfo to copy settings to
|
|
||||||
*/
|
|
||||||
ChannelInfo(const ChannelInfo &ci);
|
|
||||||
|
|
||||||
/** Default destructor
|
|
||||||
*/
|
|
||||||
~ChannelInfo();
|
|
||||||
|
|
||||||
Anope::string name; /* Channel name */
|
|
||||||
serialize_obj<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */
|
|
||||||
Anope::string desc;
|
Anope::string desc;
|
||||||
|
|
||||||
time_t time_registered;
|
time_t time_registered;
|
||||||
time_t last_used;
|
time_t last_used;
|
||||||
|
|
||||||
Anope::string last_topic; /* The last topic that was set on this channel */
|
Anope::string last_topic; /* The last topic that was set on this channel */
|
||||||
Anope::string last_topic_setter; /* Setter */
|
Anope::string last_topic_setter; /* Setter */
|
||||||
time_t last_topic_time; /* Time */
|
time_t last_topic_time; /* Time */
|
||||||
|
|
||||||
|
Channel::ModeList last_modes; /* The last modes set on this channel */
|
||||||
|
|
||||||
int16_t bantype;
|
int16_t bantype;
|
||||||
|
|
||||||
MemoInfo memos;
|
MemoInfo memos;
|
||||||
|
|
||||||
Channel *c; /* Pointer to channel record (if channel is currently in use) */
|
Channel *c; /* Pointer to channel, if the channel exists */
|
||||||
|
|
||||||
/* For BotServ */
|
/* For BotServ */
|
||||||
serialize_obj<BotInfo> bi; /* Bot used on this channel */
|
Serialize::Reference<BotInfo> bi; /* Bot used on this channel */
|
||||||
Flags<BotServFlag> botflags;
|
|
||||||
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
|
|
||||||
|
|
||||||
int16_t capsmin, capspercent; /* For CAPS kicker */
|
time_t banexpire; /* Time bans expire in */
|
||||||
int16_t floodlines, floodsecs; /* For FLOOD kicker */
|
|
||||||
int16_t repeattimes; /* For REPEAT kicker */
|
|
||||||
|
|
||||||
const Anope::string serialize_name() const anope_override;
|
/** Constructor
|
||||||
Serialize::Data serialize() const anope_override;
|
* @param chname The channel name
|
||||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
*/
|
||||||
|
ChannelInfo(const Anope::string &chname);
|
||||||
|
|
||||||
|
/** Copy constructor
|
||||||
|
* @param ci The ChannelInfo to copy settings from
|
||||||
|
*/
|
||||||
|
ChannelInfo(const ChannelInfo &ci);
|
||||||
|
|
||||||
|
~ChannelInfo();
|
||||||
|
|
||||||
|
void Serialize(Serialize::Data &data) const anope_override;
|
||||||
|
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
|
|
||||||
/** Change the founder of the channek
|
/** Change the founder of the channek
|
||||||
* @params nc The new founder
|
* @params nc The new founder
|
||||||
@@ -231,6 +108,9 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
|||||||
*/
|
*/
|
||||||
NickCore *GetFounder() const;
|
NickCore *GetFounder() const;
|
||||||
|
|
||||||
|
void SetSuccessor(NickCore *nc);
|
||||||
|
NickCore *GetSuccessor() const;
|
||||||
|
|
||||||
/** Find which bot should send mode/topic/etc changes for this channel
|
/** Find which bot should send mode/topic/etc changes for this channel
|
||||||
* @return The bot
|
* @return The bot
|
||||||
*/
|
*/
|
||||||
@@ -261,21 +141,18 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
|||||||
*/
|
*/
|
||||||
unsigned GetAccessCount() const;
|
unsigned GetAccessCount() const;
|
||||||
|
|
||||||
|
/** Get the number of access entries for this channel,
|
||||||
|
* including those that are on other channels.
|
||||||
|
*/
|
||||||
|
unsigned GetDeepAccessCount() const;
|
||||||
|
|
||||||
/** Erase an entry from the channel access list
|
/** Erase an entry from the channel access list
|
||||||
*
|
*
|
||||||
* @param index The index in the access list vector
|
* @param index The index in the access list vector
|
||||||
*
|
*
|
||||||
* Clears the memory used by the given access entry and removes it from the vector.
|
* @return The erased entry
|
||||||
*/
|
*/
|
||||||
void EraseAccess(unsigned index);
|
ChanAccess *EraseAccess(unsigned index);
|
||||||
|
|
||||||
/** Erase an entry from the channel access list
|
|
||||||
*
|
|
||||||
* @param taccess The access to remove
|
|
||||||
*
|
|
||||||
* Clears the memory used by the given access entry and removes it from the vector.
|
|
||||||
*/
|
|
||||||
void EraseAccess(const ChanAccess *taccess);
|
|
||||||
|
|
||||||
/** Clear the entire channel access list
|
/** Clear the entire channel access list
|
||||||
*
|
*
|
||||||
@@ -321,103 +198,10 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
|||||||
*/
|
*/
|
||||||
void ClearAkick();
|
void ClearAkick();
|
||||||
|
|
||||||
/** Add a badword to the badword list
|
/** Get the level entries for the channel.
|
||||||
* @param word The badword
|
* @return The levels for the channel.
|
||||||
* @param type The type (SINGLE START END)
|
|
||||||
* @return The badword
|
|
||||||
*/
|
*/
|
||||||
BadWord* AddBadWord(const Anope::string &word, BadWordType type);
|
const Anope::map<int16_t> &GetLevelEntries();
|
||||||
|
|
||||||
/** Get a badword structure by index
|
|
||||||
* @param index The index
|
|
||||||
* @return The badword
|
|
||||||
*/
|
|
||||||
BadWord* GetBadWord(unsigned index) const;
|
|
||||||
|
|
||||||
/** Get how many badwords are on this channel
|
|
||||||
* @return The number of badwords in the vector
|
|
||||||
*/
|
|
||||||
unsigned GetBadWordCount() const;
|
|
||||||
|
|
||||||
/** Remove a badword
|
|
||||||
* @param index The index of the badword
|
|
||||||
*/
|
|
||||||
void EraseBadWord(unsigned index);
|
|
||||||
|
|
||||||
/** Clear all badwords from the channel
|
|
||||||
*/
|
|
||||||
void ClearBadWords();
|
|
||||||
|
|
||||||
/** Check if a mode is mlocked
|
|
||||||
* @param mode The mode
|
|
||||||
* @param An optional param
|
|
||||||
* @param status True to check mlock on, false for mlock off
|
|
||||||
* @return true on success, false on fail
|
|
||||||
*/
|
|
||||||
bool HasMLock(ChannelMode *mode, const Anope::string ¶m, bool status) const;
|
|
||||||
|
|
||||||
/** Set a mlock
|
|
||||||
* @param mode The mode
|
|
||||||
* @param status True for mlock on, false for mlock off
|
|
||||||
* @param param An optional param arg for + mlocked modes
|
|
||||||
* @param setter Who is setting the mlock
|
|
||||||
* @param created When the mlock was created
|
|
||||||
* @return true on success, false on failure (module blocking)
|
|
||||||
*/
|
|
||||||
bool SetMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "", Anope::string setter = "", time_t created = Anope::CurTime);
|
|
||||||
|
|
||||||
/** Remove a mlock
|
|
||||||
* @param mode The mode
|
|
||||||
* @param status True for mlock on, false for mlock off
|
|
||||||
* @param param The param of the mode, required if it is a list or status mode
|
|
||||||
* @return true on success, false on failure
|
|
||||||
*/
|
|
||||||
bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "");
|
|
||||||
|
|
||||||
/** Clear all mlocks on the channel
|
|
||||||
*/
|
|
||||||
void ClearMLock();
|
|
||||||
|
|
||||||
/** Get all of the mlocks for this channel
|
|
||||||
* @return The mlocks
|
|
||||||
*/
|
|
||||||
const ModeList &GetMLock() const;
|
|
||||||
|
|
||||||
/** Get a list of modes on a channel
|
|
||||||
* @param Name The mode name to get a list of
|
|
||||||
* @return a pair of iterators for the beginning and end of the list
|
|
||||||
*/
|
|
||||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(ChannelModeName Name);
|
|
||||||
|
|
||||||
/** Get details for a specific mlock
|
|
||||||
* @param mname The mode name
|
|
||||||
* @param An optional param to match with
|
|
||||||
* @return The MLock, if any
|
|
||||||
*/
|
|
||||||
const ModeLock *GetMLock(ChannelModeName mname, const Anope::string ¶m = "");
|
|
||||||
|
|
||||||
/** Get the current mode locks as a string
|
|
||||||
* @param complete True to show mlock parameters aswell
|
|
||||||
* @return A string of mode locks, eg: +nrt
|
|
||||||
*/
|
|
||||||
Anope::string GetMLockAsString(bool complete) const;
|
|
||||||
|
|
||||||
/** Check whether a user is permitted to be on this channel
|
|
||||||
* @param u The user
|
|
||||||
* @return true if they are allowed, false if they aren't and were kicked
|
|
||||||
*/
|
|
||||||
bool CheckKick(User *user);
|
|
||||||
|
|
||||||
/** Check the channel topic
|
|
||||||
* If topic lock is enabled will change the topic back, else it records
|
|
||||||
* the new topic in the ChannelInfo
|
|
||||||
*/
|
|
||||||
void CheckTopic();
|
|
||||||
|
|
||||||
/** Restore the channel topic, used on channel creation when not syncing with the uplink
|
|
||||||
* and after uplink sync
|
|
||||||
*/
|
|
||||||
void RestoreTopic();
|
|
||||||
|
|
||||||
/** Get the level for a privilege
|
/** Get the level for a privilege
|
||||||
* @param priv The privilege name
|
* @param priv The privilege name
|
||||||
@@ -440,11 +224,30 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
|||||||
/** Clear all privileges from the channel
|
/** Clear all privileges from the channel
|
||||||
*/
|
*/
|
||||||
void ClearLevels();
|
void ClearLevels();
|
||||||
|
|
||||||
|
/** Gets a ban mask for the given user based on the bantype
|
||||||
|
* of the channel.
|
||||||
|
* @param u The user
|
||||||
|
* @return A ban mask that affects the user
|
||||||
|
*/
|
||||||
|
Anope::string GetIdealBan(User *u) const;
|
||||||
|
|
||||||
|
/** Finds a ChannelInfo
|
||||||
|
* @param name channel name to lookup
|
||||||
|
* @return the ChannelInfo associated with the channel
|
||||||
|
*/
|
||||||
|
static ChannelInfo* Find(const Anope::string &name);
|
||||||
|
|
||||||
|
void AddChannelReference(const Anope::string &what);
|
||||||
|
void RemoveChannelReference(const Anope::string &what);
|
||||||
|
void GetChannelReferences(std::deque<Anope::string> &chans);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CoreExport ChannelInfo *cs_findchan(const Anope::string &chan);
|
/** Is the user the real founder?
|
||||||
|
* @param user The user
|
||||||
|
* @param ci The channel
|
||||||
|
* @return true or false
|
||||||
|
*/
|
||||||
extern CoreExport bool IsFounder(const User *user, const ChannelInfo *ci);
|
extern CoreExport bool IsFounder(const User *user, const ChannelInfo *ci);
|
||||||
extern CoreExport void update_cs_lastseen(User *user, ChannelInfo *ci);
|
|
||||||
extern CoreExport int get_idealban(const ChannelInfo *ci, User *u, Anope::string &ret);
|
|
||||||
|
|
||||||
#endif // REGCHANNEL_H
|
#endif // REGCHANNEL_H
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
|
|||||||
+169
-114
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -20,219 +20,277 @@
|
|||||||
|
|
||||||
namespace Serialize
|
namespace Serialize
|
||||||
{
|
{
|
||||||
enum DataType
|
class Data
|
||||||
{
|
{
|
||||||
DT_TEXT,
|
public:
|
||||||
DT_INT
|
enum Type
|
||||||
|
{
|
||||||
|
DT_TEXT,
|
||||||
|
DT_INT
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~Data() { }
|
||||||
|
|
||||||
|
virtual std::iostream& operator[](const Anope::string &key) = 0;
|
||||||
|
virtual std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); }
|
||||||
|
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
||||||
|
|
||||||
|
virtual void SetType(const Anope::string &key, Type t) { }
|
||||||
|
virtual Type GetType(const Anope::string &key) const { return DT_TEXT; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern void RegisterTypes();
|
||||||
|
extern void CheckTypes();
|
||||||
|
|
||||||
|
class Type;
|
||||||
|
template<typename T> class Checker;
|
||||||
|
template<typename T> class Reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
class CoreExport stringstream : public std::stringstream
|
/** A serialziable object. Serializable objects can be serialized into
|
||||||
{
|
* abstract data types (Serialize::Data), and then reconstructed or
|
||||||
private:
|
* updated later at any time.
|
||||||
Serialize::DataType type;
|
*/
|
||||||
unsigned _max;
|
|
||||||
|
|
||||||
public:
|
|
||||||
stringstream();
|
|
||||||
stringstream(const stringstream &ss);
|
|
||||||
Anope::string astr() const;
|
|
||||||
|
|
||||||
template<typename T> std::istream &operator>>(T &val)
|
|
||||||
{
|
|
||||||
std::istringstream is(this->str());
|
|
||||||
is >> val;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
std::istream &operator>>(Anope::string &val);
|
|
||||||
|
|
||||||
bool operator==(const stringstream &other) const;
|
|
||||||
bool operator!=(const stringstream &other) const;
|
|
||||||
|
|
||||||
stringstream &setType(Serialize::DataType t);
|
|
||||||
Serialize::DataType getType() const;
|
|
||||||
stringstream &setMax(unsigned m);
|
|
||||||
unsigned getMax() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace Serialize
|
|
||||||
{
|
|
||||||
typedef std::map<Anope::string, stringstream> Data;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void RegisterTypes();
|
|
||||||
|
|
||||||
class CoreExport Serializable : public virtual Base
|
class CoreExport Serializable : public virtual Base
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static std::list<Serializable *> *serializable_items;
|
/* A list of every serializable item in Anope.
|
||||||
|
* Some of these are static and constructed at runtime,
|
||||||
private:
|
* so this list must be on the heap, as it is not always
|
||||||
|
* constructed before other objects are if it isn't.
|
||||||
|
*/
|
||||||
|
static std::list<Serializable *> *SerializableItems;
|
||||||
|
friend class Serialize::Type;
|
||||||
|
/* The type of item this object is */
|
||||||
|
Serialize::Type *s_type;
|
||||||
|
/* Iterator into serializable_items */
|
||||||
std::list<Serializable *>::iterator s_iter;
|
std::list<Serializable *>::iterator s_iter;
|
||||||
Serialize::Data last_commit;
|
/* The hash of the last serialized form of this object commited to the database */
|
||||||
|
size_t last_commit;
|
||||||
|
/* The last time this object was commited to the database */
|
||||||
time_t last_commit_time;
|
time_t last_commit_time;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Serializable();
|
Serializable(const Anope::string &serialize_type);
|
||||||
Serializable(const Serializable &);
|
Serializable(const Serializable &);
|
||||||
|
|
||||||
virtual ~Serializable();
|
|
||||||
|
|
||||||
Serializable &operator=(const Serializable &);
|
Serializable &operator=(const Serializable &);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
unsigned int id;
|
virtual ~Serializable();
|
||||||
|
|
||||||
void destroy();
|
/* Unique ID (per type, not globally) for this object */
|
||||||
|
uint64_t id;
|
||||||
|
|
||||||
|
/* Only used by redis, to ignore updates */
|
||||||
|
unsigned short redis_ignore;
|
||||||
|
|
||||||
|
/** Marks the object as potentially being updated "soon".
|
||||||
|
*/
|
||||||
void QueueUpdate();
|
void QueueUpdate();
|
||||||
|
|
||||||
bool IsCached();
|
bool IsCached(Serialize::Data &);
|
||||||
void UpdateCache();
|
void UpdateCache(Serialize::Data &);
|
||||||
|
|
||||||
bool IsTSCached();
|
bool IsTSCached();
|
||||||
void UpdateTS();
|
void UpdateTS();
|
||||||
|
|
||||||
virtual const Anope::string serialize_name() const = 0;
|
/** Get the type of serializable object this is
|
||||||
virtual Serialize::Data serialize() const = 0;
|
* @return The serializable object type
|
||||||
|
*/
|
||||||
|
Serialize::Type* GetSerializableType() const { return this->s_type; }
|
||||||
|
|
||||||
|
virtual void Serialize(Serialize::Data &data) const = 0;
|
||||||
|
|
||||||
static const std::list<Serializable *> &GetItems();
|
static const std::list<Serializable *> &GetItems();
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport SerializeType
|
/* A serializable type. There should be one of these classes for each type
|
||||||
|
* of class that inherits from Serialiable. Used for unserializing objects
|
||||||
|
* of this type, as it requires a function pointer to a static member function.
|
||||||
|
*/
|
||||||
|
class CoreExport Serialize::Type : public Base
|
||||||
{
|
{
|
||||||
typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &);
|
typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &);
|
||||||
|
|
||||||
static std::vector<Anope::string> type_order;
|
static std::vector<Anope::string> TypeOrder;
|
||||||
static Anope::map<SerializeType *> types;
|
static std::map<Anope::string, Serialize::Type *> Types;
|
||||||
|
|
||||||
|
/* The name of this type, should be a class name */
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
unserialize_func unserialize;
|
unserialize_func unserialize;
|
||||||
|
/* Owner of this type. Used for placing objects of this type in separate databases
|
||||||
|
* based on what module, if any, owns it.
|
||||||
|
*/
|
||||||
|
Module *owner;
|
||||||
|
|
||||||
|
/* The timesatmp for this type. All objects of this type are as up to date as
|
||||||
|
* this timestamp. if curtime == timestamp then we have the most up to date
|
||||||
|
* version of every object of this type.
|
||||||
|
*/
|
||||||
time_t timestamp;
|
time_t timestamp;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::map<unsigned int, Serializable *> objects;
|
/* Map of Serializable::id to Serializable objects */
|
||||||
|
std::map<uint64_t, Serializable *> objects;
|
||||||
|
|
||||||
SerializeType(const Anope::string &n, unserialize_func f);
|
/** Creates a new serializable type
|
||||||
~SerializeType();
|
* @param n Type name
|
||||||
|
* @param f Func to unserialize objects
|
||||||
|
* @param owner Owner of this type. Leave NULL for the core.
|
||||||
|
*/
|
||||||
|
Type(const Anope::string &n, unserialize_func f, Module *owner = NULL);
|
||||||
|
~Type();
|
||||||
|
|
||||||
const Anope::string &GetName();
|
/** Gets the name for this type
|
||||||
|
* @return The name, eg "NickAlias"
|
||||||
|
*/
|
||||||
|
const Anope::string &GetName() { return this->name; }
|
||||||
|
|
||||||
|
/** Unserialized an object.
|
||||||
|
* @param obj NULL if this object doesn't yet exist. If this isn't NULL, instead
|
||||||
|
* update the contents of this object.
|
||||||
|
* @param data The data to unserialize
|
||||||
|
* @return The unserialized object. If obj != NULL this should be obj.
|
||||||
|
*/
|
||||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||||
|
|
||||||
|
/** Check if this object type has any pending changes and update them.
|
||||||
|
*/
|
||||||
void Check();
|
void Check();
|
||||||
|
|
||||||
|
/** Gets the timestamp for the object type. That is, the time we know
|
||||||
|
* all objects of this type are updated at least to.
|
||||||
|
*/
|
||||||
time_t GetTimestamp() const;
|
time_t GetTimestamp() const;
|
||||||
|
|
||||||
|
/** Bumps object type timestamp to current time
|
||||||
|
*/
|
||||||
void UpdateTimestamp();
|
void UpdateTimestamp();
|
||||||
|
|
||||||
static SerializeType *Find(const Anope::string &name);
|
Module* GetOwner() const { return this->owner; }
|
||||||
|
|
||||||
|
static Serialize::Type *Find(const Anope::string &name);
|
||||||
|
|
||||||
static const std::vector<Anope::string> &GetTypeOrder();
|
static const std::vector<Anope::string> &GetTypeOrder();
|
||||||
|
|
||||||
|
static const std::map<Anope::string, Serialize::Type *>& GetTypes();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Should be used to hold lists and other objects of a specific type,
|
||||||
|
* but not a specific object. Used for ensuring that any access to
|
||||||
|
* this object type is always up to date. These are usually constructed
|
||||||
|
* at run time, before main is called, so no types are registered. This
|
||||||
|
* is why there are static Serialize::Type* variables in every function.
|
||||||
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class serialize_checker
|
class Serialize::Checker
|
||||||
{
|
{
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
T obj;
|
T obj;
|
||||||
|
mutable ::Reference<Serialize::Type> type;
|
||||||
|
|
||||||
|
inline void Check() const
|
||||||
|
{
|
||||||
|
if (!type)
|
||||||
|
type = Serialize::Type::Find(this->name);
|
||||||
|
if (type)
|
||||||
|
type->Check();
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
serialize_checker(const Anope::string &n) : name(n) { }
|
Checker(const Anope::string &n) : name(n), type(NULL) { }
|
||||||
|
|
||||||
inline const T* operator->() const
|
inline const T* operator->() const
|
||||||
{
|
{
|
||||||
static SerializeType *type = SerializeType::Find(this->name);
|
this->Check();
|
||||||
if (type)
|
|
||||||
type->Check();
|
|
||||||
return &this->obj;
|
return &this->obj;
|
||||||
}
|
}
|
||||||
inline T* operator->()
|
inline T* operator->()
|
||||||
{
|
{
|
||||||
static SerializeType *type = SerializeType::Find(this->name);
|
this->Check();
|
||||||
if (type)
|
|
||||||
type->Check();
|
|
||||||
return &this->obj;
|
return &this->obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const T& operator*() const
|
inline const T& operator*() const
|
||||||
{
|
{
|
||||||
static SerializeType *type = SerializeType::Find(this->name);
|
this->Check();
|
||||||
if (type)
|
|
||||||
type->Check();
|
|
||||||
return this->obj;
|
return this->obj;
|
||||||
}
|
}
|
||||||
inline T& operator*()
|
inline T& operator*()
|
||||||
{
|
{
|
||||||
static SerializeType *type = SerializeType::Find(this->name);
|
this->Check();
|
||||||
if (type)
|
|
||||||
type->Check();
|
|
||||||
return this->obj;
|
return this->obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline operator const T&() const
|
inline operator const T&() const
|
||||||
{
|
{
|
||||||
static SerializeType *type = SerializeType::Find(this->name);
|
this->Check();
|
||||||
if (type)
|
|
||||||
type->Check();
|
|
||||||
return this->obj;
|
return this->obj;
|
||||||
}
|
}
|
||||||
inline operator T&()
|
inline operator T&()
|
||||||
{
|
{
|
||||||
static SerializeType *type = SerializeType::Find(this->name);
|
this->Check();
|
||||||
if (type)
|
|
||||||
type->Check();
|
|
||||||
return this->obj;
|
return this->obj;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "modules.h"
|
/** Used to hold references to serializable objects. Reference should always be
|
||||||
|
* used when holding references to serializable objects for extended periods of time
|
||||||
|
* to ensure that the object it refers to it always up to date. This also behaves like
|
||||||
|
* Reference in that it will invalidate itself if the object it refers to is
|
||||||
|
* destructed.
|
||||||
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class serialize_obj : public dynamic_reference_base
|
class Serialize::Reference : public ReferenceBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
T *ref;
|
T *ref;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
serialize_obj() : ref(NULL)
|
Reference() : ref(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
serialize_obj(T *obj) : ref(obj)
|
Reference(T *obj) : ref(obj)
|
||||||
{
|
{
|
||||||
if (obj)
|
if (obj)
|
||||||
obj->AddReference(this);
|
obj->AddReference(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
serialize_obj(const serialize_obj<T> &other) : ref(other.ref)
|
Reference(const Reference<T> &other) : ReferenceBase(other), ref(other.ref)
|
||||||
{
|
{
|
||||||
if (*this)
|
if (ref && !invalid)
|
||||||
this->ref->AddReference(this);
|
this->ref->AddReference(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
~serialize_obj()
|
~Reference()
|
||||||
{
|
{
|
||||||
if (*this)
|
if (ref && !invalid)
|
||||||
this->ref->DelReference(this);
|
this->ref->DelReference(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Reference<T>& operator=(const Reference<T> &other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
|
{
|
||||||
|
if (ref && !invalid)
|
||||||
|
this->ref->DelReference(this);
|
||||||
|
|
||||||
|
this->ref = other.ref;
|
||||||
|
this->invalid = other.invalid;
|
||||||
|
|
||||||
|
if (ref && !invalid)
|
||||||
|
this->ref->AddReference(this);
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
inline operator bool() const
|
inline operator bool() const
|
||||||
{
|
{
|
||||||
if (!this->invalid)
|
if (!this->invalid)
|
||||||
return this->ref != NULL;
|
return this->ref != NULL;
|
||||||
return NULL;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
inline void operator=(T *newref)
|
|
||||||
{
|
|
||||||
if (*this)
|
|
||||||
this->ref->DelReference(this);
|
|
||||||
|
|
||||||
this->ref = newref;
|
|
||||||
this->invalid = false;
|
|
||||||
|
|
||||||
if (newref)
|
|
||||||
this->ref->AddReference(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline operator T*() const
|
inline operator T*() const
|
||||||
@@ -240,11 +298,10 @@ class serialize_obj : public dynamic_reference_base
|
|||||||
if (!this->invalid)
|
if (!this->invalid)
|
||||||
{
|
{
|
||||||
if (this->ref)
|
if (this->ref)
|
||||||
{
|
// This can invalidate me
|
||||||
FOREACH_MOD(I_OnSerializePtrAssign, OnSerializePtrAssign(this->ref));
|
|
||||||
this->ref->QueueUpdate();
|
this->ref->QueueUpdate();
|
||||||
}
|
if (!this->invalid)
|
||||||
return this->ref;
|
return this->ref;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -254,11 +311,10 @@ class serialize_obj : public dynamic_reference_base
|
|||||||
if (!this->invalid)
|
if (!this->invalid)
|
||||||
{
|
{
|
||||||
if (this->ref)
|
if (this->ref)
|
||||||
{
|
// This can invalidate me
|
||||||
FOREACH_MOD(I_OnSerializePtrAssign, OnSerializePtrAssign(this->ref));
|
|
||||||
this->ref->QueueUpdate();
|
this->ref->QueueUpdate();
|
||||||
}
|
if (!this->invalid)
|
||||||
return this->ref;
|
return this->ref;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -268,11 +324,10 @@ class serialize_obj : public dynamic_reference_base
|
|||||||
if (!this->invalid)
|
if (!this->invalid)
|
||||||
{
|
{
|
||||||
if (this->ref)
|
if (this->ref)
|
||||||
{
|
// This can invalidate me
|
||||||
FOREACH_MOD(I_OnSerializePtrAssign, OnSerializePtrAssign(this->ref));
|
|
||||||
this->ref->QueueUpdate();
|
this->ref->QueueUpdate();
|
||||||
}
|
if (!this->invalid)
|
||||||
return this->ref;
|
return this->ref;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
+73
-35
@@ -1,52 +1,67 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SERVERS_H
|
#ifndef SERVERS_H
|
||||||
#define SERVERS_H
|
#define SERVERS_H
|
||||||
|
|
||||||
#include "services.h"
|
#include "services.h"
|
||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
|
#include "extensible.h"
|
||||||
|
|
||||||
/* Anope */
|
/* Anope. We are at the top of the server tree, our uplink is
|
||||||
|
* almost always me->GetLinks()[0]. We never have an uplink. */
|
||||||
extern CoreExport Server *Me;
|
extern CoreExport Server *Me;
|
||||||
|
|
||||||
extern CoreExport void do_server(const Anope::string &source, const Anope::string &servername, unsigned int hops, const Anope::string &descript, const Anope::string &numeric);
|
namespace Servers
|
||||||
|
|
||||||
extern CoreExport const Anope::string ts6_uid_retrieve();
|
|
||||||
extern CoreExport const Anope::string ts6_sid_retrieve();
|
|
||||||
|
|
||||||
extern CoreExport std::set<Anope::string> Capab;
|
|
||||||
|
|
||||||
/** Flags set on servers
|
|
||||||
*/
|
|
||||||
enum ServerFlag
|
|
||||||
{
|
{
|
||||||
SERVER_NONE,
|
/* Gets our uplink. Note we don't actually have an "uplink", this is just
|
||||||
/* Server is syncing */
|
* the only server whose uplink *is* Me that is not a juped server.
|
||||||
SERVER_SYNCING,
|
* @return Our uplink, or NULL if not uplinked to anything
|
||||||
/* This server was juped */
|
*/
|
||||||
SERVER_JUPED
|
extern CoreExport Server* GetUplink();
|
||||||
};
|
|
||||||
|
|
||||||
const Anope::string ServerFlagStrings[] = { "SERVER_NONE", "SERVER_SYNCING", "SERVER_JUPED", "" };
|
/* Server maps by name and id */
|
||||||
|
extern CoreExport Anope::map<Server *> ByName;
|
||||||
|
extern CoreExport Anope::map<Server *> ByID;
|
||||||
|
|
||||||
|
/* CAPAB/PROTOCTL given by the uplink */
|
||||||
|
extern CoreExport std::set<Anope::string> Capab;
|
||||||
|
}
|
||||||
|
|
||||||
/** Class representing a server
|
/** Class representing a server
|
||||||
*/
|
*/
|
||||||
class CoreExport Server : public Flags<ServerFlag>
|
class CoreExport Server : public Extensible
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
/* Server name */
|
/* Server name */
|
||||||
Anope::string Name;
|
Anope::string name;
|
||||||
/* Hops between services and server */
|
/* Hops between services and server */
|
||||||
unsigned int Hops;
|
unsigned int hops;
|
||||||
/* Server description */
|
/* Server description */
|
||||||
Anope::string Description;
|
Anope::string description;
|
||||||
/* Server ID */
|
/* Server ID */
|
||||||
Anope::string SID;
|
Anope::string sid;
|
||||||
/* Links for this server */
|
/* Links for this server */
|
||||||
std::vector<Server *> Links;
|
std::vector<Server *> links;
|
||||||
/* Uplink for this server */
|
/* Uplink for this server */
|
||||||
Server *UplinkServer;
|
Server *uplink;
|
||||||
|
/* Server is syncing */
|
||||||
|
bool syncing;
|
||||||
|
/* The server is juped */
|
||||||
|
bool juped;
|
||||||
|
/* The server is about to quit */
|
||||||
|
bool quitting;
|
||||||
/* Reason this server was quit */
|
/* Reason this server was quit */
|
||||||
Anope::string QReason;
|
Anope::string quit_reason;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Constructor
|
/** Constructor
|
||||||
@@ -55,14 +70,19 @@ class CoreExport Server : public Flags<ServerFlag>
|
|||||||
* @param hops Hops from services server
|
* @param hops Hops from services server
|
||||||
* @param description Server rdescription
|
* @param description Server rdescription
|
||||||
* @param sid Server sid/numeric
|
* @param sid Server sid/numeric
|
||||||
* @param flag An optional server flag
|
* @param jupe If the server is juped
|
||||||
*/
|
*/
|
||||||
Server(Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid, ServerFlag flag = SERVER_NONE);
|
Server(Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid = "", bool jupe = false);
|
||||||
|
|
||||||
|
private:
|
||||||
/** Destructor
|
/** Destructor
|
||||||
*/
|
*/
|
||||||
~Server();
|
~Server();
|
||||||
|
|
||||||
|
public:
|
||||||
|
/* Number of users on the server */
|
||||||
|
unsigned users;
|
||||||
|
|
||||||
/** Delete this server with a reason
|
/** Delete this server with a reason
|
||||||
* @param reason The reason
|
* @param reason The reason
|
||||||
*/
|
*/
|
||||||
@@ -93,11 +113,15 @@ class CoreExport Server : public Flags<ServerFlag>
|
|||||||
*/
|
*/
|
||||||
void SetSID(const Anope::string &sid);
|
void SetSID(const Anope::string &sid);
|
||||||
|
|
||||||
/** Get the server numeric/SID
|
/** Get the server numeric/SID, else the server name
|
||||||
* @return The numeric/SID
|
* @return The numeric/SID
|
||||||
*/
|
*/
|
||||||
const Anope::string &GetSID() const;
|
const Anope::string &GetSID() const;
|
||||||
|
|
||||||
|
/** Retrieves the reason this server is quitting
|
||||||
|
*/
|
||||||
|
const Anope::string &GetQuitReason() const;
|
||||||
|
|
||||||
/** Get the list of links this server has, or NULL if it has none
|
/** Get the list of links this server has, or NULL if it has none
|
||||||
* @return A list of servers
|
* @return A list of servers
|
||||||
*/
|
*/
|
||||||
@@ -119,32 +143,46 @@ class CoreExport Server : public Flags<ServerFlag>
|
|||||||
void DelLink(Server *s);
|
void DelLink(Server *s);
|
||||||
|
|
||||||
/** Finish syncing this server and optionally all links to it
|
/** Finish syncing this server and optionally all links to it
|
||||||
* @param SyncLinks True to sync the links for this server too (if any)
|
* @param sync_links True to sync the links for this server too (if any)
|
||||||
*/
|
*/
|
||||||
void Sync(bool SyncLinks);
|
void Sync(bool sync_links);
|
||||||
|
|
||||||
/** Check if this server is synced
|
/** Check if this server is synced
|
||||||
* @return true or false
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
bool IsSynced() const;
|
bool IsSynced() const;
|
||||||
|
|
||||||
|
/** Unsync the server. Only used for Me->Unsync()
|
||||||
|
*/
|
||||||
|
void Unsync();
|
||||||
|
|
||||||
/** Check if this server is ULined
|
/** Check if this server is ULined
|
||||||
* @return true or false
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
bool IsULined() const;
|
bool IsULined() const;
|
||||||
|
|
||||||
|
/** Check if this server is juped (a pseudoserver other than us)
|
||||||
|
* @return true if this server is a juped server
|
||||||
|
*/
|
||||||
|
bool IsJuped() const;
|
||||||
|
|
||||||
|
/** Check if the server is quitting
|
||||||
|
* @return true if this server is quitting.
|
||||||
|
*/
|
||||||
|
bool IsQuitting() const;
|
||||||
|
|
||||||
/** Send a message to alll users on this server
|
/** Send a message to alll users on this server
|
||||||
* @param source The source of the message
|
* @param source The source of the message
|
||||||
* @param message The message
|
* @param message The message
|
||||||
*/
|
*/
|
||||||
void Notice(const BotInfo *source, const Anope::string &message);
|
void Notice(BotInfo *source, const Anope::string &message);
|
||||||
|
|
||||||
/** Find a server
|
/** Find a server
|
||||||
* @param name The name or SID/numeric
|
* @param name The name or SID/numeric
|
||||||
* @param s The server list to search for this server on, defaults to our Uplink
|
* @param name_only set to true to only look up by name, not SID
|
||||||
* @return The server
|
* @return The server
|
||||||
*/
|
*/
|
||||||
static Server *Find(const Anope::string &name, Server *s = NULL);
|
static Server *Find(const Anope::string &name, bool name_only = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SERVERS_H
|
#endif // SERVERS_H
|
||||||
|
|||||||
+83
-18
@@ -1,11 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* (C) 2003-2012 Anope Team
|
*
|
||||||
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
*
|
*
|
||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SERVICE_H
|
#ifndef SERVICE_H
|
||||||
@@ -13,37 +15,76 @@
|
|||||||
|
|
||||||
#include "services.h"
|
#include "services.h"
|
||||||
#include "anope.h"
|
#include "anope.h"
|
||||||
#include "modules.h"
|
#include "base.h"
|
||||||
|
|
||||||
|
/** Anything that inherits from this class can be referred to
|
||||||
|
* using ServiceReference. Any interfaces provided by modules,
|
||||||
|
* such as commands, use this. This is also used for modules
|
||||||
|
* that publish a service (m_ssl_openssl, etc).
|
||||||
|
*/
|
||||||
class CoreExport Service : public virtual Base
|
class CoreExport Service : public virtual Base
|
||||||
{
|
{
|
||||||
static Anope::map<Anope::map<Service *> > services;
|
static std::map<Anope::string, std::map<Anope::string, Service *> > Services;
|
||||||
public:
|
static std::map<Anope::string, std::map<Anope::string, Anope::string> > Aliases;
|
||||||
static Service *FindService(const Anope::string &t, const Anope::string &n)
|
|
||||||
|
static Service *FindService(const std::map<Anope::string, Service *> &services, const std::map<Anope::string, Anope::string> *aliases, const Anope::string &n)
|
||||||
{
|
{
|
||||||
Anope::map<Anope::map<Service *> >::iterator it = services.find(t);
|
std::map<Anope::string, Service *>::const_iterator it = services.find(n);
|
||||||
if (it != services.end())
|
if (it != services.end())
|
||||||
|
return it->second;
|
||||||
|
|
||||||
|
if (aliases != NULL)
|
||||||
{
|
{
|
||||||
Anope::map<Service *>::iterator it2 = it->second.find(n);
|
std::map<Anope::string, Anope::string>::const_iterator it2 = aliases->find(n);
|
||||||
if (it2 != it->second.end())
|
if (it2 != aliases->end())
|
||||||
return it2->second;
|
return FindService(services, aliases, it2->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Service *FindService(const Anope::string &t, const Anope::string &n)
|
||||||
|
{
|
||||||
|
std::map<Anope::string, std::map<Anope::string, Service *> >::const_iterator it = Services.find(t);
|
||||||
|
if (it == Services.end())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
std::map<Anope::string, std::map<Anope::string, Anope::string> >::const_iterator it2 = Aliases.find(t);
|
||||||
|
if (it2 != Aliases.end())
|
||||||
|
return FindService(it->second, &it2->second, n);
|
||||||
|
|
||||||
|
return FindService(it->second, NULL, n);
|
||||||
|
}
|
||||||
|
|
||||||
static std::vector<Anope::string> GetServiceKeys(const Anope::string &t)
|
static std::vector<Anope::string> GetServiceKeys(const Anope::string &t)
|
||||||
{
|
{
|
||||||
std::vector<Anope::string> keys;
|
std::vector<Anope::string> keys;
|
||||||
Anope::map<Anope::map<Service *> >::iterator it = services.find(t);
|
std::map<Anope::string, std::map<Anope::string, Service *> >::iterator it = Services.find(t);
|
||||||
if (it != services.end())
|
if (it != Services.end())
|
||||||
for (Anope::map<Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
|
for (std::map<Anope::string, Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
|
||||||
keys.push_back(it2->first);
|
keys.push_back(it2->first);
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void AddAlias(const Anope::string &t, const Anope::string &n, const Anope::string &v)
|
||||||
|
{
|
||||||
|
std::map<Anope::string, Anope::string> &smap = Aliases[t];
|
||||||
|
smap[n] = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DelAlias(const Anope::string &t, const Anope::string &n)
|
||||||
|
{
|
||||||
|
std::map<Anope::string, Anope::string> &smap = Aliases[t];
|
||||||
|
smap.erase(n);
|
||||||
|
if (smap.empty())
|
||||||
|
Aliases.erase(t);
|
||||||
|
}
|
||||||
|
|
||||||
Module *owner;
|
Module *owner;
|
||||||
|
/* Service type, which should be the class name (eg "Command") */
|
||||||
Anope::string type;
|
Anope::string type;
|
||||||
|
/* Service name, commands are usually named service/command */
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
|
|
||||||
Service(Module *o, const Anope::string &t, const Anope::string &n) : owner(o), type(t), name(n)
|
Service(Module *o, const Anope::string &t, const Anope::string &n) : owner(o), type(t), name(n)
|
||||||
@@ -58,7 +99,7 @@ class CoreExport Service : public virtual Base
|
|||||||
|
|
||||||
void Register()
|
void Register()
|
||||||
{
|
{
|
||||||
Anope::map<Service *> &smap = services[this->type];
|
std::map<Anope::string, Service *> &smap = Services[this->type];
|
||||||
if (smap.find(this->name) != smap.end())
|
if (smap.find(this->name) != smap.end())
|
||||||
throw ModuleException("Service " + this->type + " with name " + this->name + " already exists");
|
throw ModuleException("Service " + this->type + " with name " + this->name + " already exists");
|
||||||
smap[this->name] = this;
|
smap[this->name] = this;
|
||||||
@@ -66,27 +107,32 @@ class CoreExport Service : public virtual Base
|
|||||||
|
|
||||||
void Unregister()
|
void Unregister()
|
||||||
{
|
{
|
||||||
Anope::map<Service *> &smap = services[this->type];
|
std::map<Anope::string, Service *> &smap = Services[this->type];
|
||||||
smap.erase(this->name);
|
smap.erase(this->name);
|
||||||
if (smap.empty())
|
if (smap.empty())
|
||||||
services.erase(this->type);
|
Services.erase(this->type);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Like Reference, but used to refer to Services.
|
||||||
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class service_reference : public dynamic_reference<T>
|
class ServiceReference : public Reference<T>
|
||||||
{
|
{
|
||||||
Anope::string type;
|
Anope::string type;
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
service_reference(const Anope::string &t, const Anope::string &n) : dynamic_reference<T>(NULL), type(t), name(n)
|
ServiceReference() { }
|
||||||
|
|
||||||
|
ServiceReference(const Anope::string &t, const Anope::string &n) : type(t), name(n)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void operator=(const Anope::string &n)
|
inline void operator=(const Anope::string &n)
|
||||||
{
|
{
|
||||||
this->name = n;
|
this->name = n;
|
||||||
|
this->invalid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator bool() anope_override
|
operator bool() anope_override
|
||||||
@@ -98,7 +144,11 @@ class service_reference : public dynamic_reference<T>
|
|||||||
}
|
}
|
||||||
if (!this->ref)
|
if (!this->ref)
|
||||||
{
|
{
|
||||||
this->ref = static_cast<T *>(Service::FindService(this->type, this->name));
|
/* This really could be dynamic_cast in every case, except for when a module
|
||||||
|
* creates its own service type (that other modules must include the header file
|
||||||
|
* for), as the core is not compiled with it so there is no RTTI for it.
|
||||||
|
*/
|
||||||
|
this->ref = static_cast<T *>(::Service::FindService(this->type, this->name));
|
||||||
if (this->ref)
|
if (this->ref)
|
||||||
this->ref->AddReference(this);
|
this->ref->AddReference(this);
|
||||||
}
|
}
|
||||||
@@ -106,5 +156,20 @@ class service_reference : public dynamic_reference<T>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ServiceAlias
|
||||||
|
{
|
||||||
|
Anope::string t, f;
|
||||||
|
public:
|
||||||
|
ServiceAlias(const Anope::string &type, const Anope::string &from, const Anope::string &to) : t(type), f(from)
|
||||||
|
{
|
||||||
|
Service::AddAlias(type, from, to);
|
||||||
|
}
|
||||||
|
|
||||||
|
~ServiceAlias()
|
||||||
|
{
|
||||||
|
Service::DelAlias(t, f);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
#endif // SERVICE_H
|
#endif // SERVICE_H
|
||||||
|
|
||||||
|
|||||||
+2
-11
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SERVICES_H
|
#ifndef SERVICES_H
|
||||||
@@ -44,6 +43,7 @@
|
|||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <iterator>
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
@@ -66,13 +66,4 @@
|
|||||||
# include "anope_windows.h"
|
# include "anope_windows.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* RFC: defination of a valid nick
|
|
||||||
* nickname = ( letter / special ) *8( letter / digit / special / "-" )
|
|
||||||
* letter = %x41-5A / %x61-7A ; A-Z / a-z
|
|
||||||
* digit = %x30-39 ; 0-9
|
|
||||||
* special = %x5B-60 / %x7B-7D ; "[", "]", "\", "`", "_", "^", "{", "|", "}"
|
|
||||||
**/
|
|
||||||
#define isvalidnick(c) (isalnum(c) || ((c) >= '\x5B' && (c) <= '\x60') || ((c) >= '\x7B' && (c) <= '\x7D') || (c) == '-')
|
|
||||||
|
|
||||||
#endif // SERVICES_H
|
#endif // SERVICES_H
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* (C) 2003-2012 Anope Team
|
|
||||||
* Contact us at team@anope.org
|
|
||||||
*
|
|
||||||
* Please read COPYING and README for further details.
|
|
||||||
*
|
|
||||||
* Based on the original code of Epona by Lara.
|
|
||||||
* Based on the original code of Services by Andy Church.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SIGNAL_H
|
|
||||||
#define SIGNAL_H
|
|
||||||
|
|
||||||
#include <signal.h>
|
|
||||||
|
|
||||||
#include "sockets.h"
|
|
||||||
|
|
||||||
/** Represents a signal handler
|
|
||||||
*/
|
|
||||||
class Signal : public Pipe
|
|
||||||
{
|
|
||||||
static std::vector<Signal *> SignalHandlers;
|
|
||||||
static void SignalHandler(int signal);
|
|
||||||
|
|
||||||
struct sigaction action, old;
|
|
||||||
public:
|
|
||||||
int signal;
|
|
||||||
|
|
||||||
/** Constructor
|
|
||||||
* @param s The signal to listen for
|
|
||||||
*/
|
|
||||||
Signal(int s);
|
|
||||||
~Signal();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the signal is received.
|
|
||||||
* Note this is not *immediatly* called when the signal is received,
|
|
||||||
* but it is saved and called at a later time when we are not doing something
|
|
||||||
* important. This is always called on the main thread, even on systems that
|
|
||||||
* spawn threads for signals, like Windows.
|
|
||||||
*/
|
|
||||||
virtual void OnNotify() anope_override = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+13
-18
@@ -1,21 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* (C) 2003-2012 Anope Team
|
* (C) 2003-2014 Anope Team
|
||||||
* Contact us at team@anope.org
|
* Contact us at team@anope.org
|
||||||
*
|
*
|
||||||
* Please read COPYING and README for further details.
|
* Please read COPYING and README for further details.
|
||||||
*
|
*
|
||||||
* Based on the original code of Epona by Lara.
|
* Based on the original code of Epona by Lara.
|
||||||
* Based on the original code of Services by Andy Church.
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SOCKETENGINE_H
|
#ifndef SOCKETENGINE_H
|
||||||
#define SOCKETENGINE_H
|
#define SOCKETENGINE_H
|
||||||
|
|
||||||
#include "services.h"
|
#include "services.h"
|
||||||
|
#include "sockets.h"
|
||||||
|
|
||||||
class CoreExport SocketEngine
|
class CoreExport SocketEngine
|
||||||
{
|
{
|
||||||
|
static const int DefaultSize = 2; // Uplink, mode stacker
|
||||||
public:
|
public:
|
||||||
/* Map of sockets */
|
/* Map of sockets */
|
||||||
static std::map<int, Socket *> Sockets;
|
static std::map<int, Socket *> Sockets;
|
||||||
@@ -28,29 +31,21 @@ class CoreExport SocketEngine
|
|||||||
*/
|
*/
|
||||||
static void Shutdown();
|
static void Shutdown();
|
||||||
|
|
||||||
/** Add a socket to the internal list
|
/** Set a flag on a socket
|
||||||
* @param s The socket
|
* @param s The socket
|
||||||
|
* @param set Whether setting or unsetting
|
||||||
|
* @param flag The flag to set or unset
|
||||||
*/
|
*/
|
||||||
static void AddSocket(Socket *s);
|
static void Change(Socket *s, bool set, SocketFlag flag);
|
||||||
|
|
||||||
/** Delete a socket from the internal list
|
|
||||||
* @param s The socket
|
|
||||||
*/
|
|
||||||
static void DelSocket(Socket *s);
|
|
||||||
|
|
||||||
/** Mark a socket as writeable
|
|
||||||
* @param s The socket
|
|
||||||
*/
|
|
||||||
static void MarkWritable(Socket *s);
|
|
||||||
|
|
||||||
/** Unmark a socket as writeable
|
|
||||||
* @param s The socket
|
|
||||||
*/
|
|
||||||
static void ClearWritable(Socket *s);
|
|
||||||
|
|
||||||
/** Read from sockets and do things
|
/** Read from sockets and do things
|
||||||
*/
|
*/
|
||||||
static void Process();
|
static void Process();
|
||||||
|
|
||||||
|
static int GetLastError();
|
||||||
|
static void SetLastError(int);
|
||||||
|
|
||||||
|
static bool IgnoreErrno();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SOCKETENGINE_H
|
#endif // SOCKETENGINE_H
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user