Commit Graph

877 Commits

Author SHA1 Message Date
Shauren
06f59caf3d Core/DataStores: Rename TalentTabEntry::CategoryEnumID back to PetTalentMask 2020-07-31 20:02:08 +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
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
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
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
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
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
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
c92950b3e1 Core/DataStores: Update DBC field names to generated ones (#24999) 2020-07-12 15:36:55 +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
ForesterDev
8e0365d8a6 DB/Account: update account_access table (#24788)
* DB/Account: update account_access table:

- rename fields id -> AccountID, gmlevel -> SecurityLevel
- add Comment field
- rename command .acc set gmlevel to .acc set seclevel

* Update auth database

* Fix primary key

* Temporary restore old command account set gmlevel with same handler as account set seclevel

Use Optional  for realmID - if not set, use -1 (for all realms)

* Rename 2020_XX_XX_00_auth.sql to 2020_06_20_00_auth.sql

* Update auth_database.sql

* Rename 2020_XX_XX_00_world.sql to 2020_06_20_06_world.sql

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
2020-06-20 21:49:18 +02:00
jackpoz
cd37a17103 Scripts/Commands: Add .debug objectcount <optional map id> chat command
Add .debug objectcount <optional map id> chat command to show the number of Creatures and GameObjects
2020-06-14 15:41:01 +02:00
Shauren
75ab3619bd Core/Commands: Fixed .npc add overwriting existing spawns when used on transports 2020-05-16 11:23:34 +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
ForesterDev
8128bb97db Core/Player: add helper methods for PLAYER_FLAGS_DEVELOPER (#24511)
* Core/Player: add helper methods for PLAYER_FLAGS_DEVELOPER. Update .dev command to new command model

* Rename _player -> player
2020-04-29 22:41:51 +02:00
jackpoz
31018c3652 Core/Log: Log all character kicks to "network.kick" category 2020-04-08 21:05:01 +02:00
jackpoz
caae3886d2 Core/Misc: Remove whitespace at the end of lines 2020-04-05 19:11:00 +02:00
Giacomo Pozzoni
3def52c1c4 Core/Logs: Log full guid instead of just low guid, part 2 2020-04-05 19:10:58 +02:00
Shauren
635b8d52d5 Core/DBLayer: Prevent committing transactions started on a different database
(cherry picked from commit f6e2b8cdc1)

# Conflicts:
#	src/server/bnetserver/REST/LoginRESTService.cpp
#	src/server/database/Database/DatabaseWorkerPool.cpp
#	src/server/database/Database/DatabaseWorkerPool.h
#	src/server/database/Database/Implementation/HotfixDatabase.h
#	src/server/database/Database/MySQLConnection.h
#	src/server/database/Database/Transaction.cpp
#	src/server/database/Database/Transaction.h
#	src/server/game/Achievements/AchievementMgr.cpp
#	src/server/game/Achievements/AchievementMgr.h
#	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
#	src/server/game/AuctionHouse/AuctionHouseMgr.h
#	src/server/game/BattlePets/BattlePetMgr.cpp
#	src/server/game/BattlePets/BattlePetMgr.h
#	src/server/game/BlackMarket/BlackMarketMgr.cpp
#	src/server/game/BlackMarket/BlackMarketMgr.h
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Entities/Item/Item.cpp
#	src/server/game/Entities/Item/Item.h
#	src/server/game/Entities/Player/CollectionMgr.cpp
#	src/server/game/Entities/Player/CollectionMgr.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/Player.h
#	src/server/game/Garrison/Garrison.cpp
#	src/server/game/Garrison/Garrison.h
#	src/server/game/Groups/Group.cpp
#	src/server/game/Guilds/Guild.cpp
#	src/server/game/Guilds/Guild.h
#	src/server/game/Guilds/GuildFinderMgr.cpp
#	src/server/game/Handlers/BlackMarketHandler.cpp
#	src/server/game/Handlers/CalendarHandler.cpp
#	src/server/game/Handlers/CharacterHandler.cpp
#	src/server/game/Handlers/MailHandler.cpp
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Handlers/PetitionsHandler.cpp
#	src/server/game/Mails/Mail.cpp
#	src/server/game/Pools/PoolMgr.cpp
#	src/server/game/Quests/QuestObjectiveCriteriaMgr.cpp
#	src/server/game/Quests/QuestObjectiveCriteriaMgr.h
#	src/server/game/Scenarios/InstanceScenario.cpp
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/Server/WorldSession.h
#	src/server/game/Spells/SpellHistory.cpp
#	src/server/game/Support/SupportMgr.cpp
#	src/server/game/Tools/PlayerDump.cpp
#	src/server/scripts/Commands/cs_misc.cpp
2020-03-31 13:42:01 +00:00
Shauren
fe1003bdbd Core/DBLayer: Prevent using prepared statements on wrong database
(cherry picked from commit e8e89f58fb)

# Conflicts:
#	src/server/bnetserver/REST/LoginRESTService.cpp
#	src/server/bnetserver/Server/Session.cpp
#	src/server/database/Database/DatabaseWorkerPool.cpp
#	src/server/database/Database/Implementation/HotfixDatabase.h
#	src/server/database/Database/MySQLConnection.cpp
#	src/server/database/Database/MySQLConnection.h
#	src/server/database/Database/PreparedStatement.cpp
#	src/server/database/Database/PreparedStatement.h
#	src/server/database/Database/QueryHolder.cpp
#	src/server/database/Database/SQLOperation.h
#	src/server/database/Database/Transaction.h
#	src/server/game/Accounts/BattlenetAccountMgr.cpp
#	src/server/game/Achievements/AchievementMgr.cpp
#	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
#	src/server/game/AuctionHouseBot/AuctionHouseBot.cpp
#	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
#	src/server/game/BattlePets/BattlePetMgr.cpp
#	src/server/game/Battlegrounds/ArenaTeam.cpp
#	src/server/game/BlackMarket/BlackMarketMgr.cpp
#	src/server/game/Chat/Channels/Channel.cpp
#	src/server/game/Entities/Corpse/Corpse.cpp
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/Item/Item.cpp
#	src/server/game/Entities/Pet/Pet.cpp
#	src/server/game/Entities/Player/CollectionMgr.cpp
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Garrison/Garrison.cpp
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Groups/Group.cpp
#	src/server/game/Guilds/Guild.cpp
#	src/server/game/Guilds/GuildFinderMgr.cpp
#	src/server/game/Guilds/GuildMgr.cpp
#	src/server/game/Handlers/AuctionHouseHandler.cpp
#	src/server/game/Handlers/CharacterHandler.cpp
#	src/server/game/Handlers/ItemHandler.cpp
#	src/server/game/Handlers/MailHandler.cpp
#	src/server/game/Handlers/MiscHandler.cpp
#	src/server/game/Handlers/PetitionsHandler.cpp
#	src/server/game/Handlers/SpellHandler.cpp
#	src/server/game/Handlers/TicketHandler.cpp
#	src/server/game/Loot/Loot.cpp
#	src/server/game/Mails/Mail.cpp
#	src/server/game/Maps/Map.cpp
#	src/server/game/Movement/Waypoints/WaypointManager.cpp
#	src/server/game/OutdoorPvP/OutdoorPvP.cpp
#	src/server/game/Pools/PoolMgr.cpp
#	src/server/game/Quests/QuestObjectiveCriteriaMgr.cpp
#	src/server/game/Reputation/ReputationMgr.cpp
#	src/server/game/Scenarios/InstanceScenario.cpp
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/Server/WorldSocket.cpp
#	src/server/game/Spells/SpellHistory.cpp
#	src/server/game/Support/SupportMgr.cpp
#	src/server/game/Tools/PlayerDump.cpp
#	src/server/game/World/World.cpp
#	src/server/scripts/Commands/cs_account.cpp
#	src/server/scripts/Commands/cs_ban.cpp
#	src/server/scripts/Commands/cs_battlenet_account.cpp
#	src/server/scripts/Commands/cs_group.cpp
#	src/server/scripts/Commands/cs_lfg.cpp
#	src/server/scripts/Commands/cs_list.cpp
#	src/server/scripts/Commands/cs_message.cpp
#	src/server/scripts/Commands/cs_misc.cpp
#	src/server/scripts/Commands/cs_npc.cpp
#	src/server/scripts/Commands/cs_tele.cpp
#	src/server/scripts/Commands/cs_wp.cpp
#	src/server/shared/DataStores/DB2DatabaseLoader.cpp
#	src/server/shared/Realm/RealmList.cpp
2020-03-31 13:42:01 +00:00
Shauren
105165c35c nopch fix 2020-03-19 20:34:22 +01:00
Treeston
7ac6ccb36b Core/Chat: Add SpellInfo const* handler for command args. Use it to update .cast <spellId/link> <triggered>. 2020-03-19 16:13:01 +01:00
Giacomo Pozzoni
0752584856 Core/Database: Fix build with Maria DB on some distros (#24248) 2020-03-05 20:16:49 +01:00
ForesterDev
ffede34ba9 Core/Misc: Moved CanSpeak() method to WorldSession class (#24209)
* Core/Misc: Moved CanSpeak() method to WorldSession class

(cherry picked from commit 93aa30f447)

# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Handlers/ChatHandler.cpp
#	src/server/game/Server/WorldSession.cpp

* fix merge conflicts
2020-02-28 19:53:35 +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
ratkosrb
6176ce92ea 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 <giacomopoz@gmail.com>
2020-02-16 13:36:56 +01:00
Treeston
9304e496cb 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 <giacomopoz@gmail.com>
2020-02-08 20:22:37 +01:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
Michael
6b19f4a0ab 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
2019-12-28 22:58:18 +01:00
Shauren
5f06c476f6 Core/DBLayer: Support using mysql 8
(cherry picked from commit c3a9d56b56)
2019-11-09 13:49:27 +01:00
Kelno
6fc7ab3448 Core/Commands: Fixed wrong permissions for .lookup map commands (#23800) 2019-09-16 17:41:55 +02:00
ForesterDev
07e2264964 Core/PacketIO: updated SMSG_PLAY_SOUND, SMSG_PLAY_MUSIC and SMSG_PLAY_OBJECT_SOUND (#23636)
* Core/PacketIO: SMSG_PLAY_SOUND

(cherry picked from commit 82a33c7fa8)

# Conflicts:
#	src/server/game/Battlefield/Battlefield.cpp
#	src/server/game/Battlegrounds/Battleground.cpp
#	src/server/game/Battlegrounds/BattlegroundMgr.cpp
#	src/server/game/Battlegrounds/BattlegroundMgr.h
#	src/server/game/Entities/Object/Object.cpp
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Texts/CreatureTextMgr.cpp
#	src/server/game/Texts/CreatureTextMgr.h
#	src/server/scripts/Commands/cs_misc.cpp

* Update for 3.3.5

* Core/PacketIO: updated and enabled SMSG_PLAY_MUSIC

(cherry picked from commit c6718dc120)

# Conflicts:
#	src/server/game/Maps/Map.cpp
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/Protocol/Opcodes.h
#	src/server/game/Spells/SpellEffects.cpp

* Core/Packets: added SMSG_PLAY_OBJECT_SOUND packet class

(cherry picked from commit 1272e9eea6)

# Conflicts:
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Packets/MiscPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp

* fic build

* change variable names

* fix build error field will be initialized after
2019-08-23 19:28:21 +02:00
Shauren
7ee0891b0f Warning fix 2019-08-17 22:40:50 +02:00
Shauren
3a4216fd97 Core/Map: Kill zoneId from RespawnInfo, all it did was significantly slow down startup to make one gm command faster 2019-08-17 22:30:27 +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
910da94d20 that should make gcc complain less (57b36df follow-up) 2019-08-07 13:24:00 +02:00
Treeston
aa7fc4b6ef nopch fix 2019-08-07 11:21:53 +02:00
Treeston
57b36dfdc6 Scripts/Commands: Add .go boss, and do a usability pass over .go instance to match it. 2019-08-07 01:45:24 +02:00
Treeston
4320a021e9 Scripts/Commands: Cleanup some output from .go instance 2019-08-06 23:46:07 +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
0e7c66cb4c 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. 2019-07-21 01:50:52 +02:00
Treeston
b64834c3f5 Scripts/Commands: Adjust .list respawns to use enum iteration. Add enum iteration capability to SpawnObjectTypes. 2019-07-17 22:58:49 +02:00
Treeston
293ba08d21 Scripts/Commands: Add .debug questreset to force daily/weekly/monthly quest reset. 2019-07-16 15:04:14 +02:00
Treeston
d60082ae86 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
2019-07-15 17:14:58 +02:00
jackpoz
7421ccaf7e 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
2019-07-13 18:15:39 +02:00
Treeston
daf423a6c3 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 2019-07-12 13:37:27 +02:00
Shauren
6eecb685ce Core/Weather: Fixed weather updates to be thread safe
(cherry picked from commit 6eb9973947)
2019-07-09 21:17:59 +02:00
ForesterDev
e71773140c Scripts/Commands: update .wp commands to use orientation field from DB (PR #23566)
Closes #23330
2019-07-08 14:16:10 +02:00
Treeston
84b7b2e08e 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.
2019-07-08 11:56:41 +02:00
Treeston
ded18a2690 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. 2019-07-07 19:18:32 +02:00