From 3c866d5529826761c161de7ff9e2e60d5060edb6 Mon Sep 17 00:00:00 2001 From: runningnak3d Date: Sun, 16 Nov 2008 02:28:44 -0600 Subject: [PATCH] [svn] * Fixed a SQL issue that was causing game events to not be saved * FROM_UNIXTIME doesn't allow '' inside the () * This should solve the issue of jumping from phase 1 -> 2 -> 3 -> 4 without completing the objectives * This should also tick a LOT of players off if their servers are running with the stock TDB blizz values :P (low pop servers at least). --HG-- branch : trunk --- src/game/BattleGroundMgr.cpp | 4 ++-- src/game/GameEvent.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index d942624079..6249967bf4 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1028,7 +1028,7 @@ void BattleGroundMgr::Update(time_t diff) { DistributeArenaPoints(); m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); - CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = FROM_UNIXTIME('"I64FMTD"')",(uint64)m_NextAutoDistributionTime); + CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = FROM_UNIXTIME("I64FMTD")",(uint64)m_NextAutoDistributionTime); } m_AutoDistributionTimeChecker = 600000; // check 10 minutes } @@ -1562,7 +1562,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution() { sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now."); m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); - CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ( FROM_UNIXTIME('"I64FMTD"') )",(uint64)m_NextAutoDistributionTime); + CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ( FROM_UNIXTIME("I64FMTD") )",(uint64)m_NextAutoDistributionTime); } else { diff --git a/src/game/GameEvent.cpp b/src/game/GameEvent.cpp index 6a7ce09a02..88028290db 100644 --- a/src/game/GameEvent.cpp +++ b/src/game/GameEvent.cpp @@ -1503,7 +1503,7 @@ void GameEvent::SaveWorldEventStateToDB(uint16 event_id) CharacterDatabase.BeginTransaction(); CharacterDatabase.PExecute("DELETE FROM game_event_save WHERE event_id = '%u'",event_id); if(mGameEvent[event_id].nextstart) - CharacterDatabase.PExecute("INSERT INTO game_event_save (event_id, state, next_start) VALUES ('%u','%u',FROM_UNIXTIME('"I64FMTD"'))",event_id,mGameEvent[event_id].state,mGameEvent[event_id].nextstart); + CharacterDatabase.PExecute("INSERT INTO game_event_save (event_id, state, next_start) VALUES ('%u','%u',FROM_UNIXTIME("I64FMTD"))",event_id,mGameEvent[event_id].state,mGameEvent[event_id].nextstart); else CharacterDatabase.PExecute("INSERT INTO game_event_save (event_id, state, next_start) VALUES ('%u','%u','0000-00-00 00:00:00')",event_id,mGameEvent[event_id].state); CharacterDatabase.CommitTransaction();