Commit Graph

27184 Commits

Author SHA1 Message Date
Carbenium
7e0fb710ad Scripts/AhnKahet: Update Herald Volazj to current coding standards
* convert to BossAI
* no functional changes

(cherry picked from commit 90543fd41d)
2022-01-24 21:53:52 +01:00
Carbenium
18e5e1ef43 Scripts/AV: Update Vanndar's script to use TaskScheduler
* No functional changes

(cherry picked from commit 799d5376d8)
2022-01-24 21:35:52 +01:00
Carbenium
8809d54ca2 Core/Common: Merge TimeTrackerSmall with TimeTracker
(cherry picked from commit 228696bf80)
2022-01-24 21:34:36 +01:00
Carbenium
35e0002df3 Core/Common: Add a std::chrono interface to TimeTrackerSmall
New methods:
TimeTrackerSmall(Milliseconds expiry);
void Update(Milliseconds diff);
void Reset(Milliseconds expiry)
Milliseconds GetExpiry() const

Removed methods:
int32 GetExpiry() const

Also add basic unit tests.

Core/Scripts: Use std::chrono interface of TimeTrackerSmall

(cherry picked from commit e55516348d)
2022-01-24 21:25:47 +01:00
Shauren
d5dcf02196 Core/DBLayer: Add nicer api for SQLQueryHolders
(cherry picked from commit 9b806c6b5d)
2022-01-24 21:21:37 +01:00
Giacomo Pozzoni
61bf51874d Core/Misc: Fix static analysis issues (#25178)
(cherry picked from commit 7cf122fc2a)
2022-01-24 20:21:25 +01:00
Treeston
23ad14526c Core/Common: Allow config settings to be loaded as optional (PR #25137)
If the config setting is not present, returns the default without issuing a warning.

(cherry picked from commit 5ad064976e)
2022-01-24 15:08:46 +01:00
Jinnaix
ab7680157b Scripts/BlackrockSpire: Fix encage event of Pyroguard encounter (#25177)
(cherry picked from commit e3aa87641f)
2022-01-24 15:05:20 +01:00
Giacomo Pozzoni
736b9ac112 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

(cherry picked from commit deceb11b5f)
2022-01-24 14:58:08 +01:00
Shauren
6d9a084036 Core/Commands: Initialize commands on startup instead of first use
(cherry picked from commit 0fc7b50c04)
2022-01-24 14:46:14 +01:00
Shauren
a9b4f9aca0 Core/Mail: Load mails at login instead of on demand when queried by packets (logging in always sends one of the packets that cause mail loading anyway)
(cherry picked from commit 57eaab80d9)
2022-01-24 14:45:54 +01:00
Shauren
54a6e603ff Core/Misc: Replace database query in WorldSession::HandleAddFriendOpcode with async version
(cherry picked from commit 2f0893d279)
2022-01-24 13:38:40 +01:00
Giacomo Pozzoni
1977d26050 Core/SAI: Ignore SAI while evading (#25108)
(cherry picked from commit 420b21be98)
2022-01-24 13:21:46 +01:00
Gildor
8847f37b5b Core/Loot: Prevent loot already looted item (#25084)
(cherry picked from commit 586c00fe2e)
2022-01-24 13:20:49 +01:00
Trond B. Krokli
fa444aca66 Scripts/Quest: Force of Neltharaku quest credit (#24807)
* Scripts/Quest: Force of Neltharaku quest credit

**Description:**

Suggested solution to resolve the kill credit double cast issue
in the quest "The Force of Neltharaku" (10854).

by Rushor

**Changes proposed:**

- Remove duplicate spell casts in the zone quest script
- Remove commented-out script section
- Set a couple of unit flags (anim/stand/hover)
- Move return new creature script override to end of script
- Move PlayerGUID, FlyTimer, and Tapped to Private
- Add DB flight movement control to Enslaved Netherwing Drake
- Add SpellMgr MaxAffectedTargets = 1 for spell 38762
- Add movement enum POINT_MOVE_UP
- Add missing enum for quest ID

**Target branch(es):** 3.3.5/master

- [X] 3.3.5
- [X] master

**Issues addressed:** Closes #24796

**Tests performed:** (Does it build, tested in-game, etc.)

Pending for now.

**Known issues and TODO list:** (add/remove lines as needed)

- [X] Open PR in draft mode until testing is cleared
- [ ] Compile and create local server
- [ ] Test changes on local server

* Rename 9999_99_99_99_world.sql to 2020_07_29_00_world.sql

Co-authored-by: Rushor <Rushor@users.noreply.github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
(cherry picked from commit e0dae8feb6)
2022-01-24 13:19:36 +01:00
Ovah
9c38dc2367 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

(cherry picked from commit 210f552ac5)
2022-01-24 13:15:42 +01:00
Shauren
d2cde75ab2 Core/Networking: Fixed authserver socket read handlers being called on incorrect thread
(cherry picked from commit 3ad05386c8)
2022-01-24 13:15:13 +01:00
jackpoz
f220e46c50 Core/Metric: Add new metric in World::UpdateSessions()
Add new metric about how long adding sessions took

(cherry picked from commit 5cd93df9ee)
2022-01-24 13:12:21 +01:00
Carbenium
b3f2ff97ff Core/CreatureAI: std::chrono-ify DoSummon* methods
(cherry picked from commit 1245833cdd)
2022-01-24 13:11:13 +01:00
Giacomo Pozzoni
8350985975 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

(cherry picked from commit 8a2c79c850)
2022-01-24 13:02:38 +01:00
Shauren
c7899c1e76 Core/WorldObject: std::chrono-ify SummonPersonalClone 2022-01-24 12:57:40 +01:00
Carbenium
82fce41852 Core/WorldObject: Replace non-std::chrono SummonGameObject overloads
Also fix intended despawn time of GOs used by the "Engineering a Disaster" quest

(cherry picked from commit 8642aaaf92)
2022-01-24 12:55:43 +01:00
Carbenium
217c2d9ef3 Core/WorldObject: Replace non-std::chrono SummonTrigger overloads
(cherry picked from commit 3620b47c41)
2022-01-24 12:47:56 +01:00
Carbenium
3bba8d50b1 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);

(cherry picked from commit a41f599be7)
2022-01-24 12:39:59 +01:00
Giacomo Pozzoni
21e9fac8bd 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>
(cherry picked from commit 36ef487a90)
2022-01-24 12:21:36 +01:00
Carbenium
03e4c0d7bf Core/Creature: Remove non-std::chrono overload of DespawnOrUnsummon
(cherry picked from commit 480dee3125)
2022-01-24 12:21:26 +01:00
Carbenium
a7cbb16229 Core/EventProcessor: std::chrono-ify the remaining public API
(cherry picked from commit 1d8782e356)
2022-01-24 12:06:56 +01:00
Carbenium
eeffb310de 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)

(cherry picked from commit 92a02a5c87)
2022-01-24 12:00:35 +01:00
Carbenium
310f996b1d 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);

(cherry picked from commit 1131229ee9)
2022-01-24 11:55:32 +01:00
Carbenium
da17942af9 Core/EventMap: Clarify documentation of ScheduleEvent
(cherry picked from commit 7865c1c197)
2022-01-24 00:01:38 +01:00
Carbenium
a5d85deced Core/EventMap: Unify semantics of DelayEvents
DelayEvents(Milliseconds delay) had different semantics than
DelayEvents(Milliseconds delay, uint32 group).
The first method delayed the events only in the case the internal timer
already ticked at least for the amount of delay. In contrast the latter method
delayed events regardless of the internal timer value.

Use the latter semantics for DelayEvents(Milliseconds delay) as well which makes
the outcome more predictable. Adapt tests accordingly.

(cherry picked from commit 4470b91223)
2022-01-24 00:01:25 +01:00
Carbenium
27c1f47598 EventMap: Change GetTimeUntilEvent to return std::chrono types
(cherry picked from commit 8cb35b0d5f)
2022-01-23 23:59:46 +01:00
Carbenium
7847589d9c EventMap: Switch internal timer over to std::chrono type
Adds the EventMap::Update(Milliseconds time) overload

(cherry picked from commit b9795e4482)
2022-01-23 23:59:32 +01:00
Carbenium
a28bc7faaa Scripts/Kalimdor: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 40efda9726)
2022-01-23 23:59:11 +01:00
Carbenium
38695b0943 Scripts/World+Outland+Spells: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit 5832790428)
2022-01-23 23:58:48 +01:00
Carbenium
271462ceec Scripts/Northrend: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit fc9e7226c0)
2022-01-23 23:57:56 +01:00
Carbenium
b8a3ab880f Core/Misc: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit c39eb9b504)
2022-01-23 23:56:25 +01:00
Carbenium
58e1c091a2 Scripts/EasternKingdoms: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit d1a39a2ebf)
2022-01-23 23:53:20 +01:00
Shauren
cacdb57c9c Core/Crypto: c++17-ify crypto code cherry picked earlier that was downgraded to c++14 2022-01-23 23:49:34 +01:00
Carbenium
5f5d32888a Core/EscortAI: std::chrono-ify SetPauseTimer
(cherry picked from commit cdaf890af4)
2022-01-23 23:34:52 +01:00
Carbenium
14e9513cea Core/EscortAI: std::chrono-ify AddWaypoint
(cherry picked from commit 4b9fdc5d3d)
2022-01-23 23:34:40 +01:00
Carbenium
e660b870e9 Core/ScriptedAI: std::chrono-ify DoSpawnCreature
(cherry picked from commit f5076112cb)
2022-01-23 23:33:04 +01:00
Carbenium
da438c73e2 Core/BossAI: Remove _DespawnAtEvade(uint32, Creature*) overload
Use _DespawnAtEvade(Seconds,  Creature*) instead

(cherry picked from commit 27229c10cd)
2022-01-23 23:28:47 +01:00
Carbenium
5f296fb7c7 Core/InstanceScript: std::chrono-ify DoRespawnGameObject
(cherry picked from commit d7ff8c272a)
2022-01-23 23:09:27 +01:00
Carbenium
7c43afa471 Core/Utilities: Add custom _days chrono literal
(cherry picked from commit d5de96e46b)
2022-01-23 23:08:21 +01:00
Peter Keresztes Schmidt
10f835b058 Common/Crypto: #ifdef out unnecessary locking code for OpenSSL 1.1+ (PR #25110)
(cherry picked from commit 7ea33120a0)
2022-01-23 23:07:33 +01:00
jackpoz
b327414abb Core/Misc: Code cleanup
Remove more unused code in UpdateTime class

(cherry picked from commit 6c4f71c84b)
2022-01-23 22:49:21 +01:00
Trond B. Krokli
cf94f4a8ed Scripts/Borean Tundra: duplicate comment text (#25102)
(cherry picked from commit ebb9e1b4de)
2022-01-23 22:49:11 +01:00
Giacomo Pozzoni
e8583d04f6 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

(cherry picked from commit 3c0ac7302f)
2022-01-23 22:45:25 +01:00
Giacomo Pozzoni
1dfcb7086e 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

(cherry picked from commit 6440c3bcac)
2022-01-23 22:35:00 +01:00