Commit Graph

255 Commits

Author SHA1 Message Date
Giacomo Pozzoni
5eb742ee6a Core/Metric: Log Map::Update() times (#25067)
* Core/Metric: Log Map::Update() times

* Add more performant version to reduce allocations when metrics are disabled

* Linux build fix

* Add metric stopwatch version that doesnt let users forget to _END it

* Fix linux build

* Code cleanup

* Add Map updates panel to General dashboard

* Add "Recent events" panel to General dashboard

* Apply latest codestyle changes

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2020-07-18 00:52:01 +02:00
Treeston
896b68d5c2 Core/Time: Rename GetGameTime{System, Steady}Point methods
The names are a bit unhandy. Rename them (shorter but still meaningful).

GetGameTimeSystemPoint() -> GetSystemTime()
GetGameTimeSteadyPoint() -> Now()

Also add 2 new typedefs:

typedef std::chrono::steady_clock::time_point TimePoint;
typedef std::chrono::system_clock::time_point SystemTimePoint;

Closes #25042
2020-07-17 17:05:55 +02:00
Shauren
c0ade2e98f Nopch fix 2020-07-15 19:55:04 +02:00
Shauren
524d167398 Dep: Switch to boost process instead of old standalone version 2020-07-15 19:33:12 +02:00
Peter Keresztes Schmidt
202fd41389 Core/Misc: Replace boost::optional with std::optional (#25047)
C++17 is already mandatory, so it's a safe thing to do
2020-07-15 10:22:29 +02:00
Peter Keresztes Schmidt
ce1e2c0f9b Core/Util: Remove EventMap's non-std::chrono::duration based interface (#25049)
Closes #25012
2020-07-15 10:05:11 +02:00
Shauren
b304f4ad8d Nopch fix 2020-06-27 20:34:19 +02:00
Shauren
0468c70dfe Core/Maps: Implemented getting area id from gameobject spawns
Yes, you can now spawn LK platform anywhere and it will treat you as inside Icecrown Citadel

(cherry picked from commit 42f9deb21e)
2020-06-27 20:23:30 +02:00
jackpoz
54c701cf0d Core/Common: Replace ASSERT(false, "...") with ABORT_MSG("...") 2020-06-26 23:37:52 +02:00
jackpoz
49da3533cd Core/Common: Add macro ASSERT_WITH_SIDE_EFFECTS to be used when asserting conditions that have side effects 2020-06-26 23:21:49 +02:00
jackpoz
3ac1992afb Core/MMAPs: Fix small steps being considered as NAV_AREA_GROUND_STEEP 2020-06-24 22:53:41 +02:00
ipriver
a46d047f94 fixed indentation for cmake files 2020-06-24 14:42:02 +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
Giacomo Pozzoni
4e1dbd1cf8 Log number of Creatures and GameObject per map (#24809)
* Shared/Metric: Allow to specify tags in metrics

* Core/Metric: Log number of Creatures and GameObject per map

* Apply feedback

* Codestyle changes

* Codestyle changes

* Remove whitespace

* Update Grafana dashboards to v7.0.3

* Fix missing filter on realm

* Include Creatures and Gameobjects in Maps dashboard

* Show instances with a different color
2020-06-20 00:04:01 +02:00
Giacomo Pozzoni
995a443da2 Handle different slopes in mmaps (#24765)
* Tools/MMAPs: Remove input argument --maxAngle

Remove input argument --maxAngle . This should be just hardcoded in MapBuilder::GetMapSpecificConfig() so all settings are easily found in the same place instead of being spread around.

* Tools/MMAPs: Add new area type NAV_AREA_GROUND_STEEP

Add new area type NAV_AREA_GROUND_STEEP for ground with slope in the range (55, 70] .
NAV_AREA_GROUND is used for ground with range [0, 55] .
NAV_AREA_GROUND_STEEP takes priority over NAV_AREA_GROUND.

* Tools/MMAPs: Fix NAV_GROUND_STEEP flag not being saved in the mmtile

* Core/PathFinding: Implement NAV_GROUND_STEEP flag

Implement NAV_GROUND_STEEP flag, used only by Creatures that are in combat or evading.

* Distinguish between RC_WALKABLE_AREA and NAV_AREA_GROUND.

* Allow mobs in combat to walk on steeps up to 80°

* Allow mobs in combat to walk on steeps up to 85°.
Disable rcFilterLedgeSpans() filter as it removed long steep spans.

* Increase cost of steep spans to try making creatures walk around obstacles instead of walking on them

* Revert last commit
2020-06-17 22:20:26 +02:00
Giacomo Pozzoni
8c09b6e58b Cherry-pick some cmake commits (#24720)
* Build system: Support  new in cmake 3.17 Ninja Multi-Config generator

(cherry picked from commit 369b618d4f)

* Build system: Fixed PCH with MSVC & Ninja generator

(cherry picked from commit d669f46b6d)

* Core: Fix clang 10 warnings

(cherry picked from commit 7272508cb4)

# Conflicts:
#	src/common/Utilities/Util.h
#	src/server/bnetserver/REST/LoginRESTService.cpp
#	src/server/game/Entities/Object/Position.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Guilds/GuildFinderMgr.h
#	src/server/game/Movement/Spline/MoveSplineFlag.h
#	src/server/shared/Dynamic/LinkedList.h

* Build system: Set -Wno-deprecated-copy only for clang 10

(cherry picked from commit 7fdeb259ba)

* Core/Misc: GCC build and warning fixes

(cherry picked from commit 4d69cc1c56)

# Conflicts:
#	src/common/Utilities/Util.cpp
#	src/server/database/Database/MySQLConnection.cpp
#	src/server/game/Battlefield/Zones/BattlefieldTB.cpp
#	src/server/game/DataStores/M2Stores.cpp
#	src/server/game/DungeonFinding/LFGMgr.cpp
#	src/server/game/DungeonFinding/LFGPlayerData.cpp
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Item/Item.cpp
#	src/server/game/Entities/Object/Updates/UpdateFields.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/RestMgr.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Server/Packets/GuildPackets.h
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/Auras/SpellAuras.cpp
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/SpellInfo.cpp
#	src/server/game/Spells/SpellMgr.cpp
#	src/server/scripts/Argus/AntorusTheBurningThrone/boss_garothi_worldbreaker.cpp
#	src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp
#	src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
#	src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
#	src/server/scripts/Northrend/zone_sholazar_basin.cpp
#	src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
#	src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp
#	src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
#	src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/shattered_halls.cpp
#	src/tools/vmap4_extractor/gameobject_extract.cpp
#	src/tools/vmap4_extractor/model.cpp
#	src/tools/vmap4_extractor/vec3d.h

* Build system: Print found git version when warning about it being too old

(cherry picked from commit 1ae72db201)

* Build system: Removed hard requirement on BOOST_ROOT being set as environment variable, it can now be also passed as command line argument to cmake and fix compile warning with boost 1.73

(cherry picked from commit 161944b764)

# Conflicts:
#	dep/boost/CMakeLists.txt

* Remove some code that was already removed from 335 and then cherry-picked into master

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2020-05-31 14:17:26 +02:00
Giacomo Pozzoni
141ada19b0 Cherry pick some db commits (#24713)
* Core/DBLayer: Implement async transaction completion callbacks

(cherry picked from commit 0f0ca3a919)

# Conflicts:
#	src/server/bnetserver/REST/LoginRESTService.cpp
#	src/server/bnetserver/Server/Session.cpp
#	src/server/bnetserver/Server/Session.h
#	src/server/database/Database/Transaction.cpp
#	src/server/game/Handlers/CharacterHandler.cpp
#	src/server/game/Handlers/SpellHandler.cpp
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/Server/WorldSocket.cpp
#	src/server/game/Server/WorldSocket.h

* Core/Misc: Fixed char enum packet sometimes not showing newly created character when client latency is too low

(cherry picked from commit fc9d2e728e)

# Conflicts:
#	src/server/game/Handlers/CharacterHandler.cpp

* Fix no-pch build

* Core/Player: Wait for correct transaction on character creation

(cherry picked from commit 01c68b2aa2)

# Conflicts:
#	src/server/game/Entities/Player/Player.cpp

* Fix warning

* Remove unused login transaction

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2020-05-30 17:43:54 +02:00
Shauren
f0060496f9 Core/Networking: Switch to intrusive variant of MPSC queue to halve the number of memory allocations for packet sending (#24659) 2020-05-29 18:17:24 +02:00
Giacomo Pozzoni
c0b75bf40d Core/MMAPs: Adjust walkable climb and fix a lot of mmap raycast issues (#24539)
* Core/MMAPs: Adjust walkable climb

Adjust walkable climb as recast using walkableClimb also to find the poly from a position, giving priority to polys that are below the position but closer than walkableClimb.

* Temporarily disable static collision (the whole check should be removed)

* Core/Spells: removed deprecated mmap path check for TARGET_DEST_CASTER_FRONT_LEAP

* Core/Objects: allow flying units to use the helper as well (flying units casting radius based spells)

* Code refactor

* Handle raycasts that end in a point with no height in the mmap mesh as PATHFIND_NOPATH

* Walk back a bit from raycast hitpoints as sometime the 2D result point is outside of the polygons due to floating point errors.

* Remove whitespace

* Revert 4a197ba22a as a raycast point path should have the Z retrieved with getPolyHeight(). Raycast will only return a 2-point path with Start and Hitpoint/End

* Cleanup PathGenerator raycast case

* Fix PathGenerator raycast broken if start and end are on same poly.
Fix PathGenerator raycast broken if no wall is hit.
Remove unused case of using raycast with an existing previous path (can be added back properly if needed).
Remove forcing poly length to 2 when we actually have already the right number.

* Use closestPointOnPolyBoundary on the second try of finding a point on poly for raycast.
Note that in this case the mesh height is not used which might cause issues. The poly boundary height will be used instead.

* Handle cases where getPolyHeight() fails because the point is on polygon border (and caused by floating point imprecision)

* Add far from poly flags

* Set PATHFIND_INCOMPLETE in raycast case if startFarFromPoly or endFarFromPoly

* Fix blink close to walls with no valid polygon behind the wall

* Require to re-extract mmaps

Co-authored-by: Ovah <dreadkiller@gmx.de>
2020-05-15 20:43:12 +02:00
Giacomo Pozzoni
90b00288c2 Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects (#24416)
* Core/SAI: Allow SMART_TARGET_ACTION_INVOKER to target GameObjects

* Include new Coalesce(..) template by @Shauren
2020-04-09 11:59:10 +02:00
jackpoz
caae3886d2 Core/Misc: Remove whitespace at the end of lines 2020-04-05 19:11:00 +02:00
Treeston
ca0c50bc45 Core/Misc: C++17 cleanups, commit 3, the header commit 2020-03-19 18:20:55 +01:00
Treeston
857f8d9231 Core/Misc: C++17 cleanups, commit 2, the advstd commit 2020-03-19 17:18:01 +01:00
Shauren
f2f47f774f Core/PacketIO: Add a validating string helper class for use in packet classes 2020-03-18 23:20:11 +01:00
jackpoz
0ddee8a4a0 Core/Common: Allow to show a message when aborting
Add a new ABORT_MSG macro that allows to show a formatted message before stopping the executable
2020-03-09 20:06:13 +01:00
daMaex
ce449f6b53 Core: build on aarch64 with gcc (#24216)
* build on aarch64 with gcc

* Core/aarch64: readability on preprocessor macro

* Core/aarch64: TC C++ codestyle adjustment
2020-03-01 20:16:57 +01:00
Ujp8LfXBJ6wCPR
fb75a958f0 Part1: Modernize codebase with Clang-Tidy range based loops (#24164) 2020-02-29 13:20:05 +01:00
ForesterDev
71a01c75ca Core/Server: improve timestamp format output for large time values (#24193) 2020-02-28 19:24:33 +01:00
daMaex
cbe765df7a Core: Build on ARM64 - Raspberry Pi (preferable 4) (#23885)
* build again on aarch64

* include mm_malloc header instead of defining self
2020-02-23 22:37:02 +01:00
ForesterDev
69231581e4 Core/Server: correct timestamp format for shutdown/restart notification broadcasts (#24181)
* Core/SmartScripts: implement SMART_ACTION_OVERRIDE_LIGHT and SMART_ACTION_OVERRIDE_WEATHER

* Core/Server: correct timestamp format for shutdown/restart notification broadcasts

* remove unexpected changes

* move enum from Common to Util

* Use enum class instead of enum

* Fix width for seconds 0 to 9
2020-02-22 21:31:37 +01:00
Ujp8LfXBJ6wCPR
b089ed3b75 Remove dependency on undefined behaviour (#24159)
See https://stackoverflow.com/a/4328396
Previous method works but is technically illegal.
2020-02-16 13:22:36 +01:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
Treeston
e457b77b4b Common/Encoding: fix Base32 alphabet (oops) 2019-12-17 15:59:14 +01:00
Shauren
73bc3d8ea4 Core/Random: Refactor random number generation to use std::uniform_*_distribution to restrict result range instead of doing that ourselves
* Seed SFMTRand with more values for its state
2019-11-09 15:09:22 +01:00
daMaex
4e0279b0e4 Dep/SFMT: updated to newest upstream version from https://github.com/MersenneTwister-Lab/SFMT
* only needed files added
* used CMake and SFMTRand from https://github.com/TrinityCore/TrinityCore/pull/23240 (Thank you Artox)
2019-11-09 15:09:22 +01:00
Treeston
3750c1cad9 I actually changed compilers in godbolt this time. This does it. Really. (31b5632 7378bcb 0a40252) 2019-08-12 14:37:01 +02:00
Treeston
0a40252c29 i am so done with compilers for today , WHY IS STD::SWAP NOT A CONSTEXPR ASDFOWQWDO (31b5632 7378bcb follow-up grml) 2019-08-12 14:33:04 +02:00
Treeston
7378bcb418 ugh. compilers. 31b5632 follow-up. 2019-08-12 14:25:28 +02:00
Treeston
31b5632c00 Common/Utilities: Explicit tail recursion to keep the compilers happy. 2019-08-12 14:19:22 +02:00
Treeston
0f7e070ed4 Common/Crypto: Make C++14 compilers happy. 2019-08-11 13:29:50 +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
Treeston
b2b9880377 Core/Common: fix a bug in BigNumber::AsByteArray that was causing incorrect output in 1/256 cases with explicit minSize (iff MSB zero) 2019-08-06 11:24:48 +02:00
Treeston
a4d5b24874 Common/Util: Sorry about that unexpected downtime at 3AM last night, everyone. (We call them happy little features.) 2019-08-05 11:23:57 +02:00
Treeston
a5e73e41c0 Core/Pooling: Quest pooling rewrite: (PR#23627)
- Split quest pooling from PoolMgr (into QuestPoolMgr)
- Proper saving/restoring on server restart
- No more hacking into sObjectMgr to insert/remove available quests
2019-08-04 12:22:57 +02:00
Treeston
309851ea24 Core/Misc: Rewrite some old name handling functions that use raw buffers to no longer be old name handling functions that use raw buffers. 2019-08-03 23:53:10 +02:00
Treeston
f1d9a36c5f Core/Misc: Remove Trinity::Containers::Size (duplicate of advstd::size) 2019-07-29 16:38:28 +02:00
Treeston
163f44c1b0 Core/AI: No longer do strange things when told to enter evade mode while there's no need to do so, typically by terrible legacy code. 2019-07-29 00:14:10 +02:00
Sebastien Levy
7e10438b27 Core/Misc: MSVC build error (#23637)
- fixed a constness error leveraged by msvc 16.2
2019-07-25 17:00:03 +02:00
Giacomo Pozzoni
aeddd417c4 Core/Misc: Handle timezones for hour-specific events specifieds in worldserver.conf (#23540)
* Core/Misc: Handle timezones for hour-specific events specifieds in worldserver.conf

* Handle Respawn.RestartQuietTime too

* Handle XP.Boost.Daymask too

* Core/Misc: Code cleanup

* Core/Misc: Code cleanup

* Update Util.cpp

* Update boosted_xp.cpp
2019-07-19 21:24:56 +02:00
Treeston
c0f8e8535a build fix after d1dc0e2 2019-07-19 20:37:22 +02:00