Merge branch 'master' into Playerbot

# Conflicts:
#	src/server/game/World/World.h
This commit is contained in:
郑佩茹
2023-02-09 12:40:25 -07:00
1253 changed files with 114535 additions and 40950 deletions

View File

@@ -15,6 +15,7 @@ body:
Description of the problem or issue here.
Include entries of affected creatures / items / quests / spells etc.
If this is a crash, post the crashlog (upload to https://gist.github.com/) and include the link here.
Never upload files! Use GIST for text and YouTube for videos!
validations:
required: true
- type: textarea

View File

@@ -15,8 +15,8 @@ jobs:
fail-fast: false
matrix:
# the result of the matrix will be the combination of all attributes, so we get os*compiler*modules builds
os: [ubuntu-latest]
compiler: [clang12]
os: [ubuntu-20.04]
compiler: [clang]
runs-on: ${{ matrix.os }}
name: ${{ matrix.compiler }}
env:

4
.gitignore vendored
View File

@@ -22,9 +22,7 @@
!/env/docker/data/.gitkeep
!/env/docker/etc/
/env/docker/etc/*
!/env/docker/etc/authserver.conf.dockerdist
!/env/docker/etc/worldserver.conf.dockerdist
!/env/docker/etc/dbimport.conf.dockerdist
!/env/docker/etc/*.conf.dockerdist
!/env/docker/logs/.gitkeep
/.env*
/apps/joiner

View File

@@ -16,7 +16,7 @@ Development of this project dates back to 2004, and was developed under various
* SD2 project, 2008-2009, located at http://www.scriptdev2.com/
* TrinityCore, 2008-2012, located at https://www.trinitycore.org/
* SunwellCore 2012-2016, privately developed, more info at https://www.azerothcore.org/pages/sunwell.pl/
* AzerothCore, 2016-2022, located at https://www.azerothcore.org/
* AzerothCore, 2016-2023, located at https://www.azerothcore.org/
## Authorship of the code
Authorship is assigned for each commit within the git history, which is stored in these git repositories:

View File

@@ -71,7 +71,7 @@ FOREACH(subdir ${sub_DIRS})
continue()
endif()
STRING(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/" "" subdir_rel ${subdir})
STRING(REPLACE "${CMAKE_SOURCE_DIR}/" "" subdir_rel ${subdir})
if(EXISTS "${subdir}/CMakeLists.txt")
add_subdirectory("${subdir_rel}")
endif()

View File

@@ -3,19 +3,13 @@ CONFIG_FOLDER=${2:-"etc"}
BIN_FOLDER=${3-"bin"}
MYSQL_ROOT_PASSWORD=${4:-""}
# copy dist files to conf files
cp ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf.dist ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
echo "LoginDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_auth\"" >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
# worldserver or dbimport
if [[ $APP_NAME != "authserver" ]]; then
{
echo "WorldDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_world\""
echo "CharacterDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_characters\""
} >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
fi
# replace login info
sed -i "s/127.0.0.1;3306;acore;acore/localhost;3306;root;$MYSQL_ROOT_PASSWORD/" ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
if [[ $APP_NAME == "worldserver" ]]; then
echo "DataDir = \"./data/\"" >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
sed -i 's/DataDir = \".\"/DataDir = \".\/data"/' ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git ./env/dist/$BIN_FOLDER/data
fi
fi

View File

@@ -104,9 +104,7 @@ function comp_compile() {
echo "Using $MTHREADS threads"
CWD=$(pwd)
cd $BUILDPATH
pushd "$BUILDPATH" >> /dev/null || exit 1
comp_ccacheEnable
@@ -121,7 +119,7 @@ function comp_compile() {
msys*)
cmake --install . --config $CTYPE
cd $CWD
popd >> /dev/null || exit 1
echo "Done"
;;
@@ -138,7 +136,7 @@ function comp_compile() {
echo "Cmake install..."
sudo cmake --install . --config $CTYPE
cd $CWD
popd >> /dev/null || exit 1
# set all aplications SUID bit
echo "Setting permissions on binary files"
@@ -149,13 +147,30 @@ function comp_compile() {
if [[ $DOCKER = 1 && $DISABLE_DOCKER_CONF != 1 ]]; then
echo "Generating confs..."
cp -n "$DOCKER_ETC_FOLDER/worldserver.conf.dockerdist" "${confDir}/worldserver.conf"
cp -n "$DOCKER_ETC_FOLDER/authserver.conf.dockerdist" "${confDir}/authserver.conf"
cp -n "$DOCKER_ETC_FOLDER/dbimport.conf.dockerdist" "${confDir}/dbimport.conf"
# Search for all configs under DOCKER_ETC_FOLDER
for dockerdist in "$DOCKER_ETC_FOLDER"/*.dockerdist; do
# Grab "base" conf. turns foo.conf.dockerdist into foo.conf
baseConf="$(echo "$dockerdist" | rev | cut -f1 -d. --complement | rev)"
# env/dist/etc/foo.conf becomes foo.conf
filename="$(basename "$baseConf")"
# the dist files should be always found inside $confDir
# which may not be the same as DOCKER_ETC_FOLDER
distPath="$confDir/$filename.dist"
# if dist file doesn't exist, skip this iteration
[ ! -f "$distPath" ] && continue
# replace params in foo.conf.dist with params in foo.conf.dockerdist
conf_layer "$dockerdist" "$distPath" " # Copied from dockerdist"
# Copy modified dist file to $confDir/$filename
# Don't overwrite foo.conf if it already exists.
cp --no-clobber --verbose "$distPath" "$confDir/$filename"
done
fi
echo "Done"
;;
;;
esac
runHooks "ON_AFTER_BUILD"
@@ -170,3 +185,36 @@ function comp_all() {
comp_clean
comp_build
}
# conf_layer FILENAME FILENAME
# Layer the configuration parameters from the first argument onto the second argument
function conf_layer() {
LAYER="$1"
BASE="$2"
COMMENT="$3"
# Loop over all defined params in conf file
grep -E "^[a-zA-Z\.0-9]+\s*=.*$" "$LAYER" \
| while read -r param
do
# remove spaces from param
# foo = bar becomes foo=bar
NOSPACE="$(tr -d '[:space:]' <<< "$param")"
# split into key and value
KEY="$(cut -f1 -d= <<< "$NOSPACE")"
VAL="$(cut -f2 -d= <<< "$NOSPACE")"
# if key in base and val not in line
if grep -qE "^$KEY" "$BASE" && ! grep -qE "^$KEY.*=.*$VAL" "$BASE"; then
# Replace line
# Prevent issues with shell quoting
sed -i \
's,^'"$KEY"'.*,'"$KEY = $VAL$COMMENT"',g' \
"$BASE"
else
# insert line
echo "$KEY = $VAL$COMMENT" >> "$BASE"
fi
done
echo "Layered $LAYER onto $BASE"
}

View File

@@ -94,6 +94,11 @@ USER $DOCKER_USER
# NOTE: this folder is different by the /azerothcore (which is binded instead)
COPY --chown=$DOCKER_USER:$DOCKER_USER . /azerothcore
# Needed if we use the dev image without linking any external folder (e.g. acore-docker)
COPY --chown=$DOCKER_USER:$DOCKER_USER env/docker/etc/authserver.conf.dockerdist /azerothcore/env/dist/etc/authserver.conf.dockerdist
COPY --chown=$DOCKER_USER:$DOCKER_USER env/docker/etc/worldserver.conf.dockerdist /azerothcore/env/dist/etc/worldserver.conf.dockerdist
COPY --chown=$DOCKER_USER:$DOCKER_USER env/docker/etc/dbimport.conf.dockerdist /azerothcore/env/dist/etc/dbimport.conf.dockerdist
#================================================================
#
# SERVICE BASE: prepare the OS for the production-ready services

View File

@@ -223,7 +223,7 @@ function inst_simple_restarter {
function inst_download_client_data {
# change the following version when needed
local VERSION=v15
local VERSION=v16
echo "#######################"
echo "Client data downloader"

View File

@@ -1,3 +1,22 @@
##########################################
## workaround for python upgrade issue https://github.com/actions/runner-images/issues/6817
rm /usr/local/bin/2to3 || true
rm /usr/local/bin/2to3-3.10 || true
rm /usr/local/bin/2to3-3.11 || true
rm /usr/local/bin/idle3 || true
rm /usr/local/bin/idle3.10 || true
rm /usr/local/bin/idle3.11 || true
rm /usr/local/bin/pydoc3 || true
rm /usr/local/bin/pydoc3.10 || true
rm /usr/local/bin/pydoc3.11 || true
rm /usr/local/bin/python3 || true
rm /usr/local/bin/python3.10 || true
rm /usr/local/bin/python3.11 || true
rm /usr/local/bin/python3-config || true
rm /usr/local/bin/python3.10-config || true
rm /usr/local/bin/python3.11-config || true
##########################################
brew update
##########################################
@@ -8,8 +27,3 @@ fi
##########################################
brew install openssl@1.1 readline boost bash-completion curl unzip mysql ccache
##########################################
## workaround to fix openssl in ci until https://github.com/actions/virtual-environments/pull/4206 is merged
ln -sf $(brew --cellar openssl@1.1)/1.1.1* /usr/local/opt/openssl
##########################################

Some files were not shown because too many files have changed in this diff Show More