Commit Graph

159 Commits

Author SHA1 Message Date
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
Смердокрыл
74a4dc46b4 Core/Config: Implement reading config overrides from subdirectory (#29068)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
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 d82b2b1a67)
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 de4920de81)
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 29a4153f00)
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 <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>
(cherry picked from commit 1ddd9dc19c)
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 8fcf59f9db)
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 96dc110f4a)
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 b3db50a3b4)
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 deceb11b5f)
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 a9f9f737b2)
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 00703ee238)
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 4211645834)
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 d8ce37e0c9)
2021-12-08 21:55:04 +01:00
jackpoz
d532420d79 Core/Misc: Update 85e3169fbd 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 d05ab073cb)
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 85e3169fbd)
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 7b7dc1b508)
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 45b2bcfaf2)
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
Peter Keresztes Schmidt
bab5fd87a3 Core/Misc: Replace Trinity::make_unique with std (#24869) 2020-06-23 08:54:12 +02:00
jackpoz
d3782c2d09 Core/Misc: Add console option to update databases only
Add "--update-databases-only" console argument to stop worldserver execution after having updated all databases (if specified in config file)

(cherry picked from commit 92bf5b1ba7)
2020-05-13 21:06:33 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
bcda8dd742 Core/Dep: Boost 1.70 compatibility 2019-04-14 00:13:23 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
xinef1
608260b853 Core/World: Simplified sleep calculation routine for world update thread (#18634)
(cherry picked from commit 48f30911b9)
2018-03-18 00:19:48 +01:00
Shauren
dfd2660a85 Core/Misc: Added compatibility layer for boost 1.66 and future std:: networking stuff
* Based on work done by @dimiandre in PR #21173

Closes #21171
Closes #21173
2018-01-06 01:21:59 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00