Commit Graph

10197 Commits

Author SHA1 Message Date
Treeston
7f7fa8b23d Core/Authserver: Split SRP6 into its own file (PR #25131) 2020-07-29 00:07:41 +02:00
Ovah
210f552ac5 Core/World: added startup log outputs for query cache initialization for detailed information.
* the console will now throw a log when the feature is disabled
* additionally the console will now print how long it took to initialize
2020-07-28 21:52:03 +02:00
Shauren
3ad05386c8 Core/Networking: Fixed authserver socket read handlers being called on incorrect thread 2020-07-28 19:44:38 +02:00
jackpoz
5cd93df9ee Core/Metric: Add new metric in World::UpdateSessions()
Add new metric about how long adding sessions took
2020-07-28 17:49:51 +02:00
Carbenium
1245833cdd Core/CreatureAI: std::chrono-ify DoSummon* methods 2020-07-28 17:25:51 +02:00
Giacomo Pozzoni
8a2c79c850 Core/Metric: Log detailed metrics about each opcode handler (#25153)
* Core/Metric: Log detailed metrics about each opcode handler

* Add new panel to Performance profiling dashboard and use fill(0) instead of fill(none)

* Add new settings Metric.Threshold.* to be able to specify the minimum threshold for the specified metrics

* Update dashboard

* Change thresholds to be required to send the metrics. A TC_METRIC_DETAILED_TIMER metric with an expected threshold not configured will be ignored

* Use typedef Milliseconds

* Refresh realms on load
2020-07-28 14:27:54 +02:00
Carbenium
8642aaaf92 Core/WorldObject: Replace non-std::chrono SummonGameObject overloads
Also fix intended despawn time of GOs used by the "Engineering a Disaster" quest
2020-07-27 23:00:51 +02:00
Carbenium
3620b47c41 Core/WorldObject: Replace non-std::chrono SummonTrigger overloads 2020-07-27 14:58:18 +02:00
Carbenium
a41f599be7 Core/WorldObject: Remove non-std::chrono SummonCreature overload
Remove
TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0);
2020-07-27 14:53:25 +02:00
Giacomo Pozzoni
36ef487a90 Core/Metric: Add new cmake option WITH_DETAILED_METRICS to enable more metrics (#25136)
* Core/Metric: Add new cmake option WITH_DETAILED_METRICS to enable more metrics

Add more detailed metrics in World::UpdateSessions().

* Attempt using C++17 features

* Fix cmake typo

Co-authored-by: NoName <322016+Faq@users.noreply.github.com>

* Fix build with WITHOUT_METRICS

* Update Performance profiling dashboard with Update sessions panel

* Add panel to show sessions with update time above 100 ms

* Move legends on the right and add max update time diff in the legend of sessions

Co-authored-by: NoName <322016+Faq@users.noreply.github.com>
2020-07-27 14:00:28 +02:00
Carbenium
480dee3125 Core/Creature: Remove non-std::chrono overload of DespawnOrUnsummon 2020-07-27 13:37:18 +02:00
Carbenium
1d8782e356 Core/EventProcessor: std::chrono-ify the remaining public API 2020-07-27 13:36:25 +02:00
Carbenium
92a02a5c87 Core/EventProcessor: std::chrono-ify CalculateTime
uint64 CalculateTime(uint64 t_offset) has been replaced with Milliseconds CalculateTime(Milliseconds t_offset).
Also add the std::chrono-ified overload void AddEvent(BasicEvent*, Milliseconds, bool)
2020-07-27 13:36:25 +02:00
Carbenium
1131229ee9 Core/WorldObject: Partially std::chrono-ify SummonCreature overloads
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0);
to
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime = 0s);
2020-07-26 23:30:32 +02:00
Carbenium
c39eb9b504 Core/Misc: Use std::chrono overload of Creature::DespawnOrUnsummon 2020-07-26 22:17:36 +02:00
Treeston
4f570e5d08 Core/Authserver: Auth cleanup phase 1b, the "I didn't hit Stage All" commit. Sorry. (5e36bf7 follow-up) 2020-07-26 05:20:41 +02:00
Treeston
210176fd91 Core/Authserver: Authserver cleanup (PR#25093)
- Fix a handful of 1/256 bugs with most significant byte zero in BigNumber
- Get rid of (most of) the C-style arrays in authserver
- CryptoRandom as a unified source for cryptographic randomness
- Bring our other crypto APIs into 2020
- BigNumber usability improvements
- Authserver is now actually readable as a result of all of the above
2020-07-26 01:53:34 +02:00
Carbenium
cdaf890af4 Core/EscortAI: std::chrono-ify SetPauseTimer 2020-07-25 23:45:01 +02:00
Carbenium
4b9fdc5d3d Core/EscortAI: std::chrono-ify AddWaypoint 2020-07-25 23:45:01 +02:00
Carbenium
f5076112cb Core/ScriptedAI: std::chrono-ify DoSpawnCreature 2020-07-25 23:16:04 +02:00
Carbenium
27229c10cd Core/BossAI: Remove _DespawnAtEvade(uint32, Creature*) overload
Use _DespawnAtEvade(Seconds,  Creature*) instead
2020-07-25 23:11:10 +02:00
Carbenium
d7ff8c272a Core/InstanceScript: std::chrono-ify DoRespawnGameObject 2020-07-25 23:10:14 +02:00
jackpoz
6c4f71c84b Core/Misc: Code cleanup
Remove more unused code in UpdateTime class
2020-07-24 13:59:51 +02:00
Giacomo Pozzoni
3c0ac7302f Core/Metric: Add more metrics about World::Update() loop (#25098)
* Core/Metric: Add more metrics about World::Update() loop

* Add new Performance profiling grafana dashboard

* Add new cmake setting WITHOUT_METRICS that disables all metrics

As new metrics are added, someone might want to disable them if unused.

* Add more metrics about World::Update() loop

* Remove old performance profiling features

Remove "server set difftime" command, "-RecordUpdateTimeDiffInterval" and "MinRecordUpdateTimeDiff" worldserver config settings and their related code.
The whole UpdateTime class could be removed too.

* Update and rename 2020_07_99_99_world.sql to 2020_07_24_00_world.sql
2020-07-24 00:30:16 +02:00
Giacomo Pozzoni
6440c3bcac Core/Combat: Disable triggers entering combat (#25086)
* Core/Combat: Disable triggers entering combat

* Move check to database flags_extra flag in creature_template with value 0x00002000

* Fix Rotface puddle stalker too

* Rename 9999_99_99_99_world.sql to 2020_07_22_00_world.sql
2020-07-22 19:32:29 +02:00
Shauren
f50575ca77 Core/PlayerDump: Fixed overwriting cached character data on .pdump load when importing a character with duplicate name 2020-07-21 19:57:15 +02:00
Shauren
0b616e4865 Core/Players: Use original proc target to update weapon skills, fixes ranged weapon skill gains 2020-07-20 17:42:16 +02:00
Peter Keresztes Schmidt
e6e5775be8 Build: Enable -Wimplicit-fallthrough on clang (#25056)
* Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs

Related: #25006

* Misc: Add some missing breaks (no-ops) to satisfy clang

Related: #25006
Closes #25055

* Build: Enable -Wimplicit-fallthrough on clang

Closes #25006
2020-07-18 20:43:16 +02:00
Peter Keresztes Schmidt
85b5b842ca Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
2020-07-18 20:42:28 +02:00
Giacomo Pozzoni
7032ee0bdb Core/Misc: Replace boost::shared_mutex with std::shared_mutex (#24328)
* Core/Misc: Replace boost::shared_mutex with std::shared_mutex

* Remove std forward declarations
2020-07-18 18:34:45 +02:00
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
Shauren
83e0a1b944 Core/PacketIO: Fix broken CMSG_RESURRECT_RESPONSE structure after 9fe6756cf2 2020-07-17 21:06:45 +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
Peter Keresztes Schmidt
ddf16ae4d9 Misc: Remove some unneeded/duplicated includes (#25051) 2020-07-16 14:14:01 +02:00
Shauren
524d167398 Dep: Switch to boost process instead of old standalone version 2020-07-15 19:33:12 +02:00
Shauren
1405760f31 Core/Battlefield: Fixed startup crash when compiled without scripts 2020-07-15 15:55:31 +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
NoName
9fe6756cf2 Core/PacketIO: Updated corpse related packet structures (#24922)
# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Handlers/MiscHandler.cpp
#	src/server/game/Handlers/QueryHandler.cpp
#	src/server/game/Maps/MapManager.cpp
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Packets/QueryPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/Protocol/Opcodes.h
#	src/server/game/Server/WorldSession.h

* + For SMSG_DEATH_RELEASE_LOC
G3D::Vector3 -> TaggedPosition<Position::XYZ>
+ removed non 3.3.5 packets

Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>
Co-authored-by: Mogadischu <cgnad@live.de>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2020-07-14 23:15:33 +02:00
Peter Keresztes Schmidt
bd837d4c3d Core/CombatAI: Use std::chrono::duration overloads of EventMap (#25037)
Contributes to #25012
2020-07-14 20:46:18 +02:00
Peter Keresztes Schmidt
e372f9badb Core/Battlegrounds: Use std::chrono::duration overloads of EventMap (#25015)
Contributes to #25012
2020-07-14 18:11:07 +02:00
Shauren
8675fd756f Core/Misc: Fixed wrong db field accessors usage found with TRINITY_STRICT_DATABASE_TYPE_CHECKS
* Fixes loading group instance reset times
* Fixes loading battlefield templates
2020-07-14 12:46:57 +02:00
Gildor
5e1571062a Core/Spells: Check a few aura effects for determining if should be negative (#25004) 2020-07-14 09:43:41 +02:00
Giacomo Pozzoni
203573db83 Core/Spells: Implement SPELL_EFFECT_ACTIVATE_OBJECT. (#23) (#24997)
* Core/Spells: Implement SPELL_EFFECT_ACTIVATE_OBJECT. (#23)

Original research by @xvwyh.

# Conflicts:
#	src/server/game/DataStores/DBCStores.cpp
#	src/server/game/DataStores/DBCStructure.h
#	src/server/game/DataStores/DBCfmt.h
#	src/server/game/Entities/GameObject/GameObject.h
#	src/server/game/Entities/GameObject/GameObjectData.h
#	src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
#	src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp

* Add missing sql update

* Fix some build errors

* Remove unused enum values

* Change artkits from 0-4 to 0-3

* Remove unused code

* Code review feedback

* Fix sql

* Remove artkit4 special case handling

* Default initialize artKits

* Code review feedback

* Split sql into structure and data files

Co-authored-by: Warpten <vertozor@gmail.com>
2020-07-14 09:34:03 +02:00
Shauren
e2ec3df27e Add missing breaks 2020-07-13 18:15:09 +02:00
Peter Keresztes Schmidt
10be49bdfe Fix some compiler warnings reported by GCC (#25007)
* Core/AI: Remove unneeded null checks

GetMap() can never return NULL.

Fixes additionally -Wunused-variable warnings
reported by GCC.

* Core/GameObject: Fix a -Wunused-variable warning reported by GCC

* Core/Player: Fix a -Wunused-variable warning reported by GCC

* Scritps/CavernsOfTime: Fix -Wimplicit-fallthrough warnings reported by GCC

* Scritps/CavernsOfTime: Fix a -Wmaybe-uninitialized warning reported by GCC

Warning:

/home/peterke/DEV/TrinityCore/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp: In member function ‘virtual void npc_arthas_stratholme::npc_arthas_stratholmeAI::UpdateAI(uint32)’:
/home/peterke/DEV/TrinityCore/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp:1119:58: warning: ‘emote’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1119 |                                 (*it)->HandleEmoteCommand(emote);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

* Scritps/PitOfSaron: Fix -Wunused-variable warnings reported by GCC

* Scritps/EyeOfEternity: Fix a -Wclass-memaccess warning reported by GCC

Warning:

/home/peterke/DEV/TrinityCore/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp: In member function ‘virtual void boss_malygos::boss_malygosAI::UpdateAI(uint32)’:
/home/peterke/DEV/TrinityCore/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp:950:81: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class ObjectGuid’; use assignment or value-initialization instead [-Wclass-memaccess]
  950 |                             memset(_surgeTargetGUID, 0, sizeof(_surgeTargetGUID));
      |

* Scritps/CoilfangReservoir: Fix a -Wclass-memaccess warning reported by GCC

Warning:

/home/peterke/DEV/TrinityCore/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp: In member function ‘void boss_leotheras_the_blind::boss_leotheras_the_blindAI::Initialize()’:
/home/peterke/DEV/TrinityCore/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp:220:55: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class ObjectGuid’; use assignment or value-initialization instead [-Wclass-memaccess]
  220 |             memset(InnderDemon, 0, sizeof(InnderDemon));
      |                                                       ^

* Scritps/Naxx: Fix a -Wimplicit-fallthrough warning reported by GCC

For discussion see https://github.com/TrinityCore/TrinityCore/pull/25007
2020-07-13 16:35:31 +02:00
Ghaster
5af8ff2b84 Core/Spells: Use correct SpellEntry field for Amplitude (#25008) 2020-07-12 16:56:50 +02:00
Peter Keresztes Schmidt
c92950b3e1 Core/DataStores: Update DBC field names to generated ones (#24999) 2020-07-12 15:36:55 +02:00
Max Drosdo.www
3529442668 Core/Player: Introduce separate level caps for each expansion (#24989) 2020-07-11 11:10:04 +02:00
jackpoz
b4adaa838c Core/Creature: Add null check for charmed creatures 2020-07-09 22:12:18 +02:00
Ovah
94a4404e7e Core/Spells: Expose corpseTarget to spell scripts with SpellScript::GetHitCorpse() (#24981)
Closes #24945
2020-07-09 20:03:40 +02:00