Commit Graph
1291 Commits
Author SHA1 Message Date
ForesterDev 69f7686050 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

(cherry picked from commit 69231581e4f2d78384d3efe6f613be1b78e9d40f)
2021-12-22 01:25:24 +01:00
ratkosrb 72093e98e1 Core/Creature: Use proper name for wander distance. (#24133)
* Use proper name for wander distance.

* Rename db field.

* Fix query.

* Remove underscore from chat command.

* Rename the handler too.

* Update chat command description.

* Fix remaining issues.

* Rename 2020_99_99_99_world_335.sql to 2020_02_16_01_world.sql

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 6176ce92ea01fd33b11c2e7f8e9ebb509e80c944)

# Conflicts:
#	sql/updates/world/master/2020_02_16_01_world.sql
#	src/server/database/Database/Implementation/WorldDatabase.cpp
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Globals/ObjectMgr.h
#	src/server/scripts/Commands/cs_npc.cpp
2021-12-21 19:50:12 +01:00
Treeston 94a79bac7a Core/Misc: Some refactoring, #23603 prep: (#23676)
- Split SpawnMetadata off from SpawnData
- No longer allocate Creature/Gameobject objects in ObjectGridLoader just to check their typeid and delete them afterwards

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 9304e496cbf6ab6c028671fb8526c732ae5d799f)
2021-12-21 15:16:26 +01:00
Michael 72e61625bc additional output for additem command (#24006)
* additional output for additem command

when removing items with additem:

if the user provides an amount too large of a negative amount, the command will now output the amount of items that could not be destroyed.

* renamed sql file to hopefully avoid conflicts

* added clarification to failure string

* changed unneeded else if condition to else

* code style; braces

* Update and rename 9999_99_99_99_world.sql to 2019_12_28_01_world.sql

(cherry picked from commit 6b19f4a0ab1f77ea969a080a6eea0379baf9f8df)
2021-12-19 15:46:20 +01:00
Kelno 368d99787c Core/Commands: Fixed wrong permissions for .lookup map commands (#23800)
(cherry picked from commit 6fc7ab3448850199835f9ee9dca6991b511eba09)
2021-12-18 22:19:05 +01:00
Shauren 8f3904f8fd Core/Map: Kill zoneId from RespawnInfo, all it did was significantly slow down startup to make one gm command faster
(cherry picked from commit 3a4216fd979eb2a7667b0861a770e9af4f242eab)
2021-12-18 20:57:38 +01:00
Treeston 0b61c3b7b1 [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

(cherry picked from commit 4211645834c467a03c60248e80818d3607be9ea7)
2021-12-18 20:24:50 +01:00
Treeston 7704d8fc7a Scripts/Commands: Add .go boss, and do a usability pass over .go instance to match it.
(cherry picked from commit 57b36dfdc6b077cc4eba29406e3ded4dbf9f8ce6)
2021-12-18 16:13:24 +01:00
Treeston c7e7c52c1a Scripts/Commands: Cleanup some output from .go instance
(cherry picked from commit 4320a021e93423122745684e2689aa1a7028f8b4)
2021-12-18 16:00:20 +01:00
Treeston 51fbda4223 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

(cherry picked from commit a5e73e41c0e813e674bb0a644e0052052435494e)
2021-12-18 15:28:45 +01:00
Treeston c13d83796f Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time.
(cherry picked from commit 0e7c66cb4c7ff7d44e232d0b50703a48605ffd24)
2021-12-17 00:23:33 +01:00
Treeston e270351a16 Scripts/Commands: Adjust .list respawns to use enum iteration. Add enum iteration capability to SpawnObjectTypes.
(cherry picked from commit b64834c3f5dd7e1be472950532ce00e70b4601fa)
2021-12-16 21:41:24 +01:00
Treeston 6f6cf975e4 Scripts/Commands: Add .debug questreset to force daily/weekly/monthly quest reset.
(cherry picked from commit 293ba08d21c4e9634229bb5015445ecc0cc08fef)
2021-12-16 21:20:38 +01:00
Treeston eee950cdd7 Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:
- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean
- Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private
- Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does
- Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed
- Map::AddRespawnInfo now takes const reference, and returns success as a boolean
- Map::AddRespawnInfo no longer offers an unused "replace" parameter
- Map::DeleteRespawnInfo no longer offers a variety of unused private overloads
- Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does.
- Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ.
- Map::GetWorldObjectBySpawnId sanitized
- Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime

(cherry picked from commit d60082ae866d77a12a9e6d09dfce27fc1cb5df90)
2021-12-16 01:33:09 +01:00
jackpoz e7b94603f2 Core/Commands: Add .debug guidlimits <optional map id> chat command
Add .debug guidlimits <optional map id> chat command to show the highest low guid counter for Creature and GameObject, useful when reaching Respawn.GuidWarnLevel

(cherry picked from commit 7421ccaf7eb134f549ad3734a815397216d020ed)
2021-12-16 00:53:58 +01:00
Treeston b4b581de1b Scripts/Commands: .account ban no longer fails if an account containing the specified account name is already banned (f.ex. attempting to ban 'test' if 'test2' is already banned) - closes #22990
(cherry picked from commit daf423a6c3c0fdd13e421f02ccd791103f7bdd5b)
2021-12-15 22:48:03 +01:00
ForesterDev 61cc88731c Scripts/Commands: update .wp commands to use orientation field from DB (PR #23566)
Closes #23330

(cherry picked from commit e71773140c8efbea4abe612a71d4a65f041d450c)
2021-12-15 00:17:13 +01:00
Treeston 2532de6acb Entities/Unit: Nuke Map::ForceRespawn from orbit, with the following implications:
- .npc respawn no longer causes stupid things to happen (Fixes #23014)
- ::DeleteFromDB methods on Creature and GameObject rewritten to be as sensible as such a colossally stupid method can ever be. They're static now.
- .npc delete and .gobj delete ported to new argument handling, and rewritten as per above. They can no longer crash the server when used in instances, too. Yay for that.
- Adjusted various dusty cobwebbed hacks around the core (why does waypoint visualization use permanent spawns *shudder*) to still work too.

(cherry picked from commit 84b7b2e08ea55575cbe62d795383d4a5341ffd4d)
2021-12-14 22:42:22 +01:00
Treeston 2225cb1201 Entities/Creature: Some asserts are now LOG_ERRORs that block spawning. Fix a group spawning bug exposed by the CoS merge. Improve some command output.
(cherry picked from commit ded18a2690063991d5440df7d3e5d526b884ec16)
2021-12-14 22:24:24 +01:00
ForesterDev 104ec7a81a Core/Unit: Implement more helper methods (#23555)
(cherry picked from commit c44fb37f74347e3b6d399c941716971503af4cf8)
2021-12-14 20:42:32 +01:00
ForesterDev 27886c7f5d Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender (#23520)
* Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender and fix some cases, where we should get player gender, instead of modified by display gender

* fix merge

* Add virtual methods for Unit class

(cherry picked from commit b47bb59e2a3e42aff3793517ef94f51678b54905)
2021-12-13 00:42:20 +01:00
ccrs 4e6c59dca7 Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
        uint8 GetLevelForTarget(WorldObject const* /*target*/)
        void SetLevel(uint8 lvl)
        uint8 GetRace()
        uint32 GetRaceMask()
        uint8 GetClass()
        uint32 GetClassMask()
        uint8 GetGender()

(cherry picked from commit 5c09ff51f7015b775def8d5cc1f678eaef37200f)
2021-12-13 00:42:20 +01:00
Aokromes 30cec73c61 Coding standards (#23514)
* Coding standards

* revert part

(cherry picked from commit fe744977c917957e112704ccd66e228b826b3f7a)
2021-12-13 00:42:17 +01:00
Shauren f61de627e5 Core/Commands: Fixed crash in .npc showloot 2021-12-12 19:19:29 +01:00
Treeston 35e55f1089 Core/Entities: Kick engagement logic upstairs to Unit (from ThreatManager), since all Units with AI need it (not just those with threat list). Fixes #17981.
(cherry picked from commit dbe3bbefe734f8824e8f07c302e256f0d446b974)
2021-12-12 00:31:15 +01:00
Wyrserth ae43820ca0 Core/Commands: implement commands to look up a map/item/quest name for a given id (#23416)
* Core/Commands: implement commands to look up a map/item/quest name for a given id.

* Add entry to updates table.

* Rename 9999_99_99_99_auth.sql to 2019_06_16_00_auth.sql

* Add missed change, thanks jackpoz!

* Update auth_database.sql

(cherry picked from commit ce3dcdcb1ad1887fb3a531aaea09482c12b5e4f3)
2021-12-11 14:12:54 +01:00
jackpoz 97249ff7b4 Core/Channel: Fix CRT Debug Assert triggered with invalid channel names
(cherry picked from commit f0bd90cc35098475b20e736cf98885c99c04be3d)
2021-12-08 23:43:19 +01:00
jackpoz c73fd0e6e3 Scripts/Commands: Add .debug asan commands
Add ".debug asan memoryleak" and ".debug asan outofbounds" commands to trigger Address Sanitizer warnings at runtime (or other dynamic analysis tools)

(cherry picked from commit 71d15ea25be3e86646faaa3266617a0b8177972f)
2021-12-02 00:39:20 +01:00
Jozef Dúc b717603a9b Core/Object: Range check (#23179)
* Should solve #23062. All credits to @xvwyh

* Remove unused variables

* Remove unused variable

* Cast int32 to uint32

* Remove G3D headers from core header file

* Change door distance

* Update GameObject.cpp

Add newline

* Update GameObject.h

Indentation

(cherry picked from commit 32e1de39a26628dcb64bc21ad415afb2ad938925)
2021-12-02 00:39:20 +01:00
ForesterDev a2c0f6d321 Scripts/Commands: add some missing checks for .guild create command (#23201)
* Core/Conditions: implement CONDITION_GAMEMASTER

* Scripts/Commands: add some missing checks for .guild create command

(cherry picked from commit ae8750716f63ddc41f21bb38ceafe949d7260f0e)
2021-12-02 00:39:20 +01:00
Gustavo 6aaf9aaf3b Core/Misc: Warning fixes (/W4) (#23149)
* Core/Misc: Warning fixes (/W4)

(cherry picked from commit 50f122de778bca324d0f4c81f1e8eb30b90a7314)
2021-11-26 11:18:15 +01:00
jackpoz 97401a2997 Core/Commands: Don't re-add active quests with ".quest add" command
(cherry picked from commit f17120cc784ee1f52a24424a78a64d71ad73b713)
2021-11-24 00:02:13 +01:00
TheWinchesters 47adf2e4c8 [3.3.5] Commands: lookup player shows which character is online (#23039)
* Show 'online' for every online player in lookup player commands

(cherry picked from commit a0056951f7e425341760ebf3a7770477ef7f4446)
2021-11-23 22:52:53 +01:00
jackpoz 3ddbf02dc7 Core/Misc: Fix issues reported by static analysis
Fix issues reported by Coverity Scan

(cherry picked from commit 2fda1572d214d0b114e0291106363f49c2d3179e)
2021-11-23 22:20:39 +01:00
Shauren dcd69240b6 Core/Commands: Fixed creature/gameobject move commands not updating which cell they belong to
Closes #22720

(cherry picked from commit ec1cfa36f4c286ad8037516460a4e99ea5d7a5ed)
2021-11-21 19:52:26 +01:00
ccrs 1c5287032a Core/Movement: correct logic wrongly ported in 2a84562dc8
I'm referencing line 97 from ChaseMovementGenerator.
That commit introduced a modification in this use case:
- Chasing target is not my current victim, I should stop moving till it is my victim again
Changed To:
- Chasing target is not my current vicitm, I should stop chasing
My correction:
- I dont care about the relation of my current victim and my chasing target, I'm commanded to chase, something will tell me to stop chasing
--> Most likely: evade, new attackstart, etc.

the rest are just minor changes

(cherry picked from commit 9080e7863c28df7dc1c2af321964776e7b59e41a)
2021-11-21 14:17:23 +01:00
Giacomo Pozzoni ff2cd4a032 Scripts/Commands: Fix crash caused by .set npc model (#22877)
* Scripts/Commands: Fix crash caused by .set npc model

Fix crash caused by .set npc model with invalid model id

(cherry picked from commit 20ea24bf5ccf165ce19139d1f7ec7c650719eb68)
2021-11-18 15:57:20 +01:00
Rochet2 afac2b1742 Add rotation to .gob info (#22723)
* Add rotation to .gob info

- Add rotation (yaw, pitch, roll) to .gob info command
- Replace LANG_SPAWNINFO_DISTANCEFROMPLAYER with LANG_SPAWNINFO_ROTATION
- Fix description of .distance to describe the command arguments (the more you know..)
- Fix .gob info guid targetting nearest gameobject instead of finding with given guid
- Reorder the info data slightly
- Print location and rotation data regardless of object found in world
- Add error messages for when object is not found by guid or entry

(cherry picked from commit 257ae44a20ed40469dd821845de8e27c0af838c7)
2021-11-15 21:49:37 +01:00
Treeston c977087d58 Core/Misc: Partial merge of 3.3.5-dbedit:
- Added SmartEnum.h for enum iteration, stringification, and more, courtesy of krabicezpapundeklu/smart_enum
- Moved a bunch of enums in SharedDefines.h to the new system
- Miscellaneous utility methods ported

Core/Util: Redesign SmartEnum to properly work for large
 enums (>64 entries) and play nice with IDEs (PR #22768)

(cherry picked from commit 338e8ba0fea8b4b15120c96fff15a6c4b1a52593)
(cherry picked from commit f7ca0877a3736000a6e3b4ed09ac5f08b4d8e3f0)
(cherry picked from commit 207093475a177e9fd29696e80fdd06a11324782d)
(cherry picked from commit ee68cf33921944fd3f8c188044906998cf10ff2a)
(cherry picked from commit c16d461e16f0704bb11040faff30953d33ba2188)
(cherry picked from commit f6b0d99e2c0bc22b44d6f3cfdae50cbba7d51de8)
(cherry picked from commit bc1f456125c1b6c90617a514152d69c40ce64886)
2021-11-15 21:34:03 +01:00
ForesterDev e58d737a93 Core/Commands: fix .appear command provide wrong undermap position (#22624)
(cherry picked from commit 1e99f98327189c00e9e5e552d332120f12d38f03)
2021-11-14 20:52:50 +01:00
ForesterDev 4e66353854 Core/Commands: Fix quest remove error message (#22623)
(cherry picked from commit 82a1448705257db0b3edcffdc9a65008224bc371)
2021-11-14 20:52:18 +01:00
Shauren 9f2ccf9924 Core/Commands: Fixed crash in .go commands
Closes #22498

(cherry picked from commit b27a76969a2fdbf2e390f28478b9b8ccdb48e2bd)
2021-11-10 00:34:17 +01:00
Treeston 5ed891a0f0 Scripts/Commands: Add .debug dummy. It does nothing, which means you can make it do anything.
(cherry picked from commit 97ade1321b6d18393202a1448f2b042fc1ff0546)
2021-11-08 23:18:32 +01:00
Aokromes 3621482e44 kill some whitespaces
(cherry picked from commit cc49b7bb3024c6eb36d9bbbe7b151d7ae9ba91b7)
2021-10-26 23:55:38 +02:00
Treeston f91faa161c Core/ChatCommands: Implement achievement link parsing
(cherry picked from commit a4c666dc3d75d0c77fdeb52a6d2cd21100ba4588)
2021-10-25 15:06:41 +02:00
Treeston 33c8df9cf1 Scripts/Commands: Rewrite .account commands to new model
(cherry picked from commit c59388783a6009301548dae2c29e2a29c71aadf7)
2021-10-25 14:16:49 +02:00
Treeston 0c681b6509 Scripts/Commands: New argument parsing methodology (PR #22363)
- Detect the arguments accepted by the command handler
- Tokenize out those arguments automatically and feed them to the handler
- Unmatched rest of the string can be accepted by trailing char const* or CommandArgs*

(cherry picked from commit 66a87c4642d25f27ca24254cfeb0a0c4b21036b1)
2021-10-25 00:03:23 +02:00
Treeston f1ecb976ec Core/RBAC: Simplification part 1. Nobody needs different permissions for each type of .go command.
(cherry picked from commit 5843724debc3642434c055e5cf6f29a1eaf65358)
2021-10-23 22:31:27 +02:00
Treeston af8b4853da Scripts/Commands: Cleanup and trinity_string for .go instance. Hi shauren.
(cherry picked from commit 8e4f6777a28ac7b5d59ff1ff852e5184d877ff96)
2021-10-23 19:53:19 +02:00
Treeston 82ecd32d9c Scripts/Commands: New command ".go instance". Goes to an instance.
(cherry picked from commit 6a0870a9993f5a1016439644d4a9ab3fd89277e5)
2021-10-23 19:08:53 +02:00