Commit Graph

99 Commits

Author SHA1 Message Date
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
Naios
ba3f439bcb Core/Database: Close the databases correctly when the DBUpdater fails
* Also fixes a memory leak spotted by Aokromes

(cherry picked from commit 7d3cffc297)
2016-03-03 01:27:02 +01:00
Shauren
a0b2be6c1d Core/Logging: Force synchronous logging after io_service shutdown - fixes logging on worldserver shutdown 2016-02-23 23:41:18 +01:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Shauren
63def8aa32 Core/Battle.net:
* Changed packet structures to mirror client names
* Simplified ToString Building
* Removed deprecated structures

World: Cleaned up duplicate realm info 'realm' and 'realmHandle' variables (realmHandle was removed, that data is fully contained in realm)
2015-10-06 00:30:47 +02:00
Shauren
cd27fd38b9 Core/Maps: Moved corpse management to map level 2015-09-28 17:20:27 +02:00
StormBytePP
0bed9d56cb 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:17:05 +02:00
jackpoz
4617d65131 Merge pull request #15297 from StormBytePP/3.3.5_rename_Revision.h
Core/Build: Renamed Revision.h to GitRevision.h to avoid compile failure when old revision.h file is present
(cherry picked from commit 360cc93357)

Conflicts:
	src/server/authserver/Main.cpp
	src/server/database/Updater/DBUpdater.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/World/World.cpp
	src/server/shared/PrecompiledHeaders/sharedPCH.h
	src/server/worldserver/Main.cpp
2015-08-16 22:45:18 +01:00
StormBytePP
6a9fc63e41 Core/Build: Removed obsolete SystemConfig.h and made genrev be part of shared library, which allows cache hits to happen more likely
(cherry picked from commit 94f69fb1bc)
2015-08-16 17:50:40 +02:00
Shauren
d5cf594bfe Core/Logging: Refactored appender creation to allow using logging without mysql dependency in tools (future task) 2015-08-16 00:12:18 +02:00
DDuarte
0f082e8f92 Core/Executables: Add --version and -v to worldserver and bnetserver arguments
Closes #14993
2015-07-04 00:45:52 +01:00
Shauren
50848e4dac Core/Bnet: Fixed bnetserver not shutting down correctly when started as windows service 2015-06-10 00:21:55 +02:00
Shauren
ba6e5c5637 Core/Bnet: Implemented starting bnetserver as a windows service 2015-06-06 13:03:36 +02:00
Shauren
ca83e14f8b Core/Entities: Reworked guid scopes
* Added ObjectGuid traits to easily access whether guid type can be generated globally (ObjectMgr) or not
* This adds separate (per map) guid sequences depending on object type
* Ported map object container from cmangos/mangos-wotlk@a2d396eb0b
* 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
2015-04-28 21:19:46 +02:00
Shauren
cc4d79495f Core/Misc: Warning fixes 2015-03-22 13:47:55 +01:00
Naios
72bb8ffd96 Core/Worldserver: Set updates enabled default value to "none" -> disabled
* in addition to 1f7f9feafc
* if no config entry is presented this value is used
2015-03-21 21:06:03 +01:00
Naios
352012e531 Core/Updates: Add an automatic database update system. Automatically detects new and edited sql updates through file lists and hashing. Detects renames, deletes and is able to create and auto import full databases. * cleanups in main.cpp of world & bnetserver * refactoring in DatabaseWorkerPool.h & MySQLConnection.cpp
Make sure you re-run cmake, because boost::iostreams was added as dependency.
Maybe you need to install libboost-iostreams1.55-dev on unix as well.

Import every update manual until (included) those INSERT IGNORE updates for each database.

Thanks DDuarte and Shauren for your amazing ideas, help and advises.

In hope that nobody gets a "Your database structure is not up to date..." anymore ,-)

Signed-off-by: Naios <naios-dev@live.de>
Signed-off-by: Nayd <dnpd.dd@gmail.com>
2015-03-21 14:09:38 +00:00
jackpoz
b35578bac3 Revert "Core/Server: Catch exceptions in int main()"
This reverts commit e68ca82d4d.

Closes #14329
2015-03-11 21:07:08 +01:00
Duarte Duarte
e68ca82d4d Core/Server: Catch exceptions in int main()
The exceptions is rethrown on debug mode.

Ref Coverity CID 1010213, 1022574, 1227501, 1227502,
1227503, 1227504, 1227505, 1254536 and 1254612
2015-02-15 14:56:12 +00:00
Vincent-Michael
ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
Kinzcool
ac53077dff Conf: Changed hotfix database's name to actually match the initial name 2014-11-11 15:35:41 -05:00
devil1234
b978f0286c Core/Databases: Add hotfix database to world config and prepared statement for it.
Closes #13533
2014-11-11 13:14:36 +00:00
joschiwald
2fee7d195b Core/NetworkIO: updated SMSG_UPDATE_WORLD_STATE, added SMSG_PVP_SEASON and added packet class for SMSG_INIT_WORLD_STATES 2014-11-09 04:25:09 +01:00
Shauren
bacc90b6ba Core/NetworkIO: Added second connection to WorldSession, handle AuthContinuedSession and enabled ConnectTo and ResumeComms 2014-11-09 00:37:33 +01:00
Shauren
f773a9e053 Core: Implemented IPC (Inter-process communication) between worldserver and bnetserver using ZeroMQ library.
* Implemented ToonReady and ToonLoggedOut battle.net packets
2014-10-17 22:48:06 +02:00
jackpoz
b33695a2ef Core/Worldserver: Fix worldserver stuck on "Halting process" on shutdown
Partially revert 4fe45b8c63 to fix worldserver stuck on "Halting process" on shutdown.

Fixes #13201
2014-10-03 21:21:17 +02:00
jackpoz
02d497165a WorldServer/Misc: Log possible errors on shutdown
Log possible error on shutdown happening when trying to cancel any I/O sync operation in CliThread, refers to #13201
2014-09-28 13:49:44 +02:00
DDuarte
cefcde9ba9 Core/Misc: Multiple static analysis issues fixed (small optimizations and clear code) 2014-09-19 03:30:02 +01:00
Shauren
e0ce4528c5 Core/NetworkIO: Use reactor style sending on linux to reduce locking overhead 2014-09-09 19:19:25 +02:00
leak
1a27ce1267 Core/NetworkIO: Restore networking related scripting hooks
Closes #12607
2014-08-11 17:40:43 +02:00
leak
14cb6e4235 Resolve shutdown crash/leak if MySQL server is not running
Fixes #12734
2014-08-10 22:43:48 +02:00
Shauren
4fe45b8c63 Core/Worldserver: Replaced old hack sending key events to unblock console thread 2014-08-10 11:50:19 +02:00
DDuarte
0e52b111f3 Core/Config: User-friendlyfy configuration parsing errors
It will now print useful error messages that pinpoint the issue
with the config file (missing file, bad syntax, etc)

In memory of MitchesD that lost 18 hours finding a problem with
his config because of a duplicated line.
2014-07-29 01:47:00 +01:00
Shauren
86f3ee9949 Core/Instances: Explicitly unload InstanceSaveMgr before MapManager, fixes invalid memory access at shutdown
Closes #12635
2014-07-28 23:32:53 +02:00
Jared P. Jones
11ecd851a1 Core/Misc: Silenced 500 OS X Warnings and removed deprecated finite() method.
*Mac OS X fires off over 200 warnings related to gsoap about the deprecated register method. CMake has been patched to remove this warning.
*Updated all occurences of finite() to std::isfinite. The method finite() is not standardized by anyone aside from BSD. std::isfinite() however is standarized by C++
*Removed -ncurses and -pthread from OS X compilation. Now that we use Boost and C++11 there is no longer a need for pthread in OS X. All it does is throw a warning. However, ncurses isn't needed either as it's built into the OS X SDK and linked by default.

Note: There are only 5 remaining warnings left when compiling on OS X. I did not attempt to fix these as they were related to 3rd party libraries statically linked into the code. The 5 warnings left are all related to unused variables.
2014-07-23 17:30:45 -05:00