Commit Graph

333 Commits

Author SHA1 Message Date
Anton Popovichenko
1ddd9dc19c Core/Config: Implement config override with env vars (#26811)
* Core/Config: Implement config override with env vars

Implement overriding of configuration from the .conf file with environment variables.
Environment variables keys are autogenerated based on the keys defined in .conf file.
Usage example:
$ export TC_DATA_DIR=/usr
$ TC_WORLD_SERVER_PORT=8080 ./worldserver

* Core/Config Fix typo in logs

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>

* Core/Config Fix code style in EnvVarForIniKey

Co-authored-by: Shauren <shauren.trinity@gmail.com>

* Update tests/common/Config.cpp

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>

Co-authored-by: Anton Popovichenko <anton.popovichenko@mendix.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>
2021-08-19 22:26:16 +02:00
Giacomo Pozzoni
96dc110f4a Core/DBLayer: Add QueueSize() method (#26733)
* Core/DBLayer: Add QueueSize() method

Add QueueSize() method to database objects (Login, Character and World) that returns how many tasks are queued.
Include the queue size of the 3 databases in ".server debug" command

* Make the code less threadsafe

* Send data to InfluxDB

* Update grafana dashboard
2021-07-24 14:50:30 +02:00
Giacomo Pozzoni
5ae2a0f47d Common/Misc: Replace old macros with modern C++ attributes (#26613) 2021-06-20 16:52:24 +02:00
Mikhail Redko
6c12f45f3b Core/Console: Improve ReadWinConsole logic and cosmetic changes (#26402)
* Core/Console: Improve ReadWinConsole logic and cosmetic changes

* Core/Console: Fixed possible appearance of weird characters in the console when printing the output of child processes

* Fix codestyle

* Removed auto

* Core/Misc: Explicit casting Difficulty values to uint8 before outputting to console

* Core/Misc: Cast Difficulty to uint32 for output to console

Co-authored-by: jackpoz <giacomopoz@gmail.com>
2021-05-11 09:55:57 +02:00
killerwife
d5f1fefe7f Vmap: Introduce skipping of antiportals and unreachable mogp (#26331)
* Vmap: Introduce skipping of antiportals and unreachable mogp

* Reduce differences with master branch

* Update VMAP and MMAP versions

* Update MMAPs version

Co-authored-by: jackpoz <giacomopoz@gmail.com>
2021-04-24 14:58:16 +02:00
Shauren
677952fbc5 Core/Console: Fix uninitialized variable 2021-04-13 23:27:49 +02:00
Mikhail Redko
1539bed3db Core/Misc: Fixed utf8 encoding in console input/output. (#26352)
* Core/Misc: Fixed utf8 encoding in console input/output.

* Fix gcc build

* Fixed that weird 'a' with circle above it and other similar letters. Also fixed encoding in AppenderConsole which sometimes did not work as it should

* Fix build on Linux

* Probably better to do it like this
2021-04-11 19:41:44 +02:00
Shauren
013f8370a0 Core/Misc: Enum flag v3 - allow enabling flag operations directly after enum definition when inside namespaces
(cherry picked from commit ec87d048b4)

# Conflicts:
#	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
#	src/server/game/AuctionHouse/AuctionHouseMgr.h
#	src/server/game/Entities/Object/ObjectGuid.h
#	src/server/game/Entities/Object/Updates/UpdateField.h
#	src/server/game/Entities/Object/Updates/UpdateFields.cpp
#	src/server/game/Entities/Object/Updates/UpdateFields.h
#	src/server/game/Entities/Player/CollectionMgr.cpp
#	src/server/game/Entities/Player/CollectionMgr.h
#	src/server/game/Phasing/PhaseShift.cpp
#	src/server/game/Phasing/PhaseShift.h
#	src/server/game/Phasing/PhasingHandler.cpp
2021-04-05 16:30:09 +02:00
Shauren
ab97969202 Core/Misc: Improve enum flags with type safe operators
(cherry picked from commit 0763844fb6)

# Conflicts:
#	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
#	src/server/game/AuctionHouse/AuctionHouseMgr.h
#	src/server/game/Entities/Object/ObjectGuid.h
#	src/server/game/Entities/Object/Updates/UpdateField.h
#	src/server/game/Entities/Object/Updates/UpdateFields.cpp
#	src/server/game/Entities/Object/Updates/UpdateFields.h
#	src/server/game/Entities/Player/CollectionMgr.cpp
#	src/server/game/Entities/Player/CollectionMgr.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Globals/ObjectMgr.h
#	src/server/game/Phasing/PhaseShift.cpp
#	src/server/game/Phasing/PhaseShift.h
#	src/server/game/Phasing/PhasingHandler.cpp
2021-04-05 16:24:06 +02:00
killerwife
00da074109 MapExtraction: Fix water height redundancy algorithm ignoring "no water" (#26324)
* MapExtraction: Fix water height redundancy algorithm ignoring "no water"

* Update MMAP_VERSION

* Change map version

Co-authored-by: jackpoz <giacomopoz@gmail.com>
2021-04-04 21:52:57 +02:00
Giacomo Pozzoni
9af6bf15aa CI/CircleCI: Expose binaries built on Circle CI as docker images in the Circle CI artifacts (#25832)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-01-16 21:30:57 +01:00
Mikhail Redko
eaa22b8a17 Core/Misc: Remove unneeded null-terminator after switch from wchar_t to std::wstring in 309851e. Fixes creation characters with declined russian names (#25797)
Closes #23775
2021-01-04 19:52:43 +01:00
Kargatum
a32b6b8ac4 Core: whitespace cleanup, reduce double blank line to single (#25795)
* Core/Misc: fix double empty line

* worldserver.conf
2021-01-03 11:47:07 +01:00
jackpoz
1cafd4ef74 Core/Misc: Fix Windows 32 bits build
Close #25789
2020-12-31 19:55:55 +01:00
jackpoz
3947e4cb57 Core/MMAPs: Restore single slope angle of 55°
Re-generating MMAPs IS required.
Partially reverts 995a443da2 .

Having 2 different slope angles of 55° and 85° created too many polygons to fit in the current mmtile structure. This caused some polygons to become disconnected from each other, creating the old "invisible walls" effect. Because of this and because of the performance hit when loading a mmtile caused by the increase of polygon numbers, this commit reverts the recent changes and sets by default the slope angle to 55°.
Feel free to restore the previous behaviour by running .\mmaps_generator --maxAngle 85 --maxAngleNotSteep 55 , specifying the map id as number if a single map should have different slope values.
This is the last commit that will change MMAPs version to force re-generating them. Any future change that will affect only the generation settings will be optional (but recommended).
2020-10-10 23:03:09 +02:00
Shauren
868c82aa6c Dep/Boost: Support for boost 1.74 - heap
Closes #25470
2020-09-27 21:24:38 +02:00
Shauren
155e37831e Dep/Boost: Partial support for boost 1.74 - asio
Ref #25470
2020-09-27 20:20:59 +02:00
Shauren
dc56f0a1d9 Core/Misc: nopch fixes 2020-09-26 20:51:32 +02:00
Aokromes
91cda8b1cd Common/Metric: Fix build with PERFORMANCE_PROFILING and/or WITHOUT_METRICS 2020-09-19 03:21:36 +02:00
Treeston
75f9e7396e [3.3.5] Core/ChatCommands: Show error messages from argument parsers (PR #25443) 2020-09-12 19:42:10 +02:00
Winfidonarleyan
9d96e4852a Dep/fmt: update fmt library to 7.0.3 2020-09-11 19:25:35 +02:00
Treeston
feaaa595ca Core/ChatCommands: make ExactSequence more readable 2020-09-10 15:19:17 +02:00
Treeston
bcdbdd6f23 Core/Authserver: Removal of sha_pass_hash, compatibility fields, and everything that uses them (PR #25156) 2020-09-06 16:04:10 +02:00
Treeston
f45aa5cac1 Common/Util: Trinity::StringTo<double> support (PR #25364) 2020-09-02 22:04:45 +02:00
Treeston
eaf8fa75a1 Core/Misc: Add support for custom link colors. Clean-up hyperlink validation, no more long-ass defines. Remove UI.ShowQuestLevelsInDialogs. 2020-09-02 22:01:51 +02:00
Shauren
c1e4cfd07e Core/Config: Restore ability to load additional config files for custom scripts 2020-08-29 22:14:17 +02:00
Giacomo Pozzoni
cfc8f7b442 Core/Misc: Fix issues reported by static analysis (#25351)
* Core/Misc: Fix issues reported by static analysis

* Core/Vmaps: Code cleanup after e777161888
2020-08-29 13:02:42 +02:00
Treeston
f54cec4db7 Common/Utilities: Make StringTo<bool>'s signature match that of the other integral types, making for easier templating. Default behavior unchanged. 2020-08-28 23:35:12 +02:00
Treeston
534a2388b7 Core/Common: Tokenizer -> Trinity::Tokenize (PR: #25327) 2020-08-28 00:11:16 +02:00
Treeston
7478c2c65a Common/Utilities: Properly read std::from_chars documentation and check for out_of_range errors. 2020-08-27 21:26:14 +02:00
Treeston
3564ad18bf cd30e0b follow-up (I could've sworn I pushed that to the PR branch. Sorry, Shauren.) 2020-08-26 23:38:31 +02:00
Treeston
cd30e0b86c Common/Utilities: Centralize string -> T conversion in StringConvert.h (PR #25335) 2020-08-26 23:31:45 +02:00
Treeston
fd05a35341 Revert "[3.3.5] Core/ChatCommands: C++17 cleanup (if constexpr + std::string_view)"
This reverts commit 11c4a60fbe.
2020-08-24 16:38:39 +02:00
Treeston
11c4a60fbe [3.3.5] Core/ChatCommands: C++17 cleanup (if constexpr + std::string_view) 2020-08-24 16:17:56 +02:00
Treeston
91744de316 Common/Utilities: Move EnumUtils' implementation struct from Trinity::Impl to Trinity::Impl::EnumUtilsImpl. This avoids confusing name clashes for other implementations in sub-namespaces of Trinity::Impl. 2020-08-23 15:05:04 +02:00
Treeston
a41bbd9ad9 Core/Misc: std::string -> std::string_view in a bunch of places, notably chat commands and Util.h 2020-08-23 00:31:57 +02:00
Shauren
e1289805fc Core/Networking: Initialize MPSCQueueIntrusive dummy node without undefined behavior 2020-08-20 16:06:15 +02:00
Shauren
84a87d87bf Core/Util: Added another template utility - find_type_if
* Trinity::find_type_if - Find a type matching predicate in a given template parameter pack
2020-08-20 15:46:31 +02:00
Shauren
7c08fc863a Core/Util: Added new utilities
* Trinity::new_from_tuple - same as std::make_from_tuple except allocates object using "new"
* Trinity::is_tuple - detects whether given type is a tuple specialization
* advstd::type_identity - C++20 std::type_identity
2020-08-20 13:34:45 +02:00
Treeston
643b9209f8 Common/Misc: Clean-up a GCC sign comparison warning 2020-08-20 02:22:23 +02:00
Peter Keresztes Schmidt
4286e7aa02 Core/ChatCommands: Check whether a passed numeric enum value is valid (#25285) 2020-08-20 00:46:52 +02:00
Peter Keresztes Schmidt
5e40eb20e2 Core/ChatCommands: Add support for enum type arguments (PR #25242) 2020-08-16 14:11:21 +02:00
Treeston
6116e5b385 Core/Warden: Warden refactors (PR #25235) 2020-08-11 18:04:36 +02:00
Shauren
dd34651f4d Core/CrashHandler: Skip logging stack trace of the thread writing the crash log, it was launched by windows with same context as crashing thread 2020-08-07 17:58:46 +02:00
Shauren
c5e1b49e8c Core/CrashHandler: Remove logging function variation depending on crash reason and print directly to file, not to temporary buffer 2020-08-07 17:57:44 +02:00
Shauren
68fdfcaa50 Core/CrashHandler: NULL -> nullptr 2020-08-07 17:19:18 +02:00
Shauren
39c5e03b74 Core/CrashHandler: #ifdef cleanup to make VS not choke when parsing, fixed file being all red in editor 2020-08-07 17:19:18 +02:00
Shauren
83ed35fe62 Core/CrashHandler: Attempt to extract C++ exception object in uncaught exception hander 2020-08-07 17:19:16 +02:00
Treeston
7b8b999516 Core/Common: Move old-style pointer+size HexStr methods to Trinity::Impl where they can't hurt anyone 2020-08-04 17:03:26 +02:00
Shauren
b3db50a3b4 Core/Misc: Fix compile errors found with msvc /permissive- 2020-08-04 15:42:08 +02:00