Commit Graph

116 Commits

Author SHA1 Message Date
Francesco Borzì
cb7e28df05 refactor(src/server/game/*): remove unused imports (big part 1) (#20310) 2024-10-27 10:25:40 +01:00
Benjamin Jackson
1edac37ac3 refactor(Core): Make more use of helpers. (#19835)
* Init.

* Reword.

* Update codestyle script.

Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Add gameobject type ID check, reorder checks.

* Add helper/codestyle check for unit type.

* `IsUnit()` -> `IsCreature()`

* Add `IsUnit()` method.

* Use type mask.

https: //github.com/TrinityCore/TrinityCore/commit/cc71da35b5dc74abf71f8691161525a23d870bb5
Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com>

* Replace instances of `isType` with `IsUnit`.

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
2024-09-03 14:41:31 -03:00
Grimdhex
643362d697 refactor(Core/Object): adds consistency in the use of type object check (#19671) 2024-08-25 09:57:37 -03:00
sudlud
60be029e4c fix(Core/Scripting): fix OnBeforeCreateInstanceScript hook (#19252)
- to me this hook should obviously provide an option to overwrite
  the InstanceScript pointer
- this is e.g. beeing used by mod-eluna (but currently broken)
2024-07-03 14:54:45 -03:00
Kitzunu
f96d4c8670 Revert "Add (core\db): Support for Homebind Orientation (#13389)" (#19257)
* Revert "Add (core\db): Support for Homebind Orientation (#13389)"

This reverts commit 2e6f6e26da.

 Changes to be committed:
	modified:   src/server/database/Database/Implementation/CharacterDatabase.cpp
	modified:   src/server/game/DungeonFinding/LFGScripts.cpp
	modified:   src/server/game/Entities/Player/Player.cpp
	modified:   src/server/game/Entities/Player/Player.h
	modified:   src/server/game/Entities/Player/PlayerStorage.cpp
	modified:   src/server/game/Entities/Player/PlayerUpdates.cpp
	modified:   src/server/game/Handlers/CharacterHandler.cpp
	modified:   src/server/game/Handlers/MiscHandler.cpp
	modified:   src/server/game/Handlers/MovementHandler.cpp
	modified:   src/server/game/Maps/Map.cpp
	modified:   src/server/game/Spells/Spell.cpp
	modified:   src/server/scripts/Commands/cs_misc.cpp
	modified:   src/server/scripts/Commands/cs_tele.cpp
	modified:   src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp

 Untracked files:
	data/sql/updates/pending_db_world/rev_1719945200692175000.sql

* Revert "Add (core\db): Support for Homebind Orientation (#13389)"

* whoops
2024-07-02 22:02:15 +02:00
Walter Pagani
715b290cb7 feat(Map): Add open world LOS settings (#18816)
* chore. Add open world LOS settings

* Name change and conditional deny

* modify information in worldserver.conf.dist

* Remove pvp from variables and constants
2024-05-04 12:10:24 -03:00
sudlud
ab7405f94e fix(Core/Map): remove hackfix that blocked update of GOs beeing set active (#18812)
- this just broke the whole purpose of setActive(true) if the
  gameobjects is still not really beeing set active afterwards
- GetGridActivationRange() returns 0.0f for gameobjects anyways
- so CalculateCellArea() will result in the minimal cell area
  around the gameobject's position
- if the cell around the gameobject should not be updated, the
  gameobject should not have been set active in the first place
2024-04-30 06:56:17 -03:00
Anton Popovichenko
73340b94e3 feat(Core/Compression): Move packets compression from map to network thread (#18602)
* feat(Code/Compression): Move packets compression from map to network thread.

* Code style fix

* Remove unicode letter
2024-03-28 08:57:29 -03:00
Andrew
a11434b24f refactor(Core/GameObject): Move the GameObject state save handling to… (#18080)
* refactor(Core/GameObject): Move the GameObject state save handling to instance level

* Update GameObject.h

* remove leftover

* small improvements
2024-01-01 01:51:33 -03:00
Andrew
e3a7613f56 fix(Core/Creature): Move DespawnOnEvade() respawn handling to map level (#17806) 2023-11-20 12:18:48 -03:00
Kitzunu
bbadc32bea Revert Visibility Notifier changes (#17682)
* Revert "fix(Core/Grid): Implement missing GridUnload setting (#17569)"

This reverts commit 79b39f9655.

* Revert "fix(Core/Grid): Address bugs and performance issues introduced by visibility notifier implementation (#17480)"

This reverts commit 60e27511c5.

* Revert "fix(Core): GridCleanUpDelay Log (#17436)"

This reverts commit 90b16ca065.

* Revert "feat(Core/Grids): Implement visibility notifier (#15919)"

This reverts commit 2779833768.
2023-11-12 00:48:49 +01:00
AG
79b39f9655 fix(Core/Grid): Implement missing GridUnload setting (#17569)
* Implement GridUnload setting

* Minor fixes

- Use GetOption instead of deprecated GetBoolDefault.
- Added a missing check for instances in LoadMap
- Replaced some numbers with global defines

* Possible crashfix + minor improvements

- Initialized initialOrientation which I had forgotten (likely cause of crash)
- Readded a previous check in UpdateSplineMovement
- Made i_objectsToRemove and i_worldObjects tos sets as they were previously, instead of unordered_set.

* Update worldserver.conf.dist

* Fix high CPU usage with preload grid enabled.

This should be it.
2023-10-26 19:32:15 -03:00
AG
60e27511c5 fix(Core/Grid): Address bugs and performance issues introduced by visibility notifier implementation (#17480)
* Bug fixes

- Corrected std::chrono from seconds to milliseconds
- Got rid of leftover code that caused objects to not show up on time

* Removed logic to set gameobject as active

- More alignement with TC.
- Reduces CPU usage drastically

* Revert back to using time_t instead of std chrono

* Invoke SetNoCreate() method to reduce CPU usage drastically

* Remove setActive from static and motion transports

* Fix performance issues

* Added SetFarVisible to WG and some dungeon scripts

- Also removed setActive(true) from creatures in Wintergrasp. As for gameobjects they are set to active upon being damaged/destroyed and removed from active on rebuild (reset)

* Removed comments related to VISIBILITY_COMPENSATION

* Fix log

* Deleted unused files + corrected a check

* Added missing header

* Removed unused parameter

* Removed another unsued parameter

* Changed vector to set for i_visibleNow

- Changed vector to set for i_visibleNow in VisibleNotifer
- Adjusted HaveAtClient to accept Object*
- Adjusted SendUpdateToPlayer to send createobject packet only if not known to client
2023-10-23 05:37:11 -03:00
AG
2779833768 feat(Core/Grids): Implement visibility notifier (#15919)
* Cherry-picked from TrinityCore (unable to find author)
2023-09-28 22:28:28 +02:00
Anton Popovichenko
52d07bbfae fix(Core/InstanceMap): Stop using deleted player in RemovePlayerFromMap (#17069) 2023-09-05 06:36:34 -03:00
Francesco Borzì
5d01b700fd refactor(Core): remove unused imports (#17094) 2023-08-28 13:39:43 +02:00
天鹿
df77b5f4f7 chore(core): cleanup code p3 (#16073)
* Update MMapMgr.cpp

* Update UpdateFetcher.cpp

* Update AuctionHouseMgr.cpp

* Update AuctionHouseMgr.h

* Update BattlegroundAV.cpp

* Update ChannelMgr.cpp

* Update ThreatMgr.h

* Update Player.h

* Update PlayerSettings.cpp

* Update ObjectMgr.cpp

* Update Guild.cpp

* Update Guild.h

* Update Map.cpp

* Update World.cpp

* Update boss_nefarian.cpp

* Update boss_prince_malchezaar.cpp

* Update boss_venoxis.cpp

* Update zone_elwynn_forest.cpp

* Update zulfarrak.cpp

* Update boss_novos.cpp
2023-04-24 08:13:07 -03:00
Kitzunu
a0c51a45fb fix(Core/Player): Send player's own auras before all visible objects (#15445)
* fix(Core/Player): Send player's own auras before all visible objects

* cherry-pick commit (c6cd272505)

Co-Authored-By: Mikhail Redko <13364438+r4d1sh@users.noreply.github.com>

* Update Map.cpp

* Update src/server/game/Entities/Player/Player.cpp

* Update src/server/game/Entities/Player/Player.cpp

* Update src/server/game/Maps/Map.cpp

---------

Co-authored-by: Mikhail Redko <13364438+r4d1sh@users.noreply.github.com>
2023-04-02 15:30:26 -03:00
UltraNix
131e69d691 fix(Core/Maps): Increased visibility distance inside Ahn'Qiraj Temple… (#14271) 2023-01-28 11:01:30 +01:00
M'Dic
2e6f6e26da Add (core\db): Support for Homebind Orientation (#13389)
Add (core\db) Support for Homebind Orientation
2022-10-12 14:39:02 -04:00
UltraNix
caf310f4ab fix(Core/Maps): Fixed getting liquid data near depths. (#12814) 2022-09-06 15:22:58 -03:00
Maelthyr
d0d1671745 feat(Core/Debug): GetDebugInfo implementation (#12705)
Cherry-pick: 9a924fb9d5

Co-authored-by: jackpoz <giacomopoz@gmail.com>

Co-authored-by: jackpoz <giacomopoz@gmail.com>
2022-08-15 09:43:41 -03:00
ZhengPeiRu21
631686be7e fix(Core): Instance Reset Exploit Fix (#12459)
* fix(Core): Fix Instance Reset Exploit

* Whitespace fix

* Remove unnecessary include

* Check player instance save IDs when adding to map

* Only compare playerBind during login
2022-07-24 14:37:42 -03:00
UltraNix
39c0f1a700 feat(Core/Players): Enabled resurrecting players from opposite factio… (#12012)
* feat(Core/Players): Enabled resurrecting players from opposite faction in crossfactioned raids.

Fixes #8600

* Update
2022-06-18 13:49:35 -04:00
Skjalf
b658ba582e feat(Core/Map): Allow disabling the blizzlike PvP line of sight checks (#11692) 2022-05-11 13:06:56 -03:00
UltraNix
0d4adf5a3e fix(Core/Spells): Blink. (#11663)
* fix(Core/Spells): Blink.

Fixes #6427
Fixes #7571

* Update.
2022-05-10 22:37:53 +02:00
IntelligentQuantum
a31a30566e feat(Tools/Mapextractor): Implemented liquid object detection (#11402)
* .

* .

* .

* .

* .

* .

* .

* Delete Utils.cpp
2022-05-08 23:38:22 +02:00
acidmanifesto
cc6528ad7b Fix (core) water level and ground level correction (#11552)
We do not need to excessively have ground level be -2 below the player when underwater. ground level is ground level. no need for a lower adjustment. Most likely left over from from when the shallow water calculations was wrong entirely that lead to false hits with water walking detection due to core side calculations.
2022-05-01 08:44:03 -04:00
IntelligentQuantum
090cc5e2c6 fix(Tools/Mapextractor): Fix water height redundancy algorithm ignoring "no water" (#10947) 2022-04-24 15:14:20 -03:00
acidmanifesto
ad520391d0 fix (core): Water Calculation Corrections (#11516) 2022-04-24 09:58:22 -04:00
Kitzunu
1501445b0a chore(Core/Misc): nullptr cleanup (#11467) 2022-04-21 19:17:20 +02:00
acidmanifesto
c283883aea fix (core): Shallow Water Calulation Correction (#11419)
Shallow water calculation (in water and water walking value) is in correct and were matching. not right at all. this corrects the issue.
2022-04-16 16:38:57 -04:00
UltraNix
47790c9714 fix(Core/Vmaps): Stop M2s from occluding for spellcast LoS. Original autho… (#11341)
* Core/Vmaps: Stop M2s from occluding for spellcast LoS. Original authors: @Shauren & @HelloKitty

Fixes #11293

* buildfix.

Co-Authored-By: HelloKitty <5829095+HelloKitty@users.noreply.github.com>
2022-04-10 09:24:35 -03:00
IntelligentQuantum
cc5f26db7f feat(Core/Vmaps): Changed error message when loading outdated vmaps (#10490) 2022-04-01 06:56:04 -03:00
UltraNix
3c9e8d4eb1 fix(Core): Crash related to reset instances (#11003) 2022-03-18 19:32:28 -03:00
acidmanifesto
69e2f2e3aa fix/feat: (Core/PacketIO): updated sound and creature addon (#10813)
* fix\feat: (Core/PacketIO): updated sound and creature addon

updated SMSG_PLAY_SOUND, SMSG_PLAY_MUSIC and SMSG_PLAY_OBJECT_SOUND via tc cherry pick
https://github.com/TrinityCore/TrinityCore/pull/2363 and 0f1f7ef401 by @joschiwald  and @ForesterDev
This so far a attempt to align atleast with sound with tc, and correct a potentional issue of hearing creature sounds that is not in visible range. I notice PlaySound was being defined in some weird dependency as it isnt with tc so I renamed it to Playsound. Notice a isLarge still being used in the creature addon when it was depreciated, so i removed that a that seem to of interfered with visibilitydistanceType.

Co-Authored-By: joschiwald <736792+joschiwald@users.noreply.github.com>
Co-Authored-By: ForesterDev <11771800+ForesterDev@users.noreply.github.com>
2022-02-26 10:05:58 -05:00
Kitzunu
455899dc75 fix(Core/Misc): Change const to be after type name (#10591) 2022-02-14 16:05:45 -03:00
Kargatum
de13bf426e feat(Core/DBLayer): replace char const* to std::string_view (#10211)
* feat(Core/DBLayer): replace `char const*` to `std::string_view`

* CString

* 1

* chore(Core/Misc): code cleanup

* cl

* db fix

* fmt style sql

* to fmt

* py

* del old

* 1

* 2

* 3

* 1

* 1
2022-02-05 00:37:11 +01:00
Nefertumm
aa6ecec2ab feat(Core/Map): add DoForAllPlayers method (#10371) 2022-02-04 18:54:29 +01:00
Kargatum
5969df4e30 refactor(Core/Logging): switch to fmt style for LOG_ (#10366)
* feat(Core/Common): add support fmt style for ASSERT and ABORT

* correct CheckCompactArrayMaskOverflow

* 1

* Update src/server/game/Spells/Spell.cpp

* rework logging

* add fmt replace logs

* logging

* FMT_LOG_

* settings

* fix startup

* 1

* 2

* 3

* 4

* 5

* fmt::print

* to fmt
2022-01-27 16:44:41 +01:00
Kargatum
8b7df23f06 feat(Core/Time): Implement saparated manager for game time (#8630) 2022-01-24 17:55:00 +07:00
Kitzunu
d1cc65b1c7 refactor(Core/Misc): isEmpty to IsEmpty (#10011) 2022-01-13 21:43:15 -05:00
acidmanifesto
4330e44ad0 fix (Core/CodeReduction) TC_ removal (#10162)
TC_ remove from any commit out TC_LOG in the event when we do need to run debug logging, we can just remove the // instead of // TC_
2022-01-13 14:39:54 -05:00
IntelligentQuantum
fb249836e9 Core\Packet\Misc: Weather (#9648) 2022-01-04 13:52:13 -05:00
Kitzunu
913e65f97f refactor(Core/Misc): fabs() to std::fabs() (#9790)
- prefer std functions over C functions
2021-12-31 20:41:00 -03:00
Kargatum
51adbffae4 feat(Core/Modules): add separated lib for modules (#9281) 2021-12-02 20:28:58 +07:00
acidmanifesto
29f49108a5 chore(Core): Remove unnecessary slang Cosmetic (#9325)
* Remove unnecessary slang

Removes ZOMG! that is used in the src in logging and notes. Completely Unnecessary. Contributes to nothing useful. Inflates source. Not needed at all in any shape or form. Not Developer Lingo either.

* Further Clean Up

Removed Profanity

* sensible grammar correction

* More ZOMG! removal
2021-11-25 04:31:54 -03:00
Petric
11373cd78a fix(Core/Shutdown): add checks to see if MapUpdater threads are joineable (#7450) 2021-11-24 11:41:49 +01:00
Kargatum
f62664c987 refactor(Core/Misc): headers cleanup (#9259) 2021-11-22 17:24:39 +07:00
Nefertumm
2f2569d09a fix(Core/Map): encounters list for heroic difficulties (#8224) 2021-11-02 12:37:13 -03:00