Commit Graph

19748 Commits

Author SHA1 Message Date
Filip
ff8bc029ce DB/Update: Gibblewilt fear spam
By @Vincent-Michael fixes #10627
2013-09-29 22:28:45 +02:00
Filip
9842cbf887 DB/SAI: Finding the Source
By @dr-j fixes #10943
2013-09-29 22:24:56 +02:00
Filip
728b2555b6 DB/SAI: Neltharion's Flame (12267)
By @dr-j fixes #10965
2013-09-29 22:19:44 +02:00
Filip
c67d52730b DB/SAI: Leading the Ancestors Home
By @dr-j fixes #10783
2013-09-29 22:16:13 +02:00
Spp
ad29676c27 Fix compile under linux and update auth db with latest changes 2013-09-29 14:15:58 +02:00
Spp
ea2fe0217d Core/RBAC: Simplify RBAC implementation
- Drop groups (roles than can have inherited roles) and roles (set of
  permissions)
- Permissions can now have inherited permissions (those act as roles)

RBAC DB structure is now limited to four tables
- rbac_permissions: Contains permissions and roles
- rbac_linked_permissions: Contains the relation between permissions and
  linked permissions (those permissions that have linked permissions are
  called roles)
- rbac_default_permissions: Contains the list of permissions to be granted
  to each security level [Added to maintain compatibility in an easy way]
- rbac_account_permissions: Contains the list of permissions granted or
  denied for a particular account.

NOTE: IF YOU ARE USING CUSTOM PERMISSIONS, ROLES OR GROUPS CHECK THE SQL
BEFORE APPLYING...
2013-09-29 13:19:05 +02:00
jackpoz
a1fa7bf525 Tools/VMAP Extractor: Fix memory issues
Fix not-NULL terminated char buffer and uninitialized memory written to vmaps due to WMOLiquidHeader struct padding bytes left uninitialized. The padding bytes should be ignored anyway by VMAP Assembler so no re-extraction is required.

Valgrind log:
 Syscall param write(buf) points to uninitialised byte(s)
  at 0x585FB50: __write_nocancel (syscall-template.S:81)
  by 0x57EE2F2: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1270)
  by 0x57EE1D1: new_do_write (fileops.c:546)
  by 0x57EF904: _IO_do_write@@GLIBC_2.2.5 (fileops.c:519)
  by 0x57EEB70: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1341)
  by 0x57E3EC4: fwrite (iofwrite.c:43)
  by 0x41161B: WMOGroup::ConvertToVMAPGroupWmo(_IO_FILE*, WMORoot*, bool) (wmo.cpp:386)
  by 0x407FA9: ExtractSingleWmo(std::string&) (vmapexport.cpp:215)
  by 0x407B16: ExtractWmo() (vmapexport.cpp:138)
  by 0x409D50: main (vmapexport.cpp:497)
 Address 0x40398e2 is not stack'd, malloc'd or (recently) free'd
 Uninitialised value was created by a heap allocation
  at 0x4C2C7A7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x410ADA: WMOGroup::open() (wmo.cpp:224)
  by 0x407F54: ExtractSingleWmo(std::string&) (vmapexport.cpp:208)
  by 0x407B16: ExtractWmo() (vmapexport.cpp:138)
  by 0x409D50: main (vmapexport.cpp:497)
2013-09-29 12:26:56 +02:00
Sebastian Valle
a68c29e15c Tools/MeshExtractor: Fixed a lot of stuff, finally made the Doodads render, the WMO's have been disabled for now.
ToDo:
* Fix the doodads positions.
* Review and re-implement some code.

P.D: Help me please.
2013-09-29 02:05:28 -05:00
jackpoz
7ca6f56a06 Tools/MapExtractor: Fix string-related memory issues
Fix not-NULL terminated char buffers and char[] to string conversion.

Valgrind logs:
 Invalid read of size 1
  at 0x4C2D7D4: __GI_strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x5318BAF: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17)
  by 0x409471: ReadBuild(int) (System.cpp:189)
  by 0x40CEC6: main (System.cpp:1108)
  Address 0x5f851ee is 0 bytes after a block of size 94 alloc'd
  at 0x4C2C037: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x40F63A: MPQFile::MPQFile(char const*) (mpq_libmpq.cpp:65)
  by 0x409408: ReadBuild(int) (System.cpp:182)
  by 0x40CEC6: main (System.cpp:1108)

 Invalid read of size 1
  at 0x57FFCAC: strtok (strtok.S:165)
  by 0x40D279: MPQArchive::GetFileListTo(std::vector<std::string, std::allocator<std::string> >&) (mpq_libmpq04.h:45)
  by 0x40C5CF: ExtractDBCFiles(int, bool) (System.cpp:1001)
  by 0x40CEF5: main (System.cpp:1110)
  Address 0x5f91e27 is 0 bytes after a block of size 44,391 alloc'd
  at 0x4C2C037: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x40D1A5: MPQArchive::GetFileListTo(std::vector<std::string, std::allocator<std::string> >&) (mpq_libmpq04.h:30)
  by 0x40C5CF: ExtractDBCFiles(int, bool) (System.cpp:1001)
  by 0x40CEF5: main (System.cpp:1110)
2013-09-28 23:52:55 +02:00
jackpoz
ac5b6f337e Core/Scripts: Fix uninitialized values in The Black Morass
Valgrind log:
 Conditional jump or move depends on uninitialised value(s)
  at 0x1798C2C: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:192)
  by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
  by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)

 Conditional jump or move depends on uninitialised value(s)
  at 0x1798C7E: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:200)
  by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
  by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)

 Conditional jump or move depends on uninitialised value(s)
  at 0x1798CB0: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:205)
  by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
  by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)

 Conditional jump or move depends on uninitialised value(s)
  at 0x1798CE2: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:210)
  by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
  by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)
2013-09-28 22:18:19 +02:00
Subv
2b97ffafe9 Merge pull request #10966 from Chaplain/Mesh
Tools/MeshExtractor: Cleanup using static analyzing tool
2013-09-28 12:21:25 -07:00
Filip
6711ba0bd8 DB/Update: Pet spells 2013-09-28 18:19:33 +02:00
Filip
18bf68ad7e DB/Update: Spawndist for creature with random movement 2013-09-28 18:15:16 +02:00
Chaplain
42ae39bf97 Tools/MeshExtractor: Cleanup using static analyzing tool
*printf format fixed
*method arguments changed to const where needed
*removed not needed strlen() from cycles
*other minor changes
2013-09-28 15:47:23 +03:00
Subv
cde2e4d6c9 Merge pull request #10963 from Tomatodev/master
Tools/MeshExtractor: Fixed an infinite loop when reading the liquid information
2013-09-27 18:27:10 -07:00
Tomatoes
58348d0362 Subv's changes to mesh extractor V2
Signed-off-by: Tomatoes <diredarknil@gmail.com>
2013-09-27 18:04:14 -07:00
Sebastian Valle
85d6b7b7b3 Tools/MeshExtractor: Added some debug messages. 2013-09-27 16:42:00 -05:00
Sebastian Valle
b7b870be82 Tools/MeshExtractor: Removed the fool-proof code. 2013-09-27 16:01:28 -05:00
click
64f1324725 Fix silly " that snuck in. 2013-09-27 22:48:29 +02:00
click
33fcd36c7b Buildsystem/CMake: Add support for building meshextractor-project from CMake GUI 2013-09-27 22:12:53 +02:00
Sebastian Valle
da60e515f0 Tools/MeshExtractor: Fixed it's build, still in pre-alpha 2013-09-27 15:09:24 -05:00
Spp
895a23df11 Core/RBAC: Add default groups to accounts based on their security level.
- Removed config option RBAC.DefaultGroups

Use the table rbac_security_level_groups to configure the groups to be added to the account at load time.

Note: Those groups are only used at run time, never saved to DB
2013-09-27 13:35:45 +02:00
Spp
cfaea769bc Core/RBAC: Move RBAC code to namespace rbac 2013-09-27 13:35:45 +02:00
Kirkhammett
89085f7d57 DB/Core: The Storm King's Vengeance 2013-09-27 12:50:34 +02:00
jackpoz
2cca3982d4 Core/Movement: Port Ascent r1637 http://sourceforge.net/p/ascentemubackup/code/1637/ to TrinityCore
Port some movement packet fixes, taking into account client/server connection lag.
Credits to original author, check http://sourceforge.net/p/ascentemubackup/code/1637/ for more details.
MOVEMENT_PACKET_TIME_DELAY default value is currently set to 0, feel free to set it to different values and report feedback.
2013-09-26 20:09:50 +02:00
Filip
06c3813e56 DB/SAI: Wanton Warlord
Fixes #5126 by @dr-j
2013-09-26 16:30:55 +02:00
Filip
6ea5dfd350 DB/Update: Quest credit fix-up
Vehicles will not accept quest credit in the form of a spell cast, credit needs to be a monster kill.
2013-09-26 09:58:18 +02:00
joschiwald
a0c637f52a Core/Scripts: added some OVERRIDEs 2013-09-25 16:37:43 +02:00
joschiwald
1887fa28a0 Merge pull request #10933 from MitchesD/SteamVault
Scripts/SteamVault: reworked InstanceScript
2013-09-25 07:13:35 -07:00
Discover-
a5c248b60f Core/SAI: Get rid of unused parameter 'storageId' (third) in SMART_ACTION_SUMMON_CREATURE. This means the 4th parameter (actionInvoker 0/1) must move back one parameter. On a clean TDB there is not a single case of this parameter being used.
Updated wiki accordingly.
2013-09-25 11:46:51 +02:00
jackpoz
c256a0330a Merge branch 'master' of github.com:TrinityCore/TrinityCore 2013-09-24 23:35:11 +02:00
jackpoz
ec3832c2c1 Core/AI: Fix uninitialized values and array overflows in SAI
Proper initialize POD struct members to 0 in SMART_ACTION_CREATE_TIMED_EVENT action type.
Fix array overflows and access uninitialized values in SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST, SMART_ACTION_RANDOM_PHASE and SMART_ACTION_RANDOM_EMOTE .

Valgrind log for SMART_ACTION_RANDOM_PHASE case:
 Conditional jump or move depends on uninitialised value(s)
   at : SmartScript::UpdateTimer(SmartScriptHolder&, unsigned int) (SmartScript.cpp:3086)
   by : SmartScript::OnUpdate(unsigned int) (SmartScript.cpp:3176)
   by : SmartAI::UpdateAI(unsigned int) (SmartAI.cpp:335)
   by : Creature::Update(unsigned int) (Creature.cpp:542)
   by : TempSummon::Update(unsigned int) (TemporarySummon.cpp:47)

 Uninitialised value was created by a stack allocation
   at : SmartScript::ProcessAction(SmartScriptHolder&, Unit*, unsigned int, unsigned int, bool, SpellInfo const*, GameObject*) (SmartScript.cpp:143)
2013-09-24 23:33:28 +02:00
Filip
d6a6f44148 DB/SAI: Non-repeatable flags change & credit circumvention
By dr-j fixes #10929 fixes #6444
2013-09-24 23:05:26 +02:00
Vincent-Michael
20d070172b Core/Logs: Random changes 2013-09-23 22:55:35 +02:00
MitchesD
ae221b0f02 Scripts/SteamVault: reworked InstanceScript 2013-09-23 22:00:42 +02:00
Discover-
a0db0728f2 Merge branch 'master' of https://github.com/TrinityCore/TrinityCore 2013-09-23 16:47:47 +02:00
Discover-
9653576cb4 Core/SAI: Using SMART_TARGET_NONE no longer works the same way as SMART_TARGET_ACTION_INVOKER but rather return NULL instead.
Fixes #10908
2013-09-23 16:47:22 +02:00
Filip
4498ac0062 DB/SAI: Zeth'Gor Must Burn!
Fixes #10904 by @untaught
2013-09-22 18:40:47 +02:00
Shauren
3aa9446d54 Merge pull request #10875 from zorix/PR2
Core/Script:
2013-09-22 07:58:42 -07:00
zorix
8b2c40e0f9 Core/Script:
ICC: Convert possible non valid pointer to guid

Close #9954
2013-09-22 16:38:15 +02:00
Filip
56b3e52f06 DB/SAI: Eyes of Grillok
By @dr-j fixes #10909
2013-09-21 22:44:07 +02:00
jackpoz
9579d0a3e7 Scripts/ScarletEnclave: Fix uninitialized values in Highlord Darion Mograine
Reset() has if checks on values that are initialized after them so it's required to initialize these fields in the constructor.

Valgrind log:
 Conditional jump or move depends on uninitialised value(s)
  by 0x11CF472: HashMapHolder<Creature>::Find(unsigned long) (ObjectAccessor.h:67)
  by 0x11CE36F: Creature* ObjectAccessor::GetObjectInWorld<Creature>(unsigned long, Creature*) (ObjectAccessor.h:114)
  by 0x1257C13: Creature* ObjectAccessor::GetObjectInMap<Creature>(unsigned long, Map*, Creature*) (ObjectAccessor.h:135)
  by 0x12E64F1: Map::GetCreature(unsigned long) (Map.cpp:2767)
  by 0x10AF4DE: Unit::GetCreature(WorldObject&, unsigned long) (Unit.cpp:13021)
  by 0x16F8F81: npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::Reset() (chapter5.cpp:386)
  by 0x16F8D36: npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::npc_highlord_darion_mograineAI(Creature*) (chapter5.cpp:314)
  by 0x16F8CD6: npc_highlord_darion_mograine::GetAI(Creature*) const (chapter5.cpp:307)
  by 0x132AF6C: ScriptMgr::GetCreatureAI(Creature*) (ScriptMgr.cpp:796)
  by 0x1441D45: FactorySelector::selectAI(Creature*) (CreatureAISelector.cpp:41)
2013-09-21 22:36:23 +02:00
jackpoz
af63c8783e Core/Guild: Fix withdraw money from bank overflowing int32 limit
Clamp amount of money withdrawn from bank to MAX_MONEY_AMOUNT to avoid int32 overflow which would remove money from Player instead of adding it.
2013-09-21 19:44:15 +02:00
jackpoz
9c336cc32e Core/DB: Make a26a24a consistent with Trinity code style
Change DatabaseWorkerPool<T>::DirectExecute() to handle PreparedStatement disposal in the same way of DatabaseWorkerPool<T>::Query() , thanks Joschiwald for patch.
2013-09-21 17:45:46 +02:00
jackpoz
a26a24adf1 Core/AccountMgr: Fix memory leak on account creation
Fix .account create command not deleting a MySql PreparedStatement .

Valgrind log:
 254 (40 direct, 214 indirect) bytes in 1 blocks are definitely lost in loss record 6 of 8
  at 0x4C24DFA: operator new(unsigned long) (vg_replace_malloc.c:261)
  by 0x998EC2: DatabaseWorkerPool<LoginDatabaseConnection>::GetPreparedStatement(unsigned int) (DatabaseWorkerPool.h:437)
  by 0x99599B: AccountMgr::CreateAccount(std::string, std::string, std::string) (AccountMgr.cpp:49)
  by 0xF3ABAC: account_commandscript::HandleAccountCreateCommand(ChatHandler*, char const*)
2013-09-21 14:55:08 +02:00
Discover-
69b0a009c4 Core/SAI: Make SMART_ACTION_RANDOM_MOVE also work with SMART_TARGET_NONE and non-creature targets (if a non-creature target_type is specified and no creature target was found, the action is fired at the source)
Ref. #7431
2013-09-21 11:21:29 +02:00
jackpoz
6f9851ec13 Core/PathGenerator: Fix conditional jump on uninitialized value
Fix conditional jump on uninitialized value in PathGenerator::GetNavTerrain() by checking the result of getLiquidStatus() before accessing the LiquidData, uninitialized in case there's no water at all.

Valgrind log:
 Conditional jump or move depends on uninitialised value(s)
  at : PathGenerator::GetNavTerrain(float, float, float) (PathGenerator.cpp:553)
  by : PathGenerator::UpdateFilter() (PathGenerator.cpp:542)
  by : PathGenerator::CreateFilter() (PathGenerator.cpp:530)
  by : PathGenerator::PathGenerator(Unit const*) (PathGenerator.cpp:46)
  by : Spell::Spell(Unit*, SpellInfo const*, TriggerCastFlags, unsigned long, bool) (Spell.cpp:493)
  by : Unit::CastSpell(SpellCastTargets const&, SpellInfo const*, CustomSpellValues const*, TriggerCastFlags, Item*, AuraEffect const*, unsigned long) (Unit.cpp:846)
  by : Unit::CastSpell(Unit*, SpellInfo const*, TriggerCastFlags, Item*, AuraEffect const*, unsigned long) (Unit.cpp:882)
  by : Unit::CastSpell(Unit*, unsigned int, TriggerCastFlags, Item*, AuraEffect const*, unsigned long) (Unit.cpp:870)
  by : Unit::CastSpell(Unit*, unsigned int, bool, Item*, AuraEffect const*, unsigned long) (Unit.cpp:858)
  by : Player::SendInitialPacketsAfterAddToMap() (Player.cpp:22580)
  by : WorldSession::HandleMoveWorldportAckOpcode() (MovementHandler.cpp:121)
  by : WorldSession::HandleMoveWorldportAckOpcode(WorldPacket&) (MovementHandler.cpp:37)
2013-09-21 10:58:21 +02:00
raczman
1ae6538ea6 Merge pull request #10827 from jackpoz/restore_warnings
Shared/Build: Restore disabled warnings on Visual Studio
2013-09-20 16:08:26 -07:00
Filip
4ddad6ec60 DB/SAI: The Battle of Valhalas Quest Chain
Fixes #8377
Consists of:
1) Battle at Valhalas: Fallen Heroes (13214)
2) Battle at Valhalas: Khit'rix the Dark Master (13215)
3) Battle at Valhalas: The Return of Sigrid Iceborn (13216)
4) Battle at Valhalas: Carnage! (13217)
5) Battle at Valhalas: Thane Deathblow (13218)
6) Battle at Valhalas: Final Challenge (13219)
2013-09-20 22:59:10 +02:00
Vincent-Michael
2b9b2a7388 DB/GameObject: Added gameobject "Dark Iron Mole Machine (Minion Summoner Trap)" 2013-09-20 13:16:04 +02:00