Commit Graph
167 Commits
Author SHA1 Message Date
Shauren 21ff7f2503 Core/Misc: Add missing includes 2025-11-15 11:42:30 +01:00
Shauren e8b2be3527 Core/Network: Socket refactors
* Devirtualize calls to Read and Update by marking concrete implementations as final
* Removed derived class template argument
* Specialize boost::asio::basic_stream_socket for boost::asio::io_context instead of type-erased any_io_executor
* Make socket initialization easier composable (before entering Read loop)
* Remove use of deprecated boost::asio::null_buffers and boost::beast::ssl_stream
2025-04-08 19:15:16 +02:00
Shauren 039acb20e4 Core/Network: Simplify worldserver port configuration: removed InstanceServerPort 2025-01-07 13:41:09 +01:00
Shauren c81183a660 Dep: Replace basic_deadline_timer with std::chrono based basic_waitable_timer 2024-12-09 21:13:18 +01:00
Shauren b13b5142f1 Core/Utilities: Extend make_unique_ptr_with_deleter functionality to allow it to create deleters with compile time constant functions (reduces its size to just sizeof(void*)) 2024-10-01 21:03:44 +02:00
Shauren 052f2d0a81 Core/Common: Compile ServiceWin32 as part of common project instead of directly adding its source files to both server executables 2024-09-15 12:40:54 +02:00
Shauren fd0a7ba871 Core/CrashHandler: Compile WheatyExceptionReport only once and moved its global variable initializer to all projects using it 2024-09-15 12:13:54 +02:00
Shauren c4b710446d Core/Realms: Realmlist refactors
* Removed global realm variable from World and use RealmList everywhere
* Match auth build key with client version
* Restored allowedSecurityLevel checks for realmlist packet building
* Restored updating population field, mysteriously removed 15 years ago in f20b25d1c9
2024-08-18 18:59:58 +02:00
Shauren fd4ffc81b2 Core/Misc: Fixed windows _UNICODE incompatibilities 2024-06-02 14:21:13 +02:00
Shauren 83f4763b25 Core/Misc: Minor change to make_unique_ptr_with_deleter to make it accept only pointers 2024-05-07 12:26:21 +02:00
Shauren 8e3024a96a Core/Misc: Refactor loading process to remove exit() calls that cause deadlocks because threads are terminated without proper cleanup 2024-04-30 00:20:38 +02:00
Shauren d079a7e267 Core/OutdoorPvP: Fixed shutdown crash 2024-04-04 21:31:41 +02:00
Shauren 7df138ba2b Core/Misc: Replace shared_ptr with unique_ptr with deleter for cleanups in main() functions 2024-04-04 21:31:22 +02:00
Shauren 644a479e28 Core/Database: Fixed HotfixDatabase not being closed on shutdown with --update-databases-only
Closes #29599
2024-01-23 00:23:59 +01:00
Shauren 78bcc3f52a Core/Misc: Minor code modernization - kill std::bind 2023-12-08 20:27:41 +01:00
Shauren 333630b7de Core/Misc: Added windows version checks during startup to avoid confusion about crashes when running on unsupported OS 2023-12-01 19:53:13 +01:00
Shauren b299902881 Core/Locales: Set active code page and locale used by c string functions to utf8
Closes #29455
2023-11-24 20:01:17 +01:00
Shauren cc6dba1376 Core/Realms: Minor refactor to realm address storage (remove LocalSubnetMask as it is now unused, db field kept for table structure compatibility with 3.3.5 branch) 2023-08-03 11:18:11 +02:00
Shauren 6be536a73b Core/Network: Refactor local/remote ip address selection code and allow using hostnames in LoginREST bnetserver config options 2023-07-15 00:45:16 +02:00
СмердокрылandShauren 74a4dc46b4 Core/Config: Implement reading config overrides from subdirectory (#29068)
Co-authored-by: Shauren <[email protected]>
2023-06-09 20:36:03 +02:00
Shauren d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
Shauren edc922d532 Core/Misc: Fixed worldserver shutdown with --update-databases-only 2022-10-13 12:53:54 +02:00
Shauren f59580dc6c Core/Threading: Create ThreadPool class
(cherry picked from commit d82b2b1a6712df685b989911e3e519809935de03)
2022-10-13 11:54:18 +02:00
Shauren 9b924522d0 Core/Instances: Delete InstanceSaveMgr and replace most of its uses with new InstanceLockMgr 2022-10-04 00:19:38 +02:00
Shauren 17665c929c Core/Instances: Instance lock rewrite (WIP) 2022-10-04 00:19:38 +02:00
Giacomo Pozzoni c80d7696c3 Core/World: Include more details about MaxCoreStuckTime asserts (#28188)
* Core/World: Include more details about MaxCoreStuckTime asserts

Include more details about MaxCoreStuckTime asserts that might help find why FreezeDetector gets triggered with idle MapThreads

* Codestyle fix

(cherry picked from commit de4920de81a495ed8d6b04cf68f3912c74921f48)
2022-09-29 22:00:08 +02:00
Shauren 3fa46c6dc1 Core/Crypto: Fixed loading legacy openssl provider for RC4 on windows 2022-09-05 18:48:43 +02:00
Shauren 20f38369f3 Core/PacketIO: Updated packet structures to 9.2.7 2022-07-31 21:39:48 +02:00
Shauren 16a06346ae Core/Maps: Move terrain data handling out of Map class
Partial port of cmangos/mangos-wotlk@ff5232c648
2022-07-23 19:13:33 +02:00
Shauren 833ddfad11 Core/World: Allow specifying minimum world updates diff in config
(cherry picked from commit 29a4153f0038526ee6df690ec3499d66630e5071)
2022-06-10 16:50:29 +02:00
Shauren aa6a0f2431 Core/Crypto: Fixed EVP_PKEY reference counting for copied objects
Closes #27943
2022-05-06 12:21:59 +02:00
Shauren bc87f7b337 Core/Crypto: Switch away from most deprecated openssl functions and removed upper version limit 2022-05-03 17:03:57 +02:00
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
jackpoz aaa7596e01 Core/Misc: Fix build on systems where size_t is not defined as uintXX_t, i.e. Mac
(cherry picked from commit 8fcf59f9db929e94b1a6d2c75c1905f0a51dcddd)
2022-03-12 00:25:49 +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
Shauren ad4f4bfab7 Core/Misc: Minor game include cleanup 2022-02-13 00:49:10 +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
Giacomo Pozzoni 736b9ac112 Log sync db queries in World::Update() loop (#25174)
* Core/Misc: Log sync queries on critical path

* Fix build

* Rename

* Fix warning

* Fix no-pch

* Change WarnAboutSyncQueries() to be header-only

(cherry picked from commit deceb11b5fc52c8036f249d628ccc69ca5d022b3)
2022-01-24 14:58:08 +01:00
Shauren c776218cb5 Core/Misc: Properly close database connections when using --update-databases-only arg
(cherry picked from commit a9f9f737b2c93d8f9fcb435f7a2b164a84cbc684)
2022-01-06 23:35:09 +01:00
Shauren 3a67e37681 Core/Time: Remove artificially high minimal update intervals 2022-01-03 11:26:23 +01:00
jackpoz 0fb1bf8439 Core/Misc: Enable MaxCoreStuckTime setting by default
Enable MaxCoreStuckTime setting by default to force worldserver to exit in case of infinite loops.
Note that this will not affect existing setups with the setting MaxCoreStuckTime set to 0 in the local worldserver.conf .

(cherry picked from commit 00703ee238729a8d5b3d17edf8dc16d6c6c6b601)
2021-12-18 23:24:24 +01:00
Treeston 0b61c3b7b1 [3.3.5] Core/Authserver: TOTP rewrite: (PR #23633)
- Proper management commands (.account 2fa)
- Secrets can now be encrypted (set TOTPTokenSecret in .conf)
- Secret now stored in binary
- Argon2 and AES primitives
- Base32/64 support

(cherry picked from commit 4211645834c467a03c60248e80818d3607be9ea7)
2021-12-18 20:24:50 +01:00
Wyrserth 2344671af5 Core/Console: start CliRunnable thread after all log messages have been printed. (#23321)
(cherry picked from commit d8ce37e0c90a3da2d42a09d33523e4403aab2723)
2021-12-08 21:55:04 +01:00
jackpoz d532420d79 Core/Misc: Update 85e3169fbd7b2da70e0f054399f4db64ded36325 about SOAP
Change again how SOAP is stopped if SOAP successfully binds but worldserver fails to bind its sockets.
A crash remains if SOAP fails to bind because it calls exit() and that triggers asserts everywhere.

(cherry picked from commit d05ab073cb102a4f868b0fda51ef4368350ded32)
2021-11-21 20:16:46 +01:00
jackpoz 05210c2a34 Core/Misc: Fix shutdown with SOAP enabled
Fix worldserver entering a loop when having SOAP enabled but failing to bind both SOAP and worldserver listened socket. SOAP thread would keep trying to bind the socket over and over checking World::IsStopped() condition that was never set to true

(cherry picked from commit 85e3169fbd7b2da70e0f054399f4db64ded36325)
2021-11-21 20:16:03 +01:00
jackpoz 289be4d97c Core/Misc: Fix FreezeDetector triggered on startup
Fix FreezeDetector triggering the assert on startup if scripts took more than a few seconds to initialize.

(cherry picked from commit 7b7dc1b50844027853023491c1f69dc40292eec3)
2021-09-26 20:51:09 +02:00
Shauren 3c08eb190f Core/Misc: Add another boost hack. Fixes bnetserver/worldserver -c command line parameter when path contains spaces 2021-05-24 00:08:03 +02:00
jackpoz 8313053a3b Shared/Metric: Fix crash on shutdown
Fix crash on shutdown with metrics enabled but InfluxDB stopping before worldserver

(cherry picked from commit 45b2bcfaf266cac74806ed71f32b8dc02cd2321e)
2021-03-15 20:17:31 +01:00
Shauren e3126ed8a6 Kill whitespace 2020-09-05 10:28:02 +02:00
Maks Szokalski 6812af37bb Core/Cosmetic: Execute OnStartup script hook before printing that startup is finished (#25401) 2020-09-05 10:25:09 +02:00