mirror of
https://github.com/anope/anope.git
synced 2026-07-07 21:23:13 +02:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab0b851d28 | |||
| 4e3720b810 | |||
| 4b48fc98d3 | |||
| 82993c8d1e | |||
| d352718a39 | |||
| d44632e57d | |||
| 80451011dd | |||
| b4e673b2f4 | |||
| 58a78e9aa5 | |||
| 6da4a148fa | |||
| a3edb09eda | |||
| 27beb8f877 | |||
| 136680f917 | |||
| 378ae21ac7 | |||
| e35a86661d | |||
| 528b5938ec | |||
| 03bee17063 | |||
| fe18050c49 | |||
| aa0496f69b | |||
| 4ee22ab05e | |||
| 63ad540e55 | |||
| a1165eea94 | |||
| bfca74f6b3 | |||
| 3acf74483c | |||
| a3ec8329f4 | |||
| 7d0184ca34 | |||
| 31bc597c81 | |||
| e0b687f289 | |||
| 2de0dddb1c | |||
| ff65b68dfa | |||
| 94456a6063 | |||
| 41ea346551 | |||
| 439ad3e736 | |||
| 347d82f59b | |||
| fe68f40634 | |||
| 08b1344056 | |||
| ff67a80a71 |
+2
-18
@@ -31,12 +31,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
|||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
# Find only the part after "libraries: "
|
# Find only the part after "libraries: "
|
||||||
string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
|
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
|
# Replace the colons in the list with semicolons
|
||||||
if(NOT MINGW)
|
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
|
||||||
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
|
|
||||||
else()
|
|
||||||
set(LIBRARIES "${LINE}")
|
|
||||||
endif()
|
|
||||||
# Iterate through the libraries
|
# Iterate through the libraries
|
||||||
foreach(LIBRARY ${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
|
# 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
|
||||||
@@ -106,13 +102,6 @@ if(NOT MSVC)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
|
|
||||||
if(MINGW)
|
|
||||||
set(CMAKE_RC_COMPILER_INIT windres)
|
|
||||||
enable_language(RC)
|
|
||||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Include the checking functions used later in this CMakeLists.txt
|
# Include the checking functions used later in this CMakeLists.txt
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
include(CheckTypeSize)
|
include(CheckTypeSize)
|
||||||
@@ -189,11 +178,6 @@ if(CMAKE_THREAD_LIBS_INIT)
|
|||||||
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
|
|
||||||
if(MINGW)
|
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT PROGRAM_NAME)
|
if(NOT PROGRAM_NAME)
|
||||||
set(PROGRAM_NAME anope)
|
set(PROGRAM_NAME anope)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
echo2 () {
|
|
||||||
$ECHO2 "$*$ECHO2SUF" # these are defined later
|
|
||||||
}
|
|
||||||
|
|
||||||
exists () { # because some shells don't have test -e
|
exists () { # because some shells don't have test -e
|
||||||
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
|
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
|
||||||
return 0
|
return 0
|
||||||
@@ -42,7 +38,6 @@ Run_Build_System () {
|
|||||||
WITH_PERM=""
|
WITH_PERM=""
|
||||||
EXTRA_INCLUDE=""
|
EXTRA_INCLUDE=""
|
||||||
EXTRA_LIBS=""
|
EXTRA_LIBS=""
|
||||||
GEN_TYPE=""
|
|
||||||
|
|
||||||
if [ "$INSTDIR" != "" ] ; then
|
if [ "$INSTDIR" != "" ] ; then
|
||||||
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
|
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
|
||||||
@@ -70,45 +65,25 @@ Run_Build_System () {
|
|||||||
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$SOURCE_DIR" = "." ] ; then
|
BUILD_PATHS="-B ${SOURCE_DIR}/build ${SOURCE_DIR}"
|
||||||
pwdsave=`pwd`
|
|
||||||
test -d build || mkdir build
|
|
||||||
cd "build"
|
|
||||||
REAL_SOURCE_DIR=".."
|
|
||||||
else
|
|
||||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
CMAKE="cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $BUILD_PATHS"
|
||||||
|
echo $CMAKE
|
||||||
|
$CMAKE
|
||||||
|
|
||||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
|
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
if [ "$SOURCE_DIR" = "." ] ; then
|
if [ "$PWD" = "${SOURCE_DIR}/build" ]; then
|
||||||
echo "Now cd build, then run make to build Anope."
|
|
||||||
cd "$pwdsave"
|
|
||||||
else
|
|
||||||
echo "Now run make to build Anope."
|
echo "Now run make to build Anope."
|
||||||
|
else
|
||||||
|
echo "Now cd build, then run make to build Anope."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ECHO2SUF=''
|
|
||||||
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
|
|
||||||
ECHO2='echo -n'
|
|
||||||
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
|
|
||||||
ECHO2='echo' ; ECHO2SUF='\c'
|
|
||||||
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
|
|
||||||
ECHO2='printf "%s"'
|
|
||||||
else
|
|
||||||
# oh well...
|
|
||||||
ECHO2='echo'
|
|
||||||
fi
|
|
||||||
export ECHO2 ECHO2SUF
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Init values
|
# Init values
|
||||||
###########################################################################
|
###########################################################################
|
||||||
@@ -121,7 +96,7 @@ EXTRA_INCLUDE_DIRS=
|
|||||||
EXTRA_LIB_DIRS=
|
EXTRA_LIB_DIRS=
|
||||||
EXTRA_CONFIG_ARGS=
|
EXTRA_CONFIG_ARGS=
|
||||||
CAN_QUICK="no"
|
CAN_QUICK="no"
|
||||||
SOURCE_DIR=`dirname $0`
|
SOURCE_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Check out the options
|
# Check out the options
|
||||||
@@ -138,7 +113,7 @@ while [ $# -ge 1 ] ; do
|
|||||||
exit 0
|
exit 0
|
||||||
elif [ $1 = "-devel" ] ; then
|
elif [ $1 = "-devel" ] ; then
|
||||||
DEBUG="yes"
|
DEBUG="yes"
|
||||||
INSTDIR="$PWD/run"
|
INSTDIR="$SOURCE_DIR/run"
|
||||||
elif [ $1 = "-nocache" ] ; then
|
elif [ $1 = "-nocache" ] ; then
|
||||||
IGNORE_CACHE="1"
|
IGNORE_CACHE="1"
|
||||||
elif [ $1 = "-nointro" ] ; then
|
elif [ $1 = "-nointro" ] ; then
|
||||||
@@ -199,7 +174,7 @@ export ok INPUT
|
|||||||
ok=0
|
ok=0
|
||||||
echo "In what directory should Anope be installed?"
|
echo "In what directory should Anope be installed?"
|
||||||
while [ $ok -eq 0 ] ; do
|
while [ $ok -eq 0 ] ; do
|
||||||
echo2 "[$INSTDIR] "
|
echo -n "[$INSTDIR] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ ! "$INPUT" ] ; then
|
if [ ! "$INPUT" ] ; then
|
||||||
INPUT=$INSTDIR
|
INPUT=$INSTDIR
|
||||||
@@ -209,7 +184,7 @@ while [ $ok -eq 0 ] ; do
|
|||||||
echo "$INPUT exists, but is not a directory!"
|
echo "$INPUT exists, but is not a directory!"
|
||||||
else
|
else
|
||||||
echo "$INPUT does not exist. Create it?"
|
echo "$INPUT does not exist. Create it?"
|
||||||
echo2 "[y] "
|
echo -n "[y] "
|
||||||
read YN
|
read YN
|
||||||
if [ "$YN" != "n" ] ; then
|
if [ "$YN" != "n" ] ; then
|
||||||
if mkdir -p $INPUT ; then
|
if mkdir -p $INPUT ; then
|
||||||
@@ -238,7 +213,7 @@ else
|
|||||||
echo "should not force files to be owned by a particular group, just press"
|
echo "should not force files to be owned by a particular group, just press"
|
||||||
echo "Return.)"
|
echo "Return.)"
|
||||||
fi
|
fi
|
||||||
echo2 "[$RUNGROUP] "
|
echo -n "[$RUNGROUP] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "none" ] ; then
|
if [ "$INPUT" = "none" ] ; then
|
||||||
@@ -263,7 +238,7 @@ ok=0
|
|||||||
echo "What should the default umask for data files be (in octal)?"
|
echo "What should the default umask for data files be (in octal)?"
|
||||||
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
|
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
|
||||||
while [ $ok -eq 0 ] ; do
|
while [ $ok -eq 0 ] ; do
|
||||||
echo2 "[$UMASK] "
|
echo -n "[$UMASK] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ ! "$INPUT" ] ; then
|
if [ ! "$INPUT" ] ; then
|
||||||
INPUT=$UMASK
|
INPUT=$UMASK
|
||||||
@@ -287,7 +262,7 @@ if [ "$DEBUG" = "yes" ] ; then
|
|||||||
TEMP_YN="y"
|
TEMP_YN="y"
|
||||||
fi
|
fi
|
||||||
echo "Would you like to build a debug version of Anope?"
|
echo "Would you like to build a debug version of Anope?"
|
||||||
echo2 "[$TEMP_YN] "
|
echo -n "[$TEMP_YN] "
|
||||||
read YN
|
read YN
|
||||||
if [ "$YN" ] ; then
|
if [ "$YN" ] ; then
|
||||||
if [ "$YN" = "y" ] ; then
|
if [ "$YN" = "y" ] ; then
|
||||||
@@ -305,7 +280,7 @@ echo "You may only need to do this if CMake is unable to locate"
|
|||||||
echo "missing dependencies without hints."
|
echo "missing dependencies without hints."
|
||||||
echo "Separate directories with semicolons."
|
echo "Separate directories with semicolons."
|
||||||
echo "If you need no extra include directories, enter NONE in all caps."
|
echo "If you need no extra include directories, enter NONE in all caps."
|
||||||
echo2 "[$EXTRA_INCLUDE_DIRS] "
|
echo -n "[$EXTRA_INCLUDE_DIRS] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "NONE" ] ; then
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
@@ -323,7 +298,7 @@ echo "You may only need to do this if CMake is unable to locate"
|
|||||||
echo "missing dependencies without hints."
|
echo "missing dependencies without hints."
|
||||||
echo "Separate directories with semicolons."
|
echo "Separate directories with semicolons."
|
||||||
echo "If you need no extra library directories, enter NONE in all caps."
|
echo "If you need no extra library directories, enter NONE in all caps."
|
||||||
echo2 "[$EXTRA_LIB_DIRS] "
|
echo -n "[$EXTRA_LIB_DIRS] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "NONE" ] ; then
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
@@ -338,7 +313,7 @@ echo ""
|
|||||||
|
|
||||||
echo "Are there any extra arguments you wish to pass to CMake?"
|
echo "Are there any extra arguments you wish to pass to CMake?"
|
||||||
echo "If you need no extra arguments to CMake, enter NONE in all caps."
|
echo "If you need no extra arguments to CMake, enter NONE in all caps."
|
||||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
echo -n "[$EXTRA_CONFIG_ARGS] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "NONE" ] ; then
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
@@ -355,7 +330,7 @@ echo ""
|
|||||||
# Store values
|
# Store values
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
echo2 "Saving configuration results in config.cache... "
|
echo -n "Saving configuration results in config.cache... "
|
||||||
|
|
||||||
cat <<EOT >$SOURCE_DIR/config.cache
|
cat <<EOT >$SOURCE_DIR/config.cache
|
||||||
INSTDIR="$INSTDIR"
|
INSTDIR="$INSTDIR"
|
||||||
|
|||||||
@@ -746,6 +746,7 @@ log
|
|||||||
* nickserv/cert - Can modify other users certificate lists
|
* nickserv/cert - Can modify other users certificate lists
|
||||||
* nickserv/confirm - Can confirm other users nicknames
|
* nickserv/confirm - Can confirm other users nicknames
|
||||||
* nickserv/drop - Can drop other users nicks
|
* nickserv/drop - Can drop other users nicks
|
||||||
|
* nickserv/drop/display - Allows dropping display nicks when preservedisplay is enabled
|
||||||
* nickserv/drop/override - Allows dropping nicks without using a confirmation code
|
* nickserv/drop/override - Allows dropping nicks without using a confirmation code
|
||||||
* nickserv/recover - Can recover other users nicks
|
* nickserv/recover - Can recover other users nicks
|
||||||
* operserv/config - Can modify services's configuration
|
* operserv/config - Can modify services's configuration
|
||||||
@@ -915,7 +916,7 @@ mail
|
|||||||
* If set, this option enables the mail commands in Anope. You may choose
|
* If set, this option enables the mail commands in Anope. You may choose
|
||||||
* to disable it if you have no Sendmail-compatible mailer installed. Whilst
|
* to disable it if you have no Sendmail-compatible mailer installed. Whilst
|
||||||
* this directive (and entire block) is optional, it is required if
|
* this directive (and entire block) is optional, it is required if
|
||||||
* nickserv:registration is set to yes.
|
* nickserv:registration is set to mail.
|
||||||
*/
|
*/
|
||||||
usemail = yes
|
usemail = yes
|
||||||
|
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ module { name = "help" }
|
|||||||
username = "anope"
|
username = "anope"
|
||||||
password = "mypassword"
|
password = "mypassword"
|
||||||
port = 3306
|
port = 3306
|
||||||
|
socket = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -754,7 +755,7 @@ module { name = "sasl" }
|
|||||||
name = "sqlite/main"
|
name = "sqlite/main"
|
||||||
|
|
||||||
/* The database name, it will be created if it does not exist. */
|
/* The database name, it will be created if it does not exist. */
|
||||||
database = "anope.db"
|
database = "anope.sqlite"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,16 +773,16 @@ module { name = "sasl" }
|
|||||||
name = "webcpanel"
|
name = "webcpanel"
|
||||||
|
|
||||||
/* Web server to use. */
|
/* Web server to use. */
|
||||||
server = "httpd/main";
|
server = "httpd/main"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The directory containing the webcpanel templates. This is relative to the
|
* The directory containing the webcpanel templates. This is relative to the
|
||||||
* data directory.
|
* data directory.
|
||||||
*/
|
*/
|
||||||
template_dir = "webcpanel/templates/default";
|
template_dir = "webcpanel/templates/default"
|
||||||
|
|
||||||
/* Page title. */
|
/* Page title. */
|
||||||
title = "Anope IRC Services";
|
title = "Anope IRC Services"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -219,6 +219,12 @@ module
|
|||||||
* This directive is optional. If not set it defaults to 50.
|
* This directive is optional. If not set it defaults to 50.
|
||||||
*/
|
*/
|
||||||
maxpasslen = 50
|
maxpasslen = 50
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Whether all of the secondary nicks of a nick group have to expire or be
|
||||||
|
dropped before the display nick can expire or be dropped.
|
||||||
|
*/
|
||||||
|
preservedisplay = no
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,3 +1,16 @@
|
|||||||
|
Anope Version 2.1.8
|
||||||
|
-------------------
|
||||||
|
Added account identifiers to the nickserv/info output.
|
||||||
|
Added support for bool, float, and uint SQL columns.
|
||||||
|
Added the ability to automatically determine SQL column types based on the native type.
|
||||||
|
Added UNIX socket support to mysql module.
|
||||||
|
Changed smartjoin to use SendClearBans where available.
|
||||||
|
Dropped support for MinGW in favour of native builds.
|
||||||
|
Fixed parsing named extbans on InspIRCd.
|
||||||
|
Fixed parsing SVSMODE and SVS2MODE from UnrealIRCd.
|
||||||
|
Fixed sending global messages to remotely linked servers.
|
||||||
|
Removed the services server name from the CTCP version response.
|
||||||
|
|
||||||
Anope Version 2.1.7
|
Anope Version 2.1.7
|
||||||
-------------------
|
-------------------
|
||||||
Added importing of akick reasons, forbid reasons, opers and session exceptions to db_atheme.
|
Added importing of akick reasons, forbid reasons, opers and session exceptions to db_atheme.
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
Anope Version 2.1.8
|
||||||
|
-------------------
|
||||||
|
Added module:preservedisplay to the nickserv module.
|
||||||
|
Added the nickserv/drop/display oper privilege.
|
||||||
|
|
||||||
Anope Version 2.1.7
|
Anope Version 2.1.7
|
||||||
-------------------
|
-------------------
|
||||||
Moved nickserv/set/language and nickserv/saset/language to the ns_set_language module.
|
Moved nickserv/set/language and nickserv/saset/language to the ns_set_language module.
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ Anope Multi Language Support
|
|||||||
Then execute:
|
Then execute:
|
||||||
dpkg-reconfigure locales
|
dpkg-reconfigure locales
|
||||||
|
|
||||||
|
If you have already built Anope you will need to delete the build directory and rebuild from scratch.
|
||||||
|
|
||||||
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
||||||
|
|
||||||
2) Adding a new language
|
2) Adding a new language
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public:
|
|||||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
T *t = this->Get(e);
|
T *t = this->Get(e);
|
||||||
data[this->name] << *t;
|
data.Store(this->name, *t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
@@ -194,8 +194,7 @@ public:
|
|||||||
|
|
||||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data.SetType(this->name, Serialize::Data::DT_INT);
|
data.Store(this->name, true);
|
||||||
data[this->name] << true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
|
|||||||
+1
-1
@@ -108,7 +108,7 @@ namespace Language
|
|||||||
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
|
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
|
||||||
#define CHAN_SETTING_UNSET _("%s for %s unset.")
|
#define CHAN_SETTING_UNSET _("%s for %s unset.")
|
||||||
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
|
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
|
||||||
#define CHAN_INFO_HEADER _("Information for channel \002%s\002:")
|
#define CHAN_INFO_HEADER _("Information about channel \002%s\002:")
|
||||||
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
|
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
|
||||||
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
|
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
|
||||||
"Type \002%s%s READ %s %zu\002 to read it.")
|
"Type \002%s%s READ %s %zu\002 to read it.")
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ struct MyOper final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["name"] << this->name;
|
data.Store("name", this->name);
|
||||||
data["type"] << this->ot->GetName();
|
data.Store("type", this->ot->GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -62,12 +62,12 @@ static ServiceReference<SessionService> session_service("SessionService", "sessi
|
|||||||
|
|
||||||
void Exception::Serialize(Serialize::Data &data) const
|
void Exception::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["limit"] << this->limit;
|
data.Store("limit", this->limit);
|
||||||
data["who"] << this->who;
|
data.Store("who", this->who);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
data["expires"] << this->expires;
|
data.Store("expires", this->expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
+6
-14
@@ -19,7 +19,7 @@ namespace SQL
|
|||||||
public:
|
public:
|
||||||
typedef std::map<Anope::string, std::stringstream *> Map;
|
typedef std::map<Anope::string, std::stringstream *> Map;
|
||||||
Map data;
|
Map data;
|
||||||
std::map<Anope::string, Type> types;
|
std::map<Anope::string, Serialize::DataType> types;
|
||||||
|
|
||||||
~Data()
|
~Data()
|
||||||
{
|
{
|
||||||
@@ -34,14 +34,6 @@ namespace SQL
|
|||||||
return *ss;
|
return *ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<Anope::string> KeySet() const override
|
|
||||||
{
|
|
||||||
std::set<Anope::string> keys;
|
|
||||||
for (const auto &[key, _] : this->data)
|
|
||||||
keys.insert(key);
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Hash() const override
|
size_t Hash() const override
|
||||||
{
|
{
|
||||||
size_t hash = 0;
|
size_t hash = 0;
|
||||||
@@ -68,17 +60,17 @@ namespace SQL
|
|||||||
this->data.clear();
|
this->data.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetType(const Anope::string &key, Type t) override
|
void SetType(const Anope::string &key, Serialize::DataType dt) override
|
||||||
{
|
{
|
||||||
this->types[key] = t;
|
this->types[key] = dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type GetType(const Anope::string &key) const override
|
Serialize::DataType GetType(const Anope::string &key) const override
|
||||||
{
|
{
|
||||||
std::map<Anope::string, Type>::const_iterator it = this->types.find(key);
|
auto it = this->types.find(key);
|
||||||
if (it != this->types.end())
|
if (it != this->types.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
return DT_TEXT;
|
return Serialize::DataType::TEXT;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -240,9 +240,9 @@ public:
|
|||||||
* @param bi The source of the message
|
* @param bi The source of the message
|
||||||
* @param u The user to join
|
* @param u The user to join
|
||||||
* @param chan The channel to join the user to
|
* @param chan The channel to join the user to
|
||||||
* @param param Channel key?
|
* @param key Channel key
|
||||||
*/
|
*/
|
||||||
virtual void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
virtual void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &key) { }
|
||||||
|
|
||||||
/** Force parts a user that isn't ours from a channel.
|
/** Force parts a user that isn't ours from a channel.
|
||||||
* @param source The source of the message
|
* @param source The source of the message
|
||||||
|
|||||||
+30
-9
@@ -18,23 +18,44 @@
|
|||||||
|
|
||||||
namespace Serialize
|
namespace Serialize
|
||||||
{
|
{
|
||||||
|
enum class DataType
|
||||||
|
: uint8_t
|
||||||
|
{
|
||||||
|
BOOL,
|
||||||
|
FLOAT,
|
||||||
|
INT,
|
||||||
|
TEXT,
|
||||||
|
UINT,
|
||||||
|
};
|
||||||
|
|
||||||
class Data
|
class Data
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type
|
|
||||||
{
|
|
||||||
DT_TEXT,
|
|
||||||
DT_INT
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual ~Data() = default;
|
virtual ~Data() = default;
|
||||||
|
|
||||||
virtual std::iostream &operator[](const Anope::string &key) = 0;
|
virtual std::iostream &operator[](const Anope::string &key) = 0;
|
||||||
virtual std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); }
|
|
||||||
|
template <typename T>
|
||||||
|
void Store(const Anope::string &key, const T &value)
|
||||||
|
{
|
||||||
|
using Type = std::remove_cv_t<std::remove_reference_t<T>>;
|
||||||
|
|
||||||
|
if constexpr (std::is_same_v<Type, bool>)
|
||||||
|
SetType(key, DataType::BOOL);
|
||||||
|
else if constexpr (std::is_floating_point_v<Type>)
|
||||||
|
SetType(key, DataType::FLOAT);
|
||||||
|
else if constexpr (std::is_integral_v<Type> && std::is_signed_v<Type>)
|
||||||
|
SetType(key, DataType::INT);
|
||||||
|
else if constexpr (std::is_integral_v<Type> && std::is_unsigned_v<Type>)
|
||||||
|
SetType(key, DataType::UINT);
|
||||||
|
|
||||||
|
this->operator[](key) << value;
|
||||||
|
}
|
||||||
|
|
||||||
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
||||||
|
|
||||||
virtual void SetType(const Anope::string &key, Type t) { }
|
virtual void SetType(const Anope::string &key, DataType dt) { }
|
||||||
virtual Type GetType(const Anope::string &key) const { return DT_TEXT; }
|
virtual DataType GetType(const Anope::string &key) const { return DataType::TEXT; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void RegisterTypes();
|
extern void RegisterTypes();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Anope\n"
|
"Project-Id-Version: Anope\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-06-23 14:15+0100\n"
|
"POT-Creation-Date: 2024-08-18 03:16+0100\n"
|
||||||
"PO-Revision-Date: 2024-06-23 14:16+0100\n"
|
"PO-Revision-Date: 2024-08-18 03:17+0100\n"
|
||||||
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
||||||
"Language-Team: English\n"
|
"Language-Team: English\n"
|
||||||
"Language: en_US\n"
|
"Language: en_US\n"
|
||||||
@@ -1812,6 +1812,9 @@ msgstr "Account"
|
|||||||
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||||
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||||
|
|
||||||
|
msgid "Account id"
|
||||||
|
msgstr "Account id"
|
||||||
|
|
||||||
msgid "Account registered"
|
msgid "Account registered"
|
||||||
msgstr "Account registered"
|
msgstr "Account registered"
|
||||||
|
|
||||||
@@ -4194,12 +4197,12 @@ msgid "Info about a loaded module"
|
|||||||
msgstr "Info about a loaded module"
|
msgstr "Info about a loaded module"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Information for bot %s:"
|
msgid "Information about bot %s:"
|
||||||
msgstr "Information for bot %s:"
|
msgstr "Information about bot %s:"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Information for channel %s:"
|
msgid "Information about channel %s:"
|
||||||
msgstr "Information for channel %s:"
|
msgstr "Information about channel %s:"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Invalid duration %s, using %d days."
|
msgid "Invalid duration %s, using %d days."
|
||||||
|
|||||||
@@ -57,12 +57,20 @@ public:
|
|||||||
BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL;
|
BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL;
|
||||||
if (bi && Config->GetModule(this)->Get<bool>("smartjoin"))
|
if (bi && Config->GetModule(this)->Get<bool>("smartjoin"))
|
||||||
{
|
{
|
||||||
/* We check for bans */
|
if (IRCD->CanClearBans)
|
||||||
for (const auto &entry : c->GetModeList("BAN"))
|
|
||||||
{
|
{
|
||||||
Entry ban("BAN", entry);
|
// We can ask the IRCd to clear bans.
|
||||||
if (ban.Matches(user))
|
IRCD->SendClearBans(bi, c, bi);
|
||||||
c->RemoveMode(NULL, "BAN", ban.GetMask());
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We have to check for bans.
|
||||||
|
for (const auto &entry : c->GetModeList("BAN"))
|
||||||
|
{
|
||||||
|
Entry ban("BAN", entry);
|
||||||
|
if (ban.Matches(user))
|
||||||
|
c->RemoveMode(NULL, "BAN", ban.GetMask());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Anope::string Limit;
|
Anope::string Limit;
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ struct BadWordImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["ci"] << this->chan;
|
data.Store("ci", this->chan);
|
||||||
data["word"] << this->word;
|
data.Store("word", this->word);
|
||||||
data.SetType("type", Serialize::Data::DT_INT); data["type"] << this->type;
|
data.Store("type", this->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
|
|
||||||
if (bi)
|
if (bi)
|
||||||
{
|
{
|
||||||
source.Reply(_("Information for bot \002%s\002:"), bi->nick.c_str());
|
source.Reply(_("Information about bot \002%s\002:"), bi->nick.c_str());
|
||||||
info[_("Mask")] = bi->GetIdent() + "@" + bi->host;
|
info[_("Mask")] = bi->GetIdent() + "@" + bi->host;
|
||||||
info[_("Real name")] = bi->realname;
|
info[_("Real name")] = bi->realname;
|
||||||
info[_("Created")] = Anope::strftime(bi->created, source.GetAccount());
|
info[_("Created")] = Anope::strftime(bi->created, source.GetAccount());
|
||||||
|
|||||||
+21
-18
@@ -53,25 +53,28 @@ struct KickerDataImpl final
|
|||||||
if (kd == NULL)
|
if (kd == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
data.SetType("kickerdata:amsgs", Serialize::Data::DT_INT); data["kickerdata:amsgs"] << kd->amsgs;
|
data.Store("kickerdata:amsgs", kd->amsgs);
|
||||||
data.SetType("kickerdata:badwords", Serialize::Data::DT_INT); data["kickerdata:badwords"] << kd->badwords;
|
data.Store("kickerdata:badwords", kd->badwords);
|
||||||
data.SetType("kickerdata:bolds", Serialize::Data::DT_INT); data["kickerdata:bolds"] << kd->bolds;
|
data.Store("kickerdata:bolds", kd->bolds);
|
||||||
data.SetType("kickerdata:caps", Serialize::Data::DT_INT); data["kickerdata:caps"] << kd->caps;
|
data.Store("kickerdata:caps", kd->caps);
|
||||||
data.SetType("kickerdata:colors", Serialize::Data::DT_INT); data["kickerdata:colors"] << kd->colors;
|
data.Store("kickerdata:colors", kd->colors);
|
||||||
data.SetType("kickerdata:flood", Serialize::Data::DT_INT); data["kickerdata:flood"] << kd->flood;
|
data.Store("kickerdata:flood", kd->flood);
|
||||||
data.SetType("kickerdata:italics", Serialize::Data::DT_INT); data["kickerdata:italics"] << kd->italics;
|
data.Store("kickerdata:italics", kd->italics);
|
||||||
data.SetType("kickerdata:repeat", Serialize::Data::DT_INT); data["kickerdata:repeat"] << kd->repeat;
|
data.Store("kickerdata:repeat", kd->repeat);
|
||||||
data.SetType("kickerdata:reverses", Serialize::Data::DT_INT); data["kickerdata:reverses"] << kd->reverses;
|
data.Store("kickerdata:reverses", kd->reverses);
|
||||||
data.SetType("kickerdata:underlines", Serialize::Data::DT_INT); data["kickerdata:underlines"] << kd->underlines;
|
data.Store("kickerdata:underlines", kd->underlines);
|
||||||
data.SetType("capsmin", Serialize::Data::DT_INT); data["capsmin"] << kd->capsmin;
|
data.Store("capsmin", kd->capsmin);
|
||||||
data.SetType("capspercent", Serialize::Data::DT_INT); data["capspercent"] << kd->capspercent;
|
data.Store("capspercent", kd->capspercent);
|
||||||
data.SetType("floodlines", Serialize::Data::DT_INT); data["floodlines"] << kd->floodlines;
|
data.Store("floodlines", kd->floodlines);
|
||||||
data.SetType("floodsecs", Serialize::Data::DT_INT); data["floodsecs"] << kd->floodsecs;
|
data.Store("floodsecs", kd->floodsecs);
|
||||||
data.SetType("repeattimes", Serialize::Data::DT_INT); data["repeattimes"] << kd->repeattimes;
|
data.Store("repeattimes", kd->repeattimes);
|
||||||
data.SetType("dontkickops", Serialize::Data::DT_INT); data["dontkickops"] << kd->dontkickops;
|
data.Store("dontkickops", kd->dontkickops);
|
||||||
data.SetType("dontkickvoices", Serialize::Data::DT_INT); data["dontkickvoices"] << kd->dontkickvoices;
|
data.Store("dontkickvoices", kd->dontkickvoices);
|
||||||
|
|
||||||
|
std::ostringstream oss;
|
||||||
for (auto ttbtype : kd->ttb)
|
for (auto ttbtype : kd->ttb)
|
||||||
data["ttb"] << ttbtype << " ";
|
oss << ttbtype << " ";
|
||||||
|
data.Store("ttb", oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ struct EntryMsgImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["ci"] << this->chan;
|
data.Store("ci", this->chan);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["message"] << this->message;
|
data.Store("message", this->message);
|
||||||
data.SetType("when", Serialize::Data::DT_INT); data["when"] << this->when;
|
data.Store("when", this->when);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||||
|
|||||||
@@ -37,14 +37,14 @@ struct LogSettingImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["ci"] << chan;
|
data.Store("ci", chan);
|
||||||
data["service_name"] << service_name;
|
data.Store("service_name", service_name);
|
||||||
data["command_service"] << command_service;
|
data.Store("command_service", command_service);
|
||||||
data["command_name"] << command_name;
|
data.Store("command_name", command_name);
|
||||||
data["method"] << method;
|
data.Store("method", method);
|
||||||
data["extra"] << extra;
|
data.Store("extra", extra);
|
||||||
data["creator"] << creator;
|
data.Store("creator", creator);
|
||||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << created;
|
data.Store("created", created);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -205,12 +205,12 @@ struct ModeLocksImpl final
|
|||||||
|
|
||||||
void ModeLockImpl::Serialize(Serialize::Data &data) const
|
void ModeLockImpl::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["ci"] << this->ci;
|
data.Store("ci", this->ci);
|
||||||
data["set"] << this->set;
|
data.Store("set", this->set);
|
||||||
data["name"] << this->name;
|
data.Store("name", this->name);
|
||||||
data["param"] << this->param;
|
data.Store("param", this->param);
|
||||||
data["setter"] << this->setter;
|
data.Store("setter", this->setter);
|
||||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ struct SeenInfo final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["nick"] << nick;
|
data.Store("nick", nick);
|
||||||
data["vhost"] << vhost;
|
data.Store("vhost", vhost);
|
||||||
data["type"] << type;
|
data.Store("type", type);
|
||||||
data["nick2"] << nick2;
|
data.Store("nick2", nick2);
|
||||||
data["channel"] << channel;
|
data.Store("channel", channel);
|
||||||
data["message"] << message;
|
data.Store("message", message);
|
||||||
data.SetType("last", Serialize::Data::DT_INT); data["last"] << last;
|
data.Store("last", last);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -1068,7 +1068,7 @@ class CSSet final
|
|||||||
if (!last_value.empty())
|
if (!last_value.empty())
|
||||||
modes += "," + last_value;
|
modes += "," + last_value;
|
||||||
}
|
}
|
||||||
data["last_modes"] << modes;
|
data.Store("last_modes", modes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ struct CSMiscData final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &sdata) const override
|
void Serialize(Serialize::Data &sdata) const override
|
||||||
{
|
{
|
||||||
sdata["ci"] << this->object;
|
sdata.Store("ci", this->object);
|
||||||
sdata["name"] << this->name;
|
sdata.Store("name", this->name);
|
||||||
sdata["data"] << this->data;
|
sdata.Store("data", this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ struct CSSuspendInfo final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["chan"] << what;
|
data.Store("chan", what);
|
||||||
data["by"] << by;
|
data.Store("by", by);
|
||||||
data["reason"] << reason;
|
data.Store("reason", reason);
|
||||||
data["time"] << when;
|
data.Store("time", when);
|
||||||
data["expires"] << expires;
|
data.Store("expires", expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -1393,7 +1393,7 @@ private:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ot = OperType::Find(type);
|
auto *ot = OperType::Find(type);
|
||||||
if (!ot)
|
if (!ot)
|
||||||
{
|
{
|
||||||
// Attempt to convert oper types.
|
// Attempt to convert oper types.
|
||||||
|
|||||||
@@ -71,14 +71,6 @@ public:
|
|||||||
return this->ss;
|
return this->ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<Anope::string> KeySet() const override
|
|
||||||
{
|
|
||||||
std::set<Anope::string> keys;
|
|
||||||
for (const auto &[key, _]: this->data)
|
|
||||||
keys.insert(key);
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Hash() const override
|
size_t Hash() const override
|
||||||
{
|
{
|
||||||
size_t hash = 0;
|
size_t hash = 0;
|
||||||
|
|||||||
@@ -34,14 +34,6 @@ public:
|
|||||||
return *stream;
|
return *stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<Anope::string> KeySet() const override
|
|
||||||
{
|
|
||||||
std::set<Anope::string> keys;
|
|
||||||
for (const auto &[key, _] : this->data)
|
|
||||||
keys.insert(key);
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Hash() const override
|
size_t Hash() const override
|
||||||
{
|
{
|
||||||
size_t hash = 0;
|
size_t hash = 0;
|
||||||
|
|||||||
+60
-21
@@ -121,6 +121,7 @@ class MySQLService final
|
|||||||
Anope::string user;
|
Anope::string user;
|
||||||
Anope::string password;
|
Anope::string password;
|
||||||
unsigned int port;
|
unsigned int port;
|
||||||
|
Anope::string socket;
|
||||||
|
|
||||||
MYSQL *sql = nullptr;
|
MYSQL *sql = nullptr;
|
||||||
|
|
||||||
@@ -136,7 +137,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::mutex Lock;
|
std::mutex Lock;
|
||||||
|
|
||||||
MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po);
|
MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po, const Anope::string &so);
|
||||||
|
|
||||||
~MySQLService();
|
~MySQLService();
|
||||||
|
|
||||||
@@ -157,6 +158,29 @@ public:
|
|||||||
Anope::string BuildQuery(const Query &q);
|
Anope::string BuildQuery(const Query &q);
|
||||||
|
|
||||||
Anope::string FromUnixtime(time_t) override;
|
Anope::string FromUnixtime(time_t) override;
|
||||||
|
|
||||||
|
Anope::string GetColumnType(Serialize::DataType dt)
|
||||||
|
{
|
||||||
|
switch (dt)
|
||||||
|
{
|
||||||
|
case Serialize::DataType::BOOL:
|
||||||
|
return "TINYINT NOT NULL";
|
||||||
|
|
||||||
|
case Serialize::DataType::FLOAT:
|
||||||
|
return "DOUBLE PRECISION NOT NULL";
|
||||||
|
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
return "BIGINT NOT NULL";
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
return "TEXT";
|
||||||
|
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
return "BIGINT UNSIGNED NOT NULL";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "TEXT"; // Should never be reached
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The SQL thread used to execute queries
|
/** The SQL thread used to execute queries
|
||||||
@@ -248,13 +272,14 @@ public:
|
|||||||
const Anope::string &user = block->Get<const Anope::string>("username", "anope");
|
const Anope::string &user = block->Get<const Anope::string>("username", "anope");
|
||||||
const Anope::string &password = block->Get<const Anope::string>("password");
|
const Anope::string &password = block->Get<const Anope::string>("password");
|
||||||
unsigned int port = block->Get<unsigned int>("port", "3306");
|
unsigned int port = block->Get<unsigned int>("port", "3306");
|
||||||
|
const Anope::string &socket = block->Get<const Anope::string>("socket");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto *ss = new MySQLService(this, connname, database, server, user, password, port);
|
auto *ss = new MySQLService(this, connname, database, server, user, password, port, socket);
|
||||||
this->MySQLServices.emplace(connname, ss);
|
this->MySQLServices.emplace(connname, ss);
|
||||||
|
|
||||||
Log(LOG_NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << server << ")";
|
Log(LOG_NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << (socket.empty() ? server + ":" + port : socket) << ")";
|
||||||
}
|
}
|
||||||
catch (const SQL::Exception &ex)
|
catch (const SQL::Exception &ex)
|
||||||
{
|
{
|
||||||
@@ -309,13 +334,14 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MySQLService::MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po)
|
MySQLService::MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po, const Anope::string &so)
|
||||||
: Provider(o, n)
|
: Provider(o, n)
|
||||||
, database(d)
|
, database(d)
|
||||||
, server(s)
|
, server(s)
|
||||||
, user(u)
|
, user(u)
|
||||||
, password(p)
|
, password(p)
|
||||||
, port(po)
|
, port(po)
|
||||||
|
, socket(so)
|
||||||
{
|
{
|
||||||
Connect();
|
Connect();
|
||||||
}
|
}
|
||||||
@@ -407,17 +433,13 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
|||||||
|
|
||||||
if (known_cols.empty())
|
if (known_cols.empty())
|
||||||
{
|
{
|
||||||
Anope::string query_text = "CREATE TABLE `" + table + "` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT,"
|
Anope::string query_text = "CREATE TABLE `" + table + "` (`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,"
|
||||||
" `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP";
|
" `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP";
|
||||||
for (const auto &[column, _] : data.data)
|
for (const auto &[column, _] : data.data)
|
||||||
{
|
{
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
query_text += ", `" + column + "` ";
|
query_text += ", `" + column + "` " + GetColumnType(data.GetType(column));
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
}
|
}
|
||||||
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC";
|
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC";
|
||||||
queries.push_back(query_text);
|
queries.push_back(query_text);
|
||||||
@@ -431,11 +453,7 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
|||||||
|
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` ";
|
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` " + GetColumnType(data.GetType(column));
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
|
|
||||||
queries.push_back(query_text);
|
queries.push_back(query_text);
|
||||||
}
|
}
|
||||||
@@ -471,11 +489,29 @@ Query MySQLService::BuildInsert(const Anope::string &table, unsigned int id, Dat
|
|||||||
Anope::string buf;
|
Anope::string buf;
|
||||||
*value >> buf;
|
*value >> buf;
|
||||||
|
|
||||||
bool escape = true;
|
auto escape = true;
|
||||||
if (buf.empty())
|
switch (data.GetType(field))
|
||||||
{
|
{
|
||||||
buf = "NULL";
|
case Serialize::DataType::BOOL:
|
||||||
escape = false;
|
case Serialize::DataType::FLOAT:
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
buf = "0";
|
||||||
|
escape = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
{
|
||||||
|
buf = "NULL";
|
||||||
|
escape = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query.SetValue(field, buf, escape);
|
query.SetValue(field, buf, escape);
|
||||||
@@ -496,12 +532,15 @@ void MySQLService::Connect()
|
|||||||
const unsigned int timeout = 1;
|
const unsigned int timeout = 1;
|
||||||
mysql_options(this->sql, MYSQL_OPT_CONNECT_TIMEOUT, reinterpret_cast<const char *>(&timeout));
|
mysql_options(this->sql, MYSQL_OPT_CONNECT_TIMEOUT, reinterpret_cast<const char *>(&timeout));
|
||||||
|
|
||||||
bool connect = mysql_real_connect(this->sql, this->server.c_str(), this->user.c_str(), this->password.c_str(), this->database.c_str(), this->port, NULL, CLIENT_MULTI_RESULTS);
|
bool connect = mysql_real_connect(this->sql, this->server.c_str(), this->user.c_str(), this->password.c_str(), this->database.c_str(), this->port, this->socket.empty() ? nullptr : this->socket.c_str(), CLIENT_MULTI_RESULTS);
|
||||||
|
|
||||||
if (!connect)
|
if (!connect)
|
||||||
throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql));
|
throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql));
|
||||||
|
|
||||||
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port;
|
if (this->socket.empty())
|
||||||
|
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port;
|
||||||
|
else
|
||||||
|
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+54
-11
@@ -68,6 +68,31 @@ public:
|
|||||||
Anope::string BuildQuery(const Query &q);
|
Anope::string BuildQuery(const Query &q);
|
||||||
|
|
||||||
Anope::string FromUnixtime(time_t) override;
|
Anope::string FromUnixtime(time_t) override;
|
||||||
|
|
||||||
|
Anope::string GetColumnType(Serialize::DataType dt)
|
||||||
|
{
|
||||||
|
switch (dt)
|
||||||
|
{
|
||||||
|
case Serialize::DataType::BOOL:
|
||||||
|
return "INTEGER";
|
||||||
|
|
||||||
|
case Serialize::DataType::FLOAT:
|
||||||
|
return "REAL";
|
||||||
|
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
return "INTEGER";
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
return "TEXT";
|
||||||
|
|
||||||
|
// SQLite lacks support for 64-bit unsigned integers so we have to
|
||||||
|
// store them as text columns instead.
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
return "TEXT";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "TEXT"; // Should never be reached
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModuleSQLite final
|
class ModuleSQLite final
|
||||||
@@ -237,11 +262,7 @@ std::vector<Query> SQLiteService::CreateTable(const Anope::string &table, const
|
|||||||
{
|
{
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
query_text += ", `" + column + "` ";
|
query_text += ", `" + column + "` " + GetColumnType(data.GetType(column));
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int(11)";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
query_text += ")";
|
query_text += ")";
|
||||||
@@ -266,11 +287,7 @@ std::vector<Query> SQLiteService::CreateTable(const Anope::string &table, const
|
|||||||
|
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` ";
|
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` " + GetColumnType(data.GetType(column));;
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int(11)";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
|
|
||||||
queries.push_back(query_text);
|
queries.push_back(query_text);
|
||||||
}
|
}
|
||||||
@@ -307,7 +324,33 @@ Query SQLiteService::BuildInsert(const Anope::string &table, unsigned int id, Da
|
|||||||
{
|
{
|
||||||
Anope::string buf;
|
Anope::string buf;
|
||||||
*value >> buf;
|
*value >> buf;
|
||||||
query.SetValue(field, buf);
|
|
||||||
|
auto escape = true;
|
||||||
|
switch (data.GetType(field))
|
||||||
|
{
|
||||||
|
case Serialize::DataType::BOOL:
|
||||||
|
case Serialize::DataType::FLOAT:
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
buf = "0";
|
||||||
|
escape = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
{
|
||||||
|
buf = "NULL";
|
||||||
|
escape = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query.SetValue(field, buf, escape);
|
||||||
}
|
}
|
||||||
|
|
||||||
return query;
|
return query;
|
||||||
|
|||||||
@@ -137,9 +137,6 @@ public:
|
|||||||
if (!sender)
|
if (!sender)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!server)
|
|
||||||
server = Servers::GetUplink();
|
|
||||||
|
|
||||||
Anope::string line;
|
Anope::string line;
|
||||||
if (source && !Config->GetModule(this)->Get<bool>("anonymousglobal"))
|
if (source && !Config->GetModule(this)->Get<bool>("anonymousglobal"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ struct HostRequestImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["nick"] << this->nick;
|
data.Store("nick", this->nick);
|
||||||
data["ident"] << this->ident;
|
data.Store("ident", this->ident);
|
||||||
data["host"] << this->host;
|
data.Store("host", this->host);
|
||||||
data.SetType("time", Serialize::Data::DT_INT); data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class MemoServCore final
|
|||||||
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
|
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
|
||||||
{
|
{
|
||||||
Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()),
|
Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()),
|
||||||
message = Language::Translate(Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str());
|
message = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str());
|
||||||
|
|
||||||
subject = subject.replace_all_cs("%n", nc->display);
|
subject = subject.replace_all_cs("%n", nc->display);
|
||||||
subject = subject.replace_all_cs("%s", m->sender);
|
subject = subject.replace_all_cs("%s", m->sender);
|
||||||
|
|||||||
@@ -536,6 +536,9 @@ public:
|
|||||||
if (nickserv_expire && Anope::CurTime - na->last_seen >= nickserv_expire)
|
if (nickserv_expire && Anope::CurTime - na->last_seen >= nickserv_expire)
|
||||||
expire = true;
|
expire = true;
|
||||||
|
|
||||||
|
if (na->nc->na == na && na->nc->aliases->size() > 1 && Config->GetModule("nickserv")->Get<bool>("preservedisplay"))
|
||||||
|
expire = false;
|
||||||
|
|
||||||
FOREACH_MOD(OnPreNickExpire, (na, expire));
|
FOREACH_MOD(OnPreNickExpire, (na, expire));
|
||||||
|
|
||||||
if (expire)
|
if (expire)
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ struct AJoinEntry final
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Serialize(Serialize::Data &sd) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
if (!this->owner)
|
if (!this->owner)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sd["owner"] << this->owner->display;
|
data.Store("owner", this->owner->display);
|
||||||
sd["channel"] << this->channel;
|
data.Store("channel", this->channel);
|
||||||
sd["key"] << this->key;
|
data.Store("key", this->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &sd)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &sd)
|
||||||
|
|||||||
@@ -168,8 +168,10 @@ public:
|
|||||||
if (c == NULL || !c->GetCertCount())
|
if (c == NULL || !c->GetCertCount())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
std::ostringstream oss;
|
||||||
for (unsigned i = 0; i < c->GetCertCount(); ++i)
|
for (unsigned i = 0; i < c->GetCertCount(); ++i)
|
||||||
data["cert"] << c->GetCert(i) << " ";
|
oss << c->GetCert(i) << " ";
|
||||||
|
data.Store("cert", oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (na->nc->na == na && na->nc->aliases->size() > 1 && Config->GetModule("nickserv")->Get<bool>("preservedisplay") && !source.HasPriv("nickserv/drop/display"))
|
||||||
|
{
|
||||||
|
source.Reply(_("You may not drop \002%s\002 as it is the display nick for the account."), na->nick.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto *code = dropcode.Get(na);
|
auto *code = dropcode.Get(na);
|
||||||
if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("nickserv/drop/override") || params[1] != "OVERRIDE")))
|
if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("nickserv/drop/override") || params[1] != "OVERRIDE")))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,11 +15,12 @@
|
|||||||
|
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
|
||||||
class CommandNSGetEMail final
|
class CommandNSGetEmail final
|
||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CommandNSGetEMail(Module *creator) : Command(creator, "nickserv/getemail", 1, 1)
|
CommandNSGetEmail(Module *creator)
|
||||||
|
: Command(creator, "nickserv/getemail", 1, 1)
|
||||||
{
|
{
|
||||||
this->SetDesc(_("Matches and returns all users that registered using given email"));
|
this->SetDesc(_("Matches and returns all users that registered using given email"));
|
||||||
this->SetSyntax(_("\037email\037"));
|
this->SetSyntax(_("\037email\037"));
|
||||||
@@ -59,16 +60,19 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class NSGetEMail final
|
class NSGetEmail final
|
||||||
: public Module
|
: public Module
|
||||||
{
|
{
|
||||||
CommandNSGetEMail commandnsgetemail;
|
private:
|
||||||
|
CommandNSGetEmail commandnsgetemail;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NSGetEMail(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
NSGetEmail(const Anope::string &modname, const Anope::string &creator)
|
||||||
commandnsgetemail(this)
|
: Module(modname, creator, VENDOR)
|
||||||
|
, commandnsgetemail(this)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_INIT(NSGetEMail)
|
MODULE_INIT(NSGetEmail)
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public:
|
|||||||
InfoFormatter info(source.nc);
|
InfoFormatter info(source.nc);
|
||||||
|
|
||||||
info[_("Account")] = na->nc->display;
|
info[_("Account")] = na->nc->display;
|
||||||
|
info[_("Account id")] = Anope::ToString(na->nc->GetId());
|
||||||
if (nick_online)
|
if (nick_online)
|
||||||
{
|
{
|
||||||
bool shown = false;
|
bool shown = false;
|
||||||
|
|||||||
@@ -1108,7 +1108,7 @@ class NSSet final
|
|||||||
if (!last_value.empty())
|
if (!last_value.empty())
|
||||||
modes += "," + last_value;
|
modes += "," + last_value;
|
||||||
}
|
}
|
||||||
data["last_modes"] << modes;
|
data.Store("last_modes", modes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ struct NSMiscData final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &sdata) const override
|
void Serialize(Serialize::Data &sdata) const override
|
||||||
{
|
{
|
||||||
sdata["nc"] << this->object;
|
sdata.Store("nc", this->object);
|
||||||
sdata["name"] << this->name;
|
sdata.Store("name", this->name);
|
||||||
sdata["data"] << this->data;
|
sdata.Store("data", this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ struct NSSuspendInfo final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["nick"] << what;
|
data.Store("nick", what);
|
||||||
data["by"] << by;
|
data.Store("by", by);
|
||||||
data["reason"] << reason;
|
data.Store("reason", reason);
|
||||||
data["time"] << when;
|
data.Store("time", when);
|
||||||
data["expires"] << expires;
|
data.Store("expires", expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ struct DNSZone final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["name"] << name;
|
data.Store("name", name);
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
for (const auto &server : servers)
|
for (const auto &server : servers)
|
||||||
data["server" + Anope::ToString(count++)] << server;
|
data.Store("server" + Anope::ToString(count++), server);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -144,14 +144,14 @@ public:
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["server_name"] << server_name;
|
data.Store("server_name", server_name);
|
||||||
for (unsigned i = 0; i < ips.size(); ++i)
|
for (unsigned i = 0; i < ips.size(); ++i)
|
||||||
data["ip" + Anope::ToString(i)] << ips[i];
|
data.Store("ip" + Anope::ToString(i), ips[i]);
|
||||||
data["limit"] << limit;
|
data.Store("limit", limit);
|
||||||
data["pooled"] << pooled;
|
data.Store("pooled", pooled);
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
for (const auto &zone : zones)
|
for (const auto &zone : zones)
|
||||||
data["zone" + Anope::ToString(count++)] << zone;
|
data.Store("zone" + Anope::ToString(count++), zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ struct ForbidDataImpl final
|
|||||||
|
|
||||||
void ForbidDataImpl::Serialize(Serialize::Data &data) const
|
void ForbidDataImpl::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["expires"] << this->expires;
|
data.Store("expires", this->expires);
|
||||||
data["type"] << this->type;
|
data.Store("type", this->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *ForbidDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *ForbidDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ IgnoreDataImpl::~IgnoreDataImpl()
|
|||||||
|
|
||||||
void IgnoreDataImpl::Serialize(Serialize::Data &data) const
|
void IgnoreDataImpl::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *IgnoreDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *IgnoreDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ struct OperInfoImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["target"] << target;
|
data.Store("target", target);
|
||||||
data["info"] << info;
|
data.Store("info", info);
|
||||||
data["adder"] << adder;
|
data.Store("adder", adder);
|
||||||
data["created"] << created;
|
data.Store("created", created);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ struct MyNewsItem final
|
|||||||
{
|
{
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["type"] << this->type;
|
data.Store("type", this->type);
|
||||||
data["text"] << this->text;
|
data.Store("text", this->text);
|
||||||
data["who"] << this->who;
|
data.Store("who", this->who);
|
||||||
data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ struct Stats final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["maxusercnt"] << MaxUserCount;
|
data.Store("maxusercnt", MaxUserCount);
|
||||||
data["maxusertime"] << MaxUserTime;
|
data.Store("maxusertime", MaxUserTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ public:
|
|||||||
Uplink::Send("SVSNICK", u->GetUID(), u->timestamp, newnick, when);
|
Uplink::Send("SVSNICK", u->GetUID(), u->timestamp, newnick, when);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) override
|
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,22 @@ namespace
|
|||||||
// The version of the InspIRCd protocol that we are using.
|
// The version of the InspIRCd protocol that we are using.
|
||||||
size_t spanningtree_proto_ver = 1205;
|
size_t spanningtree_proto_ver = 1205;
|
||||||
|
|
||||||
|
bool IsExtBan(const Anope::string &str, bool &inverted, Anope::string &name, Anope::string &value)
|
||||||
|
{
|
||||||
|
auto startpos = 0;
|
||||||
|
if (!str.empty() && str[0] == '!')
|
||||||
|
startpos++;
|
||||||
|
|
||||||
|
auto endpos = str.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", startpos);
|
||||||
|
if (endpos == Anope::string::npos || str[endpos] != ':' || endpos+1 == str.length())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
inverted = !!startpos;
|
||||||
|
name = str.substr(startpos, endpos - startpos);
|
||||||
|
value = str.substr(endpos + 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Parses a module name in the format "m_foo.so=bar" to {foo, bar}.
|
// Parses a module name in the format "m_foo.so=bar" to {foo, bar}.
|
||||||
void ParseModule(const Anope::string &module, Anope::string &modname, Anope::string &moddata)
|
void ParseModule(const Anope::string &module, Anope::string &modname, Anope::string &moddata)
|
||||||
{
|
{
|
||||||
@@ -509,9 +525,12 @@ public:
|
|||||||
SendAddLine("Z", x->GetHost(), timeleft, x->by, x->GetReason());
|
SendAddLine("Z", x->GetHost(), timeleft, x->by, x->GetReason());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) override
|
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
if (key.empty())
|
||||||
|
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
||||||
|
else
|
||||||
|
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override
|
||||||
@@ -562,8 +581,11 @@ public:
|
|||||||
void SendLogin(User *u, NickAlias *na) override
|
void SendLogin(User *u, NickAlias *na) override
|
||||||
{
|
{
|
||||||
/* InspIRCd uses an account to bypass chmode +R, not umode +r, so we can't send this here */
|
/* InspIRCd uses an account to bypass chmode +R, not umode +r, so we can't send this here */
|
||||||
if (!na->nc->HasExt("UNCONFIRMED"))
|
if (na->nc->HasExt("UNCONFIRMED"))
|
||||||
SendAccount(u->GetUID(), na);
|
return;
|
||||||
|
|
||||||
|
IRCD->SendVHost(u, na->GetVHostIdent(), na->GetVHostHost());
|
||||||
|
SendAccount(u->GetUID(), na);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendLogout(User *u) override
|
void SendLogout(User *u) override
|
||||||
@@ -617,7 +639,9 @@ public:
|
|||||||
|
|
||||||
bool IsExtbanValid(const Anope::string &mask) override
|
bool IsExtbanValid(const Anope::string &mask) override
|
||||||
{
|
{
|
||||||
return mask.length() >= 3 && mask[1] == ':';
|
bool inverted;
|
||||||
|
Anope::string name, value;
|
||||||
|
return IsExtBan(mask, inverted, name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsIdentValid(const Anope::string &ident) override
|
bool IsIdentValid(const Anope::string &ident) override
|
||||||
@@ -698,19 +722,15 @@ namespace InspIRCdExtBan
|
|||||||
if (cm->type != MODE_LIST)
|
if (cm->type != MODE_LIST)
|
||||||
return cm;
|
return cm;
|
||||||
|
|
||||||
auto startpos = 0;
|
bool inverted;
|
||||||
if (param[0] == '!')
|
Anope::string name, value;
|
||||||
startpos++;
|
if (!IsExtBan(param, inverted, name, value))
|
||||||
|
|
||||||
auto endpos = param.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", startpos);
|
|
||||||
if (endpos == Anope::string::npos || param[endpos] != ':')
|
|
||||||
return cm;
|
return cm;
|
||||||
|
|
||||||
auto name = param.substr(startpos, endpos - startpos);
|
if (name.length() == 1 ? name[0] != xbchar : name != xbname)
|
||||||
if (param.length() >= endpos || (name.length() == 1 ? name[0] != xbchar : name != xbname))
|
|
||||||
return cm;
|
return cm;
|
||||||
|
|
||||||
param.erase(0, endpos);
|
param = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
Uplink::Send(source, "ENCAP", '*', "TOPIC", c->name, c->topic_setter, c->topic_ts, c->topic);
|
Uplink::Send(source, "ENCAP", '*', "TOPIC", c->name, c->topic_setter, c->topic_ts, c->topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
Uplink::Send(source, "ENCAP", '*', "SVSJOIN", user->GetUID(), chan);
|
Uplink::Send(source, "ENCAP", '*', "SVSJOIN", user->GetUID(), chan);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,12 +299,12 @@ private:
|
|||||||
/* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken
|
/* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken
|
||||||
when coming from a none TOKEN'd server
|
when coming from a none TOKEN'd server
|
||||||
*/
|
*/
|
||||||
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
if (!param.empty())
|
if (key.empty())
|
||||||
Uplink::Send("SVSJOIN", user->GetUID(), chan, param);
|
|
||||||
else
|
|
||||||
Uplink::Send("SVSJOIN", user->GetUID(), chan);
|
Uplink::Send("SVSJOIN", user->GetUID(), chan);
|
||||||
|
else
|
||||||
|
Uplink::Send("SVSJOIN", user->GetUID(), chan, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
||||||
@@ -1143,19 +1143,27 @@ struct IRCDMessageMD final
|
|||||||
struct IRCDMessageMode final
|
struct IRCDMessageMode final
|
||||||
: IRCDMessage
|
: IRCDMessage
|
||||||
{
|
{
|
||||||
IRCDMessageMode(Module *creator, const Anope::string &mname) : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); }
|
bool server_ts;
|
||||||
|
|
||||||
|
IRCDMessageMode(Module *creator, const Anope::string &mname, bool sts)
|
||||||
|
: IRCDMessage(creator, mname, 2)
|
||||||
|
, server_ts(sts)
|
||||||
|
{
|
||||||
|
SetFlag(FLAG_SOFT_LIMIT);
|
||||||
|
}
|
||||||
|
|
||||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override
|
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override
|
||||||
{
|
{
|
||||||
bool server_source = source.GetServer() != NULL;
|
auto final_is_ts = server_ts && source.GetServer() != NULL;
|
||||||
|
|
||||||
Anope::string modes = params[1];
|
Anope::string modes = params[1];
|
||||||
for (unsigned i = 2; i < params.size() - (server_source ? 1 : 0); ++i)
|
for (unsigned i = 2; i < params.size() - (final_is_ts ? 1 : 0); ++i)
|
||||||
modes += " " + params[i];
|
modes += " " + params[i];
|
||||||
|
|
||||||
if (IRCD->IsChannelValid(params[0]))
|
if (IRCD->IsChannelValid(params[0]))
|
||||||
{
|
{
|
||||||
Channel *c = Channel::Find(params[0]);
|
Channel *c = Channel::Find(params[0]);
|
||||||
auto ts = server_source ? IRCD->ExtractTimestamp(params.back()) : 0;
|
auto ts = final_is_ts ? IRCD->ExtractTimestamp(params.back()) : 0;
|
||||||
|
|
||||||
if (c)
|
if (c)
|
||||||
c->SetModesInternal(source, modes, ts);
|
c->SetModesInternal(source, modes, ts);
|
||||||
@@ -1690,20 +1698,51 @@ class ProtoUnreal final
|
|||||||
IRCDMessageUmode2 message_umode2;
|
IRCDMessageUmode2 message_umode2;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProtoUnreal(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
|
ProtoUnreal(const Anope::string &modname, const Anope::string &creator)
|
||||||
ircd_proto(this),
|
: Module(modname, creator, PROTOCOL | VENDOR)
|
||||||
message_away(this), message_error(this), message_invite(this), message_join(this), message_kick(this),
|
, ircd_proto(this)
|
||||||
message_kill(this), message_svskill(this, "SVSKILL"), message_motd(this), message_notice(this), message_part(this), message_ping(this),
|
, message_away(this)
|
||||||
message_privmsg(this), message_quit(this), message_squit(this), message_stats(this), message_time(this),
|
, message_error(this)
|
||||||
message_version(this), message_whois(this),
|
, message_invite(this)
|
||||||
|
, message_join(this)
|
||||||
message_capab(this), message_chghost(this), message_chgident(this), message_chgname(this),
|
, message_kick(this)
|
||||||
message_md(this, ircd_proto.ClientModData, ircd_proto.ChannelModData),message_mode(this, "MODE"),
|
, message_kill(this)
|
||||||
message_svsmode(this, "SVSMODE"), message_svs2mode(this, "SVS2MODE"), message_netinfo(this), message_nick(this), message_pong(this),
|
, message_svskill(this, "SVSKILL")
|
||||||
message_sasl(this), message_sdesc(this), message_sethost(this), message_setident(this), message_setname(this), message_server(this),
|
, message_motd(this)
|
||||||
message_sid(this), message_sjoin(this), message_svslogin(this), message_topic(this), message_uid(this), message_umode2(this)
|
, message_notice(this)
|
||||||
|
, message_part(this)
|
||||||
|
, message_ping(this)
|
||||||
|
, message_privmsg(this)
|
||||||
|
, message_quit(this)
|
||||||
|
, message_squit(this)
|
||||||
|
, message_stats(this)
|
||||||
|
, message_time(this)
|
||||||
|
, message_version(this)
|
||||||
|
, message_whois(this)
|
||||||
|
, message_capab(this)
|
||||||
|
, message_chghost(this)
|
||||||
|
, message_chgident(this)
|
||||||
|
, message_chgname(this)
|
||||||
|
, message_md(this, ircd_proto.ClientModData, ircd_proto.ChannelModData)
|
||||||
|
, message_mode(this, "MODE", true)
|
||||||
|
, message_svsmode(this, "SVSMODE", false)
|
||||||
|
, message_svs2mode(this, "SVS2MODE", false)
|
||||||
|
, message_netinfo(this)
|
||||||
|
, message_nick(this)
|
||||||
|
, message_pong(this)
|
||||||
|
, message_sasl(this)
|
||||||
|
, message_sdesc(this)
|
||||||
|
, message_sethost(this)
|
||||||
|
, message_setident(this)
|
||||||
|
, message_setname(this)
|
||||||
|
, message_server(this)
|
||||||
|
, message_sid(this)
|
||||||
|
, message_sjoin(this)
|
||||||
|
, message_svslogin(this)
|
||||||
|
, message_topic(this)
|
||||||
|
, message_uid(this)
|
||||||
|
, message_umode2(this)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Prioritize() override
|
void Prioritize() override
|
||||||
|
|||||||
+2
-12
@@ -30,18 +30,8 @@ if(WIN32)
|
|||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc LANGUAGE RC)
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc LANGUAGE RC)
|
||||||
# Add the resource file to the list of sources
|
# Add the resource file to the list of sources
|
||||||
list(APPEND SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc)
|
list(APPEND SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc)
|
||||||
# For MinGW, we have to change the compile flags
|
|
||||||
if(MINGW)
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
|
||||||
set(RC_CFLAGS "-DMINGW -Ocoff -I${Anope_SOURCE_DIR}/include")
|
|
||||||
# If any sort of debugging is being enabled, add a _DEBUG define to the flags for the resource compiler
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
|
|
||||||
set(RC_CFLAGS "${RC_CFLAGS} -D_DEBUG")
|
|
||||||
endif()
|
|
||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "${RC_CFLAGS}")
|
|
||||||
# For anything else, assumingly Visual Studio at this point, use a different set of compile flags
|
|
||||||
else()
|
|
||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If compiling with Visual Studio, create a static library out of win32/win32_memory.cpp to be included with everything else, needed to override its override of new/delete operators
|
# If compiling with Visual Studio, create a static library out of win32/win32_memory.cpp to be included with everything else, needed to override its override of new/delete operators
|
||||||
|
|||||||
+8
-8
@@ -160,14 +160,14 @@ NickCore *ChanAccess::GetAccount() const
|
|||||||
|
|
||||||
void ChanAccess::Serialize(Serialize::Data &data) const
|
void ChanAccess::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["provider"] << this->provider->name;
|
data.Store("provider", this->provider->name);
|
||||||
data["ci"] << this->ci->name;
|
data.Store("ci", this->ci->name);
|
||||||
data["mask"] << this->Mask();
|
data.Store("mask", this->Mask());
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["description"] << this->description;
|
data.Store("description", this->description);
|
||||||
data.SetType("last_seen", Serialize::Data::DT_INT); data["last_seen"] << this->last_seen;
|
data.Store("last_seen", this->last_seen);
|
||||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["data"] << this->AccessSerialize();
|
data.Store("data", this->AccessSerialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *ChanAccess::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *ChanAccess::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
+6
-6
@@ -75,12 +75,12 @@ BotInfo::~BotInfo()
|
|||||||
|
|
||||||
void BotInfo::Serialize(Serialize::Data &data) const
|
void BotInfo::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["nick"] << this->nick;
|
data.Store("nick", this->nick);
|
||||||
data["user"] << this->ident;
|
data.Store("user", this->ident);
|
||||||
data["host"] << this->host;
|
data.Store("host", this->host);
|
||||||
data["realname"] << this->realname;
|
data.Store("realname", this->realname);
|
||||||
data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["oper_only"] << this->oper_only;
|
data.Store("oper_only", this->oper_only);
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -36,12 +36,12 @@ Memo::~Memo()
|
|||||||
|
|
||||||
void Memo::Serialize(Serialize::Data &data) const
|
void Memo::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["owner"] << this->owner;
|
data.Store("owner", this->owner);
|
||||||
data.SetType("time", Serialize::Data::DT_INT); data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
data["sender"] << this->sender;
|
data.Store("sender", this->sender);
|
||||||
data["text"] << this->text;
|
data.Store("text", this->text);
|
||||||
data["unread"] << this->unread;
|
data.Store("unread", this->unread);
|
||||||
data["receipt"] << this->receipt;
|
data.Store("receipt", this->receipt);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *Memo::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *Memo::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
+2
-1
@@ -352,7 +352,8 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> ¶m
|
|||||||
else if (ctcpname.equals_ci("VERSION"))
|
else if (ctcpname.equals_ci("VERSION"))
|
||||||
{
|
{
|
||||||
Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
|
Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
|
||||||
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("VERSION", Anope::printf("Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Me->GetName().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)", Anope::VersionBuildString().c_str())));
|
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("VERSION", Anope::printf("Anope-%s %s -- %s -- %s", Anope::Version().c_str(),
|
||||||
|
Anope::VersionBuildString().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)")));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -141,21 +141,21 @@ NickAlias *NickAlias::Find(const Anope::string &nick)
|
|||||||
|
|
||||||
void NickAlias::Serialize(Serialize::Data &data) const
|
void NickAlias::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["nick"] << this->nick;
|
data.Store("nick", this->nick);
|
||||||
data["last_quit"] << this->last_quit;
|
data.Store("last_quit", this->last_quit);
|
||||||
data["last_realname"] << this->last_realname;
|
data.Store("last_realname", this->last_realname);
|
||||||
data["last_usermask"] << this->last_usermask;
|
data.Store("last_usermask", this->last_usermask);
|
||||||
data["last_realhost"] << this->last_realhost;
|
data.Store("last_realhost", this->last_realhost);
|
||||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
data.Store("time_registered", this->time_registered);
|
||||||
data.SetType("last_seen", Serialize::Data::DT_INT); data["last_seen"] << this->last_seen;
|
data.Store("last_seen", this->last_seen);
|
||||||
data["nc"] << this->nc->display;
|
data.Store("nc", this->nc->display);
|
||||||
|
|
||||||
if (this->HasVHost())
|
if (this->HasVHost())
|
||||||
{
|
{
|
||||||
data["vhost_ident"] << this->GetVHostIdent();
|
data.Store("vhost_ident", this->GetVHostIdent());
|
||||||
data["vhost_host"] << this->GetVHostHost();
|
data.Store("vhost_host", this->GetVHostHost());
|
||||||
data["vhost_creator"] << this->GetVHostCreator();
|
data.Store("vhost_creator", this->GetVHostCreator());
|
||||||
data["vhost_time"] << this->GetVHostCreated();
|
data.Store("vhost_time", this->GetVHostCreated());
|
||||||
}
|
}
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
|
|||||||
+12
-9
@@ -68,17 +68,20 @@ NickCore::~NickCore()
|
|||||||
|
|
||||||
void NickCore::Serialize(Serialize::Data &data) const
|
void NickCore::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["display"] << this->display;
|
data.Store("display", this->display);
|
||||||
data["uniqueid"] << this->id;
|
data.Store("uniqueid", this->id);
|
||||||
data["pass"] << this->pass;
|
data.Store("pass", this->pass);
|
||||||
data["email"] << this->email;
|
data.Store("email", this->email);
|
||||||
data["language"] << this->language;
|
data.Store("language", this->language);
|
||||||
data.SetType("lastmail", Serialize::Data::DT_INT); data["lastmail"] << this->lastmail;
|
data.Store("lastmail", this->lastmail);
|
||||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
data.Store("time_registered", this->time_registered);
|
||||||
|
data.Store("memomax", this->memos.memomax);
|
||||||
|
|
||||||
data["memomax"] << this->memos.memomax;
|
std::ostringstream oss;
|
||||||
for (const auto &ignore : this->memos.ignores)
|
for (const auto &ignore : this->memos.ignores)
|
||||||
data["memoignores"] << ignore << " ";
|
oss << ignore << " ";
|
||||||
|
data.Store("memoignores", oss.str());
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+25
-22
@@ -40,15 +40,15 @@ AutoKick::~AutoKick()
|
|||||||
|
|
||||||
void AutoKick::Serialize(Serialize::Data &data) const
|
void AutoKick::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["ci"] << this->ci->name;
|
data.Store("ci", this->ci->name);
|
||||||
if (this->nc)
|
if (this->nc)
|
||||||
data["nc"] << this->nc->display;
|
data.Store("nc", this->nc->display);
|
||||||
else
|
else
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data.SetType("addtime", Serialize::Data::DT_INT); data["addtime"] << this->addtime;
|
data.Store("addtime", this->addtime);
|
||||||
data.SetType("last_used", Serialize::Data::DT_INT); data["last_used"] << this->last_used;
|
data.Store("last_used", this->last_used);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *AutoKick::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *AutoKick::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -180,30 +180,33 @@ ChannelInfo::~ChannelInfo()
|
|||||||
|
|
||||||
void ChannelInfo::Serialize(Serialize::Data &data) const
|
void ChannelInfo::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["name"] << this->name;
|
data.Store("name", this->name);
|
||||||
if (this->founder)
|
if (this->founder)
|
||||||
data["founder"] << this->founder->display;
|
data.Store("founder", this->founder->display);
|
||||||
if (this->successor)
|
if (this->successor)
|
||||||
data["successor"] << this->successor->display;
|
data.Store("successor", this->successor->display);
|
||||||
data["description"] << this->desc;
|
data.Store("description", this->desc);
|
||||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
data.Store("time_registered", this->time_registered);
|
||||||
data.SetType("last_used", Serialize::Data::DT_INT); data["last_used"] << this->last_used;
|
data.Store("last_used", this->last_used);
|
||||||
data["last_topic"] << this->last_topic;
|
data.Store("last_topic", this->last_topic);
|
||||||
data["last_topic_setter"] << this->last_topic_setter;
|
data.Store("last_topic_setter", this->last_topic_setter);
|
||||||
data.SetType("last_topic_time", Serialize::Data::DT_INT); data["last_topic_time"] << this->last_topic_time;
|
data.Store("last_topic_time", this->last_topic_time);
|
||||||
data.SetType("bantype", Serialize::Data::DT_INT); data["bantype"] << this->bantype;
|
data.Store("bantype", this->bantype);
|
||||||
{
|
{
|
||||||
Anope::string levels_buffer;
|
Anope::string levels_buffer;
|
||||||
for (const auto &[name, level] : this->levels)
|
for (const auto &[name, level] : this->levels)
|
||||||
levels_buffer += name + " " + Anope::ToString(level) + " ";
|
levels_buffer += name + " " + Anope::ToString(level) + " ";
|
||||||
data["levels"] << levels_buffer;
|
data.Store("levels", levels_buffer);
|
||||||
}
|
}
|
||||||
if (this->bi)
|
if (this->bi)
|
||||||
data["bi"] << this->bi->nick;
|
data.Store("bi", this->bi->nick);
|
||||||
data.SetType("banexpire", Serialize::Data::DT_INT); data["banexpire"] << this->banexpire;
|
data.Store("banexpire", this->banexpire);
|
||||||
data["memomax"] << this->memos.memomax;
|
data.Store("memomax", this->memos.memomax);
|
||||||
|
|
||||||
|
std::ostringstream oss;
|
||||||
for (const auto &ignore : this->memos.ignores)
|
for (const auto &ignore : this->memos.ignores)
|
||||||
data["memoignores"] << ignore << " ";
|
oss << ignore << " ";
|
||||||
|
data.Store("memoignores", oss.str());
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
VERSION_MAJOR=2
|
VERSION_MAJOR=2
|
||||||
VERSION_MINOR=1
|
VERSION_MINOR=1
|
||||||
VERSION_PATCH=7
|
VERSION_PATCH=8
|
||||||
VERSION_EXTRA=""
|
VERSION_EXTRA=""
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
VER_ANOPE VERSIONINFO
|
VER_ANOPE VERSIONINFO
|
||||||
FILEVERSION @VERSION_COMMA@
|
FILEVERSION @VERSION_COMMA@
|
||||||
PRODUCTVERSION @VERSION_COMMA@
|
PRODUCTVERSION @VERSION_COMMA@
|
||||||
#ifndef MINGW
|
|
||||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||||
#endif
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS VS_FF_DEBUG
|
FILEFLAGS VS_FF_DEBUG
|
||||||
#else
|
#else
|
||||||
|
|||||||
+7
-7
@@ -153,14 +153,14 @@ bool XLine::IsRegex() const
|
|||||||
|
|
||||||
void XLine::Serialize(Serialize::Data &data) const
|
void XLine::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["by"] << this->by;
|
data.Store("by", this->by);
|
||||||
data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["expires"] << this->expires;
|
data.Store("expires", this->expires);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["uid"] << this->id;
|
data.Store("uid", this->id);
|
||||||
if (this->manager)
|
if (this->manager)
|
||||||
data["manager"] << this->manager->name;
|
data.Store("manager", this->manager->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *XLine::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *XLine::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
Reference in New Issue
Block a user