Commit Graph
447 Commits
Author SHA1 Message Date
Anton Popovichenko 8447f627ba 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 <[email protected]>

* Core/Config Fix code style in EnvVarForIniKey

Co-authored-by: Shauren <[email protected]>

* Update tests/common/Config.cpp

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <[email protected]>

* Apply suggestions from code review

Co-authored-by: Peter Keresztes Schmidt <[email protected]>

Co-authored-by: Anton Popovichenko <[email protected]>
Co-authored-by: Giacomo Pozzoni <[email protected]>
Co-authored-by: Shauren <[email protected]>
Co-authored-by: Peter Keresztes Schmidt <[email protected]>
(cherry picked from commit 1ddd9dc19cc1df1a1ab8c6123283999f9dea6760)
2022-03-13 16:37:01 +01:00
Giacomo Pozzoni 51f0294c18 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

(cherry picked from commit 96dc110f4a353871ac74c82ff4b1bcc4c34156f3)
2022-03-11 19:32:22 +01:00
Giacomo Pozzoni 2bc1bbd91d Common/Misc: Replace old macros with modern C++ attributes (#26613)
(cherry picked from commit 5ae2a0f47d323fadcfebf44c7b6ec11a3f91c75a)
2022-03-11 11:48:31 +01:00
Shauren a5f107dafc Core/Utilities: Fixed child process console output being incorrectly cut off at first newline 2022-03-09 16:22:04 +01:00
Mikhail Redko 9e6def8ae2 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 <[email protected]>
(cherry picked from commit 6c12f45f3b7d7eab32ed29860d2261fc8a512f0e)
2022-03-09 14:55:18 +01:00
Shauren b1f231452b Core/Console: Fix uninitialized variable
(cherry picked from commit 677952fbc59676b549337f9f7eb5c7e7abb1135e)
2022-03-08 21:58:16 +01:00
Mikhail Redko f7441f0234 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

(cherry picked from commit 1539bed3db86f2153f2d0d5fbf24bf9ee4af1d92)
2022-03-08 15:57:30 +01:00
Giacomo Pozzoni c2068bd423 CI/CircleCI: Expose binaries built on Circle CI as docker images in the Circle CI artifacts (#25832)
Co-authored-by: Shauren <[email protected]>
(cherry picked from commit 9af6bf15aa2fe836c3ebba306eaaa8971f00fac4)
2022-03-06 00:24:04 +01:00
Mikhail Redko 81555a8ea4 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

(cherry picked from commit eaa22b8a1722fd362bf5ef2c6944b5c50b121afd)
2022-03-05 21:46:57 +01:00
Kargatum 373ed8f46b Core: whitespace cleanup, reduce double blank line to single (#25795)
* Core/Misc: fix double empty line

* worldserver.conf

(cherry picked from commit a32b6b8ac4c81128a56b282f20837fb085bdd9e7)
2022-03-05 20:07:57 +01:00
Aokromes 2f0ed35c26 Common/Metric: Fix build with PERFORMANCE_PROFILING and/or WITHOUT_METRICS
(cherry picked from commit 91cda8b1cdf4b45c4ca3ef1a742f6d1733ad3d66)
2022-02-27 20:08:41 +01:00
Shauren 0b846b2107 Build: Partial support for clang-cl 2022-02-16 20:22:15 +01:00
Shauren f6e72494f1 Dep: Raise required boost versions to 1.73 on windows and 1.71 on linux and remove compatibility code for unsupported versions 2022-02-14 12:43:57 +01:00
Shauren 439b027d48 Core/Misc: Cleanup unused includes 2022-02-13 15:07:00 +01:00
Shauren 6c399c372e Core/Misc: common PCH tuning 2022-02-11 23:24:54 +01:00
Shauren 0f40af64e6 Core/Utils: Corrected included files in Containers.h 2022-02-11 22:14:47 +01:00
Shauren cbcd149ce5 Core/Misc: Explicitly include required headers instead of relying on them to be included by other headers 2022-02-11 14:33:35 +01:00
Shauren f4cf0ecad6 Core/Utils: Made bool conversion operator of FlagsArray explicit 2022-02-10 12:24:47 +01:00
Shauren 5c417bec98 Core/Utils: Extract template base class out of flag128 2022-02-09 23:11:03 +01:00
Treeston 378691aaa2 [3.3.5] Core/ChatCommands: Show error messages from argument parsers (PR #25443)
(cherry picked from commit 75f9e7396e35360f3016cc0cb21e72e20f5d96d5)
2022-02-05 23:42:15 +01:00
Winfidonarleyan 9fe5a7297d Dep/fmt: update fmt library to 7.0.3
(cherry picked from commit 9d96e4852a4a25fdc323f656e24034fa1a280826)
2022-02-05 22:50:43 +01:00
Treeston 013c9b2cb7 Core/ChatCommands: make ExactSequence more readable
(cherry picked from commit feaaa595cae735bb6093b24a88562c27b2723cfe)
2022-02-05 21:29:53 +01:00
Treeston e0e3bae82c Core/Authserver: Removal of sha_pass_hash, compatibility fields, and everything that uses them (PR #25156)
(cherry picked from commit bcdbdd6f23ce65cc0e381e61d2840140dce79311)
2022-02-05 13:29:21 +01:00
Treeston da8a66a05e Common/Util: Trinity::StringTo<double> support (PR #25364)
(cherry picked from commit f45aa5cac1579e87cbc599ffb58e10e662066792)
2022-02-04 23:50:25 +01:00
Treeston 0d54a5ecb4 Core/Misc: Add support for custom link colors. Clean-up hyperlink validation, no more long-ass defines. Remove UI.ShowQuestLevelsInDialogs.
(cherry picked from commit eaf8fa75a1c76131ecbf2585db6d6236b7334b8e)
2022-02-04 23:49:59 +01:00
Treeston c4b287c7bf Core/Misc: DBC std::array refactors, and |Hachievement unit tests
(cherry picked from commit 3fbbe7cfbe1bc51db12bdc1ec7b21c16d1716366)
2022-02-04 23:37:29 +01:00
Shauren 7cd98cd7d2 Core/Config: Restore ability to load additional config files for custom scripts
(cherry picked from commit c1e4cfd07eee19069a15e9b82a308d8a914d5637)
2022-02-04 13:05:06 +01:00
Giacomo Pozzoni 99ee958e0a Core/Misc: Fix issues reported by static analysis (#25351)
* Core/Misc: Fix issues reported by static analysis

* Core/Vmaps: Code cleanup after e777161888

(cherry picked from commit cfc8f7b442a9dba07b198fcebe2c02ab89cf0a8b)
2022-02-04 12:18:15 +01:00
Treeston 1303ca0e7e Common/Utilities: Make StringTo<bool>'s signature match that of the other integral types, making for easier templating. Default behavior unchanged.
(cherry picked from commit f54cec4db7c67b623383c140159e1171876ace89)
2022-02-04 12:06:26 +01:00
Treeston 9f97fdd31a Core/Common: Tokenizer -> Trinity::Tokenize (PR: #25327)
(cherry picked from commit 534a2388b7c662c8796aabb1ec8cb424879799b6)
2022-02-04 00:27:14 +01:00
Treeston 6e45c371c4 Common/Utilities: Properly read std::from_chars documentation and check for out_of_range errors.
(cherry picked from commit 7478c2c65aea853a2086c9c7ecc56c14ad6ee338)
2022-02-04 00:27:14 +01:00
Treeston be9dadc189 Common/Utilities: Centralize string -> T conversion in StringConvert.h (PR #25335)
(cherry picked from commit cd30e0b86ce6ee88386a91cebdf353fc55805c57)
2022-02-04 00:27:13 +01:00
Treeston 03b5c17863 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.
(cherry picked from commit 91744de3162bab23d7c5a0dd65fc8b4249eb803a)
2022-02-04 00:27:12 +01:00
Treeston 0473beff2b Core/Misc: std::string -> std::string_view in a bunch of places, notably chat commands and Util.h
(cherry picked from commit a41bbd9ad9adedb15c7133bdef1575a6ec0eb1ab)
2022-02-04 00:27:12 +01:00
Shauren 015cee5f27 Core/Networking: Initialize MPSCQueueIntrusive dummy node without undefined behavior
(cherry picked from commit e1289805fc04e75f9e7cba078cbc826ce60f037a)
2022-02-04 00:27:11 +01:00
Shauren 4064b22dd7 Core/Util: Added another template utility - find_type_if
* Trinity::find_type_if - Find a type matching predicate in a given template parameter pack

(cherry picked from commit 84a87d87bfd569192ff1564e3d8b2e68d5fff4bc)
2022-02-03 00:24:33 +01:00
Shauren c37984fc6a 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

(cherry picked from commit 7c08fc863ac45f2d41b18103b0132004a4c0c524)
2022-02-03 00:24:10 +01:00
Peter Keresztes Schmidt 3c82863c52 Core/ChatCommands: Check whether a passed numeric enum value is valid (#25285)
(cherry picked from commit 4286e7aa02e777268b25d8a5bcc1ee87f7b16c4d)
2022-02-03 00:18:48 +01:00
Peter Keresztes Schmidt 3923650aeb Core/ChatCommands: Add support for enum type arguments (PR #25242)
(cherry picked from commit 5e40eb20e2789b86d4786d86b4bbb8ae83de5e1e)
2022-01-26 22:13:06 +01:00
Treeston 319ddd9bcd Core/Warden: Warden refactors (PR #25235)
(cherry picked from commit 6116e5b38522ccfb00f6c941c75482e05b4c0799)
2022-01-26 19:42:11 +01:00
jackpoz 35755ba343 Core/Misc: Fix Windows 32 bits build
Close #25789

(cherry picked from commit 1cafd4ef74350cb3656917e8e033a5e21dcce193)
2022-01-26 18:48:08 +01:00
Shauren fbcf269207 Core/CrashHandler: Skip logging stack trace of the thread writing the crash log, it was launched by windows with same context as crashing thread
(cherry picked from commit dd34651f4d42ca598b2f1b2ed32e27b4742f4be7)
2022-01-26 18:47:44 +01:00
Shauren cc0affa523 Core/CrashHandler: Remove logging function variation depending on crash reason and print directly to file, not to temporary buffer
(cherry picked from commit c5e1b49e8c02386a0e9edf682692dc6d46cc862f)
2022-01-26 18:47:16 +01:00
Shauren 259bbf1e04 Core/CrashHandler: NULL -> nullptr
(cherry picked from commit 68fdfcaa507d06ce8e823e7848f4c58ef1e62732)
2022-01-26 18:46:56 +01:00
Shauren 473f3db0ab Core/CrashHandler: #ifdef cleanup to make VS not choke when parsing, fixed file being all red in editor
(cherry picked from commit 39c5e03b749d44df346b8f37aed3eb898526365a)
2022-01-26 18:46:43 +01:00
Shauren 7893ac94a0 Core/CrashHandler: Attempt to extract C++ exception object in uncaught exception hander
(cherry picked from commit 83ed35fe62c16f5697f253a9a44bba7dcb83e80d)
2022-01-26 18:43:31 +01:00
Treeston fa8ab6eb98 Core/Common: Move old-style pointer+size HexStr methods to Trinity::Impl where they can't hurt anyone
(cherry picked from commit 7b8b999516a824b0c417631a77f133eb47b8b2f4)
2022-01-26 14:36:42 +01:00
Shauren 58d199db48 Core/Misc: Fix compile errors found with msvc /permissive-
(cherry picked from commit b3db50a3b41b2db209327387f59afa1c40532773)
2022-01-26 14:20:13 +01:00
jackpoz 7ea19b675f Core/Metric: Require WITH_DETAILED_METRICS CMake flag for MMaps metric
(cherry picked from commit 8ad6bd8a9ba45ef22ed0275fd402da17666d8522)
2022-01-26 14:07:00 +01:00
Carbenium 8809d54ca2 Core/Common: Merge TimeTrackerSmall with TimeTracker
(cherry picked from commit 228696bf80bcd55d35445cd24ae119020c310f88)
2022-01-24 21:34:36 +01:00