mirror of
https://github.com/anope/anope.git
synced 2026-06-19 21:24:47 +02:00
Compare commits
488 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a1bc6abb4 | |||
| 0d88137738 | |||
| 5bcb780c6d | |||
| c79d189e89 | |||
| 777c6cf073 | |||
| f06eed9809 | |||
| 5bfc23a07e | |||
| 2896b388d7 | |||
| ba62e7be62 | |||
| 193ab9605b | |||
| 5d25bf4ac3 | |||
| dd3cce64c3 | |||
| fb5356ccbc | |||
| 6ac61a1852 | |||
| 70918d2a01 | |||
| f553583f36 | |||
| b22091e8fa | |||
| 651aacd3e9 | |||
| d02f03a7a8 | |||
| dc4b9afebb | |||
| 85b409df85 | |||
| 383629d718 | |||
| f572827157 | |||
| 9d87b0f923 | |||
| 5695a8b595 | |||
| 897f11e517 | |||
| f17c36c031 | |||
| 39960787de | |||
| 43f85bf4f2 | |||
| 8011cd4f0b | |||
| d8bd3afd76 | |||
| 927d2717a9 | |||
| de7b668ad1 | |||
| 396cee7d0d | |||
| fcf104f0ca | |||
| 09b92517d0 | |||
| e16a512699 | |||
| 68592b0445 | |||
| 2ee049d7d8 | |||
| b88a12f8e5 | |||
| f4cc123f16 | |||
| e3486a3e4b | |||
| 5971c272be | |||
| cc64a00216 | |||
| 7ea66a37d5 | |||
| 46030bbc7e | |||
| 887c18a6bf | |||
| 2f93b4225f | |||
| 004d9c7b18 | |||
| 1f6eff371d | |||
| a63502ff55 | |||
| 1f2206159e | |||
| 9900f83d94 | |||
| 1b4aec7bda | |||
| 586c8a70f4 | |||
| 0a6d617073 | |||
| 1348ef100e | |||
| bcffb94eaa | |||
| 7161edab00 | |||
| 03d3216cfe | |||
| 56a6cea0d5 | |||
| 3b7174319a | |||
| 1242eb5dc9 | |||
| b0caa94985 | |||
| 4a91b12221 | |||
| c15707a018 | |||
| 4bf22fa2e6 | |||
| bcf9852eec | |||
| a17d3dc27e | |||
| 0f3110e271 | |||
| 6ce5c90619 | |||
| 6c62e39680 | |||
| 7916c7f393 | |||
| 8d247130d4 | |||
| 89e05fb880 | |||
| ece55718e7 | |||
| b9bf72c457 | |||
| 577870bb45 | |||
| 6b8728428b | |||
| 4d52274432 | |||
| 9464b59137 | |||
| d5cf78e6f7 | |||
| eeb7c9c36d | |||
| 862011a3ee | |||
| 4e76d13428 | |||
| 51d869db57 | |||
| 64132f67c0 | |||
| 43d72713c5 | |||
| 8df2076024 | |||
| ec398f6a55 | |||
| b6deabc55a | |||
| dc261d9291 | |||
| 712b4a16be | |||
| c31e267403 | |||
| 0abb809226 | |||
| 3d2621349c | |||
| 8d621a71c9 | |||
| 761d90e1d7 | |||
| c72a70ffaf | |||
| 05942ff9bc | |||
| 20b3c6437b | |||
| 24a5bdf0e7 | |||
| f28fa07f3b | |||
| 1cc976960b | |||
| a4bbe9908d | |||
| 1fc8b1dd60 | |||
| 85515696e3 | |||
| 0b92ee8d30 | |||
| 0fef23470c | |||
| 03f03a91ae | |||
| 1c33521c69 | |||
| 52f55ef9a0 | |||
| 06c26d468c | |||
| 45a35e61eb | |||
| 9801065683 | |||
| ce664a160b | |||
| 0d7e0274a4 | |||
| b8b891cc25 | |||
| bec179c197 | |||
| 10be3e9bb5 | |||
| b2a57b0974 | |||
| 443654f15b | |||
| 99fe46de55 | |||
| 6a975740b3 | |||
| f8efdbf822 | |||
| 55d4d6084e | |||
| cbec05c428 | |||
| 906580a463 | |||
| e0828bf69b | |||
| 49f1b9bc49 | |||
| 81d05eb8a7 | |||
| 17a09abb6d | |||
| 57e66618e7 | |||
| 23c654519c | |||
| e669382cab | |||
| 4c244b5e06 | |||
| 9a9d93e9f0 | |||
| 1d53afee3f | |||
| d75238496b | |||
| 4d19a783bd | |||
| bd6a593b6c | |||
| d68b3c3b6d | |||
| e8c63b5f43 | |||
| da8ccdad19 | |||
| d81068abc4 | |||
| 5a9dd79ae8 | |||
| 6609f829f4 | |||
| 8dc849d8de | |||
| 8c82d30112 | |||
| 77ad2c101c | |||
| 7cf236ef51 | |||
| 670f87a22a | |||
| 15687a7c9e | |||
| 712cbb540c | |||
| 108cf5e60d | |||
| 6b9c0fe4d9 | |||
| 6b5786aa37 | |||
| dc8f7923f4 | |||
| 59c1a509b4 | |||
| dc65eca3d8 | |||
| 01b831c4c6 | |||
| 28d77b7ebe | |||
| b81d902a2e | |||
| 9eea1444fa | |||
| 1ee6c20e1e | |||
| 157dfbd5c6 | |||
| 2cc4ace60b | |||
| fc78e51452 | |||
| 8fa6752858 | |||
| a68b5efe27 | |||
| 695644d0c4 | |||
| c8c89c7af0 | |||
| 9ff6ed2430 | |||
| 2eae738083 | |||
| 6bed75b41f | |||
| 426f72117b | |||
| affc29aca5 | |||
| 3bd357725a | |||
| 08b3ef7d4e | |||
| deeec4fbf1 | |||
| 7e8a7fc598 | |||
| c1bc7cbafc | |||
| 3fa978c958 | |||
| 1f48897042 | |||
| feab2cb854 | |||
| 2d050edb4e | |||
| dc102049b0 | |||
| 845b15ddd9 | |||
| b9d2e9c092 | |||
| 49512f902c | |||
| 3a6a3330ac | |||
| 086ae2c6ce | |||
| 3e9bd7583c | |||
| fc4f89e079 | |||
| 723e3f2ce0 | |||
| 89883ac325 | |||
| 89850c85a9 | |||
| d8e1f104a4 | |||
| 76e83f613b | |||
| 22b53ec9cd | |||
| dccb56a496 | |||
| 1787a8ac27 | |||
| a2b1284aac | |||
| 7b6a109100 | |||
| 56464bbdd8 | |||
| 87ecbec79d | |||
| 578da38d30 | |||
| fbb1ab9246 | |||
| cd034d6935 | |||
| af85de47c7 | |||
| 178def8291 | |||
| 9f20b2f7dd | |||
| df627065ac | |||
| ad77b5ee2d | |||
| 146ecc2fbb | |||
| 36f523249a | |||
| b0b8e70442 | |||
| 2dba060c6a | |||
| a7316c1770 | |||
| a6f0b5e8d4 | |||
| 821c6ac90b | |||
| aab6dad14f | |||
| 6280432bc7 | |||
| 6d97b7f8f9 | |||
| c6ef1e0390 | |||
| 48ef6617ac | |||
| ef400fa6dc | |||
| 93baed333f | |||
| e9e5ccc891 | |||
| d37f569188 | |||
| a39137e271 | |||
| 25050df434 | |||
| b79c68d829 | |||
| 6712748378 | |||
| 3cdca9e47a | |||
| e57feb4ef6 | |||
| 4ef30a4de9 | |||
| 76755725e5 | |||
| 8a01e21a48 | |||
| ab9c1e4651 | |||
| fdfc12f398 | |||
| ba8f609eb0 | |||
| 114b2d4989 | |||
| 2d270cd0bf | |||
| 89c2c02904 | |||
| 6245821dfe | |||
| 0430fbf861 | |||
| 007b73e5a9 | |||
| 7ec6b68e84 | |||
| 7a92feb474 | |||
| 601c546957 | |||
| 3f57c91613 | |||
| 3d4fb90353 | |||
| 5c325b5d12 | |||
| 60b18508e0 | |||
| 8fc031fb84 | |||
| d8c4e705a2 | |||
| 3495e8a575 | |||
| b7a995c1f1 | |||
| 807770c40a | |||
| b3eeb815b6 | |||
| da43e02228 | |||
| ca28b7c1b3 | |||
| da4ce1788f | |||
| 190a3de3b9 | |||
| ce09914e1d | |||
| 656cc9973e | |||
| a9ced70eed | |||
| 5b988a5e17 | |||
| 5fe4d0f43d | |||
| 96f98ebbb6 | |||
| d6522b5220 | |||
| 3ff8e96e14 | |||
| 5d56ed0158 | |||
| 497aa0c012 | |||
| a7189482f5 | |||
| 26e09b3b7f | |||
| e78066213a | |||
| 610dbf5c92 | |||
| 0892ef1361 | |||
| adca908bce | |||
| d93c79358e | |||
| 7d0b69b94b | |||
| 8cc5b194d4 | |||
| 89e63ed395 | |||
| c01cd051c3 | |||
| b6c2d8b52e | |||
| 68ff62f6e3 | |||
| 4f4b42562a | |||
| 0a2b6b9573 | |||
| 6ac077e2cb | |||
| d2fd84d41f | |||
| ea5245f416 | |||
| 40005c5029 | |||
| 8974008304 | |||
| 29b9577bd2 | |||
| 174bb94648 | |||
| 3b634c3770 | |||
| 4184b7df44 | |||
| 4ddc1cebd1 | |||
| 54762245b8 | |||
| 63e8a8f6c2 | |||
| 16bd616604 | |||
| 9a97a0b3cf | |||
| 7a1217e97c | |||
| efcd7636dc | |||
| c6f4b95131 | |||
| 6794273f7d | |||
| e8ce6e0b10 | |||
| a07fd592cb | |||
| bd7f4f8c49 | |||
| 090107db5f | |||
| f2fb7ef53f | |||
| 36de15de5e | |||
| ab6ee16aa2 | |||
| 48560524a3 | |||
| a5206c33b9 | |||
| 419b4c8002 | |||
| 9123489c32 | |||
| fa0d664063 | |||
| c3f28223f8 | |||
| 8d05e8510f | |||
| 1707cf3dd3 | |||
| bb666ab902 | |||
| 7723437a81 | |||
| 805253de36 | |||
| 40680e2535 | |||
| c917ca5a34 | |||
| 23f5e9de79 | |||
| 6c1d764c4f | |||
| 2b0914ae36 | |||
| d20e4eb6ee | |||
| e11b5b5ace | |||
| 12cc633457 | |||
| bcb857f118 | |||
| 187c45059a | |||
| 3fe5aa037a | |||
| 7af9e42d21 | |||
| abd083b1e3 | |||
| d07de70fc3 | |||
| c1c9e17d79 | |||
| ce3a04f0a8 | |||
| f756f2b394 | |||
| 7ea34be0b8 | |||
| 6bd851a4d0 | |||
| 8d90a23689 | |||
| ea45d96968 | |||
| 771eb5cf1f | |||
| e1f80a1833 | |||
| 0374d53d28 | |||
| 578755d627 | |||
| 89ab54f0d7 | |||
| 80de50711e | |||
| 43bad5d4ae | |||
| 0d86da4f5d | |||
| caeebbfa6f | |||
| 549e9446d8 | |||
| 14c2617e41 | |||
| 6112d479f9 | |||
| 04fe8e623c | |||
| c8422a6029 | |||
| 010c774bc2 | |||
| 22e8e87a00 | |||
| 15a2e1d4e4 | |||
| c5a376cbc8 | |||
| 629422ed86 | |||
| d1611b640b | |||
| 0e5b71923b | |||
| ba47bf2f6f | |||
| 330d9ee9e7 | |||
| d84701deec | |||
| 38711cded6 | |||
| 550e371f10 | |||
| c8aae1c6ee | |||
| 92170818ff | |||
| 0c985ee709 | |||
| f74036dc58 | |||
| d121c4bd37 | |||
| 02452a0375 | |||
| 8324379346 | |||
| 855847f428 | |||
| f07229a9ee | |||
| f92bf30f15 | |||
| b10305ef3b | |||
| e1828057c3 | |||
| bce21304f7 | |||
| 2e75a5c4a4 | |||
| 09dedba379 | |||
| 602b468efd | |||
| 84d789c72b | |||
| 6d835a6e49 | |||
| 2c9f2eb991 | |||
| 0717d63c75 | |||
| bf020d8dfd | |||
| 77174a7b4d | |||
| 214f6712fe | |||
| 71870e6667 | |||
| 0e991f0e72 | |||
| 99967932a4 | |||
| b167c89ca6 | |||
| 4b291b12f8 | |||
| 1344bc5728 | |||
| 4587546330 | |||
| 4e5c094033 | |||
| 7633d9e248 | |||
| a7855fd0ba | |||
| 8d0aa3b589 | |||
| e616889a78 | |||
| 4310c712c3 | |||
| 45b4074e0d | |||
| 2b0646a148 | |||
| b9a80f28f7 | |||
| c78784ac28 | |||
| 61cf1f325f | |||
| b75fadf73d | |||
| b0535c7760 | |||
| c9120ca031 | |||
| 0e0ee67b81 | |||
| baaed4b764 | |||
| 2e5b573192 | |||
| 58b0279f7f | |||
| a512f7cdd7 | |||
| 30b3d92d94 | |||
| 4836d9548d | |||
| 394d3b9325 | |||
| 9ed99ed5f4 | |||
| cdec4027a8 | |||
| badcd21abb | |||
| 136ea16ed8 | |||
| 3cc5bf39f5 | |||
| b0e41b4811 | |||
| 56633e894d | |||
| 0701b7df9f | |||
| 94916b32cb | |||
| b0edff488a | |||
| 0a5ae7e6d8 | |||
| f4cdea8348 | |||
| 429da2b886 | |||
| 87ce2aa25d | |||
| 87c8744724 | |||
| 6f9f2617e7 | |||
| 8c2430d02d | |||
| e2f6064f10 | |||
| 87065c514a | |||
| 0c17078092 | |||
| f9e7760a23 | |||
| 53e79c2155 | |||
| fe78ca1399 | |||
| e1bdc807a8 | |||
| 88186bfd2c | |||
| 2e08b60cf7 | |||
| 7d58ed17c7 | |||
| 79f09ed157 | |||
| b1ee732713 | |||
| ef9f97fa05 | |||
| 7a4b0418bc | |||
| 3d8245a5a6 | |||
| d01df85cd1 | |||
| 1ed7d17b5d | |||
| b48c18b011 | |||
| b496e60eb0 | |||
| 2bf017a0e1 | |||
| 5fa7167181 | |||
| fe39b96db7 | |||
| e225e7e628 | |||
| b15c46d795 | |||
| e7a1572317 | |||
| 1fd0249076 | |||
| e7a6661baa | |||
| 018f1a50b2 | |||
| 4d89b91ed3 | |||
| 24dbf4e00c | |||
| 28a0108e0b | |||
| 87dc82f3e9 | |||
| 0a06ce6490 | |||
| d931ce8096 | |||
| fc0deb2181 | |||
| de6a85bdf5 | |||
| 0ab4571106 | |||
| 8c815bedeb | |||
| d684f3c556 | |||
| 3fe6a25236 | |||
| 8c5a7e7aea | |||
| e7228b6289 | |||
| 72b86bcf72 | |||
| eec4e00b16 | |||
| ff6477e6dd | |||
| d7d01bdc5c |
+532
@@ -0,0 +1,532 @@
|
||||
###############################################################################
|
||||
# strip_string(<input string> <output string>)
|
||||
#
|
||||
# A macro to handle stripping the leading and trailing spaces from a string,
|
||||
# uses string(STRIP) if using CMake 2.6.x or better, otherwise uses
|
||||
# string(REGEX REPLACE).
|
||||
###############################################################################
|
||||
macro(strip_string INPUT_STRING OUTPUT_STRING)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, we can just use the STRIP sub-command of string()
|
||||
string(STRIP ${INPUT_STRING} ${OUTPUT_STRING})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we will have to use the REGEX REPLACE sub-command of string() instead
|
||||
# First check if the input string is empty or not
|
||||
if (${INPUT_STRING} STREQUAL "")
|
||||
set(${OUTPUT_STRING} "")
|
||||
else(${INPUT_STRING} STREQUAL "")
|
||||
# Determine if the string is entirely empty or not
|
||||
string(REGEX MATCH "^[ \t]*$" EMPTY_STRING "${INPUT_STRING}")
|
||||
if(EMPTY_STRING)
|
||||
set(${OUTPUT_STRING} "")
|
||||
else(EMPTY_STRING)
|
||||
# We detect if there is any leading whitespace and remove any if there is
|
||||
string(SUBSTRING "${INPUT_STRING}" 0 1 FIRST_CHAR)
|
||||
if(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
|
||||
string(REGEX REPLACE "^[ \t]+" "" TEMP_STRING "${INPUT_STRING}")
|
||||
else(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
|
||||
set(TEMP_STRING "${INPUT_STRING}")
|
||||
endif(FIRST_CHAR STREQUAL " " OR FIRST_CHAR STREQUAL "\t")
|
||||
# Next we detect if there is any trailing whitespace and remove any if there is
|
||||
string(LENGTH "${TEMP_STRING}" STRING_LEN)
|
||||
math(EXPR STRING_LEN "${STRING_LEN} - 1")
|
||||
string(SUBSTRING "${TEMP_STRING}" ${STRING_LEN} 1 LAST_CHAR)
|
||||
if(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
string(REGEX REPLACE "[ \t]+$" "" ${OUTPUT_STRING} "${TEMP_STRING}")
|
||||
else(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
set(${OUTPUT_STRING} "${TEMP_STRING}")
|
||||
endif(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
endif(EMPTY_STRING)
|
||||
endif(${INPUT_STRING} STREQUAL "")
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
endmacro(strip_string)
|
||||
|
||||
###############################################################################
|
||||
# append_to_list(<list> <args>...)
|
||||
#
|
||||
# A macro to handle appending to lists, uses list(APPEND) if using CMake 2.4.2
|
||||
# or better, otherwise uses set() instead.
|
||||
###############################################################################
|
||||
macro(append_to_list LIST)
|
||||
if(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.2 or better, we can just use the APPEND sub-command of list()
|
||||
list(APPEND ${LIST} ${ARGN})
|
||||
else(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.2, we have to do this manually use set() instead
|
||||
set(${LIST} ${${LIST}} ${ARGN})
|
||||
endif(CMAKE242_OR_BETTER)
|
||||
endmacro(append_to_list)
|
||||
|
||||
###############################################################################
|
||||
# find_in_list(<list> <value> <output variable>)
|
||||
#
|
||||
# A macro to handle searching within a list, will store the result in the
|
||||
# given <output variable>, uses list(FIND) if using CMake 2.6.x or better
|
||||
# (or CMake 2.4.8 or better), otherwise it iterates through the list to find
|
||||
# the item.
|
||||
###############################################################################
|
||||
macro(find_in_list LIST ITEM_TO_FIND FOUND)
|
||||
if(CMAKE248_OR_BETTER)
|
||||
# For CMake 2.4.8 or better, we can use the FIND sub-command of list()
|
||||
list(FIND ${LIST} ${ITEM_TO_FIND} ITEM_FOUND)
|
||||
else(CMAKE248_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.8, we have to do this ourselves (NOTE: This is very slow due to a lack of break() as well)
|
||||
# Firstly we set the position to -1 indicating nothing found, we also use a temporary position
|
||||
set(ITEM_FOUND -1)
|
||||
set(POS 0)
|
||||
# Iterate through the list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# If the item we are looking at is the item we are trying to find, set that we've found the item
|
||||
if(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
set(ITEM_FOUND ${POS})
|
||||
endif(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
# Increase the position value by 1
|
||||
math(EXPR POS "${POS} + 1")
|
||||
endforeach(ITEM)
|
||||
endif(CMAKE248_OR_BETTER)
|
||||
# Set the given FOUND variable to the result
|
||||
set(${FOUND} ${ITEM_FOUND})
|
||||
endmacro(find_in_list)
|
||||
|
||||
###############################################################################
|
||||
# remove_list_duplicates(<list>)
|
||||
#
|
||||
# A macro to handle removing duplicates from a list, uses
|
||||
# list(REMOVE_DUPLICATES) if using CMake 2.6.x or better, otherwise it uses
|
||||
# a slower method of creating a temporary list and only adding to it when
|
||||
# a duplicate item hasn't been found.
|
||||
###############################################################################
|
||||
macro(remove_list_duplicates LIST)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, this can be done automatically
|
||||
list(REMOVE_DUPLICATES ${LIST})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we have to do this ourselves, firstly we'll clear a temporary list
|
||||
set(NEW_LIST)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# Check if the item is in the new list
|
||||
find_in_list(NEW_LIST ${ITEM} FOUND_ITEM)
|
||||
if(FOUND_ITEM EQUAL -1)
|
||||
# If the item was not found, append it to the list
|
||||
append_to_list(NEW_LIST ${ITEM})
|
||||
endif(FOUND_ITEM EQUAL -1)
|
||||
endforeach(ITEM)
|
||||
# Replace the old list with the new list
|
||||
set(${LIST} ${NEW_LIST})
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
endmacro(remove_list_duplicates)
|
||||
|
||||
###############################################################################
|
||||
# remove_item_from_list(<list> <value>)
|
||||
#
|
||||
# A macro to handle removing a value from a list, uses list(REMOVE_ITEM) in
|
||||
# both cases, but can remove the value itself using CMake 2.4.2 or better,
|
||||
# while older versions use a slower method of iterating the list to find the
|
||||
# index of the value to remove.
|
||||
###############################################################################
|
||||
macro(remove_item_from_list LIST VALUE)
|
||||
if(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.2 or better, this can be done automatically
|
||||
list(REMOVE_ITEM ${LIST} ${VALUE})
|
||||
else(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.2, we have to do this ourselves, firstly we set the index and a variable to indicate if the item was found
|
||||
set(INDEX 0)
|
||||
set(FOUND FALSE)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# If the item hasn't been found yet, but the current item is the same, remove it
|
||||
if(NOT FOUND)
|
||||
if(ITEM STREQUAL ${VALUE})
|
||||
set(FOUND TRUE)
|
||||
list(REMOVE_ITEM ${LIST} ${INDEX})
|
||||
endif(ITEM STREQUAL ${VALUE})
|
||||
endif(NOT FOUND)
|
||||
# Increase the index value by 1
|
||||
math(EXPR INDEX "${INDEX} + 1")
|
||||
endforeach(ITEM)
|
||||
endif(CMAKE242_OR_BETTER)
|
||||
endmacro(remove_item_from_list)
|
||||
|
||||
###############################################################################
|
||||
# sort_list(<list>)
|
||||
#
|
||||
# A macro to handle sorting a list, uses list(SORT) if using CMake 2.4.4 or
|
||||
# better, otherwise it uses a slower method of creating a temporary list and
|
||||
# adding elements in alphabetical order.
|
||||
###############################################################################
|
||||
macro(sort_list LIST)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
# For CMake 2.4.4 or better, this can be done automatically
|
||||
list(SORT ${LIST})
|
||||
else(CMAKE244_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.4, we have to do this ourselves, firstly we'll create a teporary list
|
||||
set(NEW_LIST)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# Temporary index position for the new list, as well as temporary value to store if the item was ever found
|
||||
set(INDEX 0)
|
||||
set(FOUND FALSE)
|
||||
# Iterate through the new list
|
||||
foreach(NEW_ITEM ${NEW_LIST})
|
||||
# Compare the items, only if nothing was found before
|
||||
if(NOT FOUND)
|
||||
if(NEW_ITEM STRGREATER "${ITEM}")
|
||||
set(FOUND TRUE)
|
||||
list(INSERT NEW_LIST ${INDEX} ${ITEM})
|
||||
endif(NEW_ITEM STRGREATER "${ITEM}")
|
||||
endif(NOT FOUND)
|
||||
# Increase the index value by 1
|
||||
math(EXPR INDEX "${INDEX} + 1")
|
||||
endforeach(NEW_ITEM)
|
||||
# If the item was never found, just append it to the end
|
||||
if(NOT FOUND)
|
||||
append_to_list(NEW_LIST ${ITEM})
|
||||
endif(NOT FOUND)
|
||||
endforeach(ITEM)
|
||||
# Replace the old list with the new list
|
||||
set(${LIST} ${NEW_LIST})
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
endmacro(sort_list)
|
||||
|
||||
###############################################################################
|
||||
# read_from_file(<filename> <regex> <output variable>)
|
||||
#
|
||||
# A macro to handle reading specific lines from a file, uses file(STRINGS) if
|
||||
# using CMake 2.6.x or better, otherwise we read in the entire file and
|
||||
# perform a string(REGEX MATCH) on each line of the file instead. This
|
||||
# macro can also be used to read in all the lines of a file if REGEX is set
|
||||
# to "".
|
||||
###############################################################################
|
||||
macro(read_from_file FILE REGEX STRINGS)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, we can just use the STRINGS sub-command to get the lines that match the given regular expression (if one is given, otherwise get all lines)
|
||||
if(REGEX STREQUAL "")
|
||||
file(STRINGS ${FILE} RESULT)
|
||||
else(REGEX STREQUAL "")
|
||||
file(STRINGS ${FILE} RESULT REGEX ${REGEX})
|
||||
endif(REGEX STREQUAL "")
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we need to do this manually, firstly we read the file in
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -DFILE:STRING=${FILE} -P ${Anope_SOURCE_DIR}/ReadFile.cmake ERROR_VARIABLE ALL_STRINGS)
|
||||
# Next we replace all newlines with semicolons
|
||||
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
||||
if(REGEX STREQUAL "")
|
||||
# For no regular expression, just set the result to all the lines
|
||||
set(RESULT ${ALL_STRINGS})
|
||||
else(REGEX STREQUAL "")
|
||||
# Clear the result list
|
||||
set(RESULT)
|
||||
# Iterate through all the lines of the file
|
||||
foreach(STRING ${ALL_STRINGS})
|
||||
# Check for a match against the given regular expression
|
||||
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
|
||||
# If we had a match, append the match to the list
|
||||
if(STRING_MATCH)
|
||||
append_to_list(RESULT ${STRING})
|
||||
endif(STRING_MATCH)
|
||||
endforeach(STRING)
|
||||
endif(REGEX STREQUAL "")
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
# Set the given STRINGS variable to the result
|
||||
set(${STRINGS} ${RESULT})
|
||||
endmacro(read_from_file)
|
||||
|
||||
###############################################################################
|
||||
# extract_include_filename(<line> <output variable> [<optional output variable of quote type>])
|
||||
#
|
||||
# This macro will take a #include line and extract the filename.
|
||||
###############################################################################
|
||||
macro(extract_include_filename INCLUDE FILENAME)
|
||||
# Strip the leading and trailing spaces from the include line
|
||||
strip_string(${INCLUDE} INCLUDE_STRIPPED)
|
||||
# Make sure to only do the following if there is a string
|
||||
if(INCLUDE_STRIPPED STREQUAL "")
|
||||
set(FILE "")
|
||||
else(INCLUDE_STRIPPED STREQUAL "")
|
||||
# Extract the filename including the quotes or angle brackets
|
||||
string(REGEX REPLACE "^.*([\"<].*[\">]).*$" "\\1" FILE "${INCLUDE_STRIPPED}")
|
||||
# If an optional 3rd argument is given, we'll store if the quote style was quoted or angle bracketed
|
||||
if(${ARGC} GREATER 2)
|
||||
string(SUBSTRING ${FILE} 0 1 QUOTE)
|
||||
if(QUOTE STREQUAL "<")
|
||||
set(${ARGV2} "angle brackets")
|
||||
else(QUOTE STREQUAL "<")
|
||||
set(${ARGV2} "quotes")
|
||||
endif(QUOTE STREQUAL "<")
|
||||
endif(${ARGC} GREATER 2)
|
||||
# Now remove the quotes or angle brackets
|
||||
string(REGEX REPLACE "^[\"<](.*)[\">]$" "\\1" FILE "${FILE}")
|
||||
endif(INCLUDE_STRIPPED STREQUAL "")
|
||||
# Set the filename to the the given variable
|
||||
set(${FILENAME} "${FILE}")
|
||||
endmacro(extract_include_filename)
|
||||
|
||||
###############################################################################
|
||||
# find_includes(<source filename> <output variable>)
|
||||
#
|
||||
# This macro will search through a file for #include lines, regardless of
|
||||
# whitespace, but only returns the lines that are valid for the current
|
||||
# platform CMake is running on.
|
||||
###############################################################################
|
||||
macro(find_includes SRC INCLUDES)
|
||||
# Read all lines from the file that start with #, regardless of whitespace before the #
|
||||
read_from_file(${SRC} "^[ \t]*#.*$" LINES)
|
||||
# Set that any #include lines found are valid, and create temporary variables for the last found #ifdef/#ifndef
|
||||
set(VALID_LINE TRUE)
|
||||
set(LAST_DEF)
|
||||
set(LAST_CHECK)
|
||||
# Create an empty include list
|
||||
set(INCLUDES_LIST)
|
||||
# Iterate through all the # lines
|
||||
foreach(LINE ${LINES})
|
||||
# Search for #ifdef, #ifndef, #else, #endif, and #include
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*ifdef[ \t]*.*$" FOUND_IFDEF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*ifndef[ \t]*.*$" FOUND_IFNDEF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*else.*$" FOUND_ELSE ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*endif.*$" FOUND_ENDIF ${LINE})
|
||||
string(REGEX MATCH "^[ \t]*#[ \t]*include[ \t]*[\"<].*[\">][\ t]*.*$" FOUND_INCLUDE ${LINE})
|
||||
# If we found a #ifdef on the line, extract the data after the #ifdef and set if the lines after it are valid based on the variables in CMake
|
||||
if(FOUND_IFDEF)
|
||||
# Extract the define
|
||||
string(REGEX REPLACE "^[ \t]*#[ \t]*ifdef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
|
||||
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
|
||||
if(DEFINE STREQUAL "_WIN32")
|
||||
set(DEFINE WIN32)
|
||||
endif(DEFINE STREQUAL "_WIN32")
|
||||
# Set the last define to this one, and set the last check to true, so when #else is encountered, we can do an opposing check
|
||||
set(LAST_DEF ${DEFINE})
|
||||
set(LAST_CHECK TRUE)
|
||||
# If the define is true (it either exists or is a non-false result), the lines following will be checked, otherwise they will be skipped
|
||||
if(${DEFINE})
|
||||
set(VALID_LINE TRUE)
|
||||
else(${DEFINE})
|
||||
set(VALID_LINE FALSE)
|
||||
endif(${DEFINE})
|
||||
else(FOUND_IFDEF)
|
||||
# If we found a #ifndef on the line, the same thing as #ifdef is done, except with the checks in the opposite direction
|
||||
if(FOUND_IFNDEF)
|
||||
# Extract the define
|
||||
string(REGEX REPLACE "^[ \t]*#[ \t]*ifndef[ \t]*(.*)$" "\\1" DEFINE ${LINE})
|
||||
# Replace _WIN32 with WIN32, so we can check if the WIN32 variable of CMake is set instead of _WIN32
|
||||
if(DEFINE STREQUAL "_WIN32")
|
||||
set(DEFINE WIN32)
|
||||
endif(DEFINE STREQUAL "_WIN32")
|
||||
# Set the last define to this one, and set the last check to false, so when #else is encountered, we can do an opposing check
|
||||
set(LAST_DEF ${DEFINE})
|
||||
set(LAST_CHECK FALSE)
|
||||
# If the define is not true (it either doesn't exists or is a false result), the lines following will be checked, otherwise they will be skipped
|
||||
if(${DEFINE})
|
||||
set(VALID_LINE FALSE)
|
||||
else(${DEFINE})
|
||||
set(VALUE_LINE TRUE)
|
||||
endif(${DEFINE})
|
||||
else(FOUND_IFNDEF)
|
||||
# If we found a #else on the line, we check the last define in the opposite direction
|
||||
if(FOUND_ELSE)
|
||||
# When LAST_CHECK is true, we were inside a #ifdef, now act as if we are entering a #ifndef section by doing an opposing check
|
||||
if(LAST_CHECK)
|
||||
if(${LAST_DEF})
|
||||
set(VALID_LINE FALSE)
|
||||
else(${LAST_DEF})
|
||||
set(VALID_LINE TRUE)
|
||||
endif(${LAST_DEF})
|
||||
# When LAST_CHECK is false, we were inside a #ifndef, now act as if we are entering a #ifdef section by doing an opposing check
|
||||
else(LAST_CHECK)
|
||||
if(${LAST_DEF})
|
||||
set(VALID_LINE TRUE)
|
||||
else(${LAST_DEF})
|
||||
set(VALID_LINE FALSE)
|
||||
endif(${LAST_DEF})
|
||||
endif(LAST_CHECK)
|
||||
else(FOUND_ELSE)
|
||||
# If we found a #endif on the line, we'll assume everything following the line is valid until we meet another one of the above lines
|
||||
if(FOUND_ENDIF)
|
||||
set(VALID_LINE TRUE)
|
||||
else(FOUND_ENDIF)
|
||||
# If we found a #include on the line, add the entire line to the list of includes unless the line isn't valid
|
||||
if(FOUND_INCLUDE)
|
||||
if(VALID_LINE)
|
||||
append_to_list(INCLUDES_LIST "${LINE}")
|
||||
endif(VALID_LINE)
|
||||
endif(FOUND_INCLUDE)
|
||||
endif(FOUND_ENDIF)
|
||||
endif(FOUND_ELSE)
|
||||
endif(FOUND_IFNDEF)
|
||||
endif(FOUND_IFDEF)
|
||||
endforeach(LINE)
|
||||
set(${INCLUDES} ${INCLUDES_LIST})
|
||||
endmacro(find_includes)
|
||||
|
||||
###############################################################################
|
||||
# calculate_depends(<source filename> [<optional output variable for includes>])
|
||||
#
|
||||
# This macro is used in most of the src (sub)directories to calculate the
|
||||
# header file dependencies for the given source file.
|
||||
###############################################################################
|
||||
macro(calculate_depends SRC)
|
||||
# Temporarily set that we didn't get a 2nd argument before we actually check if we did get one or not
|
||||
set(CHECK_ANGLE_INCLUDES FALSE)
|
||||
# Check for a second argument
|
||||
if(${ARGC} GREATER 1)
|
||||
set(CHECK_ANGLE_INCLUDES TRUE)
|
||||
endif(${ARGC} GREATER 1)
|
||||
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on
|
||||
find_includes(${SRC} INCLUDES)
|
||||
# Reset the list of headers to empty
|
||||
set(HEADERS)
|
||||
# Iterate through the strings containing #include (if any)
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
|
||||
if(QUOTE_TYPE STREQUAL "quotes")
|
||||
# Append the filename to the list of headers
|
||||
append_to_list(HEADERS ${FILENAME})
|
||||
else(QUOTE_TYPE STREQUAL "quotes")
|
||||
# The following checks will only be done if there was a request for angle includes to be checked
|
||||
if(CHECK_ANGLE_INCLUDES)
|
||||
# Find the path of the include file
|
||||
if(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME} PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include)
|
||||
else(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_path(FOUND_${FILENAME}_INCLUDE NAMES ${FILENAME})
|
||||
endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
# If the include file was found, add it's path to the list of include paths, but only if it doesn't already exist and isn't in the defaults for the compiler
|
||||
if(FOUND_${FILENAME}_INCLUDE)
|
||||
find_in_list(DEFAULT_INCLUDE_DIRS "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_DEFAULTS)
|
||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
find_in_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
if(FOUND_IN_INCLUDES EQUAL -1)
|
||||
append_to_list(${ARGV1} "${FOUND_${FILENAME}_INCLUDE}")
|
||||
endif(FOUND_IN_INCLUDES EQUAL -1)
|
||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
else(FOUND_${FILENAME}_INCLUDE)
|
||||
message(FATAL_ERROR "${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.")
|
||||
endif(FOUND_${FILENAME}_INCLUDE)
|
||||
endif(CHECK_ANGLE_INCLUDES)
|
||||
endif(QUOTE_TYPE STREQUAL "quotes")
|
||||
endforeach(INCLUDE)
|
||||
# Set the list of new headers to empty (this will store all the headers that the above list depends on)
|
||||
set(NEW_HEADERS)
|
||||
# Iterate through the list of headers
|
||||
foreach(HEADER ${HEADERS})
|
||||
# If the current header has it's own headers to depend on, append those to the list of new headers
|
||||
if(${HEADER}_HEADERS)
|
||||
append_to_list(NEW_HEADERS ${${HEADER}_HEADERS})
|
||||
endif(${HEADER}_HEADERS)
|
||||
endforeach(HEADER)
|
||||
# If there were new headers, append them to the list of headers
|
||||
if(NEW_HEADERS)
|
||||
append_to_list(HEADERS ${NEW_HEADERS})
|
||||
endif(NEW_HEADERS)
|
||||
# If after all the above there is a list of header, we'll process them, converting them to full paths
|
||||
if(HEADERS)
|
||||
# Remove duplicate headers from the list and sort the list
|
||||
remove_list_duplicates(HEADERS)
|
||||
sort_list(HEADERS)
|
||||
# Set the list of full path headers to empty
|
||||
set(HEADERS_FULL)
|
||||
# Iterate through the list of headers
|
||||
foreach(HEADER ${HEADERS})
|
||||
# Append the full path of the header to the full path headers list
|
||||
append_to_list(HEADERS_FULL ${${HEADER}_FULLPATH})
|
||||
endforeach(HEADER)
|
||||
# Set the given source file to depend on the headers given
|
||||
set_source_files_properties(${SRC} PROPERTIES OBJECT_DEPENDS "${HEADERS_FULL}")
|
||||
endif(HEADERS)
|
||||
endmacro(calculate_depends)
|
||||
|
||||
###############################################################################
|
||||
# calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
|
||||
#
|
||||
# This macro is used in most of the src (sub)directories to calculate the
|
||||
# library dependencies for the given source file.
|
||||
###############################################################################
|
||||
macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
# Set up a temporary LDFLAGS for this file
|
||||
set(THIS_LDFLAGS "${LDFLAGS}")
|
||||
# Reset extra dependencies
|
||||
set(EXTRA_DEPENDENCIES)
|
||||
# Reset library paths
|
||||
set(LIBRARY_PATHS)
|
||||
# Reset libraries
|
||||
set(LIBRARIES)
|
||||
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
|
||||
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
|
||||
# Iterate through those lines
|
||||
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
|
||||
# Strip off the /* RequiredLibraries: and */ from the line
|
||||
string(REGEX REPLACE "/\\*[ \t]*RequiredLibraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
||||
# Replace all commas with semicolons
|
||||
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
|
||||
# Iterate through the libraries given
|
||||
foreach(LIBRARY ${REQUIRED_LIBRARY})
|
||||
# Locate the library to see if it exists
|
||||
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib)
|
||||
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY})
|
||||
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
# If the library was found, we will add it to the linker flags
|
||||
if(FOUND_${LIBRARY}_LIBRARY)
|
||||
# Get the path only of the library, to add it to linker flags
|
||||
get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH)
|
||||
if(MSVC)
|
||||
# For Visual Studio, instead of editing the linker flags, we'll add the library to a separate list of extra dependencies
|
||||
append_to_list(EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}")
|
||||
else(MSVC)
|
||||
# For all others, add the library paths and libraries
|
||||
append_to_list(LIBRARY_PATHS "${LIBRARY_PATH}")
|
||||
append_to_list(LIBRARIES "${LIBRARY}")
|
||||
endif(MSVC)
|
||||
else(FOUND_${LIBRARY}_LIBRARY)
|
||||
# In the case of the library not being found, we fatally error so CMake stops trying to generate
|
||||
message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
|
||||
endif(FOUND_${LIBRARY}_LIBRARY)
|
||||
endforeach(LIBRARY)
|
||||
endforeach(REQUIRED_LIBRARY)
|
||||
# Remove duplicates from the library paths
|
||||
if(LIBRARY_PATHS)
|
||||
remove_list_duplicates(LIBRARY_PATHS)
|
||||
endif(LIBRARY_PATHS)
|
||||
# Remove diplicates from the libraries
|
||||
if(LIBRARIES)
|
||||
remove_list_duplicates(LIBRARIES)
|
||||
endif(LIBRARIES)
|
||||
# Iterate through library paths and add them to the linker flags
|
||||
foreach(LIBRARY_PATH ${LIBRARY_PATHS})
|
||||
find_in_list(DEFAULT_LIBRARY_DIRS "${LIBRARY_PATH}" FOUND_IN_DEFAULTS)
|
||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
|
||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
endforeach(LIBRARY_PATH)
|
||||
# Iterate through libraries and add them to the linker flags
|
||||
foreach(LIBRARY ${LIBRARIES})
|
||||
set(THIS_LDFLAGS "${THIS_LDFLAGS} -l${LIBRARY}")
|
||||
endforeach(LIBRARY)
|
||||
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
|
||||
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
|
||||
endmacro(calculate_libraries)
|
||||
|
||||
###############################################################################
|
||||
# add_to_cpack_ignored_files(<item> [TRUE])
|
||||
#
|
||||
# A macro to update the environment variable CPACK_IGNORED_FILES which
|
||||
# contains a list of files for CPack to ignore. If the optional 2nd argument
|
||||
# of TRUE is given, periods will be converted to \\. for CPack.
|
||||
###############################################################################
|
||||
macro(add_to_cpack_ignored_files ITEM)
|
||||
# Temporary copy of the orignal item
|
||||
set(REAL_ITEM "${ITEM}")
|
||||
# If we have 2+ arguments, assume that the second one was something like TRUE (doesn't matter really) and convert periods so they will be \\. for CPack
|
||||
if(${ARGC} GREATER 1)
|
||||
string(REPLACE "." "\\\\." REAL_ITEM ${REAL_ITEM})
|
||||
endif(${ARGC} GREATER 1)
|
||||
# If the environment variable is already defined, just tack the item to the end
|
||||
if(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "$ENV{CPACK_IGNORED_FILES};${REAL_ITEM}")
|
||||
# Otherwise set the environment variable to the item
|
||||
else(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
|
||||
endif(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
endmacro(add_to_cpack_ignored_files)
|
||||
+173
-211
@@ -9,31 +9,167 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN3
|
||||
message(FATAL_ERROR "You can not use CMake to build Anope from the root of it's source tree! Remove the CMakeCache.txt file from this directory, then create a separate directory (either below this directory or elsewhere), and then re-run CMake from there.")
|
||||
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
|
||||
|
||||
# Set the project as C++ primarily, but have C enabled for the checks required later
|
||||
project(Anope CXX)
|
||||
enable_language(C)
|
||||
|
||||
# Detect the version of CMake for the later conditional checks
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --version OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REGEX REPLACE "cmake version 2\\.(.*)" "\\1" ONLY_VERSION "${VERSION}")
|
||||
string(REGEX MATCH "-patch .*$" HAS_PATCH "${ONLY_VERSION}")
|
||||
if(HAS_PATCH)
|
||||
string(REGEX REPLACE "(.*)-patch .*" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
string(REGEX REPLACE ".*-patch (.*)" "\\1" PATCH_VERSION "${ONLY_VERSION}")
|
||||
else(HAS_PATCH)
|
||||
string(REGEX REPLACE "(.*)-beta" "\\1" MINOR_VERSION "${ONLY_VERSION}")
|
||||
if(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(PATCH_VERSION 1)
|
||||
else(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(PATCH_VERSION 0)
|
||||
endif(MINOR_VERSION STREQUAL "4-1\n")
|
||||
set(MINOR_VERSION 4)
|
||||
endif(HAS_PATCH)
|
||||
|
||||
# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does
|
||||
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||
if(MINOR_VERSION GREATER 5)
|
||||
set(CMAKE26_OR_BETTER TRUE)
|
||||
set(CMAKE248_OR_BETTER TRUE)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||
else(MINOR_VERSION GREATER 5)
|
||||
set(CMAKE26_OR_BETTER FALSE)
|
||||
# Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module is non-existant in earlier versions
|
||||
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.3)
|
||||
# Also detect if we are using CMake 2.4.8 or better, the FIND sub-command of list() is non-existant in earlier versions
|
||||
if(PATCH_VERSION GREATER 7)
|
||||
set(CMAKE248_OR_BETTER TRUE)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.3)
|
||||
set(CMAKE244_OR_BETTER FALSE)
|
||||
# ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is non-existant in earlier versions
|
||||
if(CMAKE_PATCH_VERSION GREATER 1)
|
||||
else(PATCH_VERSION GREATER 7)
|
||||
set(CMAKE248_OR_BETTER FALSE)
|
||||
# Also detect if we are using CMake 2.4.4 or better, the CheckCXXCompilerFlag module and SORT sub-command of list() are non-existant in earlier versions
|
||||
if(PATCH_VERSION GREATER 3)
|
||||
set(CMAKE244_OR_BETTER TRUE)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(CMAKE_PATCH_VERSION GREATER 1)
|
||||
set(CMAKE242_OR_BETTER FALSE)
|
||||
endif(CMAKE_PATCH_VERSION GREATER 1)
|
||||
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.3)
|
||||
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||
else(PATCH_VERSION GREATER 3)
|
||||
set(CMAKE244_OR_BETTER FALSE)
|
||||
# ALSO detect if we are using CMake 2.4.2 or better, the APPEND sub-command of list() is non-existant in earlier versions
|
||||
if(PATCH_VERSION GREATER 1)
|
||||
set(CMAKE242_OR_BETTER TRUE)
|
||||
else(PATCH_VERSION GREATER 1)
|
||||
set(CMAKE242_OR_BETTER FALSE)
|
||||
endif(PATCH_VERSION GREATER 1)
|
||||
endif(PATCH_VERSION GREATER 3)
|
||||
endif(PATCH_VERSION GREATER 7)
|
||||
endif(MINOR_VERSION GREATER 5)
|
||||
|
||||
# Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template
|
||||
set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR})
|
||||
|
||||
include(Anope)
|
||||
|
||||
# Force the locale to C for later uses of things like gcc so the messages come up in English, not the user's default language
|
||||
set(ENV{LC_ALL} C)
|
||||
|
||||
# Start with empty defaults for library and include directories, to be used by GNU compilers only
|
||||
set(DEFAULT_LIBRARY_DIRS)
|
||||
set(DEFAULT_INCLUDE_DIRS)
|
||||
|
||||
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# First look for the compiler's default library directories
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# Find only the part after "libraries: "
|
||||
string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
|
||||
# Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line
|
||||
if(NOT MINGW)
|
||||
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
|
||||
else(NOT MINGW)
|
||||
set(LIBRARIES "${LINE}")
|
||||
endif(NOT MINGW)
|
||||
# Iterate through the libraries
|
||||
foreach(LIBRARY ${LIBRARIES})
|
||||
# Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
|
||||
string(SUBSTRING ${LIBRARY} 0 1 FIRST_CHAR)
|
||||
if(NOT FIRST_CHAR STREQUAL "=")
|
||||
# If the directory had no = in front of it, make sure it's absolute and add it to the list of default library directories
|
||||
get_filename_component(LIBRARY ${LIBRARY} ABSOLUTE)
|
||||
append_to_list(DEFAULT_LIBRARY_DIRS ${LIBRARY})
|
||||
endif(NOT FIRST_CHAR STREQUAL "=")
|
||||
endforeach(LIBRARY)
|
||||
# Remove duplicate entries from the list
|
||||
if(DEFAULT_LIBRARY_DIRS)
|
||||
remove_list_duplicates(DEFAULT_LIBRARY_DIRS)
|
||||
endif(DEFAULT_LIBRARY_DIRS)
|
||||
# Next, we look for the compiler's default include directories
|
||||
# Run the command to find the default include directories
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.c ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
# Convert the new lines to semicolons
|
||||
string(REGEX REPLACE "\n" ";" LINES ${LINES})
|
||||
# Temporary variable saying if we are in the search list or not
|
||||
set(IN_SEARCH_LIST FALSE)
|
||||
# Iterate through the lines
|
||||
foreach(LINE ${LINES})
|
||||
# If the line has the following on it, the next lines will contain directory names
|
||||
if(LINE STREQUAL "#include <...> search starts here:")
|
||||
set(IN_SEARCH TRUE)
|
||||
else(LINE STREQUAL "#include <...> search starts here:")
|
||||
# If the line has the following on it, we hit the end of the list
|
||||
if(LINE STREQUAL "End of search list.")
|
||||
set(IN_SEARCH FALSE)
|
||||
else(LINE STREQUAL "End of search list.")
|
||||
# If we are within the block between the above two lines...
|
||||
if(IN_SEARCH)
|
||||
# Get everything but the first character of the line
|
||||
string(LENGTH ${LINE} LINE_LENGTH)
|
||||
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
|
||||
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
|
||||
# Convert the path to an absolute one, just in case it wasn't
|
||||
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
|
||||
# Add that directory to the list of default include directories
|
||||
append_to_list(DEFAULT_INCLUDE_DIRS ${INCLUDE})
|
||||
endif(IN_SEARCH)
|
||||
endif(LINE STREQUAL "End of search list.")
|
||||
endif(LINE STREQUAL "#include <...> search starts here:")
|
||||
endforeach(LINE)
|
||||
# Remove duplicate entries from the list
|
||||
if(DEFAULT_INCLUDE_DIRS)
|
||||
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
|
||||
endif(DEFAULT_INCLUDE_DIRS)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
|
||||
if(MSVC)
|
||||
# If the path comes up as "/registry" from any of these, the path wasn't found, otherwise, we'll set WSDK_PATH to the corresponding path
|
||||
# Look for the 2008 SDK under HKLM first
|
||||
get_filename_component(WSDK2008_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
|
||||
if(WSDK2008_PATH STREQUAL "/registry")
|
||||
# If not found, look for the 2003 SDK under HKLM
|
||||
get_filename_component(WSDK2003_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
|
||||
if(WSDK2003_PATH STREQUAL "/registry")
|
||||
# If not found, look for the 2008 SDK under HKCU
|
||||
get_filename_component(WSDK2008_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
|
||||
if(WSDK2008_PATH STREQUAL "/registry")
|
||||
# If not found, look for the 2003 SDK under HKCU
|
||||
get_filename_component(WSDK2003_PATH "[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir]" ABSOLUTE CACHE)
|
||||
if(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
# The SDK was never found, set the path to nothing
|
||||
set(WSDK_PATH "")
|
||||
else(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
set(WSDK_PATH "${WSDK2003_PATH}")
|
||||
endif(WSDK2003_PATH STREQUAL "/regsitry")
|
||||
else(WSDK2008_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2008_PATH}")
|
||||
endif(WSDK2008_PATH STREQUAL "/registry")
|
||||
else(WSDK2003_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2003_PATH}")
|
||||
endif(WSDK2003_PATH STREQUAL "/registry")
|
||||
else(WSDK2008_PATH STREQUAL "/registry")
|
||||
set(WSDK_PATH "${WSDK2008_PATH}")
|
||||
endif(WSDK2008_PATH STREQUAL "/registry")
|
||||
endif(MSVC)
|
||||
|
||||
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition
|
||||
# and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE
|
||||
# to Debug prior to calling PROJECT()
|
||||
# to Debug
|
||||
# Only do this if not using Visual Studio
|
||||
if(NOT MSVC)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
@@ -43,10 +179,6 @@ if(NOT MSVC)
|
||||
endif(CMAKE_BUILD_TYPE)
|
||||
endif(NOT MSVC)
|
||||
|
||||
# Set the project as C++ primarily, but have C enabled for the checks required later
|
||||
project(Anope CXX)
|
||||
enable_language(C)
|
||||
|
||||
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
|
||||
if(MINGW)
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
@@ -83,7 +215,7 @@ if(MSVC)
|
||||
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
# Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4251 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4251 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
add_definitions(-DMSVCPP -D_CRT_SECURE_NO_WARNINGS)
|
||||
# Otherwise, we're not using Visual Studio
|
||||
else(MSVC)
|
||||
@@ -143,6 +275,11 @@ if(NOT MSVC)
|
||||
if(HAVE_SOCKET_LIB)
|
||||
set(LDFLAGS "${LDFLAGS} -lsocket")
|
||||
endif(HAVE_SOCKET_LIB)
|
||||
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
|
||||
if(HAVE_NSL_LIB)
|
||||
set(LDFLAGS "${LDFLAGS} -lnsl")
|
||||
endif(HAVE_NSL_LIB)
|
||||
endif(NOT WIN32)
|
||||
endif(NOT MSVC)
|
||||
|
||||
@@ -181,98 +318,14 @@ check_type_size(int32_t INT32_T)
|
||||
check_type_size(uint32_t UINT32_T)
|
||||
check_type_size(u_int32_t U_INT32_T)
|
||||
|
||||
# Only CMake 2.6.x and later contain the STRIP sub-command for string()
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# Strip the leading and trailing spaces from the compile flags
|
||||
if(CXXFLAGS)
|
||||
string(STRIP ${CXXFLAGS} CXXFLAGS)
|
||||
endif(CXXFLAGS)
|
||||
# Strip the leading and trailing spaces from the linker flags
|
||||
if(LDFLAGS)
|
||||
string(STRIP ${LDFLAGS} LDFLAGS)
|
||||
endif(LDFLAGS)
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
|
||||
# A macro to handle appending to lists
|
||||
macro(append_to_list LIST)
|
||||
if(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.2 or better, we can just use the APPEND sub-command of list()
|
||||
list(APPEND ${LIST} ${ARGN})
|
||||
else(CMAKE242_OR_BETTER)
|
||||
# For CMake 2.4.x before 2.4.2, we have to do this manually use set() instead
|
||||
set(${LIST} ${${LIST}} ${ARGN})
|
||||
endif(CMAKE242_OR_BETTER)
|
||||
endmacro(append_to_list)
|
||||
|
||||
# A macro to handle reading specific lines from a file
|
||||
macro(read_from_file FILE REGEX STRINGS)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, we can just use this function to get the lines that match the given regular expression
|
||||
file(STRINGS ${FILE} RESULT REGEX ${REGEX})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we need to do this manually, firsly we read the file in
|
||||
file(READ ${FILE} ALL_STRINGS)
|
||||
# Next we replace all newlines with semicolons
|
||||
string(REGEX REPLACE "\n" ";" ALL_STRINGS ${ALL_STRINGS})
|
||||
# Clear the result list
|
||||
set(RESULT)
|
||||
# Iterate through all the lines of the file
|
||||
foreach(STRING ${ALL_STRINGS})
|
||||
# Check for a match against the given regular expression
|
||||
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
|
||||
# If we had a match, append the match to the list
|
||||
if(STRING_MATCH)
|
||||
append_to_list(RESULT ${STRING})
|
||||
endif(STRING_MATCH)
|
||||
endforeach(STRING)
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
# Set the given STRINGS variable to the result
|
||||
set(${STRINGS} ${RESULT})
|
||||
endmacro(read_from_file)
|
||||
|
||||
# A macro to handle searching within a list
|
||||
macro(find_in_list LIST ITEM_TO_FIND FOUND)
|
||||
if(CMAKE26_OR_BETTER OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.7)
|
||||
# For CMake 2.6.x or better (as well as CMake 2.4.8 or better), we can use the FIND sub-command of list()
|
||||
list(FIND ${LIST} ${ITEM_TO_FIND} ITEM_FOUND)
|
||||
else(CMAKE26_OR_BETTER OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.7)
|
||||
# For CMake 2.4.x before 2.4.8, we have to do this ourselves (NOTE: This is very slow due to a lack of break() as well), firstly we set that we a temporary boolean
|
||||
set(ITEM_FOUND -1)
|
||||
set(POS 0)
|
||||
# Iterate through the list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# If the item we are looking at is the item we are trying to find, set that we've found the item
|
||||
if(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
set(ITEM_FOUND ${POS})
|
||||
endif(${ITEM} STREQUAL ${ITEM_TO_FIND})
|
||||
math(EXPR POS "${POS} + 1")
|
||||
endforeach(ITEM)
|
||||
endif(CMAKE26_OR_BETTER OR ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} GREATER 2.4.7)
|
||||
# Set the given FOUND variable to the result
|
||||
set(${FOUND} ${ITEM_FOUND})
|
||||
endmacro(find_in_list)
|
||||
|
||||
# A macro to handle removing duplicates from a list
|
||||
macro(remove_list_duplicates LIST)
|
||||
if(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.6.x or better, this can be done automatically
|
||||
list(REMOVE_DUPLICATES ${LIST})
|
||||
else(CMAKE26_OR_BETTER)
|
||||
# For CMake 2.4.x, we have to do this ourselves, firstly we'll clear a temporary list
|
||||
set(NEW_LIST)
|
||||
# Iterate through the old list
|
||||
foreach(ITEM ${${LIST}})
|
||||
# Check if the item is in the new list
|
||||
find_in_list(NEW_LIST ${ITEM} FOUND_ITEM)
|
||||
if(FOUND_ITEM EQUAL -1)
|
||||
# If the item was not found, append it to the list
|
||||
append_to_list(NEW_LIST ${ITEM})
|
||||
endif(FOUND_ITEM EQUAL -1)
|
||||
endforeach(ITEM)
|
||||
# replace the old list with the new list
|
||||
set(${LIST} ${NEW_LIST})
|
||||
endif(CMAKE26_OR_BETTER)
|
||||
endmacro(remove_list_duplicates)
|
||||
# Strip the leading and trailing spaces from the compile flags
|
||||
if(CXXFLAGS)
|
||||
strip_string(${CXXFLAGS} CXXFLAGS)
|
||||
endif(CXXFLAGS)
|
||||
# Strip the leading and trailing spaces from the linker flags
|
||||
if(LDFLAGS)
|
||||
strip_string(${LDFLAGS} LDFLAGS)
|
||||
endif(LDFLAGS)
|
||||
|
||||
# Search for the following programs
|
||||
find_program(GREP grep)
|
||||
@@ -341,36 +394,10 @@ foreach(HEADER ${ALL_HEADERS})
|
||||
endif(NOT HEADER MATCHES ".*obsolete.*")
|
||||
endforeach(HEADER)
|
||||
# Set the list of headers to be all the non-obsolete ones, then sort the list
|
||||
set(ALL_HEADERS ${TMP_HEADERS})
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT ALL_HEADERS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
|
||||
# This function will take a #include line and extract the filename minus the quotes
|
||||
macro(extract_include_filename INCLUDE FILENAME)
|
||||
# Detect if there is any trailing whitespace (basically see if the last character is a space or a tab)
|
||||
string(LENGTH ${INCLUDE} INCLUDE_LEN)
|
||||
math(EXPR LAST_CHAR_POS "${INCLUDE_LEN} - 1")
|
||||
string(SUBSTRING ${INCLUDE} ${LAST_CHAR_POS} 1 LAST_CHAR)
|
||||
# Only strip if the last character was a space or a tab
|
||||
if(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
# Strip away trailing whitespace from the line
|
||||
string(REGEX REPLACE "[ \t]*$" "" INCLUDE_STRIPPED ${INCLUDE})
|
||||
else(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
# Just copy INCLUDE to INCLUDE_STRIPPED so the below code doesn't complain about a lack of INCLUDE_STRIPPED
|
||||
set(INCLUDE_STRIPPED ${INCLUDE})
|
||||
endif(LAST_CHAR STREQUAL " " OR LAST_CHAR STREQUAL "\t")
|
||||
# Find the filename including the quotes, it should be at the end of the line after whitespace was stripped
|
||||
string(REGEX MATCH "\".*\"$" FILE ${INCLUDE_STRIPPED})
|
||||
# Get the length of the filename with quotes
|
||||
string(LENGTH ${FILE} FILENAME_LEN)
|
||||
# Subtract 2 from this length, for the quotes
|
||||
math(EXPR FILENAME_LEN "${FILENAME_LEN} - 2")
|
||||
# Overwrite the filename with a version sans quotes
|
||||
string(SUBSTRING ${FILE} 1 ${FILENAME_LEN} FILE)
|
||||
# Set the filename to the the given variable
|
||||
set(${FILENAME} "${FILE}")
|
||||
endmacro(extract_include_filename)
|
||||
if(TMP_HEADERS)
|
||||
set(ALL_HEADERS ${TMP_HEADERS})
|
||||
sort_list(ALL_HEADERS)
|
||||
endif(TMP_HEADERS)
|
||||
|
||||
# Preparse step 1: get filenames sans paths
|
||||
# Iterate through the headers
|
||||
@@ -419,9 +446,7 @@ foreach(HEADER ${ALL_HEADERS})
|
||||
endwhile(HEADERS)
|
||||
# OLD_HEADERS will now contain all headers that the current header relies on, remove duplicate headers from the list and sort the list
|
||||
remove_list_duplicates(OLD_HEADERS)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT OLD_HEADERS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
sort_list(OLD_HEADERS)
|
||||
# Set the current header's list of headers to the cleaned up list from above
|
||||
set(${HEADER_FILENAME}_HEADERS ${OLD_HEADERS})
|
||||
endif(${HEADER_FILENAME}_HEADERS)
|
||||
@@ -433,70 +458,8 @@ set(language.h_FULLPATH ${Anope_BINARY_DIR}/lang/language.h)
|
||||
set(sysconf.h_FULLPATH ${Anope_BINARY_DIR}/include/sysconf.h)
|
||||
set(version.h_FULLPATH ${Anope_BINARY_DIR}/include/version.h)
|
||||
|
||||
# This function is used in most of the src (sub)directories to calculate the header file dependencies for the given source file
|
||||
macro(calculate_depends SRC)
|
||||
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace
|
||||
read_from_file(${SRC} "^[ \t]*#[ \t]*include[ \t]*\".*\"[ \t]*$" INCLUDES)
|
||||
# Reset the list of headers to empty
|
||||
set(HEADERS)
|
||||
# Iterate through the strings containing #include (if any)
|
||||
foreach(INCLUDE ${INCLUDES})
|
||||
# Extract the filename from the #include line
|
||||
extract_include_filename(${INCLUDE} FILENAME)
|
||||
# Append the filename to the list of headers
|
||||
append_to_list(HEADERS ${FILENAME})
|
||||
endforeach(INCLUDE)
|
||||
# Set the list of new headers to empty (this will store all the headers that the above list depends on)
|
||||
set(NEW_HEADERS)
|
||||
# Iterate through the list of headers
|
||||
foreach(HEADER ${HEADERS})
|
||||
# If the current header has it's own headers to depend on, append those to the list of new headers
|
||||
if(${HEADER}_HEADERS)
|
||||
append_to_list(NEW_HEADERS ${${HEADER}_HEADERS})
|
||||
endif(${HEADER}_HEADERS)
|
||||
endforeach(HEADER)
|
||||
# If there were new headers, append them to the list of headers
|
||||
if(NEW_HEADERS)
|
||||
append_to_list(HEADERS ${NEW_HEADERS})
|
||||
endif(NEW_HEADERS)
|
||||
# If after all the above there is a list of header, we'll process them, converting them to full paths
|
||||
if(HEADERS)
|
||||
# Remove duplicate headers from the list and sort the list
|
||||
remove_list_duplicates(HEADERS)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT HEADERS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
# Set the list of full path headers to empty
|
||||
set(HEADERS_FULL)
|
||||
# Iterate through the list of headers
|
||||
foreach(HEADER ${HEADERS})
|
||||
# Append the full path of the header to the full path headers list
|
||||
append_to_list(HEADERS_FULL ${${HEADER}_FULLPATH})
|
||||
endforeach(HEADER)
|
||||
# Set the given source file to depend on the headers given
|
||||
set_source_files_properties(${SRC} PROPERTIES OBJECT_DEPENDS "${HEADERS_FULL}")
|
||||
endif(HEADERS)
|
||||
endmacro(calculate_depends)
|
||||
|
||||
# A macro to update the environment variable CPACK_IGNORED_FILES which contains a list of files for CPack to ignore
|
||||
macro(add_to_cpack_ignored_files ITEM)
|
||||
# Temporary copy of the orignal item
|
||||
set(REAL_ITEM "${ITEM}")
|
||||
# If we have 2+ arguments, assume that the second one was something like TRUE (doesn't matter really) and convert periods so they will be \\. for CPack
|
||||
if(${ARGC} GREATER 1)
|
||||
string(REPLACE "." "\\\\." REAL_ITEM ${REAL_ITEM})
|
||||
endif(${ARGC} GREATER 1)
|
||||
# If the environment variable is already defined, just tack the item to the end
|
||||
if(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "$ENV{CPACK_IGNORED_FILES};${REAL_ITEM}")
|
||||
# Otherwise set the environment variable to the item
|
||||
else(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
|
||||
endif(DEFINED ENV{CPACK_IGNORED_FILES})
|
||||
endmacro(add_to_cpack_ignored_files)
|
||||
|
||||
# Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source
|
||||
add_to_cpack_ignored_files(".git\;config.cache\;.svn\;CMakeFiles\;sysconf.h$\;Makefile.inc$\;config.log\;config.status" TRUE)
|
||||
add_to_cpack_ignored_files(".git\;config.cache\;.svn\;CMakeFiles\;sysconf.h$\;Makefile.inc$\;config.log\;config.status\;build\;autom4te.cache" TRUE)
|
||||
# Add the files we don't want the periods converted for
|
||||
add_to_cpack_ignored_files(".\\\\\\\\.so$;.\\\\\\\\.o$;.\\\\\\\\.s$;${Anope_SOURCE_DIR}/Makefile$")
|
||||
# If the two directories are the same, we are building in-source, thus we need to ignore more files from the build
|
||||
@@ -545,8 +508,6 @@ endif(WIN32)
|
||||
|
||||
# Only process the CPack section if we have CPack
|
||||
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
# Override the module include path to include our directory, as we are using our own version of the NSIS template
|
||||
set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR})
|
||||
# Various options for CPack
|
||||
set(CPACK_PACKAGE_NAME "Anope IRC Services")
|
||||
set(CPACK_PACKAGE_VENDOR "Anope Team")
|
||||
@@ -569,17 +530,18 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
"bin\\\\anope.bat\\\" \\\"-debug -nofork" "Anope IRC Services (Debug and Window Logging)"
|
||||
"bin\\\\anope.bat\\\" \\\"-nofork" "Anope IRC Services (Window Logging)"
|
||||
"bin\\\\anope.bat\\\" \\\"-nothird" "Anope IRC Services (No Third Party Modules)"
|
||||
"http://www.anope.org" "Anope Web Site"
|
||||
"http://www.anope.org/" "Anope Web Site"
|
||||
)
|
||||
# The following doesn't work, but a bug report has been filed about it
|
||||
#set(CPACK_CREATE_DESKTOP_LINK_${SERVICES_BINARY} TRUE)
|
||||
set(CPACK_NSIS_MUI_ICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "${Anope_SOURCE_DIR}/src\\\\anope-icon.ico")
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${SERVICES_BINARY}")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.anope.org")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.anope.org/")
|
||||
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
|
||||
endif(WIN32)
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}-source")
|
||||
set(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
set(CPACK_SOURCE_IGNORE_FILES "$ENV{CPACK_IGNORED_FILES}")
|
||||
set(CPACK_MONOLITHIC_INSTALL TRUE)
|
||||
include(CPack)
|
||||
|
||||
@@ -1,12 +1,59 @@
|
||||
Anope Version 1.9.1
|
||||
--------------------
|
||||
F Don't enforce akick/forbidden/etc.-restrictions on clients on ulined servers.
|
||||
|
||||
|
||||
Provided by Ankit <ankit@nevitus.com> - 2009
|
||||
F Segfault on shutdown
|
||||
|
||||
Provided by Adam <adam@anope.org> - 2009
|
||||
F NickServ registration is sometimes denied.
|
||||
F Applied patch from Adam to fix some potential screwups
|
||||
F More fixes to bs_bot from Adam, plus an extra fix within DoAdd not covered in Adam's patch.
|
||||
F Fix bs_bot to use the correct parameters, patch from Adam.
|
||||
F Fix for bug #1004, based from second half of patch from Adam.
|
||||
F Partial patch by Adam, commenting fix for #1006 for future reference.
|
||||
F Forward-port r1946: Patch by Adam fixing #1006 (originally caused by #922): modes set by ChanServ are reversed. Thanks!
|
||||
|
||||
Provided by DukePyrolator <dukepyrolator@gmx.de> - 2009
|
||||
F Patch converting all match calls to new method, thanks!
|
||||
F Add 'w' and 'y' support to dotime(), also prevent an overflow.
|
||||
F Allow NS STATUS from unregistered users, thanks DP!
|
||||
F Wild pointers do not a happy Anope make. Thanks DP :)
|
||||
F Allow NS REGISTER to unregistered nicks, silly oversight. Thanks DP! :)
|
||||
F Fix call order, thanks to DP
|
||||
F Pass the right array to do_umode(), fixes mode tracking on Unreal. Thanks to DukePyrolator (yet again :P)
|
||||
F Fix bs_set help, thanks to DukePyrolator! :)
|
||||
F Fix two segfaults, noted by DukePyrolator. Thanks!
|
||||
F Fix part one of #1010, reported by DukePyrolator. (Language settings are not respected in message sending.) Thanks!
|
||||
F Memory leak on +beI modes.
|
||||
|
||||
|
||||
Anope Version 1.9.0
|
||||
--------------------
|
||||
09/27 F Modified compile to use g++
|
||||
10/01 F Improve protocol modules support (classes, virtual methods, etc)
|
||||
10/11 F Move core services to use BotInfo
|
||||
10/12 F Move BotInfo and related methods into a class
|
||||
11/01 F Move modules into a class
|
||||
11/15 F Fixed ns resending of passcode issue
|
||||
11/15 F Modules now delete themselves
|
||||
F Modified compile to use g++
|
||||
F Improve protocol modules support (classes, virtual methods, etc)
|
||||
F Move core services to use BotInfo
|
||||
F Move BotInfo and related methods into a class
|
||||
F Move modules into a class
|
||||
F Fixed ns resending of passcode issue
|
||||
F Modules now delete themselves
|
||||
F additional field where users' masked host can be stored so both masked IP and vhost are available instead of just one.
|
||||
F No struct Uid, ugly, and, unnecessary that we store UID in BotInfo.
|
||||
F Prevent deletion of core services via /bs bot
|
||||
F Module subsystem cleanup ('modules' branch)
|
||||
F Move modules to use classes somewhat (AnopeInit, AnopeFini)
|
||||
F Change MODULE_INIT to return a pointer
|
||||
F Remove duplicate module creation.. have loadModule return a pointer rather than creating one
|
||||
F Remove buffered loading/unloading, this makes os_modunload perm, but who cares
|
||||
F Remove 'delayed' loading, this is necessary because of before/after connected to ircd (ircd is before, rest after), I'm sure this can be done better.
|
||||
A Remove old config, replace with insp-inspired (albeit bind format) config (CBX)
|
||||
F Clean up protocol modules a bit
|
||||
A InspIRCd 1.2 support
|
||||
F Remove old (prior to 1.8.0) db compat
|
||||
F Establish a proper base for services pseudoclients
|
||||
F Add ss_main StatServ Hal9000 to play with :)
|
||||
F Burn automake with fire (CBX)
|
||||
|
||||
Provided by mooncup <mooncup@anonnet.org> - 2009
|
||||
02/04 F Automatically reapply vhost on hs off for unreal32. [ #00]
|
||||
F Automatically reapply vhost on hs off for unreal.
|
||||
|
||||
+6
-774
@@ -1,4 +1,9 @@
|
||||
Anope Version 1.8.0
|
||||
Anope Version 1.9.1
|
||||
-------------------
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
Nick tracking has been removed as an option.
|
||||
|
||||
Anope Version 1.9.0
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
@@ -7,776 +12,3 @@ Anope Version 1.8.0
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
|
||||
Anope Version 1.7.24
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.23b
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.23
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
# OSIgnoreDBName [OPTIONAL]
|
||||
# Module: os_ignore_db
|
||||
#
|
||||
# Use the given filename as database for services ignores.
|
||||
# If not given, the default of "os_ignore.db" will be used.
|
||||
#
|
||||
#OSIgnoreDBName "os_ignore.db"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.22
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
# BotCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of BotServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
BotCoreModules "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot bs_fantasy bs_fantasy_kick bs_fantasy_kickban bs_fantasy_owner bs_fantasy_seen"
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.21
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.20
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.19
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.18
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
###########################################################################
|
||||
#
|
||||
# Encryption settings
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# EncModule <module_name> [REQUIRED]
|
||||
# The encryption module to use when dealing with passwords.
|
||||
# This determines how the passwords are stored in the databases,
|
||||
# and does not add any security as far as transmitting passwords over
|
||||
# the network goes.
|
||||
# enc_none provides no password encryption, storing the password in
|
||||
# plain text, this is the most versiatle as passwords can easily be
|
||||
# recovered.
|
||||
#
|
||||
# NOTE: users of anope's previous (broken) md5 implementation should
|
||||
# select the enc_old option, or things may break.
|
||||
#
|
||||
# NOTE2: Some of these encryption methods are one-way (md5, sha1, old)
|
||||
# meaning that you can NOT retrive the passwords in plain text once
|
||||
# encrypted.
|
||||
#
|
||||
# Plain Text - enc_none
|
||||
# Previous (broken) MD5 - enc_old
|
||||
# MD5 - enc_md5
|
||||
# SHA1 - enc_sha1
|
||||
#
|
||||
|
||||
EncModule "enc_none"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.17
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.16
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.15
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
# UseStrictPrivMsg [OPTIONAL]
|
||||
# Using this directive will force services to only respond to privmsgs
|
||||
# addressed to Nick@ServerName - e.g. NickServ@localhost.net.
|
||||
# This should be used on conjunction with ircd aliases.
|
||||
#
|
||||
|
||||
#UseStrictPrivMsg
|
||||
|
||||
# NSResendDelay <time> [RECOMMENDED]
|
||||
# Sets the minimum length of time between consecutive uses of the
|
||||
# RESEND command. If not given, this restriction is disabled (note
|
||||
# that this allows "resend flooding" or "mail bombing").
|
||||
|
||||
NSResendDelay 90s
|
||||
|
||||
NSDefAutoop
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
ModuleDelayedAutoload "cs_appendtopic cs_enforce ns_maxemail os_info hs_request"
|
||||
|
||||
# LimitSessions [OPTIONAL]
|
||||
# Enables session limiting. Session limiting prevents users from
|
||||
# connecting more than a certain number of times from the same host at the
|
||||
# same time - thus preventing most types of cloning. Once a host reaches
|
||||
# it's session limit, all clients attempting to connect from that host
|
||||
# will be killed. Exceptions to the default session limit, which are based
|
||||
# on host names, can be defined via the exception list. It should be noted
|
||||
# that session limiting, along with a large exception list, can degrade
|
||||
# services' performance. See the source and comments in sessions.c and the
|
||||
# online help for more information about session limiting.
|
||||
#
|
||||
# NOTE: This option is not available when STREAMLINED is defined in
|
||||
# the Makefile.
|
||||
|
||||
LimitSessions
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
# NSAutoOPDBName [OPTIONAL]
|
||||
# Module: ns_noop
|
||||
#
|
||||
# Use the given filename as database for the autoop list. If not given,
|
||||
# the default of "autoop.db" will be used.
|
||||
#
|
||||
#NSAutoOPDBName "autoop.db"
|
||||
|
||||
# KillClonesAkillExpire <time> [REQUIRED]
|
||||
# Sets the expiry time for autokills added for hosts that have been
|
||||
# killed using the KILLCLONES command.
|
||||
|
||||
KillClonesAkillExpire 30m
|
||||
|
||||
# CheckClones <minusers> <maxdelay> <warningdelay> [DEPRECATED]
|
||||
# Causes Services to try and detect "clones" connecting to the network.
|
||||
# A WALLOPS (or GOPER, if supported on the IRC server) will be sent if
|
||||
# Services thinks it has found clones.
|
||||
#
|
||||
# This feature has been superseded by Session Limiting.
|
||||
#
|
||||
# <minusers> sets the minimum number of users which must successively
|
||||
# connect to the network before Services will send a clone warning.
|
||||
#
|
||||
# <maxdelay> sets the maximum time that can elapse between successive
|
||||
# users before Services decides they are not clones.
|
||||
#
|
||||
# <warningdelay> sets the minimum time between clone warnings for
|
||||
# clones from the same host.
|
||||
#
|
||||
# NOTE: This option is not available when STREAMLINED is defined in
|
||||
# the Makefile.
|
||||
|
||||
# CheckClones 5 10s 30s
|
||||
|
||||
# KillClones [DISCOURAGED] [DEPRECATED]
|
||||
# Causes Services to kill users which trigger the clone warnings. (If
|
||||
# CheckClones is disabled, this will have no effect.)
|
||||
#
|
||||
# This feature has been superceded by Session Limiting.
|
||||
#
|
||||
# BEWARE! The clone checking code is easily fooled; it can be
|
||||
# triggered falsely under many conditions, for example:
|
||||
#
|
||||
# - Multiple users connecting from a shell machine.
|
||||
#
|
||||
# - A single user repeatedly connecting and disconnecting.
|
||||
#
|
||||
# Be very sure you know what you're doing before you even think about
|
||||
# enabling this option, and remember that Services comes with no
|
||||
# warranty.
|
||||
#
|
||||
# If that wasn't enough discouragement:
|
||||
#
|
||||
# ***** DO NOT ENABLE THIS OPTION! *****
|
||||
#
|
||||
# NOTE: This option is not available when STREAMLINED is defined in
|
||||
# the Makefile.
|
||||
|
||||
#KillClones
|
||||
|
||||
Anope Version 1.7.13
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.12
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# BSFantasyCharacter [REQUIRED]
|
||||
# This option allows you to change the default prefix for fantasy
|
||||
# commands in channels. This character will have to be prepended to all
|
||||
# fantasy commands. If you choose "!" (the default), fantasy commands
|
||||
# will, for example, be "!kick", "!op", etc.
|
||||
|
||||
BSFantasyCharacter "!"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.11
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NickLen [REQUIRED]
|
||||
# Set this to the maximum allowed nick length on your network. Anope does
|
||||
# not support values larger than 31, so setting them makes no sense. Be
|
||||
# sure to set this correctly, as setting this wrong can result in services
|
||||
# being disconnected from the network.
|
||||
|
||||
NickLen 31
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
# UserKey1|2|3 <value> [RECOMMENDED]
|
||||
#
|
||||
# These keys are required to initiate the random number generator. These
|
||||
# numbers MUST be random as you want your passcodes to be random. Don't
|
||||
# give these keys to anyone! Keep them private!
|
||||
#
|
||||
# *** NOTE ***
|
||||
# If you don't enable these, or keep their default values, any talented
|
||||
# programmer would be able to easily "guess" random strings used to mask
|
||||
# information. Be safe, and come up with three different 7 digit numbers
|
||||
|
||||
#UserKey1 9866235
|
||||
#UserKey2 8362013
|
||||
#UserKey3 2362899
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.10
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.9
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
# IRCDModule <module_name> [REQUIRED]
|
||||
# The ircd protocol module should be used when connecting anope to your
|
||||
# chosen IRCD. This should be one of the following options, or a file
|
||||
# provided by your IRCD author.
|
||||
#
|
||||
# Bahamut 1.4.27 [or later] - "bahamut"
|
||||
# DreamForge 4.6.7 - "dreamforge"
|
||||
# Hybrid IRCd 7.0 [experimental] - "hybrid"
|
||||
# InspIRCd 1.0 Beta 5 - "inspircd"
|
||||
# InspIRCd module is provided by Brain <brain@inspircd.org>
|
||||
# Plexus 2.0 [or later] - "plexus"
|
||||
# PTLink 6.15.0 [experimental] - "ptlink"
|
||||
# RageIRCd 2.0.0 [beta-6 of later] - "rageircd"
|
||||
# Ratbox 2.0.6 [or later] - "ratbox"
|
||||
# ShadowIRCD 4.0x [beta 7 or later] - "shadowircd"
|
||||
# Solid IRCD 3.4.x [3.4.6 or later] - "solidircd"
|
||||
# UltimateIRCd 3.0.0 [or later] - "ultimate3"
|
||||
# UltimateIRCd 2.8.2 [or later] - "ultimate2"
|
||||
# Unreal 3.2 [beta-19 or later] - "unreal32"
|
||||
# Unreal 3.1.1 [or later] - "unreal31"
|
||||
# ViagraIRCd 1.3.x [or later] - "viagra"
|
||||
#
|
||||
|
||||
#IRCDModule "unreal32"
|
||||
|
||||
# HostCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of HostServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
HostCoreModules "hs_help hs_on hs_off hs_group hs_list hs_set hs_setall hs_del hs_delall"
|
||||
|
||||
# MemoCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of MemoServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
MemoCoreModules "ms_send ms_cancel ms_list ms_read ms_del ms_set ms_info ms_rsend ms_check ms_staff ms_sendall ms_help"
|
||||
|
||||
# HelpCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of HelpServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
HelpCoreModules "he_help"
|
||||
|
||||
# BotCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of BotServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
BotCoreModules "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot bs_fantasy bs_fantasy_kick bs_fantasy_kickban bs_fantasy_owner bs_fantasy_seen bs_fantasy_unban"
|
||||
|
||||
# OperCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of OperServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
OperCoreModules "os_help os_global os_stats os_oper os_admin os_staff os_mode os_kick os_clearmodes os_killclones os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_logonnews os_randomnews os_opernews os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo"
|
||||
|
||||
# NickCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of NickServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
NickCoreModules "ns_help ns_register ns_group ns_identify ns_access ns_set ns_drop ns_recover ns_release ns_sendpass ns_ghost ns_alist ns_info ns_list ns_logout ns_status ns_update ns_getpass ns_getemail ns_forbid ns_suspend"
|
||||
|
||||
# ChanCoreModules <list> [RECOMMENDED]
|
||||
# These modules will be loaded as part of ChanServ's core.
|
||||
# It is not recommended you change these settings unless you are
|
||||
# sure you understand exactly what it is you are doing.
|
||||
ChanCoreModules "cs_help cs_register cs_identify cs_set cs_xop cs_access cs_akick cs_drop cs_sendpass cs_ban cs_clear cs_modes cs_getkey cs_invite cs_kick cs_list cs_logout cs_topic cs_info cs_getpass cs_forbid cs_suspend cs_status"
|
||||
|
||||
# OSOpersOnly [RECOMMENDED]
|
||||
# If this is defined, only IRC Operators will be permitted to use
|
||||
# OperServ, regardless of module based command access restrictions.
|
||||
|
||||
OSOpersOnly
|
||||
|
||||
# NSEmailMax [OPTIONAL]
|
||||
# Module: ns_maxemail
|
||||
#
|
||||
# Limit the amount of registrations with the same email address to the
|
||||
# amount given here. If set to 0 or left commented, there will be no limit
|
||||
# enforced when registering new accounts or using /msg NickServ SET EMAIL.
|
||||
#
|
||||
#NSEmailMax 1
|
||||
|
||||
# NSAutoOPDBName [OPTIONAL]
|
||||
# Module: ns_noop
|
||||
#
|
||||
# Use the given filename as database for the autoop list. If not given,
|
||||
# the default of "autoop.db" will be used.
|
||||
#
|
||||
#NSAutoOPDBName "autoop.db"
|
||||
|
||||
# OSInfoDBName [OPTIONAL]
|
||||
# Module: os_info
|
||||
#
|
||||
# Use the given filename as database for the oper information lines.
|
||||
# If not given, the default of "os_info.db" will be used.
|
||||
#
|
||||
#OSInfoDBName "os_info.db"
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UserKey1|2|3 <value> [REQUIRED]
|
||||
#
|
||||
# These keys are required to initiate the random number generator. These
|
||||
# numbers MUST be random as you want your passcodes to be random. Don't
|
||||
# give these keys to no anyone! Keep them private!
|
||||
# For those pple who don't understand what to do here: Just pick three
|
||||
# _different_ _random_ numbers with about 6 or 7 digits and put them here.
|
||||
# If the keys don't work, they might be too long or you forgot to remove
|
||||
# the # in front of them. Example:
|
||||
# UserKey1 9866235
|
||||
|
||||
# UserKey1 <your_first_random_number_here>
|
||||
# UserKey2 <your_second_random_number_here>
|
||||
# UserKey3 <you_third_random_number_here>
|
||||
|
||||
# Numeric [OPTIONAL]
|
||||
# Many ircd identify themselves with a Numeric ID when using this option
|
||||
# consult your ircds documentation before using this.
|
||||
#Numeric "3AX"
|
||||
#Numeric "4"
|
||||
|
||||
# ModuleDelayedAutoload [OPTIONAL]
|
||||
#
|
||||
# When compiled with module support, this contains a space separated list
|
||||
# of modules to automaticaly load when services are ready for new clients.
|
||||
# e.g. new pesudo clients such as CatServ :-) *meow*
|
||||
# By default a number of modules that we found worth adding by default are
|
||||
# loaded. Feel free to change this if you want to add more, or remove some
|
||||
# from the list.
|
||||
#
|
||||
ModuleDelayedAutoload "cs_appendtopic cs_enforce ns_maxemail ns_noop os_info"
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# Proxy detection
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# Note: if ProxyDetect is not set, all parameters after it in this section
|
||||
# are optional.
|
||||
|
||||
# ProxyDetect [OPTIONAL]
|
||||
#
|
||||
# Enables insecure proxy detection. Services will automatically
|
||||
# scan each incoming user and akill those that use insecure proxy.
|
||||
#
|
||||
# Anope currently supports detection of Wingate (port 23), SOCKS4/5
|
||||
# (port 1080), and HTTP proxy (ports 3128 and 8080). It uses the
|
||||
# protocol of each proxy type to connect to an IRC server, it does
|
||||
# not only check if the port is open (so your users may still have
|
||||
# an open telnet server on their port 23 for example).
|
||||
#
|
||||
# WARNING: You should get the authorization of the administrator of
|
||||
# the computer which runs the proxy detector before enabling it; not
|
||||
# all administrators will accept it. Also note that in certain
|
||||
# countries, port scanning is prohibited.
|
||||
#
|
||||
# This feature requires threading support to be compiled into Anope.
|
||||
|
||||
#ProxyDetect
|
||||
|
||||
# ProxyThreads <number> [REQUIRED]
|
||||
#
|
||||
# Sets the number of threads Services will launch when starting. Each
|
||||
# thread will have the responsibility to scan queued hostname for
|
||||
# proxies.
|
||||
#
|
||||
# This value must be set depending of the number of users you have
|
||||
# on your network. The more threads are used, the more simultaneous
|
||||
# checks can be done. Remember however, that threads are
|
||||
# resource-consuming.
|
||||
#
|
||||
# WARNING: On Linux, each thread takes a background process, and there
|
||||
# is an additional process used for thread management; this is a problem
|
||||
# if you are limited in the number of background process you can use
|
||||
# (on a paid shell for example).
|
||||
|
||||
ProxyThreads 5
|
||||
|
||||
# ProxyMessage... <message> [RECOMMENDED]
|
||||
#
|
||||
# Sets the notices that will be sent out to users before Services
|
||||
# scan them for proxy. You may not use all of them, but just as much as
|
||||
# necessary.
|
||||
|
||||
ProxyMessage1 "I will now detect if you're using an insecure proxy."
|
||||
ProxyMessage2 "If you see a connection on port 23, 1080, 3128 or 8080 from"
|
||||
ProxyMessage3 "my.box.net, please disregard it, as it is the detector in action."
|
||||
ProxyMessage4 "See http://proxy.myirc.net/ for information about our proxy policy."
|
||||
#ProxyMessage5 "Enter"
|
||||
#ProxyMessage6 "whatever"
|
||||
#ProxyMessage7 "you want"
|
||||
#ProxyMessage8 "here."
|
||||
|
||||
# ProxyCheck... [OPTIONAL]
|
||||
#
|
||||
# Determines what types of proxy Anope will try to find (respectively
|
||||
# Wingate on port 23, SOCKS4 on port 1080, SOCKS5 on port 1080, HTTP
|
||||
# proxy on port 3128, HTTP proxy on port 8080 and HTTP proxy on port
|
||||
# 80).
|
||||
|
||||
ProxyCheckWingate
|
||||
ProxyCheckSocks4
|
||||
ProxyCheckSocks5
|
||||
ProxyCheckHTTP1
|
||||
ProxyCheckHTTP2
|
||||
ProxyCheckHTTP3
|
||||
|
||||
# ProxyTimeout <time> [REQUIRED]
|
||||
|
||||
# Sets the maximum length of time we allow a connect/read operation to
|
||||
# take. If you set this value too high, your threads may hang on a single
|
||||
# check for a very long time. The best is to try different values
|
||||
# and see which one is the more efficient for your network.
|
||||
|
||||
ProxyTimeout 15s
|
||||
|
||||
# ProxyTestServer <ip> <port> [REQUIRED]
|
||||
#
|
||||
# Sets the *IP* and port of the IRC server to use as a target when
|
||||
# testing users for proxy.
|
||||
|
||||
ProxyTestServer "1.2.3.4" 6667
|
||||
|
||||
# ProxyExpire <time> [RECOMMENDED]
|
||||
#
|
||||
# Sets the length of time before a proxy host cache entry expires, if
|
||||
# not used. If this is not set the default time is 2 days.
|
||||
|
||||
ProxyExpire 30d
|
||||
|
||||
# ProxyCacheExpire <time> [REQUIRED]
|
||||
#
|
||||
# Sets the length of time before a normal host cache entry expires, if
|
||||
# not used. This cannot be set to 0d.
|
||||
#
|
||||
# Every non-proxy hosts will be stored in cache (to avoid too many scans
|
||||
# to the same host), so you should set this enough low to not fill your
|
||||
# memory, especially on large networks.
|
||||
|
||||
ProxyCacheExpire 1d
|
||||
|
||||
# ProxyAkillReason <reason> [REQUIRED]
|
||||
#
|
||||
# Sets the reason that will be used to AKILL an user from the network
|
||||
# if a proxy is detected.
|
||||
|
||||
ProxyAkillReason "You're using an insecure proxy. See http://proxy.myirc.net/config.html for information about how to config your proxy in a safe manner."
|
||||
|
||||
# WallProxy [OPTIONAL]
|
||||
#
|
||||
# Sends a WALLOPS/GLOBOPS when an user using an insecure proxy is being
|
||||
# AKILLed.
|
||||
|
||||
WallProxy
|
||||
|
||||
# ProxyMax <number> [REQUIRED]
|
||||
#
|
||||
# Sets the maximum proxy cache entries that can be displayed in a single
|
||||
# call to OperServ CACHE.
|
||||
|
||||
ProxyMax 50
|
||||
|
||||
|
||||
Anope Version 1.7.8
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UseTS6 [OPTIONAL]
|
||||
#
|
||||
# Modern hybrid ircd like Ratbox 2.0.x support a protocol called TS6.
|
||||
# However this protocol is optional thus our default support is for without
|
||||
# TS6, if you want to take advantage of TS6, enable this option.
|
||||
|
||||
#UseTS6
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.7
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NSAddAccessOnReg [OPTIONAL]
|
||||
#
|
||||
# When enabled, services will add the usermask of registering users to the
|
||||
# access list of their newly created account. If you disable this, users
|
||||
# will always have to identify to nickserv before being recognized, unless
|
||||
# they manually add an address to the access list of their account.
|
||||
|
||||
NSAddAccessOnReg
|
||||
|
||||
# UlineServers [OPTIONAL]
|
||||
#
|
||||
# A list of ulined servers on your network, these servers are assumed they
|
||||
# can set channel modes and we will not attempt to take them from them
|
||||
# WARNING: do not put your user servers in this option
|
||||
|
||||
UlineServers "stats.your.network, proxy.your.network"
|
||||
|
||||
# KillOnSGline [OPTIONAL]
|
||||
#
|
||||
# When enabled, this option makes the services send an (SVS)KILL command
|
||||
# immediately after SGLINE ADD. This eliminates the need of killing the
|
||||
# users after the SGLINE has been added.
|
||||
|
||||
# KillOnSGline
|
||||
|
||||
# KillOnSQline [OPTIONAL]
|
||||
#
|
||||
# When enabled, this option makes the services send an (SVS)KILL command
|
||||
# immediately after SQLINE ADD. This eliminates the need of killing the
|
||||
# users after the SQLINE has been added.
|
||||
|
||||
# KillOnSQline
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NetworkDomain <name> [OPTIONAL]
|
||||
#
|
||||
# If your network has a common domain name, specify it there (for
|
||||
# example, all IRCZONE servers have a name ending in ".irczone.cl",
|
||||
# so "irczone.cl" would be set there.
|
||||
#
|
||||
# You can specify more than one Network Domain by separating each one by
|
||||
# a space: NetworkDomain "localnet.net localnet.com"
|
||||
#
|
||||
# Note that this directive is no longer used by the GLOBAL command, since
|
||||
# it uses a dynamic list of connected servers regardless of their
|
||||
# domains. However, some modules may still use this value, so you might
|
||||
# want to keep it just in case.
|
||||
|
||||
NetworkDomain "localnet.com"
|
||||
|
||||
# ListOpersOnly [DEPRECATED]
|
||||
# When enabled, limits use of the ChanServ and NickServ LIST commands
|
||||
# to IRC operators.
|
||||
#
|
||||
# This directive has been superseded by the NSListOpersOnly and
|
||||
# CSListOpersOnly directives.
|
||||
|
||||
#ListOpersOnly
|
||||
|
||||
Anope Version 1.7.6
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UserKey1|2|3 <value> [REQUIRED]
|
||||
#
|
||||
# These keys are required to initiate the random number generator. These
|
||||
# numbers MUST be random as you want your passcodes to be random. Don't
|
||||
# give these keys to no anyone! Keep them private!
|
||||
|
||||
#UserKey1 9866235
|
||||
#UserKey2 5216332
|
||||
#UserKey3 9651291
|
||||
|
||||
|
||||
# RestrictOperNick [OPTIONAL]
|
||||
# Forbids the registration of nicks that contain nick with services
|
||||
# access. So if Tester is a Services Oper, for example, You can't
|
||||
# register NewTester or Tester123 unless you are an IRC operator.
|
||||
#RestrictOperNicks
|
||||
|
||||
# UseTokens [OPTIONAL]
|
||||
# Allows irc networks to use TOKEN commands instead of the
|
||||
# standard commands. This saves bandwidth but can break older
|
||||
# modules that are not set to trap for TOKEN - if you are using
|
||||
# older modules do NOT use this option
|
||||
#UseTokens
|
||||
|
||||
# UseSVS2MODE [OPTIONAL]
|
||||
# On Unreal IRCD use SVS2MODE instead of SVSMODE, doing this will
|
||||
# show services changing user modes.
|
||||
#UseSVS2MODE
|
||||
|
||||
# NewsCount [OPTIONAL]
|
||||
# The number of LOGON/OPER News item to display when a user logs
|
||||
# on. The default value is 3
|
||||
#NewsCount 3
|
||||
|
||||
# Numeric [OPTIONAL]
|
||||
# Many ircd identify themselves with a Numeric when using this option
|
||||
# consult your ircds documentation before using this
|
||||
#Numeric 0
|
||||
|
||||
# UnRestrictSAdmin [OPTIONAL]
|
||||
# On many ircd Anope removes the umode of +a from users whom are not
|
||||
# Service Admin in Anope. This mode is NOT used by Anope for any form
|
||||
# of access. Thus this option allows them to keep the mode without having
|
||||
# to be a Service Admin in Anope
|
||||
#UnRestrictSAdmin
|
||||
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.5
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UseSVSHOLD [OPTIONAL]
|
||||
# Allows Bahamut-networks to use SVSHOLD instead of the services
|
||||
# enforcer. This option has been introduced in Bahamut 1.4.35 and
|
||||
# places a temporary Q:Line instead of introducing a new nick,
|
||||
# which is better for both CPU and bandwidth. If you enable this
|
||||
# option on a pre-1.4.35 Bahamut, it is most likely to break.
|
||||
#UseSVSHOLD
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NetworkDomain <name> [OPTIONAL]
|
||||
#
|
||||
# If your network has a common domain name, specify it there (for
|
||||
# example, all IRCZONE servers have a name ending in ".irczone.cl",
|
||||
# so "irczone.cl" would be set there.
|
||||
#
|
||||
# You can specify more than one Network Domain by separating each one by
|
||||
# a space: NetworkDomain "localnet.net localnet.com"
|
||||
#
|
||||
# Note that this directive is no longer used by the GLOBAL command, since
|
||||
# it uses a dynamic list of connected servers regardless of their
|
||||
# domains. However, some modules may still use this value, so you might
|
||||
# want to keep it just in case.
|
||||
|
||||
NetworkDomain "localnet.com"
|
||||
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.4
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# NSNickTracking [OPTIONAL]
|
||||
#
|
||||
# When enabled, services will track your last nick identified when issuing
|
||||
# nick changes.
|
||||
|
||||
#NSNickTracking
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
Anope Version 1.7.3
|
||||
-------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# BSCaseSensitive [OPTIONAL]
|
||||
# This option will make botserv use cAsE sEnSiTiVe checking for badwords
|
||||
|
||||
# BSCaseSensitive
|
||||
|
||||
# MSMemoReceipt [OPTIONAL]
|
||||
# Allow the use of memo receipts for the following groups:
|
||||
# 1 - Opers Only
|
||||
# 2 - Everybody
|
||||
#
|
||||
#MSMemoReceipt 1
|
||||
|
||||
Anope Version 1.7.2
|
||||
--------------------
|
||||
No Changes.
|
||||
|
||||
Anope Version 1.7.1
|
||||
--------------------
|
||||
** ADDED CONFIGURATION DIRECTIVES **
|
||||
|
||||
# UseRDB [OPTIONAL]
|
||||
#
|
||||
# Enable this if you want anope to load its data from a remote database.
|
||||
# (e.g. MySQL)
|
||||
#
|
||||
#UseRDB
|
||||
|
||||
# NickRegDelay <seconds> [OPTIONAL]
|
||||
# Prevents users from regging their nick if they are not
|
||||
# connected for at least X seconds.
|
||||
#NickRegDelay 30
|
||||
|
||||
** MODIFIED CONFIGURATION DIRECTIVES **
|
||||
** DELETED CONFIGURATION DIRECTIVES **
|
||||
|
||||
+1
-551
@@ -1,4 +1,4 @@
|
||||
Anope Version 1.8.0
|
||||
Anope Version 1.9.0
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
@@ -6,553 +6,3 @@ Anope Version 1.8.0
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.24
|
||||
--------------------
|
||||
*** New Strings:
|
||||
OPER_STATS_HOSTSERV_MEM
|
||||
|
||||
*** Mod Strings:
|
||||
NICK_HELP_SASET_AUTOOP
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.23b
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.23
|
||||
--------------------
|
||||
*** New Strings:
|
||||
PASSWORD_TOO_LONG
|
||||
CHAN_LOGOUT_FOUNDER_FAILED
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_OPER
|
||||
NICK_HELP_SASET_PASSWORD
|
||||
OPER_IGNORE_SYNTAX
|
||||
OPER_HELP_IGNORE
|
||||
CHAN_LOGOUT_ALL_SUCCEEDED
|
||||
OPER_HELP_MODLIST
|
||||
|
||||
*** Del Strings:
|
||||
PASSWORD_TRUNCATED
|
||||
|
||||
Anope Version 1.7.22
|
||||
--------------------
|
||||
*** New Strings:
|
||||
NICK_SASET_LANGUAGE_SYNTAX
|
||||
NICK_SASET_LANGUAGE_UNKNOWN
|
||||
NICK_SASET_LANGUAGE_CHANGED
|
||||
NICK_HELP_SASET_LANGUAGE
|
||||
NICK_HELP_RESEND
|
||||
|
||||
*** Mod Strings:
|
||||
NICK_HELP_SASET
|
||||
NICK_RECOVERED
|
||||
NICK_LIST_SERVADMIN_SYNTAX
|
||||
NICK_SERVADMIN_HELP_LIST
|
||||
CHAN_GETKEY_KEY
|
||||
NICK_SERVADMIN_HELP_LIST
|
||||
CHAN_SERVADMIN_HELP_LIST
|
||||
OPER_HELP_GLOBAL
|
||||
OPER_HELP_UMODE
|
||||
OPER_HELP_OLINE
|
||||
OPER_HELP_KICK
|
||||
OPER_HELP_SVSNICK
|
||||
OPER_HELP_SET_LOGCHAN
|
||||
OPER_HELP_SET_SUPERADMIN
|
||||
CHAN_HELP_AKICK
|
||||
NICK_HELP_RECOVER
|
||||
NICK_HELP_RELEASE
|
||||
NEWS_HELP_LOGON
|
||||
NEWS_HELP_OPER
|
||||
OPER_HELP_IGNORE
|
||||
OPER_IGNORE_TIME_DONE
|
||||
OPER_IGNORE_PERM_DONE
|
||||
OPER_IGNORE_DEL_DONE
|
||||
|
||||
*** Del Strings:
|
||||
NICK_SET_UNKNOWN_OPTION_OR_BAD_NICK
|
||||
OPER_HELP_KILLCLONES
|
||||
|
||||
Anope Version 1.7.21
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.20
|
||||
--------------------
|
||||
*** New Strings:
|
||||
NICK_HELP_CONFIRM
|
||||
CHAN_XOP_NOT_AVAILABLE
|
||||
HELP_LIMIT_SERV_OPER
|
||||
HELP_LIMIT_SERV_ADMIN
|
||||
HELP_LIMIT_SERV_ROOT
|
||||
HELP_LIMIT_IRC_OPER
|
||||
HELP_LIMIT_HOST_SETTER
|
||||
HELP_LIMIT_HOST_REMOVER
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_SET
|
||||
In all of the following strings only the trailing 'Limited to ...' line has been removed:
|
||||
OPER_HELP_EXCEPTION
|
||||
OPER_HELP_SESSION
|
||||
NICK_HELP_SASET
|
||||
NICK_HELP_SASET_DISPLAY
|
||||
NICK_HELP_SASET_PASSWORD
|
||||
NICK_HELP_SASET_URL
|
||||
NICK_HELP_SASET_EMAIL
|
||||
NICK_HELP_SASET_ICQ
|
||||
NICK_HELP_SASET_GREET
|
||||
NICK_HELP_SASET_KILL
|
||||
NICK_HELP_SASET_SECURE
|
||||
NICK_HELP_SASET_PRIVATE
|
||||
NICK_HELP_SASET_HIDE
|
||||
NICK_HELP_SASET_MSG
|
||||
NICK_HELP_SASET_NOEXPIRE
|
||||
NICK_HELP_SASET_AUTOOP
|
||||
NICK_SERVADMIN_HELP_GETPASS
|
||||
NICK_SERVADMIN_HELP_GETEMAIL
|
||||
NICK_SERVADMIN_HELP_FORBID
|
||||
NICK_SERVADMIN_HELP_SUSPEND
|
||||
NICK_SERVADMIN_HELP_UNSUSPEND
|
||||
CHAN_SERVADMIN_HELP_SET_NOEXPIRE
|
||||
CHAN_SERVADMIN_HELP_GETPASS
|
||||
CHAN_SERVADMiN_HELP_FORBID
|
||||
CHAN_SERVADMIN_HELP_SUSPEND
|
||||
CHAN_SERVADMIN_HELP_UNSUSPEND
|
||||
CHAN_SERVADMIN_HELP_STATUS
|
||||
OPER_HELP_MODE
|
||||
OPER_HELP_CLEARMODES
|
||||
OPER_HELP_KICK
|
||||
OPER_HELP_SVSNICK
|
||||
OPER_HELP_AKILL
|
||||
OPER_HELP_SGLINE
|
||||
OPER_HELP_SQLINE
|
||||
OPER_HELP_SZLINE
|
||||
OPER_HELP_SET
|
||||
OPER_HELP_NOOP
|
||||
OPER_HELP_JUPE
|
||||
OPER_HELP_RAW
|
||||
OPER_HELP_UPDATE
|
||||
OPER_HELP_RELOAD
|
||||
OPER_HELP_QUIT
|
||||
OPER_HELP_SHUTDOWN
|
||||
OPER_HELP_RESTART
|
||||
OPER_HELP_KILLCLONES
|
||||
OPER_HELP_CHANLIST
|
||||
OPER_HELP_USERLIST
|
||||
OPER_HELP_MODLOAD
|
||||
OPER_HELP_MODUNLOAD
|
||||
OPER_HELP_MODINFO
|
||||
OPER_HELP_MODLIST
|
||||
BOT_SERVADMIN_HELP_SET_NOBOT
|
||||
BOT_SERVADMIN_HELP_SET_PRIVATE
|
||||
HOST_HELP_SET
|
||||
HOST_HELP_DELALL
|
||||
HOST_HELP_SETALL
|
||||
HOST_HELP_DEL
|
||||
HOST_HELP_LIST
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.19
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
CHAN_HELP_LIST
|
||||
BOT_SET_SYNTAX
|
||||
BOT_HELP_SET
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.18
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.17
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.16
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.15
|
||||
--------------------
|
||||
*** New Strings:
|
||||
INVALID_TARGET
|
||||
NICK_SET_AUTOOP_SYNTAX
|
||||
NICK_SET_AUTOOP_ON
|
||||
NICK_SET_AUTOOP_OFF
|
||||
BOT_LONG_IDENT
|
||||
|
||||
*** Mod Strings:
|
||||
NICK_HELP_SET
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.14
|
||||
--------------------
|
||||
*** New Strings:
|
||||
CHAN_X_INVALID
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.13
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.12
|
||||
--------------------
|
||||
*** New Strings:
|
||||
OPER_STATS_UPLINK_SERVER
|
||||
OPER_STATS_UPLINK_CAPAB
|
||||
OPER_STATS_UPLINK_SERVER_COUNT
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_STATS
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.11
|
||||
---------------------
|
||||
*** New Strings:
|
||||
NICK_SASET_SYNTAX
|
||||
NICK_SASET_DISABLED
|
||||
NICK_SASET_UNKNOWN_OPTION
|
||||
NICK_SASET_BAD_NICK
|
||||
NICK_SASET_OPTION_DISABLED
|
||||
NICK_SASET_DISPLAY_INVALID
|
||||
NICK_SASET_DISPLAY_CHANGED
|
||||
NICK_SASET_PASSWORD_FAILED
|
||||
NICK_SASET_PASSWORD_CHANGED
|
||||
NICK_SASET_PASSWORD_CHANGED_TO
|
||||
NICK_SASET_LANGUAGE_SYNTAX
|
||||
NICK_SASET_LANGUAGE_UNKNOWN
|
||||
NICK_SASET_LANGUAGE_CHANGED
|
||||
NICK_SASET_URL_CHANGED
|
||||
NICK_SASET_URL_UNSET
|
||||
NICK_SASET_EMAIL_CHANGED
|
||||
NICK_SASET_EMAIL_UNSET
|
||||
NICK_SASET_EMAIL_UNSET_IMPOSSIBLE
|
||||
NICK_SASET_ICQ_CHANGED
|
||||
NICK_SASET_ICQ_UNSET
|
||||
NICK_SASET_ICQ_INVALID
|
||||
NICK_SASET_GREET_CHANGED
|
||||
NICK_SASET_GREET_UNSET
|
||||
NICK_SASET_KILL_SYNTAX
|
||||
NICK_SASET_KILL_IMMED_SYNTAX
|
||||
NICK_SASET_KILL_ON
|
||||
NICK_SASET_KILL_QUICK
|
||||
NICK_SASET_KILL_IMMED
|
||||
NICK_SASET_KILL_IMMED_DISABLED
|
||||
NICK_SASET_KILL_OFF
|
||||
NICK_SASET_SECURE_SYNTAX
|
||||
NICK_SASET_SECURE_ON
|
||||
NICK_SASET_SECURE_OFF
|
||||
NICK_SASET_PRIVATE_SYNTAX
|
||||
NICK_SASET_PRIVATE_ON
|
||||
NICK_SASET_PRIVATE_OFF
|
||||
NICK_SASET_HIDE_SYNTAX
|
||||
NICK_SASET_HIDE_EMAIL_ON
|
||||
NICK_SASET_HIDE_EMAIL_OFF
|
||||
NICK_SASET_HIDE_MASK_ON
|
||||
NICK_SASET_HIDE_MASK_OFF
|
||||
NICK_SASET_HIDE_QUIT_ON
|
||||
NICK_SASET_HIDE_QUIT_OFF
|
||||
NICK_SASET_HIDE_STATUS_ON
|
||||
NICK_SASET_HIDE_STATUS_OFF
|
||||
NICK_SASET_MSG_SYNTAX
|
||||
NICK_SASET_MSG_ON
|
||||
NICK_SASET_MSG_OFF
|
||||
NICK_SASET_NOEXPIRE_SYNTAX
|
||||
NICK_SASET_NOEXPIRE_ON
|
||||
NICK_SASET_NOEXPIRE_OFF
|
||||
NICK_HELP_SASET
|
||||
NICK_HELP_SASET_DISPLAY
|
||||
NICK_HELP_SASET_PASSWORD
|
||||
NICK_HELP_SASET_LANGUAGE
|
||||
NICK_HELP_SASET_URL
|
||||
NICK_HELP_SASET_EMAIL
|
||||
NICK_HELP_SASET_ICQ
|
||||
NICK_HELP_SASET_GREET
|
||||
NICK_HELP_SASET_KILL
|
||||
NICK_HELP_SASET_SECURE
|
||||
NICK_HELP_SASET_PRIVATE
|
||||
NICK_HELP_SASET_HIDE
|
||||
NICK_HELP_SASET_MSG
|
||||
NICK_HELP_SASET_NOEXPIRE
|
||||
NICK_HELP_CMD_SASET
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_MODLIST
|
||||
|
||||
*** Del Strings:
|
||||
NICK_SERVADMIN_HELP_SET
|
||||
NICK_SERVADMIN_HELP_SET_NOEXPIRE
|
||||
NICK_SET_NOEXPIRE_SYNTAX
|
||||
NICK_SET_NOEXPIRE_ON
|
||||
NICK_SET_NOEXPIRE_OFF
|
||||
NICK_SASET_LANGUAGE_SYNTAX
|
||||
NICK_SASET_LANGUAGE_UNKNOWN
|
||||
NICK_SASET_LANGUAGE_CHANGED
|
||||
NICK_HELP_SASET_LANGUAGE
|
||||
|
||||
|
||||
Anope Version 1.7.10
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.9
|
||||
-------------------
|
||||
*** New Strings:
|
||||
CHAN_HELP_IRCD_HALFOP
|
||||
CHAN_HELP_IRCD_PROTECT
|
||||
CHAN_GETKEY_SYNTAX
|
||||
CHAN_GETKEY_NOKEY
|
||||
CHAN_GETKEY_KEY
|
||||
OPER_SET_SQL_ERROR_DISABLED
|
||||
NICK_X_SUSPENDED
|
||||
NICK_INFO_SUSPENDED
|
||||
NICK_SUSPEND_SYNTAX
|
||||
NICK_SUSPEND_SUCCEEDED
|
||||
NICK_SUSPEND_FAILED
|
||||
NICK_UNSUSPEND_SYNTAX
|
||||
NICK_UNSUSPEND_SUCCEEDED
|
||||
NICK_UNSUSPEND_FAILED
|
||||
NICK_SERVADMIN_HELP_SUSPEND
|
||||
NICK_SERVADMIN_HELP_UNSUSPEND
|
||||
|
||||
*** Mod Strings:
|
||||
OPER_HELP_SET
|
||||
NICK_HELP
|
||||
CHAN_AOP_CLEAR
|
||||
CHAN_HOP_CLEAR
|
||||
CHAN_SOP_CLEAR
|
||||
CHAN_VOP_CLEAR
|
||||
CHAN_ACCESS_CLEAR
|
||||
CHAN_AKICK_CLEAR
|
||||
CHAN_SET_KEEPTOPIC_ON
|
||||
CHAN_SET_KEEPTOPIC_OFF
|
||||
CHAN_SET_TOPICLOCK_ON
|
||||
CHAN_SET_TOPICLOCK_OFF
|
||||
CHAN_SET_PEACE_ON
|
||||
CHAN_SET_PEACE_OFF
|
||||
CHAN_SET_PRIVATE_ON
|
||||
CHAN_SET_PRIVATE_OFF
|
||||
CHAN_SET_SECUREOPS_ON
|
||||
CHAN_SET_SECUREOPS_OFF
|
||||
CHAN_SET_SECUREFOUNDER_ON
|
||||
CHAN_SET_SECUREFOUNDER_OFF
|
||||
CHAN_SET_RESTRICTED_ON
|
||||
CHAN_SET_RESTRICTED_OFF
|
||||
CHAN_SET_SECURE_ON
|
||||
CHAN_SET_SECURE_OFF
|
||||
CHAN_SET_SIGNKICK_ON
|
||||
CHAN_SET_SIGNKICK_LEVEL
|
||||
CHAN_SET_SIGNKICK_OFF
|
||||
CHAN_SET_OPNOTICE_ON
|
||||
CHAN_SET_OPNOTICE_OFF
|
||||
CHAN_SET_XOP_ON
|
||||
CHAN_SET_XOP_OFF
|
||||
|
||||
*** Del Strings:
|
||||
CHAN_HELP_ULTIMATE
|
||||
OPER_STATS_PROXY_MEM
|
||||
OPER_CACHE_SYNTAX
|
||||
OPER_CACHE_DISABLED
|
||||
OPER_CACHE_NOT_FOUND
|
||||
OPER_CACHE_REMOVED
|
||||
OPER_CACHE_HEADER
|
||||
OPER_CACHE_LIST
|
||||
OPER_CACHE_FOOTER
|
||||
OPER_CACHE_QUEUED
|
||||
OPER_CACHE_PROGRESS
|
||||
OPER_CACHE_NORMAL
|
||||
OPER_CACHE_WINGATE
|
||||
OPER_CACHE_SOCKS4
|
||||
OPER_CACHE_SOCKS5
|
||||
OPER_CACHE_HTTP
|
||||
OPER_HELP_CACHE
|
||||
|
||||
Anope Version 1.7.8
|
||||
-------------------
|
||||
*** New Strings:
|
||||
OPER_HELP_SET_IGNORE
|
||||
OPER_HELP_ADMIN_CMD_EXTRA
|
||||
OPER_HELP_ADMIN_CMD_OLINE
|
||||
OPER_HELP_ADMIN_CMD_UMODE
|
||||
OPER_HELP_ADMIN_CMD_SVSNICK
|
||||
OPER_HELP_OPER_CMD_EXTRA
|
||||
OPER_HELP_OPER_CMD_SGLINE
|
||||
OPER_HELP_OPER_CMD_SQLINE
|
||||
OPER_HELP_OPER_CMD_SZLINE
|
||||
|
||||
*** Mod Strings:
|
||||
HOST_OFF_UNREAL
|
||||
OPER_HELP_OPER_CMD
|
||||
OPER_HELP_ADMIN_CMD
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.7
|
||||
-------------------
|
||||
*** New Strings:
|
||||
MEMO_NO_RSEND_SELF
|
||||
NICK_REGISTERED_NO_MASK
|
||||
OPER_ADMIN_MOVED
|
||||
OPER_OPER_MOVED
|
||||
OPER_HELP_SET_SQL
|
||||
OPER_SET_SQL_ON
|
||||
OPER_SET_SQL_OFF
|
||||
OPER_SET_SQL_ERROR
|
||||
OPER_SET_SQL_ERROR_INIT
|
||||
OPER_EXCEPTION_EXISTS
|
||||
OPER_EXCEPTION_CHANGED
|
||||
OPER_SET_LIST_OPTION_ON
|
||||
OPER_SET_LIST_OPTION_OFF
|
||||
OPER_HELP_SET_LIST
|
||||
OPER_SUPER_ADMIN_NOT_ENABLED
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
BOT_SERVADMIN_HELP_BOT
|
||||
NICK_HELP_STATUS
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.6
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
CHAN_REGISTER_NONE_CHANNEL
|
||||
CHAN_SYMBOL_REQUIRED
|
||||
OPER_SVSNICK_UNSUPPORTED
|
||||
OPER_SQLINE_UNSUPPORTED
|
||||
OPER_SVSO_UNSUPPORTED
|
||||
OPER_UMODE_UNSUPPORTED
|
||||
CHAN_CLEARED_INVITES
|
||||
NICK_INFO_VHOST2
|
||||
NICK_STATUS_0
|
||||
NICK_STATUS_1
|
||||
NICK_STATUS_2
|
||||
NICK_STATUS_3
|
||||
CHAN_STATUS_SYNTAX
|
||||
CHAN_STATUS_NOT_REGGED
|
||||
CHAN_STATUS_FORBIDDEN
|
||||
CHAN_STATUS_NOTONLINE
|
||||
CHAN_STATUS_INFO
|
||||
NICK_INFO_EXPIRE
|
||||
NICK_GLIST_REPLY
|
||||
NICK_GLIST_REPLY_ADMIN
|
||||
CHAN_INFO_EXPIRE
|
||||
NICK_ACCESS_LIST_EMPTY
|
||||
NICK_ACCESS_LIST_X_EMPTY
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.5
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
MEMO_HELP
|
||||
CHAN_LEVEL_NOJOIN
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.4
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
CHAN_CLEARED_HOPS
|
||||
OPER_MODULE_LIST_HEADER
|
||||
OPER_MODULE_LIST_FOOTER
|
||||
NICK_X_IS_SERVICES
|
||||
|
||||
*** Mod Strings:
|
||||
|
||||
CHAN_HELP_CLEAR
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
Anope Version 1.7.3
|
||||
-------------------
|
||||
*** New Strings:
|
||||
|
||||
MEMO_RSEND_PLEASE_WAIT
|
||||
MEMO_RSEND_DISABLED
|
||||
MEMO_RSEND_SYNTAX
|
||||
MEMO_RSEND_NICK_MEMO_TEXT
|
||||
MEMO_RSEND_CHAN_MEMO_TEXT
|
||||
MEMO_RSEND_USER_NOTIFICATION
|
||||
MEMO_HELP_RSEND
|
||||
MEMO_CHECK_SYNTAX
|
||||
MEMO_CHECK_NOT_READ
|
||||
MEMO_CHECK_READ
|
||||
MEMO_CHECK_NO_MEMO
|
||||
MEMO_HELP_CHECK
|
||||
|
||||
*** Mod Strings:
|
||||
MEMO_HELP
|
||||
NICK_LIST_SERVADMIN_SYNTAX
|
||||
NICK_SERVADMIN_HELP_LIST
|
||||
|
||||
Anope Version 1.7.2
|
||||
--------------------
|
||||
No Changes.
|
||||
|
||||
Anope Version 1.7.1
|
||||
--------------------
|
||||
*** New Strings:
|
||||
|
||||
MEMO_SET_NOTIFY_MAIL
|
||||
MEMO_SET_NOTIFY_NOMAIL
|
||||
MEMO_SET_NOTIFY_INVALIDMAIL
|
||||
MEMO_MAIL_SUBJECT
|
||||
MEMO_MAIL_TEXT1
|
||||
MEMO_MAIL_TEXT2
|
||||
MEMO_MAIL_TEXT3
|
||||
NICK_INFO_SERVICES_ROOT
|
||||
NICK_SET_HIDE_STATUS_ON
|
||||
NICK_SET_HIDE_STATUS_OFF
|
||||
NICK_REG_DELAY
|
||||
|
||||
*** Mod Strings:
|
||||
MEMO_SET_NOTIFY_SYNTAX
|
||||
NICK_HELP_SET_HIDE
|
||||
|
||||
*** Del Strings:
|
||||
|
||||
+2
-127
@@ -1,129 +1,4 @@
|
||||
Anope Version 1.8.0
|
||||
Anope Version 1.9.0
|
||||
-------------------
|
||||
- NONE
|
||||
- MySQL Support Withdrawn until rewritten.
|
||||
|
||||
Anope Version 1.7.24
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.23b
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.23
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.22
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.21
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.20
|
||||
--------------------
|
||||
ALTER TABLE `anope_ns_request` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_ns_core` DROP INDEX `display_index` ;
|
||||
ALTER TABLE `anope_ns_access` ADD UNIQUE (`display`) ;
|
||||
ALTER TABLE `anope_ms_info` ADD UNIQUE (`nm_id` , `serv`) ;
|
||||
ALTER TABLE `anope_ns_alias` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_cs_info` DROP INDEX `name_index` ;
|
||||
ALTER TABLE `anope_cs_access` ADD UNIQUE (`channel` , `display`) ;
|
||||
ALTER TABLE `anope_cs_levels` ADD UNIQUE (`channel` , `position`) ;
|
||||
ALTER TABLE `anope_cs_akicks` CHANGE `dmask` `dmask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_cs_akicks` ADD UNIQUE (`channel` , `dmask`) ;
|
||||
ALTER TABLE `anope_cs_badwords` CHANGE `word` `word` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_cs_badwords` ADD UNIQUE (`channel` , `word`) ;
|
||||
ALTER TABLE `anope_cs_ttb` ADD UNIQUE (`channel` , `ttb_id`) ;
|
||||
ALTER TABLE `anope_os_akills` CHANGE `user` `user` VARCHAR( 255 ) NOT NULL , CHANGE `host` `host` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_akills` ADD UNIQUE (`user` , `host`) ;
|
||||
ALTER TABLE `anope_os_sglines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_sglines` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_os_sqlines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_sqlines` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_os_szlines` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_szlines` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_os_news` ADD UNIQUE (`type` , `num` , `time`) ;
|
||||
ALTER TABLE `anope_os_exceptions` CHANGE `mask` `mask` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_os_exceptions` ADD UNIQUE (`mask`) ;
|
||||
ALTER TABLE `anope_hs_core` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_bs_core` DROP INDEX `nick_index` ;
|
||||
ALTER TABLE `anope_ms_info` CHANGE `receiver` `receiver` VARCHAR( 255 ) NOT NULL ;
|
||||
ALTER TABLE `anope_ms_info` ADD INDEX ( `receiver` , `serv` ) ;
|
||||
|
||||
Anope Version 1.7.19
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.18
|
||||
--------------------
|
||||
- DROP TABLE IF EXISTS `anope_os_status`
|
||||
- ALTER TABLE `anope_bs_core` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_access` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_akicks` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_badwords` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_levels` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_cs_ttb` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_hs_core` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_ms_info` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_ns_access` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_ns_request` CHANGE `active` `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_akills` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_exceptions` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_news` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_sglines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_sqlines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
- ALTER TABLE `anope_os_szlines` ADD `active` TINYINT( 1 ) DEFAULT '1' NOT NULL
|
||||
|
||||
Anope Version 1.7.17
|
||||
--------------------
|
||||
- CREATE TABLE anope_cs_ttb (
|
||||
ct_id int(11) NOT NULL auto_increment,
|
||||
channel varchar(255) NOT NULL default '',
|
||||
ttb_id int(11) NOT NULL default '0',
|
||||
value int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (ct_id)
|
||||
) TYPE=MyISAM
|
||||
- ALTER TABLE anope_cs_info DROP ttb
|
||||
|
||||
Anope Version 1.7.16
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.15
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.14
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.13
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.12
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.11
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.10
|
||||
--------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.9
|
||||
-------------------
|
||||
- DROP TABLE IF EXISTS anope_os_cache
|
||||
|
||||
Anope Version 1.7.8
|
||||
-------------------
|
||||
- NONE
|
||||
|
||||
Anope Version 1.7.7
|
||||
-------------------
|
||||
- ALTER TABLE anope_ns_alias CHANGE status status int(11) unsigned NOT NULL default '0'
|
||||
|
||||
@@ -42,6 +42,7 @@ Run_Build_System () {
|
||||
WITH_PERM=""
|
||||
BUILD_TYPE=""
|
||||
RUN_CC_PL=""
|
||||
EXTRA_ARGS=""
|
||||
GEN_TYPE=""
|
||||
|
||||
if [ "$INSTDIR" != "" ] ; then
|
||||
@@ -113,9 +114,9 @@ Run_Build_System () {
|
||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
||||
fi
|
||||
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $REAL_SOURCE_DIR"
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_ARGS $REAL_SOURCE_DIR"
|
||||
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $REAL_SOURCE_DIR
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $EXTRA_ARGS $REAL_SOURCE_DIR
|
||||
|
||||
echo ""
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
@@ -125,9 +126,9 @@ Run_Build_System () {
|
||||
echo "Now run make to build Anope."
|
||||
fi
|
||||
else
|
||||
echo "./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL"
|
||||
echo "./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_ARGS $RUN_CC_PL"
|
||||
|
||||
./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL
|
||||
./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_ARGS $RUN_CC_PL
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -154,9 +155,15 @@ RUNGROUP=
|
||||
UMASK=
|
||||
DEBUG="yes"
|
||||
USE_RUN_CC_PL="no"
|
||||
EXTRA_CONFIG_ARGS=
|
||||
CAN_QUICK="no"
|
||||
SOURCE_DIR=`dirname $0`
|
||||
|
||||
which cmake > /dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
BUILD_SYSTEM="configure"
|
||||
fi
|
||||
|
||||
###########################################################################
|
||||
# Check out the options
|
||||
###########################################################################
|
||||
@@ -248,6 +255,11 @@ done
|
||||
BUILD_SYSTEM=$INPUT
|
||||
echo ""
|
||||
|
||||
if [ "$SOURCE_DIR" != "." -a "$BUILD_SYSTEM" = "configure" ] ; then
|
||||
echo "You can not use configure unless you are in the same folder as Config!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ok=0
|
||||
echo "In what directory do you want the binaries to be installed?"
|
||||
while [ $ok -eq 0 ] ; do
|
||||
@@ -278,7 +290,6 @@ done
|
||||
INSTDIR=$INPUT
|
||||
echo ""
|
||||
|
||||
|
||||
####
|
||||
|
||||
OLD_RUNGROUP="$RUNGROUP"
|
||||
@@ -358,7 +369,7 @@ if [ "$USE_RUN_CC_PL" = "yes" ] ; then
|
||||
TEMP_YN="y"
|
||||
fi
|
||||
echo "You can optionally have the build run through run-cc.pl, which will"
|
||||
echo "cause warnings and errors (if any) to be colored yellow and run,"
|
||||
echo "cause warnings and errors (if any) to be colored yellow and red,"
|
||||
echo "respectively. This relies on Perl being installed, so if you say yes"
|
||||
echo "to this without Perl, the option will be ignored."
|
||||
echo "NOTE: If you are using MinGW, it is NOT recommended to say yes to"
|
||||
@@ -377,6 +388,16 @@ echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra arguments you wish to pass to $BUILD_SYSTEM?"
|
||||
echo "(You may only need to do this if $BUILD_SYSTEM is unable to locate"
|
||||
echo "missing dependencies without hints)"
|
||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
EXTRA_CONFIG_ARGS=$INPUT
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
################################################################################
|
||||
# Store values
|
||||
################################################################################
|
||||
@@ -390,6 +411,7 @@ RUNGROUP="$RUNGROUP"
|
||||
UMASK=$UMASK
|
||||
DEBUG="$DEBUG"
|
||||
USE_RUN_CC_PL="$USE_RUN_CC_PL"
|
||||
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
|
||||
EOT
|
||||
echo "done."
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# This file is external to the read_from_file macro in Anope.cmake in order to
|
||||
# get around a possible memory leak in older versions of CMake.
|
||||
|
||||
file(READ "${FILE}" RESULT)
|
||||
message("${RESULT}")
|
||||
|
||||
@@ -3,75 +3,55 @@ Legend:
|
||||
? = unsure
|
||||
+ = in progress
|
||||
|
||||
1.9.0
|
||||
-----
|
||||
[x] additional field where users' masked host can be stored so both masked IP and vhost are available instead of just one.
|
||||
[x] no struct Uid bollocks. that's insane, and now, unnecessary that we store UID in BotInfo.
|
||||
[x] prevent deletion of core services via /bs bot
|
||||
[x] Module subsystem cleanup ('modules' branch)
|
||||
[x] Move modules to use classes somewhat (AnopeInit, AnopeFini)
|
||||
[x] Change MODULE_INIT to return a pointer
|
||||
[x] Remove duplicate module creation.. have loadModule return a pointer rather than creating one
|
||||
[x] Remove buffered loading/unloading, this makes os_modunload perm, but who cares
|
||||
[x] Mark os_modunload permanent.
|
||||
[x] Remove 'delayed' loading, this is necessary because of before/after connected to ircd (ircd is before, rest after), I'm sure this can be done better.
|
||||
[x] Remove mod_current_* crap (involves passing Module * around a lot)
|
||||
[x] events.c
|
||||
[x] modules.c
|
||||
[x] commands.c
|
||||
[x] Redo moduleAdd|Get|Remove data to use class Extensible, etc.
|
||||
[x] remove old config, replace with insp-inspired (albeit bind format) config (CBX)
|
||||
[x] Clean up protocol
|
||||
[x] Fix anope_cmd_* stuff to just use IRCdProto methods directly
|
||||
[x] SendClientIntroduction should take a UID param, rather than generating one(?)
|
||||
[x] Fix permanent channels (+P) stuff.
|
||||
[x] Remove UnRestrictSAdmin, UseTS6, UseSVSHOLD
|
||||
[x] InspIRCd 1.2 support
|
||||
[x] Remove old (prior to 1.8.0) db compat
|
||||
[x] Establish a proper base for services pseudoclients
|
||||
[x] add ss_main StatServ Hal9000 to play with :)
|
||||
[x] burn automake with fire (CBX)
|
||||
|
||||
1.9.1
|
||||
-----
|
||||
[ ] Remove modules_unload_all fini + hack that goes with it
|
||||
[ ] signal handling cleanup
|
||||
[ ] Move a (lot) of stuff to class members as a defined interface rather than copypasta everywhere (ns_set, ns_saset!)
|
||||
[x] Remove modules_unload_all fini + hack that goes with it
|
||||
[x] signal handling cleanup
|
||||
[x] Seamless fantasy support for all ChanServ commands, instead of requiring bs_fantasy_*
|
||||
Remaining issues:
|
||||
[x] Allow fantasy to be disabled from some commands (e.g. FORBID?) seems unnecessary, really.
|
||||
[x] (think on this carefully): some commands (e.g. !help) need to strip the pre-provided channelname from them.
|
||||
[x] HelpServ must die
|
||||
[x] Command parser cleanup: mod_current_buffer needs to go away and be replaced by a proper parser. Commands should then indicate how they want the buffer split.
|
||||
[x] Make NS ENFORCE/RELEASE stuff more sane, redo timers
|
||||
[x] Support operoverride and such things (stop reversing mode changes from nonopped people where unnecessary) - done by Liber
|
||||
[x] Settable oper flags (split into types containing privs+commands, allow each oper to be set to a type, like we do with insp?)
|
||||
|
||||
Outstanding issues:
|
||||
- Add some events that were not present before but useful for future versions
|
||||
|
||||
1.9.2
|
||||
-----
|
||||
[ ] Redo database insanity.
|
||||
[ ] Move database load/save to a module
|
||||
[ ] realtime SQL/whatever module using events
|
||||
[ ] realtime SQL/whatever module using events (possibly ongoing)
|
||||
[ ] flatfile save on a periodic timer
|
||||
[ ] SANE password encryption - prefix password with the method it was encrypted with, allowing for *seamless* upgrading to different methods
|
||||
[ ] Salted SHA256 (contact Special for this)
|
||||
[ ] New database format (text, not binary - works very well for merging and so on)
|
||||
[ ] burn do_sjoin with fire
|
||||
[ ] Seamless fantasy support for all ChanServ commands, instead of requiring bs_fantasy_*
|
||||
[ ] HelpServ must die (1.9.1?)
|
||||
[ ] Command parser cleanup
|
||||
[ ] mod_current_buffer needs to go away and be replaced by a proper parser. Commands should then indicate how they want the buffer split.
|
||||
[ ] Fix permanent channels support properly. This will require removing do_sjoin().
|
||||
[ ] Make NS ENFORCE/RELEASE stuff more sane, redo timers
|
||||
[ ] Add support for +k, +q, etc type umodes
|
||||
|
||||
1.9.2
|
||||
-----
|
||||
[ ] IRCd capability support: don't rely on CAPAB, provide an interface to turn capabilities on specifically
|
||||
[ ] Socket subsystem needs some serious loving
|
||||
[ ] Multiple sockets
|
||||
[ ] Asynchronous, using select() (multiple engines? not really needed..)
|
||||
[ ] Callbacks, event style, see also inspircd
|
||||
[ ] Asynchronous DNS?
|
||||
|
||||
Future
|
||||
------
|
||||
[ ] Move a (lot) of stuff to class members as a defined interface rather than copypasta everywhere (ns_set, ns_saset!)
|
||||
[ ] CS SET INHABIT to keep pseudoclient in a channel after it empties to maintain banlists and such
|
||||
[?] Remote identification (1.9.1? will this break stuff?)
|
||||
[ ] Requires a rejig of how Alias vs Core works
|
||||
[ ] Language charset stuff, including collation (1.9.1? phoenix?)
|
||||
|
||||
Future
|
||||
------
|
||||
[ ] Add support for +k, +q, etc type umodes
|
||||
[ ] Fix permanent channels support properly. This will require removing do_sjoin().
|
||||
[ ] burn do_sjoin with fire
|
||||
[ ] fantasy: allow replies/notifications to fantasy commands to go to the channel via notice
|
||||
[ ] way for one module to depend on another... not like 2 MOD_HEADs and it being unpredictable which is loaded first..
|
||||
the MOD_HEAD MOD_TAIL allows for too few combinations (interface code of insp, hooks code of insp?)
|
||||
the MOD_HEAD MOD_TAIL allows for too few combinations (interface code of insp, hooks code of insp?)
|
||||
[ ] generic database routines modules can use to create their own database
|
||||
[ ] generic way to check which modes a user has set (u->HasUmode(UMODE_OPER))
|
||||
? [ ] a way for a module to queue itself (or even another module) for unloading
|
||||
[?] a way for a module to queue itself (or even another module) for unloading
|
||||
[ ] add overridden form of SendGlobops accepting BotInfo
|
||||
[ ] SendAkill should just take a pointer to the Akill class instead of millions of fields (same for some other stuff)
|
||||
[ ] chan_set_modes should take BotInfo, possibly with override for User *?
|
||||
@@ -79,7 +59,7 @@ Future
|
||||
[ ] Modules should also have a way to add strings programatically
|
||||
[ ] Should be able to add many strings by dropping a file in a set location.
|
||||
[ ] I forsee this working via a function rather than defines, as it seems to do now: e.g. _("NS_NICK_IS_REGISTERED").
|
||||
[?] Mail memos? think on consequences of this
|
||||
[?] Update help to reflect the fact /msg memoserv set notify mail - works just fine ;)
|
||||
[ ] Useful/common "third party" modules to core distro
|
||||
[ ] NS AJOIN
|
||||
[ ] Last used time on AKICK/access entries
|
||||
@@ -94,12 +74,12 @@ Future
|
||||
[ ] NS SUSPEND: show suspender and reason, probably to sopers only (see CS SUSPEND)
|
||||
XXX: is SUSPEND overlapping with OS IGNORE functionality?
|
||||
[ ] Merge NS INFO blah ALL with NS INFO blah, if you're requesting info, you really want the info anyway.
|
||||
? [ ] Channel passwords seem to be of limited use, think of a more appropriate way to handle this
|
||||
? [ ] Don't allow soper accounts to expire
|
||||
? [ ] Reason for CS SET RESTRICTED
|
||||
[?] Channel passwords seem to be of limited use, think of a more appropriate way to handle this
|
||||
[?] Don't allow soper accounts to expire
|
||||
[?] Reason for CS SET RESTRICTED
|
||||
[ ] NS IDENTIFY changes
|
||||
? [ ] Last failed identify? Maybe more useful for sopers only, so users don't get unnecessarily worried
|
||||
? [ ] Last successful login time/ip? perhaps both of these should be a new nick setting
|
||||
[?] Last failed identify? Maybe more useful for sopers only, so users don't get unnecessarily worried
|
||||
[?] Last successful login time/ip? perhaps both of these should be a new nick setting
|
||||
[ ] AKILL/SGLINE/etc..
|
||||
[ ] Setter
|
||||
[ ] Time added
|
||||
@@ -108,12 +88,11 @@ Future
|
||||
[ ] Reason
|
||||
[ ] Unique IDs on each AKILL/blah so that networks may use them as ticket IDs
|
||||
[ ] HS ACTIVATE -ALL (rob sez this all needs reviewing)
|
||||
[ ] Settable oper flags (split into types containing privs+commands, allow each oper to be set to a type, like we do with insp?)
|
||||
[ ] NS MARK, CS MARK. Allow multiple marks. Combine into OS MARK?
|
||||
[ ] General options block, ability to turn LOGCHAN on from the config file..
|
||||
[ ] Method to list suspended/forbidden nicks/channels?
|
||||
? [ ] MS IGNORE. Make it take nick (accounts) or n!u@h masks. Fake success of memo send still, but send to opers?
|
||||
? [ ] More "friendly" date displays of some things like registration time ("November 7th 2006 (2 years, 0 months, 0 days ago)")
|
||||
? [ ] Review settings like NSModeOnID for whether they actually have a point existing (Rob says it does not - and that it should probably be a nickname setting)
|
||||
? [ ] OS INJECT
|
||||
? [ ] Drop CS SET ENTRYMSG, replace with a 'news' type system? (limited to a configured number of items, default 3)
|
||||
[?] MS IGNORE. Make it take nick (accounts) or n!u@h masks. Fake success of memo send still, but send to opers?
|
||||
[?] More "friendly" date displays of some things like registration time ("November 7th 2006 (2 years, 0 months, 0 days ago)")
|
||||
[?] Review settings like NSModeOnID for whether they actually have a point existing (Rob says it does not - and that it should probably be a nickname setting)
|
||||
[?] OS INJECT
|
||||
[?] Drop CS SET ENTRYMSG, replace with a 'news' type system? (limited to a configured number of items, default 3)
|
||||
|
||||
@@ -6891,6 +6891,10 @@ if test "${with_makebin+set}" = set; then
|
||||
withval=$with_makebin; MAKEBIN=$withval
|
||||
fi
|
||||
|
||||
# If we're using run-cc.pl suppress the make process (run-cc.pl does it for us)
|
||||
if test "$MAKEBIN"; then
|
||||
MAKEBIN="@$MAKEBIN"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
###############################################################
|
||||
|
||||
# Anope binary directory
|
||||
ANOPATH=/home/ircd/services/
|
||||
ANOPATH=/home/ircd/services/bin
|
||||
|
||||
# Name of the pid file
|
||||
ANOPIDF=services.pid
|
||||
|
||||
+118
-82
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Example configuration file for Services. After making the appropriate
|
||||
* changes to this file, place it in the Services data directory (as
|
||||
* specified in the "configure" script, default /home/username/services)
|
||||
* specified in the "configure" script, default /home/username/services/data)
|
||||
* under the name "services.conf".
|
||||
*
|
||||
* The format of this file is fairly simple: three types of comments are supported:
|
||||
@@ -165,7 +165,7 @@ serverinfo
|
||||
#id = "00A"
|
||||
|
||||
/*
|
||||
* These identify the ident@hostname which will be used by the Serivces pesudoclients.
|
||||
* These identify the ident@hostname which will be used by the Services pesudoclients.
|
||||
* They can be overridden by the -user and -host command-line options when starting
|
||||
* Services.
|
||||
*/
|
||||
@@ -194,7 +194,7 @@ serverinfo
|
||||
networkinfo
|
||||
{
|
||||
/*
|
||||
* For the given channel, every use that has or gets op status of the channel
|
||||
* For the given channel, every user that has or gets op status of the channel
|
||||
* will automatically receive the +h user mode. This directive is optional.
|
||||
*/
|
||||
helpchannel = "#help"
|
||||
@@ -414,7 +414,7 @@ options
|
||||
/*
|
||||
* If set, Anope will dump core when a segmentation fault occurs. This is
|
||||
* generally not needed, but if Anope is crashing on your network and you
|
||||
* want to make a bug report, having a core file may be of great help.
|
||||
* want to make a bug report, having a core file will be of great help.
|
||||
* This directive is optional.
|
||||
*/
|
||||
#dumpcore = yes
|
||||
@@ -488,9 +488,116 @@ options
|
||||
*
|
||||
* WARNING: Do NOT put your user servers in this directive.
|
||||
*/
|
||||
ulineservers = "stats.your.network proxy.your.network"
|
||||
ulineservers = "stats.your.network"
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* [RECOMMENDED] Oper Access Config
|
||||
*
|
||||
* This section is used to set up staff access to restricted oper only commands.
|
||||
* You may define groups of commands and privileges, as well as who may use them.
|
||||
*
|
||||
* The block is recommended, as without it, you will be unable to access most oper commands.
|
||||
* It replaces the old ServicesRoot directive, amongst others.
|
||||
*
|
||||
* Note that third party modules may add additional commands and privileges to this list.
|
||||
*
|
||||
* Available privileges:
|
||||
* botserv/administration - Can perform certain BotServ administrative tasks
|
||||
* chanserv/access/modify - Can modify channel access lists
|
||||
* chanserv/auspex - Can see any information with /chanserv info
|
||||
* chanserv/no-register-limit - May register an unlimited number of channels and nicknames
|
||||
* chanserv/set - Can modify the settings of any channel (incl. changing of the owner and password!)
|
||||
* hostserv/set - Can add/modify/delete any vhost
|
||||
* memoserv/info - Can see any information with /memoserv info
|
||||
* memoserv/set-limit - Can set the limit of max stored memos on any user and channel
|
||||
*
|
||||
* Available commands:
|
||||
* botserv/bot/del botserv/bot/add botserv/bot/change botserv/assign/private
|
||||
* botserv/botlist botserv/set/private botserv/set/nobot
|
||||
*
|
||||
* chanserv/access/list chanserv/drop chanserv/forbid chanserv/getkey
|
||||
* chanserv/getpass chanserv/list chanserv/logout chanserv/sendpass
|
||||
* chanserv/status chanserv/topic chanserv/suspend chanserv/set/noexpire
|
||||
* chanserv/aop/list
|
||||
*
|
||||
* memoserv/sendall memoserv/staff
|
||||
*
|
||||
* nickserv/getpass nickserv/sendpass nickserv/getemail nickserv/suspend
|
||||
* nickserv/confirm
|
||||
*
|
||||
* operserv/global operserv/news operserv/stats operserv/kick
|
||||
* operserv/mode operserv/session operserv/modlist operserv/ignore
|
||||
* operserv/chankill operserv/akill operserv/sqline operserv/sgline
|
||||
* operserv/szline operserv/clearmodes operserv/staff operserv/defcon
|
||||
* operserv/modload operserv/jupe operserv/set operserv/noop
|
||||
* operserv/quit operserv/update operserv/reload operserv/restart
|
||||
* operserv/shutdown operserv/svsnick operserv/oline operserv/umode
|
||||
*
|
||||
* First, we define 'opertypes', which are named whatever we want ('Network Administrator', etc).
|
||||
* These can contain commands for oper-only strings (see above) which grants access to that specific command,
|
||||
* and privileges (which grant access to more general permissions for the named area).
|
||||
* Wildcard entries are permitted for both, e.g. 'commands = "operserv/*"' for all OperServ commands.
|
||||
*
|
||||
* Below are some default example types, but this is by no means exhaustive,
|
||||
* and it is recommended that you configure them to your liking.
|
||||
*/
|
||||
opertype
|
||||
{
|
||||
// The name of this opertype
|
||||
name = "Services Root"
|
||||
|
||||
// What commands (see above) this opertype may use
|
||||
commands = "*"
|
||||
|
||||
// What privs (see above) this opertype has
|
||||
privs = "*"
|
||||
}
|
||||
|
||||
opertype
|
||||
{
|
||||
name = "Services Administrator"
|
||||
commands = "operserv/global operserv/news operserv/stats operserv/kick operserv/mode operserv/session operserv/modlist operserv/ignore operserv/chankill operserv/akill operserv/sqline operserv/sgline operserv/szline operserv/clearmodes operserv/staff operserv/defcon botserv/* chanserv/* nickserv/* memoserv/*"
|
||||
privs = "*"
|
||||
}
|
||||
|
||||
opertype
|
||||
{
|
||||
name = "Helper"
|
||||
privs = "hostserv/set"
|
||||
}
|
||||
|
||||
/*
|
||||
* After defining different types of operators in the above opertype section, we now define who is in these groups
|
||||
* through 'oper' blocks, similar to ircd access.
|
||||
*
|
||||
* The default is to comment these out (so NOBODY will have Services access).
|
||||
* You probably want to add yourself and a few other people at minimum.
|
||||
*
|
||||
* As with all permissions, make sure to only give trustworthy people access to Services.
|
||||
*/
|
||||
#oper
|
||||
#{
|
||||
# // The nickname of this services oper
|
||||
# name = "DukePyrolator"
|
||||
#
|
||||
# // The opertype this person will have
|
||||
# type = "Services Root"
|
||||
#}#
|
||||
#
|
||||
#oper
|
||||
#{
|
||||
# name = "nick1"
|
||||
# type = "Services Administrator"
|
||||
#}#
|
||||
#
|
||||
#oper
|
||||
#{
|
||||
# name = "nick2"
|
||||
# type = "Helper"
|
||||
#}
|
||||
|
||||
/*
|
||||
* [OPTIONAL] Mail Config
|
||||
*
|
||||
@@ -684,7 +791,7 @@ nickserv
|
||||
#enforceruser = "enforcer"
|
||||
|
||||
/*
|
||||
* The delay before a NickServ-collided nick is released.
|
||||
* The delay before a NickServ collided nick is released.
|
||||
*/
|
||||
releasetimeout = 1m
|
||||
|
||||
@@ -736,18 +843,6 @@ nickserv
|
||||
*/
|
||||
#modeonid = yes
|
||||
|
||||
/*
|
||||
* If set, Services will only allow Services Root(s) to use the NickServ GETPASS command on
|
||||
* a nick. This directive is optional.
|
||||
*/
|
||||
restrictgetpass = yes
|
||||
|
||||
/*
|
||||
* If set, Services will track your last nick identified when issuing nick changes. This
|
||||
* directive is optional.
|
||||
*/
|
||||
#nicktracking = yes
|
||||
|
||||
/*
|
||||
* 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
|
||||
@@ -872,12 +967,6 @@ chanserv
|
||||
*/
|
||||
listmax = 50
|
||||
|
||||
/*
|
||||
* If set, Services will only allow Services Root(s) to use the ChanServ GETPASS command on a
|
||||
* channel. This directive is optional.
|
||||
*/
|
||||
#restrictgetpass = yes
|
||||
|
||||
/*
|
||||
* Allow only IRC Operators to use ChanServ. This directive is optional.
|
||||
*/
|
||||
@@ -974,10 +1063,10 @@ botserv
|
||||
* The core modules to load for BotServ. This is a space separated list that corresponds
|
||||
* to the base names of the modules for BotServ. This directive is optional, but highly recommended.
|
||||
*/
|
||||
modules = "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot bs_fantasy bs_fantasy_kick bs_fantasy_kickban bs_fantasy_owner bs_fantasy_seen bs_fantasy_unban"
|
||||
modules = "bs_help bs_botlist bs_assign bs_set bs_kick bs_badwords bs_act bs_info bs_say bs_unassign bs_bot"
|
||||
|
||||
/*
|
||||
* The default bot options for newly registered channel. Note that changing these options
|
||||
* The default bot options for newly registered channels. Note that changing these options
|
||||
* will have no effect on channels which are already registered. The list must be separated
|
||||
* by spaces.
|
||||
*
|
||||
@@ -1024,7 +1113,7 @@ botserv
|
||||
#smartjoin = yes
|
||||
|
||||
/*
|
||||
* If set, the bots will use a kick reason that does not retake the word when it is kicking.
|
||||
* 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.
|
||||
*/
|
||||
@@ -1074,41 +1163,6 @@ hostserv
|
||||
* to the base names of the modules for HostServ. This directive is optional, but highly recommended.
|
||||
*/
|
||||
modules = "hs_help hs_on hs_off hs_group hs_list hs_set hs_setall hs_del hs_delall"
|
||||
|
||||
/*
|
||||
* Specifies the nicks of NON-OPERS allowed to set or remove vHosts using HostServ. Can be re-loaded
|
||||
* with /msg operserv reload. You can specify more than one nick by separating each one by a space.
|
||||
*
|
||||
* This directive is optional, but you are discouraged from using it. It is recommended that you only
|
||||
* give opers the ability to set or remove vHosts by making them Services Opers or higher, but if you
|
||||
* do decide to use this directive, make sure you insert the correct nick(s) here.
|
||||
*/
|
||||
#hostsetters = "CyberBotX w00t"
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] HelpServ Config
|
||||
*
|
||||
* This section is used to set up the Help Service pseudo-client. All directives are required.
|
||||
*/
|
||||
helpserv
|
||||
{
|
||||
/*
|
||||
* The nickname of the HelpServ client.
|
||||
*/
|
||||
nick = "HelpServ"
|
||||
|
||||
/*
|
||||
* The description of the HelpServ client, which will be used as the GECOS (real
|
||||
* name) of the client.
|
||||
*/
|
||||
description = "Help Service"
|
||||
|
||||
/*
|
||||
* The core modules to load for HelpServ. This is a space separated list that corresponds
|
||||
* to the base names of the modules for HelpServ. This directive is optional, but highly recommended.
|
||||
*/
|
||||
modules = "he_help"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1163,17 +1217,7 @@ operserv
|
||||
* The core modules to load for OperServ. This is a space separated list that corresponds
|
||||
* to the base names of the modules for OperServ. This directive is optional, but highly recommended.
|
||||
*/
|
||||
modules = "os_help os_global os_stats os_oper os_admin os_staff os_mode os_kick os_clearmodes os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_logonnews os_randomnews os_opernews os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo"
|
||||
|
||||
/*
|
||||
* Specifies the Services "super-users". The super-users, or "roots" as in Unix terminology, are
|
||||
* the only uses who can add or delete Services Admins.
|
||||
*
|
||||
* You can specify more than one nick by separating each one by a space.
|
||||
*
|
||||
* This is commented out by default; make sure you insert the correct nicks before uncommenting it.
|
||||
*/
|
||||
#servicesroot = "CyberBotX w00t"
|
||||
modules = "os_help os_global os_stats os_staff os_mode os_kick os_clearmodes os_akill os_sgline os_sqline os_szline os_chanlist os_userlist os_news os_session os_noop os_jupe os_ignore os_set os_reload os_update os_restart os_quit os_shutdown os_defcon os_chankill os_svsnick os_oline os_umode os_modload os_modunload os_modlist os_modinfo"
|
||||
|
||||
/*
|
||||
* If set, Services Admins will be able to use SUPERADMIN [ON|OFF] which will temporarily grant
|
||||
@@ -1219,13 +1263,6 @@ operserv
|
||||
*/
|
||||
#killonsqline = yes
|
||||
|
||||
/*
|
||||
* Disables the highly destructive OperServ RAW command. This directive is optional, but HIGHLY
|
||||
* recommended. Not setting this and causing problems with your network using RAW will not be
|
||||
* supported.
|
||||
*/
|
||||
disableraw = yes
|
||||
|
||||
/*
|
||||
* Defines what actions should trigger notifications. The list must be separated by spaces.
|
||||
*
|
||||
@@ -1242,7 +1279,6 @@ operserv
|
||||
* - osszline: OperServ's SZLINE command was used
|
||||
* - osnoop: OperServ's NOOP command was used
|
||||
* - osjupe: OperServ's JUPE command was used
|
||||
* - osraw: OperServ's RAW command was used
|
||||
* - akillexpire: An AKILL has expired
|
||||
* - sglineexpire: An SGLINE has expired
|
||||
* - sqlineexpire: An SQLINE has expired
|
||||
@@ -1257,7 +1293,7 @@ operserv
|
||||
*
|
||||
* This directive is optional, if left blank, there will be no notifications.
|
||||
*/
|
||||
notifications="osglobal osmode osclearmodes oskick osakill ossgline ossqline osszline osnoop osjupe osraw getpass setpass forbid drop"
|
||||
notifications="osglobal osmode osclearmodes oskick osakill ossgline ossqline osszline osnoop osjupe getpass setpass forbid drop"
|
||||
|
||||
/*
|
||||
* Enables session limiting. Session limiting prevents users from connecting more than a certain
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
astyle --style=java --indent=tab --brackets=break-closing --indent-switches --indent-cases --brackets=break
|
||||
+1
-1
@@ -7,7 +7,7 @@ if(WIN32)
|
||||
# Add README.txt to list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("README.txt$" TRUE)
|
||||
endif(IN_SOURCE)
|
||||
set(DOCS DEFCON FAQ INSTALL MODULES NEWS OLDCHANGES PROXY ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
|
||||
set(DOCS DEFCON FAQ INSTALL MODULES NEWS PROXY ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
|
||||
install(FILES ${DOCS}
|
||||
DESTINATION docs
|
||||
)
|
||||
|
||||
@@ -1,480 +1,10 @@
|
||||
Frequently Asked Questions (FAQ) concerning Anope
|
||||
------------------------------------------------
|
||||
|
||||
NOTE:
|
||||
An updated version of this FAQ can be found on our website: www.anope.org
|
||||
|
||||
Table of Contents
|
||||
-----------------
|
||||
|
||||
1) General
|
||||
1.1) What is Anope?
|
||||
1.2) Where can I find Anope?
|
||||
1.3) Does Anope run under Windows?
|
||||
1.4) Can I send you questions without reading the FAQ, INSTALL or README
|
||||
files?
|
||||
1.5) I need support for the XYZ protocol.
|
||||
1.6) Your Services program doesn't do XYZ like DALnet (or other) Services.
|
||||
What's wrong?
|
||||
1.7) I've got a great new idea for Services. Do you want it?
|
||||
1.8) Examples of features we have been asked about and why we won't add (or
|
||||
haven't yet added) them, so don't ask us about them:
|
||||
1.9) Can you help me?
|
||||
1.10) Where is RootServ?
|
||||
|
||||
2) Installation / Configuration
|
||||
2.1) When I run "make", I get an error message like "missing separator",
|
||||
"Unassociated shell command", "Unexpected end of line seen", etc.
|
||||
2.2) I get an error like "Makefile.inc not found".
|
||||
2.3) I typed "./services" at the command line, but nothing happened!
|
||||
2.4) Whenever I start Anope, I get a message on my IRC server saying
|
||||
"connection refused" or something similar, and Anope gives an error
|
||||
message from the server saying "Closing Link: ...".
|
||||
2.5) My IRC server is giving me messages like "Connection to
|
||||
services.whatever.net[127.0.0.1] activated" and then "Access denied --
|
||||
no N line". Why?
|
||||
2.6) When I say "/connect services.*", it doesn't work!
|
||||
2.7) Anope starts up okay, but if I try to register a nickname, it comes
|
||||
back with "Sorry, registration failed."
|
||||
2.8) Anope reports (via /stats u or /msg OperServ STATS) a different number
|
||||
of users online than I get from doing /lusers.
|
||||
|
||||
3) OperServ
|
||||
3.1) Using the OperServ JUPE command results in server messages like
|
||||
"Server juped.server introduced by non-hub server services.my.net".
|
||||
3.2) I can't use the ADMIN command to add Services admins, it tells me
|
||||
"Permission denied."
|
||||
3.3) When I add an AKILL, the users matching it don't get killed.
|
||||
3.4) Trying to use OperServ gives me "Access denied", but my nick is in the
|
||||
ServicesRoot directive and is registered, and I've identified for my
|
||||
nick.
|
||||
3.5) When I used the OperServ RAW command, Anope and/or my network crashed,
|
||||
or did weird things! Please fix this bug!
|
||||
3.6) I would like to have the list of the different RAW on OperServ.
|
||||
3.7) I can't get /OS UMODES and /OS SVSNICK to work!
|
||||
3.8) What is a Super-Admin? How does it work? Why might it not work?
|
||||
3.9) How can i enable the OperServ RAW command?
|
||||
|
||||
4) Bugs / Crashes
|
||||
4.1) Anope always dies after about five minutes, saying "FATAL ERROR! Can't
|
||||
back up nick.db".
|
||||
4.2) Anope crashed with a segmentation fault.
|
||||
4.3) I've found a bug that's not mentioned here or in the README or BUGS
|
||||
files. What should I do?
|
||||
4.4) My FreeBSD box complains about 'Shared object "nss_dns.so.1" not
|
||||
found'
|
||||
4.5) Anope and long (more then 30 character) nicknames.
|
||||
|
||||
5) ChanServ
|
||||
5.1) Anope's channel mode setting doesn't work. I can't set modes with
|
||||
OperServ, and every time ChanServ tries to set a mode, my server
|
||||
reverses the change.
|
||||
5.2) Anope ignored the SET SUCCESSOR setting and deleted a channel when the
|
||||
founder expired.
|
||||
5.3) How to auto voice all those whom join my #channel?
|
||||
5.4) Channel options like RESTRICTED or SECUREOPS don't work. What's wrong?
|
||||
|
||||
6) BotServ
|
||||
6.1) How do I add bots to BotServ?
|
||||
6.2) Why do kick triggers and fantasy commands fail to work with my Bahamut
|
||||
IRCd?
|
||||
|
||||
7) Language
|
||||
7.1) Anope complains in the logfile about being unable to load the default
|
||||
language.
|
||||
7.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
|
||||
7.3) I selected a language other than English, but sometimes Anope sends
|
||||
responses in English instead.
|
||||
|
||||
8) DevNull
|
||||
8.1) What is the purpose of DevNull?
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
1) General
|
||||
|
||||
1.1) What is Anope?
|
||||
|
||||
Anope is a set of services for IRC networks. See the README file for more
|
||||
information. And in case you were wondering, Anope is Epona spelt backwards
|
||||
:)
|
||||
|
||||
1.2) Where can I find Anope?
|
||||
|
||||
The latest version can always be found at the official Anope distribution
|
||||
site:
|
||||
|
||||
* http://www.anope.org/
|
||||
|
||||
New version announcements can also be found at http://www.anope.org/ in the
|
||||
main page.
|
||||
|
||||
1.3) Does Anope run under Windows?
|
||||
|
||||
Yes. For more information on how to obtain the windows version of Anope
|
||||
visit http://wiki.anope.org/Windows
|
||||
|
||||
1.4) Can I send you questions without reading the FAQ, INSTALL or README files?
|
||||
|
||||
No. If you don't read those files, your messages will most probably be
|
||||
ignored. We don't mean to be rude, but if we took the time to write down
|
||||
some documentation, we'd expect you to take some time to read it.
|
||||
|
||||
1.5) I need support for the XYZ protocol.
|
||||
|
||||
Since Anope 1.7.9, support for other IRCD's, and thus protocols, has been
|
||||
made modular. More information on making a support file for your favorite
|
||||
IRCD can be found in the docs/IRCD file.
|
||||
|
||||
1.6) Your Services program doesn't do XYZ like DALnet (or other) Services.
|
||||
What's wrong?
|
||||
|
||||
Nothing is wrong, except your expectations. Anope is a completely
|
||||
different program from that used on DALnet; they are similar in concept
|
||||
only.
|
||||
|
||||
1.7) I've got a great new idea for Services. Do you want it?
|
||||
|
||||
We are always interested in hearing new ideas. HOWEVER, do not expect your
|
||||
proposal to be in the next Anope release for sure. As a rule, we usually
|
||||
don't add anything that can be equivalently done by other means, or that we
|
||||
consider totally useless; see question 1.8 for examples of things we don't
|
||||
plan to add.
|
||||
|
||||
Our general intent is for Anope to provide as much functionality as
|
||||
possible--while staying as lean as possible. So features which are
|
||||
arguably beneficial will tend to be added, while features of limited or no
|
||||
benefit or which can be equally provided by something else already in use
|
||||
will tend to be passed over.
|
||||
|
||||
If you'd like to give us your idea, you can go to our website at
|
||||
http://www.anope.org/ and add it on our online Forum, in the Feature
|
||||
Requests section.
|
||||
|
||||
1.8) Examples of features we have been asked about and why we won't add (or
|
||||
haven't yet added) them, so don't ask us about them:
|
||||
|
||||
* An option to make ChanServ stay in some/all registered channels: we see
|
||||
absolutely no necessity for this feature, since BotServ already does this
|
||||
anyway.
|
||||
|
||||
* A "current time" field in NickServ and ChanServ INFO displays: Most
|
||||
people have clocks of some sort either on their computer screens or on
|
||||
their walls (or both), and all IRC servers, as well as Services, have a
|
||||
command to return the server's current time. Thus a current-time field in
|
||||
INFO displays would simply take up extra space for no reason.
|
||||
|
||||
1.9) Can you help me?
|
||||
|
||||
No, we can't help you unless you tell us what you need help with.
|
||||
|
||||
1.10) Where is RootServ?
|
||||
|
||||
Anope does not supply RootServ. All functions you would find in RootServ
|
||||
have been integrated into OperServ. If you really want to use RootServ, you
|
||||
can set the OperServAlias in services.conf to be RootServ. This will enable
|
||||
the RootServ nick to be used for OperServ as well. Read the comments near
|
||||
OperServAlias in the configuration file for more information.
|
||||
|
||||
|
||||
2) Installation / Configuration
|
||||
|
||||
2.1) When I run "make", I get an error message like "missing separator",
|
||||
"Unassociated shell command", "Unexpected end of line seen", etc.
|
||||
|
||||
Your make program isn't compatible with the Makefile for Anope. The
|
||||
Makefile was designed to work with GNU make, and as such may not work on
|
||||
other systems' "make" programs. If you get an error from "make", obtain
|
||||
GNU make from ftp://prep.ai.mit.edu/pub/gnu/ (or wherever you prefer) and
|
||||
use it instead of your system's default "make". Note that GNU make may
|
||||
already be installed on your system; try using the command "gmake" instead
|
||||
of "make".
|
||||
|
||||
The make programs bundled with SunOS/Solaris and FreeBSD have been reported
|
||||
not to work; you will need to use GNU make on these systems.
|
||||
|
||||
2.2) I get an error like "Makefile.inc not found".
|
||||
|
||||
You forgot to run the Config script first. See the INSTALL file for
|
||||
compilation instructions.
|
||||
|
||||
2.3) I typed "./services" at the command line, but nothing happened!
|
||||
|
||||
Anope puts itself in the background when it starts, so you get your shell
|
||||
prompt right back. Meanwhile, Anope will continue setting up, then connect
|
||||
to the IRC server specified in services.conf (or on the command line). If
|
||||
it doesn't connect, you probably specified the wrong server type in the
|
||||
configuration file. (Also make sure that you are actually running one of
|
||||
the supported servers. There are a gazillion different variations on the
|
||||
basic IRC protocol out there, and we have neither the time nor the desire
|
||||
to add support for them.)
|
||||
|
||||
The recommended server, under which Epona (the original code base used by
|
||||
Anope) was developed, is Bahamut. DreamForge 4.6.7 will also work fine, but
|
||||
it's a bit obsolete nowadays. Derivatives of Bahamut and DreamForge may
|
||||
also work, if they don't change the server<->server protocol too much;
|
||||
contact their authors for more information. Most people, though, are
|
||||
running Anope with UnrealIRCd, UltimateIRCd or Bahamut.
|
||||
|
||||
As always, you can check the log file (services.log by default) for error
|
||||
messages. You can also start services with the -nofork command line option
|
||||
to prevent it from running in the background, and it will output the
|
||||
messages written to the log file to the console as well.
|
||||
|
||||
2.4) Whenever I start Anope, I get a message on my IRC server saying
|
||||
"connection refused" or something similar, and Anope gives an error
|
||||
message from the server saying "Closing Link: ...".
|
||||
|
||||
See section 3 of the INSTALL file.
|
||||
|
||||
2.5) My IRC server is giving me messages like "Connection to
|
||||
services.whatever.net[127.0.0.1] activated" and then "Access denied -- no
|
||||
N line". Why?
|
||||
|
||||
This is typically caused by including a port number in the C:line for
|
||||
services, which tells your server to try to autoconnect to it (depending on
|
||||
the class (Y:line) settings). This is not what you want, because Anope
|
||||
will connect to the server itself, but does not listen for servers to
|
||||
connect to it. The solution is to remove the port number from the C:line.
|
||||
|
||||
2.6) When I say "/connect services.*", it doesn't work!
|
||||
|
||||
Of course not. RTFM (Read The Fine Manual), and see the previous answer.
|
||||
|
||||
2.7) Anope starts up okay, but if I try to register a nickname, it comes back
|
||||
with "Sorry, registration failed."
|
||||
|
||||
Make sure you've selected the correct IRC server type in the configure
|
||||
script; see question 2.4 for details.
|
||||
|
||||
2.8) Anope reports (via /stats u or /msg OperServ STATS) a different number of
|
||||
users online than I get from doing /lusers.
|
||||
|
||||
Anope doesn't count its own pseudo-clients (NickServ, ChanServ, etc.) in
|
||||
its user count, while the IRC server does.
|
||||
|
||||
|
||||
3) OperServ
|
||||
|
||||
3.1) Using the OperServ JUPE command results in server messages like "Server
|
||||
juped.server introduced by non-hub server services.my.net".
|
||||
|
||||
Services' uplink must have an H: line for Services in the ircd.conf file,
|
||||
which looks something like:
|
||||
|
||||
H:*::services.whatever.net
|
||||
|
||||
3.2) I can't use the ADMIN command to add Services admins, it tells me
|
||||
"Permission denied."
|
||||
|
||||
Did you define yourself as the Services root? You need to insert your
|
||||
nickname in the ServicesRoot directive in services.conf. Also, you must be
|
||||
a global IRC Operator and your nickname must be registered and properly
|
||||
indentified with NickServ.
|
||||
|
||||
3.3) When I add an AKILL, the users matching it don't get killed.
|
||||
|
||||
Use the AkillOnAdd configuration directive.
|
||||
|
||||
3.4) Trying to use OperServ gives me "Access denied", but my nick is in the
|
||||
ServicesRoot directive and is registered, and I've identified for my nick.
|
||||
|
||||
You need to be a global oper (i.e. user mode +o) to access OperServ. This
|
||||
can be configured via the OSOpersOnly directive in services.conf .
|
||||
|
||||
3.5) When I used the OperServ RAW command, Anope and/or my network crashed, or
|
||||
did weird things! Please fix this bug!
|
||||
|
||||
"That's not a bug, it's a feature."
|
||||
|
||||
Have you ever typed /msg OperServ HELP RAW? It's clearly stated there that
|
||||
this command is dangerous and that its use may result in very bad things.
|
||||
|
||||
And that's why this command has been disabled by default. If you enabled
|
||||
and used it, YOU'RE ON YOUR OWN. All help requests will be ignored, even if
|
||||
the problem happens not immediately.
|
||||
|
||||
3.6) I would like to have the list of the different RAW on OperServ.
|
||||
|
||||
If you have to ask, you should not be messing with RAW :)
|
||||
|
||||
3.7) I can't get /OS UMODES and /OS SVSNICK to work!
|
||||
|
||||
You need to be a SuperAdmin to be able to use these commands.
|
||||
|
||||
3.8) What is a Super-Admin? How does it work? Why might it not work?
|
||||
|
||||
Super-Admin's have extra privileges, including being founder on all
|
||||
channels. It must be activated on a per user basis and is only available to
|
||||
Services Roots. It is set using OperServ and is not persistent. It only
|
||||
works if SuperAdmin is not commented in the services configuration file.
|
||||
This is commented by default. Read /msg OperServ HELP SET SUPERADMIN for
|
||||
further help.
|
||||
|
||||
3.9) How can i enable the OperServ RAW command?
|
||||
|
||||
Enabling the OperServ RAW command is VERY dangerous and should never be
|
||||
done on a real network without thinking about it very well first. The RAW
|
||||
command can easily break your whole network if used incorrectly, and thus
|
||||
you will receive NO SUPPORT if you enable RAW on your network.
|
||||
|
||||
Before you enable RAW, be very sure you really want to enable it, and keep
|
||||
in mind that you will NOT BE ABLE to receive ANY SUPPORT anymore, because
|
||||
Anope's stability cannot be guaranteed if RAW is enabled.
|
||||
|
||||
The RAW command comes bundled as a core module for operserv. To load it,
|
||||
add the os_raw module to the list of OperServ core modules. But be sure to
|
||||
keep in mind that when you enable the RAW command, you CANNOT GET ANY
|
||||
SUPPORT for Anope anymore.
|
||||
|
||||
|
||||
4) Bugs / Crashes
|
||||
|
||||
4.1) Anope always dies after about five minutes, saying "FATAL ERROR! Can't
|
||||
back up nick.db".
|
||||
|
||||
Make sure that the user Anope runs as has write access to the data
|
||||
directory, and that the data directory actually exists (the latter
|
||||
shouldn't be a problem if you ran the Config script). This means Anope
|
||||
needs write and execute permission on the data directory itself and execute
|
||||
permission on every parent directory of the data directory.
|
||||
|
||||
4.2) Anope crashed with a segmentation fault.
|
||||
|
||||
See if you can reproduce this by doing a certain sequence of things. If
|
||||
so, please report it to us (see part 6 of README file). If not, you're
|
||||
probably out of luck; if you like, you can report it to us anyway, but
|
||||
chances are it won't get fixed if we don't have instructions on reproducing
|
||||
it. If you do have such a problem, you may find the crontab utility useful
|
||||
for dealing with it.
|
||||
|
||||
Also, see the DumpCore directive in the configuration file. It allows Anope
|
||||
to dump its core whenever it's segfaulting, usually calling it core and
|
||||
placing it into Anope's main directory. Open up gdb by issuing the
|
||||
following command at your shell:
|
||||
|
||||
* gdb services core
|
||||
|
||||
(of course replacing 'core' with the name of the core if different) and
|
||||
type 'bt' at the gdb prompt. After that, send us the output you got and
|
||||
keep the core file in a safe place, in case we need it to dig deeper into
|
||||
the problem.
|
||||
|
||||
4.3) I've found a bug that's not mentioned here or in the README or BUGS files.
|
||||
What should I do?
|
||||
|
||||
See section 6 of the README file.
|
||||
|
||||
4.4) My FreeBSD box complains about 'Shared object "nss_dns.so.1" not found'
|
||||
|
||||
We haven't figured out the exact cause yet, but as a quickfix you can
|
||||
delete the /etc/nsswitch.conf file. Please keep in mind that removing a
|
||||
configuration file can be dangerous, so only do this if you know what you
|
||||
are doing.
|
||||
|
||||
4.5) Anope and long (more then 30 character) nicknames.
|
||||
|
||||
By default anope only supports nicknames up to 30 characters (NICKLEN=30).
|
||||
If your IRCd allows for longer nicknames or has been modified to do so
|
||||
anope will start logging a lot of ("NICK from nonexistent nick") messages.
|
||||
This is because once a user uses a nick that is too long for anope to handle,
|
||||
anope loses track of the user for the remainder of the session.
|
||||
It is POSSIBLE but not NOT RECOMMENDED to extend the maximum length of nicknames
|
||||
anope can track, however this will also break database compatibility. DBs saved
|
||||
with anope set to allow for example 40 chars cannot be read by a default anope
|
||||
and vice versa. So changing the maximum nick length is only possible
|
||||
when starting with fresh databases and even then the consequences of this are
|
||||
UNTESTED.
|
||||
In order to change the maximum internal nick length, change the NICKMAX setting
|
||||
in include/config.h, recompile anope and start without databases.
|
||||
|
||||
|
||||
5) ChanServ
|
||||
|
||||
5.1) Anope's channel mode setting doesn't work. I can't set modes with
|
||||
OperServ, and every time ChanServ tries to set a mode, my server reverses
|
||||
the change.
|
||||
|
||||
Make sure EVERY server on your network has a U: line for Services in
|
||||
ircd.conf, for example:
|
||||
|
||||
U:services.whatever.net:*:*
|
||||
|
||||
5.2) Anope ignored the SET SUCCESSOR setting and deleted a channel when the
|
||||
founder expired.
|
||||
|
||||
Normally, this is because the successor had too many channels registered;
|
||||
in this case, you will see an entry in the log file like the following:
|
||||
|
||||
[date] Successor (SuccessorNick) of channel #somechannel owns too many
|
||||
channels, deleting channel #somechannel
|
||||
|
||||
If you don't get a message like this or you can verify that the successor
|
||||
wasn't running into the channel limit, please report it using the
|
||||
bug-reporting procedure below (see section 6 of the README file).
|
||||
|
||||
5.3) How to auto voice all those whom join my #channel?
|
||||
|
||||
Execute the following commands (/cs is an alias for /msg ChanServ):
|
||||
|
||||
/cs set #channel secure off
|
||||
/cs set #channel xop off
|
||||
/cs levels #channel set AUTOVOICE -1
|
||||
|
||||
5.4) Channel options like RESTRICTED or SECUREOPS don't work. What's wrong?
|
||||
|
||||
Make sure that you didn't put any of your normal IRCd's as a ULined server
|
||||
in Anope. Some access checks for clients from ULined servers are skipped to
|
||||
avoid fights between the ULined servers. This is usually only useful when
|
||||
you have a statistics server connected to your network.
|
||||
|
||||
|
||||
6) BotServ
|
||||
|
||||
6.1) How do I add bots to BotServ?
|
||||
|
||||
Read /msg BotServ HELP and /msg BotServ HELP BOT. Note that you need to be
|
||||
opered up and identified as a Services Administrator before you can use the
|
||||
BOT command.
|
||||
|
||||
6.2) Why do kick triggers and fantasy commands fail to work with my Bahamut
|
||||
IRCd?
|
||||
|
||||
Bahamut allows you to setup a server as 'serviceshub'. This will filter
|
||||
certain data services usually don't need to process. This option also
|
||||
filters channel messages, because DALnet's services have no use for them.
|
||||
Anope parses the channel messages for kick triggers and fantasy commands.
|
||||
To make sure these work the server type of the hub they're linked to should
|
||||
be simply 'hub' and not 'serviceshub'.
|
||||
|
||||
|
||||
7) Language
|
||||
|
||||
7.1) Anope complains in the logfile about being unable to load the default
|
||||
language.
|
||||
|
||||
You forgot to run "make install".
|
||||
|
||||
7.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
|
||||
|
||||
See section 5 of the README file.
|
||||
|
||||
7.3) I selected a language other than English, but sometimes Anope sends
|
||||
responses in English instead.
|
||||
|
||||
Some language files are not complete--in other words, they don't have a
|
||||
translation of every message Anope uses, but only some of them. In this
|
||||
case, the missing messages will be displayed in English. You can either
|
||||
wait for the primary translator to provide us with a translation, or do the
|
||||
translation yourself and send us the messages translated into your
|
||||
language.
|
||||
|
||||
|
||||
8) DevNull
|
||||
|
||||
8.1) What is the purpose of DevNull?
|
||||
|
||||
DevNull functions as a message sink. Any message sent to it will be
|
||||
ignored. It will not be logged, there will be no response. It will be lost
|
||||
forever. Whether it's useful or not is up to you; we just provide you with
|
||||
the option.
|
||||
|
||||
The information in the 1.9 FAQ is subject to change at any
|
||||
moment due to new developments. Please visit our website
|
||||
for the most up to date information.
|
||||
|
||||
An updated version of the FAQ can be found here:
|
||||
|
||||
http://wiki.anope.org/index.php/FAQ
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@ Note: You should also read the README and FAQ files!
|
||||
If you're unable to get a link with your IRCd after reading this section,
|
||||
you might try the interactive link maker, which is located at:
|
||||
|
||||
http://anope.org/~heinz/ilm.php
|
||||
http://anope.org/ilm.php
|
||||
|
||||
4) Starting Anope
|
||||
|
||||
|
||||
+1
-104
@@ -1,109 +1,6 @@
|
||||
Anope MySQL Support
|
||||
-------------------
|
||||
|
||||
1) Introduction
|
||||
MySQL Support was removed in 1.9.0 until it can be better implemented moving forward.
|
||||
|
||||
Anope 1.6 onwards supports MySQL databases. On Anope 1.6.0 only PHASE 1
|
||||
has been implemented. Since the next phases require major changes in the
|
||||
core, we decided to save it for 2.0. However, having your db's easily
|
||||
accessible on your website is still a great feature.
|
||||
|
||||
PHASE 1:Anope will be able to save all it's databases to MySQL. It will
|
||||
happen in conjunction with the current FFF databases. This first step is
|
||||
nothing more than a MySQL dump of the databases (i.e. read-only), since
|
||||
Anope will not (for now) read from Mysql. (COMPLETED)
|
||||
|
||||
PHASE 2:The next step is load the databases from MySQL, being able to
|
||||
replace the FFF completely as an archive method (since all changes to
|
||||
the MySQL db would be lost on the next Services save). All, while keeping
|
||||
FFF intact. This is still not the final goal, but it's a milestone.
|
||||
(COMPLETED)
|
||||
|
||||
UPDATE: Anope 1.7.0 (Revision 11 and above) finally supports phase 2!
|
||||
A new config directive called 'UseRDB' has been added.
|
||||
If you enable this, anope will automatically try to load its
|
||||
data from MySQL (if configured and compiled with).
|
||||
|
||||
PHASE 3:The next step, and most convoluted of all (since we'll need to
|
||||
modify pretty much all the source) is to load/save (SELECT/INSERT) data
|
||||
in realtime. That way the MySQL db could be modified externally (web?).
|
||||
Again, the FFF will be kept intact.
|
||||
|
||||
2) Requirements
|
||||
|
||||
1. MySQL server version 3.23.32 or greater
|
||||
2. MySQL libs and development files (usually called mysql-dev).
|
||||
3. A MySQL user account
|
||||
4. A MySQL database
|
||||
|
||||
3) Installation
|
||||
|
||||
1. The ./Config script automatically detects if your system is capable
|
||||
of running Anope with MySQL support. There is no need anymore to
|
||||
answer yes when asked.
|
||||
|
||||
Note: You might need to run "make distclean" prior to running ./Config
|
||||
|
||||
2. Compile Anope as usual. The (g)make process will now compile MySQL
|
||||
support into Anope.
|
||||
|
||||
3. Install Anope as usual.
|
||||
|
||||
4) Configuration
|
||||
|
||||
1. Go to your "services bin directory" (eg: /home/someuser/services/) and run mydbgen
|
||||
to help on the schema creation and adjustments.
|
||||
|
||||
2. Edit services.conf and add your MySQL data to the MySQL configuration
|
||||
block.
|
||||
|
||||
3. Start or restart services to make use of the new Anope executable.
|
||||
|
||||
5) Security
|
||||
|
||||
To add a layer of security you have the option of encrypting or encoding
|
||||
all passwords for nicks and chans. Use the "MysqlSecure" directive on your
|
||||
services.conf file to enable it. The available storage methods are:
|
||||
|
||||
#MysqlSecure ""
|
||||
|
||||
or
|
||||
|
||||
MysqlSecure ""
|
||||
|
||||
Disables security. All passwords will be saved on the MySQL database
|
||||
as clear text, with no encryption or encoding. FASTEST
|
||||
|
||||
MysqlSecure "des"
|
||||
|
||||
Encrypts all passwords using a UNIX DES encryption. This is a one way
|
||||
encryption algorithm. You can only validate it against another DES
|
||||
encrypted string, using the same "salt" (the first two characters of
|
||||
the encrypted string). FAST
|
||||
|
||||
MysqlSecure "md5"
|
||||
|
||||
Calculates an MD5 128-bit checksum for the password. The value is
|
||||
returned as a 32-digit hex number that may be used as a hash key.
|
||||
This is a one way encryption algorithm. SLOW
|
||||
|
||||
MysqlSecure "sha"
|
||||
|
||||
Calculates an SHA 160-bit checksum for the password. The value is
|
||||
returned as a 40-digit hex number. This is a one way encryption
|
||||
algorithm. SLOWEST
|
||||
|
||||
MysqlSecure "mykey"
|
||||
|
||||
Encodes the passwords using "mykey" as the encryption password. It
|
||||
produces a binary string and can be decoded using the MySQL built in
|
||||
function DECODE(crypt_str,mykey). VARIABLE
|
||||
|
||||
Caveat: Keep in mind that this if you use any method other than clear
|
||||
text, services will need to encrypt/encode every single password on
|
||||
every database save. On large networks, it may impact responsiveness
|
||||
during the saves.
|
||||
|
||||
Caveat: If you enable MysqlSecure you can not longer use the UseRDB directive
|
||||
as all the password types are encrypted with a one way encryption method for
|
||||
older MySQL servers.
|
||||
|
||||
@@ -1,139 +1,8 @@
|
||||
Highlighted News in Anope 1.7 (and soon 1.8)
|
||||
============================================
|
||||
* Added a new and improved ./Config script.
|
||||
* Added MySQL phase 2 implementation (see docs/MYSQL).
|
||||
* Added NickServ registration delays.
|
||||
* Added read receipts for memos.
|
||||
* Added a way for modules to store data with internal structures.
|
||||
* Added nick tracking support.
|
||||
* Added support for SVSHOLD.
|
||||
* Added support for U:Lined servers.
|
||||
* Added support for TS6 IRCd's.
|
||||
* Added support for Windows.
|
||||
* Added internal events for modules.
|
||||
* Added a way to suspend nicks.
|
||||
* Added support for module configuration directives.
|
||||
* Added translation support for modules.
|
||||
* Added a module pack with handy modules.
|
||||
* Added IRCd protocol modules.
|
||||
* Added support for new IRCd's. Currently supported:
|
||||
- Bahamut 1.4.27 or later (including 1.8)
|
||||
- Charybdis 1.0 or later
|
||||
- DreamForge 4.6.7
|
||||
- Hybrid 7 or later
|
||||
- InspIRCd 1.0 or later (including 1.1)
|
||||
- Plexus 2.0 or later (including 3.0)
|
||||
- PTLink 6.15 or later
|
||||
- RageIRCd 2.0 or later
|
||||
- Ratbox 2.0.6 or later
|
||||
- ShadowIRCd 4.0 beta 7 or later
|
||||
- Solid IRCd 3.4.6 or later
|
||||
- UltimateIRCd 2.8.2 or later (including 3.0)
|
||||
- UnrealIRCd 3.1.1 or later (including 3.2)
|
||||
- ViagraIRCd 1.3 or later
|
||||
* Added new languages. Currently included:
|
||||
Catalan, German, English, Spanish, French, Greek,
|
||||
Hungarian, Italian, Dutch, Polish, Portugese,
|
||||
Russian, Turkish
|
||||
* Added support for CIDR channel lists.
|
||||
* Converted the core to be completely modular.
|
||||
* Improved random number algorithm.
|
||||
* Removed proxy detector (see docs/PROXY).
|
||||
* Fixed various exploits and vulnerabilities.
|
||||
* Fixed various language typos and inconsistencies.
|
||||
* Fixed a bug in the database system causing nickserv passwords
|
||||
to be saved incorrectly. Note that this breaks backwards
|
||||
compatibility on nick.db !!!
|
||||
|
||||
Highlighted News in Anope 1.6
|
||||
=============================
|
||||
* Fixed various exploits and vulnerabilities.
|
||||
* Fixed various language typos and inconsistencies.
|
||||
* Improved ignore system.
|
||||
* Improved ./configure script.
|
||||
* Removed all compile warning fixed.
|
||||
* Converted HelpServ into a proper service.
|
||||
* Added external module support.
|
||||
* Added Defense Condition (DEFCON) System.
|
||||
* Added MySQL support for mirroring databases.
|
||||
* Added multi-server configuration.
|
||||
* Added multi-domain /OS GLOBAL support.
|
||||
* Added combined +oq +oa +ha +va on net-joins.
|
||||
* Added support for ircd changes and upgrades.
|
||||
* Added HostSetters configuration directive.
|
||||
* Added /OS STAFF command.
|
||||
* Added /OS SVSNICK command.
|
||||
* Added /OS CHANKILL command.
|
||||
* Added /MS STAFF command.
|
||||
* Added /NS UPDATE command.
|
||||
* Added /MS SENDALL command.
|
||||
* Added /NS GETMAIL command.
|
||||
* Added /HS DELALL command.
|
||||
* Added /HS LIST command with pattern matching.
|
||||
* New support scripts and tools.
|
||||
* New ircd support, complete list: DreamForge 4.6.7, Bahamut 1.4.27,
|
||||
UnrealIRCd 3.1.1, UltimateIRCd 2.8.2,
|
||||
UltimateIRCd 3.0.0, Hybrid IRCd 7.0
|
||||
ViagraIRCd 1.3.x, PTlink 6.15.0
|
||||
* New Language files, complete list: cat.l, de.l, en_us.l, es.l, fr.l,
|
||||
gr.l, it.l, nl.l, pt.l, ru.l, tr.l
|
||||
|
||||
Highlighted News in Anope 1.4
|
||||
Highlighted News in Anope 1.9
|
||||
=============================
|
||||
|
||||
After the change from Epona to Anope
|
||||
------------------------------------
|
||||
* New Italian Language file
|
||||
* Added support for UltimateIRCd 3.0 and later
|
||||
* Services realtime logging to a channel
|
||||
* SuperAdmin directive for access to "super" commands.
|
||||
* Ban system is now exception aware.
|
||||
* HostServ for hostname masquerading.
|
||||
* Smarter XOP System.
|
||||
* Email verification/handshake upon registration.
|
||||
* Services can now /ignore users.
|
||||
* Smarter memo notification for channels.
|
||||
* Channel can be SUSPENDed instead of FORBIDen.
|
||||
|
||||
Before the change from Epona to Anope
|
||||
-------------------------------------
|
||||
* HostServ for networks that support them.
|
||||
* UnrealIRCd support has been rewritten, it is now fully
|
||||
working (hopefully) and officially supported again.
|
||||
* Added support for UltimateIRCd 2.8.2 and later.
|
||||
* A multi-threaded proxy detector that can scan Wingates,
|
||||
SOCKS 4/5 and HTTP proxies on ports 3128 and 8080. Don't use
|
||||
it if you have not been authorized to use it by your system
|
||||
administrator!
|
||||
* The ChanServ AOP/SOP/VOP commands, and, on networks that
|
||||
support halfops, the HOP command, have been added. They
|
||||
allow a more user-friendly control of channel privileges.
|
||||
* Use of services IDs that allow an user to be automatically
|
||||
identified after a split (if he was identified before the split)
|
||||
in a secure way. This also saves lots of bandwidth.
|
||||
* Services' default language can now be set in services.conf.
|
||||
* The OperServ RANDOMNEWS command provides an easy way to show
|
||||
network news in a random manner without flooding your users
|
||||
with them (one news per connection).
|
||||
* The BotServ SET PRIVATE option allows services admins to
|
||||
make the bot usable by IRC operators only.
|
||||
* The OperServ SQLINE command allows you to forbid nick masks
|
||||
and even channel masks with the latest Bahamut.
|
||||
* The ChanServ AKICK STICK command allows akicks to be permanently
|
||||
kept on channel.
|
||||
* The ChanServ SET TOPIC command has been renamed to TOPIC, and
|
||||
a new BAN command has been added. They both have their own
|
||||
associated levels.
|
||||
* A SET PEACE command has been added to ChanServ. It prevents
|
||||
users to use pejorative services commands (DEOP, KICK, ...)
|
||||
on users with greater or equal levels.
|
||||
|
||||
Networks using Bahamut must upgrade to Bahamut 1.4.27 or later,
|
||||
while networks using UnrealIRCd must upgrade to Unreal 3.1.1.
|
||||
|
||||
For the full changes, see the Changes file.
|
||||
|
||||
For announcements and discussions about Anope, please visit our
|
||||
web site http://www.anope.org
|
||||
* Removed MySQL Support (pending better implementation)
|
||||
* Re-designed configuration file
|
||||
* Code refresh / rewrite into C++
|
||||
|
||||
|
||||
|
||||
-2509
File diff suppressed because it is too large
Load Diff
+5
-13
@@ -1,7 +1,7 @@
|
||||
Anope -- a set of IRC services for IRC networks
|
||||
-----------------------------------------------
|
||||
|
||||
Anope is 2003-2008 Anope Team <team@anope.org>.
|
||||
Anope is 2003-2009 Anope Team <team@anope.org>.
|
||||
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
|
||||
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
|
||||
|
||||
@@ -73,6 +73,7 @@ Table of Contents
|
||||
Anope credits:
|
||||
|
||||
* Adam Kramer <ribosome@anope.org>
|
||||
* Adam <adam@anope.org>
|
||||
* Alvaro Toledo <atoledo@keldon.org>
|
||||
* Amanda Folson <amanda@anope.org>
|
||||
* Andrew Berquist <vash@anope.org>
|
||||
@@ -87,6 +88,7 @@ Table of Contents
|
||||
* Florian Schulze <certus@anope.org>
|
||||
* Gabriel Acevedo H. <drstein@anope.org>
|
||||
* Jan Milants <viper@anope.org>
|
||||
* Jens Voss <dukepyrolator@anope.org>
|
||||
* JH <jh@irc-chat.net>
|
||||
* Joris Vink <joris@anope.org>
|
||||
* Lucas Nussbaum <lucas@lucas-nussbaum.net>
|
||||
@@ -191,19 +193,9 @@ Table of Contents
|
||||
Anope currently works with:
|
||||
|
||||
* Bahamut 1.4.27 or later (including 1.8)
|
||||
* Charybdis 1.0 or later
|
||||
* DreamForge 4.6.7
|
||||
* Hybrid 7 or later
|
||||
* InspIRCd 1.0 or later (including 1.1)
|
||||
* Plexus 2.0 or later (including 3.0)
|
||||
* PTlink 6.15 or later
|
||||
* RageIRCd 2.0 beta-6 or later
|
||||
* InspIRCd 1.1 or later (including 1.2)
|
||||
* Ratbox 2.0.6 or later
|
||||
* ShadowIRCd 4.0 beta 7 or later
|
||||
* Solid IRCd 3.4.6 or later
|
||||
* UltimateIRCd 2.8.2 or later (including 3.0)
|
||||
* UnrealIRCd 3.1.1 or later (including 3.2)
|
||||
* ViagraIRCd 1.3 or later
|
||||
* UnrealIRCd 3.2 or later
|
||||
|
||||
Anope could also work with some of the daemons derived by the ones listed
|
||||
above, but there's no support for them if they work or don't work.
|
||||
|
||||
@@ -0,0 +1,309 @@
|
||||
Troubleshooting Guide for Anope 1.9
|
||||
------------------------------------------------
|
||||
|
||||
NOTE:
|
||||
An updated version of this guide can be found on our wiki:
|
||||
|
||||
http://wiki.anope.org/index.php/Troubleshooting
|
||||
|
||||
Table of Contents
|
||||
-----------------
|
||||
|
||||
1) General
|
||||
1.1) Anope complains in the logfile about being unable to load the default
|
||||
language.
|
||||
1.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
|
||||
1.3) I selected a language other than English, but sometimes Anope sends
|
||||
responses in English instead.
|
||||
1.4) Anope always dies after about five minutes, saying "FATAL ERROR! Can't
|
||||
back up nick.db".
|
||||
1.5) Anope crashed with a segmentation fault.
|
||||
1.6) I've found a bug that's not mentioned here or in the README or BUGS
|
||||
files. What should I do?
|
||||
1.7) My FreeBSD box complains about 'Shared object "nss_dns.so.1" not
|
||||
found'
|
||||
1.8) Anope and long (more then 30 character) nicknames.
|
||||
|
||||
2) Installation / Configuration
|
||||
2.1) When I run "make", I get an error message like "missing separator",
|
||||
"Unassociated shell command", "Unexpected end of line seen", etc.
|
||||
2.2) I get an error like "Makefile.inc not found".
|
||||
2.3) I typed "./services" at the command line, but nothing happened!
|
||||
2.4) Whenever I start Anope, I get a message on my IRC server saying
|
||||
"connection refused" or something similar, and Anope gives an error
|
||||
message from the server saying "Closing Link: ...".
|
||||
2.5) My IRC server is giving me messages like "Connection to
|
||||
services.whatever.net[127.0.0.1] activated" and then "Access denied --
|
||||
no N line". Why?
|
||||
2.6) When I say "/connect services.*", it doesn't work!
|
||||
2.7) Anope starts up okay, but if I try to register a nickname, it comes
|
||||
back with "Sorry, registration failed."
|
||||
2.8) Anope reports (via /stats u or /msg OperServ STATS) a different number
|
||||
of users online than I get from doing /lusers.
|
||||
|
||||
3) BotServ
|
||||
3.1) How do I add bots to BotServ?
|
||||
3.2) Why do kick triggers and fantasy commands fail to work with my Bahamut
|
||||
IRCd?
|
||||
|
||||
4) ChanServ
|
||||
4.1) Anope's channel mode setting doesn't work. I can't set modes with
|
||||
OperServ, and every time ChanServ tries to set a mode, my server
|
||||
reverses the change.
|
||||
4.2) Anope ignored the SET SUCCESSOR setting and deleted a channel when the
|
||||
founder expired.
|
||||
4.3) How to auto voice all those whom join my #channel?
|
||||
4.4) Channel options like RESTRICTED or SECUREOPS don't work. What's wrong?
|
||||
|
||||
5) OperServ
|
||||
5.1) Using the OperServ JUPE command results in server messages like
|
||||
"Server juped.server introduced by non-hub server services.my.net".
|
||||
5.2) When I add an AKILL, the users matching it don't get killed.
|
||||
5.3) Trying to use OperServ gives me "Access denied".
|
||||
5.4) I can't get /OS UMODES and /OS SVSNICK to work!
|
||||
5.5) What is a Super-Admin? How does it work? Why might it not work?
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
1) General
|
||||
|
||||
1.1) Anope complains in the logfile about being unable to load the default
|
||||
language.
|
||||
|
||||
You forgot to run "make install".
|
||||
|
||||
1.2) Anope spricht kein Deutsch!, etc. (Anope doesn't speak my language!)
|
||||
|
||||
See section 5 of the README file.
|
||||
|
||||
1.3) I selected a language other than English, but sometimes Anope sends
|
||||
responses in English instead.
|
||||
|
||||
Some language files are not complete--in other words, they only have a
|
||||
translation of some of the message Anope uses. In this case, the
|
||||
missing messages will be displayed in English. You can either wait for
|
||||
the primary translator to provide us with a translation, or do the
|
||||
translation yourself and send us the messages translated into your
|
||||
language.
|
||||
|
||||
1.4) Anope always dies after about five minutes, saying "FATAL ERROR! Can't
|
||||
back up nick.db".
|
||||
|
||||
Make sure that the user Anope runs as has write access to the data
|
||||
directory, and that the data directory actually exists (the latter
|
||||
shouldn't be a problem if you ran the Config script). This means Anope
|
||||
needs write and execute permission on the data directory itself and execute
|
||||
permission on every parent directory of the data directory.
|
||||
|
||||
1.5) Anope crashed with a segmentation fault.
|
||||
|
||||
See if you can reproduce this by doing a certain sequence of things. If
|
||||
so, please report it to us (see part 6 of README file). If not, you're
|
||||
probably out of luck; if you like, you can report it to us anyway, but
|
||||
chances are it won't get fixed if we don't have instructions on reproducing
|
||||
it. If you do have such a problem, you may find the crontab utility useful
|
||||
for dealing with it.
|
||||
|
||||
Also, see the DumpCore directive in the configuration file. It allows Anope
|
||||
to dump its core whenever it's segfaulting, usually calling it core and
|
||||
placing it into Anope's main directory. Open up gdb by issuing the
|
||||
following command at your shell:
|
||||
|
||||
* gdb services core
|
||||
|
||||
(of course replacing 'core' with the name of the core if different) and
|
||||
type 'bt' at the gdb prompt. After that, send us the output you got and
|
||||
keep the core file in a safe place, in case we need it to dig deeper into
|
||||
the problem.
|
||||
|
||||
1.6) I've found a bug that's not mentioned here or in the README or BUGS files.
|
||||
What should I do?
|
||||
|
||||
See section 6 of the README file.
|
||||
|
||||
1.7) My FreeBSD box complains about 'Shared object "nss_dns.so.1" not found'
|
||||
|
||||
We haven't figured out the exact cause yet, but as a quickfix you can
|
||||
delete the /etc/nsswitch.conf file. Please keep in mind that removing a
|
||||
configuration file can be dangerous, so only do this if you know what you
|
||||
are doing.
|
||||
|
||||
1.8) Anope and long (more then 30 character) nicknames.
|
||||
|
||||
By default, Anope only supports nicknames up to 30 characters (NICKLEN=30).
|
||||
If your IRCd allows for longer nicknames or has been modified to do so
|
||||
Anope will start logging a lot of ("NICK from nonexistent nick") messages.
|
||||
This is because once a user uses a nick that is too long for Anope to handle,
|
||||
Anope loses track of the user for the remainder of the session.
|
||||
It is POSSIBLE but not NOT RECOMMENDED to extend the maximum length of nicknames
|
||||
Anope can track, however this will also break database compatibility. DBs saved
|
||||
with Anope set to allow for example 40 chars cannot be read by a clean Anope
|
||||
installation and vice versa. So changing the maximum nick length is only possible
|
||||
when starting with fresh databases and even then the consequences of this are
|
||||
UNTESTED.
|
||||
In order to change the maximum internal nick length, change the NICKMAX setting
|
||||
in include/config.h, recompile anope and start without databases.
|
||||
|
||||
|
||||
2) Installation / Configuration
|
||||
|
||||
2.1) When I run "make", I get an error message like "missing separator",
|
||||
"Unassociated shell command", "Unexpected end of line seen", etc.
|
||||
|
||||
Your make program isn't compatible with the Makefile for Anope. The
|
||||
Makefile was designed to work with GNU make, and as such may not work on
|
||||
other systems' "make" programs. If you get an error from "make", obtain
|
||||
GNU make from ftp://prep.ai.mit.edu/pub/gnu/make/ (or wherever you prefer) and
|
||||
use it instead of your system's default "make". Note that GNU make may
|
||||
already be installed on your system; try using the command "gmake" instead
|
||||
of "make".
|
||||
|
||||
The make programs bundled with SunOS/Solaris and FreeBSD have been reported
|
||||
not to work; you will need to use GNU make on these systems.
|
||||
|
||||
2.2) I get an error like "Makefile.inc not found".
|
||||
|
||||
You forgot to run the Config script first. See the INSTALL file for
|
||||
compilation instructions.
|
||||
|
||||
2.3) I typed "./services" at the command line, but nothing happened!
|
||||
|
||||
Anope puts itself in the background when it starts, so you get your shell
|
||||
prompt right back. Meanwhile, Anope will continue setting up, then connect
|
||||
to the IRC server specified in services.conf (or on the command line). If
|
||||
it doesn't connect, you probably specified the wrong IRCd or RemoteServer in
|
||||
the configuration file. Check to make sure that you are actually running one of
|
||||
the supported IRCds, also. A list of supported IRCds can be found in the README
|
||||
file.
|
||||
|
||||
You can also check the log file (services.log by default) for error
|
||||
messages. Starting services with the -support command line option
|
||||
will prevent it from running in the background will output the
|
||||
messages written to the log file to the console as well. Please note that this
|
||||
will also prevent 3rd party modules from loading and will put Anope into
|
||||
debug mode.
|
||||
|
||||
2.4) Whenever I start Anope, I get a message on my IRC server saying
|
||||
"connection refused" or something similar, and Anope gives an error
|
||||
message from the server saying "Closing Link: ...".
|
||||
|
||||
See section 3 of the INSTALL file.
|
||||
|
||||
2.5) My IRC server is giving me messages like "Connection to
|
||||
services.whatever.net[127.0.0.1] activated" and then "Access denied -- no
|
||||
N line". Why?
|
||||
|
||||
This is typically caused by including a port number in the C:line for
|
||||
services, which tells your server to try to autoconnect to it (depending on
|
||||
the class (Y:line) settings). This is not what you want, because Anope
|
||||
will connect to the server itself, but does not listen for servers to
|
||||
connect to it. The solution is to remove the port number from the C:line.
|
||||
|
||||
2.6) When I say "/connect services.*", it doesn't work!
|
||||
|
||||
You cannot /connect services. When you start Anope, it will attempt to
|
||||
connect to the server you specified in services.conf. Please see the answer
|
||||
above for more information.
|
||||
|
||||
2.7) Anope starts up okay, but if I try to register a nickname, it comes back
|
||||
with "Sorry, registration failed."
|
||||
|
||||
Make sure you've selected the correct IRC server type in the configure
|
||||
script; see section 3 of the INSTALL file for details.
|
||||
|
||||
2.8) Anope reports (via /stats u or /msg OperServ STATS) a different number of
|
||||
users online than I get from doing /lusers.
|
||||
|
||||
Anope doesn't count its own pseudo-clients (NickServ, ChanServ, etc.) in
|
||||
its user count, while the IRC server does.
|
||||
|
||||
3) BotServ
|
||||
|
||||
3.1) How do I add bots to BotServ?
|
||||
|
||||
Read /msg BotServ HELP and /msg BotServ HELP BOT. Note that you need to be
|
||||
opered up and identified as a Services Administrator in Anope before you
|
||||
can use the BOT command.
|
||||
|
||||
3.2) Why do kick triggers and fantasy commands fail to work with my Bahamut
|
||||
IRCd?
|
||||
|
||||
Bahamut allows you to setup a server as 'serviceshub'. This will filter
|
||||
certain data that services usually don't need to process. This option also
|
||||
filters channel messages, because DALnet's services have no use for them.
|
||||
Anope parses the channel messages for kick triggers and fantasy commands.
|
||||
To make sure these work the server type of the hub they're linked to should
|
||||
be simply 'hub' and not 'serviceshub'.
|
||||
|
||||
|
||||
4) ChanServ
|
||||
|
||||
4.1) Anope's channel mode setting doesn't work. I can't set modes with
|
||||
OperServ, and every time ChanServ tries to set a mode, my server reverses
|
||||
the change.
|
||||
|
||||
Make sure EVERY server on your network has a U: line for Services in
|
||||
ircd.conf, for example:
|
||||
|
||||
U:services.whatever.net:*:*
|
||||
|
||||
4.2) Anope ignored the SET SUCCESSOR setting and deleted a channel when the
|
||||
founder expired.
|
||||
|
||||
Normally, this is because the successor had too many channels registered.
|
||||
In this case, you will see an entry in the log file like the following:
|
||||
|
||||
[date] Successor (SuccessorNick) of channel #somechannel owns too many
|
||||
channels, deleting channel #somechannel
|
||||
|
||||
If you don't get a message like this or you can verify that the successor
|
||||
wasn't running into the channel limit, please report it using the
|
||||
bug-reporting procedure in section 6 of the README file.
|
||||
|
||||
4.3) How to auto voice all those whom join my #channel?
|
||||
|
||||
Execute the following commands (/cs is an alias for /msg ChanServ):
|
||||
|
||||
/cs set #channel secure off
|
||||
/cs set #channel xop off
|
||||
/cs levels #channel set AUTOVOICE -1
|
||||
|
||||
4.4) Channel options like RESTRICTED or SECUREOPS don't work. What's wrong?
|
||||
|
||||
Make sure that you didn't put any of your normal IRCd's as a ULined server
|
||||
in Anope. Some access checks for clients from ULined servers are skipped to
|
||||
avoid fights between the ULined servers. This is usually only useful when
|
||||
you have a statistics server connected to your network.
|
||||
|
||||
5) OperServ
|
||||
|
||||
5.1) Using the OperServ JUPE command results in server messages like "Server
|
||||
juped.server introduced by non-hub server services.my.net".
|
||||
|
||||
Services' uplink must have an H: line for Services in the ircd.conf file,
|
||||
which looks something like:
|
||||
|
||||
H:*::services.whatever.net
|
||||
|
||||
5.2) When I add an AKILL, the users matching it don't get killed.
|
||||
|
||||
Use the AkillOnAdd configuration directive.
|
||||
|
||||
5.3) Trying to use OperServ gives me "Access denied".
|
||||
|
||||
Check that you're opered on your IRCd (ie, moded +o)
|
||||
Check that you're identified to a nickname listed within an opertype allowed to do the command you're trying.
|
||||
Check whether you can use /msg operserv staff
|
||||
|
||||
5.4) I can't get /OS UMODES and /OS SVSNICK to work!
|
||||
|
||||
You need to be a SuperAdmin to be able to use these commands.
|
||||
|
||||
5.5) What is a Super-Admin? How does it work? Why might it not work?
|
||||
|
||||
SuperAdmin's have extra privileges, including being founder on all
|
||||
channels. It must be activated on a per user basis and is only available to
|
||||
Services Roots. It is set using OperServ and is not persistent. It only
|
||||
works if SuperAdmin is not commented in the services configuration file,
|
||||
which is commented out by default. Read /msg OperServ HELP SET SUPERADMIN
|
||||
for further help.
|
||||
+1
-1
@@ -10,7 +10,7 @@ services.h: sysconf.h config.h extern.h
|
||||
extern.h: slist.h
|
||||
touch $@
|
||||
|
||||
pseudo.h: commands.h timeout.h encrypt.h datafiles.h slist.h
|
||||
pseudo.h: commands.h timers.h datafiles.h slist.h
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
|
||||
+65
-26
@@ -24,18 +24,10 @@ class NickRequest
|
||||
|
||||
class NickCore;
|
||||
|
||||
class NickAlias
|
||||
class CoreExport NickAlias : public Extensible
|
||||
{
|
||||
public:
|
||||
NickAlias()
|
||||
{
|
||||
next = prev = NULL;
|
||||
nick = last_quit = last_realname = last_usermask = NULL;
|
||||
time_registered = last_seen = 0;
|
||||
status = 0;
|
||||
nc = NULL;
|
||||
u = NULL;
|
||||
}
|
||||
NickAlias();
|
||||
|
||||
NickAlias *next, *prev;
|
||||
char *nick; /* Nickname */
|
||||
@@ -46,41 +38,88 @@ class NickAlias
|
||||
time_t last_seen; /* When it was seen online for the last time */
|
||||
uint16 status; /* See NS_* below */
|
||||
NickCore *nc; /* I'm an alias of this */
|
||||
|
||||
/* Not saved */
|
||||
User *u; /* Current online user that has me */
|
||||
};
|
||||
|
||||
class NickCore : public Extensible
|
||||
class CoreExport NickCore : public Extensible
|
||||
{
|
||||
public:
|
||||
NickCore()
|
||||
{
|
||||
next = prev = NULL;
|
||||
display = email = greet = url = NULL;
|
||||
pass[0] = '\0';
|
||||
icq = flags = 0;
|
||||
language = accesscount = channelcount = 0;
|
||||
lastmail = 0;
|
||||
}
|
||||
NickCore();
|
||||
|
||||
NickCore *next, *prev;
|
||||
|
||||
char *display; /* How the nick is displayed */
|
||||
char pass[PASSMAX]; /* Password of the nicks */
|
||||
char pass[PASSMAX]; /* Password of the nicks */
|
||||
char *email; /* E-mail associated to the nick */
|
||||
char *greet; /* Greet associated to the nick */
|
||||
uint32 icq; /* ICQ # associated to the nick */
|
||||
char *url; /* URL associated to the nick */
|
||||
uint32 flags; /* See NI_* below */
|
||||
uint16 language; /* Language selected by nickname owner (LANG_*) */
|
||||
uint16 accesscount; /* # of entries */
|
||||
char **access; /* Array of strings */
|
||||
std::vector<std::string> access; /* Access list, vector of strings */
|
||||
MemoInfo memos;
|
||||
uint16 channelcount; /* Number of channels currently registered */
|
||||
|
||||
OperType *ot;
|
||||
|
||||
/* Unsaved data */
|
||||
time_t lastmail; /* Last time this nick record got a mail */
|
||||
SList aliases; /* List of aliases */
|
||||
|
||||
/** Check whether this opertype has access to run the given command string.
|
||||
* @param cmdstr The string to check, e.g. botserv/set/private.
|
||||
* @return True if this opertype may run the specified command, false otherwise.
|
||||
*/
|
||||
bool HasCommand(const std::string &cmdstr) const;
|
||||
|
||||
/** Checks whether this account is a services oper or not.
|
||||
* @return True if this account is a services oper, false otherwise.
|
||||
*/
|
||||
bool IsServicesOper() const;
|
||||
|
||||
/** Check whether this opertype has access to the given special permission.
|
||||
* @param privstr The priv to check for, e.g. users/auspex.
|
||||
* @return True if this opertype has the specified priv, false otherwise.
|
||||
*/
|
||||
bool HasPriv(const std::string &privstr) const;
|
||||
|
||||
/** Add an entry to the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to add to the access list
|
||||
*
|
||||
* Adds a new entry into the access list.
|
||||
*/
|
||||
void AddAccess(const std::string &entry);
|
||||
|
||||
/** Get an entry from the nick's access list by index
|
||||
*
|
||||
* @param entry Index in the access list vector to retrieve
|
||||
* @return The access list entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
|
||||
*
|
||||
* Retrieves an entry from the access list corresponding to the given index.
|
||||
*/
|
||||
std::string GetAccess(unsigned entry);
|
||||
|
||||
/** Find an entry in the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to search for
|
||||
* @return True if the entry is found in the access list, false otherwise
|
||||
*
|
||||
* Search for an entry within the access list.
|
||||
*/
|
||||
bool FindAccess(const std::string &entry);
|
||||
|
||||
/** Erase an entry from the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to remove
|
||||
*
|
||||
* Removes the specified access list entry from the access list.
|
||||
*/
|
||||
void EraseAccess(const std::string &entry);
|
||||
|
||||
/** Clears the entire nick's access list
|
||||
*
|
||||
* Deletes all the memory allocated in the access list vector and then clears the vector.
|
||||
*/
|
||||
void ClearAccess();
|
||||
};
|
||||
|
||||
|
||||
+4
-4
@@ -6,9 +6,9 @@
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
extern MDE Command *lookup_cmd(Command *list, char *name);
|
||||
extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
|
||||
extern MDE void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
|
||||
extern MDE void do_help_limited(char *service, User * u, Command * c);
|
||||
//extern MDE void do_help_limited(char *service, User * u, Command * c);
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
@@ -61,6 +61,8 @@ class ValueItem
|
||||
ValueItem(const char *);
|
||||
/** Initialize with an std::string */
|
||||
ValueItem(const std::string &);
|
||||
/** Initialize with a long */
|
||||
ValueItem(long);
|
||||
/** Change value to a char pointer */
|
||||
//void Set(char *);
|
||||
/** Change value to a const char pointer */
|
||||
@@ -72,7 +74,9 @@ class ValueItem
|
||||
/** Get value as an int */
|
||||
int GetInteger();
|
||||
/** Get value as a string */
|
||||
char *GetString();
|
||||
const char *GetString() const;
|
||||
/** Get value as a string */
|
||||
inline const std::string &GetValue() const { return v; }
|
||||
/** Get value as a bool */
|
||||
bool GetBool();
|
||||
};
|
||||
@@ -435,7 +439,7 @@ class CoreExport ConfigReader
|
||||
/** Overloaded constructor.
|
||||
* This constructor initialises the ConfigReader class to read a user-specified config file
|
||||
*/
|
||||
ConfigReader(const std::string &);
|
||||
ConfigReader(const std::string &);
|
||||
/** Default destructor.
|
||||
* This method destroys the ConfigReader class.
|
||||
*/
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/* Include file for high-level encryption routines.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct encryption_ {
|
||||
int (*encrypt)(const char *src, int len, char *dest, int size);
|
||||
int (*encrypt_in_place)(char *buf, int size);
|
||||
int (*encrypt_check_len)(int passlen, int bufsize);
|
||||
int (*decrypt)(const char *src, char *dest, int size);
|
||||
int (*check_password)(const char *plaintext, const char *password);
|
||||
} Encryption;
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/* Prototypes and external variable declarations.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#define EVENT_START "start"
|
||||
#define EVENT_STOP "stop"
|
||||
|
||||
#define EVENT_DB_SAVING "db_saving"
|
||||
#define EVENT_DB_BACKUP "db_backup"
|
||||
#define EVENT_NEWNICK "newnick"
|
||||
#define EVENT_BOT_UNASSIGN "bot_unassign"
|
||||
#define EVENT_BOT_JOIN "bot_join"
|
||||
#define EVENT_BOT_CREATE "bot_create"
|
||||
#define EVENT_BOT_CHANGE "bot_change"
|
||||
#define EVENT_BOT_FANTASY "bot_command"
|
||||
#define EVENT_BOT_FANTASY_NO_ACCESS "bot_command_no_access"
|
||||
#define EVENT_BOT_DEL "bot_del"
|
||||
#define EVENT_BOT_ASSIGN "bot_assign"
|
||||
#define EVENT_BOT_KICK "bot_kick"
|
||||
#define EVENT_BOT_BAN "bot_ban"
|
||||
#define EVENT_TOPIC_UPDATED "chan_topic_updated"
|
||||
#define EVENT_CHAN_EXPIRE "chan_expire"
|
||||
#define EVENT_CHAN_REGISTERED "chan_registered"
|
||||
#define EVENT_CHAN_DROP "chan_dropped"
|
||||
#define EVENT_CHAN_FORBIDDEN "chan_forbidden"
|
||||
#define EVENT_CHAN_SUSPENDED "chan_suspended"
|
||||
#define EVENT_CHAN_UNSUSPEND "chan_unsuspend"
|
||||
#define EVENT_CONNECT "connect"
|
||||
#define EVENT_DB_EXPIRE "db_expire"
|
||||
#define EVENT_RESTART "restart"
|
||||
#define EVENT_RELOAD "reload"
|
||||
#define EVENT_SHUTDOWN "shutdown"
|
||||
#define EVENT_SIGNAL "signal"
|
||||
#define EVENT_NICK_REGISTERED "nick_registered"
|
||||
#define EVENT_NICK_DROPPED "nick_dropped"
|
||||
#define EVENT_NICK_FORBIDDEN "nick_forbidden"
|
||||
#define EVENT_NICK_EXPIRE "nick_expire"
|
||||
#define EVENT_CHANGE_NICK "change_nick"
|
||||
#define EVENT_USER_LOGOFF "user_logoff"
|
||||
#define EVENT_GROUP "nick_group"
|
||||
#define EVENT_NICK_IDENTIFY "nick_id"
|
||||
#define EVENT_SERVER_SQUIT "server_squit"
|
||||
#define EVENT_SERVER_CONNECT "server_connect"
|
||||
#define EVENT_DEFCON_LEVEL "defcon_level"
|
||||
#define EVENT_NICK_SUSPENDED "nick_suspended"
|
||||
#define EVENT_NICK_UNSUSPEND "nick_unsuspend"
|
||||
#define EVENT_JOIN_CHANNEL "join_channel"
|
||||
#define EVENT_PART_CHANNEL "part_channel"
|
||||
#define EVENT_ACCESS_ADD "access_add"
|
||||
#define EVENT_ACCESS_CHANGE "access_change"
|
||||
#define EVENT_ACCESS_DEL "access_del"
|
||||
#define EVENT_ACCESS_CLEAR "access_clear"
|
||||
#define EVENT_NICK_LOGOUT "nick_logout"
|
||||
#define EVENT_CHAN_KICK "chan_kick"
|
||||
+44
-120
@@ -137,10 +137,10 @@ E Entry *entry_create(char *mask);
|
||||
E Entry *entry_add(EList *list, const char *mask);
|
||||
E void entry_delete(EList *list, Entry *e);
|
||||
E EList *list_create();
|
||||
E int entry_match(Entry *e, char *nick, char *user, char *host, uint32 ip);
|
||||
E int entry_match_mask(Entry *e, char *mask, uint32 ip);
|
||||
E Entry *elist_match(EList *list, char *nick, char *user, char *host, uint32 ip);
|
||||
E Entry *elist_match_mask(EList *list, char *mask, uint32 ip);
|
||||
E int entry_match(Entry *e, const char *nick, const char *user, const char *host, uint32 ip);
|
||||
E int entry_match_mask(Entry *e, const char *mask, uint32 ip);
|
||||
E Entry *elist_match(EList *list, const char *nick, const char *user, const char *host, uint32 ip);
|
||||
E Entry *elist_match_mask(EList *list, const char *mask, uint32 ip);
|
||||
E Entry *elist_match_user(EList *list, User *u);
|
||||
E Entry *elist_find_mask(EList *list, const char *mask);
|
||||
E long get_memuse(EList *list);
|
||||
@@ -185,7 +185,6 @@ E ChannelInfo *cs_findchan(const char *chan);
|
||||
E int check_access(User * user, ChannelInfo * ci, int what);
|
||||
E int is_founder(User * user, ChannelInfo * ci);
|
||||
E int get_access(User * user, ChannelInfo * ci);
|
||||
E ChanAccess *get_access_entry(NickCore * nc, ChannelInfo * ci);
|
||||
E void update_cs_lastseen(User * user, ChannelInfo * ci);
|
||||
E int get_idealban(ChannelInfo * ci, User * u, char *ret, int retlen);
|
||||
E AutoKick *is_stuck(ChannelInfo * ci, const char *mask);
|
||||
@@ -237,14 +236,12 @@ E char *s_NickServ;
|
||||
E char *s_ChanServ;
|
||||
E char *s_MemoServ;
|
||||
E char *s_BotServ;
|
||||
E char *s_HelpServ;
|
||||
E char *s_OperServ;
|
||||
E char *s_GlobalNoticer;
|
||||
E char *desc_NickServ;
|
||||
E char *desc_ChanServ;
|
||||
E char *desc_MemoServ;
|
||||
E char *desc_BotServ;
|
||||
E char *desc_HelpServ;
|
||||
E char *desc_OperServ;
|
||||
E char *desc_GlobalNoticer;
|
||||
|
||||
@@ -254,7 +251,7 @@ E char *s_HostServ;
|
||||
E void load_hs_dbase();
|
||||
E void save_hs_dbase();
|
||||
E int do_on_id(User * u);
|
||||
E void delHostCore(char *nick);
|
||||
E void delHostCore(const char *nick);
|
||||
E void hostserv(User * u, char *buf);
|
||||
|
||||
E char *PIDFilename;
|
||||
@@ -287,9 +284,6 @@ E bool RestrictOperNicks;
|
||||
E unsigned NewsCount;
|
||||
E char *Numeric;
|
||||
|
||||
E char **HostSetters;
|
||||
E int HostNumber;
|
||||
|
||||
E bool UseMail;
|
||||
E char *SendMailPath;
|
||||
E char *SendFrom;
|
||||
@@ -318,8 +312,6 @@ E bool NSSecureAdmins;
|
||||
E bool NSStrictPrivileges;
|
||||
E bool NSEmailReg;
|
||||
E bool NSModeOnID;
|
||||
E bool NSRestrictGetPass;
|
||||
E bool NSNickTracking;
|
||||
E bool NSAddAccessOnReg;
|
||||
|
||||
E int CSDefFlags;
|
||||
@@ -354,8 +346,6 @@ E bool GlobalOnCycle;
|
||||
E bool AnonymousGlobal;
|
||||
E char *GlobalOnCycleMessage;
|
||||
E char *GlobalOnCycleUP;
|
||||
E char **ServicesRoots;
|
||||
E int RootNumber;
|
||||
E bool LogMaxUsers;
|
||||
E bool SuperAdmin;
|
||||
E bool LogBot;
|
||||
@@ -367,7 +357,6 @@ E time_t SZLineExpiry;
|
||||
E bool AkillOnAdd;
|
||||
E bool KillonSGline;
|
||||
E bool KillonSQline;
|
||||
E bool DisableRaw;
|
||||
E bool WallOper;
|
||||
E bool WallBadOS;
|
||||
E bool WallOSGlobal;
|
||||
@@ -380,7 +369,6 @@ E bool WallOSSQLine;
|
||||
E bool WallOSSZLine;
|
||||
E bool WallOSNoOp;
|
||||
E bool WallOSJupe;
|
||||
E bool WallOSRaw;
|
||||
E bool WallAkillExpire;
|
||||
E bool WallSGLineExpire;
|
||||
E bool WallSQLineExpire;
|
||||
@@ -403,9 +391,6 @@ E int ModulesDelayedNumber;
|
||||
E char **HostServCoreModules;
|
||||
E int HostServCoreNumber;
|
||||
|
||||
E char **HelpServCoreModules;
|
||||
E int HelpServCoreNumber;
|
||||
|
||||
E char **MemoServCoreModules;
|
||||
E int MemoServCoreNumber;
|
||||
|
||||
@@ -471,22 +456,16 @@ E void encmodule_encrypt_check_len(int (*func)(int passlen, int bufsize));
|
||||
E void encmodule_decrypt(int (*func)(const char *src, char *dest, int size));
|
||||
E void encmodule_check_password(int (*func)(const char *plaintext, const char *password));
|
||||
|
||||
/**** helpserv.c ****/
|
||||
E void helpserv(User * u, char *buf);
|
||||
E void helpserv_init();
|
||||
|
||||
/**** hostserv.c ****/
|
||||
E void get_hostserv_stats(long *nrec, long *memuse);
|
||||
E void hostserv_init();
|
||||
E void addHostCore(char *nick, char *vIdent, char *vhost, const char *creator, int32 tmp_time);
|
||||
E void addHostCore(const char *nick, char *vIdent, char *vhost, const char *creator, int32 tmp_time);
|
||||
E char *getvIdent(char *nick);
|
||||
E char *getvHost(char *nick);
|
||||
E int is_host_remover(User * u);
|
||||
E int is_host_setter(User *u);
|
||||
E HostCore *hostCoreListHead();
|
||||
E HostCore *findHostCore(HostCore * head, char *nick, bool *found);
|
||||
E HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent, char *vHost, const char *creator, int32 tmp_time);
|
||||
E HostCore *insertHostCore(HostCore * head, HostCore * prev, char *nick, char *vIdent, char *vHost, const char *creator, int32 tmp_time);
|
||||
E HostCore *findHostCore(HostCore * head, const char *nick, bool *found);
|
||||
E HostCore *createHostCorelist(HostCore * next, const char *nick, char *vIdent, char *vHost, const char *creator, int32 tmp_time);
|
||||
E HostCore *insertHostCore(HostCore * head, HostCore * prev, const char *nick, char *vIdent, char *vHost, const char *creator, int32 tmp_time);
|
||||
E HostCore *deleteHostCore(HostCore * head, HostCore * prev);
|
||||
E void set_lastmask(User * u);
|
||||
|
||||
@@ -533,14 +512,12 @@ E char *langnames[NUM_LANGS];
|
||||
E int langlist[NUM_LANGS];
|
||||
|
||||
E void lang_init();
|
||||
#define getstring(na,index) \
|
||||
(langtexts[((na) && (static_cast<NickAlias *>(na))->nc && !((static_cast<NickAlias *>(na))->status & NS_VERBOTEN) ? (static_cast<NickAlias *>(na))->nc->language : NSDefLanguage)][(index)])
|
||||
#define getstring2(nc,index) \
|
||||
(langtexts[((nc) ? (static_cast<NickCore *>(nc))->language : NSDefLanguage)][(index)])
|
||||
E int strftime_lang(char *buf, int size, User * u, int format,
|
||||
struct tm *tm);
|
||||
E void syntax_error(char *service, User * u, const char *command,
|
||||
int msgnum);
|
||||
E int strftime_lang(char *buf, int size, User * u, int format, struct tm *tm);
|
||||
E void syntax_error(char *service, User * u, const char *command, int msgnum);
|
||||
E const char *getstring(NickAlias *na, int index);
|
||||
E const char *getstring(NickCore *nc, int index);
|
||||
E const char *getstring(User *nc, int index);
|
||||
E const char *getstring(int index);
|
||||
|
||||
|
||||
/**** log.c ****/
|
||||
@@ -592,7 +569,6 @@ E time_t start_time;
|
||||
|
||||
E void save_databases();
|
||||
E void expire_all();
|
||||
E void do_backtrace(int show_segheader);
|
||||
E void sighandler(int signum);
|
||||
E void do_restart_services();
|
||||
|
||||
@@ -610,7 +586,7 @@ E void ms_init();
|
||||
E void memoserv(User * u, char *buf);
|
||||
E void check_memos(User * u);
|
||||
E MemoInfo *getmemoinfo(const char *name, int *ischan, int *isforbid);
|
||||
E void memo_send(User * u, char *name, char *text, int z);
|
||||
E void memo_send(User * u, const char *name, const char *text, int z);
|
||||
E int delmemo(MemoInfo * mi, int num);
|
||||
|
||||
/**** messages.c ****/
|
||||
@@ -637,15 +613,14 @@ E size_t strlcpy(char *, const char *, size_t);
|
||||
#ifndef HAVE_STRLCAT
|
||||
E size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
E char *stristr(char *s1, char *s2);
|
||||
E const char *stristr(const char *s1, const char *s2);
|
||||
E char *strnrepl(char *s, int32 size, const char *old, const char *nstr);
|
||||
E const char *merge_args(int argc, char **argv);
|
||||
E const char *merge_args(int argc, const char **argv);
|
||||
E int match_wild(const char *pattern, const char *str);
|
||||
E int match_wild_nocase(const char *pattern, const char *str);
|
||||
E int dotime(const char *s);
|
||||
E char *duration(NickAlias * na, char *buf, int bufsize, time_t seconds);
|
||||
E char *expire_left(NickAlias * na, char *buf, int len, time_t expires);
|
||||
|
||||
E time_t dotime(const char *s);
|
||||
E const char *duration(NickCore *nc, char *buf, int bufsize, time_t seconds);
|
||||
E const char *expire_left(NickCore *nc, char *buf, int len, time_t expires);
|
||||
E int doValidHost(const char *host, int type);
|
||||
|
||||
typedef int (*range_callback_t) (User * u, int num, va_list args);
|
||||
@@ -691,12 +666,16 @@ E int str_is_cidr(char *str, uint32 * ip, uint32 * mask, char **host);
|
||||
|
||||
|
||||
/**** modules.c ****/
|
||||
E void modules_unload_all(bool fini, bool unload_proto); /* Read warnings near function source */
|
||||
E void modules_unload_all(bool unload_proto); /* Read warnings near function source */
|
||||
E void ModuleDatabaseBackup(const char *dbname);
|
||||
E void ModuleRemoveBackups(const char *dbname);
|
||||
|
||||
/**** news.c ****/
|
||||
|
||||
/* Add news items. */
|
||||
E int add_newsitem(User * u, const char *text, int16 type);
|
||||
/* Delete news items. */
|
||||
E int del_newsitem(int num, int16 type);
|
||||
E int32 nnews, news_size;
|
||||
E NewsItem *news;
|
||||
E void get_news_stats(long *nrec, long *memuse);
|
||||
@@ -722,7 +701,8 @@ E void get_aliases_stats(long *nrec, long *memuse);
|
||||
E void get_core_stats(long *nrec, long *memuse);
|
||||
E void collide(NickAlias * na, int from_timeout);
|
||||
E void del_ns_timeout(NickAlias * na, int type);
|
||||
E void change_core_display(NickCore * nc, char *newdisplay);
|
||||
E void change_core_display(NickCore * nc);
|
||||
E void change_core_display(NickCore * nc, const char *newdisplay);
|
||||
E void release(NickAlias * na, int from_timeout);
|
||||
E int do_setmodes(User * u);
|
||||
E int should_mode_change(int16 status, int16 mode);
|
||||
@@ -736,7 +716,6 @@ E void save_ns_req_dbase();
|
||||
E int validate_user(User * u);
|
||||
E void cancel_user(User * u);
|
||||
E int nick_identified(User * u);
|
||||
E int nick_recognized(User * u);
|
||||
E void expire_nicks();
|
||||
E void expire_requests();
|
||||
EI int ns_do_register(User * u);
|
||||
@@ -744,19 +723,16 @@ E int delnick(NickAlias * na);
|
||||
E NickAlias *findnick(const char *nick);
|
||||
E NickAlias *findnick(const std::string &nick);
|
||||
E NickCore *findcore(const char *nick);
|
||||
E void clean_ns_timeouts(NickAlias * na);
|
||||
E void nsStartNickTracking(User * u);
|
||||
E void nsStopNickTracking(User * u);
|
||||
E int nsCheckNickTracking(User *u);
|
||||
E bool is_on_access(User *u, NickCore *nc);
|
||||
|
||||
E int group_identified(User * u, NickCore * nc);
|
||||
E int is_on_access(User * u, NickCore * nc);
|
||||
/** Set the correct oper type for a nickcore
|
||||
* @param nc The nick core
|
||||
*/
|
||||
E void SetOperType(NickCore *nc);
|
||||
|
||||
/**** operserv.c ****/
|
||||
|
||||
E SList akills, sglines, sqlines, szlines;
|
||||
E SList servadmins;
|
||||
E SList servopers;
|
||||
|
||||
E int DefConModesSet;
|
||||
E uint32 DefConModesOn;
|
||||
@@ -768,30 +744,22 @@ E void os_init();
|
||||
E void load_os_dbase();
|
||||
E void save_os_dbase();
|
||||
|
||||
E void os_remove_nick(NickCore *nc);
|
||||
E int is_services_root(User *u);
|
||||
E int is_services_admin(User *u);
|
||||
E int is_services_oper(User *u);
|
||||
E int nick_is_services_root(NickCore * nc);
|
||||
E int nick_is_services_admin(NickCore *nc);
|
||||
E int nick_is_services_oper(NickCore *nc);
|
||||
|
||||
E int add_akill(User *u, char *mask, const char *by, const time_t expires, const char *reason);
|
||||
E int add_akill(User *u, const char *mask, const char *by, const time_t expires, const char *reason);
|
||||
E int check_akill(const char *nick, const char *username, const char *host, const char *vhost, const char *ip);
|
||||
E void expire_akills();
|
||||
E void oper_global(char *nick, const char *fmt, ...);
|
||||
|
||||
E int add_sgline(User *u, char *mask, const char *by, const time_t expires, const char *reason);
|
||||
E int add_sgline(User *u, const char *mask, const char *by, time_t expires, const char *reason);
|
||||
E int check_sgline(const char *nick, const char *realname);
|
||||
E void expire_sglines();
|
||||
|
||||
E int add_sqline(User *u, char *mask, const char *by, const time_t expires, const char *reason);
|
||||
E int add_sqline(User *u, const char *mask, const char *by, time_t expires, const char *reason);
|
||||
E int check_sqline(const char *nick, int nick_change);
|
||||
E void expire_sqlines();
|
||||
E int check_chan_sqline(const char *chan);
|
||||
|
||||
E int add_szline(User * u, char *mask, const char *by,
|
||||
const time_t expires, const char *reason);
|
||||
E int add_szline(User * u, const char *mask, const char *by,
|
||||
time_t expires, const char *reason);
|
||||
E void expire_szlines();
|
||||
E int check_szline(const char *nick, char *ip);
|
||||
|
||||
@@ -822,8 +790,6 @@ E void send_cmd(const std::string &source, const char *fmt, ...) FORMAT(printf,2
|
||||
|
||||
E void notice_server(char *source, Server * s, const char *fmt, ...)
|
||||
FORMAT(printf,3,4);
|
||||
E void notice_user(char *source, User *u, const char *fmt, ...)
|
||||
FORMAT(printf,3,4);
|
||||
|
||||
E void notice_list(const char *source, const char *dest, char **text); // MARK_DEPRECATED;
|
||||
E void notice_lang(const char *source, User *dest, int message, ...); // MARK_DEPRECATED;
|
||||
@@ -860,6 +826,8 @@ E void ts6_uid_init();
|
||||
E void ts6_uid_increment(unsigned int slot);
|
||||
E const char *ts6_uid_retrieve();
|
||||
|
||||
E const char *ts6_sid_retrieve();
|
||||
|
||||
/**** sessions.c ****/
|
||||
|
||||
E Exception *exceptions;
|
||||
@@ -892,8 +860,8 @@ E int exception_add(User * u, const char *mask, const int limit,
|
||||
E int slist_add(SList *slist, void *item);
|
||||
E void slist_clear(SList *slist, int free);
|
||||
E int slist_delete(SList *slist, int index);
|
||||
E int slist_delete_range(SList *slist, char *range, slist_delcheckcb_t cb, ...);
|
||||
E int slist_enum(SList *slist, char *range, slist_enumcb_t cb, ...);
|
||||
E int slist_delete_range(SList *slist, const char *range, slist_delcheckcb_t cb, ...);
|
||||
E int slist_enum(SList *slist, const char *range, slist_enumcb_t cb, ...);
|
||||
E int slist_full(SList *slist);
|
||||
E int slist_indexof(SList *slist, void *item);
|
||||
E void slist_init(SList *slist);
|
||||
@@ -936,13 +904,10 @@ E Server *findserver_uid(Server * s, const char *name);
|
||||
E char *TS6SID;
|
||||
E char *TS6UPLINK;
|
||||
|
||||
E void update_host(User * user);
|
||||
|
||||
E User *do_nick(const char *source, const char *nick, const char *username, const char *host,
|
||||
const char *server, const char *realname, time_t ts, uint32 svid, uint32 ip, const char *vhost, const char *uid);
|
||||
const char *server, const char *realname, time_t ts, uint32 ip, const char *vhost, const char *uid);
|
||||
|
||||
E void do_umode(const char *source, int ac, const char **av);
|
||||
E void do_umode2(const char *source, int ac, const char **av);
|
||||
E void do_quit(const char *source, int ac, const char **av);
|
||||
E void do_kill(const char *source, const char *reason);
|
||||
|
||||
@@ -950,54 +915,14 @@ E int is_oper(User * user);
|
||||
E int is_protected(User * user);
|
||||
|
||||
E int is_excepted(ChannelInfo * ci, User * user);
|
||||
E int is_excepted_mask(ChannelInfo * ci, char *mask);
|
||||
E int is_excepted_mask(ChannelInfo * ci, const char *mask);
|
||||
|
||||
E int match_usermask(const char *mask, User * user);
|
||||
E int match_userip(const char *mask, User * user, char *host);
|
||||
E void split_usermask(const char *mask, char **nick, char **user,
|
||||
char **host);
|
||||
E char *create_mask(User * u);
|
||||
|
||||
#ifdef USE_MYSQL
|
||||
/**** mysql.c ****/
|
||||
E MYSQL *mysql;
|
||||
E MYSQL_RES *mysql_res;
|
||||
E MYSQL_FIELD *mysql_fields;
|
||||
E MYSQL_ROW mysql_row;
|
||||
|
||||
E int db_mysql_init();
|
||||
E int db_mysql_open();
|
||||
E int db_mysql_close();
|
||||
E int db_mysql_query(char *sql);
|
||||
E char *db_mysql_quote(char *sql);
|
||||
E char *db_mysql_quote_buffer(char *sql, int size);
|
||||
E int db_mysql_try(const char *fmt, ...);
|
||||
E int db_mysql_save_ns_core(NickCore * nc);
|
||||
E int db_mysql_save_ns_alias(NickAlias * na);
|
||||
E int db_mysql_save_ns_req(NickRequest * nr);
|
||||
E int db_mysql_save_cs_info(ChannelInfo * ci);
|
||||
E int db_mysql_save_os_db(unsigned int maxucnt, unsigned int maxutime,
|
||||
SList * ak, SList * sgl, SList * sql,
|
||||
SList * szl);
|
||||
E int db_mysql_save_news(NewsItem * ni);
|
||||
E int db_mysql_save_exceptions(Exception * e);
|
||||
E int db_mysql_save_hs_core(HostCore * hc);
|
||||
E int db_mysql_save_bs_core(BotInfo * bi);
|
||||
E int db_mysql_load_bs_dbase();
|
||||
E int db_mysql_load_hs_dbase();
|
||||
E int db_mysql_load_ns_dbase();
|
||||
E int db_mysql_load_ns_req_dbase();
|
||||
E int db_mysql_load_cs_dbase();
|
||||
E int db_mysql_load_os_dbase();
|
||||
E int db_mysql_load_exceptions();
|
||||
E int db_mysql_load_news();
|
||||
E unsigned int mysql_rand();
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
E char *common_get_vident(User *u);
|
||||
E char *common_get_vhost(User *u);
|
||||
E const char* base64enc(long i);
|
||||
E long base64dec(char *b64);
|
||||
E long base64dects(const char *ts);
|
||||
@@ -1009,7 +934,6 @@ E int decode_ip(const char *buf);
|
||||
E char *host_resolve(char *host);
|
||||
|
||||
E void event_process_hook(const char *name, int argc, char **argv);
|
||||
E void send_event(const char *name, int argc, ...);
|
||||
|
||||
#ifdef _WIN32
|
||||
E char *GetWindowsVersion() ;
|
||||
|
||||
+388
-3
@@ -16,12 +16,397 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
/*******************************************************
|
||||
* This file contains classes and templates that deal
|
||||
* with the comparison and hashing of 'irc strings'.
|
||||
* An 'irc string' is a string which compares in a
|
||||
* case insensitive manner, and as per RFC 1459 will
|
||||
* treat [ identical to {, ] identical to }, and \
|
||||
* as identical to |.
|
||||
*
|
||||
* Our hashing functions are designed to accept
|
||||
* std::string and compare/hash them as type irc::string
|
||||
* by converting them internally. This makes them
|
||||
* backwards compatible with other code which is not
|
||||
* aware of irc::string.
|
||||
*******************************************************/
|
||||
|
||||
#ifndef LOWERMAP
|
||||
#define LOWERMAP
|
||||
|
||||
/** A mapping of uppercase to lowercase, including scandinavian
|
||||
* 'oddities' as specified by RFC1459, e.g. { -> [, and | -> \
|
||||
*/
|
||||
unsigned const char rfc_case_insensitive_map[256] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */
|
||||
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */
|
||||
60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */
|
||||
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 94, 95, 96, 97, 98, 99, /* 80-99 */
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */
|
||||
120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */
|
||||
140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */
|
||||
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */
|
||||
180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */
|
||||
200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */
|
||||
220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */
|
||||
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */
|
||||
};
|
||||
|
||||
/** Case insensitive map, ASCII rules.
|
||||
* That is;
|
||||
* [ != {, but A == a.
|
||||
*/
|
||||
unsigned const char ascii_case_insensitive_map[256] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 0-19 */
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, /* 20-39 */
|
||||
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, /* 40-59 */
|
||||
60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, /* 60-79 */
|
||||
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, /* 80-99 */
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, /* 100-119 */
|
||||
120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, /* 120-139 */
|
||||
140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, /* 140-159 */
|
||||
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, /* 160-179 */
|
||||
180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, /* 180-199 */
|
||||
200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 200-219 */
|
||||
220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 220-239 */
|
||||
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 /* 240-255 */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/** The irc namespace contains a number of helper classes.
|
||||
*/
|
||||
namespace irc
|
||||
{
|
||||
/** The irc_char_traits class is used for RFC-style comparison of strings.
|
||||
* This class is used to implement irc::string, a case-insensitive, RFC-
|
||||
* comparing string class.
|
||||
*/
|
||||
struct irc_char_traits : std::char_traits<char>
|
||||
{
|
||||
/** Check if two chars match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are equal
|
||||
*/
|
||||
static bool eq(char c1st, char c2nd);
|
||||
|
||||
/** Check if two chars do NOT match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are unequal
|
||||
*/
|
||||
static bool ne(char c1st, char c2nd);
|
||||
|
||||
/** Check if one char is less than another.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if c1st is less than c2nd
|
||||
*/
|
||||
static bool lt(char c1st, char c2nd);
|
||||
|
||||
/** Compare two strings of size n.
|
||||
* @param str1 First string
|
||||
* @param str2 Second string
|
||||
* @param n Length to compare to
|
||||
* @return similar to strcmp, zero for equal, less than zero for str1
|
||||
* being less and greater than zero for str1 being greater than str2.
|
||||
*/
|
||||
static CoreExport int compare(const char *str1, const char *str2, size_t n);
|
||||
|
||||
/** Find a char within a string up to position n.
|
||||
* @param s1 String to find in
|
||||
* @param n Position to search up to
|
||||
* @param c Character to search for
|
||||
* @return Pointer to the first occurance of c in s1
|
||||
*/
|
||||
static CoreExport const char *find(const char *s1, int n, char c);
|
||||
};
|
||||
|
||||
/** This typedef declares irc::string based upon irc_char_traits.
|
||||
*/
|
||||
typedef std::basic_string<char, irc_char_traits, std::allocator<char> > string;
|
||||
}
|
||||
|
||||
/** The ci namespace contains a number of helper classes.
|
||||
*/
|
||||
namespace ci
|
||||
{
|
||||
/** The ci_char_traits class is used for ASCII-style comparison of strings.
|
||||
* This class is used to implement ci::string, a case-insensitive, ASCII-
|
||||
* comparing string class.
|
||||
*/
|
||||
struct ci_char_traits : std::char_traits<char>
|
||||
{
|
||||
/** Check if two chars match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are equal
|
||||
*/
|
||||
static bool eq(char c1st, char c2nd);
|
||||
|
||||
/** Check if two chars do NOT match.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if the characters are unequal
|
||||
*/
|
||||
static bool ne(char c1st, char c2nd);
|
||||
|
||||
/** Check if one char is less than another.
|
||||
* @param c1st First character
|
||||
* @param c2nd Second character
|
||||
* @return true if c1st is less than c2nd
|
||||
*/
|
||||
static bool lt(char c1st, char c2nd);
|
||||
|
||||
/** Compare two strings of size n.
|
||||
* @param str1 First string
|
||||
* @param str2 Second string
|
||||
* @param n Length to compare to
|
||||
* @return similar to strcmp, zero for equal, less than zero for str1
|
||||
* being less and greater than zero for str1 being greater than str2.
|
||||
*/
|
||||
static CoreExport int compare(const char *str1, const char *str2, size_t n);
|
||||
|
||||
/** Find a char within a string up to position n.
|
||||
* @param s1 String to find in
|
||||
* @param n Position to search up to
|
||||
* @param c Character to search for
|
||||
* @return Pointer to the first occurance of c in s1
|
||||
*/
|
||||
static CoreExport const char *find(const char *s1, int n, char c);
|
||||
};
|
||||
|
||||
/** This typedef declares ci::string based upon ci_char_traits.
|
||||
*/
|
||||
typedef std::basic_string<char, ci_char_traits, std::allocator<char> > string;
|
||||
}
|
||||
|
||||
/* Define operators for using >> and << with irc::string to an ostream on an istream. */
|
||||
/* This was endless fun. No. Really. */
|
||||
/* It was also the first core change Ommeh made, if anyone cares */
|
||||
|
||||
/** Operator << for irc::string
|
||||
*/
|
||||
inline std::ostream &operator<<(std::ostream &os, const irc::string &str) { return os << str.c_str(); }
|
||||
|
||||
/** Operator >> for irc::string
|
||||
*/
|
||||
inline std::istream &operator>>(std::istream &is, irc::string &str)
|
||||
{
|
||||
std::string tmp;
|
||||
is >> tmp;
|
||||
str = tmp.c_str();
|
||||
return is;
|
||||
}
|
||||
|
||||
/** Operator << for ci::string
|
||||
*/
|
||||
inline std::ostream &operator<<(std::ostream &os, const ci::string &str) { return os << str.c_str(); }
|
||||
|
||||
/** Operator >> for ci::string
|
||||
*/
|
||||
inline std::istream &operator>>(std::istream &is, ci::string &str)
|
||||
{
|
||||
std::string tmp;
|
||||
is >> tmp;
|
||||
str = tmp.c_str();
|
||||
return is;
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline std::string operator+(std::string &leftval, irc::string &rightval)
|
||||
{
|
||||
return leftval + std::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline irc::string operator+(irc::string &leftval, std::string &rightval)
|
||||
{
|
||||
return leftval + irc::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with ci::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline std::string operator+(std::string &leftval, ci::string &rightval)
|
||||
{
|
||||
return leftval + std::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with ci::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline ci::string operator+(ci::string &leftval, std::string &rightval)
|
||||
{
|
||||
return leftval + ci::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline irc::string operator+(irc::string &leftval, ci::string &rightval)
|
||||
{
|
||||
return leftval + irc::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator +
|
||||
*/
|
||||
inline ci::string operator+(ci::string &leftval, irc::string &rightval)
|
||||
{
|
||||
return leftval + ci::string(rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const std::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return leftval.c_str() == rightval;
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const irc::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return leftval == rightval.c_str();
|
||||
}
|
||||
|
||||
/* Define operators for + and == with ci::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const std::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return leftval.c_str() == rightval;
|
||||
}
|
||||
|
||||
/* Define operators for + and == with ci::string to std::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const ci::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return leftval == rightval.c_str();
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const ci::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return leftval.c_str() == rightval;
|
||||
}
|
||||
|
||||
/* Define operators for + and == with irc::string to ci::string for easy assignment
|
||||
* and comparison
|
||||
*
|
||||
* Operator ==
|
||||
*/
|
||||
inline bool operator==(const irc::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return leftval == rightval.c_str();
|
||||
}
|
||||
|
||||
/* Define operators != for irc::string to std::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const irc::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return !(leftval == rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators != for std::string to irc::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const std::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return !(leftval.c_str() == rightval);
|
||||
}
|
||||
|
||||
/* Define operators != for ci::string to std::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const ci::string &leftval, const std::string &rightval)
|
||||
{
|
||||
return !(leftval == rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators != for ci::string to irc::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const std::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return !(leftval.c_str() == rightval);
|
||||
}
|
||||
|
||||
/* Define operators != for irc::string to ci::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const irc::string &leftval, const ci::string &rightval)
|
||||
{
|
||||
return !(leftval == rightval.c_str());
|
||||
}
|
||||
|
||||
/* Define operators != for irc::string to ci::string for easy comparison
|
||||
*/
|
||||
inline bool operator!=(const ci::string &leftval, const irc::string &rightval)
|
||||
{
|
||||
return !(leftval.c_str() == rightval);
|
||||
}
|
||||
|
||||
/** Assign an irc::string to a std::string.
|
||||
*/
|
||||
//inline std::string assign(const irc::string &other) { return other.c_str(); }
|
||||
|
||||
/** Assign a std::string to an irc::string.
|
||||
*/
|
||||
//inline irc::string assign(const std::string &other) { return other.c_str(); }
|
||||
|
||||
/** Assign an ci::string to a std::string.
|
||||
*/
|
||||
//inline std::string assign(const ci::string &other) { return other.c_str(); }
|
||||
|
||||
/** Assign a std::string to an ci::string.
|
||||
*/
|
||||
//inline ci::string assign(const std::string &other) { return other.c_str(); }
|
||||
|
||||
/** Assign an irc::string to a ci::string.
|
||||
*/
|
||||
//inline ci::string assign(const irc::string &other) { return other.c_str(); }
|
||||
|
||||
/** Assign a ci::string to an irc::string.
|
||||
*/
|
||||
//inline irc::string assign(const ci::string &other) { return other.c_str(); }
|
||||
|
||||
/** sepstream allows for splitting token seperated lists.
|
||||
* Each successive call to sepstream::GetToken() returns
|
||||
* the next token, until none remain, at which point the method returns
|
||||
* an empty string.
|
||||
*/
|
||||
class sepstream
|
||||
class CoreExport sepstream
|
||||
{
|
||||
private:
|
||||
/** Original string.
|
||||
@@ -61,7 +446,7 @@ class sepstream
|
||||
|
||||
/** A derived form of sepstream, which seperates on commas
|
||||
*/
|
||||
class commasepstream : public sepstream
|
||||
class CoreExport commasepstream : public sepstream
|
||||
{
|
||||
public:
|
||||
/** Initialize with comma seperator
|
||||
@@ -71,7 +456,7 @@ class commasepstream : public sepstream
|
||||
|
||||
/** A derived form of sepstream, which seperates on spaces
|
||||
*/
|
||||
class spacesepstream : public sepstream
|
||||
class CoreExport spacesepstream : public sepstream
|
||||
{
|
||||
public:
|
||||
/** Initialize with space seperator
|
||||
|
||||
@@ -7,9 +7,5 @@
|
||||
#include "modules.h"
|
||||
#include "version.h"
|
||||
|
||||
#define MOD_UNIQUE 0
|
||||
#define MOD_HEAD 1
|
||||
#define MOD_TAIL 2
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+788
-195
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2009 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
class CoreExport OperType
|
||||
{
|
||||
private:
|
||||
/** The name of this opertype, e.g. "sra".
|
||||
*/
|
||||
std::string name;
|
||||
|
||||
/** Privs that this opertype may use, e.g. 'users/auspex'.
|
||||
* This *must* be std::list, see commands comment for details.
|
||||
*/
|
||||
std::list<std::string> privs;
|
||||
|
||||
/** Commands this user may execute, e.g:
|
||||
* botserv/set/ *, botserv/set/private, botserv/ *
|
||||
* et cetera.
|
||||
*
|
||||
* This *must* be std::list, not std::map, because
|
||||
* we support full globbing here. This shouldn't be a problem
|
||||
* as we don't invoke it often.
|
||||
*/
|
||||
std::list<std::string> commands;
|
||||
public:
|
||||
/** Create a new opertype of the given name.
|
||||
* @param nname The opertype name, e.g. "sra".
|
||||
*/
|
||||
OperType(const std::string &nname);
|
||||
|
||||
/** Check whether this opertype has access to run the given command string.
|
||||
* @param cmdstr The string to check, e.g. botserv/set/private.
|
||||
* @return True if this opertype may run the specified command, false otherwise.
|
||||
*/
|
||||
bool HasCommand(const std::string &cmdstr) const;
|
||||
|
||||
/** Check whether this opertype has access to the given special permission.
|
||||
* @param privstr The priv to check for, e.g. users/auspex.
|
||||
* @return True if this opertype has the specified priv, false otherwise.
|
||||
*/
|
||||
bool HasPriv(const std::string &privstr) const;
|
||||
|
||||
/** Add the specified command to this opertype.
|
||||
* @param cmdstr The command mask to grant this opertype access to, e.g: nickserv/ *, chanserv/set/ *, botserv/set/private.
|
||||
*/
|
||||
void AddCommand(const std::string &cmdstr);
|
||||
|
||||
/** Add the specified priv mask to this opertype.
|
||||
* @param privstr The specified mask of privs to grant this opertype access to, e.g. users/auspex, users/ *, etc.
|
||||
*/
|
||||
void AddPriv(const std::string &privstr);
|
||||
|
||||
/** Returns the name of this opertype.
|
||||
*/
|
||||
const std::string &GetName() const;
|
||||
};
|
||||
+1
-2
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "commands.h"
|
||||
#include "language.h"
|
||||
#include "timeout.h"
|
||||
#include "encrypt.h"
|
||||
#include "timers.h"
|
||||
#include "datafiles.h"
|
||||
#include "slist.h"
|
||||
|
||||
+93
-8
@@ -8,8 +8,8 @@
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
class ChannelInfo : public Extensible
|
||||
|
||||
class CoreExport ChannelInfo : public Extensible
|
||||
{
|
||||
public:
|
||||
ChannelInfo()
|
||||
@@ -20,9 +20,8 @@ class ChannelInfo : public Extensible
|
||||
desc = url = email = last_topic = forbidby = forbidreason = NULL;
|
||||
time_registered = last_used = last_topic_time = 0;
|
||||
flags = 0;
|
||||
bantype = accesscount = akickcount = 0;
|
||||
bantype = akickcount = 0;
|
||||
levels = NULL;
|
||||
access = NULL;
|
||||
akick = NULL;
|
||||
mlock_on = mlock_off = mlock_limit = 0;
|
||||
mlock_key = mlock_flood = mlock_redirect = entry_message = NULL;
|
||||
@@ -36,7 +35,7 @@ class ChannelInfo : public Extensible
|
||||
floodlines = floodsecs = 0;
|
||||
repeattimes = 0;
|
||||
}
|
||||
|
||||
|
||||
ChannelInfo *next, *prev;
|
||||
char name[CHANMAX];
|
||||
NickCore *founder;
|
||||
@@ -60,8 +59,7 @@ class ChannelInfo : public Extensible
|
||||
int16 bantype;
|
||||
int16 *levels; /* Access levels for commands */
|
||||
|
||||
uint16 accesscount;
|
||||
ChanAccess *access; /* List of authorized users */
|
||||
std::vector<ChanAccess *> access; /* List of authorized users */
|
||||
uint16 akickcount;
|
||||
AutoKick *akick; /* List of users to kickban */
|
||||
|
||||
@@ -89,5 +87,92 @@ class ChannelInfo : public Extensible
|
||||
int16 capsmin, capspercent; /* For CAPS kicker */
|
||||
int16 floodlines, floodsecs; /* For FLOOD kicker */
|
||||
int16 repeattimes; /* For REPEAT kicker */
|
||||
};
|
||||
|
||||
/** Add an entry to the channel access list
|
||||
*
|
||||
* @param nc The NickCore of the user that the access entry should be tied to
|
||||
* @param level The channel access level the user has on the channel
|
||||
* @param last_seen When the user was last seen within the channel
|
||||
*
|
||||
* Creates a new access list entry and inserts it into the access list.
|
||||
*/
|
||||
void AddAccess(NickCore *nc, int16 level, int32 last_seen = 0)
|
||||
{
|
||||
ChanAccess *new_access = new ChanAccess;
|
||||
new_access->in_use = 1;
|
||||
new_access->nc = nc;
|
||||
new_access->level = level;
|
||||
new_access->last_seen = last_seen;
|
||||
access.push_back(new_access);
|
||||
}
|
||||
|
||||
/** Get an entry from the channel access list by index
|
||||
*
|
||||
* @param index The index in the access list vector
|
||||
* @return A ChanAccess struct corresponding to the index given, or NULL if outside the bounds
|
||||
*
|
||||
* Retrieves an entry from the access list that matches the given index.
|
||||
*/
|
||||
ChanAccess *GetAccess(unsigned index)
|
||||
{
|
||||
if (access.empty() || index >= access.size())
|
||||
return NULL;
|
||||
|
||||
return access[index];
|
||||
}
|
||||
|
||||
/** Get an entry from the channel access list by NickCore
|
||||
*
|
||||
* @param nc The NickCore to find within the access list vector
|
||||
* @param level Optional channel access level to compare the access entries to
|
||||
* @return A ChanAccess struct corresponding to the NickCore, or NULL if not found
|
||||
*
|
||||
* Retrieves an entry from the access list that matches the given NickCore, optionally also matching a certain level.
|
||||
*/
|
||||
ChanAccess *GetAccess(NickCore *nc, int16 level = 0)
|
||||
{
|
||||
if (access.empty())
|
||||
return NULL;
|
||||
|
||||
for (unsigned i = 0; i < access.size(); i++)
|
||||
if (access[i]->in_use && access[i]->nc == nc && (level ? access[i]->level == level : true))
|
||||
return access[i];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Erase an entry from the channel access list
|
||||
*
|
||||
* @param index The index in the access list vector
|
||||
*
|
||||
* Clears the memory used by the given access entry and removes it from the vector.
|
||||
*/
|
||||
void EraseAccess(unsigned index)
|
||||
{
|
||||
if (access.empty() || index >= access.size())
|
||||
return;
|
||||
delete access[index];
|
||||
access.erase(access.begin() + index);
|
||||
}
|
||||
|
||||
/** Cleans the channel access list
|
||||
*
|
||||
* Cleans up the access list so it no longer contains entries no longer in use.
|
||||
*/
|
||||
void CleanAccess()
|
||||
{
|
||||
for (unsigned j = access.size(); j > 0; --j)
|
||||
if (!access[j - 1]->in_use)
|
||||
EraseAccess(j - 1);
|
||||
}
|
||||
|
||||
/** Clear the entire channel access list
|
||||
*
|
||||
* Clears the entire access list by deleting every item and then clearing the vector.
|
||||
*/
|
||||
void ClearAccess()
|
||||
{
|
||||
while (access.begin() != access.end())
|
||||
EraseAccess(0);
|
||||
}
|
||||
};
|
||||
|
||||
+138
-274
@@ -192,11 +192,11 @@ extern int strncasecmp(const char *, const char *, size_t);
|
||||
* It defines the class factory and external init_module function.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
#define MODULE_INIT(x, y) \
|
||||
#define MODULE_INIT(x) \
|
||||
extern "C" DllExport Module *init_module(const std::string &, const std::string &); \
|
||||
extern "C" Module *init_module(const std::string &, const std::string &creator) \
|
||||
extern "C" Module *init_module(const std::string &modname, const std::string &creator) \
|
||||
{ \
|
||||
return new y(x, creator); \
|
||||
return new x(modname, creator); \
|
||||
} \
|
||||
BOOLEAN WINAPI DllMain(HINSTANCE, DWORD nReason, LPVOID) \
|
||||
{ \
|
||||
@@ -208,19 +208,19 @@ extern int strncasecmp(const char *, const char *, size_t);
|
||||
} \
|
||||
return TRUE; \
|
||||
} \
|
||||
extern "C" DllExport void destroy_module(y *); \
|
||||
extern "C" void destroy_module(y *m) \
|
||||
extern "C" DllExport void destroy_module(x *); \
|
||||
extern "C" void destroy_module(x *m) \
|
||||
{ \
|
||||
delete m; \
|
||||
}
|
||||
|
||||
#else
|
||||
#define MODULE_INIT(x, y) \
|
||||
extern "C" DllExport Module *init_module(const std::string &, const std::string &creator) \
|
||||
#define MODULE_INIT(x) \
|
||||
extern "C" DllExport Module *init_module(const std::string &modname, const std::string &creator) \
|
||||
{ \
|
||||
return new y(x, creator); \
|
||||
return new x(modname, creator); \
|
||||
} \
|
||||
extern "C" DllExport void destroy_module(y *m) \
|
||||
extern "C" DllExport void destroy_module(x *m) \
|
||||
{ \
|
||||
delete m; \
|
||||
}
|
||||
@@ -229,7 +229,6 @@ extern int strncasecmp(const char *, const char *, size_t);
|
||||
/* Miscellaneous definitions. */
|
||||
#include "defs.h"
|
||||
#include "slist.h"
|
||||
#include "events.h"
|
||||
|
||||
/* pull in the various bits of STL to pull in */
|
||||
#include <string>
|
||||
@@ -237,6 +236,7 @@ extern int strncasecmp(const char *, const char *, size_t);
|
||||
#include <exception>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
/** 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
|
||||
@@ -321,13 +321,13 @@ class CoreExport Extensible
|
||||
*
|
||||
* @return Returns true on success, false if otherwise
|
||||
*/
|
||||
template<typename T> bool Extend(const std::string &key, T* p)
|
||||
template<typename T> bool Extend(const std::string &key, T *p)
|
||||
{
|
||||
/* This will only add an item if it doesnt already exist,
|
||||
* the return value is a std::pair of an iterator to the
|
||||
* element, and a bool saying if it was actually inserted.
|
||||
*/
|
||||
return this->Extension_Items.insert(std::make_pair(key, static_cast<char *>(p))).second;
|
||||
return this->Extension_Items.insert(std::make_pair(key, reinterpret_cast<char *>(p))).second;
|
||||
}
|
||||
|
||||
/** Extend an Extensible class.
|
||||
@@ -373,7 +373,7 @@ class CoreExport Extensible
|
||||
* @param p If you provide a non-existent key, this value will be NULL. Otherwise a pointer to the item you requested will be placed in this templated parameter.
|
||||
* @return Returns true if the item was found and false if it was nor, regardless of wether 'p' is NULL. This allows you to store NULL values in Extensible.
|
||||
*/
|
||||
template<typename T> bool GetExt(const std::string &key, T* &p)
|
||||
template<typename T> bool GetExt(const std::string &key, T *&p)
|
||||
{
|
||||
std::map<std::string, void *>::iterator iter = this->Extension_Items.find(key); /* Find the item */
|
||||
if(iter != this->Extension_Items.end())
|
||||
@@ -401,6 +401,20 @@ class CoreExport Extensible
|
||||
{
|
||||
return (this->Extension_Items.find(key) != this->Extension_Items.end());
|
||||
}
|
||||
|
||||
/** Get a list of all extension items names.
|
||||
* @param list A deque of strings to receive the list
|
||||
* @return This function writes a list of all extension items stored
|
||||
* in this object by name into the given deque and returns void.
|
||||
*/
|
||||
void GetExtList(std::deque<std::string> &list)
|
||||
{
|
||||
for (std::map<std::string, void *>::iterator i = Extension_Items.begin(); i != Extension_Items.end(); ++i)
|
||||
{
|
||||
list.push_back(i->first);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -433,6 +447,7 @@ typedef struct csmodeutil_ CSModeUtil;
|
||||
typedef struct session_ Session;
|
||||
|
||||
#include "bots.h"
|
||||
#include "opertype.h"
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
@@ -454,12 +469,7 @@ struct ircdvars_ {
|
||||
const char *ownerunset; /* Mode to unset for a owner */
|
||||
const char *adminset; /* Mode to set for admin */
|
||||
const char *adminunset; /* Mode to unset for admin */
|
||||
const char *modeonreg; /* Mode on Register */
|
||||
const char *rootmodeonid; /* Mode on ID for ROOTS */
|
||||
const char *adminmodeonid; /* Mode on ID for ADMINS */
|
||||
const char *opermodeonid; /* Mode on ID for OPERS */
|
||||
const char *modeonunreg; /* Mode on Unregister */
|
||||
const char *modeonnick; /* Mode on nick change */
|
||||
int sgline; /* Supports SGline */
|
||||
int sqline; /* Supports SQline */
|
||||
int szline; /* Supports SZline */
|
||||
@@ -511,11 +521,11 @@ struct ircdvars_ {
|
||||
int supporthelper; /* +h helper umodes */
|
||||
int p10; /* ircd is P10 */
|
||||
char *nickchars; /* character set */
|
||||
int sync; /* reports sync state */
|
||||
int cidrchanbei; /* channel bans/excepts/invites support CIDR (syntax: +b *!*@192.168.0.0/15)
|
||||
* 0 for no support, 1 for strict cidr support, anything else
|
||||
* for ircd specific support (nefarious only cares about first /mask) */
|
||||
const char *globaltldprefix; /* TLD prefix used for Global */
|
||||
bool b_delay_auth; /* Auth for users is sent after the initial NICK/UID command */
|
||||
};
|
||||
|
||||
struct ircdcapab_ {
|
||||
@@ -542,7 +552,6 @@ struct ircdcapab_ {
|
||||
uint32 vhost;
|
||||
uint32 ssj3;
|
||||
uint32 nick2;
|
||||
uint32 umode2;
|
||||
uint32 vl;
|
||||
uint32 tlkext;
|
||||
uint32 dodkey;
|
||||
@@ -578,9 +587,6 @@ struct memo_ {
|
||||
time_t time; /* When it was sent */
|
||||
char sender[NICKMAX];
|
||||
char *text;
|
||||
#ifdef USE_MYSQL
|
||||
uint32 id; /* Database ID; see mysql.c */
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -597,38 +603,39 @@ typedef struct {
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
enum AccessLevel
|
||||
{
|
||||
/* Note that these two levels also serve as exclusive boundaries for valid
|
||||
* access levels. ACCESS_FOUNDER may be assumed to be strictly greater
|
||||
* than any valid access level, and ACCESS_INVALID may be assumed to be
|
||||
* strictly less than any valid access level. Also read below.
|
||||
*/
|
||||
ACCESS_FOUNDER = 10000, /* Numeric level indicating founder access */
|
||||
ACCESS_INVALID = -10000, /* Used in levels[] for disabled settings */
|
||||
/* There is one exception to the above access levels: SuperAdmins will have
|
||||
* access level 10001. This level is never stored, however; it is only used
|
||||
* in comparison and to let SuperAdmins win from founders where needed
|
||||
*/
|
||||
ACCESS_SUPERADMIN = 10001,
|
||||
/* Levels for xOP */
|
||||
ACCESS_VOP = 3,
|
||||
ACCESS_HOP = 4,
|
||||
ACCESS_AOP = 5,
|
||||
ACCESS_SOP = 10
|
||||
};
|
||||
|
||||
/* Channel info structures. Stored similarly to the nicks, except that
|
||||
* the second character of the channel name, not the first, is used to
|
||||
* determine the list. (Hashing based on the first character of the name
|
||||
* wouldn't get very far. ;) ) */
|
||||
|
||||
/* Access levels for users. */
|
||||
typedef struct {
|
||||
struct ChanAccess {
|
||||
uint16 in_use; /* 1 if this entry is in use, else 0 */
|
||||
int16 level;
|
||||
NickCore *nc; /* Guaranteed to be non-NULL if in use, NULL if not */
|
||||
time_t last_seen;
|
||||
} ChanAccess;
|
||||
|
||||
/* Note that these two levels also serve as exclusive boundaries for valid
|
||||
* access levels. ACCESS_FOUNDER may be assumed to be strictly greater
|
||||
* than any valid access level, and ACCESS_INVALID may be assumed to be
|
||||
* strictly less than any valid access level. Also read below.
|
||||
*/
|
||||
#define ACCESS_FOUNDER 10000 /* Numeric level indicating founder access */
|
||||
#define ACCESS_INVALID -10000 /* Used in levels[] for disabled settings */
|
||||
/* There is one exception to the above access levels: SuperAdmins will have
|
||||
* access level 10001. This level is never stored, however; it is only used
|
||||
* in comparison and to let SuperAdmins win from founders where needed
|
||||
*/
|
||||
#define ACCESS_SUPERADMIN 10001
|
||||
|
||||
/* Levels for xOP */
|
||||
|
||||
#define ACCESS_VOP 3
|
||||
#define ACCESS_HOP 4
|
||||
#define ACCESS_AOP 5
|
||||
#define ACCESS_SOP 10
|
||||
};
|
||||
|
||||
/* AutoKick data. */
|
||||
typedef struct {
|
||||
@@ -679,7 +686,7 @@ struct badword_ {
|
||||
/* Don't allow any privileges unless a user is IDENTIFY'd with NickServ */
|
||||
#define CI_SECURE 0x00000040
|
||||
/* Don't allow the channel to be registered or used */
|
||||
#define CI_VERBOTEN 0x00000080
|
||||
#define CI_FORBIDDEN 0x00000080
|
||||
/* Channel password is encrypted */
|
||||
#define CI_ENCRYPTEDPW 0x00000100
|
||||
/* Channel does not expire */
|
||||
@@ -800,9 +807,8 @@ typedef struct {
|
||||
/* Server data */
|
||||
|
||||
typedef enum {
|
||||
SSYNC_UNKNOWN = 0, /* We can't get the sync state */
|
||||
SSYNC_IN_PROGRESS = 1, /* Sync is currently in progress */
|
||||
SSYNC_DONE = 2 /* We're in sync */
|
||||
SSYNC_IN_PROGRESS = 0, /* Sync is currently in progress */
|
||||
SSYNC_DONE = 1 /* We're in sync */
|
||||
} SyncState;
|
||||
|
||||
struct server_ {
|
||||
@@ -821,6 +827,7 @@ struct server_ {
|
||||
|
||||
#define SERVER_ISME 0x0001
|
||||
#define SERVER_JUPED 0x0002
|
||||
#define SERVER_ISUPLINK 0x0004
|
||||
|
||||
/*************************************************************************/
|
||||
#include "users.h"
|
||||
@@ -1093,11 +1100,11 @@ typedef struct ircd_modes_ {
|
||||
#define MF_NOTIFYS 0x0004 /* Memo is a notification of receitp */
|
||||
|
||||
/* Nickname status flags: */
|
||||
#define NS_VERBOTEN 0x0002 /* Nick may not be registered or used */
|
||||
#define NS_FORBIDDEN 0x0002 /* Nick may not be registered or used */
|
||||
#define NS_NO_EXPIRE 0x0004 /* Nick never expires */
|
||||
#define NS_IDENTIFIED 0x8000 /* User has IDENTIFY'd */
|
||||
#define NS_RECOGNIZED 0x4000 /* ON_ACCESS true && SECURE flag not set */
|
||||
#define NS_ON_ACCESS 0x2000 /* User comes from a known address */
|
||||
//#define NS_IDENTIFIED 0x8000 /* User has IDENTIFY'd */
|
||||
//#define NS_RECOGNIZED 0x4000 /* ON_ACCESS true && SECURE flag not set */
|
||||
//#define NS_ON_ACCESS 0x2000 /* User comes from a known address */
|
||||
#define NS_KILL_HELD 0x1000 /* Nick is being held after a kill */
|
||||
#define NS_GUESTED 0x0100 /* SVSNICK has been sent but nick has not
|
||||
* yet changed. An enforcer will be
|
||||
@@ -1125,17 +1132,17 @@ typedef struct ircd_modes_ {
|
||||
#define NI_HIDE_QUIT 0x00000200 /* Don't show last quit message in INFO */
|
||||
#define NI_KILL_QUICK 0x00000400 /* Kill in 20 seconds instead of 60 */
|
||||
#define NI_KILL_IMMED 0x00000800 /* Kill immediately instead of in 60 sec */
|
||||
#define NI_SERVICES_OPER 0x00001000 /* User is a Services operator */
|
||||
#define NI_SERVICES_ADMIN 0x00002000 /* User is a Services admin */
|
||||
//#define NI_SERVICES_OPER 0x00001000 /* No longer used */
|
||||
//#define NI_SERVICES_ADMIN 0x00002000 /* No longer used */
|
||||
#define NI_ENCRYPTEDPW 0x00004000 /* Nickname password is encrypted */
|
||||
#define NI_SERVICES_ROOT 0x00008000 /* User is a Services root */
|
||||
//#define NI_SERVICES_ROOT 0x00008000 /* No longer used */
|
||||
#define NI_MEMO_MAIL 0x00010000 /* User gets email on memo */
|
||||
#define NI_HIDE_STATUS 0x00020000 /* Don't show services access status */
|
||||
#define NI_SUSPENDED 0x00040000 /* Nickname is suspended */
|
||||
#define NI_AUTOOP 0x00080000 /* Autoop nickname in channels */
|
||||
#define NI_NOEXPIRE 0x00100000 /* nicks in this group won't expire */
|
||||
|
||||
// Old NS_VERBOTEN, very fucking temporary.
|
||||
// Old NS_FORBIDDEN, very fucking temporary.
|
||||
#define NI_FORBIDDEN 0x80000000
|
||||
|
||||
/* Languages. Never insert anything in the middle of this list, or
|
||||
@@ -1167,13 +1174,20 @@ typedef struct ircd_modes_ {
|
||||
#define DEF_LANGUAGE LANG_EN_US
|
||||
|
||||
#define BI_PRIVATE 0x0001
|
||||
#define BI_CHANSERV 0x0002
|
||||
#define BI_BOTSERV 0x0004
|
||||
#define BI_HOSTSERV 0x0008
|
||||
#define BI_OPERSERV 0x0010
|
||||
#define BI_MEMOSERV 0x0020
|
||||
#define BI_NICKSERV 0x0040
|
||||
#define BI_GLOBAL 0x0080
|
||||
|
||||
#define CUS_OP 0x0001
|
||||
#define CUS_VOICE 0x0002
|
||||
#define CUS_HALFOP 0x0004 /* Halfop (+h) */
|
||||
#define CUS_OWNER 0x0008 /* Owner/Founder (+q) */
|
||||
#define CUS_PROTECT 0x0010 /* Protected users (+a) */
|
||||
#define CUS_DEOPPED 0x0080 /* User has been specifically deopped */
|
||||
/* #define CUS_DEOPPED 0x0080 */ /* Removed due to IRCd checking it */
|
||||
|
||||
#define MUT_DEOP 0
|
||||
#define MUT_OP 1
|
||||
@@ -1183,6 +1197,8 @@ typedef struct ircd_modes_ {
|
||||
#define MUT_HALFOP 5
|
||||
#define MUT_DEPROTECT 6
|
||||
#define MUT_PROTECT 7
|
||||
#define MUT_DEOWNER 8
|
||||
#define MUT_OWNER 9
|
||||
|
||||
/*************************************************************************/
|
||||
/* CAPAB stuffs */
|
||||
@@ -1218,12 +1234,11 @@ struct capabinfo_ {
|
||||
#define CAPAB_TOKEN 0x00400000
|
||||
#define CAPAB_SSJ3 0x00800000
|
||||
#define CAPAB_NICK2 0x01000000
|
||||
#define CAPAB_UMODE2 0x02000000
|
||||
#define CAPAB_VL 0x04000000
|
||||
#define CAPAB_TLKEXT 0x08000000
|
||||
#define CAPAB_CHANMODE 0x10000000
|
||||
#define CAPAB_SJB64 0x20000000
|
||||
#define CAPAB_NICKCHARS 0x40000000
|
||||
#define CAPAB_VL 0x02000000
|
||||
#define CAPAB_TLKEXT 0x04000000
|
||||
#define CAPAB_CHANMODE 0x08000000
|
||||
#define CAPAB_SJB64 0x10000000
|
||||
#define CAPAB_NICKCHARS 0x20000000
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
@@ -1247,61 +1262,21 @@ class ServerConfig;
|
||||
#include "extern.h"
|
||||
#include "configreader.h"
|
||||
|
||||
class IRCDProto {
|
||||
|
||||
private:
|
||||
|
||||
class CoreExport IRCDProto
|
||||
{
|
||||
private:
|
||||
virtual void SendSVSKillInternal(const char *, const char *, const char *) = 0;
|
||||
virtual void SendModeInternal(BotInfo *, const char *, const char *) = 0;
|
||||
virtual void SendKickInternal(BotInfo *bi, const char *, const char *, const char *) = 0;
|
||||
virtual void SendNoticeChanopsInternal(BotInfo *bi, const char *, const char *) = 0;
|
||||
virtual void SendMessageInternal(BotInfo *bi, const char *dest, const char *buf)
|
||||
{
|
||||
if (NSDefFlags & NI_MSG)
|
||||
SendPrivmsgInternal(bi, dest, buf);
|
||||
else
|
||||
SendNoticeInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendNoticeInternal(BotInfo *bi, const char *dest, const char *msg)
|
||||
{
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NOTICE %s :%s", dest, msg);
|
||||
}
|
||||
virtual void SendPrivmsgInternal(BotInfo *bi, const char *dest, const char *buf)
|
||||
{
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PRIVMSG %s :%s", dest, buf);
|
||||
}
|
||||
virtual void SendQuitInternal(BotInfo *bi, const char *buf)
|
||||
{
|
||||
if (buf)
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "QUIT :%s", buf);
|
||||
else
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "QUIT");
|
||||
}
|
||||
virtual void SendPartInternal(BotInfo *bi, const char *chan, const char *buf)
|
||||
{
|
||||
if (buf)
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PART %s :%s", chan, buf);
|
||||
else
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PART %s", chan);
|
||||
}
|
||||
virtual void SendGlobopsInternal(const char *source, const char *buf)
|
||||
{
|
||||
BotInfo *bi = findbot(source);
|
||||
if (bi)
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "GLOBOPS :%s", buf);
|
||||
else
|
||||
send_cmd(ServerName, "GLOBOPS :%s", buf);
|
||||
}
|
||||
virtual void SendCTCPInternal(BotInfo *bi, const char *dest, const char *buf)
|
||||
{
|
||||
char *s = normalizeBuffer(buf);
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NOTICE %s :\1%s\1", dest, s);
|
||||
delete [] s;
|
||||
}
|
||||
virtual void SendNumericInternal(const char *source, int numeric, const char *dest, const char *buf)
|
||||
{
|
||||
send_cmd(source, "%03d %s %s", numeric, dest, buf);
|
||||
}
|
||||
virtual void SendMessageInternal(BotInfo *bi, const char *dest, const char *buf);
|
||||
virtual void SendNoticeInternal(BotInfo *bi, const char *dest, const char *msg);
|
||||
virtual void SendPrivmsgInternal(BotInfo *bi, const char *dest, const char *buf);
|
||||
virtual void SendQuitInternal(BotInfo *bi, const char *buf);
|
||||
virtual void SendPartInternal(BotInfo *bi, const char *chan, const char *buf);
|
||||
virtual void SendGlobopsInternal(const char *source, const char *buf);
|
||||
virtual void SendCTCPInternal(BotInfo *bi, const char *dest, const char *buf);
|
||||
virtual void SendNumericInternal(const char *source, int numeric, const char *dest, const char *buf);
|
||||
public:
|
||||
|
||||
virtual ~IRCDProto() { }
|
||||
@@ -1311,89 +1286,18 @@ private:
|
||||
virtual void SendTopic(BotInfo *, const char *, const char *, const char *, time_t) = 0;
|
||||
virtual void SendVhostDel(User *) { }
|
||||
virtual void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *) = 0;
|
||||
virtual void SendSVSKill(const char *source, const char *user, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendSVSKillInternal(source, user, buf);
|
||||
}
|
||||
virtual void SendSVSKill(const char *source, const char *user, const char *fmt, ...);
|
||||
virtual void SendSVSMode(User *, int, const char **) = 0;
|
||||
virtual void SendMode(BotInfo *bi, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendModeInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendMode(BotInfo *bi, const char *dest, const char *fmt, ...);
|
||||
virtual void SendClientIntroduction(const char *, const char *, const char *, const char *, const char *, const char *uid) = 0;
|
||||
virtual void SendKick(BotInfo *bi, const char *chan, const char *user, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendKickInternal(bi, chan, user, buf);
|
||||
}
|
||||
virtual void SendNoticeChanops(BotInfo *bi, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendNoticeChanopsInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendMessage(BotInfo *bi, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendMessageInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendNotice(BotInfo *bi, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendNoticeInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendAction(BotInfo *bi, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "", actionbuf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s%c", 1, buf, 1);
|
||||
SendPrivmsgInternal(bi, dest, actionbuf);
|
||||
}
|
||||
virtual void SendPrivmsg(BotInfo *bi, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendPrivmsgInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendGlobalNotice(BotInfo *bi, const char *dest, const char *msg)
|
||||
{
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NOTICE %s%s :%s", ircd->globaltldprefix, dest, msg);
|
||||
}
|
||||
virtual void SendGlobalPrivmsg(BotInfo *bi, const char *dest, const char *msg)
|
||||
{
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "PRIVMSG %s%s :%s", ircd->globaltldprefix, dest, msg);
|
||||
}
|
||||
virtual void SendKick(BotInfo *bi, const char *chan, const char *user, const char *fmt, ...);
|
||||
virtual void SendNoticeChanops(BotInfo *bi, const char *dest, const char *fmt, ...);
|
||||
virtual void SendMessage(BotInfo *bi, const char *dest, const char *fmt, ...);
|
||||
virtual void SendNotice(BotInfo *bi, const char *dest, const char *fmt, ...);
|
||||
virtual void SendAction(BotInfo *bi, const char *dest, const char *fmt, ...);
|
||||
virtual void SendPrivmsg(BotInfo *bi, const char *dest, const char *fmt, ...);
|
||||
virtual void SendGlobalNotice(BotInfo *bi, const char *dest, const char *msg);
|
||||
virtual void SendGlobalPrivmsg(BotInfo *bi, const char *dest, const char *msg);
|
||||
virtual void SendBotOp(const char *, const char *) = 0;
|
||||
|
||||
/** XXX: This is a hack for NickServ enforcers. It is deprecated.
|
||||
@@ -1401,64 +1305,19 @@ private:
|
||||
* Thanks.
|
||||
* -- w00t
|
||||
*/
|
||||
virtual void SendQuit(const char *nick, const char *) MARK_DEPRECATED
|
||||
{
|
||||
send_cmd(nick, "QUIT");
|
||||
}
|
||||
virtual void SendQuit(BotInfo *bi, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendQuitInternal(bi, buf);
|
||||
}
|
||||
virtual void SendPong(const char *servname, const char *who)
|
||||
{
|
||||
send_cmd(servname, "PONG %s", who);
|
||||
}
|
||||
virtual void SendQuit(const char *nick, const char *) MARK_DEPRECATED;
|
||||
virtual void SendQuit(BotInfo *bi, const char *fmt, ...);
|
||||
virtual void SendPong(const char *servname, const char *who);
|
||||
virtual void SendJoin(BotInfo *bi, const char *, time_t) = 0;
|
||||
virtual void SendSQLineDel(const char *) = 0;
|
||||
virtual void SendInvite(BotInfo *bi, const char *chan, const char *nick)
|
||||
{
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "INVITE %s %s", nick, chan);
|
||||
}
|
||||
virtual void SendPart(BotInfo *bi, const char *chan, const char *fmt, ...)
|
||||
{
|
||||
if (fmt) {
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendPartInternal(bi, chan, buf);
|
||||
}
|
||||
else SendPartInternal(bi, chan, NULL);
|
||||
}
|
||||
virtual void SendGlobops(const char *source, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendGlobopsInternal(source, buf);
|
||||
}
|
||||
virtual void SendInvite(BotInfo *bi, const char *chan, const char *nick);
|
||||
virtual void SendPart(BotInfo *bi, const char *chan, const char *fmt, ...);
|
||||
virtual void SendGlobops(const char *source, const char *fmt, ...);
|
||||
virtual void SendSQLine(const char *, const char *) = 0;
|
||||
virtual void SendSquit(const char *servname, const char *message)
|
||||
{
|
||||
send_cmd(NULL, "SQUIT %s :%s", servname, message);
|
||||
}
|
||||
virtual void SendSquit(const char *servname, const char *message);
|
||||
virtual void SendSVSO(const char *, const char *, const char *) { }
|
||||
virtual void SendChangeBotNick(BotInfo *bi, const char *newnick)
|
||||
{
|
||||
send_cmd(ircd->ts6 ? bi->uid : bi->nick, "NICK %s", newnick);
|
||||
}
|
||||
virtual void SendForceNickChange(const char *oldnick, const char *newnick, time_t when)
|
||||
{
|
||||
send_cmd(NULL, "SVSNICK %s %s :%ld", oldnick, newnick, static_cast<long>(when));
|
||||
}
|
||||
virtual void SendChangeBotNick(BotInfo *bi, const char *newnick);
|
||||
virtual void SendForceNickChange(const char *oldnick, const char *newnick, time_t when);
|
||||
virtual void SendVhost(const char *, const char *, const char *) { }
|
||||
virtual void SendConnect() = 0;
|
||||
virtual void SendSVSHold(const char *) { }
|
||||
@@ -1469,37 +1328,18 @@ private:
|
||||
virtual void SendSGLine(const char *, const char *) { }
|
||||
virtual void SendBanDel(const char *, const char *) { }
|
||||
virtual void SendSVSModeChan(const char *, const char *, const char *) { }
|
||||
virtual void SendSVID(const char *, time_t) { }
|
||||
virtual void SendUnregisteredNick(User *) { }
|
||||
virtual void SendSVID2(User *, const char *) { }
|
||||
virtual void SendSVID3(User *, const char *) { }
|
||||
virtual void SendCTCP(BotInfo *bi, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendCTCPInternal(bi, dest, buf);
|
||||
}
|
||||
virtual void SendCTCP(BotInfo *bi, const char *dest, const char *fmt, ...);
|
||||
virtual void SendSVSJoin(const char *, const char *, const char *, const char *) { }
|
||||
virtual void SendSVSPart(const char *, const char *, const char *) { }
|
||||
virtual void SendSWhois(const char *, const char *, const char *) { }
|
||||
virtual void SendEOB() { }
|
||||
virtual void SendServer(const char *, int, const char *) = 0;
|
||||
virtual void SendServer(Server *) = 0;
|
||||
virtual void ProcessUsermodes(User *, int, const char **) = 0;
|
||||
virtual int IsNickValid(const char *) { return 1; }
|
||||
virtual int IsChannelValid(const char *) { return 1; }
|
||||
virtual int IsChannelValid(const char *);
|
||||
virtual int IsFloodModeParamValid(const char *) { return 0; }
|
||||
virtual void SendNumeric(const char *source, int numeric, const char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE] = "";
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
SendNumericInternal(source, numeric, dest, *buf ? buf : NULL);
|
||||
}
|
||||
virtual void SendNumeric(const char *source, int numeric, const char *dest, const char *fmt, ...);
|
||||
|
||||
/** Sends a message logging a user into an account, where ircds support such a feature.
|
||||
* @param u The user logging in
|
||||
@@ -1512,9 +1352,14 @@ private:
|
||||
* @param account The account the user is logging out of
|
||||
*/
|
||||
virtual void SendAccountLogout(User *u, NickCore *account) { }
|
||||
|
||||
/** Set a users auto identification token
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void SetAutoIdentificationToken(User *u) { }
|
||||
};
|
||||
|
||||
class IRCDTS6Proto : public IRCDProto
|
||||
class CoreExport IRCDTS6Proto : public IRCDProto
|
||||
{
|
||||
};
|
||||
|
||||
@@ -1537,6 +1382,25 @@ struct Uplink {
|
||||
}
|
||||
};
|
||||
|
||||
class Anope
|
||||
{
|
||||
public:
|
||||
/** Check whether two strings match.
|
||||
* @param mask The pattern to check (e.g. foo*bar)
|
||||
* @param str The string to check against the pattern (e.g. foobar)
|
||||
* @param case_sensitive Whether or not the match is case sensitive, default false.
|
||||
*/
|
||||
CoreExport static bool Match(const std::string &str, const std::string &mask, bool case_sensitive = false);
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/** Pair of nick/opertype lookup. It's stored like this currently, because config is parsed before db load.
|
||||
* XXX: It would be nice to not need this. UGH.
|
||||
*/
|
||||
E std::list<std::pair<std::string, std::string> > svsopers_in_config;
|
||||
/** List of available opertypes.
|
||||
*/
|
||||
E std::list<OperType *> MyOperTypes;
|
||||
|
||||
#endif /* SERVICES_H */
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Time-delay routine include stuff.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TIMEOUT_H
|
||||
#define TIMEOUT_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
|
||||
/* Definitions for timeouts: */
|
||||
typedef struct timeout_ Timeout;
|
||||
struct timeout_ {
|
||||
Timeout *next, *prev;
|
||||
time_t settime, timeout;
|
||||
int repeat; /* Does this timeout repeat indefinitely? */
|
||||
void (*code)(Timeout *); /* This structure is passed to the code */
|
||||
void *data; /* Can be anything */
|
||||
};
|
||||
|
||||
|
||||
/* Check the timeout list for any pending actions. */
|
||||
extern void check_timeouts();
|
||||
|
||||
/* Add a timeout to the list to be triggered in `delay' seconds. Any
|
||||
* timeout added from within a timeout routine will not be checked during
|
||||
* that run through the timeout list.
|
||||
*/
|
||||
extern Timeout *add_timeout(int delay, void (*code)(Timeout *), int repeat);
|
||||
|
||||
/* Remove a timeout from the list (if it's there). */
|
||||
extern void del_timeout(Timeout *t);
|
||||
|
||||
|
||||
#endif /* TIMEOUT_H */
|
||||
@@ -0,0 +1,122 @@
|
||||
/* Timer include stuff.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TIMERS_H
|
||||
#define TIMERS_H
|
||||
|
||||
#include "services.h"
|
||||
#include <time.h>
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
class CoreExport Timer : public Extensible
|
||||
{
|
||||
private:
|
||||
/** The time this was created
|
||||
*/
|
||||
time_t settime;
|
||||
|
||||
/** The triggering time
|
||||
*/
|
||||
time_t trigger;
|
||||
|
||||
/** Numer of seconds between triggers
|
||||
*/
|
||||
long secs;
|
||||
|
||||
/** True if this is a repeating timer
|
||||
*/
|
||||
bool repeat;
|
||||
|
||||
public:
|
||||
/** Default constructor, initializes the triggering time
|
||||
* @param time_from_now The number of seconds from now to trigger the timer
|
||||
* @param now The time now
|
||||
* @param repeating Repeat this timer every time_from_now if this is true
|
||||
*/
|
||||
Timer(long time_from_now, time_t now = time(NULL), bool repeating = false);
|
||||
|
||||
/** Default destructor, does nothing
|
||||
*/
|
||||
virtual ~Timer();
|
||||
|
||||
/** Set the trigger time to a new value
|
||||
* @param t The new time
|
||||
*/
|
||||
void SetTimer(time_t t);
|
||||
|
||||
/** Retrieve the triggering time
|
||||
* @return The trigger time
|
||||
*/
|
||||
const time_t GetTimer();
|
||||
|
||||
/** Returns true if the timer is set to repeat
|
||||
* @return Returns true if the timer is set to repeat
|
||||
*/
|
||||
const bool GetRepeat();
|
||||
|
||||
/** Returns the interval between ticks
|
||||
* @return The interval
|
||||
*/
|
||||
const long GetSecs();
|
||||
|
||||
/** Returns the time this timer was created
|
||||
* @return The time this timer was created
|
||||
*/
|
||||
const time_t GetSetTime();
|
||||
|
||||
/** Called when the timer ticks
|
||||
* This should be overridden with something useful
|
||||
*/
|
||||
virtual void Tick(time_t ctime) = 0;
|
||||
};
|
||||
|
||||
/** This class manages sets of Timers, and triggers them at their defined times.
|
||||
* This will ensure timers are not missed, as well as removing timers that have
|
||||
* expired and allowing the addition of new ones.
|
||||
*/
|
||||
class CoreExport TimerManager : public Extensible
|
||||
{
|
||||
protected:
|
||||
/** A list of timers
|
||||
*/
|
||||
static std::vector<Timer *> Timers;
|
||||
public:
|
||||
/** Add a timer to the list
|
||||
* @param T A Timer derived class to add
|
||||
*/
|
||||
static void AddTimer(Timer *T);
|
||||
|
||||
/** Deletes a timer
|
||||
* @param T A Timer derived class to delete
|
||||
*/
|
||||
static void DelTimer(Timer *T);
|
||||
|
||||
/** Check if something is a timer
|
||||
* @param T A pointer
|
||||
* @return true or false
|
||||
*/
|
||||
static bool IsTimer(Timer *T);
|
||||
|
||||
/** Tick all pending timers
|
||||
* @param ctime The current time
|
||||
*/
|
||||
static void TickTimers(time_t ctime = time(NULL));
|
||||
|
||||
/** Compares two timers
|
||||
*/
|
||||
static bool TimerComparison(Timer *one, Timer *two);
|
||||
};
|
||||
|
||||
#endif
|
||||
+72
-8
@@ -22,27 +22,28 @@ struct u_chaninfolist {
|
||||
/* Online user and channel data. */
|
||||
class CoreExport User : public Extensible
|
||||
{
|
||||
private:
|
||||
std::string vident;
|
||||
std::string ident;
|
||||
std::string uid;
|
||||
bool OnAccess; /* If the user is on the access list of the nick theyre on */
|
||||
|
||||
public: // XXX: exposing a tiny bit too much
|
||||
User *next, *prev;
|
||||
|
||||
char nick[NICKMAX];
|
||||
|
||||
char *username; /* ident */
|
||||
char *host; /* User's real hostname */
|
||||
char *hostip; /* User's IP number */
|
||||
char *vhost; /* User's virtual hostname */
|
||||
std::string chost; /* User's cloaked hostname */
|
||||
char *vident; /* User's virtual ident */
|
||||
char *realname; /* Realname */
|
||||
Server *server; /* Server user is connected to */
|
||||
char *nickTrack; /* Nick Tracking */
|
||||
time_t timestamp; /* Timestamp of the nick */
|
||||
time_t my_signon; /* When did _we_ see the user? */
|
||||
time_t svid; /* Services ID */
|
||||
uint32 mode; /* See below */
|
||||
char *uid; /* Univeral ID */
|
||||
|
||||
NickAlias *na;
|
||||
NickCore *nc;
|
||||
|
||||
int isSuperAdmin; /* is SuperAdmin on or off? */
|
||||
|
||||
@@ -62,14 +63,16 @@ class CoreExport User : public Extensible
|
||||
/** Create a new user object, initialising necessary fields and
|
||||
* adds it to the hash
|
||||
*
|
||||
* @parameter nick The nickname of the user account.
|
||||
* @param nick The nickname of the user.
|
||||
* @param uid The unique identifier of the user.
|
||||
*/
|
||||
User(const std::string &nick);
|
||||
User(const std::string &nick, const std::string &uid);
|
||||
|
||||
/** Destroy a user.
|
||||
*/
|
||||
~User();
|
||||
|
||||
|
||||
/** Update the nickname of a user record accordingly, should be
|
||||
* called from ircd protocol.
|
||||
*/
|
||||
@@ -77,13 +80,54 @@ class CoreExport User : public Extensible
|
||||
|
||||
/** Update the displayed (vhost) of a user record.
|
||||
* This is used (if set) instead of real host.
|
||||
* @param host The new displayed host to give the user.
|
||||
*/
|
||||
void SetDisplayedHost(const std::string &host);
|
||||
|
||||
/** Get the displayed vhost of a user record.
|
||||
* @return The displayed vhost of the user, where ircd-supported, or the user's real host.
|
||||
*/
|
||||
const std::string GetDisplayedHost() const;
|
||||
|
||||
/** Update the cloaked host of a user
|
||||
* @param host The cloaked host
|
||||
*/
|
||||
void SetCloakedHost(const std::string &newhost);
|
||||
|
||||
/** Get the cloaked host of a user
|
||||
* @return The cloaked host
|
||||
*/
|
||||
const std::string &GetCloakedHost() const;
|
||||
|
||||
/** Retrieves the UID of the user, where applicable, if set.
|
||||
* This is not used on some IRCds, but is for a lot e.g. P10, TS6 protocols.
|
||||
* @return The UID of the user.
|
||||
*/
|
||||
const std::string &GetUID() const;
|
||||
|
||||
|
||||
/** Update the displayed ident (username) of a user record.
|
||||
* @param ident The new ident to give this user.
|
||||
*/
|
||||
void SetVIdent(const std::string &ident);
|
||||
|
||||
/** Get the displayed ident (username) of this user.
|
||||
* @return The displayed ident of this user.
|
||||
*/
|
||||
const std::string &GetVIdent() const;
|
||||
|
||||
/** Update the real ident (username) of a user record.
|
||||
* @param ident The new ident to give this user.
|
||||
* NOTE: Where possible, you should use the Get/SetVIdent() equivilants.
|
||||
*/
|
||||
void SetIdent(const std::string &ident);
|
||||
|
||||
/** Get the real ident (username) of this user.
|
||||
* @return The displayed ident of this user.
|
||||
* NOTE: Where possible, you should use the Get/SetVIdent() equivilants.
|
||||
*/
|
||||
const std::string &GetIdent() const;
|
||||
|
||||
/** Updates the realname of the user record.
|
||||
*/
|
||||
void SetRealname(const std::string &realname);
|
||||
@@ -97,5 +141,25 @@ class CoreExport User : public Extensible
|
||||
*/
|
||||
void SendMessage(const char *source, const char *fmt, ...);
|
||||
void SendMessage(const char *source, const std::string &msg);
|
||||
|
||||
/** Check if the user should become identified because
|
||||
* their svid matches the one stored in their nickcore
|
||||
* @param svid Services id
|
||||
*/
|
||||
void CheckAuthenticationToken(const char *svid);
|
||||
|
||||
/** Auto identify the user to the given accountname.
|
||||
* @param account Display nick of account
|
||||
*/
|
||||
void AutoID(const char *acc);
|
||||
|
||||
/** Check if the user is recognized for their nick (on the nicks access list)
|
||||
* @return true or false
|
||||
*/
|
||||
const bool IsRecognized() const;
|
||||
|
||||
/** Update the last usermask stored for a user, and check to see if they are recognized
|
||||
*/
|
||||
void UpdateHost();
|
||||
};
|
||||
|
||||
|
||||
+3
-9
@@ -38,15 +38,15 @@ cat >$VERSIONH <<EOF
|
||||
* Please read COPYING and CREDITS for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* This file is auto-generated by version.sh
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
|
||||
#define VERSION_MAJOR $VERSION_MAJOR
|
||||
#define VERSION_MINOR $VERSION_MINOR
|
||||
#define VERSION_PATCH $VERSION_PATCH
|
||||
@@ -67,12 +67,6 @@ cat >$VERSIONH <<EOF
|
||||
# define VER_OS
|
||||
#endif
|
||||
|
||||
#if defined(USE_MYSQL)
|
||||
# define VER_MYSQL "Q"
|
||||
#else
|
||||
# define VER_MYSQL
|
||||
#endif
|
||||
|
||||
#if defined(USE_MODULES)
|
||||
# define VER_MODULE "M"
|
||||
#else
|
||||
|
||||
+84
-52
@@ -26,25 +26,27 @@ var installerQuestions = [
|
||||
'short' : 'Install directory:',
|
||||
'default_answer' : '',
|
||||
'store_answer' : function(answer) {
|
||||
if (!answer) {
|
||||
if (!answer)
|
||||
{
|
||||
WScript.Echo("You must give a directory!\n");
|
||||
return false;
|
||||
}
|
||||
if (!fso.FolderExists(answer)) {
|
||||
if (fso.FileExists(answer)) {
|
||||
if (!fso.FolderExists(answer))
|
||||
{
|
||||
if (fso.FileExists(answer))
|
||||
{
|
||||
WScript.Echo(answer + " exists, but is not a directory!\n");
|
||||
return false;
|
||||
}
|
||||
WScript.Echo(answer + " does not exist. Create it ([yes]/no)?\n");
|
||||
var inputValue = InstallerInput().toLowerCase();
|
||||
if (!inputValue) {
|
||||
if (!inputValue)
|
||||
inputValue = 'yes';
|
||||
}
|
||||
if (inputValue != 'no') {
|
||||
if (inputValue != 'no')
|
||||
fso.CreateFolder(answer);
|
||||
}
|
||||
}
|
||||
else if (fso.FileExists(answer + '\\include\\services.h')) {
|
||||
else if (fso.FileExists(answer + '\\include\\services.h'))
|
||||
{
|
||||
WScript.Echo("You cannot use the Anope source directory as a target directory.\n");
|
||||
return false;
|
||||
}
|
||||
@@ -52,7 +54,7 @@ var installerQuestions = [
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
return '-DINSTDIR:STRING=' + installerResponses['Install Directory'];
|
||||
return '-DINSTDIR:STRING="' + installerResponses['Install Directory'] + '"';
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -75,8 +77,10 @@ var installerQuestions = [
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
if (installerResponses['Use NMake'] == 'yes') return '-G"NMake Makefiles"';
|
||||
else return '';
|
||||
if (installerResponses['Use NMake'] == 'yes')
|
||||
return '-G"NMake Makefiles"';
|
||||
else
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -94,9 +98,12 @@ var installerQuestions = [
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
if (installerResponses['Debug'] == 'msvc') return '';
|
||||
else if (installerResponses['Debug'] == 'yes') return '-DCMAKE_BUILD_TYPE:STRING=DEBUG';
|
||||
else return '-DCMAKE_BUILD_TYPE:STRING=RELEASE';
|
||||
if (installerResponses['Debug'] == 'msvc')
|
||||
return '';
|
||||
else if (installerResponses['Debug'] == 'yes')
|
||||
return '-DCMAKE_BUILD_TYPE:STRING=DEBUG';
|
||||
else
|
||||
return '-DCMAKE_BUILD_TYPE:STRING=RELEASE';
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -115,8 +122,10 @@ var installerQuestions = [
|
||||
return true;
|
||||
},
|
||||
'cmake_argument' : function() {
|
||||
if (installerResponses['Visual Studio 2008'] == 'yes') return '-G"Visual Studio 9 2008"';
|
||||
else return '';
|
||||
if (installerResponses['Visual Studio 2008'] == 'yes')
|
||||
return '-G"Visual Studio 9 2008"';
|
||||
else
|
||||
return '';
|
||||
}
|
||||
},
|
||||
];
|
||||
@@ -137,71 +146,78 @@ var ScriptPath = WScript.ScriptFullName.substr(0, WScript.ScriptFullName.length
|
||||
var fso = WScript.CreateObject('Scripting.FileSystemObject');
|
||||
var x, y, z;
|
||||
|
||||
if (fso.FileExists(ScriptPath + '.BANNER')) {
|
||||
if (fso.FileExists(ScriptPath + '.BANNER'))
|
||||
{
|
||||
var bannerStream = fso.OpenTextFile(ScriptPath + '.BANNER');
|
||||
var bannerText = bannerStream.ReadAll();
|
||||
bannerStream.close();
|
||||
|
||||
for (x in bannerReplacements) {
|
||||
for (x in bannerReplacements)
|
||||
{
|
||||
var thisReplacement = bannerReplacements[x];
|
||||
bannerText = bannerText.replace(thisReplacement['findtext'], thisReplacement['replacement']);
|
||||
}
|
||||
|
||||
WScript.Echo(bannerText + "\n");
|
||||
}
|
||||
else {
|
||||
else
|
||||
WScript.Echo("ERROR: Cannot find banner file!\n");
|
||||
}
|
||||
|
||||
WScript.Echo('Press Enter to Begin...');
|
||||
InstallerInput();
|
||||
WScript.Echo('');
|
||||
|
||||
for (x in installerQuestions) {
|
||||
for (x in installerQuestions)
|
||||
{
|
||||
var thisQuestion = installerQuestions[x];
|
||||
var validResponse = false;
|
||||
var validOpts = new Array();
|
||||
if (thisQuestion.short == 'Build debug?' && installerResponses['Use NMake'] == 'no') {
|
||||
if (thisQuestion.short == 'Build debug?' && installerResponses['Use NMake'] == 'no')
|
||||
{
|
||||
installerResponses['Debug'] = 'msvc';
|
||||
continue;
|
||||
}
|
||||
if (thisQuestion.short == 'Using Visual Studio 2008?' && installerResponses['Debug'] != 'msvc') {
|
||||
if (thisQuestion.short == 'Using Visual Studio 2008?' && installerResponses['Debug'] != 'msvc')
|
||||
{
|
||||
installerResponses['Visual Studio 2008'] = 'no';
|
||||
continue;
|
||||
}
|
||||
while (!validResponse) {
|
||||
for (y in thisQuestion.question) {
|
||||
while (!validResponse)
|
||||
{
|
||||
for (y in thisQuestion.question)
|
||||
{
|
||||
var qLine = thisQuestion.question[y];
|
||||
WScript.Echo(qLine);
|
||||
}
|
||||
WScript.Echo('');
|
||||
var choiceLine = '';
|
||||
if (thisQuestion.options) {
|
||||
for (y in thisQuestion.options) {
|
||||
if (thisQuestion.options)
|
||||
{
|
||||
for (y in thisQuestion.options)
|
||||
{
|
||||
choiceLine += thisQuestion.options[y] + ', ';
|
||||
validOpts[thisQuestion.options[y]] = true;
|
||||
}
|
||||
choiceLine = choiceLine.substring(0, choiceLine.length - 2);
|
||||
WScript.Echo('Available Options: ' + choiceLine);
|
||||
}
|
||||
if (thisQuestion.default_answer) WScript.Echo('Default Answer: ' + thisQuestion.default_answer + "\n");
|
||||
if (thisQuestion.default_answer)
|
||||
WScript.Echo('Default Answer: ' + thisQuestion.default_answer + "\n");
|
||||
WScript.Echo(thisQuestion.short);
|
||||
var inputValue = InstallerInput().toLowerCase();
|
||||
if (!inputValue) {
|
||||
if (!inputValue)
|
||||
inputValue = thisQuestion.default_answer;
|
||||
}
|
||||
if (choiceLine && !validOpts[inputValue]) {
|
||||
if (choiceLine && !validOpts[inputValue])
|
||||
WScript.Echo("ERROR: Invalid option '" + inputValue + "'\n");
|
||||
}
|
||||
else if (thisQuestion.store_answer(inputValue)) {
|
||||
else if (thisQuestion.store_answer(inputValue))
|
||||
validResponse = true;
|
||||
}
|
||||
}
|
||||
WScript.Echo('');
|
||||
}
|
||||
|
||||
WScript.Echo("\nAnope will be compiled with the following options:\n");
|
||||
for (x in installerResponses) {
|
||||
for (x in installerResponses)
|
||||
{
|
||||
var thisResponse = installerResponses[x];
|
||||
WScript.Echo("\t" + x + ":\t\t[" + thisResponse.toUpperCase() + "]");
|
||||
}
|
||||
@@ -210,59 +226,75 @@ WScript.Echo("\nTo continue, please press Enter...");
|
||||
InstallerInput();
|
||||
|
||||
var cmake = 'cmake';
|
||||
for (x in installerQuestions) {
|
||||
for (x in installerQuestions)
|
||||
{
|
||||
var thisQuestion = installerQuestions[x];
|
||||
cmake += ' ' + thisQuestion.cmake_argument();
|
||||
}
|
||||
cmake += ' "' + ScriptPath + '"';
|
||||
var fixedScriptPath = ScriptPath.replace(/\\/g, '/');
|
||||
cmake += ' "' + fixedScriptPath + '"';
|
||||
WScript.Echo(cmake + "\n");
|
||||
|
||||
var shell = WScript.CreateObject('WScript.Shell');
|
||||
var cmake_shell = shell.exec('%comspec% /c ' + cmake);
|
||||
while (!cmake_shell.StdOut.AtEndOfStream) {
|
||||
var strLine = cmake_shell.StdOut.ReadLine();
|
||||
WScript.Echo(strLine);
|
||||
while (!cmake_shell.Status)
|
||||
{
|
||||
if (!cmake_shell.StdOut.AtEndOfStream)
|
||||
WScript.Echo(cmake_shell.StdOut.ReadLine());
|
||||
else if (!cmake_shell.StdErr.AtEndOfStream)
|
||||
WScript.Echo(cmake_shell.StdErr.ReadLine());
|
||||
}
|
||||
|
||||
if (installerResponses['Use NMake'] == 'yes') WScript.Echo("\nTo compile Anope, run 'nmake'. To install, run 'nmake install'.\n");
|
||||
else WScript.Echo("\nTo compile Anope, open Anope.sln and build the solution. To install,\ndo a build on the INSTALL project.\n");
|
||||
WScript.Echo("If you update Anope, you should run this script again to ensure\nall available options are set.\n");
|
||||
if (cmake_shell.ExitCode == 0)
|
||||
{
|
||||
if (installerResponses['Use NMake'] == 'yes') WScript.Echo("\nTo compile Anope, run 'nmake'. To install, run 'nmake install'.\n");
|
||||
else WScript.Echo("\nTo compile Anope, open Anope.sln and build the solution. To install,\ndo a build on the INSTALL project.\n");
|
||||
WScript.Echo("If you update Anope, you should run this script again to ensure\nall available options are set.\n");
|
||||
}
|
||||
else
|
||||
WScript.Echo("\nThere was an error attempting to run CMake! Check the above error message,\nand contact the Anope team if you are unsure how to proceed.\n");
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
// Functions
|
||||
|
||||
function FindAnopeVersion() {
|
||||
if (!fso.FileExists(ScriptPath + 'version.log')) {
|
||||
if (!fso.FileExists(ScriptPath + 'version.log'))
|
||||
{
|
||||
anopeVersion = 'Unknown';
|
||||
return;
|
||||
}
|
||||
|
||||
var versionLog = fso.OpenTextFile(ScriptPath + 'version.log');
|
||||
while (!versionLog.atEndOfStream) {
|
||||
while (!versionLog.atEndOfStream)
|
||||
{
|
||||
var versionLine = versionLog.readline();
|
||||
var thisMatch = versionLine.replace('\n', '');
|
||||
while (thisMatch.match(/\"/g)) {
|
||||
while (thisMatch.match(/\"/g))
|
||||
thisMatch = thisMatch.replace('"', '');
|
||||
}
|
||||
versionLine = thisMatch;
|
||||
if (versionLine.match(/VERSION_MAJOR=/g)) {
|
||||
if (versionLine.match(/VERSION_MAJOR=/g))
|
||||
{
|
||||
vMaj = versionLine.replace('VERSION_MAJOR=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_MINOR=/g)) {
|
||||
if (versionLine.match(/VERSION_MINOR=/g))
|
||||
{
|
||||
vMin = versionLine.replace('VERSION_MINOR=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_PATCH=/g)) {
|
||||
if (versionLine.match(/VERSION_PATCH=/g))
|
||||
{
|
||||
vPat = versionLine.replace('VERSION_PATCH=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_EXTRA=/g)) {
|
||||
if (versionLine.match(/VERSION_EXTRA=/g))
|
||||
{
|
||||
vExtra = versionLine.replace('VERSION_EXTRA=', '');
|
||||
continue;
|
||||
}
|
||||
if (versionLine.match(/VERSION_BUILD=/g)) {
|
||||
if (versionLine.match(/VERSION_BUILD=/g))
|
||||
{
|
||||
vBuild = versionLine.replace('VERSION_BUILD=', '');
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-3
@@ -53,9 +53,7 @@ add_to_cpack_ignored_files("${index_RELATIVE}$")
|
||||
|
||||
# Find all the *.l files within the current source directory, and sort the list
|
||||
file(GLOB LANG_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.l")
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT LANG_SRCS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
sort_list(LANG_SRCS)
|
||||
|
||||
# Iterate through the language files
|
||||
foreach(LANG_L ${LANG_SRCS})
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ tr: tr.l langcomp index
|
||||
@./langcomp $@.l $@
|
||||
|
||||
langcomp: langcomp.c
|
||||
@$(MAKEBIN) $(CC) $(CFLAGS) langcomp.c -o $@
|
||||
$(MAKEBIN) $(CC) $(CFLAGS) langcomp.c -o $@
|
||||
|
||||
|
||||
language.h: index Makefile
|
||||
|
||||
+126
-432
File diff suppressed because it is too large
Load Diff
@@ -152,6 +152,15 @@ STRFTIME_MONTHS_LONG
|
||||
COMMA_SPACE
|
||||
,
|
||||
|
||||
# Command help replies
|
||||
COMMAND_REQUIRES_PERM
|
||||
Access to this command requires the permission %s to be present in your opertype.
|
||||
COMMAND_IDENTIFY_REQUIRED
|
||||
You need to be identified to use this command.
|
||||
COMMAND_CANNOT_USE
|
||||
You cannot use this command.
|
||||
COMMAND_CAN_USE
|
||||
You can use this command.
|
||||
|
||||
# Various error messages.
|
||||
USER_RECORD_NOT_FOUND
|
||||
@@ -186,18 +195,8 @@ PASSWORD_INCORRECT
|
||||
INVALID_TARGET
|
||||
"/msg %s" wird nicht mehr unterstützt. Benutze "/msg %s@%s" oder "/%s" stattdessen.
|
||||
|
||||
# What's the difference between "Access denied" and "Permission denied"?
|
||||
# Very little; you can safely make them the same message with no real loss
|
||||
# of meaning. If you want to make a distinction, "Access denied" is
|
||||
# usually used more generally; for example, a non-oper trying to access
|
||||
# OperServ gets "Access denied", while a non-Services admin trying to use
|
||||
# NickServ SET NOEXPIRE gets "Permission denied".
|
||||
ACCESS_DENIED
|
||||
Zugriff verweigert.
|
||||
PERMISSION_DENIED
|
||||
Berechtigung nicht ausreichend.
|
||||
RAW_DISABLED
|
||||
RAW wurde deaktiviert. Um RAW nutzen zu können, muss DisableRaw in der Services Config Datei deaktiviert werden.
|
||||
|
||||
MORE_OBSCURE_PASSWORD
|
||||
Bitte versuche es nochmal mit einem besseren Passwort.
|
||||
@@ -330,27 +329,6 @@ CS_LIST_INCORRECT_RANGE
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# Automatic messages
|
||||
HELP_LIMIT_SERV_OPER
|
||||
Diese Funktion ist beschränkt auf Services Operatoren.
|
||||
HELP_LIMIT_SERV_ADMIN
|
||||
Diese Funktion ist beschränkt auf Services Administratoren.
|
||||
HELP_LIMIT_SERV_ROOT
|
||||
Diese Funktion ist beschränkt auf Services Root-Administratoren.
|
||||
HELP_LIMIT_IRC_OPER
|
||||
Diese Funktion ist beschränkt auf IRC Operatoren.
|
||||
HELP_LIMIT_HOST_SETTER
|
||||
Diese Funktion ist beschränkt auf Host Setters.
|
||||
HELP_LIMIT_HOST_REMOVER
|
||||
Diese Funktion ist beschränkt auf Host Removers.
|
||||
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# NickServ messages
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# Automatic messages
|
||||
NICK_IS_REGISTERED
|
||||
Dieser Nickname gehört schon jemand anderem. Bitte wähle einen anderen.
|
||||
@@ -553,7 +531,7 @@ NICK_SET_PRIVATE_OFF
|
||||
|
||||
# SET HIDE responses
|
||||
NICK_SET_HIDE_SYNTAX
|
||||
SET HIDE {EMAIL | USERMASK | QUIT} {ON | OFF}
|
||||
SET HIDE {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}
|
||||
NICK_SET_HIDE_EMAIL_ON
|
||||
Deine eMail-Adresse wird jetzt in der %s INFO Anzeige nicht mehr erscheinen.
|
||||
NICK_SET_HIDE_EMAIL_OFF
|
||||
@@ -675,7 +653,7 @@ NICK_SASET_PRIVATE_OFF
|
||||
|
||||
# SASET HIDE responses
|
||||
NICK_SASET_HIDE_SYNTAX
|
||||
SASET nickname HIDE {EMAIL | USERMASK | QUIT} {ON | OFF}
|
||||
SASET nickname HIDE {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}
|
||||
NICK_SASET_HIDE_EMAIL_ON
|
||||
Die Emailadresse %s wird jetzt bei %s INFO Abrufen versteckt.
|
||||
NICK_SASET_HIDE_EMAIL_OFF
|
||||
@@ -750,26 +728,16 @@ NICK_ACCESS_LIST_X_EMPTY
|
||||
Die Access-Liste für %s leer.
|
||||
|
||||
# Status messages
|
||||
NICK_STATUS_0
|
||||
STATUS %s 0
|
||||
NICK_STATUS_1
|
||||
STATUS %s 1
|
||||
NICK_STATUS_2
|
||||
STATUS %s 2
|
||||
NICK_STATUS_3
|
||||
STATUS %s 3
|
||||
NICK_STATUS_REPLY
|
||||
STATUS %s %d %s
|
||||
|
||||
# INFO responses
|
||||
NICK_INFO_SYNTAX
|
||||
INFO Nickname [ALL]
|
||||
NICK_INFO_REALNAME
|
||||
%s ist %s
|
||||
NICK_INFO_SERVICES_OPER
|
||||
%s ist ein Services Operator.
|
||||
NICK_INFO_SERVICES_ADMIN
|
||||
%s ist ein Services Administrator.
|
||||
NICK_INFO_SERVICES_ROOT
|
||||
%s ist ein Services Root Administrator.
|
||||
NICK_INFO_SERVICES_OPERTYPE
|
||||
%s is a services operator of type %s.
|
||||
NICK_INFO_ADDRESS
|
||||
Letzte gesehene Hostmaske: %s
|
||||
NICK_INFO_ADDRESS_ONLINE
|
||||
@@ -1087,11 +1055,6 @@ CHAN_REGISTER_DISABLED
|
||||
Die Registrierung von Channels ist derzeit deaktiviert.
|
||||
CHAN_REGISTER_NOT_LOCAL
|
||||
Lokale Channels können nicht registriert werden.
|
||||
CHAN_MUST_REGISTER_NICK
|
||||
Du musst erst deinen Nicknamen registrieren. Tippe %R%s HELP REGISTER um Hilfe zu erhalten.
|
||||
CHAN_MUST_IDENTIFY_NICK
|
||||
Bitte identifiziere dich zuerst durch %s, in dem du diesen Befehl benutzt:
|
||||
%R%s IDENTIFY Passwort
|
||||
CHAN_MAY_NOT_BE_REGISTERED
|
||||
Der Channel %s kann nicht registriert werden.
|
||||
CHAN_ALREADY_REGISTERED
|
||||
@@ -1131,6 +1094,8 @@ CHAN_LOGOUT_SUCCEEDED
|
||||
Der User %s wurde vom Channel %s ausgeloggt.
|
||||
CHAN_LOGOUT_ALL_SUCCEEDED
|
||||
Alle identifizierten User wurden vom Channel ausgeloggt %s (except the channel founder).
|
||||
CHAN_LOGOUT_NOT_LOGGEDIN
|
||||
%s was not logged into %s.
|
||||
|
||||
# DROP responses
|
||||
CHAN_DROP_SYNTAX
|
||||
@@ -1567,7 +1532,7 @@ CHAN_LEVELS_RESET
|
||||
|
||||
# Status Messages
|
||||
CHAN_STATUS_SYNTAX
|
||||
STATUS ERROR Syntax error
|
||||
STATUS channel item
|
||||
CHAN_STATUS_NOT_REGGED
|
||||
STATUS ERROR Channel %s ist nicht registriert
|
||||
CHAN_STATUS_FORBIDDEN
|
||||
@@ -1656,6 +1621,10 @@ CHAN_LIST_END
|
||||
# CLIST responses
|
||||
CHAN_INVITE_SYNTAX
|
||||
INVITE Channel
|
||||
CHAN_INVITE_ALREADY_IN
|
||||
You are already in %s!
|
||||
CHAN_INVITE_SUCCESS
|
||||
You have been invited to %s.
|
||||
|
||||
# UNBAN responses
|
||||
CHAN_UNBAN_SYNTAX
|
||||
@@ -1701,7 +1670,7 @@ CHAN_GETKEY_SYNTAX
|
||||
CHAN_GETKEY_NOKEY
|
||||
Der Channel %s hat keinen Schlüßel.
|
||||
CHAN_GETKEY_KEY
|
||||
KEY %s %s
|
||||
Key for channel %s is %s.
|
||||
|
||||
# SENDPASS responses
|
||||
CHAN_SENDPASS_SYNTAX
|
||||
@@ -1764,6 +1733,36 @@ CHAN_UNSUSPEND_FAILED
|
||||
# Misc responses
|
||||
CHAN_EXCEPTED
|
||||
%s passt zur Ausnahme von %s und kann nicht gebannt werden, solange die Ausnahme nicht gelöscht wird.
|
||||
|
||||
#Mode syntax responses
|
||||
CHAN_OP_SYNTAX
|
||||
OP #channel [nick]
|
||||
CHAN_HALFOP_SYNTAX
|
||||
HALFOP #channel [nick]
|
||||
CHAN_VOICE_SYNTAX
|
||||
VOICE #channel [nick]
|
||||
CHAN_PROTECT_SYNTAX
|
||||
PROTECT #channel [nick]
|
||||
CHAN_OWNER_SYNTAX
|
||||
OWNER #channel
|
||||
CHAN_DEOP_SYNTAX
|
||||
DEOP #channel [nick]
|
||||
CHAN_DEHALFOP_SYNTAX
|
||||
DEHALFOP #channel [nick]
|
||||
CHAN_DEVOICE_SYNTAX
|
||||
DEVOICE #channel [nick]
|
||||
CHAN_DEPROTECT_SYNTAX
|
||||
DEROTECT #channel [nick]
|
||||
CHAN_DEOWNER_SYNTAX
|
||||
DEOWNER #channel
|
||||
|
||||
#Kick responces
|
||||
CHAN_KICK_SYNTAX
|
||||
KICK #channel nick [reason]
|
||||
|
||||
#Ban responces
|
||||
CHAN_BAN_SYNTAX
|
||||
BAN #channel nick [reason]
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
@@ -1820,7 +1819,11 @@ MEMO_X_HAS_TOO_MANY_MEMOS
|
||||
%s hat zu viele Memos gespeichert und kann keine weiteren empfangen.
|
||||
MEMO_SENT
|
||||
Memo wurde an %s versandt.
|
||||
|
||||
|
||||
# STAFF responses
|
||||
MEMO_STAFF_SYNTAX
|
||||
STAFF memo-text
|
||||
|
||||
# CANCEL responses
|
||||
MEMO_MASS_SENT
|
||||
Ein Massen-Memo wurde an alle regsitrierte User gesendet.
|
||||
@@ -1889,7 +1892,7 @@ MEMO_SET_UNKNOWN_OPTION
|
||||
|
||||
# SET NOTIFY responses
|
||||
MEMO_SET_NOTIFY_SYNTAX
|
||||
SET NOTIFY {ON | LOGON | NEW | OFF}
|
||||
SET NOTIFY {ON | LOGON | NEW | MAIL | NOMAIL | OFF }
|
||||
MEMO_SET_NOTIFY_ON
|
||||
%s wird dich beim Einloggen über eingegangene Memos informieren.
|
||||
MEMO_SET_NOTIFY_LOGON
|
||||
@@ -2611,72 +2614,6 @@ OPER_SVSNICK_SYNTAX
|
||||
SVSNICK Nickname Neuer-Nickname
|
||||
OPER_SVSNICK_NEWNICK
|
||||
Der Nickname %s wird jetzt zu %s geändert.
|
||||
|
||||
# ADMIN responses
|
||||
OPER_ADMIN_SYNTAX
|
||||
ADMIN {ADD|DEL|LIST|CLEAR} [Nickname | entry-liste]
|
||||
OPER_ADMIN_SKELETON
|
||||
Services sind im Basis-Modus. Das ADMIN-Befehl ist nicht verfügbar.
|
||||
OPER_ADMIN_EXISTS
|
||||
%s existiert bereits auf der Services Administratoren-Liste.
|
||||
OPER_ADMIN_REACHED_LIMIT
|
||||
Du kannst nur %d Services Administratoren haben.
|
||||
OPER_ADMIN_ADDED
|
||||
%s wurde zur Liste der Services Administratoren hinzugefügt.
|
||||
OPER_ADMIN_NOT_FOUND
|
||||
%s wurde nicht auf der Liste der Services Administratoren gefunden.
|
||||
OPER_ADMIN_NO_MATCH
|
||||
Keine entsprechenden Einträge in der Services Administratoren-Liste gefunden.
|
||||
OPER_ADMIN_DELETED
|
||||
%s wurde aus der Services Administratoren-Liste entfernt.
|
||||
OPER_ADMIN_DELETED_ONE
|
||||
Es wurde 1 Eintrag aus der Services Administratoren-Liste entfernt.
|
||||
OPER_ADMIN_DELETED_SEVERAL
|
||||
Es wurden %d Einträge aus der Services Administratoren-Liste entfernt.
|
||||
OPER_ADMIN_LIST_EMPTY
|
||||
Die Services Administratoren-Liste ist leer.
|
||||
OPER_ADMIN_LIST_HEADER
|
||||
Services Administratoren-Liste:
|
||||
Nummer Nickname
|
||||
OPER_ADMIN_LIST_FORMAT
|
||||
%3d %s
|
||||
OPER_ADMIN_CLEAR
|
||||
Die Liste der Services Administratoren wurde geleert.
|
||||
OPER_ADMIN_MOVED
|
||||
%s wurde zu der Services Administratoren-Liste verschoben.
|
||||
|
||||
# OPER responses
|
||||
OPER_OPER_SYNTAX
|
||||
OPER {ADD|DEL|LIST|CLEAR} [Nickname | entry-liste]
|
||||
OPER_OPER_SKELETON
|
||||
Services sind im Basis-Modus. Das OPER-Befehl ist nicht verfügbar.
|
||||
OPER_OPER_EXISTS
|
||||
%s existiert bereits auf der Services Operatoren-Liste.
|
||||
OPER_OPER_REACHED_LIMIT
|
||||
Du kannst nur %d Services Operatoren haben.
|
||||
OPER_OPER_ADDED
|
||||
%s wurde zur der Services Operatoren-Liste hinzugefügt.
|
||||
OPER_OPER_NOT_FOUND
|
||||
%s wurde nicht auf der Services Operatoren-Liste gefunden.
|
||||
OPER_OPER_NO_MATCH
|
||||
Keine entsprechenden Einträge in der Services Operatoren-Liste gefunden.
|
||||
OPER_OPER_DELETED
|
||||
%s wurde aus der Services Operatoren-Liste entfernt.
|
||||
OPER_OPER_DELETED_ONE
|
||||
Es wurde 1 Eintrag aus der Services Operatoren-Liste entfernt.
|
||||
OPER_OPER_DELETED_SEVERAL
|
||||
Es wurden %d Einträge aus der Services Operatoren-Liste entfernt.
|
||||
OPER_OPER_LIST_EMPTY
|
||||
Die Services Operatoren-Liste ist leer.
|
||||
OPER_OPER_LIST_HEADER
|
||||
Services Operatoren-Liste:
|
||||
Nummer Nickname
|
||||
OPER_OPER_LIST_FORMAT
|
||||
%3d %s
|
||||
OPER_OPER_CLEAR
|
||||
Die Liste der Services Operatoren wurde geleert.
|
||||
OPER_OPER_MOVED
|
||||
%s wurde zu der Services Operatoren-Liste verschoben.
|
||||
|
||||
# AKILL responses
|
||||
OPER_AKILL_SYNTAX
|
||||
@@ -2884,17 +2821,6 @@ OPER_SET_NOEXPIRE_ERROR
|
||||
Die Einstellung von NOEXPIRE kann nur ON oder OFF sein.
|
||||
OPER_SET_UNKNOWN_OPTION
|
||||
Unbekannte Option %s.
|
||||
OPER_SET_SQL_ON
|
||||
SQL code wird jetzt benutzt.
|
||||
OPER_SET_SQL_OFF
|
||||
SQL code wird jetzt NICHT mehr benutzt.
|
||||
OPER_SET_SQL_ERROR
|
||||
Einstellungen für SQL können nur ON oder OFF sein.
|
||||
OPER_SET_SQL_ERROR_INIT
|
||||
SQL FEHLER, schaue bitte in deine Logs nach um zu sehen wie du es berichtigen kannst.
|
||||
OPER_SET_SQL_ERROR_DISABLED
|
||||
SQL ist für den Netzwerk nicht konfiguriert. Um SQL code zu
|
||||
benutzen mußt du es in deine services.conf richtig Konfigurieren.
|
||||
OPER_SET_LIST_OPTION_ON
|
||||
%s ist eingeschaltet
|
||||
OPER_SET_LIST_OPTION_OFF
|
||||
@@ -2911,14 +2837,10 @@ OPER_NOOP_REVOKE
|
||||
# JUPE responses
|
||||
OPER_JUPE_SYNTAX
|
||||
JUPE Servername [Grund]
|
||||
|
||||
# RAW responses
|
||||
OPER_JUPE_HOST_ERROR
|
||||
Benutze bitte einen gültigen hostnamen, wenn du jupiterst
|
||||
|
||||
# RAW responses
|
||||
OPER_RAW_SYNTAX
|
||||
RAW Text
|
||||
OPER_JUPE_INVALID_SERVER
|
||||
You can not jupe your services server or your uplink server.
|
||||
|
||||
# UPDATE responses
|
||||
OPER_UPDATING
|
||||
@@ -2934,7 +2856,7 @@ OPER_CANNOT_RESTART
|
||||
|
||||
# IGNORE respondes
|
||||
OPER_IGNORE_SYNTAX
|
||||
Syntax: IGNORE {ADD|DEL|LIST|CLEAR} [Zeit] [Nickname | Hostmaske]
|
||||
IGNORE {ADD|DEL|LIST|CLEAR} [Zeit] [Nickname | Hostmaske]
|
||||
OPER_IGNORE_VALID_TIME
|
||||
Du musst eine zulässige Zahl als Zeit eingeben.
|
||||
OPER_IGNORE_TIME_DONE
|
||||
@@ -3012,7 +2934,7 @@ OPER_STAFF_FORMAT
|
||||
OPER_STAFF_AFORMAT
|
||||
%c %s %s [%s]
|
||||
OPER_DEFCON_SYNTAX
|
||||
Syntax: DEFCON [1|2|3|4|5]
|
||||
DEFCON [1|2|3|4|5]
|
||||
OPER_DEFCON_DENIED
|
||||
Dieser Service ist derzeit deaktiviert, bitte versuche es später nochmal
|
||||
OPER_DEFCON_NO_CONF
|
||||
@@ -3284,7 +3206,7 @@ NEWS_RANDOM_TEXT
|
||||
[Random News - %s] %s
|
||||
|
||||
NEWS_LOGON_SYNTAX
|
||||
Syntax: LOGONNEWS {ADD|DEL|LIST} [Text|Nummer]
|
||||
LOGONNEWS {ADD|DEL|LIST} [Text|Nummer]
|
||||
NEWS_LOGON_LIST_HEADER
|
||||
Logon News Einträge:
|
||||
NEWS_LOGON_LIST_ENTRY
|
||||
@@ -3310,7 +3232,7 @@ NEWS_LOGON_DELETED_ALL
|
||||
Alle Logon-News wurden entfernt.
|
||||
|
||||
NEWS_OPER_SYNTAX
|
||||
Syntax: OPERNEWS {ADD|DEL|LIST} [Text|Nummer]
|
||||
OPERNEWS {ADD|DEL|LIST} [Text|Nummer]
|
||||
NEWS_OPER_LIST_HEADER
|
||||
Oper News Einträge:
|
||||
NEWS_OPER_LIST_ENTRY
|
||||
@@ -3336,7 +3258,7 @@ NEWS_OPER_DELETED_ALL
|
||||
Alle Oper-News-Einträge wurden entfernt.
|
||||
|
||||
NEWS_RANDOM_SYNTAX
|
||||
Syntax: RANDOMNEWS {ADD|DEL|LIST} [Text|Nummer]
|
||||
RANDOMNEWS {ADD|DEL|LIST} [Text|Nummer]
|
||||
NEWS_RANDOM_LIST_HEADER
|
||||
Random news Einträge:
|
||||
NEWS_RANDOM_LIST_ENTRY
|
||||
@@ -3368,15 +3290,12 @@ NEWS_HELP_LOGON
|
||||
|
||||
Zeigt oder bearbeitet die Liste der LogonNews.
|
||||
Nach der Verbindung des Users werden diese Nachrichten
|
||||
angezeigt. (Es werden jedoch nur max. %s angezeigt, um ein
|
||||
angezeigt. (Es werden jedoch nur max. %d angezeigt, um ein
|
||||
Flooding des Users zu verhindern. Wenn mehr News
|
||||
existieren, werden nur die neuesten angezeigt.)
|
||||
NewsCount can be configured in services.conf.
|
||||
|
||||
LOGONNEWS LIST kann von jedem IRC Operator benutzt werden
|
||||
um die aktuelle Liste der Logon News anzeigen zu lassen.
|
||||
ADD oder DEL können allerdings nur von Services Admins
|
||||
ausgeführt werden.
|
||||
Diese Funktion ist beschr?nkt auf die Services Administartoren.
|
||||
|
||||
NEWS_HELP_OPER
|
||||
Syntax: OPERNEWS ADD Text
|
||||
@@ -3386,15 +3305,12 @@ NEWS_HELP_OPER
|
||||
Zeigt oder bearbeitet die Liste der Oper-News.Nachdem
|
||||
sich ein User die Oper-Flags gesetzt hat (mit dem
|
||||
/OPER Befehl) werden ihm diese Nachrichten angezeigt.
|
||||
(Es werden jedoch nur max. %s Nachrichten angezeigt, um ein
|
||||
(Es werden jedoch nur max. %d Nachrichten angezeigt, um ein
|
||||
Flooding des Users zu verhindern. Wenn mehr News
|
||||
existieren, werden nur die neüsten angezeigt.)
|
||||
NewsCount can be configured in services.conf.
|
||||
|
||||
OPERNEWS LIST kann von jedem IRC Operator benutzt werden
|
||||
um die aktuelle Liste der Oper-News anzeigen zu lassen.
|
||||
ADD oder DEL können allerdings nur von Services Admins
|
||||
ausgeführt werden.
|
||||
Diese Funktion ist beschr?nkt auf die Services Administartoren.
|
||||
|
||||
NEWS_HELP_RANDOM
|
||||
Syntax: RANDOMNEWS ADD Text
|
||||
@@ -3405,42 +3321,7 @@ NEWS_HELP_RANDOM
|
||||
Wenn ein User zum Network verbindet, wird eine (und nur eine!) dieser
|
||||
RandomNews Nachrichten zufällig gewählt und an den User gesendet.
|
||||
|
||||
RANDOMNEWS LIST kann von jedem IRC Operator genutzt werden um die
|
||||
aktuellen News Nachrichten aufzulisten. ADD und DEL können nur von
|
||||
Services Administratoren genutzt werden.
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# HelpServ help message ## 20.10.2004 ##
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
HELP_HELP
|
||||
%S dient dazu, Hilfe und weitere Informationen zu den Services
|
||||
auszugeben. Eine Themenübersicht bekommt man mit Hilfe des
|
||||
HELP Befehls der anderen Services:
|
||||
|
||||
%R%s HELP
|
||||
für Informationen zum Registrieren der Nicknames
|
||||
|
||||
%R%s HELP
|
||||
für Informationen zum Registrieren und Kontrollieren der
|
||||
Channels
|
||||
|
||||
%R%s HELP
|
||||
für Informationen zum Senden von Memos an User, die im
|
||||
Moment nicht online sind
|
||||
|
||||
HELP_HELP_BOT
|
||||
|
||||
%R%s HELP
|
||||
für Informationen wie man einen Bot in einem Channel
|
||||
einrichtet
|
||||
|
||||
HELP_HELP_HOST
|
||||
|
||||
%R%s HELP
|
||||
für Informationen über vHosts Einstellungen
|
||||
Diese Funktion ist beschr?nkt auf die Services Administartoren.
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
@@ -3564,7 +3445,7 @@ NICK_HELP_REGISTER
|
||||
die dann automatisch die gleiche Konfiguration und
|
||||
Channel-Privilegien bekommen. Für weitere Informationen
|
||||
über diese Funktion tippe %R%S HELP GROUP.
|
||||
|
||||
|
||||
NICK_HELP_GROUP
|
||||
Syntax: GROUP Ziel Passwort
|
||||
|
||||
@@ -4118,10 +3999,11 @@ NICK_HELP_STATUS
|
||||
Nutzer des Nicknamens der identifizierte Eigentümer ist, oder
|
||||
nicht.Die Antwort hat das Format:
|
||||
|
||||
Nickname Status-Code
|
||||
Nickname Status-Code Account
|
||||
|
||||
wobei Nickname der Nickname ist, der mit dem Befehl angefragt
|
||||
wurde und Status-Code eine der folgenden Werte:
|
||||
where Nickname is the nickname sent with the command,
|
||||
Status-Code is one of the following, and Account
|
||||
is the account they are logged in as.
|
||||
|
||||
0 - User ist nicht online oder Nickname ist nicht registriert
|
||||
1 - User wird nicht als Eigentümer erkannt
|
||||
@@ -4144,9 +4026,6 @@ NICK_HELP_SENDPASS
|
||||
|
||||
Kann in manchen Netzen auf IRC Operatoren begrenzt
|
||||
sein.
|
||||
|
||||
Dieses Kommando ist nicht verfügbar, wenn die Datenbanken
|
||||
verschlüsselt angelegt sind.
|
||||
|
||||
NICK_HELP_CONFIRM
|
||||
Syntax: CONFIRM passcode
|
||||
@@ -4197,9 +4076,6 @@ NICK_SERVADMIN_HELP_DROP
|
||||
Mit dem Nicknamen als Parameter, wird dieser Nickname
|
||||
von der Datenbank entfernt. Du kannst jeden Nickname
|
||||
in deiner Gruppe ohne bestimmte Privilegien entfernen.
|
||||
|
||||
Das Entfernen eines beliebigen Nicknamen ist beschränkt
|
||||
auf Services Administratoren.
|
||||
|
||||
NICK_SERVADMIN_HELP_INFO
|
||||
|
||||
@@ -4353,8 +4229,7 @@ CHAN_HELP_CMD_GETKEY
|
||||
CHAN_HELP_CMD_INFO
|
||||
INFO Zeigt Informationen über den angegebenen Channel
|
||||
CHAN_HELP_CMD_INVITE
|
||||
INVITE Veranlaßt den ChanServ den angegebenen Nickname in
|
||||
einen Channel eizuladen
|
||||
INVITE Tells ChanServ to invite you into a channel
|
||||
CHAN_HELP_CMD_KICK
|
||||
KICK Kickt den angegebenen Nicknamen aus einen Channel
|
||||
CHAN_HELP_CMD_LIST
|
||||
@@ -4643,13 +4518,9 @@ CHAN_HELP_SET_PRIVATE
|
||||
CHAN_HELP_SET_RESTRICTED
|
||||
Syntax: SET Channel RESTRICTED {ON | OFF}
|
||||
|
||||
Aktiviert oder deaktiviert den restricted access
|
||||
(beschränkter Zugriff)-Modi für einen Channel. Wenn
|
||||
restricted access eingeschaltet ist, werden
|
||||
User die sonst keinen Channel Operator-Status besitzen
|
||||
würden (Nicknamen mit negativem Zugriffslevel, oder wenn
|
||||
Secure Ops aktiv ist, Nicknamen die nicht auf der
|
||||
Zugriffsliste sind) vom Channel gekicked und gebanned.
|
||||
Enables or disables the restricted access option for a
|
||||
channel. When restricted access is set, users not on the access list will
|
||||
instead be kicked and banned from the channel.
|
||||
|
||||
CHAN_HELP_SET_SECURE
|
||||
Syntax: SET Channel SECURE {ON | OFF}
|
||||
@@ -5057,124 +4928,100 @@ CHAN_HELP_LIST
|
||||
ohne '#' angegeben werden.
|
||||
|
||||
CHAN_HELP_OP
|
||||
Syntax: OP [Channel [Nickname]]
|
||||
Syntax: OP Channel [Nickname]
|
||||
|
||||
Setzt den Operator-Status des angegebenen Nicknamen
|
||||
in dem Channel. Wird kein Nickname angegeben, wird
|
||||
ChanServ dich oppen, vorausgesetzt, du hast die
|
||||
entsprechenden Rechte in der Zugriffsliste um
|
||||
diesen Befehl auszuführen.
|
||||
in dem Channel. If nick is not given,
|
||||
it will op you.
|
||||
|
||||
Standardmässig ist dafür ein Level von 5 oder
|
||||
grösser erforderlich.
|
||||
|
||||
CHAN_HELP_DEOP
|
||||
Syntax: DEOP [Channel [Nickname]]
|
||||
Syntax: DEOP #Channel [Nickname]
|
||||
|
||||
Entfernt den Operator-Status eines bestimmten Nickname
|
||||
in dem Channel. Wird kein Nickname angegeben, wird ChanServ
|
||||
dich deoppen. Wird weder Channel noch Nick als Parameter
|
||||
übergeben, wird ChanServ dich in allen Channels deoppen
|
||||
in denen du die entsprechenden Rechte hast.
|
||||
dich deoppen.
|
||||
|
||||
Standardmässig ist dafür ein Level von 5 oder
|
||||
grösser erforderlich.
|
||||
|
||||
CHAN_HELP_VOICE
|
||||
Syntax: VOICE [Channel [Nickname]]
|
||||
Syntax: VOICE #Channel [Nickname]
|
||||
|
||||
Erteilt dem angegebenen Nickname Voice-Status in dem
|
||||
Channel. Wird kein Nick angegeben, wird ChanServ dich
|
||||
voicen. Wird weder Channel noch Nickane angegeben, wird
|
||||
ChanServ dich in allen Channels voicen, in denen du
|
||||
die entsprechenden Rechte hast.
|
||||
voicen.
|
||||
|
||||
Standardmässig brauchst du dafür ein Level von 5
|
||||
um anderen Voice zu erteilen, oder Level 3 um dich
|
||||
selbst zu voicen.
|
||||
|
||||
CHAN_HELP_DEVOICE
|
||||
Syntax: DEVOICE [Channel [Nickname]]
|
||||
Syntax: DEVOICE #Channel [Nickname]
|
||||
|
||||
Entfernt den Voice-Status des Nicknamen in dem Channel.
|
||||
Wird kein Nickname angegeben, wird ChanServ dich devoicen.
|
||||
Wird weder Channel noch Nick angegeben, wird ChanServ
|
||||
dich in allen Channels voicen, in denen du die
|
||||
entsprechenden Rechte hast.
|
||||
If nick is not given, it will devoice you.
|
||||
|
||||
Standardmässig brauchst du dafür ein Level von 5
|
||||
um andere zu devoicen, oder Level 3 um dich selbst
|
||||
vom Voice-Flag zu befreien.
|
||||
|
||||
CHAN_HELP_HALFOP
|
||||
Syntax: HALFOP [Channel [Nickname]]
|
||||
Syntax: HALFOP #Channel [Nickname]
|
||||
|
||||
Setzt den Half-Op-Status des angegebenen Nicknamen in dem
|
||||
Channel. Wird kein Nickname angegeben, wird ChanServ dich
|
||||
halfoppen. Wird weder Channel noch Nickname angegeben,
|
||||
wird ChanServ dich in allen Channels halfoppen, in denen
|
||||
du die entsprechenden Rechte hast.
|
||||
halfoppen.
|
||||
|
||||
Standardmässig brauchst du dafür ein Level von 5
|
||||
um andere zu halfoppen, oder Level 4 um dich selbst zu
|
||||
halfoppen.
|
||||
|
||||
CHAN_HELP_DEHALFOP
|
||||
Syntax: DEHALFOP [Channel [Nickname]]
|
||||
Syntax: DEHALFOP #Channel [Nickname]
|
||||
|
||||
Entfernt den Half-Op-Status des angegebenen Nicknamen in dem
|
||||
Channel. Wird kein Nickname angegeben, wird ChanServ dich
|
||||
dehalfoppen. Wird weder Channel noch Nickname angegeben,
|
||||
wird ChanServ dich in allen Channels dehalfoppen, in denen
|
||||
du die entsprechenden Rechte hast.
|
||||
dehalfoppen.
|
||||
|
||||
Standardmässig brauchst du dafür ein Level von 5
|
||||
um andere zu dehalfoppen, oder Level 4 um dich selbst zu
|
||||
dehalfoppen.
|
||||
|
||||
CHAN_HELP_PROTECT
|
||||
Syntax: PROTECT [Channel [Nickname]]
|
||||
Syntax: PROTECT #Channel [Nickname]
|
||||
|
||||
Beschützt den angegebenen Nicknamen in dem Channel. Wird kein
|
||||
Nickname angegeben, wird ChanServ dich beschützen. Wird weder
|
||||
Nickname noch Channel angegeben, wird ChanServ dich in allen
|
||||
Channels beschützen in denen du die entsprechenden
|
||||
Rechte hast.
|
||||
Nickname angegeben, wird ChanServ dich beschützen.
|
||||
|
||||
Standardmässig lässt sich diese Funktion vom Founder
|
||||
aufrufen oder von denjenigen mit Level 10 und grösser,
|
||||
die den Schutz auf sich selbst anwenden.
|
||||
|
||||
CHAN_HELP_DEPROTECT
|
||||
Syntax: DEPROTECT [Channel [Nickname]]
|
||||
Syntax: DEPROTECT #Channel [Nickname]
|
||||
|
||||
Entfernt den Schutz auf den angegebenen Nickname in dem Channel.
|
||||
Wird kein Nickname angegeben, wird ChanServ dich nicht mehr
|
||||
beschützen. Wird weder Nickname noch Channel angegeben, wird
|
||||
ChanServ dich in allen Channels nicht länger schützen,
|
||||
in denen du die entsprechenden Rechte hast.
|
||||
beschützen.
|
||||
|
||||
Standardmässig lässt sich diese Funktion vom Founder
|
||||
aufrufen oder von denjenigen mit Level 10 und grösser,
|
||||
die den Schutz von sich selbst aufheben wollen.
|
||||
|
||||
CHAN_HELP_OWNER
|
||||
Syntax: OWNER [Channel]
|
||||
Syntax: OWNER #Channel
|
||||
|
||||
Gibt dir Owner Status im Channel. Für den Fall, dass
|
||||
kein Channel angegeben wird, wird dir in jedem Channel,
|
||||
in dem du ausreichend Rechte besitzt, Owner Status
|
||||
gegeben.
|
||||
Gibt dir Owner Status im Channel.
|
||||
|
||||
Benötigt Founder Zugriffslevel im jeweiligen Channel.
|
||||
|
||||
CHAN_HELP_DEOWNER
|
||||
Syntax: DEOWNER [Channel]
|
||||
Syntax: DEOWNER #Channel
|
||||
|
||||
Nimmt dir Owner Status im Channel. Für den Fall, dass
|
||||
kein Channel angegeben wird, wird dir in jedem Channel,
|
||||
in dem du ausreichend Rechte besitzt, Owner Status
|
||||
genommen.
|
||||
Nimmt dir Owner Status im Channel.
|
||||
|
||||
Benötigt Founder Zugriffslevel im jeweiligen Channel.
|
||||
|
||||
@@ -5196,24 +5043,17 @@ CHAN_HELP_UNBAN
|
||||
5 (oder UNBAN)ist.
|
||||
|
||||
CHAN_HELP_KICK
|
||||
Syntax: KICK [Channel [Nickname [Grund]]]
|
||||
Syntax: KICK Channel Nickname [Grund]
|
||||
|
||||
Kickt den ausgewählten Nicknamen aus dem Channel. Wird
|
||||
kein Nickname angegeben, wird ChanServ dich (!) kicken.
|
||||
Wenn weder Nickname noch Channel angegeben werden, wird
|
||||
ChanServ dich aus allen Channels kicken, in denen
|
||||
du die entsprechenden Rechte hast.
|
||||
Kickt den ausgewählten Nicknamen aus dem Channel.
|
||||
|
||||
Standardmässig ist für diese Funktion ein Level
|
||||
von mindestens 5 erforderlich.
|
||||
|
||||
CHAN_HELP_BAN
|
||||
Syntax: BAN [Channel [Nickname [Grund]]]
|
||||
Syntax: BAN Channel Nickname [Grund]
|
||||
|
||||
Bannt einen Nicknamen im Channel. Falls kein Nickname angegeben
|
||||
wird, wirst du gebannt. Falls kein Nickname und kein Channel
|
||||
angegeben werden, wirst du in allen Channels gebannt,
|
||||
vorausgesetzt du hast die nötige Berechtigung.
|
||||
Bannt einen Nicknamen im Channel.
|
||||
|
||||
Standardmässig auf AOPs oder User mit Access Level 5 oder
|
||||
höher beschränkt.
|
||||
@@ -5240,8 +5080,11 @@ CHAN_HELP_CLEAR
|
||||
(z.B. Modi i,k,l,m,n,p,s und t)
|
||||
BANS Entfernt alle Bans in dem Channel
|
||||
EXCEPTS Entfernt alle Excepts in dem Channel
|
||||
INVITES Clears all invites on the channel.
|
||||
OPS Entfernt jeden Operator-Status (mode +o)
|
||||
in dem Channel.
|
||||
in dem Channel. If supported, removes
|
||||
channel-admin (mode +a) and channel-owner (mode +q)
|
||||
as well.
|
||||
HOPS Entfernt jeden Halfoperator-Status (mode +h)
|
||||
in den Channel.(Falls dein IRCD es unterstützt).
|
||||
VOICES Entfernt alle Voice-Flags (mode +v) in dem Channel.
|
||||
@@ -5253,14 +5096,7 @@ CHAN_HELP_CLEAR
|
||||
CHAN_HELP_GETKEY
|
||||
Syntax: GETKEY Channel
|
||||
|
||||
Liefert den Key des angegebenen Channels zurück. Dieser
|
||||
Befehl wird am häufigsten von Bots und/oder Skripten
|
||||
genutzt, daher wird das Ergebnis in dieser Form
|
||||
zurückgeliefert:
|
||||
|
||||
KEY <channel> <key>
|
||||
|
||||
key ist "NO KEY", wenn kein Key eingestellt ist.
|
||||
Liefert den Key des angegebenen Channels zurück.
|
||||
|
||||
CHAN_HELP_SENDPASS
|
||||
Syntax: SENDPASS Channel
|
||||
@@ -5273,9 +5109,6 @@ CHAN_HELP_SENDPASS
|
||||
|
||||
Kann in einigen Netzen auf IRC Operatoren beschränkt
|
||||
sein.
|
||||
|
||||
Dieser Befehl ist nicht verfügbar, wenn die
|
||||
Datenbank verschlüsselt gespeichert wird.
|
||||
|
||||
CHAN_SERVADMIN_HELP
|
||||
|
||||
@@ -5305,7 +5138,7 @@ CHAN_SERVADMIN_HELP_DROP
|
||||
der Datenbank. Zusätzlich werden Zugriffslisten,
|
||||
Einstellungen usw mit aus der Datenbank entfernt.
|
||||
|
||||
Nur Services Administratoren können Channel DROPEN,
|
||||
Nur Services Operators können Channel DROPEN,
|
||||
(löschen) ohne sich vorher gegenüber dem Channel als
|
||||
Founder zu identifizieren.
|
||||
|
||||
@@ -5325,8 +5158,6 @@ CHAN_SERVADMIN_HELP_SET_NOEXPIRE
|
||||
Ändert das NOEXPIRE-Flag an einem Channel. Wird es
|
||||
auf ON gestellt, wird der Channel bei Nichtnutzung
|
||||
nicht auslaufen.
|
||||
|
||||
Diese Funktion ist beschränkt auf Services Administratoren.
|
||||
|
||||
CHAN_SERVADMIN_HELP_INFO
|
||||
|
||||
@@ -5535,7 +5366,7 @@ MEMO_HELP_SET
|
||||
über eine bestimmte Option.
|
||||
|
||||
MEMO_HELP_SET_NOTIFY
|
||||
Syntax: SET NOTIFY {ON | LOGON | NEW | OFF}
|
||||
Syntax: SET NOTIFY {ON | LOGON | NEW | MAIL | NOMAIL | OFF}
|
||||
|
||||
Ändert den Zeitpunkt, wann MemoServ dich über neue
|
||||
eingegangene Memos informiert:
|
||||
@@ -5548,6 +5379,9 @@ MEMO_HELP_SET_NOTIFY
|
||||
machst.
|
||||
NEW Du wirst nur informiert, wenn sie an dich
|
||||
gesendet werden.
|
||||
MAIL You will be notified of memos by email aswell as
|
||||
any other settings you have.
|
||||
NOMAIL You will not be notified of memos by email.
|
||||
OFF Es wird keine Benachrichtigung über neue
|
||||
Memos stattfinden.
|
||||
|
||||
@@ -5614,9 +5448,6 @@ MEMO_HELP_STAFF
|
||||
|
||||
Sendet allen Usern mit Zugriff auf die Services eine Nachricht mit
|
||||
dem Memo-Text.
|
||||
Note: Wenn du Operatoren an beide der Services-Zugriffs-Listen
|
||||
(Oper und Admin) hast, so werden die alle diese Nachricht erhalten.
|
||||
Das gleichte trifft für die Operatoren auf der Root-Liste zu.
|
||||
|
||||
MEMO_HELP_SENDALL
|
||||
Syntax: SENDALL Memo-Text
|
||||
@@ -5651,10 +5482,6 @@ OPER_HELP_CMD_GLOBAL
|
||||
GLOBAL Eine Notice an alle User schicken
|
||||
OPER_HELP_CMD_STATS
|
||||
STATS Status des Netzes und der Services anzeigen
|
||||
OPER_HELP_CMD_OPER
|
||||
OPER Die Services Operatoren Liste bearbeiten
|
||||
OPER_HELP_CMD_ADMIN
|
||||
ADMIN Liste der Services Administratoren bearbeiten
|
||||
OPER_HELP_CMD_STAFF
|
||||
STAFF Zeigt alle Nicknamen, die Zugriff auf die
|
||||
Services haben, Onlinestatus und Level
|
||||
@@ -5712,7 +5539,7 @@ OPER_HELP_CMD_SHUTDOWN
|
||||
OPER_HELP_CMD_DEFCON
|
||||
DEFCON Ändert das DefCon System
|
||||
OPER_HELP_CMD_CHANKILL
|
||||
CHANKILL Killt alle User des angegebenen Channels
|
||||
CHANKILL AKILL alle User des angegebenen Channels
|
||||
OPER_HELP_CMD_OLINE
|
||||
OLINE Einem User "Operflags" setzen
|
||||
OPER_HELP_CMD_UMODE
|
||||
@@ -5764,82 +5591,6 @@ OPER_HELP_STATS
|
||||
Durch RESET werden einige Werte der Statistik zurück-
|
||||
gesetzt, unter anderem die max. Anzahl gleichzeitig
|
||||
verbundenen User.
|
||||
|
||||
UPTIME kann als Synonym für STATS verwendet werden.
|
||||
|
||||
OPER_HELP_OPER
|
||||
Syntax: OPER ADD Nickname
|
||||
OPER DEL {Nickname | entry-num | Liste}
|
||||
OPER LIST [Maske | Liste]
|
||||
OPER CLEAR
|
||||
|
||||
Erlaubt Services Root bestimmte Nicknamen in
|
||||
die Liste der Services Operatoren aufnehmen oder zu entfernen.
|
||||
Ein User der sich für diesen Nicknamen gegenüber %s
|
||||
identifiziert hat und auf der Liste der Services Operatoren
|
||||
ist, hat Zugriff auf die Befehle von OperServ.
|
||||
|
||||
Mit OPER ADD wird der angegebene Nickname auf die Liste der
|
||||
Services Operatoren hinzugefügt.
|
||||
|
||||
Durch OPER DEL wird der angegebene Nickname von der Liste
|
||||
entfernt. Wird ein Bereich von Zahlen eingegeben, werden
|
||||
die entsprechenden Einträge gelöscht. (Siehe das Beispiel
|
||||
für LIST weiter unten.)
|
||||
|
||||
Der OPER LIST Befehl zeigt den Inhalt der Liste der
|
||||
Services Operatoren. Wird eine Maske mit Platzhaltern
|
||||
(Wildcards) angegeben, werden die entsprechenden Einträge
|
||||
angezeigt. Wird eine Zahlenbereich angegeben, werden
|
||||
ebenfalls nur die entsprechenden Einträge angezeigt,
|
||||
zum Beispiel:
|
||||
|
||||
OPER LIST 2-5,7-9
|
||||
Zeigt die Einträge 2 bis 5 und 7 bis 9 aus
|
||||
der Services Operatoren-Liste.
|
||||
|
||||
Durch OPER CLEAR werden alle Einträge aus dieser Liste
|
||||
entfernt.
|
||||
|
||||
Jeder IRC Operator kann den OPER LIST Befehl verwenden.
|
||||
|
||||
OPER_HELP_ADMIN
|
||||
Syntax: ADMIN ADD Nickname
|
||||
ADMIN DEL {Nickname | entry-num | Liste}
|
||||
ADMIN LIST [Maske | Liste]
|
||||
ADMIN CLEAR
|
||||
|
||||
Erlaubt Services Roots bestimmte Nicknamen in die Liste
|
||||
der Services Administratoren aufnehmen oder zu entfernen.
|
||||
Ein User der sich für diesen Nicknamen gegenüber %s
|
||||
identifiziert hat und auf die Services Adminstratoren-Liste
|
||||
ist, hat Zugriff auf die Admin Befehlen von OperServ.
|
||||
|
||||
Mit ADMIN ADD wir der angegebene Nickname auf die
|
||||
Services Administratoren-Liste hinzugefügt.
|
||||
|
||||
Durch ADMIN DEL wird der angegebene Nickname von der Liste
|
||||
entfernt. Wird ein Bereich von Zahlen eingegeben, werden
|
||||
die entsprechenden Einträge gelöscht. (Siehe das Beispiel
|
||||
für LIST weiter unten.)
|
||||
|
||||
Der ADMIN LIST Befehl zeigt den Inhalt der Services
|
||||
Administratoren-Liste an. Wird eine Maske mit Platzhaltern
|
||||
(Wildcards) angegeben, werden die entsprechenden Einträge
|
||||
angezeigt. Wird ein Zahlenbereich angegeben, werden
|
||||
ebenfalls nur die entsprechenden Einträge angezeigt,
|
||||
zum Beispiel:
|
||||
|
||||
ADMIN LIST 2-5,7-9
|
||||
Zeigt die Einträge 2 bis 5 und 7 bis 9 aus der
|
||||
Services Administratoren-Liste an.
|
||||
|
||||
Mit Hilfe von ADMIN CLEAR wird die Services
|
||||
Administartoren-Liste komplett geleert.
|
||||
|
||||
Jeder IRC Operator kann den Befehl ADMIN LIST nutzen,
|
||||
jegliche anderen Befehle können nur von Services Roots
|
||||
aufgerufen werden.
|
||||
|
||||
OPER_HELP_IGNORE
|
||||
Syntax: IGNORE {ADD|DEL|LIST|CLEAR} [time] [nick | mask]
|
||||
@@ -5871,14 +5622,14 @@ OPER_HELP_MODE
|
||||
OPER_HELP_UMODE
|
||||
Syntax: UMODE User Modi
|
||||
|
||||
Erlaubt es Super Adminstratoren die Usermodi eines
|
||||
Erlaubt es Services Operators die Usermodi eines
|
||||
beliebigen Users zu ändern. Der Paramater hat das gleiche
|
||||
Format wie der normale /MODE Befehl.
|
||||
|
||||
OPER_HELP_OLINE
|
||||
Syntax: OLINE User Flags
|
||||
|
||||
Erlaubt es Super Adminstratoren einem User Operflags
|
||||
Erlaubt es Services Operators einem User Operflags
|
||||
zu setzen.Den Flags muss ein "+" oder ein "-" vorangestellt
|
||||
werden. Um alle Operflags zu entfernen, nutze einfach ein
|
||||
"-" ohne Operflags.
|
||||
@@ -5905,7 +5656,6 @@ OPER_HELP_SVSNICK
|
||||
Syntax: SVSNICK Nickname Neuer-Nickname
|
||||
|
||||
Erzwingt die Änderung des Nicknamens eines User zu dem neuen Nicknamen.
|
||||
Limited to Super Admins.
|
||||
|
||||
OPER_HELP_AKILL
|
||||
Syntax: AKILL ADD [+Zeit] Maske Grund
|
||||
@@ -6124,7 +5874,6 @@ OPER_HELP_SET
|
||||
NOEXPIRE Auslauf-Modus der Services
|
||||
an oder aus
|
||||
SUPERADMIN Den Super-Admin Modus an oder aus
|
||||
SQL SQL-Modus an oder aus
|
||||
IGNORE Ignore-Modus an oder aus
|
||||
LIST Optionen-Liste
|
||||
|
||||
@@ -6191,12 +5940,6 @@ OPER_HELP_SET_SUPERADMIN
|
||||
werden, wenn er wirklich gebraucht wird. Danach sollte er
|
||||
sofort wieder ausgeschaltet werden.
|
||||
|
||||
OPER_HELP_SET_SQL
|
||||
Syntax: SET SQL {ON | OFF}
|
||||
|
||||
Diese Einstellung wird Anope veranlassen SQL zu benutzen oder nicht.
|
||||
Kann nützlich sein wenn zB der MySQL-Server aus ist.
|
||||
|
||||
OPER_HELP_SET_IGNORE
|
||||
Syntax: SET IGNORE {ON | OFF}
|
||||
|
||||
@@ -6235,16 +5978,6 @@ OPER_HELP_JUPE
|
||||
wird dieser im Server Informationsfeld angezeigt,
|
||||
ansonsten nur "Jupitered by <nick>".
|
||||
|
||||
OPER_HELP_RAW
|
||||
Syntax: RAW Text
|
||||
|
||||
Sendet die Zeichenkette von text direkt an den Server,
|
||||
zu denen die Services verbunden sind. Dieses Kommando
|
||||
hat einen sehr beschränkten Nutzenfaktor, und kann
|
||||
leicht den Ablauf des Netzes stören, wenn es falsch
|
||||
benutz wird. BENUTZE DIESES KOMMANDO NICHT so lange
|
||||
du nicht genau weisst, was du tust!
|
||||
|
||||
OPER_HELP_UPDATE
|
||||
Syntax: UPDATE
|
||||
|
||||
@@ -6711,7 +6444,7 @@ HOST_SETALL
|
||||
HOST_DELALL
|
||||
vHost für die Gruppe %s wurden gelöscht.
|
||||
HOST_DELALL_SYNTAX
|
||||
Syntax: DELALL Nickname.
|
||||
DELALL Nickname.
|
||||
HOST_IDENT_SETALL
|
||||
vHost für die Gruppe %s wurde gesetzt: %s@%s.
|
||||
HOST_SET_ERROR
|
||||
@@ -6727,9 +6460,9 @@ HOST_SET_IDENTTOOLONG
|
||||
HOST_NOREG
|
||||
User %s wurde nicht in der NickServ Datenbank gefunden.
|
||||
HOST_SET_SYNTAX
|
||||
Syntax %R%s SET Nickname Hostmaske.
|
||||
SET Nickname Hostmaske.
|
||||
HOST_SETALL_SYNTAX
|
||||
Syntax %R%s SETALL Nickname Hostmaske.
|
||||
SETALL Nickname Hostmaske.
|
||||
HOST_DENIED
|
||||
Zugriff verweigert.
|
||||
HOST_NOT_ASSIGNED
|
||||
@@ -6738,18 +6471,12 @@ HOST_ACTIVATED
|
||||
Dein vHost (%s) ist jetzt aktiviert.
|
||||
HOST_IDENT_ACTIVATED
|
||||
Dein vHost (%s@%s) ist jetzt aktiviert.
|
||||
HOST_ID
|
||||
Bitte identifiziere dich zuerst.
|
||||
HOST_NOT_REGED
|
||||
Du musst erst deinen Nickname registrieren, um einen vHost zu erhalten.
|
||||
HOST_DEL
|
||||
vHost für %s wurde gelöscht.
|
||||
HOST_DEL_SYNTAX
|
||||
Syntax: %R%s DEL Nickname.
|
||||
DEL Nickname.
|
||||
HOST_OFF
|
||||
Your vhost was removed and the normal cloaking restored.
|
||||
HOST_OFF_UNREAL
|
||||
Dein vHost wurde gelöscht. Um die normale Host-Verschlüsselung zu reaktivieren, tippe /mode %s +%s
|
||||
HOST_NO_VIDENT
|
||||
Dein IRCd unterstützt keine vIdents. Falls das inkorrekt sein sollte, melde das bitte als einen Bug.
|
||||
HOST_GROUP
|
||||
|
||||
+147
-389
File diff suppressed because it is too large
Load Diff
+116
-418
File diff suppressed because it is too large
Load Diff
+76
-76
@@ -1,76 +1,76 @@
|
||||
/* Language stuff generator for win32.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* Written by Dominick Meglio <codemastr@unrealircd.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <cstdlib>
|
||||
#include <cctype>
|
||||
|
||||
char *strip(char *str)
|
||||
{
|
||||
char *c;
|
||||
if ((c = strchr(str,'\n')))
|
||||
*c = 0;
|
||||
if ((c = strchr(str,'\r')))
|
||||
*c = 0;
|
||||
return str;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 4)
|
||||
exit(1);
|
||||
|
||||
/* Build the index file */
|
||||
if (!strcmp(argv[1], "index"))
|
||||
{
|
||||
FILE *fd = fopen(argv[2], "rb");
|
||||
FILE *fdout = fopen(argv[3], "wb");
|
||||
char buf[1024];
|
||||
if (!fd || !fdout)
|
||||
exit(2);
|
||||
|
||||
while (fgets(buf, 1023, fd))
|
||||
{
|
||||
if (isupper(*buf))
|
||||
fprintf(fdout, "%s", buf);
|
||||
}
|
||||
fclose(fd);
|
||||
fclose(fdout);
|
||||
}
|
||||
/* Build the language.h file */
|
||||
else if (!strcmp(argv[1], "language.h"))
|
||||
{
|
||||
FILE *fd = fopen(argv[2], "r");
|
||||
FILE *fdout = fopen(argv[3], "w");
|
||||
char buf[1024];
|
||||
int i = 0;
|
||||
|
||||
if (!fd || !fdout)
|
||||
exit(2);
|
||||
|
||||
fprintf(stderr, "Generating language.h... ");
|
||||
|
||||
while (fgets(buf, 1023, fd)) {
|
||||
fprintf(fdout, "#define %-32s %d\n", strip(buf), i++);
|
||||
}
|
||||
|
||||
fprintf(fdout, "#define NUM_STRINGS %d\n", i);
|
||||
fprintf(stderr, "%d strings\n", i);
|
||||
fclose(fd);
|
||||
fclose(fdout);
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
/* Language stuff generator for win32.
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for furhter details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* Written by Dominick Meglio <codemastr@unrealircd.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <cstdlib>
|
||||
#include <cctype>
|
||||
|
||||
char *strip(char *str)
|
||||
{
|
||||
char *c;
|
||||
if ((c = strchr(str,'\n')))
|
||||
*c = 0;
|
||||
if ((c = strchr(str,'\r')))
|
||||
*c = 0;
|
||||
return str;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 4)
|
||||
exit(1);
|
||||
|
||||
/* Build the index file */
|
||||
if (!strcmp(argv[1], "index"))
|
||||
{
|
||||
FILE *fd = fopen(argv[2], "rb");
|
||||
FILE *fdout = fopen(argv[3], "wb");
|
||||
char buf[1024];
|
||||
if (!fd || !fdout)
|
||||
exit(2);
|
||||
|
||||
while (fgets(buf, 1023, fd))
|
||||
{
|
||||
if (isupper(*buf))
|
||||
fprintf(fdout, "%s", buf);
|
||||
}
|
||||
fclose(fd);
|
||||
fclose(fdout);
|
||||
}
|
||||
/* Build the language.h file */
|
||||
else if (!strcmp(argv[1], "language.h"))
|
||||
{
|
||||
FILE *fd = fopen(argv[2], "r");
|
||||
FILE *fdout = fopen(argv[3], "w");
|
||||
char buf[1024];
|
||||
int i = 0;
|
||||
|
||||
if (!fd || !fdout)
|
||||
exit(2);
|
||||
|
||||
fprintf(stderr, "Generating language.h... ");
|
||||
|
||||
while (fgets(buf, 1023, fd)) {
|
||||
fprintf(fdout, "#define %-32s %d\n", strip(buf), i++);
|
||||
}
|
||||
|
||||
fprintf(fdout, "#define NUM_STRINGS %d\n", i);
|
||||
fprintf(stderr, "%d strings\n", i);
|
||||
fclose(fd);
|
||||
fclose(fdout);
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -140,6 +140,15 @@ STRFTIME_MONTHS_LONG
|
||||
COMMA_SPACE
|
||||
,
|
||||
|
||||
# Command help replies
|
||||
COMMAND_REQUIRES_PERM
|
||||
Access to this command requires the permission %s to be present in your opertype.
|
||||
COMMAND_IDENTIFY_REQUIRED
|
||||
You need to be identified to use this command.
|
||||
COMMAND_CANNOT_USE
|
||||
You cannot use this command.
|
||||
COMMAND_CAN_USE
|
||||
You can use this command.
|
||||
|
||||
# Various error messages.
|
||||
USER_RECORD_NOT_FOUND
|
||||
@@ -173,18 +182,8 @@ PASSWORD_INCORRECT
|
||||
INVALID_TARGET
|
||||
Àäðåñàöèÿ âèäà "/msg %s" áîëüøå íå ïîääåðæèâàåòñÿ. Èñïîëüçóéòå "/msg %s@%s" èëè "/%s".
|
||||
|
||||
# What's the difference between "Access denied" and "Permission denied"?
|
||||
# Very little; you can safely make them the same message with no real loss
|
||||
# of meaning. If you want to make a distinction, "Access denied" is
|
||||
# usually used more generally; for example, a non-oper trying to access
|
||||
# OperServ gets "Access denied", while a non-Services admin trying to use
|
||||
# NickServ SET NOEXPIRE gets "Permission denied".
|
||||
ACCESS_DENIED
|
||||
Äîñòóï çàïðåùåí.
|
||||
PERMISSION_DENIED
|
||||
Íåäîñòàòî÷íî ïðàâ äëÿ äîñòóïà.
|
||||
RAW_DISABLED
|
||||
Êîìàíäà RAW îòêëþ÷åíà. Åñëè âû æåëàåòå èñïîëüçîâàòü åå, çàêîììåíòèðóéòå äèðåêòèâó DisableRaw â êîíôèãóðàöèîííîì ôàéëå ñåðâèñîâ.
|
||||
|
||||
MORE_OBSCURE_PASSWORD
|
||||
Ïîæàëóéñòà, ïîïðîáóéòå ñíîâà ñ áîëåå ñëîæíûì ïàðîëåì. Îí äîëæåí èìåòü äëèíó íå ìåíåå 5 ñèìâîëîâ, ñîñòîÿòü òîëüêî èç ëàòèíñêèõ áóêâ èëè öèôð, íå áûòü ëåãêî îòãàäûâàåìûì (ò.å. Âàøèì èìåíåì èëè Âàøèì íèêîì), è íå äîëæåí ñîäåðæàòü ïðîáåëîâ è òàáóëÿöèé.
|
||||
@@ -301,26 +300,6 @@ CS_LIST_INCORRECT_RANGE
|
||||
×òî áû íàéòè êàíàë, íà÷èíàþùèéñÿ ñ ñèìâîëà #, ïðîñòî óêàæèòå åãî
|
||||
íàçâàíèå áåç #. Íàïðèìåð anope âìåñòî #anope.
|
||||
|
||||
# Generic help limited to messages
|
||||
HELP_LIMIT_SERV_OPER
|
||||
|
||||
Äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû íåîáõîäèìû ïðàâà Îïåðàòîðà ñåðâèñîâ.
|
||||
HELP_LIMIT_SERV_ADMIN
|
||||
|
||||
Äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû íåîáõîäèìû ïðàâà Àäìèíèñòðàòîðà ñåðâèñîâ.
|
||||
HELP_LIMIT_SERV_ROOT
|
||||
|
||||
Äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû íåîáõîäèìû ïðàâà Ðóòà ñåðâèñîâ.
|
||||
HELP_LIMIT_IRC_OPER
|
||||
|
||||
Äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû íåîáõîäèìû ïðàâà IRC-îïåðàòîðà.
|
||||
HELP_LIMIT_HOST_SETTER
|
||||
|
||||
Äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû íåîáõîäèìû ïðàâà Îïåðàòîðà õîñòîâ.
|
||||
HELP_LIMIT_HOST_REMOVER
|
||||
|
||||
Äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû íåîáõîäèìû ïðàâà Îïåðàòîðà õîñòîâ.
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# NickServ messages
|
||||
@@ -524,7 +503,7 @@ NICK_SET_PRIVATE_OFF
|
||||
|
||||
# SET HIDE responses
|
||||
NICK_SET_HIDE_SYNTAX
|
||||
SET HIDE {EMAIL | USERMASK | QUIT} {ON | OFF}
|
||||
SET HIDE {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}
|
||||
NICK_SET_HIDE_EMAIL_ON
|
||||
Ñ ýòîãî ìîìåíòà, âàø email-àäðåñ áóäåò ñêðûò èç èíôîðìàöèè ïî %s INFO
|
||||
NICK_SET_HIDE_EMAIL_OFF
|
||||
@@ -646,7 +625,7 @@ NICK_SASET_PRIVATE_OFF
|
||||
|
||||
# SASET HIDE responses
|
||||
NICK_SASET_HIDE_SYNTAX
|
||||
SET íèê HIDE {EMAIL | USERMASK | QUIT} {ON | OFF}
|
||||
SET íèê HIDE {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}
|
||||
NICK_SASET_HIDE_EMAIL_ON
|
||||
Ñ ýòîãî ìîìåíòà, email-àäðåñ íèêà %s áóäåò ñêðûò èç èíôîðìàöèè ïî %s INFO.
|
||||
NICK_SASET_HIDE_EMAIL_OFF
|
||||
@@ -719,26 +698,16 @@ NICK_ACCESS_LIST_X_EMPTY
|
||||
Ñïèñîê äîñòóïà äëÿ %s ïóñò.
|
||||
|
||||
# Status messages
|
||||
NICK_STATUS_0
|
||||
STATUS %s 0 (íèê íåçàðåãèñòðèðîâàí èëè åãî íåò â ñåòè)
|
||||
NICK_STATUS_1
|
||||
STATUS %s 1 (íèê çàðåãèñòðèðîâàí è â ñåòè, íî ïîëüçîâàòåëü íå èäåíòèôèöèðîâàëñÿ ê íåìó)
|
||||
NICK_STATUS_2
|
||||
STATUS %s 2 (íèê çàðåãèñòðèðîâàí è â ñåòè, ïîëüçîâàòåëü èäåíòèôèöèðîâàí ê íåìó ÷åðåç ñïèñîê ìàñîê)
|
||||
NICK_STATUS_3
|
||||
STATUS %s 3 (ïîëüçîâàòåëü èäåíòèôèöèðîâàí êàê âëàäåëåö íèêà ÷åðåç èäåíòèôèêàöèþ ïàðîëåì)
|
||||
NICK_STATUS_REPLY
|
||||
STATUS %s %d %s
|
||||
|
||||
# INFO responses
|
||||
NICK_INFO_SYNTAX
|
||||
INFO íèê [ALL]
|
||||
NICK_INFO_REALNAME
|
||||
%s ýòî %s
|
||||
NICK_INFO_SERVICES_OPER
|
||||
%s èìååò ïðèâèëåãèè Îïåðàòîðà ñåðâèñîâ.
|
||||
NICK_INFO_SERVICES_ADMIN
|
||||
%s èìååò ïðèâèëåãèè Àäìèíèñòðàòîðà ñåðâèñîâ.
|
||||
NICK_INFO_SERVICES_ROOT
|
||||
%s èìååò ïðèâèëåãèè Ðóòà ñåðâèñîâ.
|
||||
NICK_INFO_SERVICES_OPERTYPE
|
||||
%s is a services operator of type %s.
|
||||
NICK_INFO_ADDRESS
|
||||
Ïîñëåäíÿÿ ìàñêà.........: %s
|
||||
NICK_INFO_ADDRESS_ONLINE
|
||||
@@ -1050,11 +1019,6 @@ CHAN_REGISTER_DISABLED
|
||||
Èçâèíèòå, ðåãèñòðàöèÿ êàíàëîâ âðåìåííî ïðèîñòàíîâëåíà.
|
||||
CHAN_REGISTER_NOT_LOCAL
|
||||
Ëîêàëüíûå êàíàëû íå ìîãóò áûòü çàðåãèñòðèðîâàíû.
|
||||
CHAN_MUST_REGISTER_NICK
|
||||
Ñíà÷àëà âû äîëæíû çàðåãèñòðèðîâàòü ñâîé íèê. Íàïèøèòå %R%s HELP äëÿ ïîëó÷åíèÿ èíôîðìàöèè î ðåãèñòðàöèè íèêà.
|
||||
CHAN_MUST_IDENTIFY_NICK
|
||||
Ñíà÷àëà âû äîëæíû èäåíòèôèöèðîâàòü ñâîé íèê íà %s, èñïîëüçóÿ êîìàíäó:
|
||||
%R%s IDENTIFY ïàðîëü
|
||||
CHAN_MAY_NOT_BE_REGISTERED
|
||||
Êàíàë %s íå ìîæåò áûòü çàðåãèñòðèðîâàí.
|
||||
CHAN_ALREADY_REGISTERED
|
||||
@@ -1086,6 +1050,8 @@ CHAN_IDENTIFY_SUCCEEDED
|
||||
Ïàðîëü ïðèíÿò, òåïåðü âàø óðîâåíü äîñòóïà íà êàíàëå %s - âëàäåëåö.
|
||||
CHAN_LOGOUT_FOUNDER_FAILED
|
||||
Âû íå ìîæåòå äåèäåíòèôèöèðîâàòü ñåáÿ îòíîñòèòåëüíî êàíàëà %s ò.ê. âû åãî ðåàëüíûé âëàäåëåö.
|
||||
CHAN_LOGOUT_NOT_LOGGEDIN
|
||||
%s was not logged into %s.
|
||||
|
||||
# LOGOUT responses
|
||||
CHAN_LOGOUT_SYNTAX
|
||||
@@ -1532,7 +1498,7 @@ CHAN_LEVELS_RESET
|
||||
|
||||
# Status Messages
|
||||
CHAN_STATUS_SYNTAX
|
||||
STATUS ERROR Îøèáêà ñèíòàêñèñà
|
||||
STATUS channel item
|
||||
CHAN_STATUS_NOT_REGGED
|
||||
STATUS ERROR Êàíàë %s íåçàðåãèñòðèðîâàí
|
||||
CHAN_STATUS_FORBIDDEN
|
||||
@@ -1621,6 +1587,10 @@ CHAN_LIST_END
|
||||
# INVITE responses
|
||||
CHAN_INVITE_SYNTAX
|
||||
INVITE #êàíàë
|
||||
CHAN_INVITE_ALREADY_IN
|
||||
You are already in %s!
|
||||
CHAN_INVITE_SUCCESS
|
||||
You have been invited to %s.
|
||||
|
||||
# UNBAN responses
|
||||
CHAN_UNBAN_SYNTAX
|
||||
@@ -1666,7 +1636,7 @@ CHAN_GETKEY_SYNTAX
|
||||
CHAN_GETKEY_NOKEY
|
||||
Êàíàë %s íå èìååò êëþ÷à (no key).
|
||||
CHAN_GETKEY_KEY
|
||||
KEY %s %s
|
||||
Key for channel %s is %s.
|
||||
|
||||
# SENDPASS responses
|
||||
CHAN_SENDPASS_SYNTAX
|
||||
@@ -1727,6 +1697,36 @@ CHAN_UNSUSPEND_FAILED
|
||||
# Misc responses
|
||||
CHAN_EXCEPTED
|
||||
Îäíà èç ìàñîê â ñïèñêå èñêëþ÷åíèé êàíàëà ñîâïàäàåò ñ õîñòìàñêîé ïîëüçîâàòåëÿ %s. ×òî áû çàáàíèòü åãî, âû äîëæíû óäàëèòü èñêëþ÷åíèÿ.
|
||||
|
||||
#Mode syntax responses
|
||||
CHAN_OP_SYNTAX
|
||||
OP #channel [nick]
|
||||
CHAN_HALFOP_SYNTAX
|
||||
HALFOP #channel [nick]
|
||||
CHAN_VOICE_SYNTAX
|
||||
VOICE #channel [nick]
|
||||
CHAN_PROTECT_SYNTAX
|
||||
PROTECT #channel [nick]
|
||||
CHAN_OWNER_SYNTAX
|
||||
OWNER #channel
|
||||
CHAN_DEOP_SYNTAX
|
||||
DEOP #channel [nick]
|
||||
CHAN_DEHALFOP_SYNTAX
|
||||
DEHALFOP #channel [nick]
|
||||
CHAN_DEVOICE_SYNTAX
|
||||
DEVOICE #channel [nick]
|
||||
CHAN_DEPROTECT_SYNTAX
|
||||
DEROTECT #channel [nick]
|
||||
CHAN_DEOWNER_SYNTAX
|
||||
DEOWNER #channel
|
||||
|
||||
#Kick responces
|
||||
CHAN_KICK_SYNTAX
|
||||
KICK #channel nick [reason]
|
||||
|
||||
#Ban responces
|
||||
CHAN_BAN_SYNTAX
|
||||
BAN #channel nick [reason]
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
@@ -1786,6 +1786,10 @@ MEMO_SENT
|
||||
MEMO_MASS_SENT
|
||||
Ìàññîâîå ñîîáùåíèå óñïåøíî îòïðàâëåíî âñåì çàðåãèñòðèðîâàííûì ïîëüçîâàòåëÿì.
|
||||
|
||||
# STAFF responses
|
||||
MEMO_STAFF_SYNTAX
|
||||
STAFF memo-text
|
||||
|
||||
# CANCEL responses
|
||||
MEMO_CANCEL_SYNTAX
|
||||
CANCEL {íèê | #êàíàë}
|
||||
@@ -1850,7 +1854,7 @@ MEMO_SET_UNKNOWN_OPTION
|
||||
|
||||
# SET NOTIFY responses
|
||||
MEMO_SET_NOTIFY_SYNTAX
|
||||
SET NOTIFY {ON | LOGON | NEW | OFF}
|
||||
SET NOTIFY {ON | LOGON | NEW | MAIL | NOMAIL | OFF }
|
||||
MEMO_SET_NOTIFY_ON
|
||||
Ñ ýòîãî ìîìåíòà, %s áóäåò óâåäîìëÿòü âàñ î íîâûõ ñîîáùåíèÿõ ñðàçó ïîñëå èäåíòèôèêàöèè ê íèêó èëè ïðè ïîñòóïëåíèè íîâûõ ñîîáùåíèé.
|
||||
MEMO_SET_NOTIFY_LOGON
|
||||
@@ -2559,72 +2563,6 @@ OPER_SVSNICK_SYNTAX
|
||||
OPER_SVSNICK_NEWNICK
|
||||
Íèê ïîëüçîâàòåëÿ %s áûë èçìåíåí íà %s.
|
||||
|
||||
# ADMIN responses
|
||||
OPER_ADMIN_SYNTAX
|
||||
ADMIN {ADD|DEL|LIST|CLEAR} [íèê | íîìåð_çàïèñè]
|
||||
OPER_ADMIN_SKELETON
|
||||
Ñåðâèñû ðàáîòàþò â skeleton-ðåæèìå, êîìàíäà ADMIN íåäîñòóïíà.
|
||||
OPER_ADMIN_EXISTS
|
||||
Íèê %s óæå ïðèñóòñòâóåò â ñïèñêå Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
OPER_ADMIN_REACHED_LIMIT
|
||||
Êîëè÷åñòâî çàïèñåé â ñïèñêå Àäìèíèñòðàòîðîâ ñåðâèñîâ íå ìîæåò ïðåâûøàòü %d.
|
||||
OPER_ADMIN_ADDED
|
||||
Ïîëüçîâàòåëü %s óñïåøíî äîáàâëåí â ñïèñîê Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
OPER_ADMIN_NOT_FOUND
|
||||
Ïîëüçîâàòåëü %s â ñïèñêå Àäìèíèñòðàòîðîâ ñåðâèñîâ íå îáíàðóæåí.
|
||||
OPER_ADMIN_NO_MATCH
|
||||
Ñîâïàäàþùèõ çàïèñåé íå îáíàðóæåíî.
|
||||
OPER_ADMIN_DELETED
|
||||
Ïîëüçîâàòåëü %s óñïåøíî óäàëåí èç ñïèñêà Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
OPER_ADMIN_DELETED_ONE
|
||||
Óäàëåíà 1 çàïèñü èç ñïèñêà Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
OPER_ADMIN_DELETED_SEVERAL
|
||||
Óäàëåíî %d çàïèñåé èç ñïèñêà Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
OPER_ADMIN_LIST_EMPTY
|
||||
Ñïèñîê Àäìèíèñòðàòîðîâ ñåðâèñîâ ïóñò.
|
||||
OPER_ADMIN_LIST_HEADER
|
||||
Ñïèñîê Àäìèíèñòðàòîðîâ ñåðâèñîâ:
|
||||
No. Íèê
|
||||
OPER_ADMIN_LIST_FORMAT
|
||||
%3d %s
|
||||
OPER_ADMIN_CLEAR
|
||||
Ñïèñîê Àäìèíèñòðàòîðîâ ñåðâèñîâ ïîëíîñòüþ î÷èùåí.
|
||||
OPER_ADMIN_MOVED
|
||||
Ïîëüçîâàòåëü %s óñïåøíî ïåðåìåùåí â ñïèñîê Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
|
||||
# OPER responses
|
||||
OPER_OPER_SYNTAX
|
||||
OPER {ADD|DEL|LIST|CLEAR} [íèê | íîìåð_çàïèñè]
|
||||
OPER_OPER_SKELETON
|
||||
Ñåðâèñû ðàáîòàþò â skeleton-ðåæèìå, êîìàíäà OPER íåäîñòóïíà.
|
||||
OPER_OPER_EXISTS
|
||||
Íèê %s óæå ïðèñóòñòâóåò â ñïèñêå Îïåðàòîðîâ ñåðâèñîâ.
|
||||
OPER_OPER_REACHED_LIMIT
|
||||
Êîëè÷åñòâî çàïèñåé â ñïèñêå Îïåðàòîðîâ ñåðâèñîâ íå ìîæåò ïðåâûøàòü %d.
|
||||
OPER_OPER_ADDED
|
||||
Ïîëüçîâàòåëü %s óñïåøíî äîáàâëåí â ñïèñîê Îïåðàòîðîâ ñåðâèñîâ.
|
||||
OPER_OPER_NOT_FOUND
|
||||
Ïîëüçîâàòåëü %s â ñïèñêå Îïåðàòîðîâ ñåðâèñîâ íå îáíàðóæåí.
|
||||
OPER_OPER_NO_MATCH
|
||||
Ñîâïàäàþùèõ çàïèñåé íå îáíàðóæåíî.
|
||||
OPER_OPER_DELETED
|
||||
Ïîëüçîâàòåëü %s óñïåøíî óäàëåí èç ñïèñêà Îïåðàòîðîâ ñåðâèñîâ.
|
||||
OPER_OPER_DELETED_ONE
|
||||
Óäàëåíà 1 çàïèñü èç ñïèñêà Îïåðàòîðîâ ñåðâèñîâ.
|
||||
OPER_OPER_DELETED_SEVERAL
|
||||
Óäàëåíî %d çàïèñåé èç ñïèñêà Îïåðàòîðîâ ñåðâèñîâ.
|
||||
OPER_OPER_LIST_EMPTY
|
||||
Ñïèñîê Îïåðàòîðîâ ñåðâèñîâ ïóñò.
|
||||
OPER_OPER_LIST_HEADER
|
||||
Ñïèñîê Îïåðàòîðîâ ñåðâèñîâ:
|
||||
No. Íèê
|
||||
OPER_OPER_LIST_FORMAT
|
||||
%3d %s
|
||||
OPER_OPER_CLEAR
|
||||
Ñïèñîê Îïåðàòîðîâ ñåðâèñîâ ïîëíîñòüþ î÷èùåí.
|
||||
OPER_OPER_MOVED
|
||||
%s áûë ïåðåìåùåí â ñïèñîê Îïåðàòîðîâ Ñåðâèñîâ.
|
||||
|
||||
# AKILL responses
|
||||
OPER_AKILL_SYNTAX
|
||||
AKILL {ADD|DEL|LIST|VIEW|CLEAR} [[+âðåìÿ_èñòå÷åíèÿ] {ìàñêà | íîìåð_çàïèñè} [ïðè÷èíà]]
|
||||
@@ -2829,17 +2767,6 @@ OPER_SET_NOEXPIRE_ERROR
|
||||
 êà÷åñòâå ïàðàìåòðà äëÿ îïöèè NOEXPIRE âû äîëæíû óêàçàòü ëèáî ON, ëèáî OFF.
|
||||
OPER_SET_UNKNOWN_OPTION
|
||||
Íåèçâåñòíàÿ îïöèÿ %s.
|
||||
OPER_SET_SQL_ON
|
||||
Ðåæèì ðàáîòû ñåðâèñîâ èçìåíåí: àêòèâèðîâàí SQL-ðåæèì (èñïîëüçîâàíèå SQL DB).
|
||||
OPER_SET_SQL_OFF
|
||||
Ðåæèì ðàáîòû ñåðâèñîâ èçìåíåí: SQL-ðåæèì äåàêòèâèðîâàí.
|
||||
OPER_SET_SQL_ERROR
|
||||
 êà÷åñòâå ïàðàìåòðà äëÿ îïöèè SQL âû äîëæíû óêàçàòü ëèáî ON, ëèáî OFF.
|
||||
OPER_SET_SQL_ERROR_INIT
|
||||
Îøèáêà èíèöèàëèçàöèè SQL, îáðàòèòåñü ê ëîãàì äëÿ áîëåå ïîäðîáíîé èíôîðìàöèè.
|
||||
OPER_SET_SQL_ERROR_DISABLED
|
||||
SQL-ôóíêöèè íå íàñòðîåíû èëè íàñòðîåíû íåêîððåêòíî. Âíåñèòå íåîáõîäèìûå
|
||||
èçìåíåíèÿ â êîíôèãóðàöèîííûé ôàéë ñåðâèñîâ (services.conf).
|
||||
OPER_SET_LIST_OPTION_ON
|
||||
Ðåæèì %s: âêëþ÷åí.
|
||||
OPER_SET_LIST_OPTION_OFF
|
||||
@@ -2858,10 +2785,8 @@ OPER_JUPE_SYNTAX
|
||||
JUPE èìÿ_ñåðâåðà [ïðè÷èíà]
|
||||
OPER_JUPE_HOST_ERROR
|
||||
 êà÷åñòâå îñíîâíîãî ïàðàìåòðà âû äîëæíû óêàçàòü ðåàëüíîå èìÿ ñåðåâåðà
|
||||
|
||||
# RAW responses
|
||||
OPER_RAW_SYNTAX
|
||||
RAW ñòðîêà
|
||||
OPER_JUPE_INVALID_SERVER
|
||||
You can not jupe your services server or your uplink server.
|
||||
|
||||
# UPDATE responses
|
||||
OPER_UPDATING
|
||||
@@ -2877,7 +2802,7 @@ OPER_CANNOT_RESTART
|
||||
|
||||
# IGNORE respondes
|
||||
OPER_IGNORE_SYNTAX
|
||||
Ñèíòàêñòñ: IGNORE {ADD|DEL|LIST|CLEAR} [âðåìÿ] [íèê]
|
||||
IGNORE {ADD|DEL|LIST|CLEAR} [âðåìÿ] [íèê]
|
||||
OPER_IGNORE_VALID_TIME
|
||||
Çíà÷åíèå ïàðàìåòðà "âðåìÿ" óêàçàíî íå âåðíî.
|
||||
OPER_IGNORE_TIME_DONE
|
||||
@@ -2947,7 +2872,7 @@ OPER_STAFF_AFORMAT
|
||||
# DefCon Messages
|
||||
|
||||
OPER_DEFCON_SYNTAX
|
||||
Ñèíòàêñèñ: DEFCON [1|2|3|4|5]
|
||||
DEFCON [1|2|3|4|5]
|
||||
OPER_DEFCON_DENIED
|
||||
Íà äàííûé ìîìåíò ñåðâèñû ðàáîòàþò â DEFCON-ðåæèìå. Ïîâòîðèòå ñâîé çàïðîñ ïîçæå.
|
||||
OPER_DEFCON_NO_CONF
|
||||
@@ -3206,7 +3131,7 @@ NEWS_RANDOM_TEXT
|
||||
[Ñëó÷àéíàÿ íîâîñòü - %s] %s
|
||||
|
||||
NEWS_LOGON_SYNTAX
|
||||
Ñèíòàêñèñ: LOGONNEWS {ADD|DEL|LIST} [òåêñò|íîìåð]
|
||||
LOGONNEWS {ADD|DEL|LIST} [òåêñò|íîìåð]
|
||||
NEWS_LOGON_LIST_HEADER
|
||||
Òåêóùèå ñïèñîê íîâîñòåé:
|
||||
NEWS_LOGON_LIST_ENTRY
|
||||
@@ -3232,7 +3157,7 @@ NEWS_LOGON_DELETED_ALL
|
||||
Ñïèñîê íîâîñòåé ïîëíîñòüþ î÷èùåí.
|
||||
|
||||
NEWS_OPER_SYNTAX
|
||||
Ñèíòàêñèñ: OPERNEWS {ADD|DEL|LIST} [òåêñò|íîìåð]
|
||||
OPERNEWS {ADD|DEL|LIST} [òåêñò|íîìåð]
|
||||
NEWS_OPER_LIST_HEADER
|
||||
Ñïèñîê íîâîñòåé äëÿ IRC-îïåðàòîðîâ:
|
||||
NEWS_OPER_LIST_ENTRY
|
||||
@@ -3258,7 +3183,7 @@ NEWS_OPER_DELETED_ALL
|
||||
Ñïèñîê íîâîñòåé äëÿ îïåðàòîðîâ ïîëíîñòüþ î÷èùåí.
|
||||
|
||||
NEWS_RANDOM_SYNTAX
|
||||
Ñèíòàêñèñ: RANDOMNEWS {ADD|DEL|LIST} [òåêñò|íîìåð]
|
||||
RANDOMNEWS {ADD|DEL|LIST} [òåêñò|íîìåð]
|
||||
NEWS_RANDOM_LIST_HEADER
|
||||
Ñïèñîê ñëó÷àéíûõ íîâîñòåé:
|
||||
NEWS_RANDOM_LIST_ENTRY
|
||||
@@ -3291,7 +3216,7 @@ NEWS_HELP_LOGON
|
||||
Ïîçâîëÿåò óïðàâëÿòü ñïèñêîì íîâîñòåé, êîòîðûå áóäóò àâòîìàòè÷åñêè
|
||||
âûäàâàòüñÿ ïîëüçîâàòåëþ ñðàçó æå, êàê òîëüêî îí ïîäêëþ÷èòñÿ ê ñåòè.
|
||||
Ñòîèò çàìåòèòü, ÷òî âî èçáåæàíèå ôëóäà ïîëüçîâàòåëü ïîëó÷èò òîëüêî
|
||||
%s íîâîñòü(è), òàê ÷òî åñëè ó âàñ â ñïèñêå èõ áîëüøå - ïîêàçàíû
|
||||
%d íîâîñòü(è), òàê ÷òî åñëè ó âàñ â ñïèñêå èõ áîëüøå - ïîêàçàíû
|
||||
áóäóò òîëüêî ïîñëåäíèå èç íèõ. Çíà÷åíèå NewsCount, îòâå÷àþùåå çà
|
||||
îäíîâðåìåííî ïîñûëàåìîå êîë-âî íîâîñòåé, óêàçûâàåòñÿ â services.conf
|
||||
|
||||
@@ -3301,9 +3226,7 @@ NEWS_HELP_LOGON
|
||||
êà÷åñòâå ïàðàìåòðà âû ìîæåòå óêàçàòü íîìåð íîâîñòè - ÷òî áû óäàëèòü
|
||||
îäíó íîâîñòü, èëè ALL - ÷òî áû î÷èñòèòü ñïèñîê íîâîñòåé ïîëíîñòüþ.
|
||||
|
||||
Êîìàíäà LOGONNEWS LIST âûâîäèò ñïèñîê òåêóùèõ íîâîñòåé è ìîæåò áûòü
|
||||
èñïîëüçîâàíà ëþáûì IRC-îïåðàòîðîì. Êîìàíäû ADD è DEL äîñòóïíû òîëüêî
|
||||
Àäìèíèñòðàòîðàì ñåðâèñîâ.
|
||||
LOGONNEWS may only be used by Services Operators.
|
||||
|
||||
NEWS_HELP_OPER
|
||||
Ñèíòàêñèñ: OPERNEWS ADD òåêñò
|
||||
@@ -3314,7 +3237,7 @@ NEWS_HELP_OPER
|
||||
ïîëüçîâàòåëü ïîëó÷èò ñòàòóñ IRC-îïåðàòîðà (èñïîëüçîâàâ êîìàíäó /OPER),
|
||||
äàííûå ñîîáùåíèÿ áóäóò åìó îòïðàâëåíû àâòîìàòè÷åñêè.
|
||||
Ñòîèò çàìåòèòü, ÷òî âî èçáåæàíèå ôëóäà ïîëüçîâàòåëü ïîëó÷èò òîëüêî
|
||||
%s íîâîñòü(è), òàê ÷òî åñëè ó âàñ â ñïèñêå èõ áîëüøå - ïîêàçàíû
|
||||
%d íîâîñòü(è), òàê ÷òî åñëè ó âàñ â ñïèñêå èõ áîëüøå - ïîêàçàíû
|
||||
áóäóò òîëüêî ïîñëåäíèå èç íèõ. Çíà÷åíèå NewsCount, îòâå÷àþùåå çà
|
||||
îäíîâðåìåííî ïîñûëàåìîå êîë-âî íîâîñòåé, óêàçûâàåòñÿ â services.conf
|
||||
|
||||
@@ -3324,9 +3247,7 @@ NEWS_HELP_OPER
|
||||
êà÷åñòâå ïàðàìåòðà âû ìîæåòå óêàçàòü íîìåð íîâîñòè - ÷òî áû óäàëèòü
|
||||
îäíó íîâîñòü, èëè ALL - ÷òî áû î÷èñòèòü ñïèñîê íîâîñòåé ïîëíîñòüþ.
|
||||
|
||||
Êîìàíäà OPERNEWS LIST âûâîäèò ñïèñîê òåêóùèõ íîâîñòåé è ìîæåò áûòü
|
||||
èñïîëüçîâàíà ëþáûì IRC-îïåðàòîðîì. Êîìàíäû ADD è DEL äîñòóïíû òîëüêî
|
||||
Àäìèíèñòðàòîðàì ñåðâèñîâ.
|
||||
OPERNEWS may only be used by Services Operators.
|
||||
|
||||
NEWS_HELP_RANDOM
|
||||
Ñèíòàêñèñ: RANDOMNEWS ADD òåêñò
|
||||
@@ -3344,46 +3265,7 @@ NEWS_HELP_RANDOM
|
||||
êà÷åñòâå ïàðàìåòðà âû ìîæåòå óêàçàòü íîìåð íîâîñòè - ÷òî áû óäàëèòü
|
||||
îäíó íîâîñòü, èëè ALL - ÷òî áû î÷èñòèòü ñïèñîê íîâîñòåé ïîëíîñòüþ.
|
||||
|
||||
Êîìàíäà RANDOMNEWS LIST âûâîäèò ñïèñîê òåêóùèõ íîâîñòåé è ìîæåò
|
||||
áûòü èñïîëüçîâàíà ëþáûì IRC-Îïåðàòîðîì. Êîìàíäû ADD è DEL äîñòóïíû
|
||||
òîëüêî Àäìèíèñòðàòîðàì ñåðâèñîâ.
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# HelpServ help message
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
HELP_HELP
|
||||
%S - ýòî ñïðàâî÷íûé ñåðâèñ, ïðèçâàííûé ñîîáùèòü âàì èíôîðìàöèþ îáî
|
||||
âñåõ îñíîâíûõ ñåðâèñàõ ñåòè. Âñÿ ñïðàâî÷íàÿ èíôîðìàöèÿ äîñòóïíà ÷åðåç
|
||||
êîìàíäó HELP:
|
||||
Îñíîâíûå ñåðâèñû ñåòè:
|
||||
|
||||
%R%s HELP
|
||||
ñïðàâî÷íàÿ èíôîðìàöèÿ î òîì, êàê ðåãèñòðèðîâàòü íèêè è
|
||||
íàñòðàèâàòü óæå çàðåãèñòðèðîâàííûå.
|
||||
|
||||
%R%s HELP
|
||||
ñïðàâî÷íàÿ èíôîðìàöèÿ î òîì, êàê ðåãèñòðèðîâàòü êàíàëû è
|
||||
óïðàâëÿòü óæå çàðåãèñòðèðîâàííûìè.
|
||||
|
||||
%R%s HELP
|
||||
ñïðàâî÷íàÿ èíôîðìàöèÿ î òîì, êàê îòïðàâëÿòü è ÷èòàòü
|
||||
ìåìî-ñîîáùåíèÿ.
|
||||
|
||||
HELP_HELP_BOT
|
||||
Äîïîëíèòåëüíûå ñåðâèñû ñåòè:
|
||||
|
||||
%R%s HELP
|
||||
ñïðàâî÷íàÿ èíôîðìàöèÿ î òîì, êàê ïðèãëàñèòü ñåðâèñíîãî áîòà íà
|
||||
ñâîé êàíàë è ïðàâèëüíî åãî íàñòðîèòü.
|
||||
|
||||
HELP_HELP_HOST
|
||||
|
||||
%R%s HELP
|
||||
ñïðàâî÷íàÿ èíôîðìàöèÿ îá óñòàíîâêå/óäàëåíèè vHost'îâ
|
||||
(âèðòóàëüíûõ õîñòîâ).
|
||||
RANDOMNEWS may only be used by Services Operators.
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
@@ -3498,7 +3380,7 @@ NICK_HELP_REGISTER
|
||||
ãðóïïó. Âîçìîæíîñòè ãðóïï íèêîâ ïîçâîëÿþò âàì èìåòü íåñêîëüêî íèêîâ
|
||||
ñ îáùåé äëÿ íèõ èíôîðìàöèåé, íàñòðîéêàìè, ñïèñêîì äîñòóïà. Äëÿ áîëåå
|
||||
ïîäðîáíîé èíôîðìàöèè ñì. %R%S HELP GROUP
|
||||
|
||||
|
||||
NICK_HELP_GROUP
|
||||
Ñèíòàêñèñ: GROUP ãëàâíûé_íèê ïàðîëü
|
||||
|
||||
@@ -3712,7 +3594,7 @@ NICK_HELP_SET_PRIVATE
|
||||
ïîëó÷èòü èíôîðìàöèþ î âàñ èñïîëüçóÿ êîìàíäó INFO.
|
||||
|
||||
NICK_HELP_SET_HIDE
|
||||
Ñèíòàêñèñ: SET HIDE {EMAIL | USERMASK | QUIT} {ON | OFF}
|
||||
Ñèíòàêñèñ: SET HIDE {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}
|
||||
|
||||
Äàííàÿ îïöèÿ ïîçâîëÿåò âàì ñêðûòü ÷àñòü èíôîðìàöèè î âàøåì íèêå,
|
||||
êîòîðàÿ ìîæåò çàïðîøåíà ó %S ñ ïîìîùüþ êîìàíäû INFO
|
||||
@@ -3855,7 +3737,7 @@ NICK_HELP_SASET_PRIVATE
|
||||
èìååò âîçìîæíîñòü ïîëó÷èòü èíôîðìàöèþ î íåì èñïîëüçóÿ êîìàíäó INFO.
|
||||
|
||||
NICK_HELP_SASET_HIDE
|
||||
Ñèíòàêñèñ: SASET íèê HIDE {EMAIL|STATUS|USERMASK|QUIT} {ON|OFF}
|
||||
Ñèíòàêñèñ: SASET íèê HIDE {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}
|
||||
|
||||
Äàííàÿ îïöèÿ ïîçâîëÿåò âàì ñêðûòü ÷àñòü èíôîðìàöèè îá óêàçàííîì
|
||||
íèêå, êîòîðàÿ ìîæåò çàïðîøåíà ó %S ñ ïîìîùüþ êîìàíäû INFO
|
||||
@@ -4030,10 +3912,11 @@ NICK_HELP_STATUS
|
||||
Çàïðàøèâàåò èíôîðìàöèþ î ñòàòóñå íèêà íà ñåðâèñàõ - èäåíòèôèöèðîâàëñÿ
|
||||
ëè èñïîëüçóþùèé åãî êàê âëàäåëåö. Îòâåò âûâîäèòñÿ â ôîðìàòå:
|
||||
|
||||
íèê êîä-ñòàòóñà
|
||||
íèê êîä-ñòàòóñà status account
|
||||
|
||||
ãäå íèê - ýòî íèê, ñòàòóñ êîòîðîãî âû çàïðîñèëè, à êîä-ñòàòóñà
|
||||
ìîæåò áûòü îäíèì èç:
|
||||
where nickname is the nickname sent with the command,
|
||||
status-code is one of the following, and account
|
||||
is the account they are logged in as.
|
||||
|
||||
0 - òàêîãî ïîëüçîâàòåëÿ íåò â îíëàéíå èëè ýòîò íèê íå çàðåãèñòðèðîâàí
|
||||
1 - ïîëüçîâàòåëü íå èäåíòèôèöèðîâàí êàê âëàäåëåö íèêà
|
||||
@@ -4053,7 +3936,6 @@ NICK_HELP_SENDPASS
|
||||
|
||||
Ïðèìå÷àíèå: SENDPASS ìîæåò áûòü îãðàíè÷åí äëÿ èñïîëüçîâàíèÿ òîëüêî
|
||||
IRC-îïåðàòîðàìè äàííîé ñåòè.
|
||||
Ïðèìå÷àíèå 2: ïðè âêëþ÷åííîì øèôðîâàíèè ïàðîëåé ýòà êîìàíäà íåäîñòóïíà.
|
||||
|
||||
NICK_HELP_CONFIRM
|
||||
Ñèíòàêñèñ: CONFIRM auth-êîä
|
||||
@@ -4245,7 +4127,7 @@ CHAN_HELP_CMD_GETKEY
|
||||
CHAN_HELP_CMD_INFO
|
||||
INFO Çàïðîñ èíôîðìàöèè îá óêàçàííîì êàíàëå
|
||||
CHAN_HELP_CMD_INVITE
|
||||
INVITE Çàñòàâëÿåò ñåðâèñû ïðèãëàñèòü âàñ íà óêàçàííûé êàíàë.
|
||||
INVITE Tells ChanServ to invite you into a channel
|
||||
CHAN_HELP_CMD_KICK
|
||||
KICK Âûêèäûâàåò óêàçàííîãî ïîëüçîâàòåëÿ ñ êàíàëà
|
||||
CHAN_HELP_CMD_LIST
|
||||
@@ -4525,9 +4407,9 @@ CHAN_HELP_SET_PRIVATE
|
||||
CHAN_HELP_SET_RESTRICTED
|
||||
Ñèíòàêñèñ: SET #êàíàë RESTRICTED {ON | OFF}
|
||||
|
||||
Àêòèâèðóåò/äåàêòèâèðóåò îãðàíè÷åííûé äîñòóï íà êàíàë. Äàííûé ðåæèì
|
||||
ïîçâîëÿåò çàïðåòèòü äîñòóï íà êàíàë âñåì òåì ïîëüçîâàòåëÿì, êîòîðûå
|
||||
íå ÷èñëÿòñÿ â ñïèñêå äîñòóïà êàíàëà.
|
||||
Enables or disables the restricted access option for a
|
||||
channel. When restricted access is set, users not on the access list will
|
||||
instead be kicked and banned from the channel.
|
||||
|
||||
CHAN_HELP_SET_SECURE
|
||||
Ñèíòàêñèñ: SET #êàíàë SECURE {ON | OFF}
|
||||
@@ -4950,37 +4832,31 @@ CHAN_HELP_LIST
|
||||
"#" óêàçûâàòü íå íàäî - îí çàðåçåðâèðîâàí äëÿ ñïèñêà (ñì. âûøå).
|
||||
|
||||
CHAN_HELP_OP
|
||||
Ñèíòàêñèñ: OP [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: OP #êàíàë [íèê]
|
||||
|
||||
Ïîçâîëÿåò óñòàíîâèòü ñòàòóñ îïåðàòîðà êàíàëà óêàçàííîìó íèêó íà
|
||||
óêàçàííîì êàíàëå. Åñëè íèê íå óêàçàí, ñòàòóñ îïåðàòîðà áóäåò
|
||||
âûäàí èñïîëüçóþùåìó êîìàíäó. Åñëè íå óêàçàíû íè êàíàë íè íèê -
|
||||
óñòàíîâèò ñòàòóñ îïåðàòîðà èñïîëüçóþùåìó êîìàíäó íà âñåõ êàíàëàõ,
|
||||
ãäå îí èìååò ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
âûäàí èñïîëüçóþùåìó êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå.
|
||||
|
||||
CHAN_HELP_DEOP
|
||||
Ñèíòàêñèñ: DEOP [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: DEOP #êàíàë [íèê]
|
||||
|
||||
Ñíèìàåò ñòàòóñ îïåðàòîðà êàíàëà ñ óêàçàííîãî íèêà íà óêàçàííîì
|
||||
êàíàëå. Åñëè íèê íå óêàçàí, ñíèìàåò ñòàòóñ îïåðàòîðà ñ èñïîëüçóþùåãî
|
||||
êîìàíäó. Åñëè íè êàíàë íè íèê íå óêàçàíû - ñíèìàåò ñòàòóñ îïåðàòîðà
|
||||
ñ èñïîëüçóþùåãî êîìàíäó íà âñåõ êàíàëàõ, íà êîòîðûõ ó íåãî åñòü
|
||||
ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå.
|
||||
|
||||
CHAN_HELP_VOICE
|
||||
Ñèíòàêñèñ: VOICE [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: VOICE #êàíàë [íèê]
|
||||
|
||||
Ïîçâîëÿåò óñòàíîâèòü ñòàòóñ âîéñà óêàçàííîìó íèêó íà óêàçàííîì
|
||||
êàíàëå. Åñëè íèê íå óêàçàí, ñòàòóñ âîéñà áóäåò âûäàí èñïîëüçóþùåìó
|
||||
êîìàíäó. Åñëè íå óêàçàíû íè êàíàë íè íèê - óñòàíîâèò ñòàòóñ âîéñà
|
||||
èñïîëüçóþùåìó êîìàíäó íà âñåõ êàíàëàõ, ãäå îí èìååò ñîîòâåòñòâóþùèé
|
||||
óðîâåíü äîñòóïà.
|
||||
êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå. Ìîæåò áûòü èñïîëüçîâàíà VOP'àìè
|
||||
@@ -4988,12 +4864,10 @@ CHAN_HELP_VOICE
|
||||
îòíîñèòåëüíî ñåáÿ).
|
||||
|
||||
CHAN_HELP_DEVOICE
|
||||
Ñèíòàêñèñ: DEVOICE [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: DEVOICE #êàíàë [íèê]
|
||||
|
||||
Ñíèìàåò ñòàòóñ âîéñà ñ óêàçàííîãî íèêà íà óêàçàííîì êàíàëå. Åñëè íèê
|
||||
íå óêàçàí, ñíèìàåò ñòàòóñ âîéñà ñ èñïîëüçóþùåãî êîìàíäó. Åñëè íè êàíàë
|
||||
íè íèê íå óêàçàíû - ñíèìàåò ñòàòóñ âîéñà ñ èñïîëüçóþùåãî êîìàíäó íà
|
||||
âñåõ êàíàëàõ, íà êîòîðûõ ó íåãî åñòü ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
íå óêàçàí, ñíèìàåò ñòàòóñ âîéñà ñ èñïîëüçóþùåãî êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå. Ìîæåò áûòü èñïîëüçîâàíà VOP'àìè
|
||||
@@ -5001,13 +4875,11 @@ CHAN_HELP_DEVOICE
|
||||
îòíîñèòåëüíî ñåáÿ).
|
||||
|
||||
CHAN_HELP_HALFOP
|
||||
Ñèíòàêñèñ: HALFOP [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: HALFOP #êàíàë [íèê]
|
||||
|
||||
Ïîçâîëÿåò óñòàíîâèòü ñòàòóñ ïîëóîïåðàòîðà êàíàëà óêàçàííîìó íèêó
|
||||
íà óêàçàííîì êàíàëå. Åñëè íèê íå óêàçàí, ñòàòóñ ïîëóîïåðàòîðà
|
||||
áóäåò âûäàí èñïîëüçóþùåìó êîìàíäó. Åñëè íå óêàçàíû íè êàíàë íè íèê -
|
||||
óñòàíîâèò ñòàòóñ ïîëóîïåðàòîðà èñïîëüçóþùåìó êîìàíäó íà âñåõ êàíàëàõ,
|
||||
ãäå îí èìååò ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
áóäåò âûäàí èñïîëüçóþùåìó êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå. Ìîæåò áûòü èñïîëüçîâàíà HOP'àìè
|
||||
@@ -5015,13 +4887,11 @@ CHAN_HELP_HALFOP
|
||||
îòíîñèòåëüíî ñåáÿ).
|
||||
|
||||
CHAN_HELP_DEHALFOP
|
||||
Ñèíòàêñèñ: DEHALFOP [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: DEHALFOP #êàíàë [íèê]
|
||||
|
||||
Ñíèìàåò ñòàòóñ ïîëóîïåðàòîðà ñ óêàçàííîãî íèêà íà óêàçàííîì êàíàëå.
|
||||
Åñëè íèê íå óêàçàí, ñíèìàåò ñòàòóñ ïîëóîïåðàòîðà ñ èñïîëüçóþùåãî
|
||||
êîìàíäó. Åñëè íè êàíàë íè íèê íå óêàçàíû - ñíèìàåò ñòàòóñ ïîëóîïà
|
||||
ñ èñïîëüçóþùåãî êîìàíäó íà âñåõ êàíàëàõ, íà êîòîðûõ ó íåãî åñòü
|
||||
ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå. Ìîæåò áûòü èñïîëüçîâàíà HOP'àìè
|
||||
@@ -5029,47 +4899,39 @@ CHAN_HELP_DEHALFOP
|
||||
îòíîñèòåëüíî ñåáÿ).
|
||||
|
||||
CHAN_HELP_PROTECT
|
||||
Ñèíòàêñèñ: PROTECT [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: PROTECT #êàíàë [íèê]
|
||||
|
||||
Ïîçâîëÿåò óñòàíîâèòü ñòàòóñ çàùèòû (àäìèíèñòðàòîðà) êàíàëà óêàçàííîìó
|
||||
íèêó íà óêàçàííîì êàíàëå. Åñëè íèê íå óêàçàí, ñòàòóñ çàùèòû áóäåò
|
||||
âûäàí èñïîëüçóþùåìó êîìàíäó. Åñëè íå óêàçàíû íè êàíàë íè íèê -
|
||||
óñòàíîâèò ñòàòóñ çàùèòû èñïîëüçóþùåìó êîìàíäó íà âñåõ êàíàëàõ, ãäå îí
|
||||
èìååò ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
âûäàí èñïîëüçóþùåìó êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà âëàäåëüöåì èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 10 (SOP) è âûøå (â ïîñëåäíåì ñëó÷àå - òîëüêî
|
||||
îòíîñèòåëüíî ñåáÿ).
|
||||
|
||||
CHAN_HELP_DEPROTECT
|
||||
Ñèíòàêñèñ: DEPROTECT [#êàíàë [íèê]]
|
||||
Ñèíòàêñèñ: DEPROTECT #êàíàë [íèê]
|
||||
|
||||
Ñíèìàåò ñòàòóñ çàùèòû (àäìèíèñòðàòîðà) ñ óêàçàííîãî íèêà íà óêàçàííîì
|
||||
êàíàëå. Åñëè íèê íå óêàçàí, ñíèìàåò ñòàòóñ çàùèòû ñ èñïîëüçóþùåãî
|
||||
êîìàíäó. Åñëè íè êàíàë íè íèê íå óêàçàíû - ñíèìàåò ñòàòóñ çàùèòû
|
||||
ñ èñïîëüçóþùåãî êîìàíäó íà âñåõ êàíàëàõ, íà êîòîðûõ ó íåãî åñòü
|
||||
ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà âëàäåëüöåì èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 10 (SOP) è âûøå (â ïîñëåäíåì ñëó÷àå - òîëüêî
|
||||
îòíîñèòåëüíî ñåáÿ).
|
||||
|
||||
CHAN_HELP_OWNER
|
||||
Ñèíòàêñèñ: OWNER [#êàíàë]
|
||||
Ñèíòàêñèñ: OWNER #êàíàë
|
||||
|
||||
Óñòàíàâëèâàåò ñòàòóñ âëàäåëüöà êàíàëà èñïîëüçóþùåìó êîìàíäó. Åñëè
|
||||
êàíàë íå óêàçàí - óñòàíàâëèâàåò ñòàòóñ âëàäåëüöà íà âñåõ êàíàëàõ,
|
||||
íà êîòîðûõ ó èñïîëüçóþùåãî åñòü ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
Óñòàíàâëèâàåò ñòàòóñ âëàäåëüöà êàíàëà èñïîëüçóþùåìó êîìàíäó.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà òîëüêî
|
||||
âëàäåëüöåì êàíàëà.
|
||||
|
||||
CHAN_HELP_DEOWNER
|
||||
Ñèíòàêñèñ: DEOWNER [#êàíàë]
|
||||
Ñèíòàêñèñ: DEOWNER #êàíàë
|
||||
|
||||
Ñíèìàåò ñ èñïîëüçóþùåãî ñòàòóñ âëàäåëüöà êàíàëà. Åñëè êàíàë íå
|
||||
óêàçàí, ñíèìàåò ñ èñïîëüçóþùåãî êîìàíäó ñòàòóñ âëàäåëüöà íà âñåõ
|
||||
êàíàëàõ, íà êîòîðûõ ó íåãî åñòü ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
Ñíèìàåò ñ èñïîëüçóþùåãî ñòàòóñ âëàäåëüöà êàíàëà.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà òîëüêî
|
||||
âëàäåëüöåì êàíàëà.
|
||||
@@ -5092,23 +4954,17 @@ CHAN_HELP_UNBAN
|
||||
èëè ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå.
|
||||
|
||||
CHAN_HELP_KICK
|
||||
Ñèíòàêñèñ: KICK [#êàíàë [íèê [ïðè÷èíà]]]
|
||||
Ñèíòàêñèñ: KICK #êàíàë íèê [ïðè÷èíà]
|
||||
|
||||
Âûêèäûâàåò óêàçàííîãî ïîëüçîâàòåëÿ ñ óêàçàííîãî êàíàëà. Åñëè íèê íå
|
||||
óêàçàí - âûêèäûâàåò âàñ. Åñëè êàíàë è íèê íå óêàçàíû - âûêèíåò âàñ
|
||||
ñî âñåõ êàíàëîâ, íà êîòîðûõ ó âàñ åñòü ñîîòâåòñòâóþùèé óðîâåíü
|
||||
äîñòóïà.
|
||||
Âûêèäûâàåò óêàçàííîãî ïîëüçîâàòåëÿ ñ óêàçàííîãî êàíàëà.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå.
|
||||
|
||||
CHAN_HELP_BAN
|
||||
Ñèíòàêñèñ: BAN [#êàíàë [íèê [ïðè÷èíà]]]
|
||||
Ñèíòàêñèñ: BAN #êàíàë íèê [ïðè÷èíà]
|
||||
|
||||
Áàíèò óêàçàííîãî ïîëüçîâàòåëÿ íà óêàçàííîì êàíàëå. Øàáëîí áàíìàñêè
|
||||
áóäåò âçÿò èç óñòàíîâêè BANTYPE. Åñëè íèê íå óêàçàí - ñåðâèñû
|
||||
çàáàíÿò âàñ. Åñëè êàíàë è íèê íå óêàçàíû - ñåðâèñû çàáàíÿò âàñ íà
|
||||
âñåõ êàíàëàõ, ãäå ó âàñ åñòü ñîîòâåòñòâóþùèé óðîâåíü äîñòóïà.
|
||||
Áàíèò óêàçàííîãî ïîëüçîâàòåëÿ íà óêàçàííîì êàíàëå.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå.
|
||||
@@ -5136,7 +4992,9 @@ CHAN_HELP_CLEAR
|
||||
BANS óäàëåíèå âñåõ áàíîâ êàíàëà
|
||||
EXCEPTS óäàëåíèå âñåõ èñêëþ÷åíèé èç áàíà
|
||||
INVITES óäàëåíèå âñåõ èñêëþ÷åíèé íà ïðèãëàøåíèå
|
||||
OPS ñíÿòèå ñòàòóñà îïåðàòîðà ñî âñåõ îïåðàòîðîâ êàíàëà
|
||||
OPS ñíÿòèå ñòàòóñà îïåðàòîðà ñî âñåõ îïåðàòîðîâ êàíàëà.
|
||||
If supported, removes channel-admin (mode +a) and
|
||||
channel-owner (mode +q) as well.
|
||||
HOPS ñíÿòèå ñòàòóñà ïîëóîïåðàòîðà ñî âñåõ õîïîâ êàíàëà
|
||||
VOICES ñíÿòèå ñòàòóñà âîéñà ñî âñåõ âîéñîâ êàíàëà
|
||||
USERS ìàññîâûé êèê âñåõ ïîñåòèòåëåé êàíàëà
|
||||
@@ -5147,15 +5005,7 @@ CHAN_HELP_CLEAR
|
||||
CHAN_HELP_GETKEY
|
||||
Ñèíòàêñèñ: GETKEY #êàíàë
|
||||
|
||||
Ïîçâîëÿåò çàïðîñèòü ó ñåðâèñîâ êëþ÷-ïàðîëü êàíàëà. Äàííàÿ êîìàíäà
|
||||
îáû÷íî èñïîëüçóåòñÿ áîòàìè è/èëè ñêðèïòàìè è âîçâðàùàåò ñòðîêó âèäà:
|
||||
KEY #êàíàë êëþ÷
|
||||
|
||||
Åñëè ñåêðåòíûé êëþ÷ ïîêàçàí êàê "NO KEY" - ïàðîëü íà âõîä íà êàíàëå
|
||||
íå óñòàíîâëåí.
|
||||
|
||||
Ïî-óìîë÷àíèþ, äàííàÿ êîìàíäà ìîæåò áûòü èñïîëüçîâàíà AOP'àìè èëè
|
||||
ëèöàìè ñ óðîâíåì äîñòóïà 5 è âûøå.
|
||||
Ïîçâîëÿåò çàïðîñèòü ó ñåðâèñîâ êëþ÷-ïàðîëü êàíàëà.
|
||||
|
||||
CHAN_HELP_SENDPASS
|
||||
Ñèíòàêñèñ: SENDPASS #êàíàë
|
||||
@@ -5165,7 +5015,6 @@ CHAN_HELP_SENDPASS
|
||||
|
||||
Ïðèìå÷àíèå: â çàâèñèìîñòè îò íàñòðîåê ñåòè, äîñòóï ê äàííîé êîìàíäå
|
||||
ìîæåò áûòü îãðàíè÷åí äî IRC-îïåðàòîðîâ.
|
||||
Ïðèìå÷àíèå 2: êîìàíäà íåäîñòóïíà ïðè âêëþ÷åííîì øèôðîâàíèè ïàðîëåé.
|
||||
|
||||
CHAN_SERVADMIN_HELP
|
||||
|
||||
@@ -5409,7 +5258,7 @@ MEMO_HELP_SET
|
||||
êîìàíäîé %R%S HELP SET îïöèÿ.
|
||||
|
||||
MEMO_HELP_SET_NOTIFY
|
||||
Ñèíòàêñèñ: SET NOTIFY {ON | LOGON | NEW | OFF}
|
||||
Ñèíòàêñèñ: SET NOTIFY {ON | LOGON | NEW | MAIL | NOMAIL | OFF}
|
||||
|
||||
Äàííàÿ îïöèÿ ïîçâîëÿåò íàñòðîèòü âàø ëè÷íûé ìåòîä óâåäîìëåíèÿ î
|
||||
íîâûõ ñîîáùåíèÿõ, ïîñëàííûõ âàì êåì-ëèáî.
|
||||
@@ -5423,6 +5272,9 @@ MEMO_HELP_SET_NOTIFY
|
||||
/AWAY (îòîøåë).
|
||||
NEW óâåäîìëåíèå áóäåò ïîñòóïàòü ñðàçó, êàê òîëüêî êòî-òî
|
||||
îòïðàâèò âàì íîâîå ñîîáùåíèå.
|
||||
MAIL You will be notified of memos by email aswell as
|
||||
any other settings you have.
|
||||
NOMAIL You will not be notified of memos by email.
|
||||
OFF óâåäîìëåíèé î ïîëó÷åíèè íîâûõ ñîîáùåíèé ïîñòóïàòü
|
||||
íå áóäåò
|
||||
|
||||
@@ -5483,9 +5335,6 @@ MEMO_HELP_STAFF
|
||||
|
||||
Ïîçâîëÿåò îòïðàâèòü ìåìî-ñîîáùåíèå âñåì îïåðàòîðàì/àäìèíèñòðàòîðàì
|
||||
ñåðâèñîâ ñåòè.
|
||||
Ïðèìå÷àíèå: ïîëüçîâàòåëè, çíà÷àùèåñÿ êàê â ñïèñêå îïåðàòîðîâ, òàê
|
||||
è â ñïèñêå àäìèíèñòðàòîðîâ ñåðâèñîâ - ïîëó÷àò äàííîå ñîîáùåíèå äâàæäû.
|
||||
Àíàëîãè÷íî è ïî îòíîøåíèþ ê ðóòàì ñåðâèñîâ.
|
||||
|
||||
MEMO_HELP_SENDALL
|
||||
Ñèíòàêñèñ: SENDALL òåêñò_ñîîáùåíèÿ
|
||||
@@ -5519,10 +5368,6 @@ OPER_HELP_CMD_GLOBAL
|
||||
GLOBAL Îòïðàâêà ãëîáàëüíîãî ñîîáùåíèÿ âñåì ïîëüçîâàòåëÿì ñåòè
|
||||
OPER_HELP_CMD_STATS
|
||||
STATS Çàïðîñ èíôîðìàöè î ñòàòóñå ñåðâèñîâ è ñåòè
|
||||
OPER_HELP_CMD_OPER
|
||||
OPER Óïðàâëåíèå ñïèñêîì Îïåðàòîðîâ ñåðâèñîâ
|
||||
OPER_HELP_CMD_ADMIN
|
||||
ADMIN Óïðàâëåíèå ñïèñêîì Àäìèíèñòðàòîðîâ ñåðâèñîâ
|
||||
OPER_HELP_CMD_STAFF
|
||||
STAFF Ñïèñîê âñåõ ïðîïèñàííûõ íà ñåðâèñàõ è èõ îíëàéí-ñòàòóñ
|
||||
OPER_HELP_CMD_MODE
|
||||
@@ -5630,80 +5475,6 @@ OPER_HELP_STATS
|
||||
|
||||
Ïàðàìåòð ALL âûâåäåò îáùóþ ñòàòèñòèêó â êîìáèíàöèè ñ äàííûìè èç
|
||||
MEMORY è UPLINK.
|
||||
|
||||
Êîìàíäà UPTIME ÿâëÿåòñÿ àëèàñîì êîìàíäû STATS.
|
||||
|
||||
OPER_HELP_OPER
|
||||
Ñèíòàêñèñ: OPER ADD íèê
|
||||
OPER DEL {íèê | íîìåð_çàïèñè | ñïèñîê_çàïèñåé}
|
||||
OPER LIST [ìàñêà | ñïèñîê_çàïèñåé]
|
||||
OPER CLEAR
|
||||
|
||||
Ïîçâîëÿåò Ðóòàì ñåðâèñîâ óïðàâëÿòü ñïèñêîì îïåðàòîðîâ ñåðâèñîâ.
|
||||
Îïåðàòîðû ñåðâèñîâ íå èìåþò âîçìîæíîñòè àäìèíèñòðèðîâàòü íèêè è
|
||||
êàíàëû ñåòè, îäíàêî, îíè èìåþò äîñòóï ê íåêîòîðûì êîìàíäàì/ôóíêöèÿì
|
||||
îïåðàòîðñêîãî ñåðâèñà ñåòè. Äëÿ èñïîëüçîâàíèÿ ñâîèõ ïðèâèëåãèé îíè
|
||||
äîëæíû èìåòü ñòàòóñ IRC-îïåðàòîðà è áûòü ïðîèäåíòèôèöèðîâàíû ê íèêó
|
||||
íà %s.
|
||||
|
||||
Êîìàíäà OPER ADD ïîçâîëÿåò äîáàâèòü óêàçàííûé íèê â ñïèñîê
|
||||
Îïåðàòîðîâ ñåðâèñîâ.
|
||||
|
||||
Êîìàíäà OPER DEL óäàëÿåò óêàçàííûé íèê èç ñïèñêà Îïåðàòîðîâ
|
||||
ñåðâèñîâ.  êà÷åñòâå ïàðàìåòðà âû ìîæåòå óêàçàòü íå òîëüêî íèê, íî
|
||||
è êîíêðåòíûé íîìåð çàïèñè èëè ñïèñîê çàïèñåé (ñì. ïðèìåðû
|
||||
èñïîëüçîâàíèÿ êîìàíäû LIST íèæå).
|
||||
|
||||
Êîìàíäà OPER LIST âûâîäèò ñïèñîê Îïåðàòîðîâ ñåðâèñîâ.  êà÷åñòâå
|
||||
äîïîëíèòåëüíîãî ïàðàìåòðà, âû ìîæåòå óêàçàòü ñèìâîëüíóþ ìàñêó, ÷òî
|
||||
ïîçâîëèò âàì ïîëó÷èòü ñïèñîê ñ êîíêðåòíûìè íèêàìè, ïîïàäàþùèìè ïîä
|
||||
ýòó ìàñêó, èëè æå, âû ìîæåòå óêàçàòü ñïèñîê çàïèñåé. Íàïðèìåð:
|
||||
|
||||
OPER LIST 2-5,7-9
|
||||
îòîáðàçèò âñå çàïèñè ñ 2-îé ïî 5-þ è ñ 7-îé ïî 9-þ.
|
||||
|
||||
Êîìàíäà OPER CLEAR ïîçâîëÿåò ïîëíîñòüþ î÷èñòèòü ñïèñîê Îïåðàòîðîâ
|
||||
ñåðâèñîâ.
|
||||
|
||||
Èñïîëüçîâàòü êîìàíäó OPER LIST ìîæåò ëþáîé ïîëüçîâàòåëü ñ ïðàâàìè
|
||||
IRC-îïåðàòîðà, îñòàëüíûå êîìàíäû îãðàíè÷åíû äî Ðóòà ñåðâèñîâ.
|
||||
|
||||
OPER_HELP_ADMIN
|
||||
Ñèíòàêñèñ: ADMIN ADD íèê
|
||||
ADMIN DEL {íèê | íîìåð_çàïèñè | ñïèñîê_çàïèñåé}
|
||||
ADMIN LIST [ìàñêà | ñïèñîê_çàïèñåé]
|
||||
ADMIN CLEAR
|
||||
|
||||
Ïîçâîëÿåò Ðóòàì ñåðâèñîâ óïðàâëÿòü ñïèñêîì Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
Ïîìèìî âñåõ ïðèâèëåãèé Îïåðàòîðâî ñåðâèñîâ, Àäìèíèñòðàòîðû ñåðâèñîâ
|
||||
îáëàäàþò äîïîëíèòåëüíûìè âîçìîæíîñòÿìè ïî àäìèíñòðèðîâàíèþ íèêîâ è
|
||||
êàíàëîâ ñåòè. Èì äîñòóïíû ïðàêòè÷åñêè âñå ôóíêöèè îïåðàòîðñêîãî
|
||||
ñåðâèñà ñåòè.
|
||||
Äëÿ èñïîëüçîâàíèÿ ñâîèõ ïðèâèëåãèé, îíè äîëæíû èìåòü ñòàòóñ
|
||||
IRC-îïåðàòîðà ñåòè è áûòü ïðîèäåíòèôèöèðîâàíû ê íèêó íà %s.
|
||||
|
||||
Êîìàíäà ADMIN ADD ïîçâîëÿåò äîáàâèòü óêàçàííûé íèê â ñïèñîê
|
||||
Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
|
||||
Êîìàíäà ADMIN DEL óäàëÿåò óêàçàííûé íèê èç ñïèñêà Àäìèíèñòðàòîðîâ
|
||||
ñåðâèñîâ.  êà÷åñòâå ïàðàìåòðà âû ìîæåòå óêàçàòü íå òîëüêî íèê, íî
|
||||
è êîíêðåòíûé íîìåð çàïèñè èëè ñïèñîê çàïèñåé (ñì. ïðèìåðû
|
||||
èñïîëüçîâàíèÿ êîìàíäû LIST íèæå).
|
||||
|
||||
Êîìàíäà ADMIN LIST âûâîäèò ñïèñîê Àäìèíèñòðàòîðîâ ñåðâèñîâ. Â
|
||||
êà÷åñòâå äîïîëíèòåëüíîãî ïàðàìåòðà, âû ìîæåòå óêàçàòü ñèìâîëüíóþ
|
||||
ìàñêó, ÷òî ïîçâîëèò âàì ïîëó÷èòü ñïèñîê ñ êîíêðåòíûìè íèêàìè,
|
||||
ïîïàäàþùèìè ïîä ýòó ìàñêó, èëè æå, âû ìîæåòå óêàçàòü ñïèñîê çàïèñåé.
|
||||
Íàïðèìåð:
|
||||
|
||||
ADMIN LIST 2-5,7-9
|
||||
îòîáðàçèò âñå çàïèñè ñ 2-îé ïî 5-þ è ñ 7-îé ïî 9-þ.
|
||||
|
||||
Êîìàíäà ADMIN CLEAR ïîçâîëÿåò ïîëíîñòüþ î÷èñòèòü ñïèñîê
|
||||
Àäìèíèñòðàòîðîâ ñåðâèñîâ.
|
||||
|
||||
Èñïîëüçîâàòü êîìàíäó ADMIN LIST ìîæåò ëþáîé ïîëüçîâàòåëü ñ ïðàâàìè
|
||||
IRC-îïåðàòîðà, îñòàëüíûå êîìàíäû îãðàíè÷åíû äî Ðóòà ñåðâèñîâ.
|
||||
|
||||
OPER_HELP_IGNORE
|
||||
Ñèíòàêñèñ: IGNORE {ADD|DEL|LIST|CLEAR} [âðåìÿ] [íèê|ìàñêà]
|
||||
@@ -5979,7 +5750,6 @@ OPER_HELP_SET
|
||||
LOGCHAN àêòèâàöèÿ/äåàêòèâàöèÿ ëîãèðîâàíèÿ ñîáûòèé íà ñåðâèñíûé êàíàë
|
||||
DEBUG àêòèâàöèÿ/äåàêòèâàöèÿ ðåæèì îòëàäêè (debug mode)
|
||||
NOEXPIRE àêòèâàöèÿ/äåàêòèâàöèÿ ðåæèìà íå-èñòå÷åíèÿ
|
||||
SQL àêòèâàöèÿ/äåàêòèâàöèÿ SQL-ðåæèìà
|
||||
IGNORE àêòèâàöèÿ/äåàêòèâàöèÿ îáðàáîòêè ñïèñêà èãíîðà
|
||||
LIST ïðîñìîòð ñòàòóñà âñåõ âûøåïåðå÷èñëåííûõ îïöèé
|
||||
SUPERADMIN àêòèâàöèÿ/äåàêòèâàöèÿ ðåæèìà Ñóïåð-Àäìèíèñòðàòîðà
|
||||
@@ -6053,13 +5823,6 @@ OPER_HELP_SET_SUPERADMIN
|
||||
íåîáõîäèìîñòè. Îòêëþ÷èòå åå ñðàçó, êàê òîëüêî ïåðåñòàíåòå íóæäàòüñÿ
|
||||
â íåé.
|
||||
|
||||
OPER_HELP_SET_SQL
|
||||
Ñèíòàêñèñ: SET SQL {ON | OFF}
|
||||
|
||||
Äàííàÿ îïöèÿ ïîçâîëÿåò âàì "íà ëåòó" âêëþ÷àòü èëè âûêëþ÷àòü SQL-ðåæèì
|
||||
ñåðâèñîâ. Âåñüìà ïîëåçíî, íàïðèìåð, êîãäà MySQL ñåðâåð âðåìåííî
|
||||
íåäîñòóïåí.
|
||||
|
||||
OPER_HELP_SET_IGNORE
|
||||
Ñèíòàêñèñ: SET IGNORE {ON | OFF}
|
||||
|
||||
@@ -6100,17 +5863,6 @@ OPER_HELP_JUPE
|
||||
Ïðèìå÷àíèå: ïàðàìåòð ïðè÷èíà ÿâëÿåòñÿ íå îáÿçàòåëüíûì, åñëè âû åãî
|
||||
íå óêàæåòå, áóäåò èñïîëüçîâàíà ñòàíäàðòíàÿ, âèäà: "Juped by <íèê>".
|
||||
|
||||
OPER_HELP_RAW
|
||||
Ñèíòàêñèñ: RAW òåêñò
|
||||
|
||||
Ïîçâîëÿåò îòïðàâèòü óêàçàííóþ òåêñòîâóþ ñòðîêó íàïðÿìóþ íà IRC-ñåðâåð,
|
||||
ê êîòîðîìó ïðèëèíêîâàíû ñåðâèñû. Ó÷òèòå, ÷òî äàííûå îòïðàâëÿþòñÿ
|
||||
"as is", â ñûðîì âèäå, è íèêàêèõ ïðîâåðîê íå îñóùåñòâëÿåòñÿ! À ýòî
|
||||
çíà÷èò, ÷òî íåâåðíûé ôîðìàò äàííûõ ìîæåò âûçâàòü ó IRCd-ñåðâåðà
|
||||
îøèáêó èíòåðïðåòàöèè è ïðèâåñòè ê åãî çàâèñàíèþ è/èëè îòêëþ÷åíèþ.
|
||||
|
||||
ÍÅ ÈÑÏÎËÜÇÓÉÒÅ ÝÒÓ ÊÎÌÀÍÄÓ ÁÅÇ ÀÁÑÎËÞÒÍÎÉ ÓÂÅÐÅÍÍÎÑÒÈ Â ÒÎÌ, ×ÒÎ ÂÛ ÄÅËÀÅÒÅ!
|
||||
|
||||
OPER_HELP_UPDATE
|
||||
Ñèíòàêñèñ: UPDATE
|
||||
|
||||
@@ -6632,7 +6384,7 @@ HOST_SETALL
|
||||
HOST_DELALL
|
||||
Âñå âèðòóàëüíûå õîñòû äëÿ ãðóïïû %s áûëè óäàëåíû.
|
||||
HOST_DELALL_SYNTAX
|
||||
Ñèíòàêñèñ: DELALL <íèê>.
|
||||
DELALL <íèê>.
|
||||
HOST_IDENT_SETALL
|
||||
Âèðòóàëüíûé õîñò äëÿ ãðóïïû %s óñòàíîâëåí â %s@%s.
|
||||
HOST_SET_ERROR
|
||||
@@ -6646,9 +6398,9 @@ HOST_SET_IDENTTOOLONG
|
||||
HOST_NOREG
|
||||
Ïîëüçîâàòåëü %s íå íàéäåí â ñåðâèñíîé áàçå äàííûõ íèêîâ.
|
||||
HOST_SET_SYNTAX
|
||||
Ñèòàêñèñ: %R%s SET <íèê> <õîñòìàñêà>.
|
||||
SET <íèê> <õîñòìàñêà>.
|
||||
HOST_SETALL_SYNTAX
|
||||
Ñèíòàêñèñ %R%s SETALL <íèê> <õîñòìàñêà>.
|
||||
SETALL <íèê> <õîñòìàñêà>.
|
||||
HOST_DENIED
|
||||
Äîñòóï çàïðåùåí.
|
||||
HOST_NOT_ASSIGNED
|
||||
@@ -6657,18 +6409,12 @@ HOST_ACTIVATED
|
||||
Âàø âèðòóàëüíûé õîñò %s àêòèâèðîâàí.
|
||||
HOST_IDENT_ACTIVATED
|
||||
Âàø âèðòóàëüíûé õîñò %s@%s àêòèâèðîâàí.
|
||||
HOST_ID
|
||||
Èäåíòèôèöèðóéòåñü ê ñâîåìó íèêó è ïîâòîðèòå çàïðîñ íà àêòèâàöèþ.
|
||||
HOST_NOT_REGED
|
||||
Êàêîé âèðòóàëüíûé õîñò, âàø íèê äàæå íå çàðåãèñòðèðîâàí...
|
||||
HOST_DEL
|
||||
Âèðòóàëüíûé õîñò äëÿ %s óäàëåí.
|
||||
HOST_DEL_SYNTAX
|
||||
Ñèíòàêñèñ: %R%s del <íèê>.
|
||||
DEL <íèê>.
|
||||
HOST_OFF
|
||||
Your vhost was removed and the normal cloaking restored.
|
||||
HOST_OFF_UNREAL
|
||||
Âàø âèðòóàëüíûé õîñò äåàêòèâèðîâàí. Äëÿ ðå-àêòèâàöèè èñïîëüçóéòå: /MODE %s +%s
|
||||
HOST_NO_VIDENT
|
||||
IRCd âàøåé ñåòè íå ïîääåðæèâàåò âèðòóàëüíûå èäåíòû. Åñëè ýòî íå òàê, ñîîáùèòå íàì (ðàçðàáîò÷êàì) î äàííîì ôàêòå.
|
||||
HOST_GROUP
|
||||
|
||||
+17
-6
@@ -4,24 +4,35 @@ file(GLOB SRC_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
|
||||
set(SRC_SRCS ${SRC_SRCS_C} ${SRC_SRCS_CPP})
|
||||
# If not using Visual Studio, don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators
|
||||
if(NOT MSVC)
|
||||
list(REMOVE_ITEM SRC_SRCS win32_memory.cpp)
|
||||
remove_item_from_list(SRC_SRCS win32_memory.cpp)
|
||||
endif(NOT MSVC)
|
||||
# If not using Windows, don't include windows.cpp, as it's Windows-specific
|
||||
if(NOT WIN32)
|
||||
list(REMOVE_ITEM SRC_SRCS windows.cpp)
|
||||
remove_item_from_list(SRC_SRCS windows.cpp)
|
||||
endif(NOT WIN32)
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT SRC_SRCS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
sort_list(SRC_SRCS)
|
||||
|
||||
# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though)
|
||||
set_source_files_properties(${SRC_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
|
||||
|
||||
# Create an empty list to store extra include directories
|
||||
set(EXTRA_INCLUDES)
|
||||
# Iterate through all the source files
|
||||
foreach(SRC ${SRC_SRCS})
|
||||
# Temporary variable for the current source's include directories
|
||||
set(TEMP_INCLUDES)
|
||||
# Calculate the header file dependencies for the given source file
|
||||
calculate_depends(${SRC})
|
||||
calculate_depends(${SRC} TEMP_INCLUDES)
|
||||
# If there were some extra include directories, add them to the list
|
||||
if(TEMP_INCLUDES)
|
||||
append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
|
||||
endif(TEMP_INCLUDES)
|
||||
endforeach(SRC)
|
||||
# If there were extra include directories, remove the duplicates and add the directories to the include path
|
||||
if(EXTRA_INCLUDES)
|
||||
remove_list_duplicates(EXTRA_INCLUDES)
|
||||
include_directories(${EXTRA_INCLUDES})
|
||||
endif(EXTRA_INCLUDES)
|
||||
|
||||
# Under Windows, we also include a resource file to the build
|
||||
if(WIN32)
|
||||
|
||||
+17
-16
@@ -1,12 +1,13 @@
|
||||
OBJS = actions.o base64.o bots.o botserv.o channels.o chanserv.o commands.o compat.o \
|
||||
config.o datafiles.o encrypt.o events.o hashcomp.o helpserv.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \
|
||||
OBJS = actions.o base64.o bots.o botserv.o channels.o chanserv.o command.o commands.o compat.o \
|
||||
config.o datafiles.o encrypt.o hashcomp.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \
|
||||
memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \
|
||||
process.o send.o servers.o sessions.o slist.o sockutil.o timeout.o users.o module.o modulemanager.o configreader.o
|
||||
process.o protocol.o send.o servers.o sessions.o slist.o sockutil.o opertype.o users.o module.o modulemanager.o configreader.o \
|
||||
wildcard.o nickcore.o nickalias.o timers.o
|
||||
|
||||
INCLUDES = ../include/commands.h ../include/defs.h ../include/language.h \
|
||||
../include/pseudo.h ../include/sysconf.h ../include/config.h \
|
||||
../include/encrypt.h ../include/messages.h ../include/services.h \
|
||||
../include/timeout.h ../include/datafiles.h ../include/extern.h \
|
||||
../include/messages.h ../include/services.h \
|
||||
../include/timers.h ../include/datafiles.h ../include/extern.h \
|
||||
../include/modules.h ../include/slist.h ../include/hashcomp.h
|
||||
|
||||
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
|
||||
@@ -18,35 +19,37 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
|
||||
'MAKEBIN=${MAKEBIN}'
|
||||
|
||||
.c.o:
|
||||
@$(MAKEBIN) $(CC) $(CFLAGS) -I../include/ -c $<
|
||||
$(MAKEBIN) $(CC) $(CFLAGS) -I../include/ -c $<
|
||||
|
||||
.cpp.o:
|
||||
@$(MAKEBIN) $(CC) $(CFLAGS) -I../include/ -c $<
|
||||
$(MAKEBIN) $(CC) $(CFLAGS) -I../include/ -c $<
|
||||
|
||||
all: services
|
||||
|
||||
distclean: spotless
|
||||
distclean_modules: clean_modules spotless
|
||||
|
||||
services: $(OBJS) mod_version
|
||||
@$(MAKEBIN) $(CC) $(CFLAGS) $(OBJS) $(ANOPELIBS) $(MLIBS) -o $@ $(LDFLAGS)
|
||||
services: $(OBJS)
|
||||
$(MAKEBIN) $(CC) $(CFLAGS) $(OBJS) $(ANOPELIBS) $(MLIBS) -o $@ $(LDFLAGS)
|
||||
|
||||
$(OBJS): Makefile
|
||||
timers.o: timers.cpp $(INCLUDES)
|
||||
nickcore.o: nickcore.cpp $(INCLUDES)
|
||||
nickalias.o: nickalias.cpp $(INCLUDES)
|
||||
actions.o: actions.c $(INCLUDES)
|
||||
base64.o: base64.c $(INCLUDES)
|
||||
bots.o: bots.cpp $(INCLUDES)
|
||||
botserv.o: botserv.c $(INCLUDES)
|
||||
channels.o: channels.c $(INCLUDES)
|
||||
chanserv.o: chanserv.c $(INCLUDES)
|
||||
command.o: command.cpp $(INCLUDES)
|
||||
commands.o: commands.c $(INCLUDES)
|
||||
compat.o: compat.c $(INCLUDES)
|
||||
config.o: config.c $(INCLUDES)
|
||||
datafiles.o: datafiles.c $(INCLUDES)
|
||||
encrypt.o: encrypt.c $(INCLUDES)
|
||||
events.o: events.c $(INCLUDES)
|
||||
init.o: init.c $(INCLUDES)
|
||||
ircd.o: ircd.c $(INCLUDES)
|
||||
helpserv.o: helpserv.c $(INCLUDES)
|
||||
hostserv.o: hostserv.c $(INCLUDES)
|
||||
language.o: language.c $(INCLUDES)
|
||||
log.o: log.c $(INCLUDES)
|
||||
@@ -63,17 +66,16 @@ news.o: news.c $(INCLUDES)
|
||||
nickserv.o: nickserv.c $(INCLUDES)
|
||||
operserv.o: operserv.c $(INCLUDES)
|
||||
process.o: process.c $(INCLUDES)
|
||||
protocol.o: protocol.cpp $(INCLUDES)
|
||||
send.o: send.c $(INCLUDES)
|
||||
servers.o: servers.c $(INCLUDES)
|
||||
sessions.o: sessions.c $(INCLUDES)
|
||||
slist.o: slist.c $(INCLUDES)
|
||||
sockutil.o: sockutil.c $(INCLUDES)
|
||||
timeout.o: timeout.c $(INCLUDES)
|
||||
opertype.o: opertype.cpp $(INCLUDES)
|
||||
users.o: users.c $(INCLUDES)
|
||||
vsnprintf.o: vsnprintf.c $(INCLUDES)
|
||||
|
||||
mod_version: mod_version.c $(INCLUDES)
|
||||
@$(MAKEBIN) $(CC) $(CDEFS) $(CFLAGS) $(MODULEFLAGS) -I../include/ -c mod_version.c
|
||||
wildcard.o: wildcard.cpp $(INCLUDES)
|
||||
|
||||
modules: DUMMY
|
||||
@modules/configure modules
|
||||
@@ -115,7 +117,6 @@ install: services
|
||||
test -d ${INSTDIR}/data || mkdir ${INSTDIR}/data
|
||||
(cd ../lang ; $(MAKE) install)
|
||||
$(CP) ../data/* $(INSTDIR)/data
|
||||
$(INSTALL) bin/mydbgen $(INSTDIR)/data/mydbgen
|
||||
test -d $(INSTDIR)/data/backups || mkdir $(INSTDIR)/data/backups
|
||||
test -d $(INSTDIR)/data/logs || mkdir $(INSTDIR)/data/logs
|
||||
@if [ "$(INSTDIR)/data/modules" ] ; then \
|
||||
|
||||
+3
-42
@@ -95,7 +95,7 @@ void sqline(char *mask, char *reason)
|
||||
for (c = chanlist[i]; c; c = next) {
|
||||
next = c->next;
|
||||
|
||||
if (!match_wild_nocase(mask, c->name)) {
|
||||
if (!Anope::Match(c->name, mask, false)) {
|
||||
continue;
|
||||
}
|
||||
for (cu = c->users; cu; cu = cunext) {
|
||||
@@ -180,8 +180,8 @@ void common_unban(ChannelInfo * ci, char *nick)
|
||||
|
||||
for (ban = ci->c->bans->entries; ban; ban = next) {
|
||||
next = ban->next;
|
||||
if (entry_match(ban, u->nick, u->username, u->host, ip) ||
|
||||
entry_match(ban, u->nick, u->username, u->vhost, ip)) {
|
||||
if (entry_match(ban, u->nick, u->GetIdent().c_str(), u->host, ip) ||
|
||||
entry_match(ban, u->nick, u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip)) {
|
||||
ircdproto->SendMode(whosends(ci), ci->name, "-b %s", ban->mask);
|
||||
if (ircdcap->tsmode)
|
||||
av[3] = ban->mask;
|
||||
@@ -224,42 +224,3 @@ void common_svsmode(User * u, const char *modes, const char *arg)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Get the vhost for the user, if set else return the host, on ircds without
|
||||
* vhost this returns the host
|
||||
* @param u user to get the vhost for
|
||||
* @return vhost
|
||||
*/
|
||||
char *common_get_vhost(User * u)
|
||||
{
|
||||
if (!u)
|
||||
return NULL;
|
||||
|
||||
if (ircd->vhostmode && (u->mode & ircd->vhostmode))
|
||||
return u->vhost;
|
||||
else if (ircd->vhost && u->vhost)
|
||||
return u->vhost;
|
||||
else
|
||||
return u->host;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Get the vident for the user, if set else return the ident, on ircds without
|
||||
* vident this returns the ident
|
||||
* @param u user to get info the vident for
|
||||
* @return vident
|
||||
*/
|
||||
char *common_get_vident(User * u)
|
||||
{
|
||||
if (!u)
|
||||
return NULL;
|
||||
|
||||
if (ircd->vhostmode && (u->mode & ircd->vhostmode))
|
||||
return u->vident;
|
||||
else if (ircd->vident && u->vident)
|
||||
return u->vident;
|
||||
else
|
||||
return u->username;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,5 @@ if(NOT WIN32)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/anoperc
|
||||
DESTINATION bin
|
||||
)
|
||||
# Add anoperc to list of files for CPack to ignore
|
||||
add_to_cpack_ignored_files("anoperc$")
|
||||
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mydbgen
|
||||
DESTINATION data
|
||||
)
|
||||
|
||||
endif(NOT WIN32)
|
||||
|
||||
-499
@@ -1,499 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# ====================================================================
|
||||
# anomgr: Anope Manager. Used to manage anope revision on SubVersion.
|
||||
#
|
||||
# For usage, see the usage subroutine or run the script with no
|
||||
# command line arguments.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# ====================================================================
|
||||
require 5.6.0;
|
||||
use strict;
|
||||
use Getopt::Std;
|
||||
use Net::FTP;
|
||||
use Cwd;
|
||||
|
||||
######################################################################
|
||||
# Configuration section.
|
||||
my $myver="1.0";
|
||||
my $svnrev="http://www.zero.org/anosvn.php";
|
||||
my $fhint="version.log";
|
||||
|
||||
# Default values, change or use environment variables instead.
|
||||
my $copy="anope";
|
||||
my $svnuser="evil_closet_monkey";
|
||||
my $svnpath="/usr/bin";
|
||||
my $svnroot="svn://svn.anope.org/$copy";
|
||||
my $editor="/usr/bin/mcedit";
|
||||
|
||||
# Environment variables SVNBINDIR and SVNROOT override the above
|
||||
# hardcoded values.
|
||||
$svnuser="$ENV{SVNUSER}" if ($ENV{SVNUSER});
|
||||
$svnpath="$ENV{SVNBINDIR}" if ($ENV{SVNBINDIR});
|
||||
$svnroot="$ENV{SVNROOT}" if ($ENV{SVNROOT});
|
||||
$editor="$ENV{EDITOR}" if ($ENV{EDITOR});
|
||||
|
||||
# Svnlook path.
|
||||
my $svnlook = "$svnpath/svnlook";
|
||||
|
||||
# Svn path.
|
||||
my $svn = "$svnpath/svn";
|
||||
|
||||
# wget path. Need to change to a perl module instead...
|
||||
my $wget = "$svnpath/wget";
|
||||
|
||||
my (
|
||||
$rev,
|
||||
$branch,
|
||||
$proto,
|
||||
$tag,
|
||||
$ftp,
|
||||
$dst,
|
||||
$ver_major,
|
||||
$ver_minor,
|
||||
$ver_patch,
|
||||
$ver_build,
|
||||
$ver_revision,
|
||||
$ver_comment,
|
||||
$svn_comment,
|
||||
$cver,
|
||||
$nver,
|
||||
$ctrlfile,
|
||||
$tmpfile,
|
||||
@source,
|
||||
%opt
|
||||
);
|
||||
|
||||
{
|
||||
my $ok = 1;
|
||||
foreach my $program ($svnlook, $svn, $editor)
|
||||
{
|
||||
if (-e $program)
|
||||
{
|
||||
unless (-x $program)
|
||||
{
|
||||
warn "$0: required program `$program' is not executable, ",
|
||||
"edit $0.\n";
|
||||
$ok = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
warn "$0: required program `$program' does not exist, edit $0.\n";
|
||||
$ok = 0;
|
||||
}
|
||||
}
|
||||
exit 1 unless $ok;
|
||||
}
|
||||
|
||||
sub usage()
|
||||
{
|
||||
# More features to add:
|
||||
# --diff N:M to produce a diff between revisions
|
||||
# --bugs CLI method to add bug number to the commit message
|
||||
# --mesg CLI methos to add the commit message
|
||||
# --create-branch to create a branch
|
||||
# --create-tag to create a tag
|
||||
# --switch to switch between branches/tags
|
||||
print "Usage: $0 <-g | -p | -f | -l> [-r revision | -b branch | -t tag | -P proto] <destination>\n";
|
||||
print " Operations:\n";
|
||||
print " -g Get Operation\n";
|
||||
print " -p Put Operation\n";
|
||||
print " -f[tar|diff] FTP Operation, retrieve latest tar or diff\n";
|
||||
print " -l List Operation, for valid selector options\n";
|
||||
print " Selector:\n";
|
||||
print " -r revision Retrieve by revision number\n";
|
||||
print " -b branch Retrieve by branch name\n";
|
||||
print " -t tag Retrieve by tag name\n";
|
||||
print " -P proto Retrieve by prototype name\n";
|
||||
print " Destination:\n";
|
||||
print " The working copy to perform the operation in or to. The script will \n";
|
||||
print " try to guess where that is, unless you provide a specific path.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
sub banner() {
|
||||
|
||||
print "Anope Source Managemnt Utility - Version $myver\n\n";
|
||||
|
||||
}
|
||||
|
||||
sub getans {
|
||||
my $ans;
|
||||
while (! (($ans =~ /y/) || ($ans =~ /n/))) {
|
||||
print "*** Ready to continue? (y/n): ";
|
||||
$ans = <STDIN>;
|
||||
chomp($ans);
|
||||
$ans = lc($ans);
|
||||
# $ans = &getans();
|
||||
}
|
||||
|
||||
# return $ans;
|
||||
return ($ans eq "y") ? 1 : 0
|
||||
}
|
||||
|
||||
sub find_conflict() {
|
||||
|
||||
my $filename=shift;
|
||||
my $retval=0;
|
||||
open (IN2, "$filename") || die "Can't open $filename\n";
|
||||
while (<IN2>) {
|
||||
if (/^<<<<<<</) {
|
||||
$retval=1;
|
||||
}
|
||||
}
|
||||
close(IN2);
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
sub do_lst() {
|
||||
my $out;
|
||||
print "*** BRANCHES:\n";
|
||||
print "trunk (DEFAULT)\n";
|
||||
open (IN, "$svn list $svnroot/branches|");
|
||||
while (<IN>) {
|
||||
if (! /proto/) {
|
||||
$out="$_";
|
||||
$out =~ s/\/$//;
|
||||
print "$out";
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
||||
print "\n*** PROTOTYPES:\n";
|
||||
open (IN, "$svn list $svnroot/branches/proto|");
|
||||
while (<IN>) {
|
||||
$out="$_";
|
||||
$out =~ s/\/$//;
|
||||
chomp($out);
|
||||
if (/bahamut18/) {
|
||||
$out .= "\t(OBSOLETE)";
|
||||
} elsif (/capab/) {
|
||||
$out .= "\t(OBSOLETE)";
|
||||
}
|
||||
print "$out\n";
|
||||
}
|
||||
close(IN);
|
||||
|
||||
print "\n*** TAGS:\n";
|
||||
open (IN, "$svn list $svnroot/tags|");
|
||||
while (<IN>) {
|
||||
$out="$_";
|
||||
$out =~ s/\/$//;
|
||||
print "$out";
|
||||
}
|
||||
close(IN);
|
||||
print "\n";
|
||||
|
||||
}
|
||||
|
||||
sub do_ftp() {
|
||||
|
||||
my $ftpc;
|
||||
$ftpc = Net::FTP->new("ftp.zero.org");
|
||||
$ftpc->login("ftp","-anonymou@");
|
||||
$ftpc->cwd("/incoming");
|
||||
|
||||
if ( lc($ftp) eq "tar" ) {
|
||||
print "Retrieving latest tar ball...\n";
|
||||
$ftpc->get("anope.tgz");
|
||||
} elsif ( lc($ftp) eq "diff" ) {
|
||||
print "Retrieving latest patch file...\n";
|
||||
$ftpc->get("anope.diff");
|
||||
} else {
|
||||
print "Unknown type $ftp, aborting...\n";
|
||||
}
|
||||
$ftpc->quit();
|
||||
}
|
||||
|
||||
sub do_get() {
|
||||
|
||||
my $options = "" ; # Options to be passed to the svn command
|
||||
my $selector = "" ; # Selector to be passed to the svn command
|
||||
|
||||
if ($rev) {
|
||||
$options .= "-r $rev";
|
||||
$selector = "trunk";
|
||||
$copy = $copy . "-$rev";
|
||||
} elsif ($tag) {
|
||||
$selector = "tags/$tag";
|
||||
$copy = "$tag";
|
||||
} elsif ($branch) {
|
||||
$selector = "branches/$branch";
|
||||
$copy = $copy . "-$branch";
|
||||
} elsif ($proto) {
|
||||
$selector = "branches/proto/$proto";
|
||||
$copy = "$proto";
|
||||
} else {
|
||||
$selector = "trunk";
|
||||
}
|
||||
|
||||
if ($dst eq undef) {
|
||||
my $cwd = &Cwd::cwd();
|
||||
if (-f "$cwd/$fhint") {
|
||||
system("$svn update $options $cwd");
|
||||
} elsif (-f "$cwd/$copy/$fhint") {
|
||||
system("$svn update $options $cwd/$copy");
|
||||
} else {
|
||||
system("$svn checkout $svnroot/$selector $options $cwd/$copy");
|
||||
}
|
||||
} else {
|
||||
$dst = &Cwd::cwd() if ($dst eq "\.") ;
|
||||
if (-f "$dst/$fhint") {
|
||||
system("$svn update $options $dst");
|
||||
} else {
|
||||
system("$svn checkout $svnroot/$selector $options $dst");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub do_put() {
|
||||
|
||||
if ($dst eq undef) {
|
||||
my $cwd = &Cwd::cwd();
|
||||
if (-f "$cwd/$fhint") {
|
||||
$dst = "$cwd";
|
||||
} elsif (-f "$cwd/$copy/$fhint") {
|
||||
$dst .= "$cwd/$copy";
|
||||
} else {
|
||||
print "Error: Unable to determine your working copy location.\n";
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$dst = &Cwd::cwd() if ($dst eq "\.") ;
|
||||
if (! -f "$dst/$fhint") {
|
||||
print "Error: Unable to determine your working copy location.\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
# Check to see if we need to update our working copy first.
|
||||
my $nupdate;
|
||||
open (IN, "$svn status --show-updates --verbose $dst|");
|
||||
while (<IN>) {
|
||||
if (/\*/) {
|
||||
$nupdate .= "$_";
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
||||
if ($nupdate ne undef) {
|
||||
print "*** Warning: There are files modified in the repository that need\n";
|
||||
print "*** to be merged back to your working copy before the commit can\n";
|
||||
print "*** take place. These files are:\n";
|
||||
print $nupdate;
|
||||
print "Please use: $0 -g $dst\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# Get a prelim diff of the changes...
|
||||
my $dcount=0;
|
||||
my $conflict;
|
||||
# open (IN, "$svn diff $dst|");
|
||||
open (IN, "$svn status $dst|");
|
||||
while (<IN>) {
|
||||
if (!/^\?/) {
|
||||
$dcount++;
|
||||
}
|
||||
|
||||
if (/^C/) {
|
||||
$_ =~ s/^C\s+//;
|
||||
chomp($_);
|
||||
# I don't want to use grep. But my find_conflict sub
|
||||
# does not seem to work :( Too bad
|
||||
if (`grep "^<<<<<<<" $_`) {
|
||||
$conflict .= "$_\n" ;
|
||||
} else {
|
||||
system("$svn resolved $_");
|
||||
}
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
||||
if ($dcount == 0) {
|
||||
print "*** Warning: There are no modified files to be commited. Are you\n";
|
||||
print "*** sure you are in the right working copy? Verify changes with:\n";
|
||||
print "*** $svn diff $dst\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($conflict ne undef) {
|
||||
print "*** Warning: There are merge conflicts to be resolved! Please take\n";
|
||||
print "*** a look at the following files and resolve them manually:\n\n";
|
||||
print "$conflict\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$ctrlfile = "$dst/$fhint";
|
||||
# Grab the current revision number. Clunky way, I know!
|
||||
# $ver_revision=`$wget -qO - $svnrev`;
|
||||
$ver_revision=`svnversion . | sed "s/.*:\\\(.*\\\)/\\1/" | cut -d 'M' -f 1 | cut -d 'S' -f 1`;
|
||||
chomp($ver_revision);
|
||||
|
||||
unless ($ver_revision =~ /^\d+/ and $ver_revision > 0)
|
||||
{
|
||||
print "*** Error: Got bogus result $ver_revision from $svnrev.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$ver_revision++;
|
||||
open (REV, "$ctrlfile") || die "Can't open $ctrlfile\n";
|
||||
while (<REV>) {
|
||||
push (@source, $_);
|
||||
$ver_major = $_ if (/VERSION_MAJOR/);
|
||||
$ver_minor = $_ if (/VERSION_MINOR/);
|
||||
$ver_patch = $_ if (/VERSION_PATCH/);
|
||||
$ver_build = $_ if (/VERSION_BUILD/);
|
||||
}
|
||||
close(REV);
|
||||
|
||||
my $junk;
|
||||
($junk, $ver_major) = split('"', $ver_major);
|
||||
($junk, $ver_minor) = split('"', $ver_minor);
|
||||
($junk, $ver_patch) = split('"', $ver_patch);
|
||||
($junk, $ver_build) = split('"', $ver_build);
|
||||
|
||||
$cver = "$ver_major.$ver_minor.$ver_patch ($ver_build)";
|
||||
$nver = "$ver_major.$ver_minor.$ver_patch ($ver_revision)";
|
||||
|
||||
# Greet the developer
|
||||
banner();
|
||||
|
||||
|
||||
# Check to see if we need to update our working copy first.
|
||||
my $svnrepo;
|
||||
open (IN, "$svn info|");
|
||||
while (<IN>) {
|
||||
if (/URL/) {
|
||||
$svnrepo = "$_";
|
||||
$svnrepo =~ s/URL: //;
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
||||
print "*** Repository : $svnroot \n";
|
||||
print "*** Working copy : $dst \n" ;
|
||||
print "*** Current ver. : $cver \n";
|
||||
print "*** Updated ver. : $nver \n";
|
||||
print "*** Files Changed: $dcount (before indent and version change)\n";
|
||||
die ("Aborting...\n") unless &getans();
|
||||
|
||||
# Need to add a clause for -c "comment" and -b "buglist"
|
||||
|
||||
# Get developers input for commit
|
||||
$tmpfile=".commit";
|
||||
open (OUT, ">$tmpfile") or die ("*** Error! Unable to open $tmpfile file\n");
|
||||
print OUT "# Anope commit utility. Please use this template for your commits.
|
||||
# Add Bugzilla bugs separated by spaces. The note part is free form.
|
||||
BUILD : $nver
|
||||
BUGS :
|
||||
NOTES : ";
|
||||
close(OUT);
|
||||
|
||||
system("$editor $tmpfile");
|
||||
|
||||
my $tmp_comment="";
|
||||
$ver_comment="#\n";
|
||||
$svn_comment="";
|
||||
open (IN, "$tmpfile") or die ("*** Error! Unable to open $tmpfile file\n");
|
||||
while (<IN>) {
|
||||
if ( !/^#/) {
|
||||
$tmp_comment.="$_";
|
||||
chomp($_);
|
||||
$_ =~ s/\t/ /g;
|
||||
$ver_comment.="# $_\n";
|
||||
$svn_comment.="$_ ";
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
||||
$svn_comment =~ s/\s\s+/ /g;
|
||||
# Confirm the commit one last time...
|
||||
print "*** Ready to commit, please verify:\n";
|
||||
print "\n$tmp_comment\n";
|
||||
|
||||
die ("Aborting...\n") unless &getans();
|
||||
|
||||
print "*** Running Indent...\n";
|
||||
my $prefix=".";
|
||||
if (-d "src") {
|
||||
$prefix="src";
|
||||
}
|
||||
system("indent -kr -nut $prefix/*.c");
|
||||
system("rm -f $prefix/*~");
|
||||
# if (-d "src/core") {
|
||||
# system("indent -kr -nut src/core/*.c");
|
||||
# system("rm -f src/core/*~");
|
||||
# }
|
||||
# if (-d "src/protocol") {
|
||||
# system("indent -kr -nut src/protocol/*.c");
|
||||
# system("rm -f src/protocol/*~");
|
||||
# }
|
||||
|
||||
print "*** Bumping the revision number...\n";
|
||||
# Re-write the control file
|
||||
open(OUT, ">$ctrlfile") or die ("*** Error! Unable to open $ctrlfile ... aborting");
|
||||
foreach (@source) {
|
||||
if (/^VERSION_BUILD/) {
|
||||
$_ =~ s/\"\d+\"/\"$ver_revision\"/;
|
||||
} elsif (/# \$Log\$/) {
|
||||
$_ .= "$ver_comment";
|
||||
}
|
||||
print OUT $_;
|
||||
}
|
||||
close(OUT);
|
||||
|
||||
print "*** Starting the upload...\n\n";
|
||||
my $rval=system("$svn commit $dst --username='$svnuser' --message '$svn_comment'");
|
||||
if ( $rval ) {
|
||||
print "*** Error: Unable to complete commit. Rolling back....\n\n";
|
||||
system("$svn revert $ctrlfile");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
usage() if (! @ARGV);
|
||||
|
||||
my $opt = 'hgplf:r:b:t:P:';
|
||||
getopts ("$opt", \%opt) or usage();
|
||||
usage() if $opt{h};
|
||||
|
||||
usage() if ($opt{g} && $opt{p});
|
||||
usage() if ($opt{g} && $opt{f});
|
||||
usage() if ($opt{g} && $opt{l});
|
||||
usage() if ($opt{p} && $opt{f});
|
||||
usage() if ($opt{p} && $opt{l});
|
||||
usage() if ($opt{f} && $opt{l});
|
||||
usage() if ($opt{r} && $opt{b});
|
||||
usage() if ($opt{r} && $opt{t});
|
||||
usage() if ($opt{b} && $opt{t});
|
||||
usage() if ($opt{b} && $opt{P});
|
||||
|
||||
$rev = $opt{r} ;
|
||||
$branch = $opt{b} ;
|
||||
$tag = $opt{t} ;
|
||||
$ftp = $opt{f} ;
|
||||
$proto = $opt{P} ;
|
||||
$dst = shift;
|
||||
|
||||
if ($rev ne undef) {
|
||||
unless ($rev =~ /^\d+/ and $rev > 0)
|
||||
{
|
||||
print "*** Error: Revision number '$rev' must be an integer > 0.\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
do_lst() if $opt{l};
|
||||
do_ftp() if $opt{f};
|
||||
do_get() if $opt{g};
|
||||
do_put() if $opt{p};
|
||||
print "*** Done!\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
-222
@@ -1,222 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id$
|
||||
|
||||
# Location of the .sql file with the schema
|
||||
DBSQL="tables.sql"
|
||||
|
||||
# Schema Version
|
||||
SVER="1"
|
||||
|
||||
# Local Version, defaults to 0
|
||||
LVER="0"
|
||||
|
||||
TFILE="/tmp/.anopedb.$$"
|
||||
|
||||
if [ "`eval echo -n 'a'`" = "-n a" ] ; then
|
||||
c="\c"
|
||||
else
|
||||
n="-n"
|
||||
fi
|
||||
|
||||
# Fix for bug 10
|
||||
for try in HOME/services anope/data ../data data .. .
|
||||
do
|
||||
if [ -f "$try/$DBSQL" ]; then
|
||||
DBFILE="$try/$DBSQL"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -f "./$DBFILE" ] ; then
|
||||
echo "Error: Required file $DBSQL was not found!";
|
||||
exit
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "This script will guide you through the process of configuring your Anope"
|
||||
echo "installation to make use of MySQL support. This script must be used for both"
|
||||
echo "new installs as well as for upgrading for users who have a previous version"
|
||||
echo "of Anope installed"
|
||||
|
||||
while [ -z "$SQLHOST" ] ; do
|
||||
echo ""
|
||||
echo "What is the hostname of your MySQL server?"
|
||||
echo $n "-> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ] ; then
|
||||
SQLHOST=$cc
|
||||
fi
|
||||
done
|
||||
|
||||
while [ -z "$SQLUSER" ] ; do
|
||||
echo ""
|
||||
echo "What is your MySQL username?"
|
||||
echo $n "-> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ] ; then
|
||||
SQLUSER=$cc
|
||||
fi
|
||||
done
|
||||
|
||||
OLD_TTY=`stty -g`
|
||||
|
||||
echo ""
|
||||
echo "What is your MySQL password?"
|
||||
echo $n "-> $c"
|
||||
stty -echo echonl
|
||||
read cc
|
||||
SQLPASS_PREFIX=""
|
||||
if [ ! -z "$cc" ] ; then
|
||||
SQLPASS_PREFIX="-p"
|
||||
SQLPASS=$cc
|
||||
fi
|
||||
stty $OLD_TTY
|
||||
|
||||
mysqlshow -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS >/dev/null 2>&1
|
||||
if test "$?" = "1" ; then
|
||||
echo "Error: Unable to login, verify your login/password and hostname"
|
||||
exit
|
||||
fi
|
||||
|
||||
while [ -z "$SQLDB" ] ; do
|
||||
echo ""
|
||||
echo "What is the name of the Anope SQL database?"
|
||||
echo $n "-> $c"
|
||||
read cc
|
||||
if [ ! -z "$cc" ] ; then
|
||||
SQLDB=$cc
|
||||
fi
|
||||
done
|
||||
|
||||
MYSQLDUMP="mysqldump -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB"
|
||||
MYSQLSHOW="mysqlshow -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB"
|
||||
MYSQL="mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB"
|
||||
|
||||
echo ""
|
||||
|
||||
$MYSQLSHOW | grep -q $SQLDB
|
||||
if test "$?" = "1" ; then
|
||||
echo -n "Unable to find databse, creating... "
|
||||
mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS -Bs -e "create database $SQLDB" >/dev/null 2>&1
|
||||
if test "$?" = "0" ; then
|
||||
echo "done!"
|
||||
else
|
||||
echo "failed!"
|
||||
FAILED="$FAILED 'database creation'"
|
||||
fi
|
||||
fi
|
||||
|
||||
$MYSQL -Bs -e "show tables like 'anope_os_core'" | grep -q anope_os_core
|
||||
if test "$?" = "1" ; then
|
||||
echo -n "Unable to find Anope schema, creating... "
|
||||
$MYSQL < $DBFILE
|
||||
if test "$?" = "0" ; then
|
||||
echo "done!"
|
||||
else
|
||||
echo "failed!"
|
||||
FAILED="$FAILED 'schema creation'"
|
||||
fi
|
||||
else
|
||||
# Introduced on Anope 1.6.0 -> Table anope_info
|
||||
$MYSQL -Bs -e "show tables like 'anope_info'" | grep -q anope_info
|
||||
if test "$?" = "1" ; then
|
||||
echo -n "Unable to find Anope info table, creating... "
|
||||
echo "CREATE TABLE anope_info (version int, date datetime) TYPE=MyISAM" > $TFILE
|
||||
mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
|
||||
if test "$?" = "0" ; then
|
||||
echo "done!"
|
||||
|
||||
else
|
||||
echo "failed!"
|
||||
FAILED="$FAILED 'anope_info table'"
|
||||
fi
|
||||
else
|
||||
LVER="$($MYSQL -sB -e "select version from anope_info")"
|
||||
if test "x$LVER" = "x" ; then
|
||||
LVER=0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Introduced on Anope 1.5.14.5 -> anope_cs_info.memomax
|
||||
$MYSQL -Bs -e "describe anope_cs_info memomax" 2> /dev/null | grep -q memomax
|
||||
if test "$?" = "1" ; then
|
||||
echo -n "Unable to find anope_cs_info.memomax, altering... "
|
||||
echo "ALTER TABLE anope_cs_info ADD memomax smallint unsigned NOT NULL default 0" > $TFILE
|
||||
mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
|
||||
if test "$?" = "0" ; then
|
||||
echo "done!"
|
||||
|
||||
else
|
||||
echo "failed!"
|
||||
FAILED="$FAILED 'anope_cs_info.memomax alter'"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Introduced on Anope 1.5.14.5 -> anope_cs_info.ttb
|
||||
$MYSQL -Bs -e "describe anope_cs_info ttb" 2> /dev/null | grep -q ttb
|
||||
if test "$?" = "1" ; then
|
||||
echo -n "Unable to find anope_cs_info.ttb, altering... "
|
||||
echo "ALTER TABLE anope_cs_info ADD ttb smallint NOT NULL default 0" > $TFILE
|
||||
mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
|
||||
if test "$?" = "0" ; then
|
||||
echo "done!"
|
||||
|
||||
else
|
||||
echo "failed!"
|
||||
FAILED="$FAILED 'anope_cs_info.ttb alter'"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Introduced on Anope 1.7.7 -> status smallint to inst unsigned.
|
||||
echo "Blindly altering status for bigger capacity... "
|
||||
echo "ALTER TABLE anope_ns_alias CHANGE status status int(11) unsigned NOT NULL default 0" > $TFILE
|
||||
mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
|
||||
|
||||
# Introduced on Anope 1.7.8 (620) proxy scanner removed.
|
||||
echo "Removing proxy scanner cache... "
|
||||
echo "DROP TABLE IF EXISTS anope_os_cache" > $TFILE
|
||||
mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
|
||||
|
||||
echo "done!"
|
||||
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Insert initial version number. This will have to be redesigned for 1.7
|
||||
if [ $LVER -ne $SVER ]; then
|
||||
echo -n "Inserting initial version number... "
|
||||
$MYSQL -Bs -e "delete from anope_info"
|
||||
echo "INSERT INTO anope_info (version, date) VALUES ($SVER, now())" > $TFILE
|
||||
$MYSQL < $TFILE >/dev/null 2>&1
|
||||
if test "$?" = "0" ; then
|
||||
echo "done!"
|
||||
else
|
||||
echo "failed!"
|
||||
FAILED="$FAILED 'version insert'"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f $TFILE
|
||||
if test "x$FAILED" = "x" ; then
|
||||
# Try to find out more about this installation
|
||||
SQLSOCK="$(mysql_config --socket 2> /dev/null)"
|
||||
SQLPORT="$(mysql_config --port 2> /dev/null)"
|
||||
echo ""
|
||||
echo "Your MySQL setup is complete and your Anope schema is up to date. Make"
|
||||
echo "sure you configure MySQL on your services.conf file prior to launching"
|
||||
echo "Anope with MySQL support. Your configuration values are:"
|
||||
echo ""
|
||||
echo "MysqlHost \"$SQLHOST\""
|
||||
echo "MysqlUser \"$SQLUSER\""
|
||||
echo "MysqlPass \"$SQLPASS\""
|
||||
echo "MysqlName \"$SQLDB\""
|
||||
echo "MysqlSock \"$SQLSOCK\""
|
||||
echo "MysqlPort \"$SQLPORT\""
|
||||
echo ""
|
||||
else
|
||||
echo "The following operations failed:"
|
||||
echo "$FAILED"
|
||||
fi
|
||||
|
||||
exit
|
||||
+62
-5
@@ -10,15 +10,41 @@
|
||||
*/
|
||||
|
||||
#include "services.h"
|
||||
#include "modules.h"
|
||||
|
||||
BotInfo::BotInfo(const char *nnick)
|
||||
{
|
||||
this->nick = sstrdup(nnick);
|
||||
this->lastmsg = time(NULL);
|
||||
this->uid = ts6_uid_retrieve(); // XXX is this safe? has ts6 been setup yet?
|
||||
insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL.
|
||||
nbots++;
|
||||
this->cmdTable = NULL;
|
||||
this->flags = 0;
|
||||
this->chancount = 0;
|
||||
|
||||
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
|
||||
this->flags |= BI_CHANSERV;
|
||||
else if (s_BotServ && !stricmp(s_BotServ, nnick))
|
||||
this->flags |= BI_BOTSERV;
|
||||
else if (s_HostServ && !stricmp(s_HostServ, nnick))
|
||||
this->flags |= BI_HOSTSERV;
|
||||
else if (s_OperServ && !stricmp(s_OperServ, nnick))
|
||||
this->flags |= BI_OPERSERV;
|
||||
else if (s_MemoServ && !stricmp(s_MemoServ, nnick))
|
||||
this->flags |= BI_MEMOSERV;
|
||||
else if (s_NickServ && !stricmp(s_NickServ, nnick))
|
||||
this->flags |= BI_NICKSERV;
|
||||
else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick))
|
||||
this->flags |= BI_GLOBAL;
|
||||
|
||||
FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this));
|
||||
|
||||
insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL.
|
||||
|
||||
// If we're synchronised with the uplink already, call introduce_user() for this bot.
|
||||
alog("serv_uplink is %p and status is %d", static_cast<void *>(serv_uplink), serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0);
|
||||
if (serv_uplink && serv_uplink->sync == SSYNC_DONE)
|
||||
ircdproto->SendClientIntroduction(this->nick, this->user, this->host, this->real, ircd->pseudoclient_mode, this->uid.c_str());
|
||||
}
|
||||
|
||||
BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const char *nreal)
|
||||
@@ -29,9 +55,34 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const
|
||||
this->real = sstrdup(nreal);
|
||||
this->lastmsg = time(NULL);
|
||||
this->uid = ts6_uid_retrieve(); // XXX is this safe? has ts6 been setup yet?
|
||||
insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL.
|
||||
nbots++;
|
||||
this->cmdTable = NULL;
|
||||
this->flags = 0;
|
||||
this->chancount = 0;
|
||||
|
||||
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
|
||||
this->flags |= BI_CHANSERV;
|
||||
else if (s_BotServ && !stricmp(s_BotServ, nnick))
|
||||
this->flags |= BI_BOTSERV;
|
||||
else if (s_HostServ && !stricmp(s_HostServ, nnick))
|
||||
this->flags |= BI_HOSTSERV;
|
||||
else if (s_OperServ && !stricmp(s_OperServ, nnick))
|
||||
this->flags |= BI_OPERSERV;
|
||||
else if (s_MemoServ && !stricmp(s_MemoServ, nnick))
|
||||
this->flags |= BI_MEMOSERV;
|
||||
else if (s_NickServ && !stricmp(s_NickServ, nnick))
|
||||
this->flags |= BI_NICKSERV;
|
||||
else if (s_GlobalNoticer && !stricmp(s_GlobalNoticer, nnick))
|
||||
this->flags |= BI_GLOBAL;
|
||||
|
||||
FOREACH_MOD(I_OnBotPreLoad, OnBotPreLoad(this));
|
||||
|
||||
insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL.
|
||||
|
||||
// If we're synchronised with the uplink already, call introduce_user() for this bot.
|
||||
alog("serv_uplink is %p and status is %d", static_cast<void *>(serv_uplink), serv_uplink ? serv_uplink->sync == SSYNC_DONE : 0);
|
||||
if (serv_uplink && serv_uplink->sync == SSYNC_DONE)
|
||||
ircdproto->SendClientIntroduction(this->nick, this->user, this->host, this->real, ircd->pseudoclient_mode, this->uid.c_str());
|
||||
}
|
||||
|
||||
BotInfo::~BotInfo()
|
||||
@@ -89,6 +140,11 @@ void BotInfo::RejoinAll()
|
||||
|
||||
void BotInfo::Assign(User *u, ChannelInfo *ci)
|
||||
{
|
||||
EventReturn MOD_RESULT = EVENT_CONTINUE;
|
||||
FOREACH_RESULT(I_OnBotAssign, OnBotAssign(u, ci, this));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (ci->bi)
|
||||
{
|
||||
if (u)
|
||||
@@ -101,13 +157,14 @@ void BotInfo::Assign(User *u, ChannelInfo *ci)
|
||||
this->chancount++;
|
||||
if (ci->c && ci->c->usercount >= BSMinUsers)
|
||||
bot_join(ci);
|
||||
|
||||
send_event(EVENT_BOT_ASSIGN, 2, ci->name, this->nick);
|
||||
}
|
||||
|
||||
void BotInfo::UnAssign(User *u, ChannelInfo *ci)
|
||||
{
|
||||
send_event(EVENT_BOT_UNASSIGN, 2, ci->name, ci->bi->nick);
|
||||
EventReturn MOD_RESULT = EVENT_CONTINUE;
|
||||
FOREACH_RESULT(I_OnBotUnAssign, OnBotUnAssign(u, ci));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (u && ci->c && ci->c->usercount >= BSMinUsers)
|
||||
ircdproto->SendPart(ci->bi, ci->name, "UNASSIGN from %s", u->nick);
|
||||
|
||||
+71
-20
@@ -135,6 +135,9 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
int16 cstatus = 0;
|
||||
char *cmd;
|
||||
UserData *ud;
|
||||
bool was_action = false;
|
||||
Command *command;
|
||||
std::string bbuf;
|
||||
|
||||
if (!u || !buf || !ci) {
|
||||
return;
|
||||
@@ -150,7 +153,10 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
* but the ACTION may create strange behaviours with the
|
||||
* caps or badwords kickers */
|
||||
if (!strnicmp(buf, "\1ACTION ", 8))
|
||||
{
|
||||
buf += 8;
|
||||
was_action = true;
|
||||
}
|
||||
|
||||
/* Now we can make kicker stuff. We try to order the checks
|
||||
* from the fastest one to the slowest one, since there's
|
||||
@@ -411,23 +417,45 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
|
||||
/* Fantaisist commands */
|
||||
|
||||
if (buf && (ci->botflags & BS_FANTASY) && *buf == *BSFantasyCharacter) {
|
||||
if (buf && (ci->botflags & BS_FANTASY) && *buf == *BSFantasyCharacter && !was_action) {
|
||||
cmd = strtok(buf, " ");
|
||||
|
||||
if (cmd && (cmd[0] == *BSFantasyCharacter)) {
|
||||
char *params = strtok(NULL, "");
|
||||
const char *event_name = EVENT_BOT_FANTASY_NO_ACCESS;
|
||||
|
||||
/* Strip off the fantasy character */
|
||||
cmd++;
|
||||
|
||||
if (check_access(u, ci, CA_FANTASIA))
|
||||
event_name = EVENT_BOT_FANTASY;
|
||||
{
|
||||
command = findCommand(CHANSERV, cmd);
|
||||
|
||||
if (params)
|
||||
send_event(event_name, 4, cmd, u->nick, ci->name, params);
|
||||
/* Command exists and can not be called by fantasy */
|
||||
if (command && !command->HasFlag(CFLAG_DISABLE_FANTASY))
|
||||
{
|
||||
bbuf = std::string(cmd);
|
||||
|
||||
/* Some commands don't need the channel name added.. eg !help */
|
||||
if (!command->HasFlag(CFLAG_STRIP_CHANNEL))
|
||||
{
|
||||
bbuf += " ";
|
||||
bbuf += ci->name;
|
||||
}
|
||||
|
||||
if (params)
|
||||
{
|
||||
bbuf += " ";
|
||||
bbuf += params;
|
||||
}
|
||||
|
||||
chanserv(u, const_cast<char *>(bbuf.c_str())); // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnBotFantasy, OnBotFantasy(cmd, u, ci, params));
|
||||
}
|
||||
else
|
||||
send_event(event_name, 3, cmd, u->nick, ci->name);
|
||||
FOREACH_MOD(I_OnBotNoFantasyAccess, OnBotNoFantasyAccess(cmd, u, ci, params));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -474,12 +502,31 @@ void load_bs_dbase()
|
||||
SAFE(read_string(&bi->real, f));
|
||||
if (ver >= 10) {
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
bi->flags = tmp16;
|
||||
bi->flags |= tmp16;
|
||||
}
|
||||
SAFE(read_int32(&tmp32, f));
|
||||
bi->created = tmp32;
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
bi->chancount = tmp16;
|
||||
|
||||
/* Fixes bug #1080, services bot names may have been
|
||||
* changed in the config and different from database
|
||||
* names
|
||||
*/
|
||||
if (s_ChanServ && bi->flags & BI_CHANSERV && strcmp(bi->nick, s_ChanServ))
|
||||
bi->ChangeNick(s_ChanServ);
|
||||
else if (s_BotServ && bi->flags & BI_BOTSERV && strcmp(bi->nick, s_BotServ))
|
||||
bi->ChangeNick(s_BotServ);
|
||||
else if (s_HostServ && bi->flags & BI_HOSTSERV && strcmp(bi->nick, s_HostServ))
|
||||
bi->ChangeNick(s_HostServ);
|
||||
else if (s_OperServ && bi->flags & BI_OPERSERV && strcmp(bi->nick, s_OperServ))
|
||||
bi->ChangeNick(s_OperServ);
|
||||
else if (s_MemoServ && bi->flags & BI_MEMOSERV && strcmp(bi->nick, s_MemoServ))
|
||||
bi->ChangeNick(s_MemoServ);
|
||||
else if (s_NickServ && bi->flags & BI_NICKSERV && strcmp(bi->nick, s_NickServ))
|
||||
bi->ChangeNick(s_NickServ);
|
||||
else if (s_GlobalNoticer && bi->flags & BI_GLOBAL && strcmp(bi->nick, s_GlobalNoticer))
|
||||
bi->ChangeNick(s_GlobalNoticer);
|
||||
}
|
||||
|
||||
close_db(f);
|
||||
@@ -596,8 +643,8 @@ static BanData *get_ban_data(Channel * c, User * u)
|
||||
if (!c || !u)
|
||||
return NULL;
|
||||
|
||||
snprintf(mask, sizeof(mask), "%s@%s", u->username,
|
||||
common_get_vhost(u));
|
||||
snprintf(mask, sizeof(mask), "%s@%s", u->GetIdent().c_str(),
|
||||
u->GetDisplayedHost().c_str());
|
||||
|
||||
for (bd = c->bd; bd; bd = next) {
|
||||
if (now - bd->last_use > BSKeepData) {
|
||||
@@ -734,7 +781,7 @@ void bot_join(ChannelInfo * ci)
|
||||
}
|
||||
ircdproto->SendJoin(ci->bi, ci->c->name, ci->c->creation_time);
|
||||
ircdproto->SendBotOp(ci->bi->nick, ci->c->name);
|
||||
send_event(EVENT_BOT_JOIN, 2, ci->name, ci->bi->nick);
|
||||
FOREACH_MOD(I_OnBotJoin, OnBotJoin(ci, ci->bi));
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -750,7 +797,11 @@ static void check_ban(ChannelInfo * ci, User * u, int ttbtype)
|
||||
return;
|
||||
|
||||
bd->ttb[ttbtype]++;
|
||||
if (bd->ttb[ttbtype] == ci->ttb[ttbtype]) {
|
||||
if (ci->ttb[ttbtype] && bd->ttb[ttbtype] >= ci->ttb[ttbtype])
|
||||
{
|
||||
/* Should not use == here because bd->ttb[ttbtype] could possibly be > ci->ttb[ttbtype]
|
||||
* if the TTB was changed after it was not set (0) before and the user had already been
|
||||
* kicked a few times. Bug #1056 - Adam */
|
||||
const char *av[4];
|
||||
int ac;
|
||||
char mask[BUFSIZE];
|
||||
@@ -776,7 +827,7 @@ static void check_ban(ChannelInfo * ci, User * u, int ttbtype)
|
||||
|
||||
ircdproto->SendMode(ci->bi, ci->name, "+b %s", mask);
|
||||
do_cmode(ci->bi->nick, ac, av);
|
||||
send_event(EVENT_BOT_BAN, 3, u->nick, ci->name, mask);
|
||||
FOREACH_MOD(I_OnBotBan, OnBotBan(u, ci, mask));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -795,7 +846,7 @@ static void bot_kick(ChannelInfo * ci, User * u, int message, ...)
|
||||
return;
|
||||
|
||||
va_start(args, message);
|
||||
fmt = getstring(u->na, message);
|
||||
fmt = getstring(u, message);
|
||||
if (!fmt)
|
||||
return;
|
||||
vsnprintf(buf, sizeof(buf), fmt, args);
|
||||
@@ -806,7 +857,7 @@ static void bot_kick(ChannelInfo * ci, User * u, int message, ...)
|
||||
av[2] = buf;
|
||||
ircdproto->SendKick(ci->bi, av[0], av[1], "%s", av[2]);
|
||||
do_kick(ci->bi->nick, 3, av);
|
||||
send_event(EVENT_BOT_KICK, 3, u->nick, ci->name, buf);
|
||||
FOREACH_MOD(I_OnBotKick, OnBotKick(u, ci, buf));
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -829,7 +880,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
|
||||
if (ircd->protectedumode) {
|
||||
if (is_protected(u) && (requester != u)) {
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
|
||||
getstring2(NULL, PERMISSION_DENIED));
|
||||
getstring(ACCESS_DENIED));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -841,7 +892,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
|
||||
if (ircd->except) {
|
||||
if (is_excepted(ci, u) == 1) {
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
|
||||
getstring2(NULL, BOT_EXCEPT));
|
||||
getstring(BOT_EXCEPT));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -886,7 +937,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick,
|
||||
ircdproto->SendKick(ci->bi, kav[0], kav[1], "%s", kav[2]);
|
||||
|
||||
do_kick(ci->bi->nick, 3, kav);
|
||||
send_event(EVENT_BOT_KICK, 3, kav[1], kav[0], kav[2]);
|
||||
FOREACH_MOD(I_OnBotKick, OnBotKick(u, ci, kav[2]));
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -905,7 +956,7 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
|
||||
if (ircd->protectedumode) {
|
||||
if (is_protected(u) && (requester != u)) {
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
|
||||
getstring2(NULL, PERMISSION_DENIED));
|
||||
getstring(ACCESS_DENIED));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -933,7 +984,7 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick,
|
||||
else
|
||||
ircdproto->SendKick(ci->bi, av[0], av[1], "%s", av[2]);
|
||||
do_kick(ci->bi->nick, 3, av);
|
||||
send_event(EVENT_BOT_KICK, 3, av[1], av[0], av[2]);
|
||||
FOREACH_MOD(I_OnBotKick, OnBotKick(u, ci, av[2]));
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -959,7 +1010,7 @@ void bot_raw_mode(User * requester, ChannelInfo * ci, const char *mode,
|
||||
if (ircd->protectedumode) {
|
||||
if (is_protected(u) && *mode == '-' && (requester != u)) {
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s",
|
||||
getstring2(NULL, PERMISSION_DENIED));
|
||||
getstring(ACCESS_DENIED));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+114
-91
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "services.h"
|
||||
#include "language.h"
|
||||
#include "modules.h"
|
||||
|
||||
Channel *chanlist[1024];
|
||||
|
||||
@@ -166,7 +167,7 @@ void chan_set_modes(const char *source, Channel * chan, int ac, const char **av,
|
||||
CUMode *cum;
|
||||
unsigned char botmode = 0;
|
||||
BotInfo *bi;
|
||||
User *u, *user;
|
||||
User *user;
|
||||
int i, real_ac = ac;
|
||||
const char **real_av = av;
|
||||
|
||||
@@ -174,27 +175,6 @@ void chan_set_modes(const char *source, Channel * chan, int ac, const char **av,
|
||||
alog("debug: Changing modes for %s to %s", chan->name,
|
||||
merge_args(ac, av));
|
||||
|
||||
u = finduser(source);
|
||||
if (u && (chan_get_user_status(chan, u) & CUS_DEOPPED)) {
|
||||
char *s;
|
||||
|
||||
if (debug)
|
||||
alog("debug: Removing instead of setting due to DEOPPED flag");
|
||||
|
||||
/* Swap adding and removing of the modes */
|
||||
for (s = const_cast<char *>(av[0]); *s; s++) { // XXX Unsafe cast, this needs reviewing -- CyberBotX
|
||||
if (*s == '+')
|
||||
*s = '-';
|
||||
else if (*s == '-')
|
||||
*s = '+';
|
||||
}
|
||||
|
||||
/* Set the resulting mode buffer */
|
||||
ircdproto->SendMode(whosends(chan->ci), chan->name, merge_args(ac, av));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ac--;
|
||||
|
||||
while ((mode = *modes++)) {
|
||||
@@ -256,8 +236,6 @@ void chan_set_modes(const char *source, Channel * chan, int ac, const char **av,
|
||||
if (add) {
|
||||
chan_set_user_status(chan, user, cum->status);
|
||||
/* If this does +o, remove any DEOPPED flag */
|
||||
if (cum->status & CUS_OP)
|
||||
chan_remove_user_status(chan, user, CUS_DEOPPED);
|
||||
} else {
|
||||
chan_remove_user_status(chan, user, cum->status);
|
||||
}
|
||||
@@ -303,6 +281,11 @@ void chan_set_modes(const char *source, Channel * chan, int ac, const char **av,
|
||||
}
|
||||
}
|
||||
|
||||
// Don't bounce modes from u:lined clients or servers, bug #1004
|
||||
user = finduser(source);
|
||||
if ((user && is_ulined(user->server->name)) || is_ulined(source))
|
||||
return;
|
||||
|
||||
if (check > 0)
|
||||
{
|
||||
check_modes(chan);
|
||||
@@ -321,7 +304,15 @@ void chan_set_modes(const char *source, Channel * chan, int ac, const char **av,
|
||||
if (check < 2)
|
||||
chan_set_correct_modes(user, chan, 0);
|
||||
else if ((chan->ci->flags) && (chan->ci->flags & CI_SECUREOPS))
|
||||
{
|
||||
/* Fixing bug #1006 oringinally caused by fixing #922
|
||||
* we must check for secureops here, not in chan_set_correct_modes
|
||||
* because chan_set_corret_modes will also check for usercount == 1
|
||||
* where it will deop the user, this way we know the channel was not
|
||||
* just created. (check == 3 from /cs (half)op) - Adam
|
||||
*/
|
||||
chan_set_correct_modes(user, chan, 0);
|
||||
}
|
||||
}
|
||||
|
||||
real_av++;
|
||||
@@ -509,8 +500,7 @@ User *nc_on_chan(Channel * c, NickCore * nc)
|
||||
return NULL;
|
||||
|
||||
for (u = c->users; u; u = u->next) {
|
||||
if (u->user->na && u->user->na->nc == nc
|
||||
&& nick_recognized(u->user))
|
||||
if (u->user->nc == nc)
|
||||
return u->user;
|
||||
}
|
||||
return NULL;
|
||||
@@ -559,11 +549,9 @@ void do_join(const char *source, int ac, const char **av)
|
||||
while (c) {
|
||||
nextc = c->next;
|
||||
channame = sstrdup(c->chan->name);
|
||||
send_event(EVENT_PART_CHANNEL, 3, EVENT_START, user->nick,
|
||||
channame);
|
||||
FOREACH_MOD(I_OnPrePartChannel, OnPrePartChannel(user, c->chan));
|
||||
chan_deluser(user, c->chan);
|
||||
send_event(EVENT_PART_CHANNEL, 3, EVENT_STOP, user->nick,
|
||||
channame);
|
||||
FOREACH_MOD(I_OnPartChannel, OnPartChannel(user, c->chan, ""));
|
||||
delete [] channame;
|
||||
delete c;
|
||||
c = nextc;
|
||||
@@ -572,8 +560,10 @@ void do_join(const char *source, int ac, const char **av)
|
||||
continue;
|
||||
}
|
||||
|
||||
chan = findchan(s);
|
||||
|
||||
/* how about not triggering the JOIN event on an actual /part :) -certus */
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START, source, s);
|
||||
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, s));
|
||||
|
||||
/* Make sure check_kick comes before chan_adduser, so banned users
|
||||
* don't get to see things like channel keys. */
|
||||
@@ -590,11 +580,10 @@ void do_join(const char *source, int ac, const char **av)
|
||||
}
|
||||
}
|
||||
|
||||
chan = findchan(s);
|
||||
chan = join_user_update(user, chan, s, ts);
|
||||
chan_set_correct_modes(user, chan, 1);
|
||||
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_STOP, source, s);
|
||||
FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(user, chan));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -649,8 +638,9 @@ void do_kick(const char *source, int ac, const char **av)
|
||||
}
|
||||
for (c = user->chans; c && stricmp(av[0], c->chan->name) != 0;
|
||||
c = c->next);
|
||||
if (c) {
|
||||
send_event(EVENT_CHAN_KICK, 2, user->nick, av[0]);
|
||||
if (c)
|
||||
{
|
||||
FOREACH_MOD(I_OnUserKicked, OnUserKicked(c->chan, user, source, merge_args(ac - 2, av + 2)));
|
||||
chan_deluser(user, c->chan);
|
||||
if (c->next)
|
||||
c->next->prev = c->prev;
|
||||
@@ -675,7 +665,6 @@ void do_part(const char *source, int ac, const char **av)
|
||||
User *user;
|
||||
char *s, *t;
|
||||
struct u_chanlist *c;
|
||||
char *channame;
|
||||
|
||||
if (ircd->ts6) {
|
||||
user = find_byuid(source);
|
||||
@@ -705,11 +694,12 @@ void do_part(const char *source, int ac, const char **av)
|
||||
alog("user: BUG parting %s: channel entry found but c->chan NULL", s);
|
||||
return;
|
||||
}
|
||||
channame = sstrdup(c->chan->name);
|
||||
send_event(EVENT_PART_CHANNEL, (ac >= 2 ? 4 : 3), EVENT_START,
|
||||
user->nick, channame, (ac >= 2 ? av[1] : ""));
|
||||
FOREACH_MOD(I_OnPrePartChannel, OnPrePartChannel(user, c->chan));
|
||||
|
||||
chan_deluser(user, c->chan);
|
||||
|
||||
FOREACH_MOD(I_OnPartChannel, OnPartChannel(user, c->chan, av[1] ? av[1] : ""));
|
||||
|
||||
if (c->next)
|
||||
c->next->prev = c->prev;
|
||||
if (c->prev)
|
||||
@@ -717,10 +707,6 @@ void do_part(const char *source, int ac, const char **av)
|
||||
else
|
||||
user->chans = c->next;
|
||||
delete c;
|
||||
|
||||
send_event(EVENT_PART_CHANNEL, (ac >= 2 ? 4 : 3), EVENT_STOP,
|
||||
user->nick, channame, (ac >= 2 ? av[1] : ""));
|
||||
delete [] channame;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -770,7 +756,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
Server *serv;
|
||||
struct c_userlist *cu;
|
||||
const char *s = NULL;
|
||||
char *end, cubuf[7], *end2;
|
||||
char *buf, *end, cubuf[7], *end2;
|
||||
const char *modes[6];
|
||||
int is_sqlined = 0;
|
||||
int ts = 0;
|
||||
@@ -797,10 +783,20 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
modes[2] = cu->user->nick;
|
||||
chan_set_modes(source, c, 3, modes, 2);
|
||||
}
|
||||
if (c->ci && c->ci->bi) {
|
||||
/* This is ugly, but it always works */
|
||||
ircdproto->SendPart(c->ci->bi, c->name, "TS reop");
|
||||
bot_join(c->ci);
|
||||
if (c->ci)
|
||||
{
|
||||
if (c->ci->bi)
|
||||
{
|
||||
/* This is ugly, but it always works */
|
||||
ircdproto->SendPart(c->ci->bi, c->name, "TS reop");
|
||||
bot_join(c->ci);
|
||||
}
|
||||
/* Make sure +r is set */
|
||||
if (ircd->chanreg && ircd->regmode)
|
||||
{
|
||||
c->mode |= ircd->regmode;
|
||||
ircdproto->SendMode(whosends(c->ci), c->name, "+r");
|
||||
}
|
||||
}
|
||||
/* XXX simple modes and bans */
|
||||
} else if (c->creation_time < ts)
|
||||
@@ -831,7 +827,9 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
|
||||
if (ircd->sjoinbanchar) {
|
||||
if (*s == ircd->sjoinbanchar && keep_their_modes) {
|
||||
add_ban(c, myStrGetToken(s, ircd->sjoinbanchar, 1));
|
||||
buf = myStrGetToken(s, ircd->sjoinbanchar, 1);
|
||||
add_ban(c, buf);
|
||||
delete [] buf;
|
||||
if (!end)
|
||||
break;
|
||||
s = end + 1;
|
||||
@@ -840,8 +838,9 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
}
|
||||
if (ircd->sjoinexchar) {
|
||||
if (*s == ircd->sjoinexchar && keep_their_modes) {
|
||||
add_exception(c,
|
||||
myStrGetToken(s, ircd->sjoinexchar, 1));
|
||||
buf = myStrGetToken(s, ircd->sjoinexchar, 1);
|
||||
add_exception(c, buf);
|
||||
delete [] buf;
|
||||
if (!end)
|
||||
break;
|
||||
s = end + 1;
|
||||
@@ -851,7 +850,9 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
|
||||
if (ircd->sjoininvchar) {
|
||||
if (*s == ircd->sjoininvchar && keep_their_modes) {
|
||||
add_invite(c, myStrGetToken(s, ircd->sjoininvchar, 1));
|
||||
buf = myStrGetToken(s, ircd->sjoininvchar, 1);
|
||||
add_invite(c, buf);
|
||||
delete [] buf;
|
||||
if (!end)
|
||||
break;
|
||||
s = end + 1;
|
||||
@@ -884,8 +885,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
ircdproto->SendKick(findbot(s_OperServ), av[1], s, "Q-Lined");
|
||||
} else {
|
||||
if (!check_kick(user, av[1], ts)) {
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START,
|
||||
user->nick, av[1]);
|
||||
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
|
||||
|
||||
/* Make the user join; if the channel does not exist it
|
||||
* will be created there. This ensures that the channel
|
||||
@@ -910,8 +910,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
restore_topic(c->name);
|
||||
chan_set_correct_modes(user, c, 1);
|
||||
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_STOP,
|
||||
user->nick, av[1]);
|
||||
FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(user, c));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,8 +968,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
ircdproto->SendKick(findbot(s_OperServ), av[1], s, "Q-Lined");
|
||||
} else {
|
||||
if (!check_kick(user, av[1], ts)) {
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START,
|
||||
user->nick, av[1]);
|
||||
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
|
||||
|
||||
/* Make the user join; if the channel does not exist it
|
||||
* will be created there. This ensures that the channel
|
||||
@@ -992,8 +990,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
|
||||
chan_set_correct_modes(user, c, 1);
|
||||
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_STOP,
|
||||
user->nick, av[1]);
|
||||
FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(user, c));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1044,8 +1041,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
ircdproto->SendKick(findbot(s_OperServ), av[1], s, "Q-Lined");
|
||||
} else {
|
||||
if (!check_kick(user, av[1], ts)) {
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START,
|
||||
user->nick, av[1]);
|
||||
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
|
||||
|
||||
/* Make the user join; if the channel does not exist it
|
||||
* will be created there. This ensures that the channel
|
||||
@@ -1067,8 +1063,7 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
|
||||
chan_set_correct_modes(user, c, 1);
|
||||
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_STOP,
|
||||
user->nick, av[1]);
|
||||
FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(user, c));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1104,16 +1099,14 @@ void do_sjoin(const char *source, int ac, const char **av)
|
||||
if (is_sqlined && !is_oper(user)) {
|
||||
ircdproto->SendKick(findbot(s_OperServ), av[1], user->nick, "Q-Lined");
|
||||
} else {
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_START, user->nick,
|
||||
av[1]);
|
||||
FOREACH_MOD(I_OnPreJoinChannel, OnPreJoinChannel(user, av[1]));
|
||||
|
||||
c = join_user_update(user, c, av[1], ts);
|
||||
if (is_created && c->ci)
|
||||
restore_topic(c->name);
|
||||
chan_set_correct_modes(user, c, 1);
|
||||
|
||||
send_event(EVENT_JOIN_CHANNEL, 3, EVENT_STOP, user->nick,
|
||||
av[1]);
|
||||
FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(user, c));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1172,7 +1165,7 @@ void do_cmode(const char *source, int ac, const char **av)
|
||||
if (!chan) {
|
||||
if (debug) {
|
||||
ci = cs_findchan(av[0]);
|
||||
if (!(ci && (ci->flags & CI_VERBOTEN)))
|
||||
if (!(ci && (ci->flags & CI_FORBIDDEN)))
|
||||
alog("debug: MODE %s for nonexistent channel %s",
|
||||
merge_args(ac - 1, av + 1), av[0]);
|
||||
}
|
||||
@@ -1264,11 +1257,7 @@ void do_topic(const char *source, int ac, const char **av)
|
||||
|
||||
record_topic(av[0]);
|
||||
|
||||
if (ci && ci->last_topic) {
|
||||
send_event(EVENT_TOPIC_UPDATED, 2, av[0], ci->last_topic);
|
||||
} else {
|
||||
send_event(EVENT_TOPIC_UPDATED, 2, av[0], "");
|
||||
}
|
||||
FOREACH_MOD(I_OnTopicUpdated, OnTopicUpdated(c, av[0]));
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -1386,7 +1375,7 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
|
||||
if (!c || !(ci = c->ci))
|
||||
return;
|
||||
|
||||
if ((ci->flags & CI_VERBOTEN) || (*(c->name) == '+'))
|
||||
if ((ci->flags & CI_FORBIDDEN) || (*(c->name) == '+'))
|
||||
return;
|
||||
|
||||
status = chan_get_user_status(c, user);
|
||||
@@ -1400,7 +1389,7 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
|
||||
* to receive modes. I wonder who added that... *looks at Rob* ;) -GD
|
||||
*/
|
||||
if (give_modes && (get_ignore(user->nick) == NULL)
|
||||
&& (!user->na || !(user->na->nc->flags & NI_AUTOOP))) {
|
||||
&& (!user->nc || !(user->nc->flags & NI_AUTOOP))) {
|
||||
if (ircd->owner && is_founder(user, ci))
|
||||
add_modes |= CUS_OWNER;
|
||||
else if ((ircd->protect || ircd->admin)
|
||||
@@ -1471,7 +1460,6 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
|
||||
strcat(modebuf, "o");
|
||||
strcat(userbuf, " ");
|
||||
strcat(userbuf, user->nick);
|
||||
rem_modes |= CUS_DEOPPED;
|
||||
} else {
|
||||
add_modes &= ~CUS_OP;
|
||||
}
|
||||
@@ -1510,7 +1498,6 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
|
||||
strcat(modebuf, "o");
|
||||
strcat(userbuf, " ");
|
||||
strcat(userbuf, user->nick);
|
||||
add_modes |= CUS_DEOPPED;
|
||||
}
|
||||
if (rem_modes & CUS_HALFOP) {
|
||||
strcat(modebuf, "h");
|
||||
@@ -1567,8 +1554,7 @@ void chan_adduser2(User * user, Channel * c)
|
||||
/* Added channelname to entrymsg - 30.03.2004, Certus */
|
||||
/* Also, don't send the entrymsg when bursting -GD */
|
||||
if (c->ci && c->ci->entry_message && is_sync(user->server))
|
||||
notice_user(whosends(c->ci)->nick, user, "[%s] %s", c->name,
|
||||
c->ci->entry_message);
|
||||
user->SendMessage(whosends(c->ci)->nick, "[%s] %s", c->name, c->ci->entry_message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1581,7 +1567,7 @@ void chan_adduser2(User * user, Channel * c)
|
||||
if (c->usercount == BSMinUsers)
|
||||
bot_join(c->ci);
|
||||
if (c->usercount >= BSMinUsers && (c->ci->botflags & BS_GREET)
|
||||
&& user->na && user->na->nc->greet
|
||||
&& user->nc && user->nc->greet
|
||||
&& check_access(user, c->ci, CA_GREET)) {
|
||||
/* Only display the greet if the main uplink we're connected
|
||||
* to has synced, or we'll get greet-floods when the net
|
||||
@@ -1589,7 +1575,7 @@ void chan_adduser2(User * user, Channel * c)
|
||||
*/
|
||||
if (is_sync(user->server)) {
|
||||
ircdproto->SendPrivmsg(c->ci->bi, c->name, "[%s] %s",
|
||||
user->na->nick, user->na->nc->greet);
|
||||
user->nc->display, user->nc->greet);
|
||||
c->ci->bi->lastmsg = time(NULL);
|
||||
}
|
||||
}
|
||||
@@ -1826,6 +1812,41 @@ Channel *join_user_update(User * user, Channel * chan, const char *name,
|
||||
/* If it's a new channel, so we need to create it first. */
|
||||
if (!chan)
|
||||
chan = chan_create(name, chants);
|
||||
else
|
||||
{
|
||||
// Check chants against 0, as not every ircd sends JOIN with a TS.
|
||||
if (chan->creation_time > chants && chants != 0)
|
||||
{
|
||||
struct c_userlist *cu;
|
||||
const char *modes[6];
|
||||
|
||||
chan->creation_time = chants;
|
||||
for (cu = chan->users; cu; cu = cu->next)
|
||||
{
|
||||
/* XXX */
|
||||
modes[0] = "-ov";
|
||||
modes[1] = cu->user->nick;
|
||||
modes[2] = cu->user->nick;
|
||||
chan_set_modes(s_OperServ, chan, 3, modes, 2);
|
||||
}
|
||||
if (chan->ci)
|
||||
{
|
||||
if (chan->ci->bi)
|
||||
{
|
||||
/* This is ugly, but it always works */
|
||||
ircdproto->SendPart(chan->ci->bi, chan->name, "TS reop");
|
||||
bot_join(chan->ci);
|
||||
}
|
||||
/* Make sure +r is set */
|
||||
if (ircd->chanreg && ircd->regmode)
|
||||
{
|
||||
chan->mode |= ircd->regmode;
|
||||
ircdproto->SendMode(whosends(chan->ci), chan->name, "+r");
|
||||
}
|
||||
}
|
||||
/* XXX simple modes and bans */
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
alog("debug: %s joins %s", user->nick, chan->name);
|
||||
@@ -2122,7 +2143,7 @@ EList *list_create()
|
||||
* @param ip IP to match against, set to 0 to not match this
|
||||
* @return 1 for a match, 0 for no match
|
||||
*/
|
||||
int entry_match(Entry * e, char *nick, char *user, char *host, uint32 ip)
|
||||
int entry_match(Entry * e, const char *nick, const char *user, const char *host, uint32 ip)
|
||||
{
|
||||
/* If we don't get an entry, or it s an invalid one, no match ~ Viper */
|
||||
if (!e || e->type == ENTRYTYPE_NONE)
|
||||
@@ -2141,13 +2162,13 @@ int entry_match(Entry * e, char *nick, char *user, char *host, uint32 ip)
|
||||
&& (!user || stricmp(e->host, host) != 0))
|
||||
return 0;
|
||||
if ((e->type & ENTRYTYPE_NICK_WILD)
|
||||
&& !match_wild_nocase(e->nick, nick))
|
||||
&& !Anope::Match(nick, e->nick, false))
|
||||
return 0;
|
||||
if ((e->type & ENTRYTYPE_USER_WILD)
|
||||
&& !match_wild_nocase(e->user, user))
|
||||
&& !Anope::Match(user, e->user, false))
|
||||
return 0;
|
||||
if ((e->type & ENTRYTYPE_HOST_WILD)
|
||||
&& !match_wild_nocase(e->host, host))
|
||||
&& !Anope::Match(host, e->host, false))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
@@ -2160,7 +2181,7 @@ int entry_match(Entry * e, char *nick, char *user, char *host, uint32 ip)
|
||||
* @param ip IP to match against, set to 0 to not match this
|
||||
* @return 1 for a match, 0 for no match
|
||||
*/
|
||||
int entry_match_mask(Entry * e, char *mask, uint32 ip)
|
||||
int entry_match_mask(Entry * e, const char *mask, uint32 ip)
|
||||
{
|
||||
char *hostmask, *nick, *user, *host;
|
||||
int res;
|
||||
@@ -2201,7 +2222,7 @@ int entry_match_mask(Entry * e, char *mask, uint32 ip)
|
||||
* @param ip The ip to match
|
||||
* @return Returns the first matching entry, if none, NULL is returned.
|
||||
*/
|
||||
Entry *elist_match(EList * list, char *nick, char *user, char *host,
|
||||
Entry *elist_match(EList * list, const char *nick, const char *user, const char *host,
|
||||
uint32 ip)
|
||||
{
|
||||
Entry *e;
|
||||
@@ -2225,7 +2246,7 @@ Entry *elist_match(EList * list, char *nick, char *user, char *host,
|
||||
* @param ip The ip to match
|
||||
* @return Returns the first matching entry, if none, NULL is returned.
|
||||
*/
|
||||
Entry *elist_match_mask(EList * list, char *mask, uint32 ip)
|
||||
Entry *elist_match_mask(EList * list, const char *mask, uint32 ip)
|
||||
{
|
||||
char *hostmask, *nick, *user, *host;
|
||||
Entry *res;
|
||||
@@ -2291,9 +2312,11 @@ Entry *elist_match_user(EList * list, User * u)
|
||||
ip = str_is_ip(host);
|
||||
|
||||
/* Match what we ve got against the lists.. */
|
||||
res = elist_match(list, u->nick, u->username, u->host, ip);
|
||||
res = elist_match(list, u->nick, u->GetIdent().c_str(), u->host, ip);
|
||||
if (!res)
|
||||
elist_match(list, u->nick, u->username, u->vhost, ip);
|
||||
res = elist_match(list, u->nick, u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip);
|
||||
if (!res && !u->GetCloakedHost().empty() && u->GetCloakedHost() != u->GetDisplayedHost())
|
||||
res = elist_match(list, u->nick, u->GetIdent().c_str(), u->GetCloakedHost().c_str(), ip);
|
||||
|
||||
if (host)
|
||||
delete [] host;
|
||||
|
||||
+171
-171
@@ -111,8 +111,11 @@ CSModeUtil csmodeutils[] = {
|
||||
{ "VOICE", "voice", "+v", 0, CA_VOICE, CA_VOICEME },
|
||||
{ "DEHALFOP", "dehalfop", "-h", 0, CA_HALFOP, CA_HALFOPME },
|
||||
{ "HALFOP", "halfop", "+h", 0, CA_HALFOP, CA_HALFOPME },
|
||||
/* These get set later */
|
||||
{ "DEPROTECT", "", "", 0, CA_PROTECT, CA_PROTECTME },
|
||||
{ "PROTECT", "", "", 0, CA_PROTECT, CA_PROTECTME },
|
||||
{ "DEOWNER", "", "", 0, ACCESS_FOUNDER, ACCESS_FOUNDER},
|
||||
{ "OWNER", "", "", 0, ACCESS_FOUNDER, ACCESS_FOUNDER},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@@ -124,6 +127,28 @@ void moduleAddChanServCmds() {
|
||||
|
||||
/* *INDENT-ON* */
|
||||
/*************************************************************************/
|
||||
|
||||
class ChanServTimer : public Timer
|
||||
{
|
||||
private:
|
||||
std::string channel;
|
||||
|
||||
public:
|
||||
ChanServTimer(long delay, const std::string &chan) : Timer(delay), channel(chan)
|
||||
{
|
||||
}
|
||||
|
||||
void Tick(time_t ctime)
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(channel.c_str());
|
||||
|
||||
if (ci)
|
||||
ci->flags &= ~CI_INHABIT;
|
||||
|
||||
ircdproto->SendPart(findbot(s_ChanServ), channel.c_str(), NULL);
|
||||
}
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Returns modes for mlock in a nice way. */
|
||||
@@ -189,7 +214,7 @@ char *get_mlock_modes(ChannelInfo * ci, int complete)
|
||||
void get_chanserv_stats(long *nrec, long *memuse)
|
||||
{
|
||||
long count = 0, mem = 0;
|
||||
int i, j;
|
||||
unsigned i, j;
|
||||
ChannelInfo *ci;
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
@@ -202,7 +227,8 @@ void get_chanserv_stats(long *nrec, long *memuse)
|
||||
mem += strlen(ci->url) + 1;
|
||||
if (ci->email)
|
||||
mem += strlen(ci->email) + 1;
|
||||
mem += ci->accesscount * sizeof(ChanAccess);
|
||||
if (!ci->access.empty())
|
||||
mem += ci->access.size() * sizeof(ChanAccess);
|
||||
mem += ci->akickcount * sizeof(AutoKick);
|
||||
for (j = 0; j < ci->akickcount; j++) {
|
||||
if (!(ci->akick[j].flags & AK_ISNICK)
|
||||
@@ -299,7 +325,8 @@ void chanserv(User * u, char *buf)
|
||||
void load_cs_dbase()
|
||||
{
|
||||
dbFILE *f;
|
||||
int ver, i, j, c;
|
||||
int ver, c;
|
||||
unsigned i, j;
|
||||
ChannelInfo *ci, **last, *prev;
|
||||
int failed = 0;
|
||||
|
||||
@@ -390,27 +417,29 @@ void load_cs_dbase()
|
||||
ci->levels[j] = static_cast<int16>(tmp16);
|
||||
}
|
||||
|
||||
SAFE(read_int16(&ci->accesscount, f));
|
||||
if (ci->accesscount) {
|
||||
ci->access = static_cast<ChanAccess *>(scalloc(ci->accesscount, sizeof(ChanAccess)));
|
||||
for (j = 0; j < ci->accesscount; j++) {
|
||||
SAFE(read_int16(&ci->access[j].in_use, f));
|
||||
if (ci->access[j].in_use) {
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
ci->access[j].level = static_cast<int16>(tmp16);
|
||||
uint16 accesscount = 0;
|
||||
SAFE(read_int16(&accesscount, f));
|
||||
if (accesscount) {
|
||||
for (j = 0; j < accesscount; j++) {
|
||||
uint16 in_use = 0;
|
||||
SAFE(read_int16(&in_use, f));
|
||||
if (in_use) {
|
||||
uint16 level;
|
||||
SAFE(read_int16(&level, f));
|
||||
NickCore *nc;
|
||||
SAFE(read_string(&s, f));
|
||||
if (s) {
|
||||
ci->access[j].nc = findcore(s);
|
||||
nc = findcore(s);
|
||||
delete [] s;
|
||||
}
|
||||
if (ci->access[j].nc == NULL)
|
||||
ci->access[j].in_use = 0;
|
||||
SAFE(read_int32(&tmp32, f));
|
||||
ci->access[j].last_seen = tmp32;
|
||||
else
|
||||
nc = NULL;
|
||||
uint32 last_seen;
|
||||
SAFE(read_int32(&last_seen, f));
|
||||
if (nc)
|
||||
ci->AddAccess(nc, level, last_seen);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ci->access = NULL;
|
||||
}
|
||||
|
||||
SAFE(read_int16(&ci->akickcount, f));
|
||||
@@ -452,20 +481,8 @@ void load_cs_dbase()
|
||||
SAFE(read_int32(&ci->mlock_off, f));
|
||||
SAFE(read_int32(&ci->mlock_limit, f));
|
||||
SAFE(read_string(&ci->mlock_key, f));
|
||||
if (ircd->fmode) {
|
||||
SAFE(read_string(&ci->mlock_flood, f));
|
||||
} else {
|
||||
SAFE(read_string(&s, f));
|
||||
if (s)
|
||||
delete [] s;
|
||||
}
|
||||
if (ircd->Lmode) {
|
||||
SAFE(read_string(&ci->mlock_redirect, f));
|
||||
} else {
|
||||
SAFE(read_string(&s, f));
|
||||
if (s)
|
||||
delete [] s;
|
||||
}
|
||||
SAFE(read_string(&ci->mlock_flood, f));
|
||||
SAFE(read_string(&ci->mlock_redirect, f));
|
||||
|
||||
SAFE(read_int16(&tmp16, f));
|
||||
if (tmp16) ci->memos.memos.resize(tmp16);
|
||||
@@ -548,7 +565,7 @@ void load_cs_dbase()
|
||||
ChannelInfo *next;
|
||||
for (ci = chanlists[i]; ci; ci = next) {
|
||||
next = ci->next;
|
||||
if (!(ci->flags & CI_VERBOTEN) && !ci->founder) {
|
||||
if (!(ci->flags & CI_FORBIDDEN) && !ci->founder) {
|
||||
alog("%s: database load: Deleting founderless channel %s",
|
||||
s_ChanServ, ci->name);
|
||||
delchan(ci);
|
||||
@@ -578,7 +595,7 @@ void load_cs_dbase()
|
||||
void save_cs_dbase()
|
||||
{
|
||||
dbFILE *f;
|
||||
int i, j;
|
||||
unsigned i, j;
|
||||
ChannelInfo *ci;
|
||||
static time_t lastwarn = 0;
|
||||
|
||||
@@ -619,14 +636,15 @@ void save_cs_dbase()
|
||||
for (j = 0; j < CA_SIZE; j++)
|
||||
SAFE(write_int16(ci->levels[j], f));
|
||||
|
||||
SAFE(write_int16(ci->accesscount, f));
|
||||
for (j = 0; j < ci->accesscount; j++) {
|
||||
SAFE(write_int16(ci->access[j].in_use, f));
|
||||
if (ci->access[j].in_use) {
|
||||
SAFE(write_int16(ci->access[j].level, f));
|
||||
SAFE(write_string(ci->access[j].nc->display, f));
|
||||
SAFE(write_int32(ci->access[j].last_seen, f));
|
||||
}
|
||||
SAFE(write_int16(ci->access.empty() ? 0 : ci->access.size(), f));
|
||||
for (j = 0; j < ci->access.size(); j++) {
|
||||
ChanAccess *access = ci->GetAccess(j);
|
||||
if (!access->in_use)
|
||||
continue;
|
||||
SAFE(write_int16(access->in_use, f));
|
||||
SAFE(write_int16(access->level, f));
|
||||
SAFE(write_string(access->nc->display, f));
|
||||
SAFE(write_int32(access->last_seen, f));
|
||||
}
|
||||
|
||||
SAFE(write_int16(ci->akickcount, f));
|
||||
@@ -647,16 +665,8 @@ void save_cs_dbase()
|
||||
SAFE(write_int32(ci->mlock_off, f));
|
||||
SAFE(write_int32(ci->mlock_limit, f));
|
||||
SAFE(write_string(ci->mlock_key, f));
|
||||
if (ircd->fmode) {
|
||||
SAFE(write_string(ci->mlock_flood, f));
|
||||
} else {
|
||||
SAFE(write_string(NULL, f));
|
||||
}
|
||||
if (ircd->Lmode) {
|
||||
SAFE(write_string(ci->mlock_redirect, f));
|
||||
} else {
|
||||
SAFE(write_string(NULL, f));
|
||||
}
|
||||
SAFE(write_string(ci->mlock_flood, f));
|
||||
SAFE(write_string(ci->mlock_redirect, f));
|
||||
SAFE(write_int16(ci->memos.memos.size(), f));
|
||||
SAFE(write_int16(ci->memos.memomax, f));
|
||||
for (j = 0; j < ci->memos.memos.size(); j++) {
|
||||
@@ -721,7 +731,7 @@ void save_cs_dbase()
|
||||
void check_modes(Channel * c)
|
||||
{
|
||||
char modebuf[64], argbuf[BUFSIZE], *end = modebuf, *end2 = argbuf;
|
||||
uint32 modes;
|
||||
uint32 modes = 0;
|
||||
ChannelInfo *ci;
|
||||
CBModeInfo *cbmi;
|
||||
CBMode *cbm;
|
||||
@@ -761,13 +771,15 @@ void check_modes(Channel * c)
|
||||
ircdproto->SendMode(whosends(ci), c->name, "-r");
|
||||
}
|
||||
}
|
||||
return;
|
||||
/* Channels that are not regged also need the defcon modes.. ~ Viper */
|
||||
/* return; */
|
||||
}
|
||||
|
||||
/* Initialize te modes-var to set all modes not set yet but which should
|
||||
/* Initialize the modes-var to set all modes not set yet but which should
|
||||
* be set as by mlock and defcon.
|
||||
*/
|
||||
modes = ~c->mode & ci->mlock_on;
|
||||
if (ci)
|
||||
modes = ~c->mode & ci->mlock_on;
|
||||
if (DefConModesSet)
|
||||
modes |= (~c->mode & DefConModesOn);
|
||||
|
||||
@@ -786,8 +798,13 @@ void check_modes(Channel * c)
|
||||
/* Check if it's a defcon or mlock mode */
|
||||
if (DefConModesOn & cbmi->flag)
|
||||
value = cbmi->csgetvalue(&DefConModesCI);
|
||||
else
|
||||
else if (ci)
|
||||
value = cbmi->csgetvalue(ci);
|
||||
else {
|
||||
value = NULL;
|
||||
if (debug)
|
||||
alog ("Warning: setting modes with unknown origin.");
|
||||
}
|
||||
|
||||
cbm = &cbmodes[static_cast<int>(cbmi->mode)];
|
||||
cbm->setvalue(c, value);
|
||||
@@ -799,17 +816,22 @@ void check_modes(Channel * c)
|
||||
}
|
||||
}
|
||||
} else if (cbmi->getvalue && cbmi->csgetvalue
|
||||
&& ((ci->mlock_on & cbmi->flag)
|
||||
|| (DefConModesOn & cbmi->flag))
|
||||
&& (c->mode & cbmi->flag)) {
|
||||
&& ((ci && (ci->mlock_on & cbmi->flag))
|
||||
|| (DefConModesOn & cbmi->flag))
|
||||
&& (c->mode & cbmi->flag)) {
|
||||
char *value = cbmi->getvalue(c);
|
||||
char *csvalue;
|
||||
|
||||
/* Check if it's a defcon or mlock mode */
|
||||
if (DefConModesOn & cbmi->flag)
|
||||
csvalue = cbmi->csgetvalue(&DefConModesCI);
|
||||
else
|
||||
else if (ci)
|
||||
csvalue = cbmi->csgetvalue(ci);
|
||||
else {
|
||||
csvalue = NULL;
|
||||
if (debug)
|
||||
alog ("Warning: setting modes with unknown origin.");
|
||||
}
|
||||
|
||||
/* Lock and actual values don't match, so fix the mode */
|
||||
if (value && csvalue && strcmp(value, csvalue)) {
|
||||
@@ -828,9 +850,15 @@ void check_modes(Channel * c)
|
||||
if (*(end - 1) == '+')
|
||||
end--;
|
||||
|
||||
modes = c->mode & ci->mlock_off;
|
||||
modes = 0;
|
||||
if (ci) {
|
||||
modes = c->mode & ci->mlock_off;
|
||||
/* Make sure we don't remove a mode just set by defcon.. ~ Viper */
|
||||
if (DefConModesSet)
|
||||
modes &= ~(modes & DefConModesOn);
|
||||
}
|
||||
if (DefConModesSet)
|
||||
modes |= (~c->mode & DefConModesOff);
|
||||
modes |= c->mode & DefConModesOff;
|
||||
|
||||
if (modes) {
|
||||
*end++ = '-';
|
||||
@@ -867,7 +895,7 @@ void check_modes(Channel * c)
|
||||
*end = 0;
|
||||
*end2 = 0;
|
||||
|
||||
ircdproto->SendMode(whosends(ci), c->name, "%s%s", modebuf,
|
||||
ircdproto->SendMode((ci ? whosends(ci) : findbot(s_OperServ)), c->name, "%s%s", modebuf,
|
||||
(end2 == argbuf ? "" : argbuf));
|
||||
}
|
||||
|
||||
@@ -883,7 +911,7 @@ int check_valid_admin(User * user, Channel * chan, int servermode)
|
||||
}
|
||||
|
||||
/* They will be kicked; no need to deop, no need to update our internal struct too */
|
||||
if (chan->ci->flags & CI_VERBOTEN)
|
||||
if (chan->ci->flags & CI_FORBIDDEN)
|
||||
return 0;
|
||||
|
||||
if (servermode && !check_access(user, chan->ci, CA_AUTOPROTECT)) {
|
||||
@@ -915,7 +943,7 @@ int check_valid_op(User * user, Channel * chan, int servermode)
|
||||
return 1;
|
||||
|
||||
/* They will be kicked; no need to deop, no need to update our internal struct too */
|
||||
if (chan->ci->flags & CI_VERBOTEN)
|
||||
if (chan->ci->flags & CI_FORBIDDEN)
|
||||
return 0;
|
||||
|
||||
if (servermode && !check_access(user, chan->ci, CA_AUTOOP)) {
|
||||
@@ -997,7 +1025,7 @@ int check_should_op(User * user, char *chan)
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (!ci || (ci->flags & CI_VERBOTEN) || *chan == '+')
|
||||
if (!ci || (ci->flags & CI_FORBIDDEN) || *chan == '+')
|
||||
return 0;
|
||||
|
||||
if ((ci->flags & CI_SECURE) && !nick_identified(user))
|
||||
@@ -1020,7 +1048,7 @@ int check_should_voice(User * user, char *chan)
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (!ci || (ci->flags & CI_VERBOTEN) || *chan == '+')
|
||||
if (!ci || (ci->flags & CI_FORBIDDEN) || *chan == '+')
|
||||
return 0;
|
||||
|
||||
if ((ci->flags & CI_SECURE) && !nick_identified(user))
|
||||
@@ -1040,7 +1068,7 @@ int check_should_halfop(User * user, char *chan)
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (!ci || (ci->flags & CI_VERBOTEN) || *chan == '+')
|
||||
if (!ci || (ci->flags & CI_FORBIDDEN) || *chan == '+')
|
||||
return 0;
|
||||
|
||||
if (check_access(user, ci, CA_AUTOHALFOP)) {
|
||||
@@ -1058,7 +1086,7 @@ int check_should_owner(User * user, char *chan)
|
||||
char *tmp;
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (!ci || (ci->flags & CI_VERBOTEN) || *chan == '+')
|
||||
if (!ci || (ci->flags & CI_FORBIDDEN) || *chan == '+')
|
||||
return 0;
|
||||
|
||||
if (((ci->flags & CI_SECUREFOUNDER) && is_real_founder(user, ci))
|
||||
@@ -1080,7 +1108,7 @@ int check_should_protect(User * user, char *chan)
|
||||
char *tmp;
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (!ci || (ci->flags & CI_VERBOTEN) || *chan == '+')
|
||||
if (!ci || (ci->flags & CI_FORBIDDEN) || *chan == '+')
|
||||
return 0;
|
||||
|
||||
if (check_access(user, ci, CA_AUTOPROTECT)) {
|
||||
@@ -1096,21 +1124,6 @@ int check_should_protect(User * user, char *chan)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Tiny helper routine to get ChanServ out of a channel after it went in. */
|
||||
|
||||
static void timeout_leave(Timeout * to)
|
||||
{
|
||||
const char *chan = static_cast<const char *>(to->data);
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (ci) /* Check cos the channel may be dropped in the meantime */
|
||||
ci->flags &= ~CI_INHABIT;
|
||||
|
||||
ircdproto->SendPart(findbot(s_ChanServ), chan, NULL);
|
||||
delete [] static_cast<const char *>(to->data);
|
||||
}
|
||||
|
||||
|
||||
/* Check whether a user is permitted to be on a channel. If so, return 0;
|
||||
* else, kickban the user with an appropriate message (could be either
|
||||
* AKICK or restricted access) and return 1. Note that this is called
|
||||
@@ -1131,7 +1144,7 @@ int check_kick(User * user, const char *chan, time_t chants)
|
||||
char buf[BUFSIZE];
|
||||
char mask[BUFSIZE];
|
||||
const char *reason;
|
||||
Timeout *t;
|
||||
ChanServTimer *t;
|
||||
|
||||
if (!ci)
|
||||
return 0;
|
||||
@@ -1139,16 +1152,25 @@ int check_kick(User * user, const char *chan, time_t chants)
|
||||
if (user->isSuperAdmin == 1)
|
||||
return 0;
|
||||
|
||||
if (ci->flags & CI_SUSPENDED || ci->flags & CI_VERBOTEN)
|
||||
/* We don't enforce services restrictions on clients on ulined services
|
||||
* as this will likely lead to kick/rejoin floods. ~ Viper */
|
||||
if (is_ulined(user->server->name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ci->flags & CI_SUSPENDED || ci->flags & CI_FORBIDDEN)
|
||||
{
|
||||
if (is_oper(user))
|
||||
return 0;
|
||||
|
||||
get_idealban(ci, user, mask, sizeof(mask));
|
||||
reason = ci->forbidreason ? ci->forbidreason : getstring(user->na, CHAN_MAY_NOT_BE_USED);
|
||||
reason = ci->forbidreason ? ci->forbidreason : getstring(user, CHAN_MAY_NOT_BE_USED);
|
||||
set_modes = true;
|
||||
goto kick;
|
||||
}
|
||||
|
||||
if (nick_recognized(user))
|
||||
nc = user->na->nc;
|
||||
if (user->IsRecognized())
|
||||
nc = user->nc;
|
||||
else
|
||||
nc = NULL;
|
||||
|
||||
@@ -1182,13 +1204,9 @@ int check_kick(User * user, const char *chan, time_t chants)
|
||||
}
|
||||
}
|
||||
|
||||
if (is_ulined(user->server->name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (check_access(user, ci, CA_NOJOIN)) {
|
||||
get_idealban(ci, user, mask, sizeof(mask));
|
||||
reason = getstring(user->na, CHAN_NOT_ALLOWED_TO_JOIN);
|
||||
reason = getstring(user, CHAN_NOT_ALLOWED_TO_JOIN);
|
||||
goto kick;
|
||||
}
|
||||
|
||||
@@ -1197,7 +1215,7 @@ int check_kick(User * user, const char *chan, time_t chants)
|
||||
kick:
|
||||
if (debug)
|
||||
alog("debug: channel: AutoKicking %s!%s@%s from %s", user->nick,
|
||||
user->username, user->host, chan);
|
||||
user->GetIdent().c_str(), user->host, chan);
|
||||
|
||||
/* Remember that the user has not been added to our channel user list
|
||||
* yet, so we check whether the channel does not exist OR has no user
|
||||
@@ -1215,8 +1233,8 @@ int check_kick(User * user, const char *chan, time_t chants)
|
||||
{
|
||||
ircdproto->SendMode(findbot(s_ChanServ), chan, "+ntsi");
|
||||
}
|
||||
t = add_timeout(CSInhabit, timeout_leave, 0);
|
||||
t->data = sstrdup(chan);
|
||||
|
||||
t = new ChanServTimer(CSInhabit, chan);
|
||||
ci->flags |= CI_INHABIT;
|
||||
}
|
||||
|
||||
@@ -1402,9 +1420,9 @@ void expire_chans()
|
||||
next = ci->next;
|
||||
if (!ci->c && now - ci->last_used >= CSExpire
|
||||
&& !(ci->
|
||||
flags & (CI_VERBOTEN | CI_NO_EXPIRE | CI_SUSPENDED)))
|
||||
flags & (CI_FORBIDDEN | CI_NO_EXPIRE | CI_SUSPENDED)))
|
||||
{
|
||||
send_event(EVENT_CHAN_EXPIRE, 1, ci->name);
|
||||
FOREACH_MOD(I_OnChanExpire, OnChanExpire(ci->name));
|
||||
alog("Expiring channel %s (founder: %s)", ci->name,
|
||||
(ci->founder ? ci->founder->display : "(none)"));
|
||||
delchan(ci);
|
||||
@@ -1430,7 +1448,7 @@ void cs_remove_nick(const NickCore * nc)
|
||||
if (ci->founder == nc) {
|
||||
if (ci->successor) {
|
||||
NickCore *nc2 = ci->successor;
|
||||
if (!nick_is_services_admin(nc2) && CSMaxReg && nc2->channelcount >= CSMaxReg) {
|
||||
if (!nc2->IsServicesOper() && CSMaxReg && nc2->channelcount >= CSMaxReg) {
|
||||
alog("%s: Successor (%s) of %s owns too many channels, " "deleting channel", s_ChanServ, nc2->display, ci->name);
|
||||
delchan(ci);
|
||||
continue;
|
||||
@@ -1458,11 +1476,12 @@ void cs_remove_nick(const NickCore * nc)
|
||||
if (ci->successor == nc)
|
||||
ci->successor = NULL;
|
||||
|
||||
for (ca = ci->access, j = ci->accesscount; j > 0; ca++, j--) {
|
||||
if (ca->in_use && ca->nc == nc) {
|
||||
ca->in_use = 0;
|
||||
ca->nc = NULL;
|
||||
}
|
||||
for (j = ci->access.size(); j > 0; --j)
|
||||
{
|
||||
ca = ci->GetAccess(j - 1);
|
||||
|
||||
if (ca->in_use && ca->nc == nc)
|
||||
ci->EraseAccess(j - 1);
|
||||
}
|
||||
|
||||
for (akick = ci->akick, j = 0; j < ci->akickcount; akick++, j++) {
|
||||
@@ -1576,6 +1595,8 @@ int check_access(User * user, ChannelInfo * ci, int what)
|
||||
if (level > 0)
|
||||
ci->last_used = time(NULL);
|
||||
|
||||
if (what == ACCESS_FOUNDER)
|
||||
return is_founder(user, ci);
|
||||
if (level >= ACCESS_FOUNDER)
|
||||
return (what == CA_AUTODEOP || what == CA_NOJOIN) ? 0 : 1;
|
||||
/* Hacks to make flags work */
|
||||
@@ -1651,7 +1672,7 @@ ChannelInfo *makechan(const char *chan)
|
||||
|
||||
int delchan(ChannelInfo * ci)
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
NickCore *nc;
|
||||
User *u;
|
||||
struct u_chaninfolist *cilist, *cilist_next;
|
||||
@@ -1663,6 +1684,8 @@ int delchan(ChannelInfo * ci)
|
||||
return 0;
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnDelChan, OnDelChan(ci));
|
||||
|
||||
nc = ci->founder;
|
||||
|
||||
if (debug >= 2) {
|
||||
@@ -1745,8 +1768,6 @@ int delchan(ChannelInfo * ci)
|
||||
delete [] ci->forbidby;
|
||||
if (ci->forbidreason)
|
||||
delete [] ci->forbidreason;
|
||||
if (ci->access)
|
||||
free(ci->access);
|
||||
if (debug >= 2) {
|
||||
alog("debug: delchan() top of the akick list");
|
||||
}
|
||||
@@ -1846,9 +1867,9 @@ int is_founder(User * user, ChannelInfo * ci)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (user->na && user->na->nc == ci->founder) {
|
||||
if (user->nc && user->nc == ci->founder) {
|
||||
if ((nick_identified(user)
|
||||
|| (nick_recognized(user) && !(ci->flags & CI_SECURE))))
|
||||
|| (user->IsRecognized() && !(ci->flags & CI_SECURE))))
|
||||
return 1;
|
||||
}
|
||||
if (is_identified(user, ci))
|
||||
@@ -1864,9 +1885,9 @@ int is_real_founder(User * user, ChannelInfo * ci)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (user->na && user->na->nc == ci->founder) {
|
||||
if (user->nc && user->nc == ci->founder) {
|
||||
if ((nick_identified(user)
|
||||
|| (nick_recognized(user) && !(ci->flags & CI_SECURE))))
|
||||
|| (user->IsRecognized() && !(ci->flags & CI_SECURE))))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -1889,26 +1910,6 @@ int is_identified(User * user, ChannelInfo * ci)
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Returns the ChanAccess entry for an user */
|
||||
|
||||
ChanAccess *get_access_entry(NickCore * nc, ChannelInfo * ci)
|
||||
{
|
||||
ChanAccess *access;
|
||||
int i;
|
||||
|
||||
if (!ci || !nc) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (access = ci->access, i = 0; i < ci->accesscount; access++, i++)
|
||||
if (access->in_use && access->nc == nc)
|
||||
return access;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Return the access level the given user has on the channel. If the
|
||||
* channel doesn't exist, the user isn't on the access list, or the channel
|
||||
* is CS_SECURE and the user hasn't IDENTIFY'd with NickServ, return 0. */
|
||||
@@ -1927,12 +1928,12 @@ int get_access(User * user, ChannelInfo * ci)
|
||||
if (is_founder(user, ci))
|
||||
return ACCESS_FOUNDER;
|
||||
|
||||
if (!user->na)
|
||||
if (!user->nc)
|
||||
return 0;
|
||||
|
||||
if (nick_identified(user)
|
||||
|| (nick_recognized(user) && !(ci->flags & CI_SECURE)))
|
||||
if ((access = get_access_entry(user->na->nc, ci)))
|
||||
|| (user->IsRecognized() && !(ci->flags & CI_SECURE)))
|
||||
if ((access = ci->GetAccess(user->nc)))
|
||||
return access->level;
|
||||
|
||||
if (nick_identified(user))
|
||||
@@ -1947,12 +1948,12 @@ void update_cs_lastseen(User * user, ChannelInfo * ci)
|
||||
{
|
||||
ChanAccess *access;
|
||||
|
||||
if (!ci || !user || !user->na)
|
||||
if (!ci || !user || !user->nc)
|
||||
return;
|
||||
|
||||
if (is_founder(user, ci) || nick_identified(user)
|
||||
|| (nick_recognized(user) && !(ci->flags & CI_SECURE)))
|
||||
if ((access = get_access_entry(user->na->nc, ci)))
|
||||
|| (user->IsRecognized() && !(ci->flags & CI_SECURE)))
|
||||
if ((access = ci->GetAccess(user->nc)))
|
||||
access->last_seen = time(NULL);
|
||||
}
|
||||
|
||||
@@ -1968,22 +1969,24 @@ int get_idealban(ChannelInfo * ci, User * u, char *ret, int retlen)
|
||||
if (!ci || !u || !ret || retlen == 0)
|
||||
return 0;
|
||||
|
||||
std::string vident = u->GetIdent();
|
||||
|
||||
switch (ci->bantype) {
|
||||
case 0:
|
||||
snprintf(ret, retlen, "*!%s@%s", common_get_vident(u),
|
||||
common_get_vhost(u));
|
||||
snprintf(ret, retlen, "*!%s@%s", vident.c_str(),
|
||||
u->GetDisplayedHost().c_str());
|
||||
return 1;
|
||||
case 1:
|
||||
snprintf(ret, retlen, "*!%s%s@%s",
|
||||
(strlen(common_get_vident(u)) <
|
||||
(*(common_get_vident(u)) ==
|
||||
'~' ? USERMAX + 1 : USERMAX) ? "*" : ""),
|
||||
(*(common_get_vident(u)) ==
|
||||
'~' ? common_get_vident(u) + 1 : common_get_vident(u)),
|
||||
common_get_vhost(u));
|
||||
if (vident[0] == '~')
|
||||
snprintf(ret, retlen, "*!*%s@%s",
|
||||
vident.c_str(), u->GetDisplayedHost().c_str());
|
||||
else
|
||||
snprintf(ret, retlen, "*!%s@%s",
|
||||
vident.c_str(), u->GetDisplayedHost().c_str());
|
||||
|
||||
return 1;
|
||||
case 2:
|
||||
snprintf(ret, retlen, "*!*@%s", common_get_vhost(u));
|
||||
snprintf(ret, retlen, "*!*@%s", u->GetDisplayedHost().c_str());
|
||||
return 1;
|
||||
case 3:
|
||||
mask = create_mask(u);
|
||||
@@ -2003,7 +2006,10 @@ char *cs_get_flood(ChannelInfo * ci)
|
||||
if (!ci) {
|
||||
return NULL;
|
||||
} else {
|
||||
return ci->mlock_flood;
|
||||
if (ircd->fmode)
|
||||
return ci->mlock_flood;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2043,7 +2049,10 @@ char *cs_get_redirect(ChannelInfo * ci)
|
||||
if (!ci) {
|
||||
return NULL;
|
||||
} else {
|
||||
return ci->mlock_redirect;
|
||||
if (ircd->Lmode)
|
||||
return ci->mlock_redirect;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2124,28 +2133,19 @@ void cs_set_redirect(ChannelInfo * ci, const char *value)
|
||||
int get_access_level(ChannelInfo * ci, NickAlias * na)
|
||||
{
|
||||
ChanAccess *access;
|
||||
int num;
|
||||
|
||||
if (!ci || !na) {
|
||||
if (!ci || !na)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (na->nc == ci->founder) {
|
||||
if (na->nc == ci->founder)
|
||||
return ACCESS_FOUNDER;
|
||||
}
|
||||
|
||||
for (num = 0; num < ci->accesscount; num++) {
|
||||
|
||||
access = &ci->access[num];
|
||||
|
||||
if (access->nc && access->nc == na->nc && access->in_use) {
|
||||
return access->level;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
access = ci->GetAccess(na->nc);
|
||||
|
||||
if (!access)
|
||||
return 0;
|
||||
else
|
||||
return access->level;
|
||||
}
|
||||
|
||||
const char *get_xop_level(int level)
|
||||
@@ -2200,11 +2200,11 @@ AutoKick *is_stuck(ChannelInfo * ci, const char *mask)
|
||||
|| !(akick->flags & AK_STUCK))
|
||||
continue;
|
||||
/* Example: mask = *!*@*.org and akick->u.mask = *!*@*.anope.org */
|
||||
if (match_wild_nocase(mask, akick->u.mask))
|
||||
if (Anope::Match(akick->u.mask, mask, false))
|
||||
return akick;
|
||||
if (ircd->reversekickcheck) {
|
||||
/* Example: mask = *!*@irc.anope.org and akick->u.mask = *!*@*.anope.org */
|
||||
if (match_wild_nocase(akick->u.mask, mask))
|
||||
if (Anope::Match(mask, akick->u.mask, false))
|
||||
return akick;
|
||||
}
|
||||
}
|
||||
@@ -2238,7 +2238,7 @@ void stick_mask(ChannelInfo * ci, AutoKick * akick)
|
||||
if (ircd->reversekickcheck) {
|
||||
/* If akick is wider than a ban already in place.
|
||||
Example: c->bans[i] = *!*@irc.epona.org and akick->u.mask = *!*@*.epona.org */
|
||||
if (match_wild_nocase(akick->u.mask, ban->mask))
|
||||
if (Anope::Match(ban->mask, akick->u.mask, false))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2009 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
#include "services.h"
|
||||
#include "modules.h"
|
||||
|
||||
Command::Command(const std::string &sname, size_t min_params, size_t max_params, const std::string &spermission) : MaxParams(max_params), MinParams(min_params), name(sname), permission(spermission)
|
||||
{
|
||||
this->flags = 0;
|
||||
this->core = 0;
|
||||
this->mod_name = NULL;
|
||||
this->service = NULL;
|
||||
this->next = NULL;
|
||||
}
|
||||
|
||||
Command::~Command()
|
||||
{
|
||||
if (this->mod_name) {
|
||||
delete [] this->mod_name;
|
||||
}
|
||||
if (this->service) {
|
||||
delete [] this->service;
|
||||
}
|
||||
}
|
||||
|
||||
CommandReturn Command::Execute(User *u, std::vector<ci::string> &) { return MOD_CONT; }
|
||||
|
||||
bool Command::OnHelp(User *u, const ci::string &subcommand) { return false; }
|
||||
|
||||
void Command::OnSyntaxError(User *u) { }
|
||||
|
||||
void Command::SetFlag(CommandFlags flag)
|
||||
{
|
||||
this->flags |= flag;
|
||||
}
|
||||
|
||||
void Command::UnsetFlag(CommandFlags flag)
|
||||
{
|
||||
this->flags &= ~flag;
|
||||
}
|
||||
|
||||
bool Command::HasFlag(CommandFlags flag) const
|
||||
{
|
||||
return this->flags & flag;
|
||||
}
|
||||
|
||||
void Command::SetPermission(const std::string &reststr)
|
||||
{
|
||||
this->permission = reststr;
|
||||
}
|
||||
|
||||
+146
-113
@@ -15,6 +15,7 @@
|
||||
#include "services.h"
|
||||
#include "commands.h"
|
||||
#include "language.h"
|
||||
#include "hashcomp.h"
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
@@ -29,8 +30,8 @@ Command *lookup_cmd(Command * list, char *cmd)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
for (c = list; c->name; c++) {
|
||||
if (stricmp(c->name, cmd) == 0) {
|
||||
for (c = list; ; c++) {
|
||||
if (stricmp(c->name.c_str(), cmd) == 0) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
@@ -48,65 +49,132 @@ Command *lookup_cmd(Command * list, char *cmd)
|
||||
* @param cmd Command
|
||||
* @return void
|
||||
*/
|
||||
void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[],
|
||||
const char *cmd)
|
||||
void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *cmd)
|
||||
{
|
||||
Command *c = findCommand(cmdTable, cmd);
|
||||
int retVal = 0;
|
||||
Command *current;
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (c && c->routine) {
|
||||
if ((checkDefCon(DEFCON_OPER_ONLY)
|
||||
|| checkDefCon(DEFCON_SILENT_OPER_ONLY)) && !is_oper(u)) {
|
||||
if (!checkDefCon(DEFCON_SILENT_OPER_ONLY)) {
|
||||
notice_lang(service, u, OPER_DEFCON_DENIED);
|
||||
}
|
||||
} else {
|
||||
if ((c->has_priv == NULL) || c->has_priv(u)) {
|
||||
retVal = c->routine(u);
|
||||
if (retVal == MOD_CONT) {
|
||||
current = c->next;
|
||||
while (current && retVal == MOD_CONT) {
|
||||
retVal = current->routine(u);
|
||||
current = current->next;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notice_lang(service, u, ACCESS_DENIED);
|
||||
alog("Access denied for %s with service %s and command %s",
|
||||
u->nick, service, cmd);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u)) {
|
||||
if (!c)
|
||||
{
|
||||
if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u))
|
||||
{
|
||||
notice_lang(service, u, UNKNOWN_COMMAND_HELP, cmd, service);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
if ((checkDefCon(DEFCON_OPER_ONLY) || checkDefCon(DEFCON_SILENT_OPER_ONLY)) && !is_oper(u))
|
||||
{
|
||||
if (!checkDefCon(DEFCON_SILENT_OPER_ONLY))
|
||||
{
|
||||
notice_lang(service, u, OPER_DEFCON_DENIED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the 'Limited to' line for the given command
|
||||
* @param service Services Client
|
||||
* @param u User Struct
|
||||
* @param c Command Struct
|
||||
* @return void
|
||||
*/
|
||||
void do_help_limited(char *service, User * u, Command * c)
|
||||
{
|
||||
if (c->has_priv == is_services_oper)
|
||||
notice_lang(service, u, HELP_LIMIT_SERV_OPER);
|
||||
else if (c->has_priv == is_services_admin)
|
||||
notice_lang(service, u, HELP_LIMIT_SERV_ADMIN);
|
||||
else if (c->has_priv == is_services_root)
|
||||
notice_lang(service, u, HELP_LIMIT_SERV_ROOT);
|
||||
else if (c->has_priv == is_oper)
|
||||
notice_lang(service, u, HELP_LIMIT_IRC_OPER);
|
||||
else if (c->has_priv == is_host_setter)
|
||||
notice_lang(service, u, HELP_LIMIT_HOST_SETTER);
|
||||
else if (c->has_priv == is_host_remover)
|
||||
notice_lang(service, u, HELP_LIMIT_HOST_REMOVER);
|
||||
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED))
|
||||
{
|
||||
// Command requires registered users only
|
||||
if (!nick_identified(u))
|
||||
{
|
||||
notice_lang(service, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
|
||||
alog("Access denied for unregistered user %s with service %s and command %s", u->nick, service, cmd);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check whether or not access string is empty
|
||||
}
|
||||
|
||||
std::vector<ci::string> params;
|
||||
std::string curparam;
|
||||
char *s = NULL;
|
||||
while ((s = strtok(NULL, " ")))
|
||||
{
|
||||
// - 1 because params[0] corresponds with a maxparam of 1.
|
||||
if (params.size() >= (c->MaxParams - 1))
|
||||
{
|
||||
curparam += s;
|
||||
curparam += " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
params.push_back(s);
|
||||
}
|
||||
}
|
||||
|
||||
if (!curparam.empty())
|
||||
{
|
||||
// Remove trailing space
|
||||
curparam.erase(curparam.size() - 1, curparam.size());
|
||||
|
||||
// Add it
|
||||
params.push_back(curparam.c_str());
|
||||
}
|
||||
|
||||
if (params.size() < c->MinParams)
|
||||
{
|
||||
c->OnSyntaxError(u);
|
||||
return;
|
||||
}
|
||||
|
||||
EventReturn MOD_RESULT = EVENT_CONTINUE;
|
||||
FOREACH_RESULT(I_OnPreCommand, OnPreCommand(u, c->service, c->name.c_str(), params));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (params.size() > 0 && !c->HasFlag(CFLAG_STRIP_CHANNEL) && (cmdTable == CHANSERV || cmdTable == BOTSERV))
|
||||
{
|
||||
if (ircdproto->IsChannelValid(params[0].c_str()))
|
||||
{
|
||||
if ((ci = cs_findchan(params[0].c_str())))
|
||||
{
|
||||
if ((ci->flags & CI_FORBIDDEN) && (!c->HasFlag(CFLAG_ALLOW_FORBIDDEN)))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
|
||||
alog("Access denied for user %s with service %s and command %s because of FORBIDDEN channel %s",
|
||||
u->nick, service, cmd, ci->name);
|
||||
return;
|
||||
}
|
||||
else if ((ci->flags & CI_SUSPENDED) && (!c->HasFlag(CFLAG_ALLOW_SUSPENDED)))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
|
||||
alog("Access denied for user %s with service %s and command %s because of SUSPENDED channel %s",
|
||||
u->nick, service, cmd, ci->name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL))
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* A user not giving a channel name for a param that should be a channel */
|
||||
else
|
||||
{
|
||||
notice_lang(service, u, CHAN_X_INVALID, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If the command requires a permission, and they aren't registered or don't have the required perm, DENIED
|
||||
if (!c->permission.empty())
|
||||
{
|
||||
if (!u->nc->HasPriv(c->permission) && !u->nc->HasCommand(c->permission))
|
||||
{
|
||||
notice_lang(service, u, ACCESS_DENIED);
|
||||
alog("Access denied for user %s with service %s and command %s", u->nick, service, cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
retVal = c->Execute(u, params);
|
||||
|
||||
FOREACH_MOD(I_OnPostCommand, OnPostCommand(u, c->service, c->name.c_str(), params));
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -119,70 +187,35 @@ void do_help_limited(char *service, User * u, Command * c)
|
||||
* @param cmd Command
|
||||
* @return void
|
||||
*/
|
||||
void mod_help_cmd(char *service, User * u, CommandHash * cmdTable[],
|
||||
const char *cmd)
|
||||
void mod_help_cmd(char *service, User * u, CommandHash * cmdTable[], const char *cmd)
|
||||
{
|
||||
Command *c = findCommand(cmdTable, cmd);
|
||||
Command *current;
|
||||
int has_had_help = 0;
|
||||
int cont = MOD_CONT;
|
||||
const char *p1 = NULL, *p2 = NULL, *p3 = NULL, *p4 = NULL;
|
||||
spacesepstream tokens(cmd);
|
||||
std::string token;
|
||||
tokens.GetToken(token);
|
||||
|
||||
for (current = c; (current) && (cont == MOD_CONT);
|
||||
current = current->next) {
|
||||
p1 = current->help_param1;
|
||||
p2 = current->help_param2;
|
||||
p3 = current->help_param3;
|
||||
p4 = current->help_param4;
|
||||
if (current->helpmsg_all >= 0) {
|
||||
notice_help(service, u, current->helpmsg_all, p1, p2, p3, p4);
|
||||
has_had_help = 1;
|
||||
} else if (current->all_help) {
|
||||
cont = current->all_help(u);
|
||||
has_had_help = 1;
|
||||
}
|
||||
if (is_services_root(u)) {
|
||||
if (current->helpmsg_root >= 0) {
|
||||
notice_help(service, u, current->helpmsg_root, p1, p2, p3,
|
||||
p4);
|
||||
has_had_help = 1;
|
||||
} else if (current->root_help) {
|
||||
cont = current->root_help(u);
|
||||
has_had_help = 1;
|
||||
}
|
||||
} else if (is_services_admin(u)) {
|
||||
if (current->helpmsg_admin >= 0) {
|
||||
notice_help(service, u, current->helpmsg_admin, p1, p2, p3,
|
||||
p4);
|
||||
has_had_help = 1;
|
||||
} else if (current->admin_help) {
|
||||
cont = current->admin_help(u);
|
||||
has_had_help = 1;
|
||||
}
|
||||
} else if (is_services_oper(u)) {
|
||||
if (current->helpmsg_oper >= 0) {
|
||||
notice_help(service, u, current->helpmsg_oper, p1, p2, p3,
|
||||
p4);
|
||||
has_had_help = 1;
|
||||
} else if (current->oper_help) {
|
||||
cont = current->oper_help(u);
|
||||
has_had_help = 1;
|
||||
}
|
||||
} else {
|
||||
if (current->helpmsg_reg >= 0) {
|
||||
notice_help(service, u, current->helpmsg_reg, p1, p2, p3,
|
||||
p4);
|
||||
has_had_help = 1;
|
||||
} else if (current->regular_help) {
|
||||
cont = current->regular_help(u);
|
||||
has_had_help = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (has_had_help == 0) {
|
||||
Command *c = findCommand(cmdTable, token.c_str());
|
||||
|
||||
ci::string subcommand = tokens.StreamEnd() ? "" : tokens.GetRemaining().c_str();
|
||||
|
||||
if (!c || !c->OnHelp(u, subcommand))
|
||||
notice_lang(service, u, NO_HELP_AVAILABLE, cmd);
|
||||
} else {
|
||||
do_help_limited(service, u, c);
|
||||
else
|
||||
{
|
||||
u->SendMessage(service, " ");
|
||||
|
||||
/* Inform the user what permission is required to use the command */
|
||||
if (!c->permission.empty())
|
||||
notice_lang(service, u, COMMAND_REQUIRES_PERM, c->permission.c_str());
|
||||
|
||||
/* User isn't identified and needs to be to use this command */
|
||||
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !nick_identified(u))
|
||||
notice_lang(service, u, COMMAND_IDENTIFY_REQUIRED);
|
||||
/* User doesn't have the proper permission to use this command */
|
||||
else if (!c->permission.empty() && (!u->nc || (!u->nc->HasCommand(c->permission))))
|
||||
notice_lang(service, u, COMMAND_CANNOT_USE);
|
||||
/* User can use this command */
|
||||
else
|
||||
notice_lang(service, u, COMMAND_CAN_USE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+616
-376
File diff suppressed because it is too large
Load Diff
+12
-4
@@ -21,7 +21,7 @@ ConfigReader::~ConfigReader()
|
||||
{
|
||||
if (this->errorlog)
|
||||
delete this->errorlog;
|
||||
if(this->privatehash)
|
||||
if (this->privatehash)
|
||||
delete this->data;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ std::string ConfigReader::ReadValue(const std::string &tag, const std::string &n
|
||||
{
|
||||
/* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */
|
||||
std::string result;
|
||||
if (!serverConfig.ConfValue(*this->data, tag, name, default_value, index, result, allow_linefeeds)) this->error = CONF_VALUE_NOT_FOUND;
|
||||
|
||||
if (!serverConfig.ConfValue(*this->data, tag, name, default_value, index, result, allow_linefeeds))
|
||||
this->error = CONF_VALUE_NOT_FOUND;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -56,14 +59,19 @@ bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, int
|
||||
int ConfigReader::ReadInteger(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool need_positive)
|
||||
{
|
||||
int result;
|
||||
if (!serverConfig.ConfValueInteger(*this->data, tag, name, default_value, index, result)) {
|
||||
|
||||
if (!serverConfig.ConfValueInteger(*this->data, tag, name, default_value, index, result))
|
||||
{
|
||||
this->error = CONF_VALUE_NOT_FOUND;
|
||||
return 0;
|
||||
}
|
||||
if (need_positive && result < 0) {
|
||||
|
||||
if (need_positive && result < 0)
|
||||
{
|
||||
this->error = CONF_INT_NEGATIVE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+17
-4
@@ -2,9 +2,7 @@
|
||||
file(GLOB CORE_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
|
||||
file(GLOB CORE_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
|
||||
set(CORE_SRCS ${CORE_SRCS_C} ${CORE_SRCS_CPP})
|
||||
if(CMAKE244_OR_BETTER)
|
||||
list(SORT CORE_SRCS)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
sort_list(CORE_SRCS)
|
||||
|
||||
# If using Windows, add the MODULE_COMPILE define
|
||||
if(WIN32)
|
||||
@@ -14,12 +12,21 @@ endif(WIN32)
|
||||
# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though)
|
||||
set_source_files_properties(${CORE_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
|
||||
|
||||
# Create an empty list to store extra include directories
|
||||
set(EXTRA_INCLUDES)
|
||||
|
||||
# Iterate through all the source files
|
||||
foreach(SRC ${CORE_SRCS})
|
||||
# Convert the source file extension to have a .so extension
|
||||
string(REGEX REPLACE "\\.(c|cpp)$" ".so" SO ${SRC})
|
||||
# Temporary variable for the current source's include directories
|
||||
set(TEMP_INCLUDES)
|
||||
# Calculate the header file dependencies for the given source file
|
||||
calculate_depends(${SRC})
|
||||
calculate_depends(${SRC} TEMP_INCLUDES)
|
||||
# If there were some extra include directories, add them to the list
|
||||
if(TEMP_INCLUDES)
|
||||
append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
|
||||
endif(TEMP_INCLUDES)
|
||||
# For Visual Studio only, include win32_memory.cpp to the list of sources, required to override Visual Studio's overrides of the new/delete operators
|
||||
if(MSVC)
|
||||
append_to_list(SRC ${Anope_SOURCE_DIR}/src/win32_memory.cpp)
|
||||
@@ -39,3 +46,9 @@ foreach(SRC ${CORE_SRCS})
|
||||
DESTINATION data/modules
|
||||
)
|
||||
endforeach(SRC)
|
||||
|
||||
# If there were extra include directories, remove the duplicates and add the directories to the include path
|
||||
if(EXTRA_INCLUDES)
|
||||
remove_list_duplicates(EXTRA_INCLUDES)
|
||||
include_directories(${EXTRA_INCLUDES})
|
||||
endif(EXTRA_INCLUDES)
|
||||
|
||||
+9
-14
@@ -8,29 +8,24 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
|
||||
'PROFILE=${PROFILE}' 'SHARED=${SHARED}' \
|
||||
'MODULEFLAGS=${MODULEFLAGS}' 'MAKEBIN=${MAKEBIN}'
|
||||
|
||||
OBJECTS= $(SRCS:.c=.o)
|
||||
OBJECTS+= $(SRCS:.cpp=.o)
|
||||
SO_FILES=$(OBJECTS:.o=.s)
|
||||
OBJECTS= $(SRCS:.c=.so)
|
||||
OBJECTS+= $(SRCS:.cpp=.so)
|
||||
CDEFS= -rdynamic -Wall
|
||||
|
||||
all: modules subs
|
||||
|
||||
modules: $(OBJECTS) $(SO_FILES)
|
||||
modules: $(OBJECTS)
|
||||
|
||||
install:
|
||||
$(CP) ./*.so $(INSTDIR)/data/modules
|
||||
|
||||
distclean: spotless
|
||||
|
||||
.c.o:
|
||||
@$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $<
|
||||
%.so: %.c
|
||||
$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -o $*.so $*.c
|
||||
|
||||
.cpp.o:
|
||||
@$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $<
|
||||
|
||||
.o.s:
|
||||
@$(MAKEBIN) $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE}
|
||||
@$(TOUCH) $*.s
|
||||
%.so: %.cpp
|
||||
$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -o $*.so $*.cpp
|
||||
|
||||
subs:
|
||||
@for i in $(SUBS); do \
|
||||
@@ -43,8 +38,8 @@ subs_clean:
|
||||
(cd $$i; $(MAKE) clean); done
|
||||
|
||||
clean: subs_clean
|
||||
rm -f *.o *.s *.so *.c~ core
|
||||
rm -f *.so
|
||||
|
||||
spotless: subs_clean
|
||||
rm -f *.o *.s *.so *.c~ core *.so Makefile.inc
|
||||
rm -f *.so Makefile.inc
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ so:
|
||||
$(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE}
|
||||
|
||||
clean:
|
||||
rm -f *.o *.so *.c~ core
|
||||
rm -f *.so
|
||||
|
||||
spotless: clean
|
||||
rm -f *~ *.o *.so *.c~ core
|
||||
rm -f *.so
|
||||
|
||||
|
||||
+57
-54
@@ -15,69 +15,72 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_act(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
class CommandBSAct : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSAct() : Command("ACT", 2, 2)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(params[0].c_str());
|
||||
|
||||
if (!check_access(u, ci, CA_SAY))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!ci->bi)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!ci->c || ci->c->usercount < BSMinUsers)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
while ((i = params[1].find_first_of("\001"), i) && i != std::string::npos)
|
||||
params[1].erase(i, 1);
|
||||
|
||||
ircdproto->SendAction(ci->bi, ci->name, "%s", params[1].c_str());
|
||||
ci->bi->lastmsg = time(NULL);
|
||||
if (LogBot && LogChannel && logchan && !debug && findchan(LogChannel))
|
||||
ircdproto->SendPrivmsg(ci->bi, LogChannel, "ACT %s %s %s", u->nick, ci->name, params[1].c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "ACT", BOT_ACT_SYNTAX);
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_ACT);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSAct : public Module
|
||||
{
|
||||
public:
|
||||
BSAct(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("ACT", do_act, NULL, BOT_HELP_ACT, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSAct());
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_ACT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_ACT);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs act command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_act(User * u)
|
||||
{
|
||||
ChannelInfo *ci;
|
||||
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *text = strtok(NULL, "");
|
||||
|
||||
if (!chan || !text)
|
||||
syntax_error(s_BotServ, u, "ACT", BOT_ACT_SYNTAX);
|
||||
else if (!(ci = cs_findchan(chan)))
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_VERBOTEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
else if (!ci->c || ci->c->usercount < BSMinUsers)
|
||||
notice_lang(s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name);
|
||||
else if (!check_access(u, ci, CA_SAY))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else {
|
||||
strnrepl(text, BUFSIZE, "\001", "");
|
||||
ircdproto->SendAction(ci->bi, ci->name, "%s", text);
|
||||
ci->bi->lastmsg = time(NULL);
|
||||
if (LogBot && LogChannel && logchan && !debug && findchan(LogChannel))
|
||||
ircdproto->SendPrivmsg(ci->bi, LogChannel, "ACT %s %s %s",
|
||||
u->nick, ci->name, text);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_act", BSAct)
|
||||
MODULE_INIT(BSAct)
|
||||
|
||||
+68
-54
@@ -15,69 +15,83 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_assign(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
class CommandBSAssign : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSAssign() : Command("ASSIGN", 2, 2)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
const char *nick = params[1].c_str();
|
||||
BotInfo *bi;
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_READONLY);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!(bi = findbot(nick)))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
ci = cs_findchan(chan);
|
||||
|
||||
if ((ci->botflags & BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->nc->HasPriv("botserv/administration")))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (bi->flags & BI_PRIVATE && !u->nc->HasCommand("botserv/assign/private"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if ((ci->bi) && (stricmp(ci->bi->nick, nick) == 0))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_ALREADY, ci->bi->nick, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bi->Assign(u, ci);
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick, ci->name);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_ASSIGN);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class BSAssign : public Module
|
||||
{
|
||||
public:
|
||||
BSAssign(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("ASSIGN", do_assign, NULL, BOT_HELP_ASSIGN, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSAssign);
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_ASSIGN);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_ASSIGN);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs assign command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_assign(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *nick = strtok(NULL, " ");
|
||||
BotInfo *bi;
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_READONLY);
|
||||
else if (!chan || !nick)
|
||||
syntax_error(s_BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX);
|
||||
else if (!(bi = findbot(nick)))
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, nick);
|
||||
else if (bi->flags & BI_PRIVATE && !is_oper(u))
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
else if (!(ci = cs_findchan(chan)))
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_VERBOTEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if ((ci->bi) && (stricmp(ci->bi->nick, nick) == 0))
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_ALREADY, ci->bi->nick, chan);
|
||||
else if ((ci->botflags & BS_NOBOT)
|
||||
|| (!check_access(u, ci, CA_ASSIGN) && !is_services_admin(u)))
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
else {
|
||||
bi->Assign(u, ci);
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick, ci->name);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_assign", BSAssign)
|
||||
MODULE_INIT(BSAssign)
|
||||
|
||||
+172
-129
@@ -15,80 +15,64 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_badwords(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
int badwords_del_callback(User * u, int num, va_list args);
|
||||
int badwords_list(User * u, int index, ChannelInfo * ci, int *sent_header);
|
||||
int badwords_list_callback(User * u, int num, va_list args);
|
||||
|
||||
class BSBadwords : public Module
|
||||
class CommandBSBadwords : public Command
|
||||
{
|
||||
public:
|
||||
BSBadwords(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
private:
|
||||
CommandReturn DoList(User *u, ChannelInfo *ci, const char *word)
|
||||
{
|
||||
Command *c;
|
||||
int sent_header = 0;
|
||||
int i = 0;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
if (ci->bwcount == 0)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, ci->name);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (word && strspn(word, "1234567890,-") == strlen(word))
|
||||
{
|
||||
process_numlist(word, NULL, badwords_list_callback, u, ci, &sent_header);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < ci->bwcount; i++)
|
||||
{
|
||||
if (!(ci->badwords[i].in_use))
|
||||
continue;
|
||||
if (word && ci->badwords[i].word
|
||||
&& !Anope::Match(ci->badwords[i].word, word, false))
|
||||
continue;
|
||||
badwords_list(u, i, ci, &sent_header);
|
||||
}
|
||||
}
|
||||
if (!sent_header)
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name);
|
||||
|
||||
c = createCommand("BADWORDS", do_badwords, NULL, BOT_HELP_BADWORDS, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
return MOD_CONT;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BADWORDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs badwords command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_badwords(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *cmd = strtok(NULL, " ");
|
||||
char *word = strtok(NULL, "");
|
||||
ChannelInfo *ci;
|
||||
BadWord *bw;
|
||||
|
||||
unsigned i;
|
||||
int need_args = (cmd
|
||||
&& (!stricmp(cmd, "LIST") || !stricmp(cmd, "CLEAR")));
|
||||
|
||||
if (!cmd || (need_args ? 0 : !word)) {
|
||||
syntax_error(s_BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX);
|
||||
} else if (!(ci = cs_findchan(chan))) {
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (!check_access(u, ci, CA_BADWORDS)
|
||||
&& (!need_args || !is_services_admin(u))) {
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
} else if (stricmp(cmd, "ADD") == 0) {
|
||||
|
||||
CommandReturn DoAdd(User *u, ChannelInfo *ci, const char *word)
|
||||
{
|
||||
char *opt, *pos;
|
||||
int type = BW_ANY;
|
||||
unsigned i = 0;
|
||||
BadWord *bw;
|
||||
|
||||
if (readonly) {
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
pos = strrchr(word, ' ');
|
||||
if (pos) {
|
||||
pos = strrchr(const_cast<char *>(word), ' '); // XXX - Potentially unsafe cast
|
||||
if (pos)
|
||||
{
|
||||
opt = pos + 1;
|
||||
if (*opt) {
|
||||
if (*opt)
|
||||
{
|
||||
if (!stricmp(opt, "SINGLE"))
|
||||
type = BW_SINGLE;
|
||||
else if (!stricmp(opt, "START"))
|
||||
@@ -100,26 +84,33 @@ int do_badwords(User * u)
|
||||
}
|
||||
}
|
||||
|
||||
for (bw = ci->badwords, i = 0; i < ci->bwcount; bw++, i++) {
|
||||
for (bw = ci->badwords, i = 0; i < ci->bwcount; bw++, i++)
|
||||
{
|
||||
if (bw->word && ((BSCaseSensitive && (!strcmp(bw->word, word)))
|
||||
|| (!BSCaseSensitive
|
||||
&& (!stricmp(bw->word, word))))) {
|
||||
&& (!stricmp(bw->word, word)))))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_ALREADY_EXISTS,
|
||||
bw->word, ci->name);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ci->bwcount; i++) {
|
||||
for (i = 0; i < ci->bwcount; i++)
|
||||
{
|
||||
if (!ci->badwords[i].in_use)
|
||||
break;
|
||||
}
|
||||
if (i == ci->bwcount) {
|
||||
if (i < BSBadWordsMax) {
|
||||
if (i == ci->bwcount)
|
||||
{
|
||||
if (i < BSBadWordsMax)
|
||||
{
|
||||
ci->bwcount++;
|
||||
ci->badwords =
|
||||
static_cast<BadWord *>(srealloc(ci->badwords, sizeof(BadWord) * ci->bwcount));
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_REACHED_LIMIT,
|
||||
BSBadWordsMax);
|
||||
return MOD_CONT;
|
||||
@@ -131,50 +122,57 @@ int do_badwords(User * u)
|
||||
bw->type = type;
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_ADDED, bw->word, ci->name);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
} else if (stricmp(cmd, "DEL") == 0) {
|
||||
CommandReturn DoDelete(User *u, ChannelInfo *ci, const char *word)
|
||||
{
|
||||
int deleted = 0, a, b;
|
||||
|
||||
if (readonly) {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
int i;
|
||||
BadWord *bw;
|
||||
|
||||
/* Special case: is it a number/list? Only do search if it isn't. */
|
||||
if (isdigit(*word) && strspn(word, "1234567890,-") == strlen(word)) {
|
||||
if (isdigit(*word) && strspn(word, "1234567890,-") == strlen(word))
|
||||
{
|
||||
int count, last = -1;
|
||||
deleted =
|
||||
process_numlist(word, &count, badwords_del_callback, u, ci,
|
||||
&last);
|
||||
if (!deleted) {
|
||||
if (count == 1) {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NO_SUCH_ENTRY,
|
||||
last, ci->name);
|
||||
} else {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NO_MATCH,
|
||||
ci->name);
|
||||
deleted = process_numlist(word, &count, badwords_del_callback, u, ci, &last);
|
||||
if (!deleted)
|
||||
{
|
||||
if (count == 1)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NO_SUCH_ENTRY, last, ci->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name);
|
||||
}
|
||||
} else if (deleted == 1) {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED_ONE,
|
||||
ci->name);
|
||||
} else {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL,
|
||||
deleted, ci->name);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < ci->bwcount; i++) {
|
||||
if (ci->badwords[i].in_use
|
||||
&& !stricmp(ci->badwords[i].word, word))
|
||||
else if (deleted == 1)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED_ONE, ci->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL, deleted, ci->name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (i = 0; i < ci->bwcount; i++)
|
||||
{
|
||||
if (ci->badwords[i].in_use && !stricmp(ci->badwords[i].word, word))
|
||||
break;
|
||||
}
|
||||
if (i == ci->bwcount) {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NOT_FOUND, word,
|
||||
chan);
|
||||
|
||||
if (i == ci->bwcount)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NOT_FOUND, word, ci->name);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bw = &ci->badwords[i];
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED, bw->word,
|
||||
ci->name);
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED, bw->word, ci->name);
|
||||
if (bw->word)
|
||||
delete [] bw->word;
|
||||
bw->word = NULL;
|
||||
@@ -205,8 +203,8 @@ int do_badwords(User * u)
|
||||
}
|
||||
/* After reordering only the entries at the end could still be empty.
|
||||
* We ll free the places no longer in use... - Viper */
|
||||
for (int j = ci->bwcount - 1; j >= 0; j--) {
|
||||
if (ci->badwords[j].in_use)
|
||||
for (i = ci->bwcount - 1; i >= 0; i--) {
|
||||
if (ci->badwords[i].in_use)
|
||||
break;
|
||||
ci->bwcount--;
|
||||
}
|
||||
@@ -214,36 +212,12 @@ int do_badwords(User * u)
|
||||
static_cast<BadWord *>(srealloc(ci->badwords,sizeof(BadWord) * ci->bwcount));
|
||||
}
|
||||
|
||||
} else if (stricmp(cmd, "LIST") == 0) {
|
||||
int sent_header = 0;
|
||||
|
||||
if (ci->bwcount == 0) {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (word && strspn(word, "1234567890,-") == strlen(word)) {
|
||||
process_numlist(word, NULL, badwords_list_callback, u, ci,
|
||||
&sent_header);
|
||||
} else {
|
||||
for (i = 0; i < ci->bwcount; i++) {
|
||||
if (!(ci->badwords[i].in_use))
|
||||
continue;
|
||||
if (word && ci->badwords[i].word
|
||||
&& !match_wild_nocase(word, ci->badwords[i].word))
|
||||
continue;
|
||||
badwords_list(u, i, ci, &sent_header);
|
||||
}
|
||||
}
|
||||
if (!sent_header)
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_NO_MATCH, chan);
|
||||
|
||||
} else if (stricmp(cmd, "CLEAR") == 0) {
|
||||
|
||||
if (readonly) {
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
CommandReturn DoClear(User *u, ChannelInfo *ci, const char *word)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ci->bwcount; i++)
|
||||
if (ci->badwords[i].word)
|
||||
delete [] ci->badwords[i].word;
|
||||
@@ -253,12 +227,81 @@ int do_badwords(User * u)
|
||||
ci->bwcount = 0;
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_CLEAR);
|
||||
return MOD_CONT;
|
||||
}
|
||||
public:
|
||||
CommandBSBadwords() : Command("BADWORDS", 2, 3)
|
||||
{
|
||||
}
|
||||
|
||||
} else {
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ci::string cmd = params[1];
|
||||
const char *word = params.size() > 2 ? params[2].c_str() : NULL;
|
||||
ChannelInfo *ci;
|
||||
bool need_args = cmd == "LIST" || cmd == "CLEAR";
|
||||
|
||||
if (need_args ? 0 : !word)
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
ci = cs_findchan(chan);
|
||||
|
||||
if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !u->nc->HasPriv("botserv/administration")))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BADWORDS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (cmd == "ADD")
|
||||
return this->DoAdd(u, ci, word);
|
||||
else if (cmd == "DEL")
|
||||
return this->DoDelete(u, ci, word);
|
||||
else if (cmd == "LIST")
|
||||
return this->DoList(u, ci, word);
|
||||
else if (cmd == "CLEAR")
|
||||
return this->DoClear(u, ci, word);
|
||||
else
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_BADWORDS);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
};
|
||||
|
||||
class BSBadwords : public Module
|
||||
{
|
||||
public:
|
||||
BSBadwords(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
this->AddCommand(BOTSERV, new CommandBSBadwords);
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BADWORDS);
|
||||
}
|
||||
};
|
||||
|
||||
int badwords_del_callback(User * u, int num, va_list args)
|
||||
{
|
||||
@@ -311,4 +354,4 @@ int badwords_list_callback(User * u, int num, va_list args)
|
||||
return badwords_list(u, num - 1, ci, sent_header);
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_badwords", BSBadwords)
|
||||
MODULE_INIT(BSBadwords)
|
||||
|
||||
+158
-104
@@ -15,72 +15,21 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_bot(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
|
||||
class BSBot : public Module
|
||||
class CommandBSBot : public Command
|
||||
{
|
||||
public:
|
||||
BSBot(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
private:
|
||||
CommandReturn DoAdd(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("BOT", do_bot, is_services_admin, -1, -1, -1, BOT_SERVADMIN_HELP_BOT, BOT_SERVADMIN_HELP_BOT);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
if (is_services_admin(u)) {
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BOT);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs bot command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_bot(User * u)
|
||||
{
|
||||
BotInfo *bi;
|
||||
char *cmd = strtok(NULL, " ");
|
||||
char *ch = NULL;
|
||||
|
||||
if (!cmd)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "BOT", BOT_BOT_SYNTAX);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BOT_READONLY);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!stricmp(cmd, "ADD"))
|
||||
{
|
||||
char *nick = strtok(NULL, " ");
|
||||
char *user = strtok(NULL, " ");
|
||||
char *host = strtok(NULL, " ");
|
||||
char *real = strtok(NULL, "");
|
||||
const char *nick = params[1].c_str();
|
||||
const char *user = params.size() > 2 ? params[2].c_str() : NULL;
|
||||
const char *host = params.size() > 3 ? params[3].c_str() : NULL;
|
||||
const char *real = params.size() > 4 ? params[4].c_str() : NULL;
|
||||
const char *ch = NULL;
|
||||
BotInfo *bi;
|
||||
|
||||
if (!nick || !user || !host || !real)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "BOT", BOT_BOT_SYNTAX);
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -158,42 +107,35 @@ int do_bot(User * u)
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bi = new BotInfo(nick);
|
||||
if (!bi)
|
||||
if (!(bi = new BotInfo(nick, user, host, real)))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bi->user = sstrdup(user);
|
||||
bi->host = sstrdup(host);
|
||||
bi->real = sstrdup(real);
|
||||
bi->created = time(NULL);
|
||||
bi->chancount = 0;
|
||||
|
||||
/* We check whether user with this nick is online, and kill it if so */
|
||||
EnforceQlinedNick(nick, s_BotServ);
|
||||
|
||||
/* We make the bot online, ready to serve */
|
||||
ircdproto->SendClientIntroduction(bi->nick, bi->user, bi->host, bi->real,
|
||||
ircd->pseudoclient_mode, bi->uid.c_str());
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_BOT_ADDED, bi->nick, bi->user,
|
||||
bi->host, bi->real);
|
||||
|
||||
send_event(EVENT_BOT_CREATE, 1, bi->nick);
|
||||
FOREACH_MOD(I_OnBotCreate, OnBotCreate(bi));
|
||||
return MOD_CONT;
|
||||
}
|
||||
else if (!stricmp(cmd, "CHANGE"))
|
||||
|
||||
CommandReturn DoChange(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
char *oldnick = strtok(NULL, " ");
|
||||
char *nick = strtok(NULL, " ");
|
||||
char *user = strtok(NULL, " ");
|
||||
char *host = strtok(NULL, " ");
|
||||
char *real = strtok(NULL, "");
|
||||
const char *oldnick = params[1].c_str();
|
||||
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
|
||||
const char *user = params.size() > 3 ? params[3].c_str() : NULL;
|
||||
const char *host = params.size() > 4 ? params[4].c_str() : NULL;
|
||||
const char *real = params.size() > 5 ? params[5].c_str() : NULL;
|
||||
const char *ch = NULL;
|
||||
BotInfo *bi;
|
||||
|
||||
if (!oldnick || !nick)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "BOT", BOT_BOT_SYNTAX);
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -203,6 +145,12 @@ int do_bot(User * u)
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (stricmp(oldnick, nick) && nickIsServices(oldnick, 0))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (strlen(nick) > NickLen)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BAD_NICK);
|
||||
@@ -221,7 +169,7 @@ int do_bot(User * u)
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (nickIsServices(nick, 0))
|
||||
if (stricmp(oldnick, nick) && nickIsServices(nick, 0))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick);
|
||||
return MOD_CONT;
|
||||
@@ -311,6 +259,13 @@ int do_bot(User * u)
|
||||
EnforceQlinedNick(nick, s_BotServ);
|
||||
}
|
||||
|
||||
if (user)
|
||||
ircdproto->SendQuit(bi, "Quit: Be right back");
|
||||
else {
|
||||
ircdproto->SendChangeBotNick(bi, nick);
|
||||
ircdproto->SendSQLine(bi->nick, "Reserved for services");
|
||||
}
|
||||
|
||||
if (strcmp(nick, bi->nick))
|
||||
bi->ChangeNick(nick);
|
||||
|
||||
@@ -330,18 +285,12 @@ int do_bot(User * u)
|
||||
bi->real = sstrdup(real);
|
||||
}
|
||||
|
||||
/* If only the nick changes, we just make the bot change his nick,
|
||||
* else we must make it quit and rejoin. We must not forget to set
|
||||
* the Q:Line either (it's otherwise set in SendClientIntroduction)
|
||||
*/
|
||||
if (!user)
|
||||
if (user)
|
||||
{
|
||||
ircdproto->SendChangeBotNick(bi, bi->nick);
|
||||
ircdproto->SendSQLine(bi->nick, "Reserved for services");
|
||||
}
|
||||
else
|
||||
{
|
||||
ircdproto->SendQuit(bi, "Quit: Be right back");
|
||||
if (ircd->ts6) {
|
||||
// This isn't the nicest way to do this, unfortunately.
|
||||
bi->uid = ts6_uid_retrieve();
|
||||
}
|
||||
ircdproto->SendClientIntroduction(bi->nick, bi->user, bi->host, bi->real,
|
||||
ircd->pseudoclient_mode, bi->uid.c_str());
|
||||
bi->RejoinAll();
|
||||
@@ -350,15 +299,18 @@ int do_bot(User * u)
|
||||
notice_lang(s_BotServ, u, BOT_BOT_CHANGED,
|
||||
oldnick, bi->nick, bi->user, bi->host, bi->real);
|
||||
|
||||
send_event(EVENT_BOT_CHANGE, 1, bi->nick);
|
||||
FOREACH_MOD(I_OnBotChange, OnBotChange(bi));
|
||||
return MOD_CONT;
|
||||
}
|
||||
else if (!stricmp(cmd, "DEL"))
|
||||
|
||||
CommandReturn DoDel(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
char *nick = strtok(NULL, " ");
|
||||
const char *nick = params[1].c_str();
|
||||
BotInfo *bi;
|
||||
|
||||
if (!nick)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "BOT", BOT_BOT_SYNTAX);
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -370,21 +322,123 @@ int do_bot(User * u)
|
||||
|
||||
if (nickIsServices(nick, 0))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST);
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
send_event(EVENT_BOT_DEL, 1, bi->nick);
|
||||
FOREACH_MOD(I_OnBotDelete, OnBotDelete(bi));
|
||||
|
||||
ircdproto->SendQuit(bi, "Quit: Help! I'm being deleted by %s!", u->nick);
|
||||
ircdproto->SendSQLineDel(bi->nick);
|
||||
|
||||
delete bi;
|
||||
notice_lang(s_BotServ, u, BOT_BOT_DELETED, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
else
|
||||
public:
|
||||
CommandBSBot() : Command("BOT", 1, 6)
|
||||
{
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
ci::string cmd = params[0];
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BOT_READONLY);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (cmd == "ADD")
|
||||
{
|
||||
// ADD nick user host real - 5
|
||||
if (!u->nc->HasCommand("botserv/bot/add"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (params.size() < 5)
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
// ADD takes less params than CHANGE, so we need to take 6 if given and append it with a space to 5.
|
||||
if (params.size() >= 6)
|
||||
params[4] = params[4] + " " + params[5];
|
||||
|
||||
return this->DoAdd(u, params);
|
||||
}
|
||||
else if (cmd == "CHANGE")
|
||||
{
|
||||
// CHANGE oldn newn user host real - 6
|
||||
// but only oldn and newn are required
|
||||
if (!u->nc->HasCommand("botserv/bot/change"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (params.size() < 3)
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
return this->DoChange(u, params);
|
||||
}
|
||||
else if (cmd == "DEL")
|
||||
{
|
||||
// DEL nick
|
||||
if (!u->nc->HasCommand("botserv/bot/del"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (params.size() < 1)
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
return this->DoDel(u, params);
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(u);
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_BOT);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "BOT", BOT_BOT_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
class BSBot : public Module
|
||||
{
|
||||
public:
|
||||
BSBot(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
this->AddCommand(BOTSERV, new CommandBSBot());
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BOT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
MODULE_INIT("bs_bot", BSBot)
|
||||
MODULE_INIT(BSBot)
|
||||
|
||||
+60
-67
@@ -15,82 +15,75 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_botlist(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
class CommandBSBotList : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSBotList() : Command("BOTLIST", 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
int i, count = 0;
|
||||
BotInfo *bi;
|
||||
|
||||
if (!nbots) {
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_EMPTY);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (bi = botlists[i]; bi; bi = bi->next) {
|
||||
if (!(bi->flags & BI_PRIVATE)) {
|
||||
if (!count)
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_HEADER);
|
||||
count++;
|
||||
u->SendMessage(s_BotServ, " %-15s (%s@%s)", bi->nick, bi->user, bi->host);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (u->nc->HasCommand("botserv/botlist") && count < nbots) {
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER);
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (bi = botlists[i]; bi; bi = bi->next) {
|
||||
if (bi->flags & BI_PRIVATE) {
|
||||
u->SendMessage(s_BotServ, " %-15s (%s@%s)", bi->nick, bi->user, bi->host);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!count)
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_EMPTY);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_FOOTER, count);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_BOTLIST);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSBotList : public Module
|
||||
{
|
||||
public:
|
||||
BSBotList(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("BOTLIST", do_botlist, NULL, BOT_HELP_BOTLIST, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSBotList());
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BOTLIST);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_BOTLIST);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs botlist command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_botlist(User * u)
|
||||
{
|
||||
int i, count = 0;
|
||||
BotInfo *bi;
|
||||
|
||||
if (!nbots) {
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_EMPTY);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (bi = botlists[i]; bi; bi = bi->next) {
|
||||
if (!(bi->flags & BI_PRIVATE)) {
|
||||
if (!count)
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_HEADER);
|
||||
count++;
|
||||
notice_user(s_BotServ, u, " %-15s (%s@%s)", bi->nick,
|
||||
bi->user, bi->host);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_oper(u) && count < nbots) {
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER);
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (bi = botlists[i]; bi; bi = bi->next) {
|
||||
if (bi->flags & BI_PRIVATE) {
|
||||
notice_user(s_BotServ, u, " %-15s (%s@%s)",
|
||||
bi->nick, bi->user, bi->host);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!count)
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_EMPTY);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_BOTLIST_FOOTER, count);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_botlist", BSBotList)
|
||||
MODULE_INIT(BSBotList)
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
/* BotServ core fantasy functions
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_fantasy(int argc, char **argv);
|
||||
|
||||
class BSFantasy : public Module
|
||||
{
|
||||
public:
|
||||
BSFantasy(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
EvtHook *hook;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
|
||||
this->AddEventHook(hook);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle all csmodeutils fantasy commands.
|
||||
* @param argc Argument count
|
||||
* @param argv Argument list
|
||||
* @return MOD_CONT or MOD_STOP
|
||||
**/
|
||||
int do_fantasy(int argc, char **argv)
|
||||
{
|
||||
User *u;
|
||||
ChannelInfo *ci;
|
||||
CSModeUtil *util = csmodeutils;
|
||||
char *target;
|
||||
|
||||
if (argc < 3)
|
||||
return MOD_CONT;
|
||||
|
||||
do {
|
||||
if (stricmp(argv[0], util->bsname) == 0) {
|
||||
/* This could have been moved to its own module
|
||||
however it would require more coding to handle the pass holders
|
||||
similar to how PROTECT is done
|
||||
*/
|
||||
if (!ircd->halfop) {
|
||||
if (!stricmp(argv[0], "halfop") || !stricmp(argv[0], "dehalfop")) {
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
u = finduser(argv[1]);
|
||||
ci = cs_findchan(argv[2]);
|
||||
if (!u || !ci)
|
||||
return MOD_CONT;
|
||||
|
||||
target = ((argc == 4) ? argv[3] : NULL);
|
||||
|
||||
if (!target && check_access(u, ci, util->levelself))
|
||||
bot_raw_mode(u, ci, util->mode, u->nick);
|
||||
else if (target && check_access(u, ci, util->level))
|
||||
bot_raw_mode(u, ci, util->mode, target);
|
||||
}
|
||||
} while ((++util)->name != NULL);
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_fantasy", BSFantasy)
|
||||
@@ -1,87 +0,0 @@
|
||||
/* BotServ core fantasy functions
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_fantasy(int argc, char **argv);
|
||||
|
||||
class BSFantasyKick : public Module
|
||||
{
|
||||
public:
|
||||
BSFantasyKick(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
EvtHook *hook;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
|
||||
this->AddEventHook(hook);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle kick/k fantasy commands.
|
||||
* @param argc Argument count
|
||||
* @param argv Argument list
|
||||
* @return MOD_CONT or MOD_STOP
|
||||
**/
|
||||
int do_fantasy(int argc, char **argv)
|
||||
{
|
||||
User *u, *u2;
|
||||
ChannelInfo *ci;
|
||||
char *target = NULL;
|
||||
char *reason = NULL;
|
||||
|
||||
if (argc < 3)
|
||||
return MOD_CONT;
|
||||
|
||||
if ((stricmp(argv[0], "kick") == 0) || (stricmp(argv[0], "k") == 0)) {
|
||||
u = finduser(argv[1]);
|
||||
ci = cs_findchan(argv[2]);
|
||||
if (!u || !ci)
|
||||
return MOD_CONT;
|
||||
|
||||
if (argc >= 4) {
|
||||
target = myStrGetToken(argv[3], ' ', 0);
|
||||
reason = myStrGetTokenRemainder(argv[3], ' ', 1);
|
||||
}
|
||||
if (!target && check_access(u, ci, CA_KICKME)) {
|
||||
bot_raw_kick(u, ci, u->nick, "Requested");
|
||||
} else if (target && check_access(u, ci, CA_KICK)) {
|
||||
if (!stricmp(target, ci->bi->nick))
|
||||
bot_raw_kick(u, ci, u->nick, "Oops!");
|
||||
else {
|
||||
u2 = finduser(target);
|
||||
if (u2 && ci->c && is_on_chan(ci->c, u2)) {
|
||||
if (!reason && !is_protected(u2))
|
||||
bot_raw_kick(u, ci, target, "Requested");
|
||||
else if (!is_protected(u2))
|
||||
bot_raw_kick(u, ci, target, reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (target)
|
||||
delete [] target;
|
||||
if (reason)
|
||||
delete [] reason;
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_fantasy_kick", BSFantasyKick)
|
||||
@@ -1,89 +0,0 @@
|
||||
/* BotServ core fantasy functions
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_fantasy(int argc, char **argv);
|
||||
|
||||
class BSFantasyKickBan : public Module
|
||||
{
|
||||
public:
|
||||
BSFantasyKickBan(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
EvtHook *hook;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
|
||||
this->AddEventHook(hook);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handle kickban/kb fantasy commands.
|
||||
* @param argc Argument count
|
||||
* @param argv Argument list
|
||||
* @return MOD_CONT or MOD_STOP
|
||||
**/
|
||||
int do_fantasy(int argc, char **argv)
|
||||
{
|
||||
User *u, *u2;
|
||||
ChannelInfo *ci;
|
||||
char *target = NULL;
|
||||
char *reason = NULL;
|
||||
|
||||
if (argc < 3)
|
||||
return MOD_CONT;
|
||||
|
||||
if ((stricmp(argv[0], "kickban") == 0)
|
||||
|| (stricmp(argv[0], "kb") == 0)) {
|
||||
u = finduser(argv[1]);
|
||||
ci = cs_findchan(argv[2]);
|
||||
if (!u || !ci)
|
||||
return MOD_CONT;
|
||||
|
||||
if (argc >= 4) {
|
||||
target = myStrGetToken(argv[3], ' ', 0);
|
||||
reason = myStrGetTokenRemainder(argv[3], ' ', 1);
|
||||
}
|
||||
if (!target && check_access(u, ci, CA_BANME)) {
|
||||
bot_raw_ban(u, ci, u->nick, "Requested");
|
||||
} else if (target && check_access(u, ci, CA_BAN)) {
|
||||
if (stricmp(target, ci->bi->nick) == 0) {
|
||||
bot_raw_ban(u, ci, u->nick, "Oops!");
|
||||
} else {
|
||||
u2 = finduser(target);
|
||||
if (u2 && ci->c && is_on_chan(ci->c, u2)) {
|
||||
if (!reason && !is_protected(u2))
|
||||
bot_raw_ban(u, ci, target, "Requested");
|
||||
else if (!is_protected(u2))
|
||||
bot_raw_ban(u, ci, target, reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (target)
|
||||
delete [] target;
|
||||
if (reason)
|
||||
delete [] reason;
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_fantasy_kickban", BSFantasyKickBan)
|
||||
@@ -1,78 +0,0 @@
|
||||
/* BotServ core fantasy functions
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_fantasy(int argc, char **argv);
|
||||
|
||||
class BSFantasyOwner : public Module
|
||||
{
|
||||
public:
|
||||
BSFantasyOwner(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
EvtHook *hook;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
/* No need to load of we don't support owner */
|
||||
if (!ircd->owner)
|
||||
{
|
||||
throw ModuleException("Your ircd doesn't support the owner channelmode; bs_fantasy_owner won't be loaded");
|
||||
}
|
||||
|
||||
hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
|
||||
this->AddEventHook(hook);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handle owner/deowner fantasy commands.
|
||||
* @param argc Argument count
|
||||
* @param argv Argument list
|
||||
* @return MOD_CONT or MOD_STOP
|
||||
**/
|
||||
int do_fantasy(int argc, char **argv)
|
||||
{
|
||||
User *u;
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (argc < 3)
|
||||
return MOD_CONT;
|
||||
|
||||
if (stricmp(argv[0], "deowner") == 0) {
|
||||
u = finduser(argv[1]);
|
||||
ci = cs_findchan(argv[2]);
|
||||
if (!u || !ci)
|
||||
return MOD_CONT;
|
||||
|
||||
if (is_founder(u, ci))
|
||||
bot_raw_mode(u, ci, ircd->ownerunset, u->nick);
|
||||
} else if (stricmp(argv[0], "owner") == 0) {
|
||||
u = finduser(argv[1]);
|
||||
ci = cs_findchan(argv[2]);
|
||||
if (!u || !ci)
|
||||
return MOD_CONT;
|
||||
|
||||
if (is_founder(u, ci))
|
||||
bot_raw_mode(u, ci, ircd->ownerset, u->nick);
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_fantasy_owner", BSFantasyOwner)
|
||||
@@ -1,128 +0,0 @@
|
||||
/* BotServ core fantasy functions
|
||||
*
|
||||
* (C) 2003-2009 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_fantasy(int argc, char **argv);
|
||||
|
||||
class BSFantasySeen : public Module
|
||||
{
|
||||
public:
|
||||
BSFantasySeen(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
EvtHook *hook;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
|
||||
this->AddEventHook(hook);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle seen fantasy command.
|
||||
* @param argc Argument count
|
||||
* @param argv Argument list
|
||||
* @return MOD_CONT or MOD_STOP
|
||||
**/
|
||||
int do_fantasy(int argc, char **argv)
|
||||
{
|
||||
User *u;
|
||||
ChannelInfo *ci;
|
||||
User *u2;
|
||||
NickAlias *na;
|
||||
ChanAccess *access;
|
||||
char buf[BUFSIZE];
|
||||
char *target = NULL;
|
||||
|
||||
if (argc < 4)
|
||||
return MOD_CONT;
|
||||
|
||||
if (stricmp(argv[0], "seen") == 0) {
|
||||
u = finduser(argv[1]);
|
||||
ci = cs_findchan(argv[2]);
|
||||
if (!u || !ci)
|
||||
return MOD_CONT;
|
||||
|
||||
target = myStrGetToken(argv[3], ' ', 0);
|
||||
|
||||
if (stricmp(ci->bi->nick, target) == 0) {
|
||||
/* If we look for the bot */
|
||||
snprintf(buf, sizeof(buf), getstring(u->na, BOT_SEEN_BOT),
|
||||
u->nick);
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", buf);
|
||||
} else if (!(na = findnick(target)) || (na->status & NS_VERBOTEN)) {
|
||||
/* If the nick is not registered or forbidden */
|
||||
snprintf(buf, sizeof(buf), getstring(u->na, BOT_SEEN_UNKNOWN),
|
||||
target);
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", buf);
|
||||
} else if ((u2 = nc_on_chan(ci->c, na->nc))) {
|
||||
/* If the nick we're looking for is on the channel,
|
||||
* there are three possibilities: it's yourself,
|
||||
* it's the nick we look for, it's an alias of the
|
||||
* nick we look for.
|
||||
*/
|
||||
if (u == u2 || (u->na && u->na->nc == na->nc))
|
||||
snprintf(buf, sizeof(buf), getstring(u->na, BOT_SEEN_YOU),
|
||||
u->nick);
|
||||
else if (!stricmp(u2->nick, target))
|
||||
snprintf(buf, sizeof(buf),
|
||||
getstring(u->na, BOT_SEEN_ON_CHANNEL), u2->nick);
|
||||
else
|
||||
snprintf(buf, sizeof(buf),
|
||||
getstring(u->na, BOT_SEEN_ON_CHANNEL_AS), target,
|
||||
u2->nick);
|
||||
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", buf);
|
||||
} else if ((access = get_access_entry(na->nc, ci))) {
|
||||
/* User is on the access list but not present actually.
|
||||
Special case: if access->last_seen is 0 it's that we
|
||||
never seen the user.
|
||||
*/
|
||||
if (access->last_seen) {
|
||||
char durastr[192];
|
||||
duration(u->na, durastr, sizeof(durastr),
|
||||
time(NULL) - access->last_seen);
|
||||
snprintf(buf, sizeof(buf), getstring(u->na, BOT_SEEN_ON),
|
||||
target, durastr);
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf),
|
||||
getstring(u->na, BOT_SEEN_NEVER), target);
|
||||
}
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", buf);
|
||||
} else if (na->nc == ci->founder) {
|
||||
/* User is the founder of the channel */
|
||||
char durastr[192];
|
||||
duration(u->na, durastr, sizeof(durastr),
|
||||
time(NULL) - na->last_seen);
|
||||
snprintf(buf, sizeof(buf), getstring(u->na, BOT_SEEN_ON),
|
||||
target, durastr);
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", buf);
|
||||
} else {
|
||||
/* All other cases */
|
||||
snprintf(buf, sizeof(buf), getstring(u->na, BOT_SEEN_UNKNOWN),
|
||||
target);
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", buf);
|
||||
}
|
||||
/* free myStrGetToken(ed) variable target (#851) */
|
||||
if (target) delete [] target;
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_fantasy_seen", BSFantasySeen)
|
||||
+27
-26
@@ -6,8 +6,8 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
@@ -15,41 +15,42 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_help(User * u);
|
||||
class CommandBSHelp : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSHelp() : Command("HELP", 1, 1)
|
||||
{
|
||||
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
mod_help_cmd(s_BotServ, u, BOTSERV, params[0].c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
// Abuse syntax error to display general list help.
|
||||
notice_help(s_BotServ, u, BOT_HELP);
|
||||
moduleDisplayHelp(s_BotServ, u);
|
||||
notice_help(s_BotServ, u, BOT_HELP_FOOTER, BSMinUsers);
|
||||
}
|
||||
};
|
||||
|
||||
class BSHelp : public Module
|
||||
{
|
||||
public:
|
||||
BSHelp(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("HELP", do_help, NULL, -1, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
this->AddCommand(BOTSERV, new CommandBSHelp());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The /bs help command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_help(User * u)
|
||||
{
|
||||
char *cmd = strtok(NULL, "");
|
||||
|
||||
if (!cmd) {
|
||||
notice_help(s_BotServ, u, BOT_HELP);
|
||||
moduleDisplayHelp(4, u);
|
||||
notice_help(s_BotServ, u, BOT_HELP_FOOTER, BSMinUsers);
|
||||
} else {
|
||||
mod_help_cmd(s_BotServ, u, BOTSERV, cmd);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_help", BSHelp)
|
||||
MODULE_INIT(BSHelp)
|
||||
|
||||
+238
-240
@@ -15,255 +15,253 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_info(User * u);
|
||||
void send_bot_channels(User * u, BotInfo * bi);
|
||||
void myBotServHelp(User * u);
|
||||
class CommandBSInfo : public Command
|
||||
{
|
||||
private:
|
||||
void send_bot_channels(User * u, BotInfo * bi)
|
||||
{
|
||||
int i;
|
||||
ChannelInfo *ci;
|
||||
char buf[307], *end;
|
||||
|
||||
*buf = 0;
|
||||
end = buf;
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (ci = chanlists[i]; ci; ci = ci->next) {
|
||||
if (ci->bi == bi) {
|
||||
if (strlen(buf) + strlen(ci->name) > 300) {
|
||||
u->SendMessage(s_BotServ, "%s", buf);
|
||||
*buf = 0;
|
||||
end = buf;
|
||||
}
|
||||
end +=
|
||||
snprintf(end, sizeof(buf) - (end - buf), " %s ",
|
||||
ci->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*buf)
|
||||
u->SendMessage(s_BotServ, "%s", buf);
|
||||
return;
|
||||
}
|
||||
public:
|
||||
CommandBSInfo() : Command("INFO", 1, 1)
|
||||
{
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
BotInfo *bi;
|
||||
ChannelInfo *ci;
|
||||
const char *query = params[0].c_str();
|
||||
|
||||
int need_comma = 0;
|
||||
char buf[BUFSIZE], *end;
|
||||
const char *commastr = getstring(u, COMMA_SPACE);
|
||||
|
||||
if ((bi = findbot(query)))
|
||||
{
|
||||
struct tm *tm;
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_HEADER, bi->nick);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_MASK, bi->user, bi->host);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_REALNAME, bi->real);
|
||||
tm = localtime(&bi->created);
|
||||
strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_CREATED, buf);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_OPTIONS,
|
||||
getstring(u,
|
||||
(bi->
|
||||
flags & BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE :
|
||||
BOT_INFO_OPT_NONE));
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_USAGE, bi->chancount);
|
||||
|
||||
if (u->nc->HasPriv("botserv/administration"))
|
||||
this->send_bot_channels(u, bi);
|
||||
}
|
||||
else if ((ci = cs_findchan(query)))
|
||||
{
|
||||
if (!is_founder(u, ci) && !u->nc->HasPriv("botserv/administration"))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_HEADER, ci->name);
|
||||
if (ci->bi)
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_BOT, ci->bi->nick);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_BOT_NONE);
|
||||
|
||||
if (ci->botflags & BS_KICK_BADWORDS) {
|
||||
if (ci->ttb[TTB_BADWORDS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_BADWORDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS,
|
||||
getstring(u, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_BOLDS) {
|
||||
if (ci->ttb[TTB_BOLDS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_BOLDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS,
|
||||
getstring(u, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_CAPS) {
|
||||
if (ci->ttb[TTB_CAPS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_CAPS], ci->capsmin,
|
||||
ci->capspercent);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_ON,
|
||||
getstring(u, BOT_INFO_ACTIVE), ci->capsmin,
|
||||
ci->capspercent);
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_OFF,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_COLORS) {
|
||||
if (ci->ttb[TTB_COLORS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_COLORS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS,
|
||||
getstring(u, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_FLOOD) {
|
||||
if (ci->ttb[TTB_FLOOD])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_FLOOD], ci->floodlines,
|
||||
ci->floodsecs);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_ON,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->floodlines, ci->floodsecs);
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_OFF,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_REPEAT) {
|
||||
if (ci->ttb[TTB_REPEAT])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_REPEAT], ci->repeattimes);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_ON,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->repeattimes);
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_OFF,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_REVERSES) {
|
||||
if (ci->ttb[TTB_REVERSES])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_REVERSES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES,
|
||||
getstring(u, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_UNDERLINES) {
|
||||
if (ci->ttb[TTB_UNDERLINES])
|
||||
notice_lang(s_BotServ, u,
|
||||
BOT_INFO_CHAN_KICK_UNDERLINES_BAN,
|
||||
getstring(u, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_UNDERLINES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES,
|
||||
getstring(u, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES,
|
||||
getstring(u, BOT_INFO_INACTIVE));
|
||||
|
||||
end = buf;
|
||||
*end = 0;
|
||||
if (ci->botflags & BS_DONTKICKOPS) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s",
|
||||
getstring(u, BOT_INFO_OPT_DONTKICKOPS));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_DONTKICKVOICES) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u, BOT_INFO_OPT_DONTKICKVOICES));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_FANTASY) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u, BOT_INFO_OPT_FANTASY));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_GREET) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u, BOT_INFO_OPT_GREET));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_NOBOT) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u, BOT_INFO_OPT_NOBOT));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_SYMBIOSIS) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u, BOT_INFO_OPT_SYMBIOSIS));
|
||||
need_comma = 1;
|
||||
}
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_OPTIONS,
|
||||
*buf ? buf : getstring(u, BOT_INFO_OPT_NONE));
|
||||
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_NOT_FOUND, query);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_INFO);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "INFO", BOT_INFO_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class BSInfo : public Module
|
||||
{
|
||||
public:
|
||||
BSInfo(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("INFO", do_info, NULL, BOT_HELP_INFO, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSInfo());
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_INFO);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_INFO);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs info command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_info(User * u)
|
||||
{
|
||||
BotInfo *bi;
|
||||
ChannelInfo *ci;
|
||||
char *query = strtok(NULL, " ");
|
||||
|
||||
int need_comma = 0, is_servadmin = is_services_admin(u);
|
||||
char buf[BUFSIZE], *end;
|
||||
const char *commastr = getstring(u->na, COMMA_SPACE);
|
||||
|
||||
if (!query)
|
||||
syntax_error(s_BotServ, u, "INFO", BOT_INFO_SYNTAX);
|
||||
else if ((bi = findbot(query))) {
|
||||
struct tm *tm;
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_HEADER, bi->nick);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_MASK, bi->user, bi->host);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_REALNAME, bi->real);
|
||||
tm = localtime(&bi->created);
|
||||
strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_CREATED, buf);
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_OPTIONS,
|
||||
getstring(u->na,
|
||||
(bi->
|
||||
flags & BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE :
|
||||
BOT_INFO_OPT_NONE));
|
||||
notice_lang(s_BotServ, u, BOT_INFO_BOT_USAGE, bi->chancount);
|
||||
|
||||
if (is_services_admin(u))
|
||||
send_bot_channels(u, bi);
|
||||
} else if ((ci = cs_findchan(query))) {
|
||||
if (!is_servadmin && !is_founder(u, ci)) {
|
||||
notice_lang(s_BotServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, query);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_HEADER, ci->name);
|
||||
if (ci->bi)
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_BOT, ci->bi->nick);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_BOT_NONE);
|
||||
|
||||
if (ci->botflags & BS_KICK_BADWORDS) {
|
||||
if (ci->ttb[TTB_BADWORDS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_BADWORDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS,
|
||||
getstring(u->na, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_BOLDS) {
|
||||
if (ci->ttb[TTB_BOLDS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_BOLDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS,
|
||||
getstring(u->na, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_CAPS) {
|
||||
if (ci->ttb[TTB_CAPS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_CAPS], ci->capsmin,
|
||||
ci->capspercent);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_ON,
|
||||
getstring(u->na, BOT_INFO_ACTIVE), ci->capsmin,
|
||||
ci->capspercent);
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_OFF,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_COLORS) {
|
||||
if (ci->ttb[TTB_COLORS])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_COLORS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS,
|
||||
getstring(u->na, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_FLOOD) {
|
||||
if (ci->ttb[TTB_FLOOD])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_FLOOD], ci->floodlines,
|
||||
ci->floodsecs);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_ON,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->floodlines, ci->floodsecs);
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_OFF,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_REPEAT) {
|
||||
if (ci->ttb[TTB_REPEAT])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_REPEAT], ci->repeattimes);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_ON,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->repeattimes);
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_OFF,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_REVERSES) {
|
||||
if (ci->ttb[TTB_REVERSES])
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_REVERSES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES,
|
||||
getstring(u->na, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
if (ci->botflags & BS_KICK_UNDERLINES) {
|
||||
if (ci->ttb[TTB_UNDERLINES])
|
||||
notice_lang(s_BotServ, u,
|
||||
BOT_INFO_CHAN_KICK_UNDERLINES_BAN,
|
||||
getstring(u->na, BOT_INFO_ACTIVE),
|
||||
ci->ttb[TTB_UNDERLINES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES,
|
||||
getstring(u->na, BOT_INFO_ACTIVE));
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES,
|
||||
getstring(u->na, BOT_INFO_INACTIVE));
|
||||
|
||||
end = buf;
|
||||
*end = 0;
|
||||
if (ci->botflags & BS_DONTKICKOPS) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s",
|
||||
getstring(u->na, BOT_INFO_OPT_DONTKICKOPS));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_DONTKICKVOICES) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u->na, BOT_INFO_OPT_DONTKICKVOICES));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_FANTASY) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u->na, BOT_INFO_OPT_FANTASY));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_GREET) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u->na, BOT_INFO_OPT_GREET));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_NOBOT) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u->na, BOT_INFO_OPT_NOBOT));
|
||||
need_comma = 1;
|
||||
}
|
||||
if (ci->botflags & BS_SYMBIOSIS) {
|
||||
end += snprintf(end, sizeof(buf) - (end - buf), "%s%s",
|
||||
need_comma ? commastr : "",
|
||||
getstring(u->na, BOT_INFO_OPT_SYMBIOSIS));
|
||||
need_comma = 1;
|
||||
}
|
||||
notice_lang(s_BotServ, u, BOT_INFO_CHAN_OPTIONS,
|
||||
*buf ? buf : getstring(u->na, BOT_INFO_OPT_NONE));
|
||||
|
||||
} else
|
||||
notice_lang(s_BotServ, u, BOT_INFO_NOT_FOUND, query);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
void send_bot_channels(User * u, BotInfo * bi)
|
||||
{
|
||||
int i;
|
||||
ChannelInfo *ci;
|
||||
char buf[307], *end;
|
||||
|
||||
*buf = 0;
|
||||
end = buf;
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (ci = chanlists[i]; ci; ci = ci->next) {
|
||||
if (ci->bi == bi) {
|
||||
if (strlen(buf) + strlen(ci->name) > 300) {
|
||||
notice_user(s_BotServ, u, "%s", buf);
|
||||
*buf = 0;
|
||||
end = buf;
|
||||
}
|
||||
end +=
|
||||
snprintf(end, sizeof(buf) - (end - buf), " %s ",
|
||||
ci->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*buf)
|
||||
notice_user(s_BotServ, u, "%s", buf);
|
||||
return;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_info", BSInfo)
|
||||
MODULE_INIT(BSInfo)
|
||||
|
||||
+336
-327
@@ -17,342 +17,351 @@
|
||||
|
||||
int do_kickcmd(User * u);
|
||||
|
||||
void myBotServHelp(User * u);
|
||||
class CommandBSKick : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSKick() : Command("KICK", 3, 4)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ci::string option = params[1];
|
||||
ci::string value = params[2];
|
||||
const char *ttb = params.size() > 3 ? params[3].c_str() : NULL;
|
||||
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (readonly)
|
||||
notice_lang(s_BotServ, u, BOT_KICK_DISABLED);
|
||||
else if (!chan || option.empty() || value.empty())
|
||||
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
|
||||
else if (value != "ON" && value != "OFF")
|
||||
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
|
||||
else if (!check_access(u, ci, CA_SET) && !u->nc->HasPriv("botserv/administration"))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
else {
|
||||
if (option == "BADWORDS") {
|
||||
if (value == "ON") {
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_BADWORDS] =
|
||||
strtol(ttb, NULL, 10);
|
||||
/* Only error if errno returns ERANGE or EINVAL or we are less then 0 - TSL */
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_BADWORDS] < 0) {
|
||||
/* leaving the debug behind since we might want to know what these are */
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BADWORDS]);
|
||||
}
|
||||
/* reset the value back to 0 - TSL */
|
||||
ci->ttb[TTB_BADWORDS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else {
|
||||
ci->ttb[TTB_BADWORDS] = 0;
|
||||
}
|
||||
ci->botflags |= BS_KICK_BADWORDS;
|
||||
if (ci->ttb[TTB_BADWORDS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN,
|
||||
ci->ttb[TTB_BADWORDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_BADWORDS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_OFF);
|
||||
}
|
||||
} else if (option == "BOLDS") {
|
||||
if (value == "ON") {
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_BOLDS] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_BOLDS] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BOLDS]);
|
||||
}
|
||||
ci->ttb[TTB_BOLDS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_BOLDS] = 0;
|
||||
ci->botflags |= BS_KICK_BOLDS;
|
||||
if (ci->ttb[TTB_BOLDS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON_BAN,
|
||||
ci->ttb[TTB_BOLDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_BOLDS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_OFF);
|
||||
}
|
||||
} else if (option == "CAPS") {
|
||||
if (value == "ON") {
|
||||
char *min = strtok(NULL, " ");
|
||||
char *percent = strtok(NULL, " ");
|
||||
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_CAPS] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_CAPS] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_CAPS]);
|
||||
}
|
||||
ci->ttb[TTB_CAPS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_CAPS] = 0;
|
||||
|
||||
if (!min)
|
||||
ci->capsmin = 10;
|
||||
else
|
||||
ci->capsmin = atol(min);
|
||||
if (ci->capsmin < 1)
|
||||
ci->capsmin = 10;
|
||||
|
||||
if (!percent)
|
||||
ci->capspercent = 25;
|
||||
else
|
||||
ci->capspercent = atol(percent);
|
||||
if (ci->capspercent < 1 || ci->capspercent > 100)
|
||||
ci->capspercent = 25;
|
||||
|
||||
ci->botflags |= BS_KICK_CAPS;
|
||||
if (ci->ttb[TTB_CAPS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON_BAN,
|
||||
ci->capsmin, ci->capspercent,
|
||||
ci->ttb[TTB_CAPS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON,
|
||||
ci->capsmin, ci->capspercent);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_CAPS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_CAPS_OFF);
|
||||
}
|
||||
} else if (option == "COLORS") {
|
||||
if (value == "ON") {
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_COLORS] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_COLORS] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_COLORS]);
|
||||
}
|
||||
ci->ttb[TTB_COLORS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_COLORS] = 0;
|
||||
ci->botflags |= BS_KICK_COLORS;
|
||||
if (ci->ttb[TTB_COLORS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON_BAN,
|
||||
ci->ttb[TTB_COLORS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_COLORS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_COLORS_OFF);
|
||||
}
|
||||
} else if (option == "FLOOD") {
|
||||
if (value == "ON") {
|
||||
char *lines = strtok(NULL, " ");
|
||||
char *secs = strtok(NULL, " ");
|
||||
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_FLOOD] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_FLOOD] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_FLOOD]);
|
||||
}
|
||||
ci->ttb[TTB_FLOOD] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_FLOOD] = 0;
|
||||
|
||||
if (!lines)
|
||||
ci->floodlines = 6;
|
||||
else
|
||||
ci->floodlines = atol(lines);
|
||||
if (ci->floodlines < 2)
|
||||
ci->floodlines = 6;
|
||||
|
||||
if (!secs)
|
||||
ci->floodsecs = 10;
|
||||
else
|
||||
ci->floodsecs = atol(secs);
|
||||
if (ci->floodsecs < 1 || ci->floodsecs > BSKeepData)
|
||||
ci->floodsecs = 10;
|
||||
|
||||
ci->botflags |= BS_KICK_FLOOD;
|
||||
if (ci->ttb[TTB_FLOOD])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON_BAN,
|
||||
ci->floodlines, ci->floodsecs,
|
||||
ci->ttb[TTB_FLOOD]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON,
|
||||
ci->floodlines, ci->floodsecs);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_FLOOD;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_OFF);
|
||||
}
|
||||
} else if (option == "REPEAT") {
|
||||
if (value == "ON") {
|
||||
char *times = strtok(NULL, " ");
|
||||
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_REPEAT] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_REPEAT] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REPEAT]);
|
||||
}
|
||||
ci->ttb[TTB_REPEAT] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_REPEAT] = 0;
|
||||
|
||||
if (!times)
|
||||
ci->repeattimes = 3;
|
||||
else
|
||||
ci->repeattimes = atol(times);
|
||||
if (ci->repeattimes < 2)
|
||||
ci->repeattimes = 3;
|
||||
|
||||
ci->botflags |= BS_KICK_REPEAT;
|
||||
if (ci->ttb[TTB_REPEAT])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON_BAN,
|
||||
ci->repeattimes, ci->ttb[TTB_REPEAT]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON,
|
||||
ci->repeattimes);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_REPEAT;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_OFF);
|
||||
}
|
||||
} else if (option == "REVERSES") {
|
||||
if (value == "ON") {
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_REVERSES] =
|
||||
strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_REVERSES] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REVERSES]);
|
||||
}
|
||||
ci->ttb[TTB_REVERSES] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_REVERSES] = 0;
|
||||
ci->botflags |= BS_KICK_REVERSES;
|
||||
if (ci->ttb[TTB_REVERSES])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON_BAN,
|
||||
ci->ttb[TTB_REVERSES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_REVERSES;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_OFF);
|
||||
}
|
||||
} else if (option == "UNDERLINES") {
|
||||
if (value == "ON") {
|
||||
if (ttb) {
|
||||
errno = 0;
|
||||
ci->ttb[TTB_UNDERLINES] =
|
||||
strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_UNDERLINES] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_UNDERLINES]);
|
||||
}
|
||||
ci->ttb[TTB_UNDERLINES] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_UNDERLINES] = 0;
|
||||
ci->botflags |= BS_KICK_UNDERLINES;
|
||||
if (ci->ttb[TTB_UNDERLINES])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON_BAN,
|
||||
ci->ttb[TTB_UNDERLINES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_UNDERLINES;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_OFF);
|
||||
}
|
||||
} else
|
||||
notice_help(s_BotServ, u, BOT_KICK_UNKNOWN, option.c_str());
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
if (subcommand.empty())
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK);
|
||||
else if (subcommand == "BADWORDS")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_BADWORDS);
|
||||
else if (subcommand == "BOLDS")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_BOLDS);
|
||||
else if (subcommand == "CAPS")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_CAPS);
|
||||
else if (subcommand == "COLORS")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_COLORS);
|
||||
else if (subcommand == "FLOOD")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_FLOOD);
|
||||
else if (subcommand == "REPEAT")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_REPEAT);
|
||||
else if (subcommand == "REVERSES")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_REVERSES);
|
||||
else if (subcommand == "UNDERLINES")
|
||||
notice_help(s_BotServ, u, BOT_HELP_KICK_UNDERLINES);
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class BSKick : public Module
|
||||
{
|
||||
public:
|
||||
BSKick(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("KICK", do_kickcmd, NULL, BOT_HELP_KICK, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK BADWORDS", NULL, NULL, BOT_HELP_KICK_BADWORDS, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK BOLDS", NULL, NULL, BOT_HELP_KICK_BOLDS, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK CAPS", NULL, NULL, BOT_HELP_KICK_CAPS, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK COLORS", NULL, NULL, BOT_HELP_KICK_COLORS, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK FLOOD", NULL, NULL, BOT_HELP_KICK_FLOOD, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK REPEAT", NULL, NULL, BOT_HELP_KICK_REPEAT, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK REVERSES", NULL, NULL, BOT_HELP_KICK_REVERSES, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("KICK UNDERLINES", NULL, NULL, BOT_HELP_KICK_UNDERLINES, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSKick());
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_KICK);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_KICK);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs kick command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_kickcmd(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *option = strtok(NULL, " ");
|
||||
char *value = strtok(NULL, " ");
|
||||
char *ttb = strtok(NULL, " ");
|
||||
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
notice_lang(s_BotServ, u, BOT_KICK_DISABLED);
|
||||
else if (!chan || !option || !value)
|
||||
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
|
||||
else if (stricmp(value, "ON") && stricmp(value, "OFF"))
|
||||
syntax_error(s_BotServ, u, "KICK", BOT_KICK_SYNTAX);
|
||||
else if (!(ci = cs_findchan(chan)))
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_VERBOTEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!is_services_admin(u) && !check_access(u, ci, CA_SET))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
else {
|
||||
if (!stricmp(option, "BADWORDS")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_BADWORDS] =
|
||||
strtol(ttb, NULL, 10);
|
||||
/* Only error if errno returns ERANGE or EINVAL or we are less then 0 - TSL */
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_BADWORDS] < 0) {
|
||||
/* leaving the debug behind since we might want to know what these are */
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BADWORDS]);
|
||||
}
|
||||
/* reset the value back to 0 - TSL */
|
||||
ci->ttb[TTB_BADWORDS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else {
|
||||
ci->ttb[TTB_BADWORDS] = 0;
|
||||
}
|
||||
ci->botflags |= BS_KICK_BADWORDS;
|
||||
if (ci->ttb[TTB_BADWORDS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN,
|
||||
ci->ttb[TTB_BADWORDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_BADWORDS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_OFF);
|
||||
}
|
||||
} else if (!stricmp(option, "BOLDS")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_BOLDS] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_BOLDS] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BOLDS]);
|
||||
}
|
||||
ci->ttb[TTB_BOLDS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_BOLDS] = 0;
|
||||
ci->botflags |= BS_KICK_BOLDS;
|
||||
if (ci->ttb[TTB_BOLDS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON_BAN,
|
||||
ci->ttb[TTB_BOLDS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_BOLDS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BOLDS_OFF);
|
||||
}
|
||||
} else if (!stricmp(option, "CAPS")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
char *min = strtok(NULL, " ");
|
||||
char *percent = strtok(NULL, " ");
|
||||
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_CAPS] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_CAPS] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_CAPS]);
|
||||
}
|
||||
ci->ttb[TTB_CAPS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_CAPS] = 0;
|
||||
|
||||
if (!min)
|
||||
ci->capsmin = 10;
|
||||
else
|
||||
ci->capsmin = atol(min);
|
||||
if (ci->capsmin < 1)
|
||||
ci->capsmin = 10;
|
||||
|
||||
if (!percent)
|
||||
ci->capspercent = 25;
|
||||
else
|
||||
ci->capspercent = atol(percent);
|
||||
if (ci->capspercent < 1 || ci->capspercent > 100)
|
||||
ci->capspercent = 25;
|
||||
|
||||
ci->botflags |= BS_KICK_CAPS;
|
||||
if (ci->ttb[TTB_CAPS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON_BAN,
|
||||
ci->capsmin, ci->capspercent,
|
||||
ci->ttb[TTB_CAPS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON,
|
||||
ci->capsmin, ci->capspercent);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_CAPS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_CAPS_OFF);
|
||||
}
|
||||
} else if (!stricmp(option, "COLORS")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_COLORS] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_COLORS] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_COLORS]);
|
||||
}
|
||||
ci->ttb[TTB_COLORS] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_COLORS] = 0;
|
||||
ci->botflags |= BS_KICK_COLORS;
|
||||
if (ci->ttb[TTB_COLORS])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON_BAN,
|
||||
ci->ttb[TTB_COLORS]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_COLORS;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_COLORS_OFF);
|
||||
}
|
||||
} else if (!stricmp(option, "FLOOD")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
char *lines = strtok(NULL, " ");
|
||||
char *secs = strtok(NULL, " ");
|
||||
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_FLOOD] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_FLOOD] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_FLOOD]);
|
||||
}
|
||||
ci->ttb[TTB_FLOOD] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_FLOOD] = 0;
|
||||
|
||||
if (!lines)
|
||||
ci->floodlines = 6;
|
||||
else
|
||||
ci->floodlines = atol(lines);
|
||||
if (ci->floodlines < 2)
|
||||
ci->floodlines = 6;
|
||||
|
||||
if (!secs)
|
||||
ci->floodsecs = 10;
|
||||
else
|
||||
ci->floodsecs = atol(secs);
|
||||
if (ci->floodsecs < 1 || ci->floodsecs > BSKeepData)
|
||||
ci->floodsecs = 10;
|
||||
|
||||
ci->botflags |= BS_KICK_FLOOD;
|
||||
if (ci->ttb[TTB_FLOOD])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON_BAN,
|
||||
ci->floodlines, ci->floodsecs,
|
||||
ci->ttb[TTB_FLOOD]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON,
|
||||
ci->floodlines, ci->floodsecs);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_FLOOD;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_FLOOD_OFF);
|
||||
}
|
||||
} else if (!stricmp(option, "REPEAT")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
char *times = strtok(NULL, " ");
|
||||
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_REPEAT] = strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_REPEAT] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REPEAT]);
|
||||
}
|
||||
ci->ttb[TTB_REPEAT] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_REPEAT] = 0;
|
||||
|
||||
if (!times)
|
||||
ci->repeattimes = 3;
|
||||
else
|
||||
ci->repeattimes = atol(times);
|
||||
if (ci->repeattimes < 2)
|
||||
ci->repeattimes = 3;
|
||||
|
||||
ci->botflags |= BS_KICK_REPEAT;
|
||||
if (ci->ttb[TTB_REPEAT])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON_BAN,
|
||||
ci->repeattimes, ci->ttb[TTB_REPEAT]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON,
|
||||
ci->repeattimes);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_REPEAT;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REPEAT_OFF);
|
||||
}
|
||||
} else if (!stricmp(option, "REVERSES")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_REVERSES] =
|
||||
strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_REVERSES] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REVERSES]);
|
||||
}
|
||||
ci->ttb[TTB_REVERSES] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_REVERSES] = 0;
|
||||
ci->botflags |= BS_KICK_REVERSES;
|
||||
if (ci->ttb[TTB_REVERSES])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON_BAN,
|
||||
ci->ttb[TTB_REVERSES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_REVERSES;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_REVERSES_OFF);
|
||||
}
|
||||
} else if (!stricmp(option, "UNDERLINES")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
if (ttb) {
|
||||
ci->ttb[TTB_UNDERLINES] =
|
||||
strtol(ttb, NULL, 10);
|
||||
if (errno == ERANGE || errno == EINVAL
|
||||
|| ci->ttb[TTB_UNDERLINES] < 0) {
|
||||
if (debug) {
|
||||
alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_UNDERLINES]);
|
||||
}
|
||||
ci->ttb[TTB_UNDERLINES] = 0;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_BAD_TTB, ttb);
|
||||
return MOD_CONT;
|
||||
}
|
||||
} else
|
||||
ci->ttb[TTB_UNDERLINES] = 0;
|
||||
ci->botflags |= BS_KICK_UNDERLINES;
|
||||
if (ci->ttb[TTB_UNDERLINES])
|
||||
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON_BAN,
|
||||
ci->ttb[TTB_UNDERLINES]);
|
||||
else
|
||||
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON);
|
||||
} else {
|
||||
ci->botflags &= ~BS_KICK_UNDERLINES;
|
||||
notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_OFF);
|
||||
}
|
||||
} else
|
||||
notice_help(s_BotServ, u, BOT_KICK_UNKNOWN, option);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_kick", BSKick)
|
||||
MODULE_INIT(BSKick)
|
||||
|
||||
+64
-57
@@ -15,72 +15,79 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_say(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
class CommandBSSay : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSay() : Command("SAY", 2, 2)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
ChannelInfo *ci;
|
||||
|
||||
const char *chan = params[0].c_str();
|
||||
const char *text = params[1].c_str();
|
||||
|
||||
ci = cs_findchan(chan);
|
||||
|
||||
if (!check_access(u, ci, CA_SAY))
|
||||
{
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!ci->bi)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!ci->c || ci->c->usercount < BSMinUsers)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (text[0] == '\001')
|
||||
{
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", text);
|
||||
ci->bi->lastmsg = time(NULL);
|
||||
if (LogBot && LogChannel && logchan && !debug && findchan(LogChannel))
|
||||
ircdproto->SendPrivmsg(ci->bi, LogChannel, "SAY %s %s %s", u->nick, ci->name, text);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_SAY);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "SAY", BOT_SAY_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class BSSay : public Module
|
||||
{
|
||||
public:
|
||||
BSSay(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("SAY", do_say, NULL, BOT_HELP_SAY, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSSay());
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_SAY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_SAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs say command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_say(User * u)
|
||||
{
|
||||
ChannelInfo *ci;
|
||||
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *text = strtok(NULL, "");
|
||||
|
||||
if (!chan || !text)
|
||||
syntax_error(s_BotServ, u, "SAY", BOT_SAY_SYNTAX);
|
||||
else if (!(ci = cs_findchan(chan)))
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_VERBOTEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
else if (!ci->c || ci->c->usercount < BSMinUsers)
|
||||
notice_lang(s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name);
|
||||
else if (!check_access(u, ci, CA_SAY))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else {
|
||||
if (text[0] != '\001') {
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", text);
|
||||
ci->bi->lastmsg = time(NULL);
|
||||
if (LogBot && LogChannel && logchan && !debug && findchan(LogChannel))
|
||||
ircdproto->SendPrivmsg(ci->bi, LogChannel,
|
||||
"SAY %s %s %s", u->nick, ci->name, text);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SAY", BOT_SAY_SYNTAX);
|
||||
}
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_say", BSSay)
|
||||
MODULE_INIT(BSSay)
|
||||
|
||||
+168
-159
@@ -15,174 +15,183 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_set(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
class CommandBSSet : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSet() : Command("SET", 3, 3)
|
||||
{
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ci::string option = params[1];
|
||||
ci::string value = params[2];
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_SET_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (u->nc->HasCommand("botserv/set/private") && option == "PRIVATE")
|
||||
{
|
||||
BotInfo *bi;
|
||||
|
||||
if (!(bi = findbot(chan)))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (value == "ON")
|
||||
{
|
||||
bi->flags |= BI_PRIVATE;
|
||||
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_ON, bi->nick);
|
||||
}
|
||||
else if (value == "OFF")
|
||||
{
|
||||
bi->flags &= ~BI_PRIVATE;
|
||||
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_OFF, bi->nick);
|
||||
}
|
||||
else
|
||||
{
|
||||
syntax_error(s_BotServ, u, "SET PRIVATE", BOT_SET_PRIVATE_SYNTAX);
|
||||
}
|
||||
return MOD_CONT;
|
||||
} else if (!(ci = cs_findchan(chan)))
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (!u->nc->HasPriv("botserv/administration") && !check_access(u, ci, CA_SET))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else {
|
||||
if (option == "DONTKICKOPS") {
|
||||
if (value == "ON") {
|
||||
ci->botflags |= BS_DONTKICKOPS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_ON,
|
||||
ci->name);
|
||||
} else if (value == "OFF") {
|
||||
ci->botflags &= ~BS_DONTKICKOPS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_OFF,
|
||||
ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET DONTKICKOPS",
|
||||
BOT_SET_DONTKICKOPS_SYNTAX);
|
||||
}
|
||||
} else if (option == "DONTKICKVOICES") {
|
||||
if (value == "ON") {
|
||||
ci->botflags |= BS_DONTKICKVOICES;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_ON,
|
||||
ci->name);
|
||||
} else if (value == "OFF") {
|
||||
ci->botflags &= ~BS_DONTKICKVOICES;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_OFF,
|
||||
ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET DONTKICKVOICES",
|
||||
BOT_SET_DONTKICKVOICES_SYNTAX);
|
||||
}
|
||||
} else if (option == "FANTASY") {
|
||||
if (value == "ON") {
|
||||
ci->botflags |= BS_FANTASY;
|
||||
notice_lang(s_BotServ, u, BOT_SET_FANTASY_ON, ci->name);
|
||||
} else if (value == "OFF") {
|
||||
ci->botflags &= ~BS_FANTASY;
|
||||
notice_lang(s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET FANTASY",
|
||||
BOT_SET_FANTASY_SYNTAX);
|
||||
}
|
||||
} else if (option == "GREET") {
|
||||
if (value == "ON") {
|
||||
ci->botflags |= BS_GREET;
|
||||
notice_lang(s_BotServ, u, BOT_SET_GREET_ON, ci->name);
|
||||
} else if (value == "OFF") {
|
||||
ci->botflags &= ~BS_GREET;
|
||||
notice_lang(s_BotServ, u, BOT_SET_GREET_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET GREET",
|
||||
BOT_SET_GREET_SYNTAX);
|
||||
}
|
||||
} else if (u->nc->HasCommand("botserv/set/nobot") && option == "NOBOT") {
|
||||
if (value == "ON") {
|
||||
ci->botflags |= BS_NOBOT;
|
||||
if (ci->bi)
|
||||
ci->bi->UnAssign(u, ci);
|
||||
notice_lang(s_BotServ, u, BOT_SET_NOBOT_ON, ci->name);
|
||||
} else if (value == "OFF") {
|
||||
ci->botflags &= ~BS_NOBOT;
|
||||
notice_lang(s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET NOBOT",
|
||||
BOT_SET_NOBOT_SYNTAX);
|
||||
}
|
||||
} else if (option == "SYMBIOSIS") {
|
||||
if (value == "ON") {
|
||||
ci->botflags |= BS_SYMBIOSIS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name);
|
||||
} else if (value == "OFF") {
|
||||
ci->botflags &= ~BS_SYMBIOSIS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET SYMBIOSIS",
|
||||
BOT_SET_SYMBIOSIS_SYNTAX);
|
||||
}
|
||||
} else {
|
||||
notice_help(s_BotServ, u, BOT_SET_UNKNOWN, option.c_str());
|
||||
}
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
if (subcommand.empty())
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET);
|
||||
if (u->nc && u->nc->IsServicesOper())
|
||||
notice_help(s_BotServ, u, BOT_SERVADMIN_HELP_SET);
|
||||
}
|
||||
else if (subcommand == "DONTKICKOPS")
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET_DONTKICKOPS);
|
||||
else if (subcommand == "DONTKICKVOICES")
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET_DONTKICKVOICES);
|
||||
else if (subcommand == "FANTASY")
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET_FANTASY);
|
||||
else if (subcommand == "GREET")
|
||||
notice_help(s_BotServ, u, BOT_HELP_SET_GREET);
|
||||
else if (subcommand == "SYMBIOSIS")
|
||||
notice_lang(s_BotServ, u, BOT_HELP_SET_SYMBIOSIS, s_ChanServ);
|
||||
else if (subcommand == "NOBOT")
|
||||
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_SET_NOBOT);
|
||||
else if (subcommand == "PRIVATE")
|
||||
notice_lang(s_BotServ, u, BOT_SERVADMIN_HELP_SET_PRIVATE);
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "SET", BOT_SET_SYNTAX);
|
||||
}
|
||||
};
|
||||
class BSSet : public Module
|
||||
{
|
||||
public:
|
||||
BSSet(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("SET", do_set, NULL, BOT_HELP_SET, -1, -1, BOT_SERVADMIN_HELP_SET, BOT_SERVADMIN_HELP_SET);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SET DONTKICKOPS", NULL, NULL, BOT_HELP_SET_DONTKICKOPS, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SET DONTKICKVOICES", NULL, NULL, BOT_HELP_SET_DONTKICKVOICES, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SET FANTASY", NULL, NULL, BOT_HELP_SET_FANTASY, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SET GREET", NULL, NULL, BOT_HELP_SET_GREET, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SET SYMBIOSIS", NULL, NULL, BOT_HELP_SET_SYMBIOSIS, -1, -1, -1, -1);
|
||||
c->help_param1 = s_ChanServ;
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SET NOBOT", NULL, NULL, -1, -1, -1, BOT_SERVADMIN_HELP_SET_NOBOT, BOT_SERVADMIN_HELP_SET_NOBOT);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SET PRIVATE", NULL, NULL, -1, -1, -1,
|
||||
BOT_SERVADMIN_HELP_SET_PRIVATE,
|
||||
BOT_SERVADMIN_HELP_SET_PRIVATE);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSSet());
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_SET);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs set command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_set(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *option = strtok(NULL, " ");
|
||||
char *value = strtok(NULL, " ");
|
||||
int is_servadmin = is_services_admin(u);
|
||||
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
notice_lang(s_BotServ, u, BOT_SET_DISABLED);
|
||||
else if (!chan || !option || !value)
|
||||
syntax_error(s_BotServ, u, "SET", BOT_SET_SYNTAX);
|
||||
else if (is_servadmin && !stricmp(option, "PRIVATE")) {
|
||||
BotInfo *bi;
|
||||
|
||||
if ((bi = findbot(chan))) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
bi->flags |= BI_PRIVATE;
|
||||
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_ON, bi->nick);
|
||||
} else if (!stricmp(value, "OFF")) {
|
||||
bi->flags &= ~BI_PRIVATE;
|
||||
notice_lang(s_BotServ, u, BOT_SET_PRIVATE_OFF, bi->nick);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET PRIVATE",
|
||||
BOT_SET_PRIVATE_SYNTAX);
|
||||
}
|
||||
} else {
|
||||
notice_lang(s_BotServ, u, BOT_DOES_NOT_EXIST, chan);
|
||||
}
|
||||
return MOD_CONT;
|
||||
} else if (!(ci = cs_findchan(chan)))
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_VERBOTEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!is_servadmin && !check_access(u, ci, CA_SET))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else {
|
||||
if (!stricmp(option, "DONTKICKOPS")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
ci->botflags |= BS_DONTKICKOPS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_ON,
|
||||
ci->name);
|
||||
} else if (!stricmp(value, "OFF")) {
|
||||
ci->botflags &= ~BS_DONTKICKOPS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_OFF,
|
||||
ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET DONTKICKOPS",
|
||||
BOT_SET_DONTKICKOPS_SYNTAX);
|
||||
}
|
||||
} else if (!stricmp(option, "DONTKICKVOICES")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
ci->botflags |= BS_DONTKICKVOICES;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_ON,
|
||||
ci->name);
|
||||
} else if (!stricmp(value, "OFF")) {
|
||||
ci->botflags &= ~BS_DONTKICKVOICES;
|
||||
notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_OFF,
|
||||
ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET DONTKICKVOICES",
|
||||
BOT_SET_DONTKICKVOICES_SYNTAX);
|
||||
}
|
||||
} else if (!stricmp(option, "FANTASY")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
ci->botflags |= BS_FANTASY;
|
||||
notice_lang(s_BotServ, u, BOT_SET_FANTASY_ON, ci->name);
|
||||
} else if (!stricmp(value, "OFF")) {
|
||||
ci->botflags &= ~BS_FANTASY;
|
||||
notice_lang(s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET FANTASY",
|
||||
BOT_SET_FANTASY_SYNTAX);
|
||||
}
|
||||
} else if (!stricmp(option, "GREET")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
ci->botflags |= BS_GREET;
|
||||
notice_lang(s_BotServ, u, BOT_SET_GREET_ON, ci->name);
|
||||
} else if (!stricmp(value, "OFF")) {
|
||||
ci->botflags &= ~BS_GREET;
|
||||
notice_lang(s_BotServ, u, BOT_SET_GREET_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET GREET",
|
||||
BOT_SET_GREET_SYNTAX);
|
||||
}
|
||||
} else if (is_servadmin && !stricmp(option, "NOBOT")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
ci->botflags |= BS_NOBOT;
|
||||
if (ci->bi)
|
||||
ci->bi->UnAssign(u, ci);
|
||||
notice_lang(s_BotServ, u, BOT_SET_NOBOT_ON, ci->name);
|
||||
} else if (!stricmp(value, "OFF")) {
|
||||
ci->botflags &= ~BS_NOBOT;
|
||||
notice_lang(s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET NOBOT",
|
||||
BOT_SET_NOBOT_SYNTAX);
|
||||
}
|
||||
} else if (!stricmp(option, "SYMBIOSIS")) {
|
||||
if (!stricmp(value, "ON")) {
|
||||
ci->botflags |= BS_SYMBIOSIS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name);
|
||||
} else if (!stricmp(value, "OFF")) {
|
||||
ci->botflags &= ~BS_SYMBIOSIS;
|
||||
notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name);
|
||||
} else {
|
||||
syntax_error(s_BotServ, u, "SET SYMBIOSIS",
|
||||
BOT_SET_SYMBIOSIS_SYNTAX);
|
||||
}
|
||||
} else {
|
||||
notice_help(s_BotServ, u, BOT_SET_UNKNOWN, option);
|
||||
}
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_set", BSSet)
|
||||
MODULE_INIT(BSSet)
|
||||
|
||||
+43
-48
@@ -16,63 +16,58 @@
|
||||
#include "module.h"
|
||||
|
||||
int do_unassign(User * u);
|
||||
void myBotServHelp(User * u);
|
||||
|
||||
class CommandBSUnassign : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSUnassign() : Command("UNASSIGN", 1, 1)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
|
||||
if (readonly)
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_READONLY);
|
||||
else if (!u->nc->HasPriv("botserv/administration") && !check_access(u, ci, CA_ASSIGN))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
else {
|
||||
ci->bi->UnAssign(u, ci);
|
||||
notice_lang(s_BotServ, u, BOT_UNASSIGN_UNASSIGNED, ci->name);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_BotServ, u, BOT_HELP_UNASSIGN);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_BotServ, u, "UNASSIGN", BOT_UNASSIGN_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class BSUnassign : public Module
|
||||
{
|
||||
public:
|
||||
BSUnassign(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
c = createCommand("UNASSIGN", do_unassign, NULL, BOT_HELP_UNASSIGN, -1, -1, -1, -1);
|
||||
this->AddCommand(BOTSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetBotHelp(myBotServHelp);
|
||||
this->AddCommand(BOTSERV, new CommandBSUnassign);
|
||||
}
|
||||
void BotServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_UNASSIGN);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to Anopes /bs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myBotServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_HELP_CMD_UNASSIGN);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /bs unassign command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_unassign(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
notice_lang(s_BotServ, u, BOT_ASSIGN_READONLY);
|
||||
else if (!chan)
|
||||
syntax_error(s_BotServ, u, "UNASSIGN", BOT_UNASSIGN_SYNTAX);
|
||||
else if (!(ci = cs_findchan(chan)))
|
||||
notice_lang(s_BotServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
else if (ci->flags & CI_VERBOTEN)
|
||||
notice_lang(s_BotServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
else if (!is_services_admin(u) && !check_access(u, ci, CA_ASSIGN))
|
||||
notice_lang(s_BotServ, u, ACCESS_DENIED);
|
||||
else if (!ci->bi)
|
||||
notice_help(s_BotServ, u, BOT_NOT_ASSIGNED);
|
||||
else {
|
||||
ci->bi->UnAssign(u, ci);
|
||||
notice_lang(s_BotServ, u, BOT_UNASSIGN_UNASSIGNED, ci->name);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("bs_unassign", BSUnassign)
|
||||
MODULE_INIT(BSUnassign)
|
||||
|
||||
+370
-394
@@ -15,60 +15,22 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
|
||||
int do_access(User * u);
|
||||
int do_levels(User * u);
|
||||
|
||||
void myChanServHelp(User * u);
|
||||
|
||||
class CSAccess : public Module
|
||||
{
|
||||
public:
|
||||
CSAccess(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion
|
||||
("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("ACCESS", do_access, NULL, CHAN_HELP_ACCESS, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("ACCESS LEVELS", NULL, NULL, CHAN_HELP_ACCESS_LEVELS, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("LEVELS", do_levels, NULL, CHAN_HELP_LEVELS, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_ACCESS);
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LEVELS);
|
||||
}
|
||||
|
||||
|
||||
static int access_del(User * u, ChannelInfo *ci, ChanAccess * access, int *perm, int uacc)
|
||||
{
|
||||
char *nick;
|
||||
if (!access->in_use)
|
||||
return 0;
|
||||
if (!is_services_admin(u) && uacc <= access->level) {
|
||||
if (uacc <= access->level && !u->nc->HasPriv("chanserv/access/modify"))
|
||||
{
|
||||
(*perm)++;
|
||||
return 0;
|
||||
}
|
||||
nick = access->nc->display;
|
||||
access->nc = NULL;
|
||||
access->in_use = 0;
|
||||
send_event(EVENT_ACCESS_DEL, 3, ci->name, u->nick, nick);
|
||||
|
||||
FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, u, nick));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -78,35 +40,34 @@ static int access_del_callback(User * u, int num, va_list args)
|
||||
int *last = va_arg(args, int *);
|
||||
int *perm = va_arg(args, int *);
|
||||
int uacc = va_arg(args, int);
|
||||
if (num < 1 || num > ci->accesscount)
|
||||
if (num < 1 || num > ci->access.size())
|
||||
return 0;
|
||||
*last = num;
|
||||
return access_del(u, ci, &ci->access[num - 1], perm, uacc);
|
||||
return access_del(u, ci, ci->GetAccess(num - 1), perm, uacc);
|
||||
}
|
||||
|
||||
|
||||
static int access_list(User * u, int index, ChannelInfo * ci,
|
||||
int *sent_header)
|
||||
static int access_list(User * u, int index, ChannelInfo * ci, int *sent_header)
|
||||
{
|
||||
ChanAccess *access = &ci->access[index];
|
||||
ChanAccess *access = ci->GetAccess(index);
|
||||
const char *xop;
|
||||
|
||||
if (!access->in_use)
|
||||
return 0;
|
||||
|
||||
if (!*sent_header) {
|
||||
if (!*sent_header)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_HEADER, ci->name);
|
||||
*sent_header = 1;
|
||||
}
|
||||
|
||||
if (ci->flags & CI_XOP) {
|
||||
if (ci->flags & CI_XOP)
|
||||
{
|
||||
xop = get_xop_level(access->level);
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_XOP_FORMAT, index + 1,
|
||||
xop, access->nc->display);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_AXS_FORMAT, index + 1,
|
||||
access->level, access->nc->display);
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_XOP_FORMAT, index + 1, xop, access->nc->display);
|
||||
}
|
||||
else
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_AXS_FORMAT, index + 1, access->level, access->nc->display);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -114,415 +75,430 @@ static int access_list_callback(User * u, int num, va_list args)
|
||||
{
|
||||
ChannelInfo *ci = va_arg(args, ChannelInfo *);
|
||||
int *sent_header = va_arg(args, int *);
|
||||
if (num < 1 || num > ci->accesscount)
|
||||
if (num < 1 || num > ci->access.size())
|
||||
return 0;
|
||||
return access_list(u, num - 1, ci, sent_header);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The /cs access command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_access(User * u)
|
||||
class CommandCSAccess : public Command
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *cmd = strtok(NULL, " ");
|
||||
char *nick = strtok(NULL, " ");
|
||||
char *s = strtok(NULL, " ");
|
||||
char event_access[BUFSIZE];
|
||||
public:
|
||||
CommandCSAccess() : Command("ACCESS", 2, 4)
|
||||
{
|
||||
}
|
||||
|
||||
ChannelInfo *ci;
|
||||
NickAlias *na = NULL;
|
||||
NickCore *nc;
|
||||
ChanAccess *access;
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ci::string cmd = params[1];
|
||||
const char *nick = params.size() > 2 ? params[2].c_str() : NULL;
|
||||
const char *s = params.size() > 3 ? params[3].c_str() : NULL;
|
||||
|
||||
unsigned i;
|
||||
int level = 0, ulev;
|
||||
int is_list = (cmd && stricmp(cmd, "LIST") == 0);
|
||||
int is_servadmin = is_services_admin(u);
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
NickAlias *na = NULL;
|
||||
NickCore *nc;
|
||||
ChanAccess *access;
|
||||
|
||||
/* If LIST, we don't *require* any parameters, but we can take any.
|
||||
* If DEL, we require a nick and no level.
|
||||
* Else (ADD), we require a level (which implies a nick). */
|
||||
if (!cmd || ((is_list || !stricmp(cmd, "CLEAR")) ? 0 :
|
||||
(stricmp(cmd, "DEL") == 0) ? (!nick || s) : !s)) {
|
||||
syntax_error(s_ChanServ, u, "ACCESS", CHAN_ACCESS_SYNTAX);
|
||||
} else if (!(ci = cs_findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
unsigned i;
|
||||
int level = 0, ulev;
|
||||
bool is_list = cmd == "LIST";
|
||||
|
||||
/* If LIST, we don't *require* any parameters, but we can take any.
|
||||
* If DEL, we require a nick and no level.
|
||||
* Else (ADD), we require a level (which implies a nick). */
|
||||
if (is_list || cmd == "CLEAR" ? 0 : (cmd == "DEL" ? (!nick || s) : !s))
|
||||
this->OnSyntaxError(u);
|
||||
/* We still allow LIST in xOP mode, but not others */
|
||||
} else if ((ci->flags & CI_XOP) && !is_list) {
|
||||
if (ircd->halfop)
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_XOP_HOP, s_ChanServ);
|
||||
else
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_XOP, s_ChanServ);
|
||||
} else if (((is_list && !check_access(u, ci, CA_ACCESS_LIST))
|
||||
|| (!is_list && !check_access(u, ci, CA_ACCESS_CHANGE)))
|
||||
&& !is_servadmin) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else if (stricmp(cmd, "ADD") == 0) {
|
||||
if (readonly) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DISABLED);
|
||||
return MOD_CONT;
|
||||
else if ((ci->flags & CI_XOP) && !is_list)
|
||||
{
|
||||
if (ircd->halfop)
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_XOP_HOP, s_ChanServ);
|
||||
else
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_XOP, s_ChanServ);
|
||||
}
|
||||
else if ((
|
||||
(is_list && !check_access(u, ci, CA_ACCESS_LIST) && !u->nc->HasCommand("chanserv/access/list"))
|
||||
||
|
||||
(!is_list && !check_access(u, ci, CA_ACCESS_CHANGE) && !u->nc->HasPriv("chanserv/access/modify"))
|
||||
))
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
else if (cmd == "ADD")
|
||||
{
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
level = atoi(s);
|
||||
ulev = get_access(u, ci);
|
||||
level = atoi(s);
|
||||
ulev = get_access(u, ci);
|
||||
|
||||
if (!is_servadmin && level >= ulev) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (level >= ulev && !u->nc->HasPriv("chanserv/access/modify"))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (level == 0) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_NONZERO);
|
||||
return MOD_CONT;
|
||||
} else if (level <= ACCESS_INVALID || level >= ACCESS_FOUNDER) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_RANGE,
|
||||
ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (!level)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_NONZERO);
|
||||
return MOD_CONT;
|
||||
}
|
||||
else if (level <= ACCESS_INVALID || level >= ACCESS_FOUNDER)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_RANGE, ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
na = findnick(nick);
|
||||
if (!na) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NICKS_ONLY);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (na->status & NS_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, NICK_X_FORBIDDEN, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
na = findnick(nick);
|
||||
if (!na)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NICKS_ONLY);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (na->status & NS_FORBIDDEN)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, NICK_X_FORBIDDEN, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
nc = na->nc;
|
||||
for (access = ci->access, i = 0; i < ci->accesscount;
|
||||
access++, i++) {
|
||||
if (access->nc == nc) {
|
||||
nc = na->nc;
|
||||
access = ci->GetAccess(nc);
|
||||
if (access)
|
||||
{
|
||||
/* Don't allow lowering from a level >= ulev */
|
||||
if (!is_servadmin && access->level >= ulev) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
if (access->level >= ulev && !u->nc->HasPriv("chanserv/access/modify"))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (access->level == level) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_UNCHANGED,
|
||||
access->nc->display, chan, level);
|
||||
if (access->level == level)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_UNCHANGED, access->nc->display, chan, level);
|
||||
return MOD_CONT;
|
||||
}
|
||||
access->level = level;
|
||||
snprintf(event_access, BUFSIZE, "%d", access->level);
|
||||
send_event(EVENT_ACCESS_CHANGE, 4, ci->name, u->nick,
|
||||
na->nick, event_access);
|
||||
alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->username, u->host, ulev, access->level, na->nick, nc->display, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_CHANGED,
|
||||
access->nc->display, chan, level);
|
||||
|
||||
FOREACH_MOD(I_OnAccessChange, OnAccessChange(ci, u, na->nick, level));
|
||||
|
||||
alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ulev, access->level, na->nick, nc->display, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LEVEL_CHANGED, nc->display, chan, level);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
|
||||
/* All entries should be in use so we no longer need
|
||||
* to go over the entire list..
|
||||
for (i = 0; i < ci->accesscount; i++) {
|
||||
if (!ci->access[i].in_use)
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
if (i < CSAccessMax) {
|
||||
ci->accesscount++;
|
||||
ci->access =
|
||||
static_cast<ChanAccess *>(srealloc(ci->access,
|
||||
sizeof(ChanAccess) * ci->accesscount));
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_REACHED_LIMIT,
|
||||
CSAccessMax);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
access = &ci->access[i];
|
||||
access->nc = nc;
|
||||
access->in_use = 1;
|
||||
access->level = level;
|
||||
access->last_seen = 0;
|
||||
|
||||
snprintf(event_access, BUFSIZE, "%d", access->level);
|
||||
send_event(EVENT_ACCESS_ADD, 4, ci->name, u->nick, na->nick,
|
||||
event_access);
|
||||
alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->username, u->host, ulev, access->level, na->nick, nc->display, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_ADDED, nc->display,
|
||||
ci->name, access->level);
|
||||
} else if (stricmp(cmd, "DEL") == 0) {
|
||||
int deleted, a, b;
|
||||
if (readonly) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (ci->accesscount == 0) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_EMPTY, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
/* Special case: is it a number/list? Only do search if it isn't. */
|
||||
if (isdigit(*nick) && strspn(nick, "1234567890,-") == strlen(nick)) {
|
||||
int count, last = -1, perm = 0;
|
||||
deleted = process_numlist(nick, &count, access_del_callback, u,
|
||||
ci, &last, &perm, get_access(u, ci));
|
||||
if (!deleted) {
|
||||
if (perm) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
} else if (count == 1) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NO_SUCH_ENTRY,
|
||||
last, ci->name);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NO_MATCH,
|
||||
ci->name);
|
||||
}
|
||||
} else if (deleted == 1) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DELETED_ONE,
|
||||
ci->name);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DELETED_SEVERAL,
|
||||
deleted, ci->name);
|
||||
}
|
||||
} else {
|
||||
na = findnick(nick);
|
||||
if (!na) {
|
||||
notice_lang(s_ChanServ, u, NICK_X_NOT_REGISTERED, nick);
|
||||
if (ci->access.size() >= CSAccessMax)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_REACHED_LIMIT, CSAccessMax);
|
||||
return MOD_CONT;
|
||||
}
|
||||
nc = na->nc;
|
||||
for (i = 0; i < ci->accesscount; i++) {
|
||||
if (ci->access[i].nc == nc)
|
||||
break;
|
||||
}
|
||||
if (i == ci->accesscount) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NOT_FOUND, nick,
|
||||
chan);
|
||||
|
||||
ci->AddAccess(nc, level);
|
||||
|
||||
FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, u, na->nick, level));
|
||||
|
||||
alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ulev, level, na->nick, nc->display, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_ADDED, nc->display, ci->name, level);
|
||||
}
|
||||
else if (cmd == "DEL")
|
||||
{
|
||||
int deleted;
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
access = &ci->access[i];
|
||||
if (!is_servadmin && get_access(u, ci) <= access->level) {
|
||||
deleted = 0;
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DELETED,
|
||||
access->nc->display, ci->name);
|
||||
alog("%s: %s!%s@%s (level %d) deleted access of %s (group %s) on %s", s_ChanServ, u->nick, u->username, u->host, get_access(u, ci), na->nick, access->nc->display, chan);
|
||||
access->nc = NULL;
|
||||
access->in_use = 0;
|
||||
deleted = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (deleted) {
|
||||
/* Reordering - DrStein */
|
||||
for (b = 0; b < ci->accesscount; b++) {
|
||||
if (ci->access[b].in_use) {
|
||||
for (a = 0; a < ci->accesscount; a++) {
|
||||
if (a > b)
|
||||
break;
|
||||
if (!ci->access[a].in_use) {
|
||||
ci->access[a].in_use = 1;
|
||||
ci->access[a].level = ci->access[b].level;
|
||||
ci->access[a].nc = ci->access[b].nc;
|
||||
ci->access[a].last_seen =
|
||||
ci->access[b].last_seen;
|
||||
ci->access[b].nc = NULL;
|
||||
ci->access[b].in_use = 0;
|
||||
break;
|
||||
}
|
||||
if (ci->access.empty())
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_EMPTY, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
/* Special case: is it a number/list? Only do search if it isn't. */
|
||||
if (isdigit(*nick) && strspn(nick, "1234567890,-") == strlen(nick))
|
||||
{
|
||||
int count, last = -1, perm = 0;
|
||||
deleted = process_numlist(nick, &count, access_del_callback, u, ci, &last, &perm, get_access(u, ci));
|
||||
if (!deleted)
|
||||
{
|
||||
if (perm)
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
else if (count == 1)
|
||||
{
|
||||
last = atoi(nick);
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NO_SUCH_ENTRY, last, ci->name);
|
||||
}
|
||||
else
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NO_MATCH, ci->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
alog("%s: %s!%s@%s (level %d) deleted access of user%s %s on %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, get_access(u, ci), deleted == 1 ? "" : "s", nick, chan);
|
||||
if (deleted == 1)
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DELETED_ONE, ci->name);
|
||||
else
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DELETED_SEVERAL, deleted, ci->name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
na = findnick(nick);
|
||||
if (!na)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, NICK_X_NOT_REGISTERED, nick);
|
||||
return MOD_CONT;
|
||||
}
|
||||
nc = na->nc;
|
||||
access = ci->GetAccess(nc);
|
||||
if (!access)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NOT_FOUND, nick, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (get_access(u, ci) <= access->level && !u->nc->HasPriv("chanserv/access/modify"))
|
||||
{
|
||||
deleted = 0;
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
}
|
||||
else
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DELETED, access->nc->display, ci->name);
|
||||
alog("%s: %s!%s@%s (level %d) deleted access of %s (group %s) on %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, get_access(u, ci), na->nick, access->nc->display, chan);
|
||||
access->nc = NULL;
|
||||
access->in_use = 0;
|
||||
deleted = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* After reordering only the entries at the end could still be empty.
|
||||
* We ll free the places no longer in use... */
|
||||
for (i = ci->accesscount - 1; i >= 0; i--) {
|
||||
if (ci->access[i].in_use == 1)
|
||||
break;
|
||||
if (deleted)
|
||||
{
|
||||
/* We'll free the access entries no longer in use... */
|
||||
ci->CleanAccess();
|
||||
|
||||
ci->accesscount--;
|
||||
/* We don't know the nick if someone used numbers, so we trigger the event without
|
||||
* nick param. We just do this once, even if someone enters a range. -Certus */
|
||||
FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, u, (na->nick ? na->nick : NULL)));
|
||||
}
|
||||
ci->access =
|
||||
static_cast<ChanAccess *>(srealloc(ci->access,sizeof(ChanAccess) * ci->accesscount));
|
||||
}
|
||||
else if (cmd == "LIST")
|
||||
{
|
||||
int sent_header = 0;
|
||||
|
||||
/* We don't know the nick if someone used numbers, so we trigger the event without
|
||||
* nick param. We just do this once, even if someone enters a range. -Certus */
|
||||
if (na)
|
||||
send_event(EVENT_ACCESS_DEL, 3, ci->name, u->nick, na->nick);
|
||||
if (ci->access.empty())
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_EMPTY, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (nick && strspn(nick, "1234567890,-") == strlen(nick))
|
||||
process_numlist(nick, NULL, access_list_callback, u, ci, &sent_header);
|
||||
else
|
||||
send_event(EVENT_ACCESS_DEL, 2, ci->name, u->nick);
|
||||
}
|
||||
} else if (stricmp(cmd, "LIST") == 0) {
|
||||
int sent_header = 0;
|
||||
|
||||
if (ci->accesscount == 0) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_EMPTY, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (nick && strspn(nick, "1234567890,-") == strlen(nick)) {
|
||||
process_numlist(nick, NULL, access_list_callback, u, ci,
|
||||
&sent_header);
|
||||
} else {
|
||||
for (i = 0; i < ci->accesscount; i++) {
|
||||
if (nick && ci->access[i].nc
|
||||
&& !match_wild_nocase(nick, ci->access[i].nc->display))
|
||||
continue;
|
||||
access_list(u, i, ci, &sent_header);
|
||||
{
|
||||
for (i = 0; i < ci->access.size(); i++)
|
||||
{
|
||||
access = ci->GetAccess(i);
|
||||
if (nick && access->nc && !Anope::Match(access->nc->display, nick, false))
|
||||
continue;
|
||||
access_list(u, i, ci, &sent_header);
|
||||
}
|
||||
}
|
||||
if (!sent_header)
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NO_MATCH, chan);
|
||||
else
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_FOOTER, ci->name);
|
||||
}
|
||||
if (!sent_header) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_NO_MATCH, chan);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_LIST_FOOTER, ci->name);
|
||||
else if (cmd == "CLEAR")
|
||||
{
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
ci->ClearAccess();
|
||||
|
||||
FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, u));
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_CLEAR, ci->name);
|
||||
alog("%s: %s!%s@%s (level %d) cleared access list on %s",
|
||||
s_ChanServ, u->nick, u->GetIdent().c_str(), u->host,
|
||||
get_access(u, ci), chan);
|
||||
|
||||
}
|
||||
} else if (stricmp(cmd, "CLEAR") == 0) {
|
||||
else
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (readonly) {
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_DISABLED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_ACCESS);
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_ACCESS_LEVELS);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!is_servadmin && !is_founder(u, ci)) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
free(ci->access);
|
||||
ci->access = NULL;
|
||||
ci->accesscount = 0;
|
||||
|
||||
send_event(EVENT_ACCESS_CLEAR, 2, ci->name, u->nick);
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_ACCESS_CLEAR, ci->name);
|
||||
alog("%s: %s!%s@%s (level %d) cleared access list on %s",
|
||||
s_ChanServ, u->nick, u->username, u->host,
|
||||
get_access(u, ci), chan);
|
||||
|
||||
} else {
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "ACCESS", CHAN_ACCESS_SYNTAX);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int do_levels(User * u)
|
||||
class CommandCSLevels : public Command
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *cmd = strtok(NULL, " ");
|
||||
char *what = strtok(NULL, " ");
|
||||
char *s = strtok(NULL, " ");
|
||||
char *error;
|
||||
public:
|
||||
CommandCSLevels() : Command("LEVELS", 2, 4)
|
||||
{
|
||||
}
|
||||
|
||||
ChannelInfo *ci;
|
||||
int level;
|
||||
int i;
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ci::string cmd = params[1];
|
||||
const char *what = params.size() > 2 ? params[2].c_str() : NULL;
|
||||
const char *s = params.size() > 3 ? params[3].c_str() : NULL;
|
||||
char *error;
|
||||
|
||||
/* If SET, we want two extra parameters; if DIS[ABLE] or FOUNDER, we want only
|
||||
* one; else, we want none.
|
||||
*/
|
||||
if (!cmd
|
||||
|| ((stricmp(cmd, "SET") == 0) ? !s
|
||||
: ((strnicmp(cmd, "DIS", 3) == 0)) ? (!what || s) : !!what)) {
|
||||
syntax_error(s_ChanServ, u, "LEVELS", CHAN_LEVELS_SYNTAX);
|
||||
} else if (!(ci = cs_findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (ci->flags & CI_XOP) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_XOP);
|
||||
} else if (!is_founder(u, ci) && !is_services_admin(u)) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else if (stricmp(cmd, "SET") == 0) {
|
||||
level = strtol(s, &error, 10);
|
||||
ChannelInfo *ci = cs_findchan(chan);
|
||||
int level;
|
||||
int i;
|
||||
|
||||
if (*error != '\0') {
|
||||
syntax_error(s_ChanServ, u, "LEVELS", CHAN_LEVELS_SYNTAX);
|
||||
return MOD_CONT;
|
||||
}
|
||||
/* If SET, we want two extra parameters; if DIS[ABLE] or FOUNDER, we want only
|
||||
* one; else, we want none.
|
||||
*/
|
||||
if (cmd == "SET" ? !s : (cmd.substr(0, 3) == "DIS" ? (!what || s) : !!what))
|
||||
this->OnSyntaxError(u);
|
||||
else if (ci->flags & CI_XOP)
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_XOP);
|
||||
else if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
else if (cmd == "SET") {
|
||||
level = strtol(s, &error, 10);
|
||||
|
||||
if (level <= ACCESS_INVALID || level >= ACCESS_FOUNDER) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_RANGE,
|
||||
ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
if (stricmp(levelinfo[i].name, what) == 0) {
|
||||
ci->levels[levelinfo[i].what] = level;
|
||||
|
||||
alog("%s: %s!%s@%s set level %s on channel %s to %d",
|
||||
s_ChanServ, u->nick, u->username, u->host,
|
||||
levelinfo[i].name, ci->name, level);
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_CHANGED,
|
||||
levelinfo[i].name, chan, level);
|
||||
if (*error != '\0') {
|
||||
this->OnSyntaxError(u);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what, s_ChanServ);
|
||||
|
||||
} else if (stricmp(cmd, "DIS") == 0 || stricmp(cmd, "DISABLE") == 0) {
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
if (stricmp(levelinfo[i].name, what) == 0) {
|
||||
ci->levels[levelinfo[i].what] = ACCESS_INVALID;
|
||||
|
||||
alog("%s: %s!%s@%s disabled level %s on channel %s",
|
||||
s_ChanServ, u->nick, u->username, u->host,
|
||||
levelinfo[i].name, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_DISABLED,
|
||||
levelinfo[i].name, chan);
|
||||
if (level <= ACCESS_INVALID || level >= ACCESS_FOUNDER) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_RANGE,
|
||||
ACCESS_INVALID + 1, ACCESS_FOUNDER - 1);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what, s_ChanServ);
|
||||
} else if (stricmp(cmd, "LIST") == 0) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_HEADER, chan);
|
||||
|
||||
if (!levelinfo_maxwidth) {
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
int len = strlen(levelinfo[i].name);
|
||||
if (len > levelinfo_maxwidth)
|
||||
levelinfo_maxwidth = len;
|
||||
if (stricmp(levelinfo[i].name, what) == 0) {
|
||||
ci->levels[levelinfo[i].what] = level;
|
||||
|
||||
alog("%s: %s!%s@%s set level %s on channel %s to %d",
|
||||
s_ChanServ, u->nick, u->GetIdent().c_str(), u->host,
|
||||
levelinfo[i].name, ci->name, level);
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_CHANGED,
|
||||
levelinfo[i].name, chan, level);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
int j = ci->levels[levelinfo[i].what];
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what, s_ChanServ);
|
||||
|
||||
if (j == ACCESS_INVALID) {
|
||||
j = levelinfo[i].what;
|
||||
} else if (cmd == "DIS" || cmd == "DISABLE") {
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
if (stricmp(levelinfo[i].name, what) == 0) {
|
||||
ci->levels[levelinfo[i].what] = ACCESS_INVALID;
|
||||
|
||||
if (j == CA_AUTOOP || j == CA_AUTODEOP || j == CA_AUTOVOICE
|
||||
|| j == CA_NOJOIN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_DISABLED,
|
||||
alog("%s: %s!%s@%s disabled level %s on channel %s",
|
||||
s_ChanServ, u->nick, u->GetIdent().c_str(), u->host,
|
||||
levelinfo[i].name, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_DISABLED,
|
||||
levelinfo[i].name, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_UNKNOWN, what, s_ChanServ);
|
||||
} else if (cmd == "LIST") {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_HEADER, chan);
|
||||
|
||||
if (!levelinfo_maxwidth) {
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
int len = strlen(levelinfo[i].name);
|
||||
if (len > levelinfo_maxwidth)
|
||||
levelinfo_maxwidth = len;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
int j = ci->levels[levelinfo[i].what];
|
||||
|
||||
if (j == ACCESS_INVALID) {
|
||||
j = levelinfo[i].what;
|
||||
|
||||
if (j == CA_AUTOOP || j == CA_AUTODEOP || j == CA_AUTOVOICE
|
||||
|| j == CA_NOJOIN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_DISABLED,
|
||||
levelinfo_maxwidth, levelinfo[i].name);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_DISABLED,
|
||||
levelinfo_maxwidth, levelinfo[i].name);
|
||||
}
|
||||
} else if (j == ACCESS_FOUNDER) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_FOUNDER,
|
||||
levelinfo_maxwidth, levelinfo[i].name);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_DISABLED,
|
||||
levelinfo_maxwidth, levelinfo[i].name);
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_NORMAL,
|
||||
levelinfo_maxwidth, levelinfo[i].name, j);
|
||||
}
|
||||
} else if (j == ACCESS_FOUNDER) {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_FOUNDER,
|
||||
levelinfo_maxwidth, levelinfo[i].name);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_LIST_NORMAL,
|
||||
levelinfo_maxwidth, levelinfo[i].name, j);
|
||||
}
|
||||
|
||||
} else if (cmd == "RESET") {
|
||||
reset_levels(ci);
|
||||
|
||||
alog("%s: %s!%s@%s reset levels definitions on channel %s",
|
||||
s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_RESET, chan);
|
||||
} else {
|
||||
this->OnSyntaxError(u);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
} else if (stricmp(cmd, "RESET") == 0) {
|
||||
reset_levels(ci);
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_LEVELS);
|
||||
return true;
|
||||
}
|
||||
|
||||
alog("%s: %s!%s@%s reset levels definitions on channel %s",
|
||||
s_ChanServ, u->nick, u->username, u->host, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_LEVELS_RESET, chan);
|
||||
} else {
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "LEVELS", CHAN_LEVELS_SYNTAX);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT("cs_access", CSAccess)
|
||||
|
||||
class CSAccess : public Module
|
||||
{
|
||||
public:
|
||||
CSAccess(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
this->AddCommand(CHANSERV, new CommandCSAccess());
|
||||
this->AddCommand(CHANSERV, new CommandCSLevels());
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_ACCESS);
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LEVELS);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
MODULE_INIT(CSAccess)
|
||||
|
||||
+537
-514
File diff suppressed because it is too large
Load Diff
+151
-186
@@ -15,202 +15,167 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_unban(User * u);
|
||||
int do_ban(User * u);
|
||||
void myChanServHelp(User * u);
|
||||
class CommandCSBan : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSBan() : Command("BAN", 2, 3)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
const char *target = params[1].c_str();
|
||||
const char *reason = NULL;
|
||||
|
||||
if (params.size() > 2)
|
||||
{
|
||||
params[2].resize(200);
|
||||
reason = params[2].c_str();
|
||||
}
|
||||
|
||||
Channel *c = findchan(chan);
|
||||
ChannelInfo *ci;
|
||||
User *u2;
|
||||
|
||||
int is_same;
|
||||
|
||||
if (!reason)
|
||||
reason = "Requested";
|
||||
|
||||
is_same = (stricmp(target, u->nick) == 0);
|
||||
|
||||
if (c)
|
||||
ci = c->ci;
|
||||
|
||||
if (!c) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
|
||||
} else if (is_same ? !(u2 = u) : !(u2 = finduser(target))) {
|
||||
notice_lang(s_ChanServ, u, NICK_X_NOT_IN_USE, target);
|
||||
} else if (!is_same ? !check_access(u, ci, CA_BAN) :
|
||||
!check_access(u, ci, CA_BANME)) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else if (!is_same && (ci->flags & CI_PEACE)
|
||||
&& (get_access(u2, ci) >= get_access(u, ci))) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
/*
|
||||
* Dont ban/kick the user on channels where he is excepted
|
||||
* to prevent services <-> server wars.
|
||||
*/
|
||||
} else if (ircd->except && is_excepted(ci, u2)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_EXCEPTED, u2->nick, ci->name);
|
||||
} else if (ircd->protectedumode && is_protected(u2)) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else {
|
||||
const char *av[3];
|
||||
char mask[BUFSIZE];
|
||||
|
||||
av[0] = "+b";
|
||||
get_idealban(ci, u2, mask, sizeof(mask));
|
||||
av[1] = mask;
|
||||
ircdproto->SendMode(whosends(ci), c->name, "+b %s", av[1]);
|
||||
chan_set_modes(s_ChanServ, c, 2, av, 1);
|
||||
|
||||
/* We still allow host banning while not allowing to kick */
|
||||
if (!is_on_chan(c, u2))
|
||||
return MOD_CONT;
|
||||
|
||||
if ((ci->flags & CI_SIGNKICK)
|
||||
|| ((ci->flags & CI_SIGNKICK_LEVEL)
|
||||
&& !check_access(u, ci, CA_SIGNKICK)))
|
||||
ircdproto->SendKick(whosends(ci), ci->name, target, "%s (%s)",
|
||||
reason, u->nick);
|
||||
else
|
||||
ircdproto->SendKick(whosends(ci), ci->name, target, "%s", reason);
|
||||
|
||||
const char *kav[4];
|
||||
kav[0] = ci->name;
|
||||
kav[1] = target;
|
||||
kav[2] = reason;
|
||||
do_kick(s_ChanServ, 3, kav);
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_BAN);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "BAN", CHAN_BAN_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class CommandCSUnban : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSUnban() : Command("UNBAN", 1, 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
Channel *c;
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (!(c = findchan(chan)))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
ci = c->ci;
|
||||
|
||||
if (!check_access(u, ci, CA_UNBAN))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
common_unban(ci, u->nick);
|
||||
notice_lang(s_ChanServ, u, CHAN_UNBANNED, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_UNBAN);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "UNBAN", CHAN_UNBAN_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class CSBan : public Module
|
||||
{
|
||||
public:
|
||||
CSBan(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("BAN", do_ban, NULL, CHAN_HELP_BAN, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("UNBAN", do_unban, NULL, CHAN_HELP_UNBAN, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
this->AddCommand(CHANSERV, new CommandCSBan());
|
||||
this->AddCommand(CHANSERV, new CommandCSUnban());
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_BAN);
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_UNBAN);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_BAN);
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_UNBAN);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /cs ban command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_ban(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *params = strtok(NULL, " ");
|
||||
char *reason = strtok(NULL, "");
|
||||
|
||||
Channel *c;
|
||||
ChannelInfo *ci;
|
||||
User *u2;
|
||||
|
||||
int is_same;
|
||||
|
||||
if (!reason) {
|
||||
reason = const_cast<char *>("Requested"); // XXX unsafe cast -- w00t
|
||||
} else {
|
||||
if (strlen(reason) > 200)
|
||||
reason[200] = '\0';
|
||||
}
|
||||
|
||||
if (!chan) {
|
||||
struct u_chanlist *uc, *next;
|
||||
|
||||
/* Bans the user on every channels he is on. */
|
||||
|
||||
for (uc = u->chans; uc; uc = next) {
|
||||
next = uc->next;
|
||||
if ((ci = uc->chan->ci) && !(ci->flags & CI_VERBOTEN)
|
||||
&& check_access(u, ci, CA_BANME)) {
|
||||
const char *av[3];
|
||||
char mask[BUFSIZE];
|
||||
|
||||
/*
|
||||
* Dont ban/kick the user on channels where he is excepted
|
||||
* to prevent services <-> server wars.
|
||||
*/
|
||||
if (ircd->except) {
|
||||
if (is_excepted(ci, u))
|
||||
notice_lang(s_ChanServ, u, CHAN_EXCEPTED,
|
||||
u->nick, ci->name);
|
||||
continue;
|
||||
}
|
||||
if (is_protected(u)) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
continue;
|
||||
}
|
||||
|
||||
av[0] = "+b";
|
||||
get_idealban(ci, u, mask, sizeof(mask));
|
||||
av[1] = mask;
|
||||
ircdproto->SendMode(whosends(ci), uc->chan->name, "+b %s",
|
||||
av[1]);
|
||||
chan_set_modes(s_ChanServ, uc->chan, 2, av, 1);
|
||||
|
||||
if ((ci->flags & CI_SIGNKICK)
|
||||
|| ((ci->flags & CI_SIGNKICK_LEVEL)
|
||||
&& !check_access(u, ci, CA_SIGNKICK)))
|
||||
ircdproto->SendKick(whosends(ci), ci->name, u->nick,
|
||||
"%s (%s)", reason, u->nick);
|
||||
else
|
||||
ircdproto->SendKick(whosends(ci), ci->name, u->nick, "%s",
|
||||
reason);
|
||||
|
||||
const char *kav[4];
|
||||
kav[0] = ci->name;
|
||||
kav[1] = u->nick;
|
||||
kav[2] = reason;
|
||||
do_kick(s_ChanServ, 3, kav);
|
||||
}
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
} else if (!params) {
|
||||
params = u->nick;
|
||||
}
|
||||
|
||||
is_same = (params == u->nick) ? 1 : (stricmp(params, u->nick) == 0);
|
||||
|
||||
if (!(c = findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
|
||||
} else if (!(ci = c->ci)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (is_same ? !(u2 = u) : !(u2 = finduser(params))) {
|
||||
notice_lang(s_ChanServ, u, NICK_X_NOT_IN_USE, params);
|
||||
} else if (!is_same ? !check_access(u, ci, CA_BAN) :
|
||||
!check_access(u, ci, CA_BANME)) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else if (!is_same && (ci->flags & CI_PEACE)
|
||||
&& (get_access(u2, ci) >= get_access(u, ci))) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
/*
|
||||
* Dont ban/kick the user on channels where he is excepted
|
||||
* to prevent services <-> server wars.
|
||||
*/
|
||||
} else if (ircd->except && is_excepted(ci, u2)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_EXCEPTED, u2->nick, ci->name);
|
||||
} else if (ircd->protectedumode && is_protected(u2)) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
} else {
|
||||
const char *av[3];
|
||||
char mask[BUFSIZE];
|
||||
|
||||
av[0] = "+b";
|
||||
get_idealban(ci, u2, mask, sizeof(mask));
|
||||
av[1] = mask;
|
||||
ircdproto->SendMode(whosends(ci), c->name, "+b %s", av[1]);
|
||||
chan_set_modes(s_ChanServ, c, 2, av, 1);
|
||||
|
||||
/* We still allow host banning while not allowing to kick */
|
||||
if (!is_on_chan(c, u2))
|
||||
return MOD_CONT;
|
||||
|
||||
if ((ci->flags & CI_SIGNKICK)
|
||||
|| ((ci->flags & CI_SIGNKICK_LEVEL)
|
||||
&& !check_access(u, ci, CA_SIGNKICK)))
|
||||
ircdproto->SendKick(whosends(ci), ci->name, params, "%s (%s)",
|
||||
reason, u->nick);
|
||||
else
|
||||
ircdproto->SendKick(whosends(ci), ci->name, params, "%s", reason);
|
||||
|
||||
const char *kav[4];
|
||||
kav[0] = ci->name;
|
||||
kav[1] = params;
|
||||
kav[2] = reason;
|
||||
do_kick(s_ChanServ, 3, kav);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
/**
|
||||
* The /cs unban command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_unban(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
Channel *c;
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (!chan) {
|
||||
syntax_error(s_ChanServ, u, "UNBAN", CHAN_UNBAN_SYNTAX);
|
||||
} else if (!(c = findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
|
||||
} else if (!(ci = c->ci)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (!check_access(u, ci, CA_UNBAN)) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
} else {
|
||||
common_unban(ci, u->nick);
|
||||
notice_lang(s_ChanServ, u, CHAN_UNBANNED, chan);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_ban", CSBan)
|
||||
MODULE_INIT(CSBan)
|
||||
|
||||
+328
-332
@@ -15,347 +15,343 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_clear(User * u);
|
||||
void myChanServHelp(User * u);
|
||||
class CommandCSClear : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSClear() : Command("CLEAR", 2, 2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ci::string what = params[1];
|
||||
Channel *c = findchan(chan);
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (c)
|
||||
ci = c->ci;
|
||||
|
||||
if (!c) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
|
||||
} else if (!u || !check_access(u, ci, CA_CLEAR)) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else if (what == "bans") {
|
||||
const char *av[2];
|
||||
Entry *ban, *bnext;
|
||||
|
||||
if (c->bans && c->bans->count) {
|
||||
for (ban = c->bans->entries; ban; ban = bnext) {
|
||||
bnext = ban->next;
|
||||
av[0] = "-b";
|
||||
av[1] = ban->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-b %s", ban->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_BANS, chan);
|
||||
} else if (ircd->except && what == "excepts") {
|
||||
const char *av[2];
|
||||
Entry *except, *bnext;
|
||||
|
||||
if (c->excepts && c->excepts->count) {
|
||||
for (except = c->excepts->entries; except; except = bnext) {
|
||||
bnext = except->next;
|
||||
av[0] = "-e";
|
||||
av[1] = except->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-e %s", except->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_EXCEPTS, chan);
|
||||
|
||||
} else if (ircd->invitemode && what == "invites") {
|
||||
const char *av[2];
|
||||
Entry *invite, *bnext;
|
||||
|
||||
if (c->invites && c->invites->count) {
|
||||
for (invite = c->invites->entries; invite; invite = bnext) {
|
||||
bnext = invite->next;
|
||||
av[0] = "-I";
|
||||
av[1] = invite->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-I %s", invite->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_INVITES, chan);
|
||||
|
||||
} else if (what == "modes") {
|
||||
const char *argv[2];
|
||||
|
||||
if (c->mode) {
|
||||
/* Clear modes the bulk of the modes */
|
||||
ircdproto->SendMode(whosends(ci), c->name, "%s",
|
||||
ircd->modestoremove);
|
||||
argv[0] = ircd->modestoremove;
|
||||
chan_set_modes(whosends(ci)->nick, c, 1, argv, 0);
|
||||
|
||||
/* to prevent the internals from complaining send -k, -L, -f by themselves if we need
|
||||
to send them - TSL */
|
||||
if (c->key) {
|
||||
ircdproto->SendMode(whosends(ci), c->name, "-k %s", c->key);
|
||||
argv[0] = "-k";
|
||||
argv[1] = c->key;
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, argv, 0);
|
||||
}
|
||||
if (ircd->Lmode && c->redirect) {
|
||||
ircdproto->SendMode(whosends(ci), c->name, "-L %s",
|
||||
c->redirect);
|
||||
argv[0] = "-L";
|
||||
argv[1] = c->redirect;
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, argv, 0);
|
||||
}
|
||||
if (ircd->fmode && c->flood) {
|
||||
if (flood_mode_char_remove) {
|
||||
ircdproto->SendMode(whosends(ci), c->name, "%s %s",
|
||||
flood_mode_char_remove, c->flood);
|
||||
argv[0] = flood_mode_char_remove;
|
||||
argv[1] = c->flood;
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, argv, 0);
|
||||
} else {
|
||||
if (debug) {
|
||||
alog("debug: flood_mode_char_remove was not set unable to remove flood/throttle modes");
|
||||
}
|
||||
}
|
||||
}
|
||||
check_modes(c);
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_MODES, chan);
|
||||
} else if (what == "ops") {
|
||||
const char *av[6]; /* The max we have to hold: chan, ts, modes(max3), nick, nick, nick */
|
||||
int ac, isop, isadmin, isown, count, i;
|
||||
char buf[BUFSIZE], tmp[BUFSIZE], tmp2[BUFSIZE];
|
||||
struct c_userlist *cu, *bnext;
|
||||
|
||||
if (ircd->svsmode_ucmode) {
|
||||
av[0] = chan;
|
||||
ircdproto->SendSVSModeChan(av[0], "-o", NULL);
|
||||
if (ircd->owner) {
|
||||
ircdproto->SendSVSModeChan(av[0], ircd->ownerunset, NULL);
|
||||
}
|
||||
if (ircd->protect || ircd->admin) {
|
||||
ircdproto->SendSVSModeChan(av[0], ircd->adminunset, NULL);
|
||||
}
|
||||
for (cu = c->users; cu; cu = bnext) {
|
||||
bnext = cu->next;
|
||||
isop = chan_has_user_status(c, cu->user, CUS_OP);
|
||||
isadmin = chan_has_user_status(c, cu->user, CUS_PROTECT);
|
||||
isown = chan_has_user_status(c, cu->user, CUS_OWNER);
|
||||
count = (isop ? 1 : 0) + (isadmin ? 1 : 0) + (isown ? 1 : 0);
|
||||
|
||||
if (!isop && !isadmin && !isown)
|
||||
continue;
|
||||
|
||||
snprintf(tmp, BUFSIZE, "-%s%s%s", (isop ? "o" : ""), (isadmin ?
|
||||
ircd->adminunset+1 : ""), (isown ? ircd->ownerunset+1 : ""));
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long>(time(NULL)));
|
||||
av[1] = buf;
|
||||
av[2] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+3] = cu->user->nick;
|
||||
ac = 3 + i;
|
||||
} else {
|
||||
av[1] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+2] = cu->user->nick;
|
||||
ac = 2 + i;
|
||||
}
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
} else {
|
||||
av[0] = chan;
|
||||
for (cu = c->users; cu; cu = bnext) {
|
||||
bnext = cu->next;
|
||||
isop = chan_has_user_status(c, cu->user, CUS_OP);
|
||||
isadmin = chan_has_user_status(c, cu->user, CUS_PROTECT);
|
||||
isown = chan_has_user_status(c, cu->user, CUS_OWNER);
|
||||
count = (isop ? 1 : 0) + (isadmin ? 1 : 0) + (isown ? 1 : 0);
|
||||
|
||||
if (!isop && !isadmin && !isown)
|
||||
continue;
|
||||
|
||||
snprintf(tmp, BUFSIZE, "-%s%s%s", (isop ? "o" : ""), (isadmin ?
|
||||
ircd->adminunset+1 : ""), (isown ? ircd->ownerunset+1 : ""));
|
||||
/* We need to send the IRCd a nick for every mode.. - Viper */
|
||||
snprintf(tmp2, BUFSIZE, "%s %s %s", (isop ? cu->user->nick : ""),
|
||||
(isadmin ? cu->user->nick : ""), (isown ? cu->user->nick : ""));
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long>(time(NULL)));
|
||||
av[1] = buf;
|
||||
av[2] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+3] = cu->user->nick;
|
||||
ac = 3 + i;
|
||||
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[2], tmp2);
|
||||
} else {
|
||||
av[1] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+2] = cu->user->nick;
|
||||
ac = 2 + i;
|
||||
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[1], tmp2);
|
||||
}
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_OPS, chan);
|
||||
} else if (ircd->halfop && what == "hops") {
|
||||
const char *av[4];
|
||||
int ac;
|
||||
char buf[BUFSIZE];
|
||||
struct c_userlist *cu, *bnext;
|
||||
|
||||
for (cu = c->users; cu; cu = bnext) {
|
||||
bnext = cu->next;
|
||||
if (!chan_has_user_status(c, cu->user, CUS_HALFOP))
|
||||
continue;
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long>(time(NULL)));
|
||||
av[0] = chan;
|
||||
av[1] = buf;
|
||||
av[2] = "-h";
|
||||
av[3] = cu->user->nick;
|
||||
ac = 4;
|
||||
} else {
|
||||
av[0] = chan;
|
||||
av[1] = "-h";
|
||||
av[2] = cu->user->nick;
|
||||
ac = 3;
|
||||
}
|
||||
|
||||
if (ircd->svsmode_ucmode) {
|
||||
if (ircdcap->tsmode)
|
||||
ircdproto->SendSVSModeChan(av[0], av[2], NULL);
|
||||
else
|
||||
ircdproto->SendSVSModeChan(av[0], av[1], NULL);
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
break;
|
||||
} else {
|
||||
if (ircdcap->tsmode)
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[2],
|
||||
av[3]);
|
||||
else
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[1],
|
||||
av[2]);
|
||||
}
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_HOPS, chan);
|
||||
} else if (what == "voices") {
|
||||
const char *av[4];
|
||||
int ac;
|
||||
char buf[BUFSIZE];
|
||||
struct c_userlist *cu, *bnext;
|
||||
|
||||
for (cu = c->users; cu; cu = bnext) {
|
||||
bnext = cu->next;
|
||||
if (!chan_has_user_status(c, cu->user, CUS_VOICE))
|
||||
continue;
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long int>(time(NULL)));
|
||||
av[0] = chan;
|
||||
av[1] = buf;
|
||||
av[2] = "-v";
|
||||
av[3] = cu->user->nick;
|
||||
ac = 4;
|
||||
} else {
|
||||
av[0] = chan;
|
||||
av[1] = "-v";
|
||||
av[2] = cu->user->nick;
|
||||
ac = 3;
|
||||
}
|
||||
|
||||
if (ircd->svsmode_ucmode) {
|
||||
if (ircdcap->tsmode)
|
||||
ircdproto->SendSVSModeChan(av[0], av[2], NULL);
|
||||
else
|
||||
ircdproto->SendSVSModeChan(av[0], av[1], NULL);
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
break;
|
||||
} else {
|
||||
if (ircdcap->tsmode) {
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[2],
|
||||
av[3]);
|
||||
} else {
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[1],
|
||||
av[2]);
|
||||
}
|
||||
}
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_VOICES, chan);
|
||||
} else if (what == "users") {
|
||||
const char *av[3];
|
||||
struct c_userlist *cu, *bnext;
|
||||
char buf[256];
|
||||
|
||||
snprintf(buf, sizeof(buf), "CLEAR USERS command from %s", u->nick);
|
||||
|
||||
for (cu = c->users; cu; cu = bnext) {
|
||||
bnext = cu->next;
|
||||
av[0] = sstrdup(chan);
|
||||
av[1] = sstrdup(cu->user->nick);
|
||||
av[2] = sstrdup(buf);
|
||||
ircdproto->SendKick(whosends(ci), av[0], av[1], av[2]);
|
||||
do_kick(s_ChanServ, 3, av);
|
||||
delete [] av[2];
|
||||
delete [] av[1];
|
||||
delete [] av[0];
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_USERS, chan);
|
||||
} else {
|
||||
syntax_error(s_ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_CLEAR);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class CSClear : public Module
|
||||
{
|
||||
public:
|
||||
CSClear(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("CLEAR", do_clear, NULL, CHAN_HELP_CLEAR, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
this->AddCommand(CHANSERV, new CommandCSClear());
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_CLEAR);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_CLEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /cs clear command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_clear(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *what = strtok(NULL, " ");
|
||||
Channel *c;
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (!what) {
|
||||
syntax_error(s_ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX);
|
||||
} else if (!(c = findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
|
||||
} else if (!(ci = c->ci)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (!u || !check_access(u, ci, CA_CLEAR)) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
} else if (stricmp(what, "bans") == 0) {
|
||||
const char *av[2];
|
||||
Entry *ban, *next;
|
||||
|
||||
if (c->bans && c->bans->count) {
|
||||
for (ban = c->bans->entries; ban; ban = next) {
|
||||
next = ban->next;
|
||||
av[0] = "-b";
|
||||
av[1] = ban->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-b %s", ban->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_BANS, chan);
|
||||
} else if (ircd->except && stricmp(what, "excepts") == 0) {
|
||||
const char *av[2];
|
||||
Entry *except, *next;
|
||||
|
||||
if (c->excepts && c->excepts->count) {
|
||||
for (except = c->excepts->entries; except; except = next) {
|
||||
next = except->next;
|
||||
av[0] = "-e";
|
||||
av[1] = except->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-e %s", except->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_EXCEPTS, chan);
|
||||
|
||||
} else if (ircd->invitemode && stricmp(what, "invites") == 0) {
|
||||
const char *av[2];
|
||||
Entry *invite, *next;
|
||||
|
||||
if (c->invites && c->invites->count) {
|
||||
for (invite = c->invites->entries; invite; invite = next) {
|
||||
next = invite->next;
|
||||
av[0] = "-I";
|
||||
av[1] = invite->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-I %s", invite->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_INVITES, chan);
|
||||
|
||||
} else if (stricmp(what, "modes") == 0) {
|
||||
const char *argv[2];
|
||||
|
||||
if (c->mode) {
|
||||
/* Clear modes the bulk of the modes */
|
||||
ircdproto->SendMode(whosends(ci), c->name, "%s",
|
||||
ircd->modestoremove);
|
||||
argv[0] = ircd->modestoremove;
|
||||
chan_set_modes(whosends(ci)->nick, c, 1, argv, 0);
|
||||
|
||||
/* to prevent the internals from complaining send -k, -L, -f by themselves if we need
|
||||
to send them - TSL */
|
||||
if (c->key) {
|
||||
ircdproto->SendMode(whosends(ci), c->name, "-k %s", c->key);
|
||||
argv[0] = "-k";
|
||||
argv[1] = c->key;
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, argv, 0);
|
||||
}
|
||||
if (ircd->Lmode && c->redirect) {
|
||||
ircdproto->SendMode(whosends(ci), c->name, "-L %s",
|
||||
c->redirect);
|
||||
argv[0] = "-L";
|
||||
argv[1] = c->redirect;
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, argv, 0);
|
||||
}
|
||||
if (ircd->fmode && c->flood) {
|
||||
if (flood_mode_char_remove) {
|
||||
ircdproto->SendMode(whosends(ci), c->name, "%s %s",
|
||||
flood_mode_char_remove, c->flood);
|
||||
argv[0] = flood_mode_char_remove;
|
||||
argv[1] = c->flood;
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, argv, 0);
|
||||
} else {
|
||||
if (debug) {
|
||||
alog("debug: flood_mode_char_remove was not set unable to remove flood/throttle modes");
|
||||
}
|
||||
}
|
||||
}
|
||||
check_modes(c);
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_MODES, chan);
|
||||
} else if (stricmp(what, "ops") == 0) {
|
||||
const char *av[6]; /* The max we have to hold: chan, ts, modes(max3), nick, nick, nick */
|
||||
int ac, isop, isadmin, isown, count, i;
|
||||
char buf[BUFSIZE], tmp[BUFSIZE], tmp2[BUFSIZE];
|
||||
struct c_userlist *cu, *next;
|
||||
|
||||
if (ircd->svsmode_ucmode) {
|
||||
av[0] = chan;
|
||||
ircdproto->SendSVSModeChan(av[0], "-o", NULL);
|
||||
if (ircd->owner) {
|
||||
ircdproto->SendSVSModeChan(av[0], ircd->ownerunset, NULL);
|
||||
}
|
||||
if (ircd->protect || ircd->admin) {
|
||||
ircdproto->SendSVSModeChan(av[0], ircd->adminunset, NULL);
|
||||
}
|
||||
for (cu = c->users; cu; cu = next) {
|
||||
next = cu->next;
|
||||
isop = chan_has_user_status(c, cu->user, CUS_OP);
|
||||
isadmin = chan_has_user_status(c, cu->user, CUS_PROTECT);
|
||||
isown = chan_has_user_status(c, cu->user, CUS_OWNER);
|
||||
count = (isop ? 1 : 0) + (isadmin ? 1 : 0) + (isown ? 1 : 0);
|
||||
|
||||
if (!isop && !isadmin && !isown)
|
||||
continue;
|
||||
|
||||
snprintf(tmp, BUFSIZE, "-%s%s%s", (isop ? "o" : ""), (isadmin ?
|
||||
ircd->adminunset+1 : ""), (isown ? ircd->ownerunset+1 : ""));
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long>(time(NULL)));
|
||||
av[1] = buf;
|
||||
av[2] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+3] = cu->user->nick;
|
||||
ac = 3 + i;
|
||||
} else {
|
||||
av[1] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+2] = cu->user->nick;
|
||||
ac = 2 + i;
|
||||
}
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
} else {
|
||||
av[0] = chan;
|
||||
for (cu = c->users; cu; cu = next) {
|
||||
next = cu->next;
|
||||
isop = chan_has_user_status(c, cu->user, CUS_OP);
|
||||
isadmin = chan_has_user_status(c, cu->user, CUS_PROTECT);
|
||||
isown = chan_has_user_status(c, cu->user, CUS_OWNER);
|
||||
count = (isop ? 1 : 0) + (isadmin ? 1 : 0) + (isown ? 1 : 0);
|
||||
|
||||
if (!isop && !isadmin && !isown)
|
||||
continue;
|
||||
|
||||
snprintf(tmp, BUFSIZE, "-%s%s%s", (isop ? "o" : ""), (isadmin ?
|
||||
ircd->adminunset+1 : ""), (isown ? ircd->ownerunset+1 : ""));
|
||||
/* We need to send the IRCd a nick for every mode.. - Viper */
|
||||
snprintf(tmp2, BUFSIZE, "%s %s %s", (isop ? cu->user->nick : ""),
|
||||
(isadmin ? cu->user->nick : ""), (isown ? cu->user->nick : ""));
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long>(time(NULL)));
|
||||
av[1] = buf;
|
||||
av[2] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+3] = cu->user->nick;
|
||||
ac = 3 + i;
|
||||
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[2], tmp2);
|
||||
} else {
|
||||
av[1] = tmp;
|
||||
/* We have to give as much nicks as modes.. - Viper */
|
||||
for (i = 0; i < count; i++)
|
||||
av[i+2] = cu->user->nick;
|
||||
ac = 2 + i;
|
||||
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[1], tmp2);
|
||||
}
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_OPS, chan);
|
||||
} else if (ircd->halfop && stricmp(what, "hops") == 0) {
|
||||
const char *av[4];
|
||||
int ac;
|
||||
char buf[BUFSIZE];
|
||||
struct c_userlist *cu, *next;
|
||||
|
||||
for (cu = c->users; cu; cu = next) {
|
||||
next = cu->next;
|
||||
if (!chan_has_user_status(c, cu->user, CUS_HALFOP))
|
||||
continue;
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long>(time(NULL)));
|
||||
av[0] = chan;
|
||||
av[1] = buf;
|
||||
av[2] = "-h";
|
||||
av[3] = cu->user->nick;
|
||||
ac = 4;
|
||||
} else {
|
||||
av[0] = chan;
|
||||
av[1] = "-h";
|
||||
av[2] = cu->user->nick;
|
||||
ac = 3;
|
||||
}
|
||||
|
||||
if (ircd->svsmode_ucmode) {
|
||||
if (ircdcap->tsmode)
|
||||
ircdproto->SendSVSModeChan(av[0], av[2], NULL);
|
||||
else
|
||||
ircdproto->SendSVSModeChan(av[0], av[1], NULL);
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
break;
|
||||
} else {
|
||||
if (ircdcap->tsmode)
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[2],
|
||||
av[3]);
|
||||
else
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[1],
|
||||
av[2]);
|
||||
}
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_HOPS, chan);
|
||||
} else if (stricmp(what, "voices") == 0) {
|
||||
const char *av[4];
|
||||
int ac;
|
||||
char buf[BUFSIZE];
|
||||
struct c_userlist *cu, *next;
|
||||
|
||||
for (cu = c->users; cu; cu = next) {
|
||||
next = cu->next;
|
||||
if (!chan_has_user_status(c, cu->user, CUS_VOICE))
|
||||
continue;
|
||||
|
||||
if (ircdcap->tsmode) {
|
||||
snprintf(buf, BUFSIZE - 1, "%ld", static_cast<long int>(time(NULL)));
|
||||
av[0] = chan;
|
||||
av[1] = buf;
|
||||
av[2] = "-v";
|
||||
av[3] = cu->user->nick;
|
||||
ac = 4;
|
||||
} else {
|
||||
av[0] = chan;
|
||||
av[1] = "-v";
|
||||
av[2] = cu->user->nick;
|
||||
ac = 3;
|
||||
}
|
||||
|
||||
if (ircd->svsmode_ucmode) {
|
||||
if (ircdcap->tsmode)
|
||||
ircdproto->SendSVSModeChan(av[0], av[2], NULL);
|
||||
else
|
||||
ircdproto->SendSVSModeChan(av[0], av[1], NULL);
|
||||
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
break;
|
||||
} else {
|
||||
if (ircdcap->tsmode) {
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[2],
|
||||
av[3]);
|
||||
} else {
|
||||
ircdproto->SendMode(whosends(ci), av[0], "%s %s", av[1],
|
||||
av[2]);
|
||||
}
|
||||
}
|
||||
do_cmode(s_ChanServ, ac, av);
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_VOICES, chan);
|
||||
} else if (stricmp(what, "users") == 0) {
|
||||
const char *av[3];
|
||||
struct c_userlist *cu, *next;
|
||||
char buf[256];
|
||||
|
||||
snprintf(buf, sizeof(buf), "CLEAR USERS command from %s", u->nick);
|
||||
|
||||
for (cu = c->users; cu; cu = next) {
|
||||
next = cu->next;
|
||||
av[0] = sstrdup(chan);
|
||||
av[1] = sstrdup(cu->user->nick);
|
||||
av[2] = sstrdup(buf);
|
||||
ircdproto->SendKick(whosends(ci), av[0], av[1], av[2]);
|
||||
do_kick(s_ChanServ, 3, av);
|
||||
delete [] av[2];
|
||||
delete [] av[1];
|
||||
delete [] av[0];
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_CLEARED_USERS, chan);
|
||||
} else {
|
||||
syntax_error(s_ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_clear", CSClear)
|
||||
MODULE_INIT(CSClear)
|
||||
|
||||
+84
-75
@@ -15,88 +15,64 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_drop(User * u);
|
||||
void myChanServHelp(User * u);
|
||||
|
||||
class CSDrop : public Module
|
||||
class CommandCSDrop : public Command
|
||||
{
|
||||
public:
|
||||
CSDrop(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
CommandCSDrop() : Command("DROP", 1, 1)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("DROP", do_drop, NULL, -1, CHAN_HELP_DROP, -1, CHAN_SERVADMIN_HELP_DROP, CHAN_SERVADMIN_HELP_DROP);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DROP);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /cs command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_drop(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
ChannelInfo *ci;
|
||||
int is_servadmin = is_services_admin(u);
|
||||
|
||||
if (readonly && !is_servadmin) {
|
||||
notice_lang(s_ChanServ, u, CHAN_DROP_DISABLED);
|
||||
return MOD_CONT;
|
||||
this->SetFlag(CFLAG_ALLOW_FORBIDDEN);
|
||||
this->SetFlag(CFLAG_ALLOW_SUSPENDED);
|
||||
}
|
||||
|
||||
if (!chan) {
|
||||
syntax_error(s_ChanServ, u, "DROP", CHAN_DROP_SYNTAX);
|
||||
} else if (!(ci = cs_findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (!is_servadmin && (ci->flags & CI_VERBOTEN)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (!is_servadmin && (ci->flags & CI_SUSPENDED)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (!is_servadmin
|
||||
&& (ci->
|
||||
flags & CI_SECUREFOUNDER ? !is_real_founder(u,
|
||||
ci) :
|
||||
!is_founder(u, ci))) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else {
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_DROP_DISABLED); // XXX: READ_ONLY_MODE?
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
ci = cs_findchan(chan);
|
||||
|
||||
if ((ci->flags & CI_FORBIDDEN) && !u->nc->HasCommand("chanserv/drop"))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if ((ci->flags & CI_SUSPENDED) && !u->nc->HasCommand("chanserv/drop"))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if ((ci->flags & CI_SECUREFOUNDER ? !is_real_founder(u, ci) : !is_founder(u, ci)) && !u->nc->HasCommand("chanserv/drop"))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
int level = get_access(u, ci);
|
||||
|
||||
if (readonly) /* in this case we know they're a Services admin */
|
||||
notice_lang(s_ChanServ, u, READ_ONLY_MODE);
|
||||
|
||||
if (ci->c) {
|
||||
if (ircd->regmode) {
|
||||
if (ci->c)
|
||||
{
|
||||
if (ircd->regmode)
|
||||
{
|
||||
ci->c->mode &= ~ircd->regmode;
|
||||
ircdproto->SendMode(whosends(ci), ci->name, "-r");
|
||||
}
|
||||
}
|
||||
|
||||
if (ircd->chansqline && (ci->flags & CI_VERBOTEN)) {
|
||||
if (ircd->chansqline && (ci->flags & CI_FORBIDDEN))
|
||||
{
|
||||
ircdproto->SendSQLineDel(ci->name);
|
||||
}
|
||||
|
||||
alog("%s: Channel %s dropped by %s!%s@%s (founder: %s)",
|
||||
s_ChanServ, ci->name, u->nick, u->username,
|
||||
s_ChanServ, ci->name, u->nick, u->GetIdent().c_str(),
|
||||
u->host, (ci->founder ? ci->founder->display : "(none)"));
|
||||
|
||||
delchan(ci);
|
||||
@@ -104,15 +80,48 @@ int do_drop(User * u)
|
||||
/* We must make sure that the Services admin has not normally the right to
|
||||
* drop the channel before issuing the wallops.
|
||||
*/
|
||||
if (WallDrop && is_servadmin && level < ACCESS_FOUNDER)
|
||||
ircdproto->SendGlobops(s_ChanServ,
|
||||
"\2%s\2 used DROP on channel \2%s\2", u->nick,
|
||||
chan);
|
||||
if (WallDrop) {
|
||||
if ((level < ACCESS_FOUNDER) || (!is_real_founder(u, ci) && ci->flags & CI_SECUREFOUNDER))
|
||||
ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used DROP on channel \2%s\2", u->nick, chan);
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_DROPPED, chan);
|
||||
send_event(EVENT_CHAN_DROP, 1, chan);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_drop", CSDrop)
|
||||
FOREACH_MOD(I_OnChanDrop, OnChanDrop(chan));
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
if (u->nc && u->nc->IsServicesOper())
|
||||
notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP_DROP);
|
||||
else
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_DROP);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "DROP", CHAN_DROP_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class CSDrop : public Module
|
||||
{
|
||||
public:
|
||||
CSDrop(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
this->AddCommand(CHANSERV, new CommandCSDrop());
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_DROP);
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(CSDrop)
|
||||
|
||||
+109
-78
@@ -15,114 +15,145 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_forbid(User * u);
|
||||
void myChanServHelp(User * u);
|
||||
|
||||
class CSForbid : public Module
|
||||
class CommandCSForbid : public Command
|
||||
{
|
||||
public:
|
||||
CSForbid(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
CommandCSForbid() : Command("FORBID", 1, 2, "chanserv/forbid")
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("FORBID", do_forbid, is_services_admin, -1, -1, -1, CHAN_SERVADMIN_HELP_FORBID, CHAN_SERVADMIN_HELP_FORBID);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
}
|
||||
};
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
ChannelInfo *ci;
|
||||
const char *chan = params[0].c_str();
|
||||
const char *reason = params.size() > 1 ? params[1].c_str() : NULL;
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
if (is_services_admin(u)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_FORBID);
|
||||
}
|
||||
}
|
||||
Channel *c;
|
||||
Entry *cur, *enext;
|
||||
|
||||
/**
|
||||
* The /cs forbid command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_forbid(User * u)
|
||||
{
|
||||
ChannelInfo *ci;
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *reason = strtok(NULL, "");
|
||||
if (ForceForbidReason && !reason)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "FORBID", CHAN_FORBID_SYNTAX_REASON);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
Channel *c;
|
||||
if (*chan != '#')
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_SYMBOL_REQUIRED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
/* Assumes that permission checking has already been done. */
|
||||
if (!chan || (ForceForbidReason && !reason)) {
|
||||
syntax_error(s_ChanServ, u, "FORBID",
|
||||
(ForceForbidReason ? CHAN_FORBID_SYNTAX_REASON :
|
||||
CHAN_FORBID_SYNTAX));
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (*chan != '#') {
|
||||
notice_lang(s_ChanServ, u, CHAN_SYMBOL_REQUIRED);
|
||||
return MOD_CONT;
|
||||
} else if (!ircdproto->IsChannelValid(chan)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_INVALID, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (readonly)
|
||||
notice_lang(s_ChanServ, u, READ_ONLY_MODE);
|
||||
if ((ci = cs_findchan(chan)) != NULL)
|
||||
delchan(ci);
|
||||
ci = makechan(chan);
|
||||
if (ci) {
|
||||
ci->flags |= CI_VERBOTEN;
|
||||
if (!ircdproto->IsChannelValid(chan))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_X_INVALID, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, READ_ONLY_MODE);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if ((ci = cs_findchan(chan)) != NULL)
|
||||
delchan(ci);
|
||||
|
||||
ci = makechan(chan);
|
||||
if (!ci)
|
||||
{
|
||||
alog("%s: Valid FORBID for %s by %s failed", s_ChanServ, ci->name, u->nick);
|
||||
notice_lang(s_ChanServ, u, CHAN_FORBID_FAILED, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
ci->flags |= CI_FORBIDDEN;
|
||||
ci->forbidby = sstrdup(u->nick);
|
||||
if (reason)
|
||||
ci->forbidreason = sstrdup(reason);
|
||||
|
||||
if ((c = findchan(ci->name))) {
|
||||
struct c_userlist *cu, *next;
|
||||
if ((c = findchan(ci->name)))
|
||||
{
|
||||
struct c_userlist *cu, *nextu;
|
||||
const char *av[3];
|
||||
|
||||
for (cu = c->users; cu; cu = next) {
|
||||
next = cu->next;
|
||||
/* Before banning everyone, it might be prudent to clear +e and +I lists..
|
||||
* to prevent ppl from rejoining.. ~ Viper */
|
||||
if (ircd->except && c->excepts && c->excepts->count) {
|
||||
for (cur = c->excepts->entries; cur; cur = enext) {
|
||||
enext = cur->next;
|
||||
av[0] = "-e";
|
||||
av[1] = cur->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-e %s", cur->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
if (ircd->invitemode && c->invites && c->invites->count) {
|
||||
for (cur = c->invites->entries; cur; cur = enext) {
|
||||
enext = cur->next;
|
||||
av[0] = "-I";
|
||||
av[1] = cur->mask;
|
||||
ircdproto->SendMode(whosends(ci), chan, "-I %s", cur->mask);
|
||||
chan_set_modes(whosends(ci)->nick, c, 2, av, 0);
|
||||
}
|
||||
}
|
||||
|
||||
for (cu = c->users; cu; cu = nextu)
|
||||
{
|
||||
nextu = cu->next;
|
||||
|
||||
if (is_oper(cu->user))
|
||||
continue;
|
||||
|
||||
av[0] = c->name;
|
||||
av[1] = cu->user->nick;
|
||||
av[2] = reason ? reason : "CHAN_FORBID_REASON";
|
||||
av[2] = reason ? reason : getstring(cu->user->nc, CHAN_FORBID_REASON);
|
||||
ircdproto->SendKick(findbot(s_ChanServ), av[0], av[1], av[2]);
|
||||
do_kick(s_ChanServ, 3, av);
|
||||
}
|
||||
}
|
||||
|
||||
if (WallForbid)
|
||||
ircdproto->SendGlobops(s_ChanServ,
|
||||
"\2%s\2 used FORBID on channel \2%s\2",
|
||||
u->nick, ci->name);
|
||||
ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick, ci->name);
|
||||
|
||||
if (ircd->chansqline) {
|
||||
if (ircd->chansqline)
|
||||
{
|
||||
ircdproto->SendSQLine(ci->name, ((reason) ? reason : "Forbidden"));
|
||||
}
|
||||
|
||||
alog("%s: %s set FORBID for channel %s", s_ChanServ, u->nick,
|
||||
ci->name);
|
||||
alog("%s: %s set FORBID for channel %s", s_ChanServ, u->nick, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_FORBID_SUCCEEDED, chan);
|
||||
send_event(EVENT_CHAN_FORBIDDEN, 1, chan);
|
||||
} else {
|
||||
alog("%s: Valid FORBID for %s by %s failed", s_ChanServ, ci->name,
|
||||
u->nick);
|
||||
notice_lang(s_ChanServ, u, CHAN_FORBID_FAILED, chan);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_forbid", CSForbid)
|
||||
FOREACH_MOD(I_OnChanForbidden, OnChanForbidden(ci));
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP_FORBID);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "FORBID", CHAN_FORBID_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class CSForbid : public Module
|
||||
{
|
||||
public:
|
||||
CSForbid(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
this->AddCommand(CHANSERV, new CommandCSForbid());
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_FORBID);
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(CSForbid)
|
||||
|
||||
+48
-48
@@ -15,63 +15,63 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_getkey(User * u);
|
||||
void myChanServHelp(User * u);
|
||||
class CommandCSGetKey : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSGetKey() : Command("GETKEY", 1, 1)
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
ChannelInfo *ci;
|
||||
|
||||
ci = cs_findchan(chan);
|
||||
|
||||
if (!check_access(u, ci, CA_GETKEY) && !u->nc->HasCommand("chanserv/getkey"))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!ci->c || !ci->c->key)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_GETKEY_NOKEY, chan);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_GETKEY_KEY, chan, ci->c->key);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_GETKEY);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "GETKEY", CHAN_GETKEY_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class CSGetKey : public Module
|
||||
{
|
||||
public:
|
||||
CSGetKey(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("GETKEY", do_getkey, NULL, CHAN_HELP_GETKEY, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
this->AddCommand(CHANSERV, new CommandCSGetKey());
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETKEY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETKEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* The /cs getkey command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_getkey(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (!chan) {
|
||||
syntax_error(s_ChanServ, u, "GETKEY", CHAN_GETKEY_SYNTAX);
|
||||
} else if (!(ci = cs_findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (!check_access(u, ci, CA_GETKEY)) {
|
||||
notice_lang(s_ChanServ, u, ACCESS_DENIED);
|
||||
} else if (!ci->c || !ci->c->key) {
|
||||
notice_lang(s_ChanServ, u, CHAN_GETKEY_NOKEY, chan);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_GETKEY_KEY, chan, ci->c->key);
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_getkey", CSGetKey)
|
||||
MODULE_INIT(CSGetKey)
|
||||
|
||||
+51
-60
@@ -15,76 +15,67 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_getpass(User * u);
|
||||
void myChanServHelp(User * u);
|
||||
class CommandCSGetPass : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSGetPass() : Command("GETPASS", 1, 1, "chanserv/getpass")
|
||||
{
|
||||
this->SetFlag(CFLAG_ALLOW_SUSPENDED);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
char tmp_pass[PASSMAX];
|
||||
ChannelInfo *ci;
|
||||
|
||||
ci = cs_findchan(chan);
|
||||
|
||||
if (!enc_decrypt(ci->founderpass, tmp_pass, PASSMAX - 1))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_GETPASS_UNAVAILABLE);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
alog("%s: %s!%s@%s used GETPASS on %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ci->name);
|
||||
if (WallGetpass)
|
||||
{
|
||||
ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used GETPASS on channel \2%s\2", u->nick, chan);
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_GETPASS_PASSWORD_IS, chan, tmp_pass);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP_GETPASS);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "GETPASS", CHAN_GETPASS_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class CSGetPass : public Module
|
||||
{
|
||||
public:
|
||||
CSGetPass(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
this->AddCommand(CHANSERV, new CommandCSGetPass());
|
||||
|
||||
c = createCommand("GETPASS", do_getpass, is_services_admin, -1, -1, -1, CHAN_SERVADMIN_HELP_GETPASS, CHAN_SERVADMIN_HELP_GETPASS);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
char tmp_pass[PASSMAX];
|
||||
if (!enc_decrypt("tmp", tmp_pass, PASSMAX - 1))
|
||||
throw ModuleException("Incompatible with the encryption module being used");
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETPASS);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
if (is_services_admin(u)) {
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETPASS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The /cs getpass command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
|
||||
int do_getpass(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char tmp_pass[PASSMAX];
|
||||
ChannelInfo *ci;
|
||||
|
||||
if (!chan) {
|
||||
syntax_error(s_ChanServ, u, "GETPASS", CHAN_GETPASS_SYNTAX);
|
||||
} else if (!(ci = cs_findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (CSRestrictGetPass && !is_services_root(u)) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
} else {
|
||||
if(enc_decrypt(ci->founderpass, tmp_pass, PASSMAX - 1)==1) {
|
||||
alog("%s: %s!%s@%s used GETPASS on %s",
|
||||
s_ChanServ, u->nick, u->username, u->host, ci->name);
|
||||
if (WallGetpass) {
|
||||
ircdproto->SendGlobops(s_ChanServ,
|
||||
"\2%s\2 used GETPASS on channel \2%s\2",
|
||||
u->nick, chan);
|
||||
}
|
||||
notice_lang(s_ChanServ, u, CHAN_GETPASS_PASSWORD_IS,
|
||||
chan, tmp_pass);
|
||||
} else {
|
||||
notice_lang(s_ChanServ, u, CHAN_GETPASS_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_getpass", CSGetPass)
|
||||
MODULE_INIT(CSGetPass)
|
||||
|
||||
+52
-47
@@ -6,8 +6,8 @@
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
@@ -15,60 +15,65 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_help(User * u);
|
||||
class CommandCSHelp : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSHelp() : Command("HELP", 1, 1)
|
||||
{
|
||||
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
|
||||
this->SetFlag(CFLAG_STRIP_CHANNEL);
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
ci::string cmd = params[0];
|
||||
|
||||
if (cmd == "LEVELS DESC")
|
||||
{
|
||||
int i;
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC);
|
||||
if (!levelinfo_maxwidth)
|
||||
{
|
||||
for (i = 0; levelinfo[i].what >= 0; i++)
|
||||
{
|
||||
int len = strlen(levelinfo[i].name);
|
||||
if (len > levelinfo_maxwidth)
|
||||
levelinfo_maxwidth = len;
|
||||
}
|
||||
}
|
||||
for (i = 0; levelinfo[i].what >= 0; i++)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name, getstring(u, levelinfo[i].desc));
|
||||
}
|
||||
}
|
||||
else
|
||||
mod_help_cmd(s_ChanServ, u, CHANSERV, cmd.c_str());
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP);
|
||||
moduleDisplayHelp(s_ChanServ, u);
|
||||
if (CSExpire >= 86400)
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_EXPIRES, CSExpire / 86400);
|
||||
if (u->nc && u->nc->IsServicesOper())
|
||||
notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class CSHelp : public Module
|
||||
{
|
||||
public:
|
||||
CSHelp(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("HELP", do_help, NULL, -1, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
this->AddCommand(CHANSERV, new CommandCSHelp());
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The /cs help command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_help(User * u)
|
||||
{
|
||||
char *cmd = strtok(NULL, "");
|
||||
|
||||
if (!cmd) {
|
||||
notice_help(s_ChanServ, u, CHAN_HELP);
|
||||
moduleDisplayHelp(2, u);
|
||||
if (CSExpire >= 86400)
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_EXPIRES,
|
||||
CSExpire / 86400);
|
||||
if (is_services_oper(u))
|
||||
notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP);
|
||||
} else if (stricmp(cmd, "LEVELS DESC") == 0) {
|
||||
int i;
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC);
|
||||
if (!levelinfo_maxwidth) {
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
int len = strlen(levelinfo[i].name);
|
||||
if (len > levelinfo_maxwidth)
|
||||
levelinfo_maxwidth = len;
|
||||
}
|
||||
}
|
||||
for (i = 0; levelinfo[i].what >= 0; i++) {
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT,
|
||||
levelinfo_maxwidth, levelinfo[i].name,
|
||||
getstring(u->na, levelinfo[i].desc));
|
||||
}
|
||||
} else {
|
||||
mod_help_cmd(s_ChanServ, u, CHANSERV, cmd);
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_help", CSHelp)
|
||||
MODULE_INIT(CSHelp)
|
||||
|
||||
+58
-59
@@ -15,68 +15,34 @@
|
||||
|
||||
#include "module.h"
|
||||
|
||||
int do_identify(User * u);
|
||||
void myChanServHelp(User * u);
|
||||
|
||||
class CSIdentify : public Module
|
||||
class CommandCSIdentify : public Command
|
||||
{
|
||||
public:
|
||||
CSIdentify(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
CommandCSIdentify(const std::string &cname) : Command(cname, 2, 2)
|
||||
{
|
||||
Command *c;
|
||||
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
|
||||
c = createCommand("IDENTIFY", do_identify, NULL, CHAN_HELP_IDENTIFY, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
c = createCommand("ID", do_identify, NULL, CHAN_HELP_IDENTIFY, -1, -1, -1, -1);
|
||||
this->AddCommand(CHANSERV, c, MOD_UNIQUE);
|
||||
|
||||
this->SetChanHelp(myChanServHelp);
|
||||
}
|
||||
};
|
||||
|
||||
CommandReturn Execute(User *u, std::vector<ci::string> ¶ms)
|
||||
{
|
||||
const char *chan = params[0].c_str();
|
||||
const char *pass = params[1].c_str();
|
||||
ChannelInfo *ci;
|
||||
struct u_chaninfolist *uc;
|
||||
|
||||
ci = cs_findchan(chan);
|
||||
|
||||
/**
|
||||
* Add the help response to anopes /cs help output.
|
||||
* @param u The user who is requesting help
|
||||
**/
|
||||
void myChanServHelp(User * u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_IDENTIFY);
|
||||
}
|
||||
if (is_founder(u, ci))
|
||||
{
|
||||
notice_lang(s_ChanServ, u, NICK_ALREADY_IDENTIFIED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
/**
|
||||
* The /cs command.
|
||||
* @param u The user who issued the command
|
||||
* @param MOD_CONT to continue processing other modules, MOD_STOP to stop processing.
|
||||
**/
|
||||
int do_identify(User * u)
|
||||
{
|
||||
char *chan = strtok(NULL, " ");
|
||||
char *pass = strtok(NULL, " ");
|
||||
ChannelInfo *ci;
|
||||
struct u_chaninfolist *uc;
|
||||
|
||||
if (!pass) {
|
||||
syntax_error(s_ChanServ, u, "IDENTIFY", CHAN_IDENTIFY_SYNTAX);
|
||||
} else if (!(ci = cs_findchan(chan))) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_NOT_REGISTERED, chan);
|
||||
} else if (ci->flags & CI_VERBOTEN) {
|
||||
notice_lang(s_ChanServ, u, CHAN_X_FORBIDDEN, chan);
|
||||
} else if (!nick_identified(u)) {
|
||||
notice_lang(s_ChanServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
|
||||
} else if (is_founder(u, ci)) {
|
||||
notice_lang(s_ChanServ, u, NICK_ALREADY_IDENTIFIED);
|
||||
} else {
|
||||
int res;
|
||||
|
||||
if ((res = enc_check_password(pass, ci->founderpass)) == 1) {
|
||||
if (!is_identified(u, ci)) {
|
||||
if ((res = enc_check_password(pass, ci->founderpass)) == 1)
|
||||
{
|
||||
if (!is_identified(u, ci))
|
||||
{
|
||||
uc = new u_chaninfolist;
|
||||
uc->prev = NULL;
|
||||
uc->next = u->founder_chans;
|
||||
@@ -85,22 +51,55 @@ int do_identify(User * u)
|
||||
u->founder_chans = uc;
|
||||
uc->chan = ci;
|
||||
alog("%s: %s!%s@%s identified for %s", s_ChanServ, u->nick,
|
||||
u->username, u->host, ci->name);
|
||||
u->GetIdent().c_str(), u->host, ci->name);
|
||||
}
|
||||
|
||||
notice_lang(s_ChanServ, u, CHAN_IDENTIFY_SUCCEEDED, chan);
|
||||
} else if (res < 0) {
|
||||
}
|
||||
else if (res < 0)
|
||||
{
|
||||
alog("%s: check_password failed for %s", s_ChanServ, ci->name);
|
||||
notice_lang(s_ChanServ, u, CHAN_IDENTIFY_FAILED);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
alog("%s: Failed IDENTIFY for %s by %s!%s@%s",
|
||||
s_ChanServ, ci->name, u->nick, u->username, u->host);
|
||||
s_ChanServ, ci->name, u->nick, u->GetIdent().c_str(), u->host);
|
||||
notice_lang(s_ChanServ, u, PASSWORD_INCORRECT);
|
||||
bad_password(u);
|
||||
}
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
MODULE_INIT("cs_identify", CSIdentify)
|
||||
bool OnHelp(User *u, const ci::string &subcommand)
|
||||
{
|
||||
notice_help(s_ChanServ, u, CHAN_HELP_IDENTIFY);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u)
|
||||
{
|
||||
syntax_error(s_ChanServ, u, "IDENTIFY", CHAN_IDENTIFY_SYNTAX);
|
||||
}
|
||||
};
|
||||
|
||||
class CSIdentify : public Module
|
||||
{
|
||||
public:
|
||||
CSIdentify(const std::string &modname, const std::string &creator) : Module(modname, creator)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetVersion("$Id$");
|
||||
this->SetType(CORE);
|
||||
this->AddCommand(CHANSERV, new CommandCSIdentify("IDENTIFY"));
|
||||
// XXX: we need aliases.
|
||||
this->AddCommand(CHANSERV, new CommandCSIdentify("ID"));
|
||||
}
|
||||
void ChanServHelp(User *u)
|
||||
{
|
||||
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_IDENTIFY);
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(CSIdentify)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user