Commit Graph

82 Commits

Author SHA1 Message Date
Naios
da3c03a48b Core/Define: Remove the conditional macro for constexpr.
* Not needed anymore since the requirements were raised to MSVC 2015.
2016-08-29 22:03:48 +02:00
Naios
13e5817417 Core/Common: Correct the linking of localeNames 2016-08-29 22:03:48 +02:00
jackpoz
2585c62e6f Tools/MMapGenerator: Avoid saving uninitialized padding bytes to disk
Initialize padding bytes in MmapTileHeader struct to avoid saving uninitialized data to disk, causing issues when binary-comparing *.mmtile files.
2016-08-17 15:07:02 +02:00
jackpoz
5588881be2 Common/Common: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-08 18:07:19 +02:00
Naios
68015599dc Core/Common: Converted the common library to a shared library.
* There is still the possibility to static link against common.

(cherry picked from commit 501fd9b502)

# Conflicts:
#	src/common/Collision/Management/MMapManager.h
#	src/common/Collision/VMapTools.h
#	src/common/Common.cpp
#	src/common/Common.h
#	src/common/Cryptography/Authentication/PacketCrypt.h
#	src/common/Cryptography/Authentication/WorldPacketCrypt.h
#	src/common/Cryptography/HmacHash.cpp
#	src/common/Cryptography/HmacHash.h
#	src/common/Cryptography/SHA256.h
#	src/common/GitRevision.h
#	src/common/Utilities/Random.h
#	src/common/Utilities/Util.h
2016-08-08 18:00:32 +02:00
jackpoz
4170a9357c Common/Utilities: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-06 16:28:46 +02:00
Shauren
caee7dcad5 Core/Utils: Added additional argument to Tokenizer class to make it behave like strtok - not returning empty tokens in case of multiple consecutive separators in input string
(cherry picked from commit dd1533b315)
2016-08-06 14:29:11 +02:00
jackpoz
206f08adbb Common/Threading: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-04 23:44:55 +02:00
jackpoz
bcd5380e78 Common/Logging: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-04 21:53:43 +02:00
jackpoz
8538151ea6 Common/Debugging: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-04 17:04:31 +02:00
jackpoz
e4b2e0450f Common/Crypto: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-03 23:33:36 +02:00
jackpoz
25dc3dd7a2 Common/Maps: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-03 22:35:44 +02:00
jackpoz
6ce252f80a Common/Maps: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-03 18:29:57 +02:00
jackpoz
d77e76c584 Common/MMaps: Reduce differences between 3.3.5 and 6.x branches
Code functionality shouldn't have been modified.
2016-08-03 15:45:44 +02:00
ariel-
2efd40b804 Core/Misc: remove unused function prototype 2016-07-16 20:38:34 -03:00
Naios
d9755c637c Core/EventProcessor: Check whether an event was aborted before aborting it.
* Fixes an assertion introduced in commit 1ad73212dc.
* Use itr = std::unordered_map<...>::erase for updating the iterator.
2016-07-03 20:52:50 +02:00
jackpoz
284dd6b80d Core/Crash reporting: Better handle max nesting level setting
Fix wheaty exception report counting reference symbols as 2 nesting levels, not logging child objects in some cases, i.e. spell id in SpellEvent crash.
2016-07-03 13:16:06 +02:00
Naios
1ad73212dc Core/EventProcessor: Wait for non deletable events to get deletable.
* Immediate deletion caused issues with the SpellEvent,
  so we delete it at one of the next update ticks now.
* Only affects the unforced cancellation of events.
* Ref #16675
2016-07-03 00:22:23 +02:00
Naios
185921dc2b Core/Common: Add the linkage type to the version string
* Add platform strings for intel and apple
* Remove usage of underscore uppercase identifiers because
  those are reserved for the compiler.
* Requested by Aokromes

(cherry picked from commit afa0bac669)
2016-06-23 22:24:52 +02:00
jackpoz
1347d7cf7a Core/VMaps: Fix some vmap height edge cases
Fix Map::GetWaterOrGroundLevel() checking dynamic object only in phase 1 instead of current Unit phase.
Improve DynamicMapTree::getHeight() dynamic object check by casting the ray at +0.5f from the passed Z coordinate, this value will be tuned to improve even more the results.
2016-06-04 15:01:39 +02: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
Shauren
0fbfa8ead0 Core/Containers: Warning fixes and RandomResizeList with predicate optimization 2016-05-24 18:51:31 +02:00
Naios
f50c4b71a1 Core/Game: Remove some unnecessary export macros 2016-05-10 19:22:22 +02:00
Naios
d4d199d765 Core/Common: Move the query callback header to the database project
* Also renames the header to it's correct name QueryCallback
2016-05-10 18:16:13 +02:00
Naios
5b15b714ab Core/Utilities: Inherit env vars when starting external processes 2016-04-30 01:06:00 +02:00
Shauren
5bbc58f32d Core/Misc: Use steady_clock instead of system_clock for calculating ms timers. This makes update diffs immune to systemwide time changes
(cherry picked from commit 406ac4f4b4)
2016-04-26 18:15:10 +02:00
joschiwald
9e371b766c Core/Utils: replaced std::random_shuffle with our own implementation using SFMT random generator 2016-04-24 01:15:56 +02:00
Naios
2698d1ff48 Core/Common: Fix a std::string -> char* -> std::string conversion
* Thanks jackpoz for noticing
2016-04-23 18:13:42 +02: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
3271f328de Core/Cryptography: Move the SHA1 calculate helper to the SHA1 header 2016-04-17 19:30:13 +02:00
Naios
f93617c3c9 Core/Common: Capsule boost process into helper functions
* For easier usage, the processes output it routed
  correctly to the TC logger line by line now.
* Add support for asynchronous process execution
  and process termination.

(cherry picked from commit 3497b4960b)
2016-04-11 21:40:59 +02:00
Naios
fc106eba51 Core/Misc: Replace tc's optional with boost::optional. (very partial cherry-pick)
* benefits from empty optimization (objects are only constructed if needed).
* supports r-value references (move semantics) (boost >= 1.56.0).
* preparation for c++14/17's std::optional and std::none_t.
* add move constructor to CompactArray.

(cherry picked from commit 800d5d8939)
2016-04-11 21:00:26 +02:00
Shauren
836788ed3c Core/Misc: MSVC /W4 warning fixes
(cherry picked from commit 08c27d3205)
2016-04-09 18:25:53 +02:00
Shauren
39abb8acb3 Core/Misc: MSVC warning fixes
(cherry picked from commit 70412e7e25)
2016-04-09 18:13:30 +02:00
Shauren
702cfefddb Buildsystem: Initial changes to support building with vs clang toolset
(cherry picked from commit 4a3a178d7f)
2016-04-09 12:38:20 +02:00
Shauren
b841546574 Core/Common: Moved MessageBuffer to common
(cherry picked from commit a81a204678)
2016-04-09 12:31:04 +02:00
DDuarte
c9e3f2aa9a Core/Config: Fix 3 more missing config warnings
Closes #16861

Thanks tkrokli

(cherry picked from commit 0afcefea27)
2016-03-31 03:31:51 +01: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
6487e2f2d6 Core/Startup: Warn when a config key isn't found in the config files
Example: "Missing name Guild.SaveInterval in config file worldserver.conf, add "Guild.SaveInterval = 15" to this file"
(cherry picked from commit 06b3bca0d2)

# Conflicts:
#	src/common/Configuration/Config.cpp
2016-03-27 23:49:08 +01:00
Naios
1a1c0d1dc4 Core/Common: Converted the common library to a shared library.
* There is still the possibility to static link against common.

(cherry picked from commit 501fd9b502)
2016-03-24 02:45:44 +01:00
Naios
2613413608 Core/Build: Add the possibility to link libraries dynamically.
* makes it possible to access exported singletons from other shared lib's.
* reduces binary size

(cherry picked from commit f4e0945b13)
2016-03-24 02:38:54 +01:00
Shauren
9295d9fa09 Core/Util: Extracted GetPID to separate function
(cherry picked from commit e3af42e05c)
2016-03-21 17:26:48 +01:00
Naios
abda7a910a CMake: Use inherited dependencies in common and tools 2016-03-18 02:52:57 +01:00
Naios
f52495c66b Dep/CppFormat: Update cppformat to cppformat/cppformat@5174b8c 2016-03-16 15:36:32 +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
Shauren
9fc5c4bc41 Core/PacketIO: Requeue packets handled with STATUS_LOGGEDIN received before player is fully loaded in one step after packet processing loop - reduces used locks from 3 per packet to 1 per packet
(cherry picked from commit 8086a39210)
2016-03-12 23:49:39 +01:00
Vincent-Michael
f81488b90e Core: Revert fail
(cherry picked from commit b5329d8a03)
2016-03-12 21:46:56 +01:00
Vincent-Michael
d6f093681e Core: Added missing overrides
(cherry picked from commit 5d584116fe)
2016-03-12 21:46:37 +01:00