Skip to content

Commit

Permalink
Merge branch '3.3.5' into npcbots_3.3.5
Browse files Browse the repository at this point in the history
# Conflicts:
#	.circleci/config.yml
  • Loading branch information
trickerer committed Apr 13, 2024
2 parents 7c73f78 + d6ccdbe commit f0d5dca
Show file tree
Hide file tree
Showing 157 changed files with 612 additions and 169 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gcc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ concurrency:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: |
sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11
- name: Setup
run: |
mkdir bin
Expand Down
2 changes: 1 addition & 1 deletion cmake/compiler/gcc/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ target_compile_definitions(trinity-compile-option-interface
INTERFACE
-D_BUILD_DIRECTIVE="$<CONFIG>")

set(GCC_EXPECTED_VERSION 10.0.0)
set(GCC_EXPECTED_VERSION 11.1.0)

if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_EXPECTED_VERSION)
message(FATAL_ERROR "GCC: TrinityCore requires version ${GCC_EXPECTED_VERSION} to build but found ${CMAKE_CXX_COMPILER_VERSION}")
Expand Down
101 changes: 73 additions & 28 deletions contrib/extractor.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,102 @@ CLS

:MENU
ECHO.
ECHO ...............................................
ECHO Trinitycore dbc/db2, maps, vmaps, mmaps extractor
ECHO ...............................................
ECHO PRESS 1, 2, 3 OR 4 to select your task, or 5 to EXIT.
ECHO ...............................................
ECHO ====================== Extractor ========================
ECHO TrinityCore cameras, dbc, maps, vmaps and mmaps extractor
ECHO =========================================================
ECHO.
ECHO WARNING! when extracting the vmaps extractor will
ECHO ======================================================
ECHO WARNING! When extracting the vmaps extractor will
ECHO output the text below, it's intended and not an error:
ECHO ..........................................
ECHO ======================================================
ECHO Extracting World\Wmo\Band\Final_Stage.wmo
ECHO No such file.
ECHO Couldn't open RootWmo!!!
ECHO Done!
ECHO ..........................................
ECHO ======================================================
ECHO.
ECHO Press 1, 2, 3 or 4 to start extracting or 5 to exit.
ECHO 1 - Extract base files (NEEDED) and cameras.
ECHO 2 - Extract vmaps (needs maps to be extracted before you run this) (OPTIONAL, highly recommended)
ECHO 3 - Extract mmaps (needs vmaps to be extracted before you run this, may take hours) (OPTIONAL, highly recommended)
ECHO 4 - Extract all (may take hours)
ECHO 5 - EXIT
ECHO 1: Extract base files (NEEDED) and cameras.
ECHO 2: Extract vmaps (needs maps to be extracted before you run this) (OPTIONAL, but highly recommended)
ECHO 3: Extract mmaps (needs vmaps to be extracted before you run this, may take hours) (OPTIONAL, but highly recommended)
ECHO 4: Extract all (may take hours)
ECHO 5: Extract all with logs (may take hours)
ECHO 6: EXIT
ECHO.
SET /P M=Type 1, 2, 3, 4 or 5 then press ENTER:
SET /P M=Type 1, 2, 3, 4, 5 or 6 then press ENTER:
IF %M%==1 GOTO MAPS
IF %M%==2 GOTO VMAPS
IF %M%==3 GOTO MMAPS
IF %M%==4 GOTO ALL
IF %M%==5 GOTO :EOF
IF %M%==5 GOTO ALLWITHLOGS
IF %M%==6 GOTO :EOF

:MAPS
start /b /w mapextractor.exe
ECHO.
START /b /w mapextractor.exe
TIMEOUT 5 > NUL
CLS
GOTO MENU

:VMAPS
start /b /w vmap4extractor.exe
start /b /w vmap4assembler.exe Buildings vmaps
rmdir Buildings /s /q
ECHO.
START /b /w vmap4extractor.exe
START /b /w vmap4assembler.exe Buildings vmaps
RMDIR Buildings /s /q
TIMEOUT 5 > NUL
CLS
GOTO MENU

:MMAPS
ECHO.
ECHO This may take a few hours to complete. Please be patient.
PAUSE
start /b /w mmaps_generator.exe
TIMEOUT 5 > NUL
START /b /w mmaps_generator.exe
TIMEOUT 5 > NUL
CLS
GOTO MENU

:ALL
ECHO.
ECHO This may take a few hours to complete. Please be patient.
PAUSE
start /b /w mapextractor.exe
start /b /w vmap4extractor.exe
start /b /w vmap4assembler.exe
rmdir Buildings /s /q
start /b /w mmaps_generator.exe
TIMEOUT 5 > NUL
START /b /w mapextractor.exe
TIMEOUT 5 > NUL
START /b /w vmap4extractor.exe
TIMEOUT 5 > NUL
START /b /w vmap4assembler.exe
RMDIR Buildings /s /q
TIMEOUT 5 > NUL
START /b /w mmaps_generator.exe
TIMEOUT 5 > NUL
CLS
GOTO MENU

REM "2>&1" merges Standard Error (stderr) with Standard Output (stdout).
REM The results are redirected ">" into the log file.
:ALLWITHLOGS
ECHO.
ECHO This may take a few hours to complete. Please be patient.
ECHO.
TIMEOUT 5 > NUL
ECHO Extracting cameras, dbc and maps.
START /b /w mapextractor.exe 2>&1 > mapextractor.log
ECHO cameras, dbc and maps extracted.
ECHO.
TIMEOUT 5 > NUL
ECHO Extracting Buildings for Vmaps.
START /b /w vmap4extractor.exe 2>&1 > vmap4extractor.log
ECHO Buildings for Vmaps extracted.
ECHO.
TIMEOUT 5 > NUL
ECHO Assembling Buildings with Vmaps.
START /b /w vmap4assembler.exe 2>&1 > vmap4assembler.log
RMDIR Buildings /s /q
ECHO Buildings with Vmaps Assembled.
ECHO.
TIMEOUT 5 > NUL
ECHO Generating Mmaps (This takes the longest time).
START /b /w mmaps_generator.exe 2>&1 > mmaps_generator.log
ECHO Mmaps generated.
TIMEOUT 5 > NUL
CLS
GOTO MENU
2 changes: 1 addition & 1 deletion revision_data.h.in.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define _SOURCE_DIRECTORY R"(@CMAKE_SOURCE_DIR@)"
#define _BUILD_DIRECTORY R"(@BUILDDIR@)"
#define _MYSQL_EXECUTABLE R"(@MYSQL_EXECUTABLE@)"
#define _FULL_DATABASE "TDB_full_world_335.24011_2024_01_21.sql"
#define _FULL_DATABASE "TDB_full_world_335.24041_2024_04_10.sql"
#define VER_COMPANYNAME_STR "TrinityCore Developers"
#define VER_LEGALCOPYRIGHT_STR "(c)2008-@rev_year@ TrinityCore"
#define VER_FILEVERSION 0,0,0
Expand Down
9 changes: 5 additions & 4 deletions sql/base/auth_database.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- MySQL dump 10.13 Distrib 8.0.35, for Linux (x86_64)
-- MySQL dump 10.13 Distrib 8.0.36, for Linux (x86_64)
--
-- Host: localhost Database: auth
-- ------------------------------------------------------
-- Server version 8.0.35-0ubuntu0.20.04.1
-- Server version 8.0.36-0ubuntu0.22.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Expand Down Expand Up @@ -2023,7 +2023,8 @@ INSERT INTO `updates` VALUES
('2024_01_06_01_auth.sql','3D9E0A906A357877DB8E7B72E0797AB38EF884BC','ARCHIVED','2024-01-06 11:33:07',0),
('2024_01_06_02_auth.sql','B14F889C198A4F640A968BAB8A4C262AC61634C7','ARCHIVED','2024-01-06 12:43:47',0),
('2024_01_06_03_auth.sql','693BFD4326314659BAD9A2C70D9526FF4625B393','ARCHIVED','2024-01-06 12:55:07',0),
('2024_01_21_00_auth.sql','B45B95D7B608D6ACF1BCBA656718C7DEED8CFF00','ARCHIVED','2024-01-21 11:38:22',0);
('2024_01_21_00_auth.sql','B45B95D7B608D6ACF1BCBA656718C7DEED8CFF00','ARCHIVED','2024-01-21 11:38:22',0),
('2024_04_10_00_auth.sql','CE8BD4D6DF6DE85DBF892507B1B18B746FE4A71D','ARCHIVED','2024-04-10 16:07:02',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down Expand Up @@ -2162,4 +2163,4 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2024-01-21 11:38:23
-- Dump completed on 2024-04-10 16:07:05
9 changes: 5 additions & 4 deletions sql/base/characters_database.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- MySQL dump 10.13 Distrib 8.0.35, for Linux (x86_64)
-- MySQL dump 10.13 Distrib 8.0.36, for Linux (x86_64)
--
-- Host: localhost Database: characters
-- ------------------------------------------------------
-- Server version 8.0.35-0ubuntu0.20.04.1
-- Server version 8.0.36-0ubuntu0.22.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Expand Down Expand Up @@ -2684,7 +2684,8 @@ INSERT INTO `updates` VALUES
('2023_06_14_00_characters.sql','0595B21DCFC0A04F2D8DF1F7BC018C758895DBE5','ARCHIVED','2023-06-14 19:34:24',0),
('2023_09_10_00_characters.sql','5DE09CA31B5168CF3622CB462816B6C598893D96','ARCHIVED','2023-09-10 12:23:34',0),
('2024_01_21_00_characters.sql','4D27D8DAC9F78795DB6938B54F32502EF8D8AAE6','ARCHIVED','2024-01-21 11:38:22',0),
('2024_02_05_00_characters.sql','1777CBCA822AD85777DA4A390DF7AAF41AF68EBD','RELEASED','2024-02-05 12:17:19',0);
('2024_02_05_00_characters.sql','1777CBCA822AD85777DA4A390DF7AAF41AF68EBD','ARCHIVED','2024-02-05 12:17:19',0),
('2024_04_10_00_characters.sql','E0D6E19ACE6759332402FA27C23B0F7745C49742','ARCHIVED','2024-04-10 16:07:02',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down Expand Up @@ -2855,4 +2856,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2024-01-21 11:38:24
-- Dump completed on 2024-04-10 16:07:06
6 changes: 3 additions & 3 deletions sql/base/dev/world_database.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- MySQL dump 10.13 Distrib 8.0.35, for Linux (x86_64)
-- MySQL dump 10.13 Distrib 8.0.36, for Linux (x86_64)
--
-- Host: localhost Database: world
-- ------------------------------------------------------
-- Server version 8.0.35-0ubuntu0.20.04.1
-- Server version 8.0.36-0ubuntu0.22.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Expand Down Expand Up @@ -4067,4 +4067,4 @@ CREATE TABLE `waypoints` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2024-01-21 11:38:25
-- Dump completed on 2024-04-10 16:07:07
4 changes: 4 additions & 0 deletions sql/old/3.3.5a/world/24011_2024_04_10/2024_04_09_00_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Add properly required fishing skill for Zul'Gurub area
DELETE FROM `skill_fishing_base_level` WHERE `entry`=1977;
INSERT INTO `skill_fishing_base_level` (`entry`, `skill`) VALUES
(1977, 330);
2 changes: 2 additions & 0 deletions sql/updates/auth/3.3.5/2024_04_10_00_auth.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- TDB 335.24041 auth
UPDATE `updates` SET `state`='ARCHIVED';
2 changes: 2 additions & 0 deletions sql/updates/characters/3.3.5/2024_04_10_00_characters.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- TDB 335.24041 characters
UPDATE `updates` SET `state`='ARCHIVED';
3 changes: 3 additions & 0 deletions sql/updates/world/3.3.5/2024_04_10_00_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- TDB 335.24041 world
UPDATE `version` SET `db_version`='TDB 335.24041', `cache_id`=24041 LIMIT 1;
UPDATE `updates` SET `state`='ARCHIVED';
31 changes: 30 additions & 1 deletion src/common/Configuration/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
#include "Config.h"
#include "Log.h"
#include "StringConvert.h"
#include "Util.h"
#include <boost/filesystem/operations.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <algorithm>
#include <cstdlib>
#include <memory>
#include <mutex>

namespace bpt = boost::property_tree;
namespace fs = boost::filesystem;

namespace
{
Expand Down Expand Up @@ -159,6 +160,8 @@ bool ConfigMgr::LoadAdditionalFile(std::string file, bool keepOnReload, std::str
if (!LoadFile(file, fullTree, error))
return false;

std::lock_guard<std::mutex> lock(_configLock);

for (bpt::ptree::value_type const& child : fullTree.begin()->second)
_config.put_child(bpt::ptree::path_type(child.first, '/'), child.second);

Expand All @@ -168,6 +171,32 @@ bool ConfigMgr::LoadAdditionalFile(std::string file, bool keepOnReload, std::str
return true;
}

bool ConfigMgr::LoadAdditionalDir(std::string const& dir, bool keepOnReload, std::vector<std::string>& loadedFiles, std::vector<std::string>& errors)
{
fs::path dirPath = dir;
if (!fs::exists(dirPath) || !fs::is_directory(dirPath))
return true;

for (fs::directory_entry const& f : fs::recursive_directory_iterator(dirPath))
{
if (!fs::is_regular_file(f))
continue;

fs::path configFile = fs::absolute(f);
if (configFile.extension() != ".conf")
continue;

std::string fileName = configFile.generic_string();
std::string error;
if (LoadAdditionalFile(fileName, keepOnReload, error))
loadedFiles.push_back(std::move(fileName));
else
errors.push_back(std::move(error));
}

return errors.empty();
}

std::vector<std::string> ConfigMgr::OverrideWithEnvVariablesIfAny()
{
std::lock_guard<std::mutex> lock(_configLock);
Expand Down
2 changes: 2 additions & 0 deletions src/common/Configuration/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "Define.h"
#include <string>
#include <string_view>
#include <vector>

class TC_COMMON_API ConfigMgr
Expand All @@ -33,6 +34,7 @@ class TC_COMMON_API ConfigMgr
/// Method used only for loading main configuration files (authserver.conf and worldserver.conf)
bool LoadInitial(std::string file, std::vector<std::string> args, std::string& error);
bool LoadAdditionalFile(std::string file, bool keepOnReload, std::string& error);
bool LoadAdditionalDir(std::string const& dir, bool keepOnReload, std::vector<std::string>& loadedFiles, std::vector<std::string>& errors);

/// Overrides configuration with environment variables and returns overridden keys
std::vector<std::string> OverrideWithEnvVariablesIfAny();
Expand Down
5 changes: 3 additions & 2 deletions src/server/authserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ add_executable(authserver
)

if(NOT WIN32)
set_target_properties(authserver PROPERTIES
COMPILE_DEFINITIONS _TRINITY_REALM_CONFIG="${CONF_DIR}/authserver.conf"
target_compile_definitions(authserver PRIVATE
_TRINITY_REALM_CONFIG="${CONF_DIR}/authserver.conf"
_TRINITY_REALM_CONFIG_DIR="${CONF_DIR}/authserver.conf.d"
)
endif()

Expand Down
Loading

0 comments on commit f0d5dca

Please sign in to comment.