Commit Graph

7107 Commits

Author SHA1 Message Date
jackpoz
9578b5f87a Core/Thread: Fix race condition converting time values to local time
Replace thread-unsafe localtime() http://www.cplusplus.com/reference/ctime/localtime/ with thread-safe portable ACE_OS::localtime_r() .

Helgrind log:
 Possible data race during read of size 4 at 0x6F183C0 by thread #1
 Locks held: none
  at 0x14E72E3: World::InitDailyQuestResetTime() (World.cpp:2772)
  by 0x14E3A01: World::SetInitialWorldSettings() (World.cpp:1790)
  by 0x101122A: Master::Run() (Master.cpp:164)
  by 0x101740C: main (Main.cpp:142)

 This conflicts with a previous write of size 4 by thread #2
 Locks held: none
  at 0x6C2D3BA: __tzfile_compute (tzfile.c:797)
  by 0x6C2D036: __tz_convert (tzset.c:627)
  by 0x164146C: LogMessage::getTimeStr(long) (Appender.cpp:23)
  by 0x1641550: LogMessage::getTimeStr() (Appender.cpp:31)
  by 0x1641722: Appender::write(LogMessage&) (Appender.cpp:80)
  by 0x1633FCE: Logger::write(LogMessage&) (Logger.cpp:83)
  by 0x16433D8: LogOperation::call() (LogOperation.cpp:29)
  by 0x16428A4: LogWorker::svc() (LogWorker.cpp:45)
2013-09-07 14:37:54 +02:00
Aokromes
80516db48c Core/Battlegrounds: Allow random BG winner/loser rewards to be configurable
Signed-off-by: Machiavelli <machiavelli.trinity@gmail.com>
2013-09-07 13:32:04 +01:00
Machiavelli
287dc307bc Merge pull request #10724 from jackpoz/guild_disband_leak
Core/Guild: Fix memory leak on Guild disband
2013-09-07 05:07:28 -07:00
Aokromes
c3c5327fbd Merge pull request #10716 from Discover-/SAI_Owner_Or_Summoner
Core/SAI: Make SMART_TARGET_OWNER_OR_SUMMONER also work for creatures su...
2013-09-06 17:29:15 -07:00
joschiwald
f66120060a Scripts/Spells: drop obsolete code 2013-09-07 01:21:36 +02:00
Vincent-Michael
fab0f461c0 Core/Condition: Added CONDITION_SOURCE_TYPE_PHASE_DEFINITION define for only 4.3.4 branch 2013-09-07 00:16:10 +02:00
Subv
8c70f8cb08 Merge pull request #10730 from jackpoz/scoreboard_fix
Core/Battleground: Fix scoreboard
2013-09-06 12:51:00 -07:00
jackpoz
3816fb440f Core/Battleground: Fix scoreboard
Fix scoreboard broken in 07d793b94b . A local variable in a loop stored data of the iterator before incrementing it.
2013-09-06 21:49:30 +02:00
Vincent-Michael
bc1a079b6c Core/SAI: Fix typo (i blame germans laziness) 2013-09-06 21:40:04 +02:00
joschiwald
adef15cd0f Core/Spells: add an other condition to SpellInfo::NeedsToBeTriggeredByCaster to correct spells with are wrongly triggered by target instead of caster
- convert archavons rock shards to spellscript (now it works properly)
- add a spellscript for one spell that can't be corrected by this (and delete the sai hack, now i uses the correct spell)
2013-09-06 20:57:38 +02:00
Machiavelli
577c9457e3 Update DBCStructure.h 2013-09-06 13:55:57 +01:00
Machiavelli
2fc6385dba Core/Vehicles: Add vehicle_seat_flag_unk18 (0x20000) to seat.IsUsableByOverride
Exact definition still needs to be researched
2013-09-06 13:30:53 +01:00
Shauren
0ca481c0a2 Core/Achievements: Converted save queries to prepared statements 2013-09-06 14:00:21 +02:00
Shauren
a65c0ac576 Merge pull request #10722 from jackpoz/guild_startup_crashfix
Core/Guild: Fix Guild validation crash on start up
2013-09-06 02:06:24 -07:00
jackpoz
9ce70fb3c9 Core/Guild: Fix memory leak on Guild disband
Fix memory leak when disbanding a Guild, removed from GuildMgr but never deleted. Due to the different ways of how Guild::Disband() and Guild::DeleteMember() are called, each call to these methods has a different way to delete the Guild if empty/invalid.

Valgrind log:
 2,127 (240 direct, 1,887 indirect) bytes in 1 blocks are definitely lost in loss record 54 of 81
  at operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by guild_commandscript::HandleGuildCreateCommand(ChatHandler*, char const*) (cs_guild.cpp:91)
  by ChatHandler::ExecuteCommandInTable(ChatCommand*, char const*, std::string const&) (Chat.cpp:339)
  by ChatHandler::ExecuteCommandInTable(ChatCommand*, char const*, std::string const&) (Chat.cpp:320)
  by ChatHandler::ParseCommands(char const*) (Chat.cpp:466)
  by WorldSession::HandleMessagechatOpcode(WorldPacket&) (ChatHandler.cpp:217)
  by WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:317)
  by World::UpdateSessions(unsigned int) (World.cpp:2632)
  by World::Update(unsigned int) (World.cpp:1989)
  by WorldRunnable::run() (WorldRunnable.cpp:60)
  by ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186)
  by ACE_OS_Thread_Adapter::invoke() (in /usr/lib/libACE-6.0.3.so)
2013-09-05 22:10:46 +02:00
jackpoz
b056bc976c Core/Guild: Fix Guild validation crash on start up
Partially revert 58ec4e5319 and increment GuildStore iterator before validating Guilds. This is required because Guild::Validate() removes the Guild from GuildStore if invalid.
Closes #8363
2013-09-05 21:14:32 +02:00
Vincent-Michael
458f5b9502 Core/SAI: Added SMART_ACTION_SUMMON_CREA / SMART_ACTION_SUMMON_GO log for has already summon spell 2013-09-05 16:16:23 +02:00
joschiwald
7ef1f0738b Core/Battlegrounds/IoC: fix fortress teleport pads
(and replace a hack with an other hack)

Closes #5846
Closes #7993
Ref #8984
2013-09-05 00:59:22 +02:00
Discover-
926edaf49d Tabs to spaces... 2013-09-04 14:07:27 +02:00
Discover-
9761affc8d Core/SAI: Make SMART_TARGET_OWNER_OR_SUMMONER also work for creatures summoned by spells 2013-09-04 09:35:21 +02:00
Sebastian Valle
a37f18a67a Core/Build: Fixed build 2013-09-03 21:55:35 -05:00
Sebastian Valle
88df2ca6d4 Core/Build: Updated the header files to fix the build. 2013-09-03 17:43:11 -05:00
Sebastian Valle
07d793b94b Core/Misc: Fixed some more issues found by static code analysis tools. 2013-09-03 17:31:02 -05:00
Shauren
b3d5784d1f Merge pull request #10713 from jackpoz/movement_fix
Core/Movement: Fix uninitialized MovementInfo fields
2013-09-03 14:10:40 -07:00
jackpoz
0450b74e96 Core/Movement: Fix uninitialized MovementInfo fields
Fix uninitialized fallTime and splineElevation fields of MovementInfo.

Valgrind log:
 Conditional jump or move depends on uninitialised value(s)
   at 0x5FBEB50: deflate (in /lib/x86_64-linux-gnu/libz.so.1.2.7)
   by 0x1269883: UpdateData::Compress(void*, unsigned int*, void*, int) (UpdateData.cpp:85)
   by 0x1269BB6: UpdateData::BuildPacket(WorldPacket*) (UpdateData.cpp:133)
   by 0x130E9B3: Trinity::VisibleNotifier::SendToSelf() (GridNotifiers.cpp:68)
   by 0x117A89D: Player::UpdateVisibilityForPlayer() (Player.cpp:22344)
   by 0x117B334: Player::SendInitialPacketsAfterAddToMap() (Player.cpp:22567)
   by 0x15A48BC: WorldSession::HandlePlayerLogin(LoginQueryHolder*) (CharacterHandler.cpp:937)
   by 0x141D04B: WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1106)
   by 0x141994D: WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:391)
   by 0x14E289C: World::UpdateSessions(unsigned int) (World.cpp:2629)
   by 0x14E0613: World::Update(unsigned int) (World.cpp:1986)
   by 0x100B37F: WorldRunnable::run() (WorldRunnable.cpp:60)
 Uninitialised value was created by a heap allocation
   at 0x4C286E7: operator new(unsigned long) (vg_replace_malloc.c:287)
   by 0x159E64F: void LoadHelper<Creature>(std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > const&, CoordPair<512u>&, GridRefManager<Creature>&, unsigned int&, Map*) (ObjectGridLoader.cpp:94)
   by 0x159DECF: ObjectGridLoader::Visit(GridRefManager<Creature>&) (ObjectGridLoader.cpp:150)
   by 0x159F092: void VisitorHelper<ObjectGridLoader, Creature>(ObjectGridLoader&, ContainerMapList<Creature>&) (TypeContainerVisitor.h:64)
   by 0x159EFF5: void VisitorHelper<ObjectGridLoader, Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > >(ObjectGridLoader&, ContainerMapList<TypeList<Creature, TypeList<DynamicObject, TypeList<Corpse, TypeNull> > > >&) (TypeContainerVisitor.h:70)
2013-09-03 23:05:02 +02:00
Sebastian Valle
24f8b2b994 Core/Misc: Fixed some more issues found by code analysis tools. 2013-09-03 15:09:37 -05:00
Vincent-Michael
ab85a9507e Core/SAI: Added SMART_ACTION_CALL_KILLEDMONSTER log for has already spell kill credit 2013-09-02 17:48:55 +02:00
Nay
28f9317698 Core/RBAC: Move cast and characters commands to RBAC (using individual permissions) 2013-09-02 13:25:07 +01:00
Spp
f3487aa0e1 Compile Fix (and edit of last 2 sqls to add the missing permissions) 2013-09-02 13:19:59 +02:00
Spp
f68471f142 Core/RBAC: Move message commands to RBAC (using individual permissions) 2013-09-02 13:01:50 +02:00
Spp
2d508387e5 Core/Commands: Move lookup commands to RBAC (using individual permissions) 2013-09-02 12:54:51 +02:00
Spp
eb73684952 Core/RBAC: Move list commands to RBAC (using individual permissions) 2013-09-02 12:25:32 +02:00
Spp
4219f45c85 Core/RBAC: Move lfg commands to RBAC (using individual permissions) 2013-09-02 12:17:46 +02:00
Spp
c0dfdeab1c Core/RBAC: Move learn commands to RBAC (using individual permissions) 2013-09-02 12:12:20 +02:00
Spp
2625e78f80 Core/RBAC: Move instance commands to RBAC (using individual permissions) 2013-09-02 11:58:14 +02:00
Spp
08ef6bd9f8 Core/RBAC: Move honor commands to RBAC (using individual permissions) 2013-09-02 11:53:22 +02:00
Spp
11233dbd73 Core/RBAC: Move guild commands to RBAC (using individual permissions) 2013-09-02 11:45:36 +02:00
Spp
015eee068b Core/RBAC: Move gobject commands to RBAC (using individual permissions) 2013-09-02 11:38:41 +02:00
Spp
29c57c3447 Core/RBAC: Move go commands to RBAC (using individual permissions) 2013-09-02 11:33:45 +02:00
Spp
1bccf67c09 Core/RBAC: Move gm commands to RBAC (using individual permissions) 2013-09-02 11:24:09 +02:00
Spp
fced8a896e Core/RBAC: Move event commands to RBAC (using individual permissions) 2013-09-02 11:20:05 +02:00
Spp
225691e0ae Core/RBAC: Move disable commands to RBAC (using individual permissions) 2013-09-02 11:17:15 +02:00
Spp
3e45640135 Core/RBAC: Move deserter commands to RBAC (using individual permissions) 2013-09-02 10:01:34 +02:00
Spp
f53c61c93e Core/RBAC: Move debug commands to RBAC (using individual permissions) 2013-09-02 10:01:34 +02:00
Spp
33d9da5060 Core/RBAC: Move cheat commands to RBAC (using individual permissions) 2013-09-02 10:01:34 +02:00
Nay
69a0800cb7 Merge pull request #10696 from jackpoz/socket_race_condition
Core/Socket: Fix race condition in WorldSocket
2013-09-01 15:52:57 -07:00
Nay
68b447b24c Merge pull request #10563 from Ascathor/master
Core/Account: Make account password change security variable and various changes
2013-09-01 15:52:13 -07:00
Shauren
f388ceb8bd Merge pull request #10687 from jackpoz/farsight_fix
Core/Spell: Fix farsight log error "Player requests non-existing seer"
2013-09-01 13:52:05 -07:00
jackpoz
1417f62453 Core/Spell: Fix farsight log error "Player requests non-existing seer"
Partially revert 167ca565d0 which wrongly used TYPEMASK_UNIT to denote Creatures and Players, so when a Player sent farsight opcode with another Player as target HandleFarSightOpcode() couldn't find the right Unit filtering by typemask TYPEMASK_SEER.
2013-09-01 22:35:48 +02:00
Shauren
e8a566b3b1 Core/Objects: Removed obsolete code 2013-09-01 22:30:07 +02:00