Commit Graph

142 Commits

Author SHA1 Message Date
jackpoz
a01d397c3d Core/Misc: Fix static analysis issues
Fix static analysis issues reported by 3rd party tools

(cherry picked from commit 24e82fe83d)
2021-02-25 18:50:55 +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
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Treeston
f7a7d02a7f Pet/Guardian AI hook re-organizing (#19824)
* Pet/Guardian AI hook re-organizing:
- Adjust OwnerAttacked/OwnerAttackedBy hooks on CreatureAI to fire for all owned units, not just player pets. This should allow guardians to more reliably recognize valid targets.
- Kill off the AttackedBy hook. While it was defined in CreatureAI.h as virtual, it was only ever invoked for player pets in specific situations. This makes it classic developer bait.
  - Adjust PetAI to use DamageTaken instead of AttackedBy.
  - Adjust behavior of AttackStart on PetAI to compensate.

(cherry picked from commit 1660bb7d27)
2020-07-16 21:47:28 +02:00
Shauren
c7306439e7 Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower 2020-06-12 01:29:18 +02:00
Shauren
4d69cc1c56 Core/Misc: GCC build and warning fixes 2020-05-21 22:15:58 +02:00
ccrs
104e745edf Core/Misc: cleanup SetInFront uses
Set in front modifies only the serverside orientation, use with care.
Also check for current focus to prevent things like incorrect damage on casting creatures (ie dragon breath direction change in your face because of some taunt missclick)

(cherry picked from commit 229444b74a)
2020-04-28 17:51:25 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +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
d1cbd8a837 Core/Pets: Fixed flashing pet attack button (#18906)
(cherrypicked from 0fa38d0ae0)
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
xinef1
0a2876c091 Core/Pets: Fixed exploit where warlock can abandon its pet to generate new name (#18606)
(cherry-picked from 8ce5712552)
2018-12-09 14:18:42 +01:00
Brecky
06520a322b Delete double include #include "PetPackets.h" 2018-03-01 08:19:52 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
b453e12423 Core/Game: Include cleanup part 5
* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
2017-06-04 01:00:45 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
Shauren
a12a34b1dc Core/Game: Include cleanup - removed G3D classes from packets
* Use our own Position class instead, with the coords written to packets being part of type
2017-05-16 22:16:21 +02:00
Aokromes
0ff577853e Core/Logs: Fine tune more logs
And move others to more logical appenders
(cherry picked from commit b65d26b5b4)

# Conflicts:
#	src/server/game/Handlers/PetHandler.cpp
2017-02-11 22:42:34 +01:00
Aokromes
a5f21b4c62 Core/Misc: Coding standard (#17521)
(cherry picked from commit a832865ce2)

# Conflicts:
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Spells/Spell.cpp
2017-02-05 00:00:38 +01:00
joschiwald
0f432edc4b Fixed build
Closes #18816
2017-01-13 18:54:15 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren
ac1dc758b9 Core/Units: Cleanup hardcoded magic numbers for byte field offsets 2016-12-13 20:58:22 +01:00
Shauren
d2733eb6f1 Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into legion 2016-06-13 21:00:25 +02:00
Shauren
8396dabdad Core/Misc: Fixed coverity issues
Uninitialized fields: CID 1354593, 1354595, 1354738
Unchecked return value: CID 1354558
Out of bounds access: CID 1352989, 1352993
Null pointer dereference: CID 1296286
2016-06-06 09:16:59 +02:00
Shauren
6b1c85a676 Core/PacketIO: Updated spell packets 2016-06-05 14:08:53 +02:00
Warpten
12f029d442 Core/PacketIO: Implemented new Cast HighGuid type and fix some mistakes with SMSG_MOVE_UPDATE_APPLY_MOVEMENT_FORCE
Core/Updatefields: Health is now stored as an unsigned long int.
2016-06-03 09:27:27 +02:00
myran2
bc1a81747a Core/Pets: Implemented pet specializations (#17058)
* Use prepared statements in Pet::SavePetToDB
* Add support for resetting all of a player's pet specializations
* Send one big spell unlearn/learn packet instead of lots of small ones
* Implemented Adaptation talent
2016-05-26 17:20:01 +02:00
DDuarte
67b977c86a Merge branch 'pets' of https://github.com/myran2/TrinityCore into myran2-pets
# Conflicts:
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Handlers/SpellHandler.cpp
#	src/server/game/Server/Packets/PetPackets.cpp
#	src/server/game/Server/Packets/PetPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/WorldSession.h
2016-03-02 01:38:39 +00:00
Carbenium
46addc21cd Core/PacketIO: Updated and enabled CMSG_REQUEST_PVP_REWARDS 2016-02-02 18:30:34 +01:00
Carbenium
fd162fb604 Core/PacketIO: Add CMSG_REQUEST_PET_INFO packet class for further usage 2016-02-02 18:04:36 +01:00
Carbenium
1f8268c89c Core/PacketIO: Updated and enabled CMSG_PET_SPELL_AUTOCAST 2016-02-02 16:38:36 +01:00
Carbenium
dea718e4ed Core/PacketIO: Updated and enabled CMSG_PET_STOP_ATTACK 2016-02-02 01:56:51 +01:00
Carbenium
0b76381283 Core/PacketIO: Updated and enabled CMSG_PET_ABANDON 2016-02-02 01:18:27 +01:00
Carbenium
6fbfc61de1 Core/PacketIO: Updated and enabled CMSG_DISMISS_CRITTER 2016-02-01 20:14:10 +01:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
jackpoz
4700b24263 Core/Misc: Remove unneeded ToCreature() casts
Remove some ToCreature() casts not needed anymore after 1ee90e1022 changes that moved IsPet(), IsTotem(), IsSummon(), IsGuardian(), IsHunterPet() and IsVehicle() from Creature to Unit

(cherry picked from commit ea4d9c0d9e)

Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/scripts/Spells/spell_pet.cpp
2015-09-24 22:06:05 +02:00
jackpoz
cacf184822 Core/Misc: Remove unneeded ToCreature() casts
Remove some ToCreature() casts not needed anymore after 1ee90e1022 changes that moved IsPet() from Creature to Unit

(cherry picked from commit d243630acf)

Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Spells/Spell.cpp
	src/server/game/Spells/SpellEffects.cpp
2015-09-24 21:04:46 +02:00
Shauren
f45ae7af43 Core/PacketIO: Updated spell packets 2015-07-18 00:45:21 +02:00
Vincent-Michael
d418ae54a4 Core: White space CleanUp 2015-07-05 04:03:36 +02:00
et65
c6ab951025 Core/PacketsIO: Implemented or updated most of party related packets.
Packets updated or implemented :
- SMSG_INSTANCE_INFO : updated

- CMSG_SAVE_CUF_PROFILES : updated
- SMSG_LOAD_CUF_PROFILES : updated

- SMSG_PARTY_COMMAND_RESULT : updated

- CMSG_PARTY_INVITE : updated
- SMSG_PARTY_INVITE : updated
- CMSG_PARTY_INVITE_RESPONSE : updated
- CMSG_PARTY_UNINVITE : updated
- SMSG_GROUP_UNINVITE : updated
- CMSG_LEAVE_GROUP : updated
- SMSG_GROUP_DECLINE : updated

- SMSG_GROUP_DESTROYED : updated

- CMSG_MINIMAP_PING : updated
- SMSG_MINIMAP_PING : updated

- CMSG_CONVERT_RAID : updated
- CMSG_SET_EVERYONE_IS_ASSISTANT

- CMSG_DO_READY_CHECK : updated
- CMSG_READY_CHECK_RESPONSE : updated
- SMSG_READY_CHECK_COMPLETED : updated
- SMSG_READY_CHECK_RESPONSE : updated
- SMSG_READY_CHECK_STARTED : updated

- CMSG_REQUEST_PARTY_JOIN_UPDATES : implemented (source : sniffs)
- CMSG_REQUEST_PARTY_MEMBER_STATE : updated
- SMSG_PARTY_MEMBER_STATE : updated
- SMSG_PARTY_UPDATE : updated

- CMSG_REQUEST_RAID_INFO : updated

- CMSG_INITIATE_ROLE_POLL : updated
- SMSG_ROLE_POLL_INFORM : updated
- CMSG_SET_ROLE : updated
- SMSG_ROLE_CHANGED_INFORM : updated

- CMSG_CHANGE_SUB_GROUP : updated
- CMSG_SWAP_SUB_GROUPS : implemented

- CMSG_SET_ASSISTANT_LEADER : updated
- CMSG_SET_PARTY_LEADER : updated
- SMSG_GROUP_NEW_LEADER : updated

- CMSG_CLEAR_RAID_MARKER : implemented
- SMSG_RAID_MARKERS_CHANGED : implemented

- CMSG_UPDATE_RAID_TARGET : updated
- SMSG_SEND_RAID_TARGET_UPDATE_ALL : updated
- SMSG_SEND_RAID_TARGET_UPDATE_SINGLE : updated

- CMSG_OPT_OUT_OF_LOOT : updated
- CMSG_SET_LOOT_METHOD : updated

About group update flags:
- Not sure they are use for now.
- Pets now have their group update flags.
- Pets'power is no send to client anymore.
- Changes about them are inspired from SMSG_PARTY_MEMBER_STATS parsing of WowPacketParser, but it seems this packet is not use anymore.

CHAT_MSG_RAID has been fixed.

About Ready check:
- Correctly implemented this function.
- An update function has been added to Group class, and to GroupMgr class in order to manage the ready check expiration (when 35 seconds were gone, players who have not answered must be reported as AFK)

About Raid markers:
- Old spell effect SPELL_EFFECT_SUMMON_OBJECT_SLOT3 has been renamed to SPELL_EFFECT_CHANGE_RAID_MARKER and implemented. I'm sure about that because raid markers spells are the only spells that have this effect type.

Source: WowPacketParser, and sniffs from official.
2015-05-19 13:10:29 +02:00
Shauren
ca83e14f8b Core/Entities: Reworked guid scopes
* Added ObjectGuid traits to easily access whether guid type can be generated globally (ObjectMgr) or not
* This adds separate (per map) guid sequences depending on object type
* Ported map object container from cmangos/mangos-wotlk@a2d396eb0b
* 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
2015-04-28 21:19:46 +02:00
Shauren
7e5df6d504 Core/Logging: Removed a bunch of useless "received X" logs 2015-04-21 21:26:15 +02:00
Vincent-Michael
94215132c1 Core/PacketIO: Updated and enabled SMSG_CHAT_PLAYER_NOTFOUND for WoD 2015-04-18 20:29:07 +02:00
Vincent-Michael
ee057d3a8d Core/PacketIO: Updated and enabled CMSG_QUERY_PET_NAME / SMSG_QUERY_PET_NAME_RESPONSE for WoD 2015-04-18 19:17:48 +02:00
Shauren
8cfb542ee4 Core/PacketIO: Updated values of all known server opcodes 2015-03-27 22:21:24 +01:00
Shauren
cc4d79495f Core/Misc: Warning fixes 2015-03-22 13:47:55 +01:00
click
b05caa738a Core/Log: Move a few PetHandler INFO-notifications over to DEBUG-level
(cherry picked from commit cffef1e80d)

Conflicts:
	src/server/game/Handlers/PetHandler.cpp
2015-02-22 06:18:55 +00:00
Shauren
56186319bd Core/Spells: Cooldown updates
* Refactored cooldown handling to separate class shared by creatures and players
* Updated and enabled cooldown packets
* Implemented creature school lockouts
* Implemented spell charges
* Fixed AuraUpdate structure
* Fixed aura flag AFLAG_NOCASTER handling
* Implemented spell charge related auras
2015-02-17 01:01:44 +01:00