From 6354da1eebe58db4d67180e6816ed58e956efa7a Mon Sep 17 00:00:00 2001 From: raczman Date: Sat, 21 Mar 2009 20:42:09 +0100 Subject: [PATCH 1/3] Added MySQL reconnect support, in case of mysql server dying while trinity's running - Thanks to Xeptor for that one. --HG-- branch : trunk --- src/shared/Database/DatabaseMysql.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/shared/Database/DatabaseMysql.cpp b/src/shared/Database/DatabaseMysql.cpp index 72da1090a8..77a59a69c5 100644 --- a/src/shared/Database/DatabaseMysql.cpp +++ b/src/shared/Database/DatabaseMysql.cpp @@ -167,6 +167,20 @@ bool DatabaseMysql::Initialize(const char *infoString) PExecute("SET NAMES `utf8`"); PExecute("SET CHARACTER SET `utf8`"); + #if MYSQL_VERSION_ID >= 50003 + my_bool my_true = (my_bool)1; + if (mysql_options(mMysql, MYSQL_OPT_RECONNECT, &my_true)) + { + sLog.outDetail("Failed to turn on MYSQL_OPT_RECONNECT."); + } + else + { + sLog.outDetail("Successfully turned on MYSQL_OPT_RECONNECT."); + } + #else + #warning "Your mySQL client lib version does not support reconnecting after a timeout.\nIf this causes you any trouble we advice you to upgrade your mySQL client libs to at least mySQL 5.0.13 to resolve this problem." + #endif + return true; } else From ca7d04ca1367c41840c6cc42a321d9be2851208d Mon Sep 17 00:00:00 2001 From: raczman Date: Sat, 21 Mar 2009 21:07:51 +0100 Subject: [PATCH 2/3] Not allow to receive rewards when BG finishes prematurely - thanks to Sethoso, original author. --HG-- branch : trunk --- src/game/BattleGround.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index e63bea531d..5ab9490b21 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -561,7 +561,7 @@ void BattleGround::EndBattleGround(uint32 winner) UpdatePlayerScore(plr, SCORE_BONUS_HONOR, 20); RewardQuest(plr); } - else + else if(winner !=0) { RewardMark(plr,ITEM_LOSER_COUNT); } From 3531d0f2542f283909df43f280c12c281563cdc6 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 21 Mar 2009 22:25:13 -0600 Subject: [PATCH 3/3] *Fix a crash bug of priestess_delrissa script. --HG-- branch : trunk --- .../scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp index c027d3a4b9..3ca8aaf764 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp @@ -820,7 +820,7 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI Blink_Timer = 8000; }else Blink_Timer -= diff; - if (m_creature->GetDistance(m_creature->getVictim()) <= 10) + if (m_creature->getVictim() && m_creature->GetDistance(m_creature->getVictim()) <= 10) m_creature->StopMoving(); //DoMeleeAttackIfReady(); //mage type, no melee needed