Commit Graph

401 Commits

Author SHA1 Message Date
leak
dce92611f3 Refactored singletons to enable proper deconstruction during shutdown 2014-07-20 00:40:08 +02:00
Shauren
7532864264 Buildsystem/MSVC: Warning fixes
C4800 'type' : forcing value to bool 'true' or 'false' (performance warning)
C4127 conditional expression is constant
2014-07-17 15:42:57 +02:00
Subv
151785b9ce Merge branch 'master' of github.com:TrinityCore/TrinityCore into boost
Conflicts:
	src/server/game/World/World.cpp
2014-07-03 15:57:47 -05:00
leak
029bad6698 Replaced all remaining ACE based Singletons
Replaced ACE base AutoPtr class with shared_ptr
Note: worldserver currently broken due to MapUpdater threading failure (ACE ofc, what else could it be)
2014-07-01 00:54:09 +02:00
Subv
1320c9f8d6 Core/SmartAI: Allow the use of SMART_ACTION_SET_EVENT_PHASE with SMART_EVENT_RESPAWN.
Closes #9289
2014-06-24 23:01:12 -05:00
Aokromes
84e6af26e6 Merge pull request #11976 from Ascathor/master
Core/Misc: New ability to log account IP access history
2014-06-23 22:48:35 +02:00
Vincent-Michael
53caf7959e Core/Ulduar: Added IsInCombat check for ulduar teleporter 2014-06-14 22:01:50 +02:00
Vincent-Michael
880253a833 Core/SAI: Fix typo in 2596f1f35d 2014-06-14 20:12:38 +02:00
Vincent-Michael
2596f1f35d Core/SAI: Added SMART_ACTION_CAST support for gameobject cast 2014-06-14 19:55:55 +02:00
Ascathor
6949735098 Core/Misc:
* Fix some codestyle, fix some typos

* Change CMakeLists for: Custom (can be uncommented), Events, World
** Custom is theoretically unchanged. You can, however, uncomment the glob_recurse that initializes every file within. This might be easier for beginners.

* Introducing the IP Based Action Log System:
** On several different actions, e.g. Login, Character Login, etc., a new entry is added
** Can be logged on and off in worldserver config
*** Disabled by default to prevent increased log db size for unknowing users.

* Add a new row to account table called 'last_attempt_ip'
** Lists the last ip trying to connect to the account

* Add a new type of HookScripts: AccountScript
** Includes: OnAccountLogin, OnFailedAccountLogin, OnEmailChange, OnFailedChange, OnPasswordChange, OnFailedPasswordChange

* Added new Hook to PlayerScripts: OnFailedPlayerDelete

* Added new variables to PlayerScripts: OnPlayerDelete
2014-06-13 16:25:11 +02:00
Discover-
80daaf8d43 Core/SAI: SMART_EVENT_IC_LOS is now called when movement in LOS was made while the creature was in combat 2014-05-23 17:11:37 +02:00
jackpoz
1083dbb993 Core/Misc: Remove Unit::Get* wrappers for ObjectAccessor::Get* 2014-05-20 21:21:33 +02:00
jackpoz
d36ecbf4a3 Merge pull request #12076 from Trisjdc/even_more_sai
Core/SAI: Clear UNIT_STATE_EVADE immediately if we're about to follow a target on EnterEvadeMode
2014-05-19 22:00:48 +02:00
Trisjdc
9bad26fc88 Core/SAI: Clear UNIT_STATE_EVADE immediately if we're about to follow a target on EnterEvadeMode (MoveFollow does not clear evade) 2014-05-16 19:46:02 +01:00
Trisjdc
50336af1c7 Core/SAI: Prevent nullifying damage, because of player damage requirements 2014-05-15 17:05:02 +01:00
Dehravor
cbd36d5a4e Core/Misc: Remove remaining COMPILER_HAS_CPP11_SUPPORT related macros 2014-05-01 11:19:32 +02:00
joschiwald
84bff76ba0 Core/Misc: remove some obsolete parameters 2014-04-28 20:05:36 +02:00
Kinzcool
c536305e3a Core: Droped faction_H field -- only one faction table is necessary 2014-04-27 18:13:55 -04:00
joschiwald
211d56d633 Core/BG/SA:
* replaced some trinity_string with broadcasttexts
* basic implementation of phasing in SA
* spawn some triggers in SA (fixes dest position of teleport pads)
* added text getter to broadcasttext struct
* some cleanup in destructable go event notification
2014-04-26 03:40:30 +02:00
jackpoz
2585e799f9 Core/Misc: Change how Position struct is retrieved
Update Position::GetPosition() and similar methods signatures to reflect 2a4c9bcaf9 changes by return a Position object instead of accepting a Position parameter by reference.
2014-04-25 21:19:30 +02:00
joschiwald
465e4a0b0f Core/Achievements: achievement earned message will now use broadcasttext instead of trinity_string 2014-04-23 01:14:20 +02:00
joschiwald
583039c1c5 Core/SmartScripts: use broadcasttext instead of trinity_string in SMART_ACTION_FLEE_FOR_ASSIST and SMART_ACTION_CALL_FOR_HELP 2014-04-22 19:24:47 +02:00
jackpoz
8ca6371793 Core/Misc: Ensure GetVictim() returns a valid reference when expected
Add a new method EnsureVictim() which asserts a valid not NULL reference will be returned to the caller. Use this whenever the GetVictim() would be dereferenced .
2014-04-19 21:48:22 +02:00
MitchesD
718b0e6bdd Core/SmartScripts: SMART_ACTION_EQUIP prevent to false errors 2014-04-03 19:47:27 +02:00
Vincent-Michael
bacfbdc4ee Core/Sai: Added new db errors :P (hihi) 2014-03-31 17:32:39 +02:00
Gacko
7630b3c627 SmartAI: Use same method for removing auras in EnterEvadeMode as in CreatureAI
Also fixes warnings about duplicate auras. Self-casted auras were not removed on entering evade mode in SAI as they are in CreatureAI.
2014-03-30 15:05:04 +02:00
jackpoz
8c44259fae Core/Misc: Fix some static analysis issues
Fix uninitialized values, most of which are false positives, always initialized before being accessed.
Add some asserts and additional NULL checks as sanity checks. Use SpellMgr::EnsureSpellInfo() if the spell id is valid and always supposed to return a valid not-NULL SpellInfo* .
2014-03-27 21:43:59 +01:00
Discover-
17674182c4 Core/SAI: Allow only creature sources to use the event types SMART_EVENT_DISTANCE_CREATURE and SMART_EVENT_DISTANCE_GAMEOBJECT for now. 2014-03-26 13:50:36 +01:00
Discover-
76641bc7dc Core/SAI: Only allow SMART_EVENT_TARGET_BUFFED to be used from creature sources. 2014-03-26 13:44:36 +01:00
deathicon
78e9a3eb65 Core/SAI: Implement two new event types that are triggered when a certain creature/gameobject entry or guid gets within a given distance of the source. 2014-03-26 10:23:34 +01:00
jackpoz
7a188c8685 Core/SAI: Fix assertion in SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
Fix assertion triggered in SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST if max entry is less than min entry
2014-02-09 16:09:09 +01:00
jackpoz
28946ac5db Core/SAI: Improve error log
Log both target and current Object when checking if a Creature/GameObject have SmartAI enabled.
2014-02-08 22:38:29 +01:00
jackpoz
dbed818f6f Core/SAI: Fix crash
Disable script type SMART_SCRIPT_TYPE_TIMED_ACTIONLIST actions if they are trying to overwrite the timed action list while iterating it.
This was invalidating the iterator and deleting any smart action stored in it, including the current executed one.

Valgrind log:
 Invalid read of size 1
  at SmartScript::OnUpdate(unsigned int) (SmartScript.cpp:3258)
  by SmartAI::UpdateAI(unsigned int) (SmartAI.cpp:331)
  by Creature::Update(unsigned int) (Creature.cpp:544)
 Address 0x1807d9b2 is 10 bytes after a block of size 40 alloc'd
  at operator new(unsigned long) (vg_replace_malloc.c:319)
  ...
  by SmartAIMgr::LoadSmartAIFromDB() (SmartScriptMgr.cpp:231)
  by World::SetInitialWorldSettings() (World.cpp:1724)
  by Master::Run() (Master.cpp:169)
  by main (Main.cpp:142)
2014-02-08 21:59:35 +01:00
Discover-
bebb581d2e Core/SAI: I need more sleep... 2014-01-21 20:01:00 +01:00
Discover-
bf0d8c1346 Core/SAI: Implement three more event phases which makes a total of 9 (from 6).
Ref. #11486
2014-01-21 19:56:43 +01:00
jackpoz
cbba22ba68 Core/SAI: Fix assertion triggered in SmartScript
Remove assertion in SmartScript added in b8625f41bd and handle SmartScripts with GetBaseObject() returning NULL , like SmartTrigger . In this case SmartScript::mTargetStorage cannot be sanitized and might contain references to free'd WorldObjects if the script doesn't last a single Map::Update() call.
2014-01-15 20:20:01 +01:00
jackpoz
b8625f41bd Core/SAI: Fix crash in SmartScript
Fix crash in SmartScript storing WorldObject* instead of guid as targets in SmartScript::mTargetStorage , used by SMART_TARGET_STORED target type , SMART_ESCORT_TARGETS and other escort related code.
Fixes #11228 , #10157 .

Valgrind log:
 Invalid read of size 4
  at : Object::GetTypeId() const (Object.h:140)
  by : SmartScript::IsPlayer(WorldObject*) (SmartScript.h:73)
  by : SmartScript::ProcessAction(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:330)
  by : SmartScript::ProcessEvent(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2662)
  by : SmartScript::ProcessAction(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2226)
  by : SmartScript::ProcessTimedAction(SmartScriptHolder&, unsigned int const&, unsigned int const&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2238)
  by : SmartScript::ProcessEvent(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:2685)
  by : SmartScript::UpdateTimer(SmartScriptHolder&, unsigned int) (SmartScript.cpp:3198)
  by : SmartScript::OnUpdate(unsigned int) (SmartScript.cpp:3244)
  by : SmartAI::UpdateAI(unsigned int) (SmartAI.cpp:331)
  by : Creature::Update(unsigned int) (Creature.cpp:544)
  by : void Trinity::ObjectUpdater::Visit<Creature>(GridRefManager<Creature>&) (GridNotifiers.cpp:340)
2014-01-12 20:23:13 +01:00
joschiwald
7ec7fcf78c Core/SAI: drop unneeded code 2014-01-10 17:36:04 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
Malcrom
fe95371d9a Core/Scripting: Replace casted with cast as casted is not a word. 2013-12-25 14:16:55 -03:30
Shauren
8bcde41538 Core/Quests: Added stuff missing in previous commit 2013-12-25 12:17:23 +01:00
Shauren
5e8f829181 Core/SAI: Fixed a crash in call for help/flee for assist actions when they had an emote attached 2013-12-24 11:26:07 +01:00
Shauren
107af52853 Core/Chat: Refactored building chat packets
* Moved everything into one specialized method instead of being scattered all over the place
* Allow localizing creature names in chat messages (when using $N)
* Send SMSG_GM_MESSAGECHAT for gm messages
2013-12-23 14:23:49 +01:00
Discover-
c5788de8a4 Core/SAI: Fix another memory leak, thanks to @Xter 2013-12-19 10:50:16 +01:00
Discover-
e44e932d4d Core/SAI: Fix two memoryleaks in my previous commits. Thanks to @Xter for the notice. 2013-12-19 10:28:45 +01:00
Discover-
e5f7beecf5 Core/SAI: Using SMART_ACTION_FORCE_DESPAWN now despawns the given target_type instead of always the creature itself. 2013-12-18 10:06:19 +01:00
Discover-
a0f7fee922 Core/SAI: Fix compile
Core/SAI: Don't limit SMART_ACTION_SET_INGAME_PHASE_MASK to unit targets only. Thanks to @Shauren for the notice.
2013-12-17 11:38:29 +01:00
Discover-
154ee466eb Core/SAI: Using the action_type SMART_ACTION_SET_REACT_STATE now sets the react state of the target_type. Won't break any scripts as all current cases of this action_type have target_type 1 (SMART_TARGET_SELF). 2013-12-17 11:10:23 +01:00
Discover-
1f4d585bef Core/SAI: In all npc flag related action_types we now check if the target is a creature instead of an unit (creature/player). 2013-12-17 11:06:07 +01:00
Discover-
20a22662df Core/SAI: Using SMART_ACTION_SET_FOLLOW with target_type 0 (SMART_TARGET_NONE) will now stop the following completely. Fixes 6 scripts in a clean TDB already using this functionality even though it wasn't implemented. 2013-12-17 10:12:23 +01:00