Commit Graph

471 Commits

Author SHA1 Message Date
Shauren
7851cd3a96 Core/AreaTriggers: Code cleanup 2021-01-30 18:10:21 +01:00
Matan Shukry
0417c5ff5f Core/AreaTriggers: Implementation for sever side area triggers
- Spawn GridLoader to spawn area triggers correctly now
- Removed SAI completely
- Removed remnants of smart scripts. Created different issue for it
- Calling InitDbPhaseShift and not InDbPhaseShift
- changed SpawnId to uint64 rather than uint32
- not using CellGuidSet typedef as to not include ObjectMgr.h in the header
2021-01-30 18:10:21 +01:00
r00ty-tc
2a84b5ae1a Core/Spawns: Resolve crash in BattlegroundAV
- Correctly set spawngroup on spawned creatures in Alterac Valley BG
 - Sanity check on application of dynamic spawn rates (not for BG/Arena
   maps)
 - Check that spawndata exists before using it.

Closes #20535

(cherry picked from commit 55b9a3f65f)
2020-12-31 23:23:50 +01:00
Shauren
49f8b1dbb4 Core/Corpses: Fixed crash during loading corpses
Closes #25748
Closes #25744
2020-12-22 16:11:34 +01:00
Shauren
93f2affbf2 Core/Corpses: Fixed client crashes with player corpses
Closes #25714
2020-12-13 18:38:31 +01:00
Shauren
5a0e348a95 Dep/Boost: Support for boost 1.74 - heap
Closes #25470

(cherry picked from commit 868c82aa6c)
2020-12-12 18:50:19 +01:00
Shauren
7a406db506 Core/Collision: Fixed false positive errors in console about vmap loading 2020-12-08 18:16:47 +01:00
Shauren
b82a3a557a Core/DataStores: Updated db2 structures to 9.0.2
* Includes support for new character customization
2020-12-08 18:16:47 +01:00
Shauren
b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Treeston
35e74687c3 Core/Player: More cleanups to Player::UpdateZone, including correcting an oversight that was causing the last known zone id to not update when leaving map. Closes #20289 for real this time.
(cherry picked from commit 47af704f63)
2020-08-23 23:25:35 +02:00
Treeston
27806eeac9 Core/Spawn: Move spawn group state management from sObjectMgr to the Map object, which makes it actually function as intended with instances. Woops.
(cherry picked from commit f279207d48)
2020-08-23 17:00:59 +02:00
Treeston
608c9aaabf Scripts/InstanceScript: Implement database framework for managing spawn groups based on boss state. (#20103)
(cherry picked from commit 84590be26d)
2020-08-22 13:48:44 +02:00
r00ty-tc
03b125e6d1 Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object
 - Toggleable spawn groups (with C++/SAI/command options to use them)
 - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone.
 - Backward compatibility mode (set via group and for summons)
   to support creatures/gos that currently don't work well with this
   (this should be removed once the exceptions are fixed)

Fixes and closes #2858
Tags #8661 as fixable.
Fixes and closes #13787
Fixes #15222.

(cherry picked from commit 59db2eeea0)
2020-08-22 12:59:57 +02:00
jackpoz
bf5be28396 Core/Misc: Fix static analysis issues
Fix various coverity reported issues

(cherry picked from commit 925557d1c0)
2020-08-21 23:13:13 +02:00
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
treeston
5392212799 So, I came in trying to fix gameobject LoS. So I restructured some stuff.
Then it turned out that gameobject LoS is already fixed. So all this does, really, is restructure some stuff.
And remove the hack from Sapphiron because I could.

(cherry picked from commit d57307f63d)
2020-07-16 22:00:28 +02:00
Golrag
2f27e41c3d Core/Maps: Corrected GetWaterOrGroundLevel (#19863)
* When a gameobject was above water like in ToC. It would return water level

(cherry picked from commit a2c123b529)
2020-07-16 22:00:28 +02:00
Treeston
51ce3b1c1d [3.3.5] Get zone/area IDs from vmap data in the liquid update (#19840)
* Add new method Map::getFullVMapDataForPosition to get area info and liquid info in a single vmap lookup
* Use this lookup in Map:: relocation methods to update m_areaId and m_zoneId fields on WorldObject
* Adjust GetZoneId/GetAreaId on WorldObject to always return these cached fields
* Clean up liquid state handling on Unit and Player
* Hand floor's Z coord up through GetFullTerrainStatusForPosition, use it to update a new field in WorldObject, and use that to feed a new GetFloorZ call on WorldObject.

Closes #16489

(cherry picked from commit f6c849729b)
2020-07-16 22:00:24 +02:00
Shauren
20e2f3632a Core/Maps: Added optional *.tilelist file to map_extractor output which contains a list of existing tiles to speed up map creation in worldserver 2020-07-06 16:36:30 +02:00
Shauren
deca201f77 Core/DataStores: Simplified string memory allocation in db2 files, dropped unneccessary level of indirection 2020-06-27 13:33:17 +02:00
Peter Keresztes Schmidt
bab5fd87a3 Core/Misc: Replace Trinity::make_unique with std (#24869) 2020-06-23 08:54:12 +02:00
Shauren
eba31dea27 Core/Maps: Improvements to terrain swap handling
* Fixed memory leak when unloading grids
* Handle child maps being entered
* Allow chaining more child maps (Draenor -> Tanaan Jungle -> Tanaan Jungle - No Hubs Phase)
2020-05-24 22:34:25 +02:00
ariel-
7dcc185a15 Core/Instance: stop updating the instance resettimes based on creature respawns
- Rather update normal instance reset time to 2 hours after last creature kill
- This fixes yet another integer overflow due to the possibility of having time_t max showing up
- Also change respawntime and resettime fields to bigint on respawn/instance related tables
- Start using prepared statements on the InstanceSaveMgr

(cherry picked from commit 4c593f12ca)
2020-04-27 12:25:52 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
0a2d9ad2f7 Core/Items: Add ItemContext param to Item::Create function 2019-11-23 00:03:42 +01:00
Shauren
f6e2b8cdc1 Core/DBLayer: Prevent committing transactions started on a different database 2019-07-27 10:52:33 +02:00
Shauren
e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +02:00
xinef1
4f65dc5e20 Core/Misc: Various crash fixes (#19059)
* Replaced some FindPlayer calls with GetPlayer
Fixed some more crashes

* Correction

(cherrypicked from 14dfc377b4)
2019-07-21 21:06:54 +02:00
xinef1
b485f3e673 Few small optimizations here and there (#18684)
Changes list:
- Added CharacterGuidByNameContainer which contains name -> guid unordered map (updated along CharacterInfo)
- Extended CharacterInfo structure with GuildId
- Extended CharacterInfo structure with ArenaTeamId[3], for all possible teams (2v2, 3v3, 5v5)
- Removed CHAR_SEL_GUID_BY_NAME and CHAR_SEL_CHAR_GUID_BY_NAME synchronous queries, name -> guid can be now retrieved in World::GetCharacterGuidByName
- Removed CHAR_SEL_GUID_RACE_ACC_BY_NAME synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_CHAR_LEVEL synchronous query, level can be retrieved by guid
- Changed CHAR_SEL_CHARACTER_ACTIONS_SPEC to asynchronous query, action bars are now loaded asynchronously
- Removed CHAR_SEL_CHARACTER_NAME_CLASS synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_PLAYER_ARENA_TEAMS and CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID synchronous queries, arena teams are now stored in CharacterInfo
- Replaced synchronous db calls with CharacterInfo lookups
- Removed ObjectMgr::GetPlayerGUIDByName, as it used db query
- Replaced some unnecessary UpdateObjectVisibility() calls because they were either duplicated (called few lines above in other function) or it is enough to call DestroyForNearbyPlayers because object is being removed or should be invisible and DestroyForNearbyPlayers is faster
- Corrected typo in Player::DestroyForPlayer, only items in slots 0 to EQUIPMENT_SLOT_END are sent to other players
- Renamed Player::GetGuildIdFromDB to Player::GetGuildIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetArenaTeamIdFromDB to Player::GetArenaTeamIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetLevelFromDB to Player::GetLevelFromCharacterInfo and changed the function to use CharacterInfo structure
- Removed GameEventMgr::_questToEventLinks and associated functions, eventId is now stored in Quest class under _eventIdForQuest variable
- Changed some functions checking quest status to use other functions for quest status check instead of duplicating code
- Removed callback from add friend, because we can get the guid from appropriate storage, no need to make db query
- Removed callback from add ignore, because we can get the guid from appropriate storage, no need to make db query
- Added callback to unwrap wrapped items asynchronously
- Removed synchronous select in tutorials to check if we have any entries in db, if any entry exists in db, m_TutorialsChanged variable will have TUTORIALS_FLAG_LOADED_FROM_DB flag added and it is no longer necessary to query database

(cherrypicked from b955456008)
2019-07-21 21:06:54 +02:00
Shauren
48cc6f384d Core/Maps: Adjusted WorldObject::GetGridActivationRange() to never be less than map visibility distance for active objects to ensure equal ranges for activation/deactivation of grids
Updates #19072

(cherrypicked from 74bb92a582)
2019-06-15 18:41:09 +02:00
Shauren
455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
217a9bb34d Core/Vmaps: Changed error message when loading outdated vmaps
Closes #18431
Closes #18857

(cherry-picked from c90882ed6e)
2018-12-09 14:18:42 +01:00
HelloKitty
46c69df3a7 Core/Vmaps: Stop M2s from occluding for spellcast LoS
Closes #18528

(cherry-picked from 01d715eaef)
2018-12-09 14:18:42 +01:00
Shauren
738f37d3cf Core/Maps: Replaced spawnmask with difficulty list 2018-09-15 17:55:26 +02:00
Traesh
a8a071e9d9 Core/AreaTrigger: handle AREATRIGGER_FLAG_HAS_CIRCULAR_MOVEMENT (#21778) 2018-08-05 18:57:35 +02:00
Shauren
b773d9997b Core/Maps: Fixed loading vmaps and mmaps in instances 2018-05-06 00:39:13 +02:00
Shauren
2c64bb97e6 Tools:
* mapextractor - fixed fatigue in Thousand Needles
* mapextractor - fixed compressing liquid data
* vmapextractor - fixed extracting liquids inside WMOs
* vmapextractor - implemented new WMO flags
* vmapextractor - store model type for gameobject models
* mmap_generator - fixed processing liquids broken in e5d23103f3
2018-04-07 21:56:19 +02:00
Shauren
f31d907112 Core/Maps: Fixed map min height calculation 2018-03-31 17:09:47 +02:00
Shauren
198828dad6 Core/Maps: Fixed child/parent map crash in garrison maps 2018-03-29 20:48:18 +02:00
Shauren
42f9deb21e 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
2018-03-28 22:01:22 +02:00
Shauren
8f53ba3854 Core/Phasing: Rewrite GetTerrainMapId 2018-03-25 19:28:36 +03:00
Shauren
3743d04201 Core/MMaps: Implemented loading phased tiles
Closes #16909
2018-03-25 19:28:36 +03:00
Shauren
be0f2c297c Core/Maps: Implemented loading swapped maps 2018-03-25 19:28:36 +03:00
Shauren
bea7faa8f9 Core/Entities: Take terrain swaps into account when calculating LoS/height/area 2018-03-25 19:28:36 +03:00
Shauren
91be2332e2 Core/Entities: Phasing rewrite
* Optimized phase visibility checking
* Handle all phase flags

Closes #16758
Closes #21119
2018-03-25 19:28:36 +03:00
Shauren
007b5a68c5 Core/DataStores: Fixed db2 structures after 7.3.5 2018-03-12 23:11:49 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
6eb9973947 Core/Weather: Fixed weather updates to be thread safe 2017-09-14 22:33:40 +02:00
roc13x
503a382804 Core/Instances: Fix loading entrance location 2017-08-21 09:05:01 +02:00