Commit Graph

113 Commits

Author SHA1 Message Date
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
Shauren
155e37831e Dep/Boost: Partial support for boost 1.74 - asio
Ref #25470
2020-09-27 20:20:59 +02:00
Shauren
b3db50a3b4 Core/Misc: Fix compile errors found with msvc /permissive- 2020-08-04 15:42:08 +02:00
Giacomo Pozzoni
deceb11b5f 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
2020-07-30 21:42:27 +02:00
Peter Keresztes Schmidt
b210bb3713 Core/Misc: Replace Trinity::make_unique with std (#24869)
(cherry picked from commit bab5fd87a3)
2020-06-23 18:03:16 +02:00
Shauren
a9f9f737b2 Core/Misc: Properly close database connections when using --update-databases-only arg 2020-06-22 09:53:10 +02:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
jackpoz
00703ee238 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 .
2019-10-26 19:49:41 +02:00
Treeston
4211645834 [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
2019-08-10 21:34:51 +02:00
Wyrserth
d8ce37e0c9 Core/Console: start CliRunnable thread after all log messages have been printed. (#23321) 2019-05-26 23:01:50 +02:00
Shauren
d56c671064 Core/Dep: Boost 1.70 compatibility
(cherry picked from commit bcda8dd742)
2019-04-14 01:04:02 +02:00
jackpoz
92bf5b1ba7 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)
2019-03-17 21:34:13 +01:00
jackpoz
d05ab073cb 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.
2019-01-18 22:57:23 +01:00
jackpoz
85e3169fbd 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
2019-01-18 17:58:24 +01:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
jackpoz
7b7dc1b508 Core/Misc: Fix FreezeDetector triggered on startup
Fix FreezeDetector triggering the assert on startup if scripts took more than a few seconds to initialize.
2018-05-12 13:59:34 +02:00
Shauren
b2b4f9d1e4 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

(cherry picked from commit dfd2660a85)
2018-01-06 12:30:28 +01:00
tkrokli
f6b6f57a6d Update copyright note for 2018
Best wishes for the new year.
2018-01-01 01:55:29 +01:00
jackpoz
45b2bcfaf2 Shared/Metric: Fix crash on shutdown
Fix crash on shutdown with metrics enabled but InfluxDB stopping before worldserver
2017-12-17 14:35:18 +01:00
ariel-
85a7d5ce9a Core: ported headers cleanup from master branch 2017-06-19 23:20:06 -03:00
Shauren
d6201e5dbb Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50
(cherry picked from commit 9299e9bde0)
2017-06-19 13:16:13 -03:00
Shauren
7874bee7bf Core/Misc: Cleanup worldserver/authserver main() functions to run destructors in predictable order
* world/auth servers will now fail to startup if listen ports are in use
* Restored "Network.OutUBuff" config option lost during boost transition

(cherry picked from commit 6c92a481a3)
2017-06-19 04:04:21 -03:00
Shauren
f59bac4d14 Build fix 2017-06-05 20:00:28 +02:00
ariel-
c3d0a3c1a8 Core/Misc: fix some clang 5 warnings 2017-05-27 17:23:05 -03:00
Shauren
9ec2a82cac Core/Misc: Prefix all preprocessor defines from CompilerDefs with TRINITY_ to avoid conflicts (PLATFORM_WINDOWS is used/defined by CascLib)
(cherry picked from commit b8db320bf1)
2017-05-23 18:46:44 +02:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00
xinef1
48f30911b9 Core/World: Simplified sleep calculation routine for world update thread (#18634) 2016-12-31 20:50:39 +01:00
Duarte Duarte
3ae1016082 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
2016-06-04 11:23:29 +01:00
Naios
86b0fcf67a 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.
2016-04-18 21:02:01 +02:00
Naios
3123c278b9 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.

(cherry picked from commit bc0f2b6e5a)
2016-04-11 21:42:16 +02:00
DDuarte
9aadd97fba Core/Config: Error logging for ptree_bad_data
Ref 6487e2f2d6 (commitcomment-16888976)

(cherry picked from commit 9431b94bff)
2016-03-31 03:31:46 +01:00
DDuarte
980f28d2ce 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
2016-03-28 02:02:29 +01:00
Naios
96bc31924a CMake: Use inherited dependencies in scripts
* Removes the circular dependency between game <-> scripts
2016-03-18 02:53:00 +01:00
MitchesD
caef32d375 Core/Misc: fix build
(cherry picked from commit ce5def332f)
2016-03-12 23:52:51 +01:00
Shauren
fd819b0919 Core/Debugging: Make abort() less bad on windows by forcing crash log generation
(cherry picked from commit dea7d429ab)

# Conflicts:
#	src/server/bnetserver/Main.cpp
2016-03-12 23:52:35 +01:00
Shauren
c71987b1a1 Core/Logging: Force synchronous logging after io_service shutdown - fixes logging on worldserver shutdown
(cherry picked from commit a0b2be6c1d)
2016-03-12 23:49:56 +01:00
Naios
cebe6122ad Core/Worldserver: Move the Realm instance into the game library
(cherry picked from commit 7c257aab5e)
2016-03-11 20:03:13 +01:00
Naios
3a4ec8bcbe 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.

(cherry picked from commit a8fe7f6eb7)
2016-03-11 19:51:07 +01:00
DDuarte
2ea31027e5 Core: Backport 6.x realm changes
Make acessible all the info about current realm (e.g name) anywhere, not only realm id
Reduce the number of differences between the two branches

Original changes by Shauren

Partial port of bacc90b6ba and 63def8aa32
2016-03-06 19:46:59 +00:00
Naios
7d3cffc297 Core/Database: Close the databases correctly when the DBUpdater fails
* Also fixes a memory leak spotted by Aokromes
2016-03-03 01:06:13 +01:00
Rushor
923a368ac7 Update copyright note for 2016 2016-01-01 12:02:33 +01:00
Shauren
402a3c45ff Core/Maps: Moved corpse management to map level
(cherry picked from commit cd27fd38b9)

# Conflicts:
#	src/server/database/Database/Implementation/CharacterDatabase.cpp
#	src/server/database/Database/Implementation/CharacterDatabase.h
#	src/server/game/Entities/Corpse/Corpse.cpp
#	src/server/game/Entities/Creature/GossipDef.cpp
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/Player.h
#	src/server/game/Globals/ObjectAccessor.cpp
#	src/server/game/Globals/ObjectAccessor.h
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Globals/ObjectMgr.h
#	src/server/game/Grids/ObjectGridLoader.cpp
#	src/server/game/Handlers/AuctionHouseHandler.cpp
#	src/server/game/Handlers/CharacterHandler.cpp
#	src/server/game/Handlers/ChatHandler.cpp
#	src/server/game/Handlers/QueryHandler.cpp
#	src/server/game/Maps/Map.cpp
#	src/server/game/Server/Packets/CharacterPackets.cpp
#	src/server/game/World/World.cpp
#	src/server/scripts/Commands/cs_reload.cpp
2015-09-29 18:45:01 +02:00
pete318
dcb7082277 Map local guids 6.x -> 3.3.35:
Implemented:
  ca83e14f8b
  ee1c1b97be
  18e4ab6911
  bf37446b3c
  cb854a2b7b

* This adds separate (per map) guid sequences depending on object type
* Ported map object container from cmangos/mangos-wotlk@a2d396e
* Added type container visitor for TypeUnorderedMapContainer
* Implemented helper function to erase unique pairs from multimap containers
* Moved object storage of all objects except players and transports to map level
* Added containers linking database spawn id with creature/gameobject in world
* Renamed DBTableGuid to spawnId
* Added a separate spawn id sequence generator for creatures and gameobjects - this will be used in db tables
* Moved building SMSG_UPDATE_OBJECT - updatefields changes broadcast to map update
* Added new function to return but not increment guid
* Adjusted .debug loadcells to show low guid in map before/after load
* Added debug messages for creature spawn/destroy, for map guid debugging
* Store all Gameobjects and Creatures added to OutdoorPvP, so the callback script can be removed when OutdoorPvP instance is destroyed.
2015-09-22 21:33:57 +02:00
StormBytePP
7b245a0b6b Core: Added ABORT() macro to prevent the usage of ASSERT(false) as a quick hack to crash the core misusing assert 2015-09-21 15:11:06 +02:00
StormBytePP
0cc3d883e1 Core/Build: Renamed Revision.h to GitRevision.h to avoid compile failure when old revision.h file is present 2015-08-16 23:08:01 +02:00
Shauren
222eaccc51 Build fix for WheatyExceptionReport, c++ exceptions must not be thrown in SEH handlers 2015-08-16 18:08:03 +02:00
StormBytePP
94f69fb1bc Core/Build: Removed obsolete SystemConfig.h and made genrev be part of shared library, which allows cache hits to happen more likely 2015-08-16 17:15:38 +02:00
Shauren
cdbd563157 Core/Logging: Refactored appender creation to allow using logging without mysql dependency in tools (future task)
Conflicts:
	src/server/bnetserver/Main.cpp
	src/server/worldserver/Main.cpp
2015-08-16 00:09:02 +01:00
DDuarte
be32beee57 Core/Executables: Add --version and -v to worldserver and authserver arguments
Closes #14993

(cherry picked from commit 0f082e8f92)

Conflicts:
	src/server/bnetserver/Main.cpp
2015-07-04 02:54:23 +01:00
Shauren
62a3edb84a Core/Misc: Warning fixes
(cherry picked from commit cc4d79495f)

Partial cherry-picked.

Signed-off-by: Naios <naios-dev@live.de>
2015-04-05 01:20:11 +02:00