Commit Graph

307 Commits

Author SHA1 Message Date
Shauren
d6201e5dbb Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50
(cherry picked from commit 9299e9bde0)
2017-06-19 13:16:13 -03:00
treeston
d57307f63d 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.
2017-06-10 15:08:35 +02:00
Golrag
a2c123b529 Core/Maps: Corrected GetWaterOrGroundLevel (#19863)
* When a gameobject was above water like in ToC. It would return water level
2017-06-08 19:25:26 +02:00
Treeston
f6c849729b [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
2017-06-08 00:25:06 +02:00
ariel-
4c593f12ca 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
2017-04-12 02:19:55 -03:00
Shauren
74bb92a582 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
2017-02-08 20:23:37 +01:00
xinef1
14dfc377b4 Core/Misc: Various crash fixes (#19059)
* Replaced some FindPlayer calls with GetPlayer
Fixed some more crashes

* Correction
2017-02-05 23:42:31 +01:00
xinef1
b955456008 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
2017-01-28 01:00:28 -03:00
Shauren
c90882ed6e Core/Vmaps: Changed error message when loading outdated vmaps
Closes #18431
Closes #18857
2017-01-22 12:06:02 +01:00
HelloKitty
01d715eaef Core/Vmaps: Stop M2s from occluding for spellcast LoS
Closes #18528
2017-01-21 14:44:31 +01:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00
treeston
820e843391 Map/InstanceMap: Ease up on a somewhat overzealous error message regarding instance saves. 2016-09-21 15:36:21 +02:00
Treeston
cf628880d5 Map/Instances: Greatly simplify PermBindAllPlayers logic. (#17940) 2016-09-16 13:09:16 +02:00
Aokromes
fad58ad099 Core/Misc: Even better description for logs 2016-07-02 22:31:11 +02:00
Aokromes
bd7dc87b02 Core/Misc: Even better description for a log 2016-06-22 14:32:48 +02:00
Aokromes
54d4769d4b Core/Misc: Better description for a log 2016-06-22 14:24:11 +02:00
jackpoz
1347d7cf7a Core/VMaps: Fix some vmap height edge cases
Fix Map::GetWaterOrGroundLevel() checking dynamic object only in phase 1 instead of current Unit phase.
Improve DynamicMapTree::getHeight() dynamic object check by casting the ray at +0.5f from the passed Z coordinate, this value will be tuned to improve even more the results.
2016-06-04 15:01:39 +02:00
Treeston
9ad952c3bc Merge pull request #16736 from r00ty-tc/map_height
Solve many of the creature falling through floor issues.
2016-04-16 10:43:57 +02:00
r00ty-tc
87b4533046 [Core/Maps] Activate creatures and objects during opening cinematics and other flyby
cameras (sunwell etc).

Requires re-running map extractor to extract camera m2 files from data
files. These are very small.

Closes #4755
Closes #16772
2016-04-14 01:34:17 +02:00
Naios
131ef5f2d6 Core/Maps: Fix non PCH build 2016-04-11 23:12:23 +02:00
Naios
775e0764e8 Core/Game: Move scheduled map scripts counter methods into MapManager
* Since those have nothing to do with core scripts and are
  not wished inside the ScriptMgr

(cherry picked from commit 59e3cf82ac)
2016-04-11 21:40:38 +02:00
Naios
9f61b72679 Core/Game: Converted the game library to a shared library.
* There is still the possibility to static link against game.

(cherry picked from commit bf33159a70)
2016-03-24 02:46:42 +01:00
r00ty-tc
971f4ccab8 Core/Maps: Implement optional pre-loading of maps.
- Option to preload basemaps upon server load (BaseMapLoadAllGrids)
- Option to preload instance maps upon map load (InstanceMapLoadAllGrids)
- Change default logging to only log mmap errors to server log
- Add new public to map to load all cells in map
- change debug loadcells to use new function instead
2016-03-15 02:05:13 +01:00
ccrs
6a339ed5c9 Core/TempSummons: avoid use MoveInLineOfSight before InitSummon 2016-03-01 21:20:47 +01:00
r00ty-tc
10550fe8cf Solve many of the creature falling through floor issues.
This seems entirely wrong to discount the returned map height if we're
already below it. In many cases this is exactly why we want the height!
2016-02-26 22:02:20 +00:00
Shauren
ff45a422c5 Warning fix. 2016-02-12 20:45:09 +01:00
Shauren
fa3f106693 Core/Maps: Use map.dbc zone fallback if no area is found in grid files, not only if grid files don't exist
Closes #16583
Closes #16584

Extracting new maps is NOT needed.
2016-02-12 20:39:25 +01:00
treeston
62aff401f6 Merge branch '3.3.5-instanceextend' into 3.3.5 (PR #16392) 2016-02-10 22:23:39 +01:00
Shauren
89d8d50b2e Core/Maps: Moved min height calculation to worldserver for more precise results
Closes #16530
2016-02-10 21:25:28 +01:00
treeston
6102a7937d Maps/Instances: Implement handling of CMSG_SET_SAVED_INSTANCE_EXTEND 2016-02-10 19:35:11 +01:00
Shauren
25cdc5d980 Core/Maps: Parse MFBO adt chunk to properly handle height where player counts as falling under the map
* This fixes the height at which player is instantly killed when falling from The Frozen Throne
* Set PLAYER_FLAGS_IS_OUT_OF_BOUNDS on players under the map to enable release spirit button while still falling

Note: Extracting new maps is required
(cherry picked from commit 4f78efd463)

# Conflicts:
#	dep/PackageList.txt
#	src/server/game/DataStores/DBCStructure.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Handlers/MovementHandler.cpp
#	src/tools/map_extractor/CMakeLists.txt
#	src/tools/map_extractor/System.cpp
#	src/tools/map_extractor/adt.h
#	src/tools/map_extractor/loadlib.cpp
2016-02-09 18:44:19 +01:00
Shauren
aa432db36d Core/Maps: Changed the way area data is stored in maps, it now uses ID field from AreaTable.dbc instead AreaBit used for exploration marker (and is not unique anymore on top of simply being stupidly confusing)
Note: Extracting maps is required
(cherry picked from commit db0b8bf24e)

# Conflicts:
#	src/server/game/Achievements/AchievementMgr.cpp
#	src/server/game/Chat/Chat.cpp
#	src/server/game/Conditions/ConditionMgr.cpp
#	src/server/game/DataStores/DBCStores.cpp
#	src/server/game/DataStores/DBCStores.h
#	src/server/game/DataStores/DBCfmt.h
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Handlers/BattleGroundHandler.cpp
#	src/server/game/Handlers/MiscHandler.cpp
#	src/server/game/Maps/Map.cpp
#	src/server/game/Spells/Spell.cpp
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/scripts/Commands/cs_go.cpp
#	src/server/scripts/Commands/cs_group.cpp
#	src/server/scripts/Commands/cs_lookup.cpp
#	src/server/scripts/Commands/cs_misc.cpp
#	src/tools/map_extractor/System.cpp
#	src/tools/mmaps_generator/TerrainBuilder.cpp
2016-02-09 18:19:28 +01:00
treeston
0f0a51b87a Game/Maps: Instance handling follow-up:
- Fix a bug where a player could maintain a conflicting non-perm solo bind if they were in the instance when invited to group. Closes #16150.
- If a group is created while the leader is in an instance that nobody is bound to, the group will take over the instance and bind to it. This stops the homebind timer when reforming group after disconnects and the like.
2016-01-04 15:48:53 +01:00
Rushor
923a368ac7 Update copyright note for 2016 2016-01-01 12:02:33 +01:00
treeston
43fa7d48a5 Game/Maps: Clean up instance handling.
- Rename Map::CanEnter to Map::CannotEnter. Return value changed from boolean (true means player can enter) to enum Map::EnterState (CAN_ENTER=0 means player can enter, any other value is a reason for deny).
- Move hack-y player error messages from within Map::CanEnter to the function calling CanEnter as appropriate (primarily WorldSession::HandleAreaTriggerOpcode).
- Modify WorldSession::HandleAreaTriggerOpcode to properly revive the player upon touching the portal leading to the instance they died in even if they are currently unable to zone in. Fixes and closes #15758.
- Modify Player::LoadFromDB to properly spawn players in the instance they logged off in if possible. Fixes and closes #15561.
- Modify permanent save behavior to be blizzlike: Players can always enter an instance they are saved to (assuming there are no map constraints against it), but get a homebind timer if the instance is already in use.
2015-12-31 01:02:07 +01:00
Naios
3a3a6bbfd2 Core/Globals: Use std::string rather than char* to pass script names around.
(cherry picked from commit b7b49fe35f)

Conflicts:
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Globals/ObjectMgr.cpp
2015-11-07 13:09:10 +01:00
Shauren
910fb00130 Core/Corpses: Fixed a possible crash adding bones to grid
Closes #15808

(cherry picked from commit ec1583df67)
2015-11-06 21:30:41 +01:00
MitchesD
a968595977 Core/PacketIO: fixed instance binding of gamemasters
(cherry picked from commit 231fb1d322)
2015-10-31 17:39:17 +01:00
Shauren
8c9ea7782a Core/Corpses: Fixed a crash happening when a corpse is added to a grid that was not yet fully loaded
Closes #15684
2015-10-30 17:53:00 +01:00
Shauren
1d17475791 Core/Corpses: Fixed map crash happening during map unload when there are corpses inside 2015-10-29 18:46:37 +01:00
Shauren
20b4e6f03a Core/Corpses: Fixed leaking corpses
Closes  #15765

(cherry picked from commit bd16520ecc)
2015-10-28 21:56:40 +01:00
pete318
b1032ed620 Change many uint32 to ObjectGuid::LowType in line with 6.x changes. 2015-10-12 23:10:41 +02:00
Shauren
325336137d Core/Transports: Fixed accessing deleted instance transports
Thanks @jackpoz for valgrind log and @pete318 for reproduction steps

Closes #15633

(cherry picked from commit 8745e08be0)
2015-09-30 19:58:09 +02:00
Shauren
402a3c45ff Core/Maps: Moved corpse management to map level
(cherry picked from commit cd27fd38b9)

# Conflicts:
#	src/server/database/Database/Implementation/CharacterDatabase.cpp
#	src/server/database/Database/Implementation/CharacterDatabase.h
#	src/server/game/Entities/Corpse/Corpse.cpp
#	src/server/game/Entities/Creature/GossipDef.cpp
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Player/Player.h
#	src/server/game/Globals/ObjectAccessor.cpp
#	src/server/game/Globals/ObjectAccessor.h
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Globals/ObjectMgr.h
#	src/server/game/Grids/ObjectGridLoader.cpp
#	src/server/game/Handlers/AuctionHouseHandler.cpp
#	src/server/game/Handlers/CharacterHandler.cpp
#	src/server/game/Handlers/ChatHandler.cpp
#	src/server/game/Handlers/QueryHandler.cpp
#	src/server/game/Maps/Map.cpp
#	src/server/game/Server/Packets/CharacterPackets.cpp
#	src/server/game/World/World.cpp
#	src/server/scripts/Commands/cs_reload.cpp
2015-09-29 18:45:01 +02:00
pete318
3c188ac10e Combat with distant creatures
Iterate creatures in combat with players during map update, and also visit
their cells if greater than player visibility distance away.
2015-09-23 22:03:27 +02:00
pete318
dcb7082277 Map local guids 6.x -> 3.3.35:
Implemented:
  ca83e14f8b
  ee1c1b97be
  18e4ab6911
  bf37446b3c
  cb854a2b7b

* This adds separate (per map) guid sequences depending on object type
* Ported map object container from cmangos/mangos-wotlk@a2d396e
* Added type container visitor for TypeUnorderedMapContainer
* Implemented helper function to erase unique pairs from multimap containers
* Moved object storage of all objects except players and transports to map level
* Added containers linking database spawn id with creature/gameobject in world
* Renamed DBTableGuid to spawnId
* Added a separate spawn id sequence generator for creatures and gameobjects - this will be used in db tables
* Moved building SMSG_UPDATE_OBJECT - updatefields changes broadcast to map update
* Added new function to return but not increment guid
* Adjusted .debug loadcells to show low guid in map before/after load
* Added debug messages for creature spawn/destroy, for map guid debugging
* Store all Gameobjects and Creatures added to OutdoorPvP, so the callback script can be removed when OutdoorPvP instance is destroyed.
2015-09-22 21:33:57 +02:00
StormBytePP
7b245a0b6b Core: Added ABORT() macro to prevent the usage of ASSERT(false) as a quick hack to crash the core misusing assert 2015-09-21 15:11:06 +02:00
Naios
e011ae63d5 Core/Logging: Enable perfect forwarding for logging format and args.
* Handle timestamp parsing though cppformat.
* Change a wrong forward -> move

(cherry picked from commit 026ceb85b9)
2015-07-22 02:18:36 +02:00
jackpoz
fae8269589 Core/Instances: Fix some Instance Lock chat messages
Always send a Welcome type Instance Lock chat message when entering an instance instead of changing type based on remaining time.
Fix scheduled warning message to always send "Your instance lock for ... will expire in 0 minutes." even if there are hours left, issue added in 4193806dba , closes #11519 .
Update warning messages based on remaining time so that the most meaning is always used (6 hours left, 59 minutes left, etc).
2015-07-08 23:32:04 +02:00
Shauren
8c61e51fe5 Core/Transports: Moved teleporting transports to Map::DelayedUpdate
(cherry picked from commit 5c5cb3e555)
2015-05-19 11:12:14 +01:00