Commit Graph

133 Commits

Author SHA1 Message Date
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
Shauren
803c5fcc88 Core/Misc: Fixed sending "X" to parent terminal when shutting down with ctrl+c on windows
* Also fixed usage of FormatMessage - its number of characters written, not error code
2017-08-25 23:51:46 +02:00
Shauren
7e39fb3a80 Build fix 2017-05-22 00:02:06 +02:00
Shauren
3d7c2ef88f Core/Game: Include cleanup, part 4 - packets and largest headers (after preprocessing, except player/objectmgr) 2017-05-21 23:18:43 +02:00
Shauren
9299e9bde0 Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50 2017-05-13 19:37:33 +02:00
joschiwald
229c78b5a3 Core/Packets: Implemented CMSG_QUERY_REALM_NAME and SMSG_REALM_QUERY_RESPONSE 2017-05-13 17:25:21 +02:00
Shauren
beb3316089 Core/Shared: Include cleanup 2017-05-13 11:49:09 +02:00
Shauren
7e538980a2 Core/Database: Include cleanup 2017-05-12 18:50:27 +02:00
Shauren
3a418a0bbc Core/Common: Include cleanup 2017-05-11 22:29:51 +02:00
Shauren
6c92a481a3 Core/Misc: Cleanup worldserver/bnetserver main() functions to run destructors in predictable order
* world/bnet servers will now fail to startup if listen ports are in use
* Restored "Network.OutUBuff" config option lost during boost transition
2017-05-04 20:41:22 +02:00
Shauren
b8db320bf1 Core/Misc: Prefix all preprocessor defines from CompilerDefs with TRINITY_ to avoid conflicts (PLATFORM_WINDOWS is used/defined by CascLib) 2017-03-04 18:46:18 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren
9633c8c2b7 Core/Debugging: Partially revert e0fb4445cd, the cmake hack to build wheaty directly into executable is still needed as it is impossible to have it initialize before every other static variable when it resides in dll (dynamic linking only) 2016-11-28 20:21:21 +01:00
Shauren
e0fb4445cd Core/Debugging: Added wheaty everywhere and modified it to always reliably report issues during static initialization 2016-11-28 18:37:51 +01:00
Shauren
a8c412a063 Tools: Added universal TrinityCore banner with git version info to all tools 2016-07-17 17:24:53 +02:00
DDuarte
8b26aea95a Implement real time statistic visualization (#16956)
Docs at https://trinitycore.atlassian.net/wiki/display/tc/Monitoring+a+TrinityCore+server

* Common/Graphs: Initial proof of concept

* Move influx db code to its own class

* Reuse the same socket

* Allow to log values of different categories

* Allow to log events

* Pass the timestamp to influxdb

* Send events in batches

* Send data async

* Log server shutdown.
Fix memory leak.

* Allow to enable/disable Stats in the settings and at runtime

* Read interval between each batch send from config

* Add InfluxDB connection info to configs

* Move each event category to its own table

* Log pathfinding queries

* Move categories table initialization to constructor using enum as key to avoid assigning the table name to the wrong enum value

* Log player login/logout events.
Pass the hostname correctly in the HTTP request.

* Fix linux build

* Handle "Connection: close" HTTP header, reconnecting on next scheduled send.
Disable StatsLogger if connection fails, logging the error.

* Add an enum for categories of logged values, it's still possible to pass a string instead of the enum.

* Don't log the whole batchedData when InfluxDB returns an error, it's too long and unreadable on console.

* Allow to call a function at a specified interval in thread-safe World::Update() context to log data like player count.

* Log map tile load/unload

* Core/StatsLogger: Allow logging more value types other than ints

https://docs.influxdata.com/influxdb/v0.10/write_protocols/write_syntax/

* Fix a typo in string escape of StatsLogger

* Yet more fixes to the escaping in FormatInfluxDBValue

* DB/Gameobject: Fix respawn time of few Quest GameObjects

By Tauriella, closes #16701

* DB/Misc: Fix some engrish

By tkrokli closes #16648

* Tools/MMaps: Add format library linking to mmaps_generator

(Very) partial cherry pick of ed75b0649a

* Core/StatsLogger: Simplify code

Convert values and categories arrays to maps initialized in-place
Remove constructor and destructor

* Core/StatsLogger: Add realm name to the event and value tags

* Log amount of processed packet of each session

* Apply recent singleton changes to sStatsLogger too

* Fix influxdb data format if no realm name is present

* Remove unneeded newlines from request body, fixes response 400 from InfluxDB 0.10

* Rename Reporting folder to Metric

* Rename StatsLogger to Metric

* Rename InfluxDB configs to Metric

* Add Grafana dashboards

* Add a random annoying macro

* Move string formatting to Metric::SendBatch(), reducing performance footprint of Metric::LogEvent() and Metric::LogValue()

* Update grafana graphs refresing tags on load and showing now-15m data, refreshing every minute. These settings can be modified in grafana.

* Rename MetricData fields

* Contrib/Grafana: Rename dashboard files

* Contrib/Grafana: Replace hardcoded Windows/Ubuntu realm names by the default, Trinity

* Config/Worldserver: Add missing section to the index

* Contrib/Grafana: Add singlestat panels with current online players, update diff averages (1 min, 5 mins and 15 mins)

http://i.imgur.com/Zi8lfvS.png

* Core/Metric: Replace the enums MetricEventCategory and MetricValueCategory by strings

For the sake of simplicity and less recompile time when adding new metrics, similar to how TC_LOG_* works

* Contrib/Grafana: Display the current number of online players and not its average

Closes #15075
(cherry picked from commit 3ae1016082)

# Conflicts:
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/World/World.cpp
#	src/server/worldserver/Main.cpp
2016-06-04 11:26:57 +01:00
Naios
51ec8d3b8c Core/Scripting: Use the path of the worldserver executable to search for the scripts dir
* Fixes issues when starting the worldserver not in the bin directory
  or the CMAKE_INSTALL_PREFIX directory using the -c option.

(cherry picked from commit 86b0fcf67a)
2016-04-18 23:03:24 +02:00
Naios
bc0f2b6e5a Core/Game: Add a dynamic script reloader which reloads scripts modules on changes.
* is responsible for registering plain modules.
* requires compilation with the `WITH_DYNAMIC_LINKING` flag.
* requires further support of the ScriptMgr.
2016-04-11 21:13:59 +02:00
DDuarte
9431b94bff Core/Config: Error logging for ptree_bad_data
Ref 6487e2f2d6 (commitcomment-16888976)
2016-03-31 03:19:27 +01:00
Shauren
dde620c402 Core: Updated to 6.2.4
* Rewrite bnetserver for new authentication protocol
2016-03-28 17:12:57 +02:00
DDuarte
423bded9a6 Core/Network: Change SocketMgr.StartNetwork to take the thread count by arg instead of config
AuthSocketMgr doesn't need "Network.Threads" config

Fixes "Missing name Network.Threads in config file authserver.conf"

Ref #16859

(cherry picked from commit 980f28d2ce)

# Conflicts:
#	src/server/authserver/Server/AuthSocketMgr.h
#	src/server/game/Server/WorldSocketMgr.cpp
2016-03-28 02:36:58 +01:00
Shauren
92e247b226 Core/Dep: Removed ZMQ dependency in preparation for future changes 2016-03-20 18:50:25 +01:00
Naios
28d8f7f70d CMake: Use inherited dependencies in scripts
* Removes the circular dependency between game <-> scripts

(cherry picked from commit 96bc31924a)
2016-03-19 23:19:54 +01:00
Naios
7c257aab5e Core/Worldserver: Move the Realm instance into the game library 2016-03-11 18:35:50 +01:00
Naios
a8fe7f6eb7 Core/Database: Move singleton instances into compilation units
* Fixes issues when building shared libraries
  (prevents gcc and clang from providing several instance)
* Also instantiate the database worker pools in DatabaseEnv.cpp now.
2016-03-11 18:25:55 +01:00
MitchesD
ce5def332f Core/Misc: fix build 2016-03-03 19:58:28 +01:00
Shauren
dea7d429ab Core/Debugging: Make abort() less bad on windows by forcing crash log generation 2016-03-03 17:29:48 +01:00