Temporary revert 6743 commit. I fix this patch across 1-2 days.
--HG-- branch : trunk
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "GameSystem/Grid.h"
|
#include "GameSystem/Grid.h"
|
||||||
#include "GameSystem/GridReference.h"
|
#include "GameSystem/GridReference.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
class GridInfo
|
class GridInfo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
#include "SpellMgr.h"
|
#include "SpellMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include "MapManager.h"
|
#include "MapManager.h"
|
||||||
#include "BattleGround.h"
|
#include "BattleGround.h"
|
||||||
#include "BattleGroundAB.h"
|
#include "BattleGroundAB.h"
|
||||||
@@ -552,7 +552,7 @@ void AchievementMgr::LoadFromDB(QueryResult *achievementResult, QueryResult *cri
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (criteria->timeLimit && time_t(date + criteria->timeLimit) < sGameTime.GetGameTime())
|
if (criteria->timeLimit && time_t(date + criteria->timeLimit) < time(NULL))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
CriteriaProgress& progress = m_criteriaProgress[id];
|
CriteriaProgress& progress = m_criteriaProgress[id];
|
||||||
@@ -612,7 +612,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||||||
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
|
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
|
||||||
data.append(GetPlayer()->GetPackGUID());
|
data.append(GetPlayer()->GetPackGUID());
|
||||||
data << uint32(achievement->ID);
|
data << uint32(achievement->ID);
|
||||||
data << uint32(secsToTimeBitFields(sGameTime.GetGameTime()));
|
data << uint32(secsToTimeBitFields(time(NULL)));
|
||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
GetPlayer()->SendMessageToSetInRange(&data, sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY), true);
|
GetPlayer()->SendMessageToSetInRange(&data, sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY), true);
|
||||||
}
|
}
|
||||||
@@ -1623,7 +1623,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
|
|||||||
|
|
||||||
progress = &m_criteriaProgress[entry->ID];
|
progress = &m_criteriaProgress[entry->ID];
|
||||||
progress->counter = changeValue;
|
progress->counter = changeValue;
|
||||||
progress->date = sGameTime.GetGameTime();
|
progress->date = time(NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1658,7 +1658,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
|
|||||||
|
|
||||||
if(entry->timeLimit)
|
if(entry->timeLimit)
|
||||||
{
|
{
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
if(time_t(progress->date + entry->timeLimit) < now)
|
if(time_t(progress->date + entry->timeLimit) < now)
|
||||||
progress->counter = 1;
|
progress->counter = 1;
|
||||||
|
|
||||||
@@ -1680,7 +1680,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
|||||||
|
|
||||||
SendAchievementEarned(achievement);
|
SendAchievementEarned(achievement);
|
||||||
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
|
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
|
||||||
ca.date = sGameTime.GetGameTime();
|
ca.date = time(NULL);
|
||||||
ca.changed = true;
|
ca.changed = true;
|
||||||
|
|
||||||
// don't insert for ACHIEVEMENT_FLAG_REALM_FIRST_KILL since otherwise only the first group member would reach that achievement
|
// don't insert for ACHIEVEMENT_FLAG_REALM_FIRST_KILL since otherwise only the first group member would reach that achievement
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "AuctionHouseMgr.h"
|
#include "AuctionHouseMgr.h"
|
||||||
#include "AuctionHouseBot.h"
|
#include "AuctionHouseBot.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Policies/SingletonImp.h"
|
#include "Policies/SingletonImp.h"
|
||||||
@@ -90,9 +89,9 @@ AuctionHouseBot::AuctionHouseBot()
|
|||||||
|
|
||||||
//End Filters
|
//End Filters
|
||||||
|
|
||||||
_lastrun_a = sGameTime.GetGameTime();
|
_lastrun_a = time(NULL);
|
||||||
_lastrun_h = sGameTime.GetGameTime();
|
_lastrun_h = time(NULL);
|
||||||
_lastrun_n = sGameTime.GetGameTime();
|
_lastrun_n = time(NULL);
|
||||||
|
|
||||||
AllianceConfig = AHBConfig(2);
|
AllianceConfig = AHBConfig(2);
|
||||||
HordeConfig = AHBConfig(6);
|
HordeConfig = AHBConfig(6);
|
||||||
@@ -420,7 +419,7 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
|
|||||||
auctionEntry->bidder = 0;
|
auctionEntry->bidder = 0;
|
||||||
auctionEntry->bid = 0;
|
auctionEntry->bid = 0;
|
||||||
auctionEntry->deposit = dep;
|
auctionEntry->deposit = dep;
|
||||||
auctionEntry->expire_time = (time_t) etime + sGameTime.GetGameTime();
|
auctionEntry->expire_time = (time_t) etime + time(NULL);
|
||||||
auctionEntry->auctionHouseEntry = ahEntry;
|
auctionEntry->auctionHouseEntry = ahEntry;
|
||||||
item->SaveToDB();
|
item->SaveToDB();
|
||||||
item->RemoveFromUpdateQueueOf(AHBplayer);
|
item->RemoveFromUpdateQueueOf(AHBplayer);
|
||||||
@@ -696,7 +695,7 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
|
|||||||
|
|
||||||
void AuctionHouseBot::Update()
|
void AuctionHouseBot::Update()
|
||||||
{
|
{
|
||||||
time_t _newrun = sGameTime.GetGameTime();
|
time_t _newrun = time(NULL);
|
||||||
if ((!AHBSeller) && (!AHBBuyer))
|
if ((!AHBSeller) && (!AHBBuyer))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1507,7 +1506,7 @@ void AuctionHouseBot::Commands(uint32 command, uint32 ahMapID, uint32 col, char*
|
|||||||
{
|
{
|
||||||
if (itr->second->owner == AHBplayerGUID)
|
if (itr->second->owner == AHBplayerGUID)
|
||||||
{
|
{
|
||||||
itr->second->expire_time = sGameTime.GetGameTime();
|
itr->second->expire_time = sWorld.GetGameTime();
|
||||||
uint32 id = itr->second->Id;
|
uint32 id = itr->second->Id;
|
||||||
uint32 expire_time = itr->second->expire_time;
|
uint32 expire_time = itr->second->expire_time;
|
||||||
CharacterDatabase.PExecute("UPDATE auctionhouse SET time = '%u' WHERE id = '%u'", expire_time, id);
|
CharacterDatabase.PExecute("UPDATE auctionhouse SET time = '%u' WHERE id = '%u'", expire_time, id);
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "UpdateMask.h"
|
#include "UpdateMask.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
//please DO NOT use iterator++, because it is slower than ++iterator!!!
|
//please DO NOT use iterator++, because it is slower than ++iterator!!!
|
||||||
//post-incrementation is always slower than pre-incrementation !
|
//post-incrementation is always slower than pre-incrementation !
|
||||||
@@ -272,7 +271,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
|||||||
AH->bidder = 0;
|
AH->bidder = 0;
|
||||||
AH->bid = 0;
|
AH->bid = 0;
|
||||||
AH->buyout = buyout;
|
AH->buyout = buyout;
|
||||||
AH->expire_time = sGameTime.GetGameTime() + auction_time;
|
AH->expire_time = time(NULL) + auction_time;
|
||||||
AH->deposit = deposit;
|
AH->deposit = deposit;
|
||||||
AH->auctionHouseEntry = auctionHouseEntry;
|
AH->auctionHouseEntry = auctionHouseEntry;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -184,7 +183,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction)
|
|||||||
std::ostringstream msgAuctionSalePendingBody;
|
std::ostringstream msgAuctionSalePendingBody;
|
||||||
uint32 auctionCut = auction->GetAuctionCut();
|
uint32 auctionCut = auction->GetAuctionCut();
|
||||||
|
|
||||||
time_t distrTime = sGameTime.GetGameTime() + sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY);
|
time_t distrTime = time(NULL) + sWorld.getConfig(CONFIG_MAIL_DELIVERY_DELAY);
|
||||||
|
|
||||||
msgAuctionSalePendingBody.width(16);
|
msgAuctionSalePendingBody.width(16);
|
||||||
msgAuctionSalePendingBody << std::right << std::hex << auction->bidder;
|
msgAuctionSalePendingBody << std::right << std::hex << auction->bidder;
|
||||||
@@ -500,7 +499,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
|
|||||||
|
|
||||||
void AuctionHouseObject::Update()
|
void AuctionHouseObject::Update()
|
||||||
{
|
{
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = sWorld.GetGameTime();
|
||||||
///- Handle expired auctions
|
///- Handle expired auctions
|
||||||
|
|
||||||
// If storage is empty, no need to update. next == NULL in this case.
|
// If storage is empty, no need to update. next == NULL in this case.
|
||||||
@@ -684,7 +683,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
|
|||||||
data << uint32(bid ? GetAuctionOutBid() : 0);
|
data << uint32(bid ? GetAuctionOutBid() : 0);
|
||||||
//minimal outbid
|
//minimal outbid
|
||||||
data << uint32(buyout); //auction->buyout
|
data << uint32(buyout); //auction->buyout
|
||||||
data << uint32((expire_time-sGameTime.GetGameTime())*IN_MILISECONDS);//time left
|
data << uint32((expire_time-time(NULL))*IN_MILISECONDS);//time left
|
||||||
data << uint64(bidder) ; //auction->bidder current
|
data << uint64(bidder) ; //auction->bidder current
|
||||||
data << uint32(bid); //current bid
|
data << uint32(bid); //current bid
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
#include "Object.h"
|
#include "Object.h"
|
||||||
#include "SpellAuras.h"
|
#include "SpellAuras.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
namespace Trinity
|
namespace Trinity
|
||||||
{
|
{
|
||||||
@@ -260,7 +259,7 @@ void BattleGround::Update(uint32 diff)
|
|||||||
BattleGroundPlayerMap::iterator itr = m_Players.find(*(m_OfflineQueue.begin()));
|
BattleGroundPlayerMap::iterator itr = m_Players.find(*(m_OfflineQueue.begin()));
|
||||||
if (itr != m_Players.end())
|
if (itr != m_Players.end())
|
||||||
{
|
{
|
||||||
if (itr->second.OfflineRemoveTime <= sGameTime.GetGameTime())
|
if (itr->second.OfflineRemoveTime <= sWorld.GetGameTime())
|
||||||
{
|
{
|
||||||
RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
|
RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
|
||||||
m_OfflineQueue.pop_front(); // remove from offline queue
|
m_OfflineQueue.pop_front(); // remove from offline queue
|
||||||
@@ -1267,7 +1266,7 @@ void BattleGround::EventPlayerLoggedOut(Player* player)
|
|||||||
{
|
{
|
||||||
// player is correct pointer, it is checked in WorldSession::LogoutPlayer()
|
// player is correct pointer, it is checked in WorldSession::LogoutPlayer()
|
||||||
m_OfflineQueue.push_back(player->GetGUID());
|
m_OfflineQueue.push_back(player->GetGUID());
|
||||||
m_Players[player->GetGUID()].OfflineRemoveTime = sGameTime.GetGameTime() + MAX_OFFLINE_TIME;
|
m_Players[player->GetGUID()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME;
|
||||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||||
{
|
{
|
||||||
if (isBattleGround())
|
if (isBattleGround())
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
#include "GameEventMgr.h"
|
#include "GameEventMgr.h"
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
INSTANTIATE_SINGLETON_1( BattleGroundMgr );
|
INSTANTIATE_SINGLETON_1( BattleGroundMgr );
|
||||||
|
|
||||||
@@ -1225,10 +1224,10 @@ void BattleGroundMgr::Update(uint32 diff)
|
|||||||
{
|
{
|
||||||
if (m_AutoDistributionTimeChecker < diff)
|
if (m_AutoDistributionTimeChecker < diff)
|
||||||
{
|
{
|
||||||
if(sGameTime.GetGameTime() > m_NextAutoDistributionTime)
|
if(time(NULL) > m_NextAutoDistributionTime)
|
||||||
{
|
{
|
||||||
DistributeArenaPoints();
|
DistributeArenaPoints();
|
||||||
m_NextAutoDistributionTime = sGameTime.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||||
CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = '"UI64FMTD"'", m_NextAutoDistributionTime);
|
CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = '"UI64FMTD"'", m_NextAutoDistributionTime);
|
||||||
}
|
}
|
||||||
m_AutoDistributionTimeChecker = 600000; // check 10 minutes
|
m_AutoDistributionTimeChecker = 600000; // check 10 minutes
|
||||||
@@ -1761,7 +1760,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution()
|
|||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now.");
|
sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now.");
|
||||||
m_NextAutoDistributionTime = sGameTime.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
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 ('"UI64FMTD"')", m_NextAutoDistributionTime);
|
CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"UI64FMTD"')", m_NextAutoDistributionTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -250,8 +250,6 @@ SET(game_STAT_SRCS
|
|||||||
TaxiHandler.cpp
|
TaxiHandler.cpp
|
||||||
TemporarySummon.cpp
|
TemporarySummon.cpp
|
||||||
TemporarySummon.h
|
TemporarySummon.h
|
||||||
TimeMgr.cpp
|
|
||||||
TimeMgr.h
|
|
||||||
TicketHandler.cpp
|
TicketHandler.cpp
|
||||||
Tools.cpp
|
Tools.cpp
|
||||||
Tools.h
|
Tools.h
|
||||||
|
|||||||
@@ -24,13 +24,12 @@
|
|||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
|
void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
|
||||||
{
|
{
|
||||||
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty
|
sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty
|
||||||
|
|
||||||
time_t cur_time = sGameTime.GetGameTime();
|
time_t cur_time = time(NULL);
|
||||||
|
|
||||||
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR,4+4*0+4+4*0+4+4);
|
WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR,4+4*0+4+4*0+4+4);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include "UpdateMask.h"
|
#include "UpdateMask.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "ScriptCalls.h"
|
#include "ScriptCalls.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
class LoginQueryHolder : public SqlQueryHolder
|
class LoginQueryHolder : public SqlQueryHolder
|
||||||
{
|
{
|
||||||
@@ -76,7 +75,7 @@ bool LoginQueryHolder::Initialize()
|
|||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, "SELECT a.button,a.action,a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = '%u' ORDER BY button", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, "SELECT a.button,a.action,a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = '%u' ORDER BY button", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(m_guid),(uint64)sGameTime.GetGameTime());
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(m_guid),(uint64)time(NULL));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid));
|
||||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADHOMEBIND, "SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(m_guid));
|
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADHOMEBIND, "SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
#include "ScriptCalls.h"
|
#include "ScriptCalls.h"
|
||||||
#include "SpellAuras.h"
|
#include "SpellAuras.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg, uint32 lang)
|
bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg, uint32 lang)
|
||||||
{
|
{
|
||||||
@@ -167,7 +166,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
|||||||
|
|
||||||
if (!_player->CanSpeak())
|
if (!_player->CanSpeak())
|
||||||
{
|
{
|
||||||
std::string timeStr = secsToTimeString(m_muteTime - sGameTime.GetGameTime());
|
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
|
||||||
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
|
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -628,7 +627,7 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
|
|||||||
|
|
||||||
if (!GetPlayer()->CanSpeak())
|
if (!GetPlayer()->CanSpeak())
|
||||||
{
|
{
|
||||||
std::string timeStr = secsToTimeString(m_muteTime - sGameTime.GetGameTime());
|
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
|
||||||
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
|
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -27,7 +27,6 @@
|
|||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "GossipDef.h"
|
#include "GossipDef.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
Corpse::Corpse(CorpseType type) : WorldObject()
|
Corpse::Corpse(CorpseType type) : WorldObject()
|
||||||
, m_type(type)
|
, m_type(type)
|
||||||
@@ -39,7 +38,7 @@ Corpse::Corpse(CorpseType type) : WorldObject()
|
|||||||
|
|
||||||
m_valuesCount = CORPSE_END;
|
m_valuesCount = CORPSE_END;
|
||||||
|
|
||||||
m_time = sGameTime.GetGameTime();
|
m_time = time(NULL);
|
||||||
|
|
||||||
lootForBody = false;
|
lootForBody = false;
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@
|
|||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "GridDefines.h"
|
#include "GridDefines.h"
|
||||||
#include "LootMgr.h"
|
#include "LootMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
enum CorpseType
|
enum CorpseType
|
||||||
{
|
{
|
||||||
@@ -71,7 +70,7 @@ class Corpse : public WorldObject
|
|||||||
uint64 const& GetOwnerGUID() const { return GetUInt64Value(CORPSE_FIELD_OWNER); }
|
uint64 const& GetOwnerGUID() const { return GetUInt64Value(CORPSE_FIELD_OWNER); }
|
||||||
|
|
||||||
time_t const& GetGhostTime() const { return m_time; }
|
time_t const& GetGhostTime() const { return m_time; }
|
||||||
void ResetGhostTime() { m_time = sGameTime.GetGameTime(); }
|
void ResetGhostTime() { m_time = time(NULL); }
|
||||||
CorpseType GetType() const { return m_type; }
|
CorpseType GetType() const { return m_type; }
|
||||||
|
|
||||||
GridPair const& GetGrid() const { return m_grid; }
|
GridPair const& GetGrid() const { return m_grid; }
|
||||||
|
|||||||
+39
-51
@@ -47,7 +47,6 @@
|
|||||||
#include "GameEventMgr.h"
|
#include "GameEventMgr.h"
|
||||||
#include "CreatureGroups.h"
|
#include "CreatureGroups.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
// apply implementation of the singletons
|
// apply implementation of the singletons
|
||||||
#include "Policies/SingletonImp.h"
|
#include "Policies/SingletonImp.h"
|
||||||
|
|
||||||
@@ -62,38 +61,30 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
|
|||||||
|
|
||||||
bool VendorItemData::RemoveItem( uint32 item_id )
|
bool VendorItemData::RemoveItem( uint32 item_id )
|
||||||
{
|
{
|
||||||
ItemToSlotMap::iterator i = m_itemtoslot.find(item_id);
|
for (VendorItemList::iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||||
if (i != m_itemtoslot.end())
|
|
||||||
{
|
{
|
||||||
m_items.erase(m_items.begin() + i->second);
|
if((*i)->item==item_id)
|
||||||
|
{
|
||||||
//need to recount vendorslot
|
m_items.erase(i);
|
||||||
ItemToSlotMap::iterator itr;
|
|
||||||
for (itr = i; itr != m_itemtoslot.end();++itr)
|
|
||||||
itr->second -= 1;
|
|
||||||
//and delete
|
|
||||||
m_itemtoslot.erase(i);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 VendorItemData::FindItemSlot(uint32 item_id) const
|
size_t VendorItemData::FindItemSlot(uint32 item_id) const
|
||||||
{
|
{
|
||||||
ItemToSlotMap::const_iterator i = m_itemtoslot.find(item_id);
|
for (size_t i = 0; i < m_items.size(); ++i)
|
||||||
if (i != m_itemtoslot.end())
|
if (m_items[i]->item==item_id)
|
||||||
return i->second;
|
return i;
|
||||||
|
return m_items.size();
|
||||||
return uint8(m_items.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VendorItem const* VendorItemData::FindItem(uint32 item_id) const
|
VendorItem const* VendorItemData::FindItem(uint32 item_id) const
|
||||||
{
|
{
|
||||||
ItemToSlotMap::const_iterator i = m_itemtoslot.find(item_id);
|
for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||||
if (i != m_itemtoslot.end())
|
if((*i)->item==item_id)
|
||||||
return m_items[i->second];
|
return *i;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,8 +162,6 @@ m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL)
|
|||||||
|
|
||||||
Creature::~Creature()
|
Creature::~Creature()
|
||||||
{
|
{
|
||||||
for (VendorItemCounts::iterator itr = m_vendorItemCounts.begin(); itr != m_vendorItemCounts.end(); ++itr)
|
|
||||||
delete itr->second;
|
|
||||||
m_vendorItemCounts.clear();
|
m_vendorItemCounts.clear();
|
||||||
|
|
||||||
if(i_AI)
|
if(i_AI)
|
||||||
@@ -251,7 +240,7 @@ void Creature::RemoveCorpse()
|
|||||||
if (IsAIEnabled)
|
if (IsAIEnabled)
|
||||||
AI()->CorpseRemoved(respawnDelay);
|
AI()->CorpseRemoved(respawnDelay);
|
||||||
|
|
||||||
m_respawnTime = sGameTime.GetGameTime() + m_respawnDelay;
|
m_respawnTime = time(NULL) + m_respawnDelay;
|
||||||
|
|
||||||
float x,y,z,o;
|
float x,y,z,o;
|
||||||
GetRespawnCoord(x, y, z, &o);
|
GetRespawnCoord(x, y, z, &o);
|
||||||
@@ -451,7 +440,7 @@ void Creature::Update(uint32 diff)
|
|||||||
break;
|
break;
|
||||||
case DEAD:
|
case DEAD:
|
||||||
{
|
{
|
||||||
if( m_respawnTime <= sGameTime.GetGameTime() )
|
if( m_respawnTime <= time(NULL) )
|
||||||
{
|
{
|
||||||
if(!GetLinkedCreatureRespawnTime()) // Can respawn
|
if(!GetLinkedCreatureRespawnTime()) // Can respawn
|
||||||
Respawn();
|
Respawn();
|
||||||
@@ -462,7 +451,7 @@ void Creature::Update(uint32 diff)
|
|||||||
if(targetGuid == m_DBTableGuid) // if linking self, never respawn (check delayed to next day)
|
if(targetGuid == m_DBTableGuid) // if linking self, never respawn (check delayed to next day)
|
||||||
SetRespawnTime(DAY);
|
SetRespawnTime(DAY);
|
||||||
else
|
else
|
||||||
m_respawnTime = (sGameTime.GetGameTime()>GetLinkedCreatureRespawnTime()? sGameTime.GetGameTime():GetLinkedCreatureRespawnTime())+urand(5,MINUTE); // else copy time from master and add a little
|
m_respawnTime = (time(NULL)>GetLinkedCreatureRespawnTime()? time(NULL):GetLinkedCreatureRespawnTime())+urand(5,MINUTE); // else copy time from master and add a little
|
||||||
SaveRespawnTime(); // also save to DB immediately
|
SaveRespawnTime(); // also save to DB immediately
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -595,11 +584,6 @@ void Creature::Update(uint32 diff)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::SetRespawnTime(uint32 respawn)
|
|
||||||
{
|
|
||||||
m_respawnTime = respawn ? sGameTime.GetGameTime() + respawn : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Creature::RegenerateMana()
|
void Creature::RegenerateMana()
|
||||||
{
|
{
|
||||||
uint32 curValue = GetPower(POWER_MANA);
|
uint32 curValue = GetPower(POWER_MANA);
|
||||||
@@ -1886,10 +1870,10 @@ void Creature::SaveRespawnTime()
|
|||||||
if(isSummon() || !m_DBTableGuid || m_creatureData && !m_creatureData->dbData)
|
if(isSummon() || !m_DBTableGuid || m_creatureData && !m_creatureData->dbData)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(m_respawnTime > sGameTime.GetGameTime()) // dead (no corpse)
|
if(m_respawnTime > time(NULL)) // dead (no corpse)
|
||||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||||
else if(m_deathTimer > 0) // dead (corpse)
|
else if(m_deathTimer > 0) // dead (corpse)
|
||||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),sGameTime.GetGameTime()+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
|
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this should not be called by petAI or
|
// this should not be called by petAI or
|
||||||
@@ -2078,10 +2062,10 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid)
|
|||||||
modOwner->ApplySpellMod(spellid, SPELLMOD_COOLDOWN, cooldown);
|
modOwner->ApplySpellMod(spellid, SPELLMOD_COOLDOWN, cooldown);
|
||||||
|
|
||||||
if(cooldown)
|
if(cooldown)
|
||||||
_AddCreatureSpellCooldown(spellid, sGameTime.GetGameTime() + cooldown/IN_MILISECONDS);
|
_AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/IN_MILISECONDS);
|
||||||
|
|
||||||
if(spellInfo->Category)
|
if(spellInfo->Category)
|
||||||
_AddCreatureCategoryCooldown(spellInfo->Category, sGameTime.GetGameTime());
|
_AddCreatureCategoryCooldown(spellInfo->Category, time(NULL));
|
||||||
|
|
||||||
m_GlobalCooldown = spellInfo->StartRecoveryTime;
|
m_GlobalCooldown = spellInfo->StartRecoveryTime;
|
||||||
}
|
}
|
||||||
@@ -2097,13 +2081,13 @@ bool Creature::HasCategoryCooldown(uint32 spell_id) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
CreatureSpellCooldowns::const_iterator itr = m_CreatureCategoryCooldowns.find(spellInfo->Category);
|
CreatureSpellCooldowns::const_iterator itr = m_CreatureCategoryCooldowns.find(spellInfo->Category);
|
||||||
return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILISECONDS)) > sGameTime.GetGameTime());
|
return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILISECONDS)) > time(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature::HasSpellCooldown(uint32 spell_id) const
|
bool Creature::HasSpellCooldown(uint32 spell_id) const
|
||||||
{
|
{
|
||||||
CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spell_id);
|
CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spell_id);
|
||||||
return (itr != m_CreatureSpellCooldowns.end() && itr->second > sGameTime.GetGameTime()) || HasCategoryCooldown(spell_id);
|
return (itr != m_CreatureSpellCooldowns.end() && itr->second > time(NULL)) || HasCategoryCooldown(spell_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature::HasSpell(uint32 spellID) const
|
bool Creature::HasSpell(uint32 spellID) const
|
||||||
@@ -2117,7 +2101,7 @@ bool Creature::HasSpell(uint32 spellID) const
|
|||||||
|
|
||||||
time_t Creature::GetRespawnTimeEx() const
|
time_t Creature::GetRespawnTimeEx() const
|
||||||
{
|
{
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
if(m_respawnTime > now) // dead (no corpse)
|
if(m_respawnTime > now) // dead (no corpse)
|
||||||
return m_respawnTime;
|
return m_respawnTime;
|
||||||
else if(m_deathTimer > 0) // dead (corpse)
|
else if(m_deathTimer > 0) // dead (corpse)
|
||||||
@@ -2212,13 +2196,17 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
|||||||
if(!vItem->maxcount)
|
if(!vItem->maxcount)
|
||||||
return vItem->maxcount;
|
return vItem->maxcount;
|
||||||
|
|
||||||
VendorItemCounts::iterator itr = m_vendorItemCounts.find(vItem->item);
|
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||||
|
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||||
|
if(itr->itemId==vItem->item)
|
||||||
|
break;
|
||||||
|
|
||||||
if(itr == m_vendorItemCounts.end())
|
if(itr == m_vendorItemCounts.end())
|
||||||
return vItem->maxcount;
|
return vItem->maxcount;
|
||||||
|
|
||||||
VendorItemCount* vCount = itr->second;
|
VendorItemCount* vCount = &*itr;
|
||||||
|
|
||||||
time_t ptime = sGameTime.GetGameTime();
|
time_t ptime = time(NULL);
|
||||||
|
|
||||||
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
|
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
|
||||||
{
|
{
|
||||||
@@ -2227,7 +2215,6 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
|||||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
||||||
if((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount )
|
if((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount )
|
||||||
{
|
{
|
||||||
delete itr->second;
|
|
||||||
m_vendorItemCounts.erase(itr);
|
m_vendorItemCounts.erase(itr);
|
||||||
return vItem->maxcount;
|
return vItem->maxcount;
|
||||||
}
|
}
|
||||||
@@ -2244,17 +2231,21 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
|||||||
if(!vItem->maxcount)
|
if(!vItem->maxcount)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
VendorItemCounts::iterator itr = m_vendorItemCounts.find(vItem->item);
|
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||||
|
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||||
|
if(itr->itemId==vItem->item)
|
||||||
|
break;
|
||||||
|
|
||||||
if(itr == m_vendorItemCounts.end())
|
if(itr == m_vendorItemCounts.end())
|
||||||
{
|
{
|
||||||
uint32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0;
|
int32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0;
|
||||||
m_vendorItemCounts[vItem->item] = new VendorItemCount(new_count);
|
m_vendorItemCounts.push_back(VendorItemCount(vItem->item,new_count));
|
||||||
return new_count;
|
return new_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
VendorItemCount* vCount = itr->second;
|
VendorItemCount* vCount = &*itr;
|
||||||
|
|
||||||
time_t ptime = sGameTime.GetGameTime();
|
time_t ptime = time(NULL);
|
||||||
|
|
||||||
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
|
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
|
||||||
{
|
{
|
||||||
@@ -2331,6 +2322,3 @@ BaseHealthManaPair Creature::GenerateHealthMana()
|
|||||||
{
|
{
|
||||||
return objmgr.GenerateCreatureStats(getLevel(), GetCreatureInfo());
|
return objmgr.GenerateCreatureStats(getLevel(), GetCreatureInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
VendorItemCount::VendorItemCount() : count(0), lastIncrementTime(sGameTime.GetGameTime()) {}
|
|
||||||
VendorItemCount::VendorItemCount(uint32 _count) : count(_count), lastIncrementTime(sGameTime.GetGameTime()) {}
|
|
||||||
|
|||||||
+10
-16
@@ -28,7 +28,6 @@
|
|||||||
#include "LootMgr.h"
|
#include "LootMgr.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "Cell.h"
|
#include "Cell.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@@ -319,50 +318,45 @@ struct VendorItem
|
|||||||
uint32 ExtendedCost;
|
uint32 ExtendedCost;
|
||||||
};
|
};
|
||||||
typedef std::vector<VendorItem*> VendorItemList;
|
typedef std::vector<VendorItem*> VendorItemList;
|
||||||
typedef std::map<uint32, uint8> ItemToSlotMap;
|
|
||||||
|
|
||||||
struct VendorItemData
|
struct VendorItemData
|
||||||
{
|
{
|
||||||
VendorItemList m_items;
|
VendorItemList m_items;
|
||||||
ItemToSlotMap m_itemtoslot;
|
|
||||||
|
|
||||||
VendorItem* GetItem(uint8 slot) const
|
VendorItem* GetItem(uint32 slot) const
|
||||||
{
|
{
|
||||||
if(slot >= uint8(m_items.size()))
|
if(slot>=m_items.size()) return NULL;
|
||||||
return NULL;
|
|
||||||
return m_items[slot];
|
return m_items[slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Empty() const { return m_items.empty(); }
|
bool Empty() const { return m_items.empty(); }
|
||||||
uint8 GetItemCount() const { return uint8(m_items.size()); }
|
uint8 GetItemCount() const { return m_items.size(); }
|
||||||
void AddItem(uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 vendorslot)
|
void AddItem( uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost)
|
||||||
{
|
{
|
||||||
m_items.push_back(new VendorItem(item, maxcount, ptime, ExtendedCost));
|
m_items.push_back(new VendorItem(item, maxcount, ptime, ExtendedCost));
|
||||||
m_itemtoslot[item] = vendorslot;
|
|
||||||
}
|
}
|
||||||
bool RemoveItem( uint32 item_id );
|
bool RemoveItem( uint32 item_id );
|
||||||
VendorItem const* FindItem(uint32 item_id) const;
|
VendorItem const* FindItem(uint32 item_id) const;
|
||||||
uint8 FindItemSlot(uint32 item_id) const;
|
size_t FindItemSlot(uint32 item_id) const;
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
for (VendorItemList::const_iterator itr = m_items.begin(); itr != m_items.end(); ++itr)
|
for (VendorItemList::const_iterator itr = m_items.begin(); itr != m_items.end(); ++itr)
|
||||||
delete (*itr);
|
delete (*itr);
|
||||||
m_items.clear();
|
m_items.clear();
|
||||||
m_itemtoslot.clear();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VendorItemCount
|
struct VendorItemCount
|
||||||
{
|
{
|
||||||
VendorItemCount();
|
explicit VendorItemCount(uint32 _item, uint32 _count)
|
||||||
VendorItemCount(uint32 _count);
|
: itemId(_item), count(_count), lastIncrementTime(time(NULL)) {}
|
||||||
|
|
||||||
|
uint32 itemId;
|
||||||
uint32 count;
|
uint32 count;
|
||||||
time_t lastIncrementTime;
|
time_t lastIncrementTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<uint32, VendorItemCount*> VendorItemCounts;
|
typedef std::list<VendorItemCount> VendorItemCounts;
|
||||||
|
|
||||||
struct TrainerSpell
|
struct TrainerSpell
|
||||||
{
|
{
|
||||||
@@ -589,7 +583,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
|||||||
|
|
||||||
time_t const& GetRespawnTime() const { return m_respawnTime; }
|
time_t const& GetRespawnTime() const { return m_respawnTime; }
|
||||||
time_t GetRespawnTimeEx() const;
|
time_t GetRespawnTimeEx() const;
|
||||||
void SetRespawnTime(uint32 respawn);
|
void SetRespawnTime(uint32 respawn) { m_respawnTime = respawn ? time(NULL) + respawn : 0; }
|
||||||
void Respawn(bool force = false);
|
void Respawn(bool force = false);
|
||||||
void SaveRespawnTime();
|
void SaveRespawnTime();
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#define TRINITY_DESTINATION_HOLDER_H
|
#define TRINITY_DESTINATION_HOLDER_H
|
||||||
|
|
||||||
#include "Platform/Define.h"
|
#include "Platform/Define.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
class WorldObject;
|
class WorldObject;
|
||||||
class Map;
|
class Map;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "UpdateData.h"
|
#include "UpdateData.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
|
void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
|
||||||
{
|
{
|
||||||
@@ -48,7 +47,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
|
|||||||
DEBUG_LOG("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName());
|
DEBUG_LOG("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName());
|
||||||
DEBUG_LOG("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName());
|
DEBUG_LOG("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName());
|
||||||
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
pl->duel->startTimer = now;
|
pl->duel->startTimer = now;
|
||||||
plTarget->duel->startTimer = now;
|
plTarget->duel->startTimer = now;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include "GossipDef.h"
|
#include "GossipDef.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "BattleGroundMgr.h"
|
#include "BattleGroundMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
INSTANTIATE_SINGLETON_1(GameEventMgr);
|
INSTANTIATE_SINGLETON_1(GameEventMgr);
|
||||||
|
|
||||||
@@ -41,7 +40,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
|||||||
default:
|
default:
|
||||||
case GAMEEVENT_NORMAL:
|
case GAMEEVENT_NORMAL:
|
||||||
{
|
{
|
||||||
time_t currenttime = sGameTime.GetGameTime();
|
time_t currenttime = time(NULL);
|
||||||
// Get the event information
|
// Get the event information
|
||||||
return mGameEvent[entry].start < currenttime
|
return mGameEvent[entry].start < currenttime
|
||||||
&& currenttime < mGameEvent[entry].end
|
&& currenttime < mGameEvent[entry].end
|
||||||
@@ -58,7 +57,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
|||||||
// if inactive world event, check the prerequisite events
|
// if inactive world event, check the prerequisite events
|
||||||
case GAMEEVENT_WORLD_INACTIVE:
|
case GAMEEVENT_WORLD_INACTIVE:
|
||||||
{
|
{
|
||||||
time_t currenttime = sGameTime.GetGameTime();
|
time_t currenttime = time(NULL);
|
||||||
for (std::set<uint16>::const_iterator itr = mGameEvent[entry].prerequisite_events.begin(); itr != mGameEvent[entry].prerequisite_events.end(); ++itr)
|
for (std::set<uint16>::const_iterator itr = mGameEvent[entry].prerequisite_events.begin(); itr != mGameEvent[entry].prerequisite_events.end(); ++itr)
|
||||||
{
|
{
|
||||||
if( (mGameEvent[*itr].state != GAMEEVENT_WORLD_NEXTPHASE && mGameEvent[*itr].state != GAMEEVENT_WORLD_FINISHED) || // if prereq not in nextphase or finished state, then can't start this one
|
if( (mGameEvent[*itr].state != GAMEEVENT_WORLD_NEXTPHASE && mGameEvent[*itr].state != GAMEEVENT_WORLD_FINISHED) || // if prereq not in nextphase or finished state, then can't start this one
|
||||||
@@ -74,7 +73,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
|||||||
|
|
||||||
uint32 GameEventMgr::NextCheck(uint16 entry) const
|
uint32 GameEventMgr::NextCheck(uint16 entry) const
|
||||||
{
|
{
|
||||||
time_t currenttime = sGameTime.GetGameTime();
|
time_t currenttime = time(NULL);
|
||||||
|
|
||||||
// for NEXTPHASE state world events, return the delay to start the next event, so the followup event will be checked correctly
|
// for NEXTPHASE state world events, return the delay to start the next event, so the followup event will be checked correctly
|
||||||
if ((mGameEvent[entry].state == GAMEEVENT_WORLD_NEXTPHASE || mGameEvent[entry].state == GAMEEVENT_WORLD_FINISHED) && mGameEvent[entry].nextstart >= currenttime)
|
if ((mGameEvent[entry].state == GAMEEVENT_WORLD_NEXTPHASE || mGameEvent[entry].state == GAMEEVENT_WORLD_FINISHED) && mGameEvent[entry].nextstart >= currenttime)
|
||||||
@@ -129,7 +128,7 @@ bool GameEventMgr::StartEvent( uint16 event_id, bool overwrite )
|
|||||||
ApplyNewEvent(event_id);
|
ApplyNewEvent(event_id);
|
||||||
if(overwrite)
|
if(overwrite)
|
||||||
{
|
{
|
||||||
mGameEvent[event_id].start = sGameTime.GetGameTime();
|
mGameEvent[event_id].start = time(NULL);
|
||||||
if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
||||||
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
||||||
}
|
}
|
||||||
@@ -169,7 +168,7 @@ void GameEventMgr::StopEvent( uint16 event_id, bool overwrite )
|
|||||||
|
|
||||||
if(overwrite && !serverwide_evt)
|
if(overwrite && !serverwide_evt)
|
||||||
{
|
{
|
||||||
mGameEvent[event_id].start = sGameTime.GetGameTime() - mGameEvent[event_id].length * MINUTE;
|
mGameEvent[event_id].start = time(NULL) - mGameEvent[event_id].length * MINUTE;
|
||||||
if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
||||||
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
||||||
}
|
}
|
||||||
@@ -1046,7 +1045,7 @@ uint32 GameEventMgr::Initialize() // return the next e
|
|||||||
|
|
||||||
uint32 GameEventMgr::Update() // return the next event delay in ms
|
uint32 GameEventMgr::Update() // return the next event delay in ms
|
||||||
{
|
{
|
||||||
time_t currenttime = sGameTime.GetGameTime();
|
time_t currenttime = time(NULL);
|
||||||
uint32 nextEventDelay = max_ge_check_delay; // 1 day
|
uint32 nextEventDelay = max_ge_check_delay; // 1 day
|
||||||
uint32 calcDelay;
|
uint32 calcDelay;
|
||||||
std::set<uint16> activate, deactivate;
|
std::set<uint16> activate, deactivate;
|
||||||
@@ -1599,7 +1598,7 @@ bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id)
|
|||||||
// set the followup events' start time
|
// set the followup events' start time
|
||||||
if(!mGameEvent[event_id].nextstart)
|
if(!mGameEvent[event_id].nextstart)
|
||||||
{
|
{
|
||||||
time_t currenttime = sGameTime.GetGameTime();
|
time_t currenttime = time(NULL);
|
||||||
mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
|
mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+11
-27
@@ -39,7 +39,6 @@
|
|||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "OutdoorPvPMgr.h"
|
#include "OutdoorPvPMgr.h"
|
||||||
#include "BattleGroundAV.h"
|
#include "BattleGroundAV.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
GameObject::GameObject() : WorldObject(), m_goValue(new GameObjectValue)
|
GameObject::GameObject() : WorldObject(), m_goValue(new GameObjectValue)
|
||||||
{
|
{
|
||||||
@@ -226,14 +225,14 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||||||
// Arming Time for GAMEOBJECT_TYPE_TRAP (6)
|
// Arming Time for GAMEOBJECT_TYPE_TRAP (6)
|
||||||
Unit* owner = GetOwner();
|
Unit* owner = GetOwner();
|
||||||
if (owner && owner->isInCombat())
|
if (owner && owner->isInCombat())
|
||||||
m_cooldownTime = sGameTime.GetGameTime() + GetGOInfo()->trap.startDelay;
|
m_cooldownTime = time(NULL) + GetGOInfo()->trap.startDelay;
|
||||||
m_lootState = GO_READY;
|
m_lootState = GO_READY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GAMEOBJECT_TYPE_FISHINGNODE:
|
case GAMEOBJECT_TYPE_FISHINGNODE:
|
||||||
{
|
{
|
||||||
// fishing code (bobber ready)
|
// fishing code (bobber ready)
|
||||||
if( sGameTime.GetGameTime() > m_respawnTime - FISHING_BOBBER_READY_TIME )
|
if( time(NULL) > m_respawnTime - FISHING_BOBBER_READY_TIME )
|
||||||
{
|
{
|
||||||
// splash bobber (bobber ready now)
|
// splash bobber (bobber ready now)
|
||||||
Unit* caster = GetOwner();
|
Unit* caster = GetOwner();
|
||||||
@@ -265,7 +264,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||||||
{
|
{
|
||||||
if (m_respawnTime > 0) // timer on
|
if (m_respawnTime > 0) // timer on
|
||||||
{
|
{
|
||||||
if (m_respawnTime <= sGameTime.GetGameTime()) // timer expired
|
if (m_respawnTime <= time(NULL)) // timer expired
|
||||||
{
|
{
|
||||||
m_respawnTime = 0;
|
m_respawnTime = 0;
|
||||||
m_SkillupList.clear();
|
m_SkillupList.clear();
|
||||||
@@ -317,7 +316,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||||||
GameObjectInfo const* goInfo = GetGOInfo();
|
GameObjectInfo const* goInfo = GetGOInfo();
|
||||||
if(goInfo->type == GAMEOBJECT_TYPE_TRAP)
|
if(goInfo->type == GAMEOBJECT_TYPE_TRAP)
|
||||||
{
|
{
|
||||||
if(m_cooldownTime >= sGameTime.GetGameTime())
|
if(m_cooldownTime >= time(NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// traps
|
// traps
|
||||||
@@ -371,7 +370,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||||||
if(goInfo->trap.spellId)
|
if(goInfo->trap.spellId)
|
||||||
CastSpell(ok, goInfo->trap.spellId);
|
CastSpell(ok, goInfo->trap.spellId);
|
||||||
|
|
||||||
m_cooldownTime = sGameTime.GetGameTime() + 4; // 4 seconds
|
m_cooldownTime = time(NULL) + 4; // 4 seconds
|
||||||
|
|
||||||
// count charges
|
// count charges
|
||||||
//if(goInfo->trap.charges > 0)
|
//if(goInfo->trap.charges > 0)
|
||||||
@@ -407,7 +406,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||||||
{
|
{
|
||||||
case GAMEOBJECT_TYPE_DOOR:
|
case GAMEOBJECT_TYPE_DOOR:
|
||||||
case GAMEOBJECT_TYPE_BUTTON:
|
case GAMEOBJECT_TYPE_BUTTON:
|
||||||
if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < sGameTime.GetGameTime()))
|
if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < time(NULL)))
|
||||||
ResetDoorOrButton();
|
ResetDoorOrButton();
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
@@ -471,7 +470,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_respawnTime = sGameTime.GetGameTime() + m_respawnDelayTime;
|
m_respawnTime = time(NULL) + m_respawnDelayTime;
|
||||||
|
|
||||||
// if option not set then object will be saved at grid unload
|
// if option not set then object will be saved at grid unload
|
||||||
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
|
||||||
@@ -652,7 +651,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
|||||||
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
||||||
|
|
||||||
// ready to respawn
|
// ready to respawn
|
||||||
if(m_respawnTime && m_respawnTime <= sGameTime.GetGameTime())
|
if(m_respawnTime && m_respawnTime <= time(NULL))
|
||||||
{
|
{
|
||||||
m_respawnTime = 0;
|
m_respawnTime = 0;
|
||||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||||
@@ -736,7 +735,7 @@ Unit* GameObject::GetOwner(bool inWorld) const
|
|||||||
|
|
||||||
void GameObject::SaveRespawnTime()
|
void GameObject::SaveRespawnTime()
|
||||||
{
|
{
|
||||||
if(m_goData && m_goData->dbData && m_respawnTime > sGameTime.GetGameTime() && m_spawnedByDefault)
|
if(m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault)
|
||||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -792,26 +791,11 @@ bool GameObject::canDetectTrap(Player const* u, float distance) const
|
|||||||
return distance < visibleDistance;
|
return distance < visibleDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t GameObject::GetRespawnTimeEx() const
|
|
||||||
{
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
|
||||||
if(m_respawnTime > now)
|
|
||||||
return m_respawnTime;
|
|
||||||
else
|
|
||||||
return now;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GameObject::SetRespawnTime(int32 respawn)
|
|
||||||
{
|
|
||||||
m_respawnTime = respawn > 0 ? sGameTime.GetGameTime() + respawn : 0;
|
|
||||||
m_respawnDelayTime = respawn > 0 ? respawn : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GameObject::Respawn()
|
void GameObject::Respawn()
|
||||||
{
|
{
|
||||||
if(m_spawnedByDefault && m_respawnTime > 0)
|
if(m_spawnedByDefault && m_respawnTime > 0)
|
||||||
{
|
{
|
||||||
m_respawnTime = sGameTime.GetGameTime();
|
m_respawnTime = time(NULL);
|
||||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -936,7 +920,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
|
|||||||
SwitchDoorOrButton(true,alternative);
|
SwitchDoorOrButton(true,alternative);
|
||||||
SetLootState(GO_ACTIVATED);
|
SetLootState(GO_ACTIVATED);
|
||||||
|
|
||||||
m_cooldownTime = sGameTime.GetGameTime() + time_to_restore;
|
m_cooldownTime = time(NULL) + time_to_restore;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameObject::SetGoArtKit(uint8 kit)
|
void GameObject::SetGoArtKit(uint8 kit)
|
||||||
|
|||||||
+13
-4
@@ -25,7 +25,6 @@
|
|||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "Object.h"
|
#include "Object.h"
|
||||||
#include "LootMgr.h"
|
#include "LootMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
|
|
||||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
|
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
|
||||||
@@ -641,10 +640,20 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
|
|||||||
uint32 GetSpellId() const { return m_spellId;}
|
uint32 GetSpellId() const { return m_spellId;}
|
||||||
|
|
||||||
time_t GetRespawnTime() const { return m_respawnTime; }
|
time_t GetRespawnTime() const { return m_respawnTime; }
|
||||||
time_t GetRespawnTimeEx() const;
|
time_t GetRespawnTimeEx() const
|
||||||
|
{
|
||||||
void SetRespawnTime(int32 respawn);
|
time_t now = time(NULL);
|
||||||
|
if(m_respawnTime > now)
|
||||||
|
return m_respawnTime;
|
||||||
|
else
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetRespawnTime(int32 respawn)
|
||||||
|
{
|
||||||
|
m_respawnTime = respawn > 0 ? time(NULL) + respawn : 0;
|
||||||
|
m_respawnDelayTime = respawn > 0 ? respawn : 0;
|
||||||
|
}
|
||||||
void Respawn();
|
void Respawn();
|
||||||
bool isSpawned() const
|
bool isSpawned() const
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
#define TRINITY_GUARDAI_H
|
#define TRINITY_GUARDAI_H
|
||||||
|
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
class Creature;
|
class Creature;
|
||||||
|
|
||||||
|
|||||||
+10
-11
@@ -30,7 +30,6 @@
|
|||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include "Config/ConfigEnv.h"
|
#include "Config/ConfigEnv.h"
|
||||||
|
|
||||||
Guild::Guild()
|
Guild::Guild()
|
||||||
@@ -169,7 +168,7 @@ bool Guild::AddMember(uint64 plGuid, uint32 plRank)
|
|||||||
newmember.RankId = plRank;
|
newmember.RankId = plRank;
|
||||||
newmember.OFFnote = (std::string)"";
|
newmember.OFFnote = (std::string)"";
|
||||||
newmember.Pnote = (std::string)"";
|
newmember.Pnote = (std::string)"";
|
||||||
newmember.LogoutTime = sGameTime.GetGameTime();
|
newmember.LogoutTime = time(NULL);
|
||||||
newmember.BankResetTimeMoney = 0; // this will force update at first query
|
newmember.BankResetTimeMoney = 0; // this will force update at first query
|
||||||
for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
||||||
newmember.BankResetTimeTab[i] = 0;
|
newmember.BankResetTimeTab[i] = 0;
|
||||||
@@ -773,7 +772,7 @@ void Guild::Roster(WorldSession *session /*= NULL*/)
|
|||||||
data << uint8(itr->second.Class);
|
data << uint8(itr->second.Class);
|
||||||
data << uint8(0); // new 2.4.0
|
data << uint8(0); // new 2.4.0
|
||||||
data << uint32(itr->second.ZoneId);
|
data << uint32(itr->second.ZoneId);
|
||||||
data << float(float(sGameTime.GetGameTime()-itr->second.LogoutTime) / DAY);
|
data << float(float(time(NULL)-itr->second.LogoutTime) / DAY);
|
||||||
data << itr->second.Pnote;
|
data << itr->second.Pnote;
|
||||||
data << itr->second.OFFnote;
|
data << itr->second.OFFnote;
|
||||||
}
|
}
|
||||||
@@ -828,7 +827,7 @@ void Guild::UpdateLogoutTime(uint64 guid)
|
|||||||
if (itr == members.end())
|
if (itr == members.end())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
itr->second.LogoutTime = sGameTime.GetGameTime();
|
itr->second.LogoutTime = time(NULL);
|
||||||
|
|
||||||
if (m_OnlineMembers > 0)
|
if (m_OnlineMembers > 0)
|
||||||
--m_OnlineMembers;
|
--m_OnlineMembers;
|
||||||
@@ -866,7 +865,7 @@ void Guild::DisplayGuildEventLog(WorldSession *session)
|
|||||||
if (itr->EventType == GUILD_EVENT_LOG_PROMOTE_PLAYER || itr->EventType == GUILD_EVENT_LOG_DEMOTE_PLAYER)
|
if (itr->EventType == GUILD_EVENT_LOG_PROMOTE_PLAYER || itr->EventType == GUILD_EVENT_LOG_DEMOTE_PLAYER)
|
||||||
data << uint8(itr->NewRank);
|
data << uint8(itr->NewRank);
|
||||||
// Event timestamp
|
// Event timestamp
|
||||||
data << uint32(sGameTime.GetGameTime()-itr->TimeStamp);
|
data << uint32(time(NULL)-itr->TimeStamp);
|
||||||
}
|
}
|
||||||
session->SendPacket(&data);
|
session->SendPacket(&data);
|
||||||
sLog.outDebug("WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)");
|
sLog.outDebug("WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)");
|
||||||
@@ -934,7 +933,7 @@ void Guild::LogGuildEvent(uint8 EventType, uint32 PlayerGuid1, uint32 PlayerGuid
|
|||||||
NewEvent.PlayerGuid1 = PlayerGuid1;
|
NewEvent.PlayerGuid1 = PlayerGuid1;
|
||||||
NewEvent.PlayerGuid2 = PlayerGuid2;
|
NewEvent.PlayerGuid2 = PlayerGuid2;
|
||||||
NewEvent.NewRank = NewRank;
|
NewEvent.NewRank = NewRank;
|
||||||
NewEvent.TimeStamp = uint32(sGameTime.GetGameTime());
|
NewEvent.TimeStamp = uint32(time(NULL));
|
||||||
// Count new LogGuid
|
// Count new LogGuid
|
||||||
m_GuildEventLogNextGuid = (m_GuildEventLogNextGuid + 1) % sWorld.getConfig(CONFIG_GUILD_EVENT_LOG_COUNT);
|
m_GuildEventLogNextGuid = (m_GuildEventLogNextGuid + 1) % sWorld.getConfig(CONFIG_GUILD_EVENT_LOG_COUNT);
|
||||||
// Check max records limit
|
// Check max records limit
|
||||||
@@ -1347,7 +1346,7 @@ uint32 Guild::GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId)
|
|||||||
if ((GetBankRights(itr->second.RankId,TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
if ((GetBankRights(itr->second.RankId,TabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GUILD_BANK_RIGHT_VIEW_TAB)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint32 curTime = uint32(sGameTime.GetGameTime()/MINUTE);
|
uint32 curTime = uint32(time(NULL)/MINUTE);
|
||||||
if (curTime - itr->second.BankResetTimeTab[TabId] >= 24*HOUR/MINUTE)
|
if (curTime - itr->second.BankResetTimeTab[TabId] >= 24*HOUR/MINUTE)
|
||||||
{
|
{
|
||||||
itr->second.BankResetTimeTab[TabId] = curTime;
|
itr->second.BankResetTimeTab[TabId] = curTime;
|
||||||
@@ -1367,7 +1366,7 @@ uint32 Guild::GetMemberMoneyWithdrawRem(uint32 LowGuid)
|
|||||||
if (itr->second.RankId == GR_GUILDMASTER)
|
if (itr->second.RankId == GR_GUILDMASTER)
|
||||||
return WITHDRAW_MONEY_UNLIMITED;
|
return WITHDRAW_MONEY_UNLIMITED;
|
||||||
|
|
||||||
uint32 curTime = uint32(sGameTime.GetGameTime()/MINUTE); // minutes
|
uint32 curTime = uint32(time(NULL)/MINUTE); // minutes
|
||||||
// 24 hours
|
// 24 hours
|
||||||
if (curTime > itr->second.BankResetTimeMoney + 24*HOUR/MINUTE)
|
if (curTime > itr->second.BankResetTimeMoney + 24*HOUR/MINUTE)
|
||||||
{
|
{
|
||||||
@@ -1601,7 +1600,7 @@ void Guild::DisplayGuildBankLogs(WorldSession *session, uint8 TabId)
|
|||||||
if (itr->EventType == GUILD_BANK_LOG_MOVE_ITEM || itr->EventType == GUILD_BANK_LOG_MOVE_ITEM2)
|
if (itr->EventType == GUILD_BANK_LOG_MOVE_ITEM || itr->EventType == GUILD_BANK_LOG_MOVE_ITEM2)
|
||||||
data << uint8(itr->DestTabId); // moved tab
|
data << uint8(itr->DestTabId); // moved tab
|
||||||
}
|
}
|
||||||
data << uint32(sGameTime.GetGameTime() - itr->TimeStamp);
|
data << uint32(time(NULL) - itr->TimeStamp);
|
||||||
}
|
}
|
||||||
session->SendPacket(&data);
|
session->SendPacket(&data);
|
||||||
}
|
}
|
||||||
@@ -1631,7 +1630,7 @@ void Guild::DisplayGuildBankLogs(WorldSession *session, uint8 TabId)
|
|||||||
if (itr->EventType == GUILD_BANK_LOG_MOVE_ITEM || itr->EventType == GUILD_BANK_LOG_MOVE_ITEM2)
|
if (itr->EventType == GUILD_BANK_LOG_MOVE_ITEM || itr->EventType == GUILD_BANK_LOG_MOVE_ITEM2)
|
||||||
data << uint8(itr->DestTabId); // moved tab
|
data << uint8(itr->DestTabId); // moved tab
|
||||||
}
|
}
|
||||||
data << uint32(sGameTime.GetGameTime() - itr->TimeStamp);
|
data << uint32(time(NULL) - itr->TimeStamp);
|
||||||
}
|
}
|
||||||
session->SendPacket(&data);
|
session->SendPacket(&data);
|
||||||
}
|
}
|
||||||
@@ -1647,7 +1646,7 @@ void Guild::LogBankEvent(uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uin
|
|||||||
NewEvent.ItemOrMoney = ItemOrMoney;
|
NewEvent.ItemOrMoney = ItemOrMoney;
|
||||||
NewEvent.ItemStackCount = ItemStackCount;
|
NewEvent.ItemStackCount = ItemStackCount;
|
||||||
NewEvent.DestTabId = DestTabId;
|
NewEvent.DestTabId = DestTabId;
|
||||||
NewEvent.TimeStamp = uint32(sGameTime.GetGameTime());
|
NewEvent.TimeStamp = uint32(time(NULL));
|
||||||
|
|
||||||
//add new event to the end of event list
|
//add new event to the end of event list
|
||||||
uint32 currentTabId = TabId;
|
uint32 currentTabId = TabId;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "MapManager.h"
|
#include "MapManager.h"
|
||||||
#include "MapInstanced.h"
|
#include "MapInstanced.h"
|
||||||
#include "InstanceSaveMgr.h"
|
#include "InstanceSaveMgr.h"
|
||||||
|
#include "Timer.h"
|
||||||
#include "GridNotifiersImpl.h"
|
#include "GridNotifiersImpl.h"
|
||||||
#include "Config/ConfigEnv.h"
|
#include "Config/ConfigEnv.h"
|
||||||
#include "Transports.h"
|
#include "Transports.h"
|
||||||
@@ -38,7 +39,6 @@
|
|||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "Group.h"
|
#include "Group.h"
|
||||||
#include "InstanceData.h"
|
#include "InstanceData.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
#include "Policies/Singleton.h"
|
#include "Policies/Singleton.h"
|
||||||
#include "Policies/SingletonImp.h"
|
#include "Policies/SingletonImp.h"
|
||||||
@@ -109,7 +109,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
|
|||||||
resetTime = GetResetTimeFor(mapId,difficulty);
|
resetTime = GetResetTimeFor(mapId,difficulty);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resetTime = sGameTime.GetGameTime() + 2 * HOUR;
|
resetTime = time(NULL) + 2 * HOUR;
|
||||||
// normally this will be removed soon after in InstanceMap::Add, prevent error
|
// normally this will be removed soon after in InstanceMap::Add, prevent error
|
||||||
ScheduleReset(true, resetTime, InstResetEvent(0, mapId, difficulty, instanceId));
|
ScheduleReset(true, resetTime, InstResetEvent(0, mapId, difficulty, instanceId));
|
||||||
}
|
}
|
||||||
@@ -259,7 +259,7 @@ void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const
|
|||||||
|
|
||||||
void InstanceSaveManager::CleanupInstances()
|
void InstanceSaveManager::CleanupInstances()
|
||||||
{
|
{
|
||||||
uint64 now = (uint64)sGameTime.GetGameTime();
|
uint64 now = (uint64)time(NULL);
|
||||||
|
|
||||||
barGoLink bar(2);
|
barGoLink bar(2);
|
||||||
bar.step();
|
bar.step();
|
||||||
@@ -406,7 +406,7 @@ void InstanceSaveManager::PackInstances()
|
|||||||
|
|
||||||
void InstanceSaveManager::LoadResetTimes()
|
void InstanceSaveManager::LoadResetTimes()
|
||||||
{
|
{
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
time_t today = (now / DAY) * DAY;
|
time_t today = (now / DAY) * DAY;
|
||||||
|
|
||||||
// NOTE: Use DirectPExecute for tables that will be queried later
|
// NOTE: Use DirectPExecute for tables that will be queried later
|
||||||
@@ -571,7 +571,7 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev
|
|||||||
|
|
||||||
void InstanceSaveManager::Update()
|
void InstanceSaveManager::Update()
|
||||||
{
|
{
|
||||||
time_t now = sGameTime.GetGameTime(), t;
|
time_t now = time(NULL), t;
|
||||||
while(!m_resetTimeQueue.empty() && (t = m_resetTimeQueue.begin()->first) < now)
|
while(!m_resetTimeQueue.empty() && (t = m_resetTimeQueue.begin()->first) < now)
|
||||||
{
|
{
|
||||||
InstResetEvent &event = m_resetTimeQueue.begin()->second;
|
InstResetEvent &event = m_resetTimeQueue.begin()->second;
|
||||||
@@ -643,7 +643,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
|||||||
if (!mapEntry->Instanceable())
|
if (!mapEntry->Instanceable())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint64 now = (uint64)sGameTime.GetGameTime();
|
uint64 now = (uint64)time(NULL);
|
||||||
|
|
||||||
if(!warn)
|
if(!warn)
|
||||||
{
|
{
|
||||||
|
|||||||
+10
-3
@@ -30,7 +30,6 @@
|
|||||||
#include "SystemConfig.h"
|
#include "SystemConfig.h"
|
||||||
#include "revision.h"
|
#include "revision.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
bool ChatHandler::HandleHelpCommand(const char* args)
|
bool ChatHandler::HandleHelpCommand(const char* args)
|
||||||
{
|
{
|
||||||
@@ -100,14 +99,22 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
|
|||||||
uint32 queuedClientsNum = sWorld.GetQueuedSessionCount();
|
uint32 queuedClientsNum = sWorld.GetQueuedSessionCount();
|
||||||
uint32 maxActiveClientsNum = sWorld.GetMaxActiveSessionCount();
|
uint32 maxActiveClientsNum = sWorld.GetMaxActiveSessionCount();
|
||||||
uint32 maxQueuedClientsNum = sWorld.GetMaxQueuedSessionCount();
|
uint32 maxQueuedClientsNum = sWorld.GetMaxQueuedSessionCount();
|
||||||
std::string str = secsToTimeString(sGameTime.GetUptime());
|
std::string uptime = secsToTimeString(sWorld.GetUptime());
|
||||||
uint32 updateTime = sWorld.GetUpdateTime();
|
uint32 updateTime = sWorld.GetUpdateTime();
|
||||||
|
|
||||||
PSendSysMessage(_FULLVERSION);
|
PSendSysMessage(_FULLVERSION);
|
||||||
|
//if(m_session)
|
||||||
|
// full = _FULLVERSION(REVISION_DATE,REVISION_TIME,"|cffffffff|Hurl:" REVISION_ID "|h" REVISION_ID "|h|r");
|
||||||
|
//else
|
||||||
|
// full = _FULLVERSION(REVISION_DATE,REVISION_TIME,REVISION_ID);
|
||||||
|
|
||||||
|
//SendSysMessage(full);
|
||||||
|
//PSendSysMessage(LANG_USING_SCRIPT_LIB,sWorld.GetScriptsVersion());
|
||||||
|
//PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion());
|
||||||
|
//PSendSysMessage(LANG_USING_EVENT_AI,sWorld.GetCreatureEventAIVersion());
|
||||||
PSendSysMessage(LANG_CONNECTED_PLAYERS, PlayersNum, MaxPlayersNum);
|
PSendSysMessage(LANG_CONNECTED_PLAYERS, PlayersNum, MaxPlayersNum);
|
||||||
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
|
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
|
||||||
PSendSysMessage(LANG_UPTIME, str.c_str());
|
PSendSysMessage(LANG_UPTIME, uptime.c_str());
|
||||||
PSendSysMessage("Update time diff: %u.", updateTime);
|
PSendSysMessage("Update time diff: %u.", updateTime);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+5
-5
@@ -42,7 +42,7 @@
|
|||||||
#include "GlobalEvents.h"
|
#include "GlobalEvents.h"
|
||||||
#include "OutdoorPvPWG.h"
|
#include "OutdoorPvPWG.h"
|
||||||
#include "OutdoorPvPMgr.h"
|
#include "OutdoorPvPMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||||
#include "CreatureGroups.h"
|
#include "CreatureGroups.h"
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
|||||||
if(HasLowerSecurity (target,target_guid,true))
|
if(HasLowerSecurity (target,target_guid,true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
time_t mutetime = sGameTime.GetGameTime() + notspeaktime*60;
|
time_t mutetime = time(NULL) + notspeaktime*60;
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
target->GetSession()->m_muteTime = mutetime;
|
target->GetSession()->m_muteTime = mutetime;
|
||||||
@@ -536,7 +536,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
|||||||
|
|
||||||
if(target)
|
if(target)
|
||||||
{
|
{
|
||||||
int32 curRespawnDelay = target->GetRespawnTimeEx()-sGameTime.GetGameTime();
|
int32 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
|
||||||
if(curRespawnDelay < 0)
|
if(curRespawnDelay < 0)
|
||||||
curRespawnDelay = 0;
|
curRespawnDelay = 0;
|
||||||
|
|
||||||
@@ -3502,8 +3502,8 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
|
|||||||
std::string endTimeStr = TimeToTimestampStr(eventData.end);
|
std::string endTimeStr = TimeToTimestampStr(eventData.end);
|
||||||
|
|
||||||
uint32 delay = gameeventmgr.NextCheck(event_id);
|
uint32 delay = gameeventmgr.NextCheck(event_id);
|
||||||
time_t nextTime = sGameTime.GetGameTime()+delay;
|
time_t nextTime = time(NULL)+delay;
|
||||||
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(sGameTime.GetGameTime()+delay) : "-";
|
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(NULL)+delay) : "-";
|
||||||
|
|
||||||
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE);
|
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE);
|
||||||
std::string lengthStr = secsToTimeString(eventData.length * MINUTE);
|
std::string lengthStr = secsToTimeString(eventData.length * MINUTE);
|
||||||
|
|||||||
+5
-6
@@ -55,7 +55,6 @@
|
|||||||
#include "AuctionHouseBot.h"
|
#include "AuctionHouseBot.h"
|
||||||
#include "CreatureEventAIMgr.h"
|
#include "CreatureEventAIMgr.h"
|
||||||
#include "DBCEnums.h"
|
#include "DBCEnums.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
bool ChatHandler::HandleAHBotOptionsCommand(const char *args)
|
bool ChatHandler::HandleAHBotOptionsCommand(const char *args)
|
||||||
{
|
{
|
||||||
@@ -4615,7 +4614,7 @@ bool ChatHandler::HandleNpcInfoCommand(const char* /*args*/)
|
|||||||
uint32 Entry = target->GetEntry();
|
uint32 Entry = target->GetEntry();
|
||||||
CreatureInfo const* cInfo = target->GetCreatureInfo();
|
CreatureInfo const* cInfo = target->GetCreatureInfo();
|
||||||
|
|
||||||
int32 curRespawnDelay = target->GetRespawnTimeEx()-sGameTime.GetGameTime();
|
int32 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
|
||||||
if(curRespawnDelay < 0)
|
if(curRespawnDelay < 0)
|
||||||
curRespawnDelay = 0;
|
curRespawnDelay = 0;
|
||||||
std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay,true);
|
std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay,true);
|
||||||
@@ -5975,7 +5974,7 @@ bool ChatHandler::HandleBanInfoHelper(uint32 accountid, char const* accountname)
|
|||||||
|
|
||||||
time_t unbandate = time_t(fields[3].GetUInt64());
|
time_t unbandate = time_t(fields[3].GetUInt64());
|
||||||
bool active = false;
|
bool active = false;
|
||||||
if(fields[2].GetBool() && (fields[1].GetUInt64() == (uint64)0 ||unbandate >= sGameTime.GetGameTime()) )
|
if(fields[2].GetBool() && (fields[1].GetUInt64() == (uint64)0 ||unbandate >= time(NULL)) )
|
||||||
active = true;
|
active = true;
|
||||||
bool permanent = (fields[1].GetUInt64() == (uint64)0);
|
bool permanent = (fields[1].GetUInt64() == (uint64)0);
|
||||||
std::string bantime = permanent?GetTrinityString(LANG_BANINFO_INFINITE):secsToTimeString(fields[1].GetUInt64(), true);
|
std::string bantime = permanent?GetTrinityString(LANG_BANINFO_INFINITE):secsToTimeString(fields[1].GetUInt64(), true);
|
||||||
@@ -6825,7 +6824,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
|
|||||||
for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||||
{
|
{
|
||||||
InstanceSave *save = itr->second.save;
|
InstanceSave *save = itr->second.save;
|
||||||
std::string timeleft = GetTimeString(save->GetResetTime() - sGameTime.GetGameTime());
|
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||||
PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
|
PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
@@ -6841,7 +6840,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
|
|||||||
for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||||
{
|
{
|
||||||
InstanceSave *save = itr->second.save;
|
InstanceSave *save = itr->second.save;
|
||||||
std::string timeleft = GetTimeString(save->GetResetTime() - sGameTime.GetGameTime());
|
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||||
PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++;
|
PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6870,7 +6869,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
|
|||||||
if(itr->first != player->GetMapId())
|
if(itr->first != player->GetMapId())
|
||||||
{
|
{
|
||||||
InstanceSave *save = itr->second.save;
|
InstanceSave *save = itr->second.save;
|
||||||
std::string timeleft = GetTimeString(save->GetResetTime() - sGameTime.GetGameTime());
|
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||||
PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
|
PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||||
player->UnbindInstance(itr, Difficulty(i));
|
player->UnbindInstance(itr, Difficulty(i));
|
||||||
counter++;
|
counter++;
|
||||||
|
|||||||
+9
-10
@@ -34,7 +34,6 @@
|
|||||||
#include "BattleGroundMgr.h"
|
#include "BattleGroundMgr.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
#include "AuctionHouseMgr.h"
|
#include "AuctionHouseMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
enum MailShowFlags
|
enum MailShowFlags
|
||||||
{
|
{
|
||||||
@@ -284,7 +283,7 @@ void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data )
|
|||||||
if (pl->unReadMails)
|
if (pl->unReadMails)
|
||||||
--pl->unReadMails;
|
--pl->unReadMails;
|
||||||
m->checked = m->checked | MAIL_CHECK_MASK_READ;
|
m->checked = m->checked | MAIL_CHECK_MASK_READ;
|
||||||
// m->expire_time = sGameTime.GetGameTime() + (30 * DAY); // Expire time do not change at reading mail
|
// m->expire_time = time(NULL) + (30 * DAY); // Expire time do not change at reading mail
|
||||||
pl->m_mailsUpdated = true;
|
pl->m_mailsUpdated = true;
|
||||||
m->state = MAIL_STATE_CHANGED;
|
m->state = MAIL_STATE_CHANGED;
|
||||||
}
|
}
|
||||||
@@ -332,7 +331,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data )
|
|||||||
|
|
||||||
Player *pl = _player;
|
Player *pl = _player;
|
||||||
Mail *m = pl->GetMail(mailId);
|
Mail *m = pl->GetMail(mailId);
|
||||||
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > sGameTime.GetGameTime())
|
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
|
||||||
{
|
{
|
||||||
pl->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR);
|
pl->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
@@ -394,7 +393,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
|
|||||||
Player* pl = _player;
|
Player* pl = _player;
|
||||||
|
|
||||||
Mail* m = pl->GetMail(mailId);
|
Mail* m = pl->GetMail(mailId);
|
||||||
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > sGameTime.GetGameTime())
|
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
|
||||||
{
|
{
|
||||||
pl->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_INTERNAL_ERROR);
|
pl->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
@@ -487,7 +486,7 @@ void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data )
|
|||||||
Player *pl = _player;
|
Player *pl = _player;
|
||||||
|
|
||||||
Mail* m = pl->GetMail(mailId);
|
Mail* m = pl->GetMail(mailId);
|
||||||
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > sGameTime.GetGameTime())
|
if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
|
||||||
{
|
{
|
||||||
pl->SendMailResult(mailId, MAIL_MONEY_TAKEN, MAIL_ERR_INTERNAL_ERROR);
|
pl->SendMailResult(mailId, MAIL_MONEY_TAKEN, MAIL_ERR_INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
@@ -531,7 +530,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
|||||||
WorldPacket data(SMSG_MAIL_LIST_RESULT, (200)); // guess size
|
WorldPacket data(SMSG_MAIL_LIST_RESULT, (200)); // guess size
|
||||||
data << uint32(0); // real mail's count
|
data << uint32(0); // real mail's count
|
||||||
data << uint8(0); // mail's count
|
data << uint8(0); // mail's count
|
||||||
time_t cur_time = sGameTime.GetGameTime();
|
time_t cur_time = time(NULL);
|
||||||
|
|
||||||
for (PlayerMails::iterator itr = pl->GetMailBegin(); itr != pl->GetMailEnd(); ++itr)
|
for (PlayerMails::iterator itr = pl->GetMailBegin(); itr != pl->GetMailEnd(); ++itr)
|
||||||
{
|
{
|
||||||
@@ -589,7 +588,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
|||||||
data << uint32((*itr)->stationery); // stationery (Stationery.dbc)
|
data << uint32((*itr)->stationery); // stationery (Stationery.dbc)
|
||||||
data << uint32((*itr)->money); // Gold
|
data << uint32((*itr)->money); // Gold
|
||||||
data << uint32(show_flags); // unknown, 0x4 - auction, 0x10 - normal
|
data << uint32(show_flags); // unknown, 0x4 - auction, 0x10 - normal
|
||||||
data << float(((*itr)->expire_time-sGameTime.GetGameTime())/DAY); // Time
|
data << float(((*itr)->expire_time-time(NULL))/DAY); // Time
|
||||||
data << uint32((*itr)->mailTemplateId); // mail template (MailTemplate.dbc)
|
data << uint32((*itr)->mailTemplateId); // mail template (MailTemplate.dbc)
|
||||||
data << (*itr)->subject; // Subject string - once 00, when mail type = 3
|
data << (*itr)->subject; // Subject string - once 00, when mail type = 3
|
||||||
data << uint8(item_count); // client limit is 0x10
|
data << uint8(item_count); // client limit is 0x10
|
||||||
@@ -675,7 +674,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data )
|
|||||||
Player *pl = _player;
|
Player *pl = _player;
|
||||||
|
|
||||||
Mail* m = pl->GetMail(mailId);
|
Mail* m = pl->GetMail(mailId);
|
||||||
if (!m || !m->itemTextId && !m->mailTemplateId || m->state == MAIL_STATE_DELETED || m->deliver_time > sGameTime.GetGameTime())
|
if (!m || !m->itemTextId && !m->mailTemplateId || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL))
|
||||||
{
|
{
|
||||||
pl->SendMailResult(mailId, MAIL_MADE_PERMANENT, MAIL_ERR_INTERNAL_ERROR);
|
pl->SendMailResult(mailId, MAIL_MADE_PERMANENT, MAIL_ERR_INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
@@ -741,7 +740,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/ )
|
|||||||
data << uint32(0); // count
|
data << uint32(0); // count
|
||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
for (PlayerMails::iterator itr = _player->GetMailBegin(); itr != _player->GetMailEnd(); ++itr)
|
for (PlayerMails::iterator itr = _player->GetMailBegin(); itr != _player->GetMailEnd(); ++itr)
|
||||||
{
|
{
|
||||||
Mail *m = (*itr);
|
Mail *m = (*itr);
|
||||||
@@ -930,7 +929,7 @@ void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sende
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t deliver_time = sGameTime.GetGameTime() + deliver_delay;
|
time_t deliver_time = time(NULL) + deliver_delay;
|
||||||
|
|
||||||
//expire time if COD 3 days, if no COD 30 days, if auction sale pending 1 hour
|
//expire time if COD 3 days, if no COD 30 days, if auction sale pending 1 hour
|
||||||
uint32 expire_delay;
|
uint32 expire_delay;
|
||||||
|
|||||||
+3
-3
@@ -3135,7 +3135,7 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O
|
|||||||
sa.ownerGUID = ownerGUID;
|
sa.ownerGUID = ownerGUID;
|
||||||
|
|
||||||
sa.script = &iter->second;
|
sa.script = &iter->second;
|
||||||
m_scriptSchedule.insert(std::pair<time_t, ScriptAction>(time_t(sGameTime.GetGameTime() + iter->first), sa));
|
m_scriptSchedule.insert(std::pair<time_t, ScriptAction>(time_t(sWorld.GetGameTime() + iter->first), sa));
|
||||||
if (iter->first == 0)
|
if (iter->first == 0)
|
||||||
immedScript = true;
|
immedScript = true;
|
||||||
|
|
||||||
@@ -3165,7 +3165,7 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
|
|||||||
sa.ownerGUID = ownerGUID;
|
sa.ownerGUID = ownerGUID;
|
||||||
|
|
||||||
sa.script = &script;
|
sa.script = &script;
|
||||||
m_scriptSchedule.insert(std::pair<time_t, ScriptAction>(time_t(sGameTime.GetGameTime() + delay), sa));
|
m_scriptSchedule.insert(std::pair<time_t, ScriptAction>(time_t(sWorld.GetGameTime() + delay), sa));
|
||||||
|
|
||||||
sWorld.IncreaseScheduledScriptsCount();
|
sWorld.IncreaseScheduledScriptsCount();
|
||||||
|
|
||||||
@@ -3187,7 +3187,7 @@ void Map::ScriptsProcess()
|
|||||||
///- Process overdue queued scripts
|
///- Process overdue queued scripts
|
||||||
std::multimap<time_t, ScriptAction>::iterator iter = m_scriptSchedule.begin();
|
std::multimap<time_t, ScriptAction>::iterator iter = m_scriptSchedule.begin();
|
||||||
// ok as multimap is a *sorted* associative container
|
// ok as multimap is a *sorted* associative container
|
||||||
while (!m_scriptSchedule.empty() && (iter->first <= sGameTime.GetGameTime()))
|
while (!m_scriptSchedule.empty() && (iter->first <= sWorld.GetGameTime()))
|
||||||
{
|
{
|
||||||
ScriptAction const& step = iter->second;
|
ScriptAction const& step = iter->second;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@
|
|||||||
#include "DBCStructure.h"
|
#include "DBCStructure.h"
|
||||||
#include "GridDefines.h"
|
#include "GridDefines.h"
|
||||||
#include "Cell.h"
|
#include "Cell.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "GameSystem/GridRefManager.h"
|
#include "GameSystem/GridRefManager.h"
|
||||||
#include "MapRefManager.h"
|
#include "MapRefManager.h"
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
#include "DBCEnums.h"
|
#include "DBCEnums.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::HandleRepopRequestOpcode( WorldPacket & recv_data )
|
void WorldSession::HandleRepopRequestOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
@@ -383,7 +382,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ )
|
|||||||
data << uint32(0);
|
data << uint32(0);
|
||||||
data << uint8(0);
|
data << uint8(0);
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
LogoutRequest(sGameTime.GetGameTime());
|
LogoutRequest(time(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandlePlayerLogoutOpcode( WorldPacket & /*recv_data*/ )
|
void WorldSession::HandlePlayerLogoutOpcode( WorldPacket & /*recv_data*/ )
|
||||||
@@ -443,7 +442,7 @@ void WorldSession::HandleTogglePvP( WorldPacket & recv_data )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!GetPlayer()->pvpInfo.inHostileArea && GetPlayer()->IsPvP())
|
if(!GetPlayer()->pvpInfo.inHostileArea && GetPlayer()->IsPvP())
|
||||||
GetPlayer()->pvpInfo.endTimer = sGameTime.GetGameTime(); // start toggle-off
|
GetPlayer()->pvpInfo.endTimer = time(NULL); // start toggle-off
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(OutdoorPvP * pvp = _player->GetOutdoorPvP())
|
//if(OutdoorPvP * pvp = _player->GetOutdoorPvP())
|
||||||
@@ -734,7 +733,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// prevent resurrect before 30-sec delay after body release not finished
|
// prevent resurrect before 30-sec delay after body release not finished
|
||||||
if(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType()==CORPSE_RESURRECTABLE_PVP) > sGameTime.GetGameTime())
|
if(corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType()==CORPSE_RESURRECTABLE_PVP) > time(NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
|
if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
|
||||||
@@ -868,7 +867,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
|||||||
{
|
{
|
||||||
// set resting flag we are in the inn
|
// set resting flag we are in the inn
|
||||||
GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||||
GetPlayer()->InnEnter(sGameTime.GetGameTime(), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z);
|
GetPlayer()->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z);
|
||||||
GetPlayer()->SetRestType(REST_TYPE_IN_TAVERN);
|
GetPlayer()->SetRestType(REST_TYPE_IN_TAVERN);
|
||||||
|
|
||||||
if(sWorld.IsFFAPvPRealm())
|
if(sWorld.IsFFAPvPRealm())
|
||||||
@@ -1622,6 +1621,6 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& recv_data)
|
|||||||
sLog.outDebug("WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE");
|
sLog.outDebug("WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE");
|
||||||
|
|
||||||
WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4);
|
WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4);
|
||||||
data << uint32(sGameTime.GetGameTime());
|
data << uint32(time(NULL));
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "WaypointMovementGenerator.h"
|
#include "WaypointMovementGenerator.h"
|
||||||
#include "InstanceSaveMgr.h"
|
#include "InstanceSaveMgr.h"
|
||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::HandleMoveWorldportAckOpcode( WorldPacket & /*recv_data*/ )
|
void WorldSession::HandleMoveWorldportAckOpcode( WorldPacket & /*recv_data*/ )
|
||||||
{
|
{
|
||||||
@@ -155,7 +154,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||||||
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
|
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
|
||||||
if (uint32 timeReset = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId(),diff))
|
if (uint32 timeReset = sInstanceSaveManager.GetResetTimeFor(GetPlayer()->GetMapId(),diff))
|
||||||
{
|
{
|
||||||
uint32 timeleft = timeReset - sGameTime.GetGameTime();
|
uint32 timeleft = timeReset - time(NULL);
|
||||||
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), diff, timeleft);
|
GetPlayer()->SendInstanceResetWarning(GetPlayer()->GetMapId(), diff, timeleft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
#include "WaypointManager.h"
|
#include "WaypointManager.h"
|
||||||
#include "InstanceData.h" //for condition_instance_data
|
#include "InstanceData.h" //for condition_instance_data
|
||||||
#include "GossipDef.h"
|
#include "GossipDef.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
INSTANTIATE_SINGLETON_1(ObjectMgr);
|
INSTANTIATE_SINGLETON_1(ObjectMgr);
|
||||||
|
|
||||||
@@ -5025,7 +5024,7 @@ void ObjectMgr::LoadNpcTextLocales()
|
|||||||
//not very fast function but it is called only once a day, or on starting-up
|
//not very fast function but it is called only once a day, or on starting-up
|
||||||
void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||||
{
|
{
|
||||||
time_t basetime = sGameTime.GetGameTime();
|
time_t basetime = time(NULL);
|
||||||
sLog.outDebug("Returning mails current time: hour: %d, minute: %d, second: %d ", localtime(&basetime)->tm_hour, localtime(&basetime)->tm_min, localtime(&basetime)->tm_sec);
|
sLog.outDebug("Returning mails current time: hour: %d, minute: %d, second: %d ", localtime(&basetime)->tm_hour, localtime(&basetime)->tm_min, localtime(&basetime)->tm_sec);
|
||||||
//delete all old mails without item and without body immediately, if starting server
|
//delete all old mails without item and without body immediately, if starting server
|
||||||
if (!serverUp)
|
if (!serverUp)
|
||||||
@@ -8250,9 +8249,7 @@ void ObjectMgr::LoadVendors()
|
|||||||
|
|
||||||
VendorItemData& vList = m_mCacheVendorItemMap[entry];
|
VendorItemData& vList = m_mCacheVendorItemMap[entry];
|
||||||
|
|
||||||
uint8 vendorslot = vList.GetItemCount();
|
vList.AddItem(item_id,maxcount,incrtime,ExtendedCost);
|
||||||
|
|
||||||
vList.AddItem(item_id,maxcount,incrtime,ExtendedCost,vendorslot);
|
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
} while (result->NextRow());
|
} while (result->NextRow());
|
||||||
@@ -8523,8 +8520,7 @@ void ObjectMgr::LoadGossipMenuItems()
|
|||||||
void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb)
|
void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb)
|
||||||
{
|
{
|
||||||
VendorItemData& vList = m_mCacheVendorItemMap[entry];
|
VendorItemData& vList = m_mCacheVendorItemMap[entry];
|
||||||
uint8 vendorslot = vList.GetItemCount();
|
vList.AddItem(item,maxcount,incrtime,extendedcost);
|
||||||
vList.AddItem(item,maxcount,incrtime,extendedcost,vendorslot);
|
|
||||||
|
|
||||||
if(savetodb) WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')",entry, item, maxcount,incrtime,extendedcost);
|
if(savetodb) WorldDatabase.PExecuteLog("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')",entry, item, maxcount,incrtime,extendedcost);
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-8
@@ -30,7 +30,6 @@
|
|||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
#include "Unit.h"
|
#include "Unit.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
char const* petTypeSuffix[MAX_PET_TYPE] =
|
char const* petTypeSuffix[MAX_PET_TYPE] =
|
||||||
{
|
{
|
||||||
@@ -244,7 +243,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, sGameTime.GetGameTime());
|
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
|
||||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32());
|
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32());
|
||||||
SetCreatorGUID(owner->GetGUID());
|
SetCreatorGUID(owner->GetGUID());
|
||||||
|
|
||||||
@@ -302,7 +301,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||||||
m_resetTalentsTime = fields[16].GetUInt64();
|
m_resetTalentsTime = fields[16].GetUInt64();
|
||||||
InitTalentForLevel(); // set original talents points before spell loading
|
InitTalentForLevel(); // set original talents points before spell loading
|
||||||
|
|
||||||
uint32 timediff = (sGameTime.GetGameTime() - fields[14].GetUInt32());
|
uint32 timediff = (time(NULL) - fields[14].GetUInt32());
|
||||||
_LoadAuras(timediff);
|
_LoadAuras(timediff);
|
||||||
|
|
||||||
// load action bar, if data broken will fill later by default spells.
|
// load action bar, if data broken will fill later by default spells.
|
||||||
@@ -443,7 +442,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
|||||||
};
|
};
|
||||||
|
|
||||||
ss << "', "
|
ss << "', "
|
||||||
<< sGameTime.GetGameTime() << ", "
|
<< time(NULL) << ", "
|
||||||
<< uint32(m_resetTalentsCost) << ", "
|
<< uint32(m_resetTalentsCost) << ", "
|
||||||
<< uint64(m_resetTalentsTime) << ", "
|
<< uint64(m_resetTalentsTime) << ", "
|
||||||
<< GetUInt32Value(UNIT_CREATED_BY_SPELL) << ", "
|
<< GetUInt32Value(UNIT_CREATED_BY_SPELL) << ", "
|
||||||
@@ -1035,7 +1034,7 @@ void Pet::_LoadSpellCooldowns()
|
|||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
{
|
{
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
|
|
||||||
WorldPacket data(SMSG_SPELL_COOLDOWN, (8+1+result->GetRowCount()*8));
|
WorldPacket data(SMSG_SPELL_COOLDOWN, (8+1+result->GetRowCount()*8));
|
||||||
data << GetGUID();
|
data << GetGUID();
|
||||||
@@ -1078,7 +1077,7 @@ void Pet::_SaveSpellCooldowns()
|
|||||||
{
|
{
|
||||||
CharacterDatabase.PExecute("DELETE FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber());
|
CharacterDatabase.PExecute("DELETE FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber());
|
||||||
|
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
|
|
||||||
// remove oudated and save active
|
// remove oudated and save active
|
||||||
for (CreatureSpellCooldowns::iterator itr = m_CreatureSpellCooldowns.begin(); itr != m_CreatureSpellCooldowns.end();)
|
for (CreatureSpellCooldowns::iterator itr = m_CreatureSpellCooldowns.begin(); itr != m_CreatureSpellCooldowns.end();)
|
||||||
@@ -1593,7 +1592,7 @@ bool Pet::resetTalents(bool no_cost)
|
|||||||
player->ModifyMoney(-(int32)cost);
|
player->ModifyMoney(-(int32)cost);
|
||||||
|
|
||||||
m_resetTalentsCost = cost;
|
m_resetTalentsCost = cost;
|
||||||
m_resetTalentsTime = sGameTime.GetGameTime();
|
m_resetTalentsTime = time(NULL);
|
||||||
}
|
}
|
||||||
if (!m_loading)
|
if (!m_loading)
|
||||||
player->PetSpellInitialize();
|
player->PetSpellInitialize();
|
||||||
@@ -1704,7 +1703,7 @@ void Pet::InitTalentForLevel()
|
|||||||
|
|
||||||
uint32 Pet::resetTalentsCost() const
|
uint32 Pet::resetTalentsCost() const
|
||||||
{
|
{
|
||||||
uint32 days = (sGameTime.GetGameTime() - m_resetTalentsTime)/DAY;
|
uint32 days = (sWorld.GetGameTime() - m_resetTalentsTime)/DAY;
|
||||||
|
|
||||||
// The first time reset costs 10 silver; after 1 day cost is reset to 10 silver
|
// The first time reset costs 10 silver; after 1 day cost is reset to 10 silver
|
||||||
if (m_resetTalentsCost < 10*SILVER || days > 0)
|
if (m_resetTalentsCost < 10*SILVER || days > 0)
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
#define TRINITY_PETAI_H
|
#define TRINITY_PETAI_H
|
||||||
|
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
class Creature;
|
class Creature;
|
||||||
class Spell;
|
class Spell;
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "Pet.h"
|
#include "Pet.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
@@ -558,7 +557,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
|||||||
CharacterDatabase.PExecute("UPDATE character_pet SET name = '%s', renamed = '1' WHERE owner = '%u' AND id = '%u'", name.c_str(), _player->GetGUIDLow(), pet->GetCharmInfo()->GetPetNumber());
|
CharacterDatabase.PExecute("UPDATE character_pet SET name = '%s', renamed = '1' WHERE owner = '%u' AND id = '%u'", name.c_str(), _player->GetGUIDLow(), pet->GetCharmInfo()->GetPetNumber());
|
||||||
CharacterDatabase.CommitTransaction();
|
CharacterDatabase.CommitTransaction();
|
||||||
|
|
||||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, sGameTime.GetGameTime());
|
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
|
void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
|
||||||
|
|||||||
+39
-62
@@ -65,7 +65,6 @@
|
|||||||
#include "GameEventMgr.h"
|
#include "GameEventMgr.h"
|
||||||
#include "AchievementMgr.h"
|
#include "AchievementMgr.h"
|
||||||
#include "SpellAuras.h"
|
#include "SpellAuras.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
@@ -386,7 +385,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
|||||||
m_bgBattleGroundQueueID[j].invitedToInstance = 0;
|
m_bgBattleGroundQueueID[j].invitedToInstance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_logintime = sGameTime.GetGameTime();
|
m_logintime = time(NULL);
|
||||||
m_Last_tick = m_logintime;
|
m_Last_tick = m_logintime;
|
||||||
m_WeaponProficiency = 0;
|
m_WeaponProficiency = 0;
|
||||||
m_ArmorProficiency = 0;
|
m_ArmorProficiency = 0;
|
||||||
@@ -462,7 +461,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
|||||||
m_baseHealthRegen = 0;
|
m_baseHealthRegen = 0;
|
||||||
|
|
||||||
// Honor System
|
// Honor System
|
||||||
m_lastHonorUpdateTime = sGameTime.GetGameTime();
|
m_lastHonorUpdateTime = time(NULL);
|
||||||
|
|
||||||
// Player summoning
|
// Player summoning
|
||||||
m_summon_expire = 0;
|
m_summon_expire = 0;
|
||||||
@@ -697,7 +696,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Played time
|
// Played time
|
||||||
m_Last_tick = sGameTime.GetGameTime();
|
m_Last_tick = time(NULL);
|
||||||
m_Played_time[PLAYED_TIME_TOTAL] = 0;
|
m_Played_time[PLAYED_TIME_TOTAL] = 0;
|
||||||
m_Played_time[PLAYED_TIME_LEVEL] = 0;
|
m_Played_time[PLAYED_TIME_LEVEL] = 0;
|
||||||
|
|
||||||
@@ -1136,7 +1135,7 @@ void Player::Update( uint32 p_time )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// undelivered mail
|
// undelivered mail
|
||||||
if (m_nextMailDelivereTime && m_nextMailDelivereTime <= sGameTime.GetGameTime())
|
if (m_nextMailDelivereTime && m_nextMailDelivereTime <= time(NULL))
|
||||||
{
|
{
|
||||||
SendNewMail();
|
SendNewMail();
|
||||||
++unReadMails;
|
++unReadMails;
|
||||||
@@ -1162,7 +1161,7 @@ void Player::Update( uint32 p_time )
|
|||||||
Unit::Update(p_time);
|
Unit::Update(p_time);
|
||||||
SetCanDelayTeleport(false);
|
SetCanDelayTeleport(false);
|
||||||
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
|
|
||||||
UpdatePvPFlag(now);
|
UpdatePvPFlag(now);
|
||||||
|
|
||||||
@@ -1280,13 +1279,13 @@ void Player::Update( uint32 p_time )
|
|||||||
{
|
{
|
||||||
if (roll_chance_i(3) && GetTimeInnEnter() > 0) // freeze update
|
if (roll_chance_i(3) && GetTimeInnEnter() > 0) // freeze update
|
||||||
{
|
{
|
||||||
int time_inn = sGameTime.GetGameTime()-GetTimeInnEnter();
|
int time_inn = time(NULL)-GetTimeInnEnter();
|
||||||
if (time_inn >= 10) // freeze update
|
if (time_inn >= 10) // freeze update
|
||||||
{
|
{
|
||||||
float bubble = 0.125*sWorld.getRate(RATE_REST_INGAME);
|
float bubble = 0.125*sWorld.getRate(RATE_REST_INGAME);
|
||||||
// speed collect rest bonus (section/in hour)
|
// speed collect rest bonus (section/in hour)
|
||||||
SetRestBonus(GetRestBonus()+ time_inn*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble);
|
SetRestBonus(GetRestBonus()+ time_inn*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble);
|
||||||
UpdateInnerTime(sGameTime.GetGameTime());
|
UpdateInnerTime(time(NULL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2781,7 +2780,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
|||||||
|
|
||||||
void Player::SendInitialSpells()
|
void Player::SendInitialSpells()
|
||||||
{
|
{
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
time_t infTime = curTime + infinityCooldownDelayCheck;
|
time_t infTime = curTime + infinityCooldownDelayCheck;
|
||||||
|
|
||||||
uint16 spellCount = 0;
|
uint16 spellCount = 0;
|
||||||
@@ -2889,7 +2888,7 @@ void Player::UpdateNextMailTimeAndUnreads()
|
|||||||
{
|
{
|
||||||
// calculate next delivery time (min. from non-delivered mails
|
// calculate next delivery time (min. from non-delivered mails
|
||||||
// and recalculate unReadMail
|
// and recalculate unReadMail
|
||||||
time_t cTime = sGameTime.GetGameTime();
|
time_t cTime = time(NULL);
|
||||||
m_nextMailDelivereTime = 0;
|
m_nextMailDelivereTime = 0;
|
||||||
unReadMails = 0;
|
unReadMails = 0;
|
||||||
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
|
for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr)
|
||||||
@@ -2906,7 +2905,7 @@ void Player::UpdateNextMailTimeAndUnreads()
|
|||||||
|
|
||||||
void Player::AddNewMailDeliverTime(time_t deliver_time)
|
void Player::AddNewMailDeliverTime(time_t deliver_time)
|
||||||
{
|
{
|
||||||
if(deliver_time <= sGameTime.GetGameTime()) // ready now
|
if(deliver_time <= time(NULL)) // ready now
|
||||||
{
|
{
|
||||||
++unReadMails;
|
++unReadMails;
|
||||||
SendNewMail();
|
SendNewMail();
|
||||||
@@ -3674,7 +3673,7 @@ void Player::_LoadSpellCooldowns(QueryResult *result)
|
|||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -3708,7 +3707,7 @@ void Player::_SaveSpellCooldowns()
|
|||||||
{
|
{
|
||||||
CharacterDatabase.PExecute("DELETE FROM character_spell_cooldown WHERE guid = '%u'", GetGUIDLow());
|
CharacterDatabase.PExecute("DELETE FROM character_spell_cooldown WHERE guid = '%u'", GetGUIDLow());
|
||||||
|
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
time_t infTime = curTime + infinityCooldownDelayCheck;
|
time_t infTime = curTime + infinityCooldownDelayCheck;
|
||||||
|
|
||||||
bool first_round = true;
|
bool first_round = true;
|
||||||
@@ -3754,7 +3753,7 @@ uint32 Player::resetTalentsCost() const
|
|||||||
return 10*GOLD;
|
return 10*GOLD;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint32 months = (sGameTime.GetGameTime() - m_resetTalentsTime)/MONTH;
|
uint32 months = (sWorld.GetGameTime() - m_resetTalentsTime)/MONTH;
|
||||||
if(months > 0)
|
if(months > 0)
|
||||||
{
|
{
|
||||||
// This cost will be reduced by a rate of 5 gold per month
|
// This cost will be reduced by a rate of 5 gold per month
|
||||||
@@ -3847,7 +3846,7 @@ bool Player::resetTalents(bool no_cost)
|
|||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1);
|
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1);
|
||||||
|
|
||||||
m_resetTalentsCost = cost;
|
m_resetTalentsCost = cost;
|
||||||
m_resetTalentsTime = sGameTime.GetGameTime();
|
m_resetTalentsTime = time(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: remove pet before or after unlearn spells? for now after unlearn to allow removing of talent related, pet affecting auras
|
//FIXME: remove pet before or after unlearn spells? for now after unlearn to allow removing of talent related, pet affecting auras
|
||||||
@@ -4381,7 +4380,7 @@ void Player::SendDelayResponse(const uint32 ml_seconds)
|
|||||||
{
|
{
|
||||||
//FIXME: is this delay time arg really need? 50msec by default in code
|
//FIXME: is this delay time arg really need? 50msec by default in code
|
||||||
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||||
data << (uint32)sGameTime.GetGameTime();
|
data << (uint32)time(NULL);
|
||||||
data << (uint32)0;
|
data << (uint32)0;
|
||||||
GetSession()->SendPacket( &data );
|
GetSession()->SendPacket( &data );
|
||||||
}
|
}
|
||||||
@@ -6287,8 +6286,8 @@ void Player::RewardReputation(Quest const *pQuest)
|
|||||||
void Player::UpdateHonorFields()
|
void Player::UpdateHonorFields()
|
||||||
{
|
{
|
||||||
/// called when rewarding honor and at each save
|
/// called when rewarding honor and at each save
|
||||||
uint64 now = sGameTime.GetGameTime();
|
uint64 now = time(NULL);
|
||||||
uint64 today = uint64(sGameTime.GetGameTime() / DAY) * DAY;
|
uint64 today = uint64(time(NULL) / DAY) * DAY;
|
||||||
|
|
||||||
if(m_lastHonorUpdateTime < today)
|
if(m_lastHonorUpdateTime < today)
|
||||||
{
|
{
|
||||||
@@ -6340,7 +6339,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor, bool pvpt
|
|||||||
uint64 victim_guid = 0;
|
uint64 victim_guid = 0;
|
||||||
uint32 victim_rank = 0;
|
uint32 victim_rank = 0;
|
||||||
uint32 rank_diff = 0;
|
uint32 rank_diff = 0;
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
|
|
||||||
// need call before fields update to have chance move yesterday data to appropriate fields before today data change.
|
// need call before fields update to have chance move yesterday data to appropriate fields before today data change.
|
||||||
UpdateHonorFields();
|
UpdateHonorFields();
|
||||||
@@ -12053,7 +12052,7 @@ void Player::AddItemToBuyBackSlot( Item *pItem )
|
|||||||
sLog.outDebug( "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot);
|
sLog.outDebug( "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot);
|
||||||
|
|
||||||
m_items[slot] = pItem;
|
m_items[slot] = pItem;
|
||||||
time_t base = sGameTime.GetGameTime();
|
time_t base = time(NULL);
|
||||||
uint32 etime = uint32(base - m_logintime + (30 * 3600));
|
uint32 etime = uint32(base - m_logintime + (30 * 3600));
|
||||||
uint32 eslot = slot - BUYBACK_SLOT_START;
|
uint32 eslot = slot - BUYBACK_SLOT_START;
|
||||||
|
|
||||||
@@ -13576,7 +13575,7 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
|
|||||||
|
|
||||||
AddTimedQuest( quest_id );
|
AddTimedQuest( quest_id );
|
||||||
questStatusData.m_timer = limittime * IN_MILISECONDS;
|
questStatusData.m_timer = limittime * IN_MILISECONDS;
|
||||||
qtime = static_cast<uint32>(sGameTime.GetGameTime()) + limittime;
|
qtime = static_cast<uint32>(time(NULL)) + limittime;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
questStatusData.m_timer = 0;
|
questStatusData.m_timer = 0;
|
||||||
@@ -15547,7 +15546,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||||||
|
|
||||||
SaveRecallPosition();
|
SaveRecallPosition();
|
||||||
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
time_t logoutTime = time_t(fields[23].GetUInt64());
|
time_t logoutTime = time_t(fields[23].GetUInt64());
|
||||||
|
|
||||||
// since last logout (in seconds)
|
// since last logout (in seconds)
|
||||||
@@ -16288,10 +16287,10 @@ void Player::_LoadQuestStatus(QueryResult *result)
|
|||||||
{
|
{
|
||||||
AddTimedQuest(quest_id);
|
AddTimedQuest(quest_id);
|
||||||
|
|
||||||
if (quest_time <= sGameTime.GetGameTime())
|
if (quest_time <= sWorld.GetGameTime())
|
||||||
questStatusData.m_timer = 1;
|
questStatusData.m_timer = 1;
|
||||||
else
|
else
|
||||||
questStatusData.m_timer = (quest_time - sGameTime.GetGameTime()) * IN_MILISECONDS;
|
questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * IN_MILISECONDS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
quest_time = 0;
|
quest_time = 0;
|
||||||
@@ -16589,7 +16588,7 @@ void Player::SendRaidInfo()
|
|||||||
size_t p_counter = data.wpos();
|
size_t p_counter = data.wpos();
|
||||||
data << uint32(counter); // placeholder
|
data << uint32(counter); // placeholder
|
||||||
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
|
|
||||||
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||||
{
|
{
|
||||||
@@ -16912,7 +16911,7 @@ void Player::SaveToDB()
|
|||||||
ss << m_Played_time[PLAYED_TIME_LEVEL] << ", ";
|
ss << m_Played_time[PLAYED_TIME_LEVEL] << ", ";
|
||||||
|
|
||||||
ss << finiteAlways(m_rest_bonus) << ", ";
|
ss << finiteAlways(m_rest_bonus) << ", ";
|
||||||
ss << (uint64)sGameTime.GetGameTime() << ", ";
|
ss << (uint64)time(NULL) << ", ";
|
||||||
ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ", ";
|
ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ", ";
|
||||||
//save, far from tavern/city
|
//save, far from tavern/city
|
||||||
//save, but in tavern/city
|
//save, but in tavern/city
|
||||||
@@ -17181,11 +17180,11 @@ void Player::_SaveQuestStatus()
|
|||||||
case QUEST_NEW :
|
case QUEST_NEW :
|
||||||
CharacterDatabase.PExecute("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) "
|
CharacterDatabase.PExecute("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) "
|
||||||
"VALUES ('%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
|
"VALUES ('%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
|
||||||
GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS+ sGameTime.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]);
|
GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]);
|
||||||
break;
|
break;
|
||||||
case QUEST_CHANGED :
|
case QUEST_CHANGED :
|
||||||
CharacterDatabase.PExecute("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" UI64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ",
|
CharacterDatabase.PExecute("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" UI64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ",
|
||||||
i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS + sGameTime.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first );
|
i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first );
|
||||||
break;
|
break;
|
||||||
case QUEST_UNCHANGED:
|
case QUEST_UNCHANGED:
|
||||||
break;
|
break;
|
||||||
@@ -17880,7 +17879,7 @@ void Player::PetSpellInitialize()
|
|||||||
uint8 cooldownsCount = pet->m_CreatureSpellCooldowns.size() + pet->m_CreatureCategoryCooldowns.size();
|
uint8 cooldownsCount = pet->m_CreatureSpellCooldowns.size() + pet->m_CreatureCategoryCooldowns.size();
|
||||||
data << uint8(cooldownsCount);
|
data << uint8(cooldownsCount);
|
||||||
|
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
|
|
||||||
for (CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr)
|
for (CreatureSpellCooldowns::const_iterator itr = pet->m_CreatureSpellCooldowns.begin(); itr != pet->m_CreatureSpellCooldowns.end(); ++itr)
|
||||||
{
|
{
|
||||||
@@ -18646,7 +18645,7 @@ void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
|
|||||||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+m_spells.size()*8);
|
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+m_spells.size()*8);
|
||||||
data << GetGUID();
|
data << GetGUID();
|
||||||
data << uint8(0x0); // flags (0x1, 0x2)
|
data << uint8(0x0); // flags (0x1, 0x2)
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (itr->second->state == PLAYERSPELL_REMOVED)
|
if (itr->second->state == PLAYERSPELL_REMOVED)
|
||||||
@@ -18925,7 +18924,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
|
|||||||
{
|
{
|
||||||
it->SetPaidArenaPoints(arenaPoints);
|
it->SetPaidArenaPoints(arenaPoints);
|
||||||
it->SetPaidHonorPoints(honorPoints);
|
it->SetPaidHonorPoints(honorPoints);
|
||||||
it->SetRefundExpiryTime( sGameTime.GetGameTime()+(HOUR*2) );
|
it->SetRefundExpiryTime( time(NULL)+(HOUR*2) );
|
||||||
for (uint8 i = 0; i < 5; ++i)
|
for (uint8 i = 0; i < 5; ++i)
|
||||||
it->SetPaidExtendedCost(i, extendedCost[i], extendedCostCount[i]);
|
it->SetPaidExtendedCost(i, extendedCost[i], extendedCostCount[i]);
|
||||||
}
|
}
|
||||||
@@ -19091,25 +19090,12 @@ void Player::UpdatePvP(bool state, bool override)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(pvpInfo.endTimer != 0)
|
if(pvpInfo.endTimer != 0)
|
||||||
pvpInfo.endTimer = sGameTime.GetGameTime();
|
pvpInfo.endTimer = time(NULL);
|
||||||
else
|
else
|
||||||
SetPvP(state);
|
SetPvP(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::HasSpellCooldown(uint32 spell_id) const
|
|
||||||
{
|
|
||||||
SpellCooldowns::const_iterator itr = m_spellCooldowns.find(spell_id);
|
|
||||||
return itr != m_spellCooldowns.end() && itr->second.end > sGameTime.GetGameTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 Player::GetSpellCooldownDelay(uint32 spell_id) const
|
|
||||||
{
|
|
||||||
SpellCooldowns::const_iterator itr = m_spellCooldowns.find(spell_id);
|
|
||||||
time_t t = sGameTime.GetGameTime();
|
|
||||||
return itr != m_spellCooldowns.end() && itr->second.end > t ? itr->second.end - t : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell, bool infinityCooldown)
|
void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell, bool infinityCooldown)
|
||||||
{
|
{
|
||||||
// init cooldown values
|
// init cooldown values
|
||||||
@@ -19146,7 +19132,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
|
|||||||
catrec = spellInfo->CategoryRecoveryTime;
|
catrec = spellInfo->CategoryRecoveryTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
|
|
||||||
time_t catrecTime;
|
time_t catrecTime;
|
||||||
time_t recTime;
|
time_t recTime;
|
||||||
@@ -20007,7 +19993,7 @@ void Player::SendInitialPacketsBeforeAddToMap()
|
|||||||
SendEquipmentSetList();
|
SendEquipmentSetList();
|
||||||
|
|
||||||
data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4);
|
data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4);
|
||||||
data << uint32(secsToTimeBitFields(sGameTime.GetGameTime()));
|
data << uint32(secsToTimeBitFields(sWorld.GetGameTime()));
|
||||||
data << (float)0.01666667f; // game speed
|
data << (float)0.01666667f; // game speed
|
||||||
data << uint32(0); // added in 3.1.2
|
data << uint32(0); // added in 3.1.2
|
||||||
GetSession()->SendPacket( &data );
|
GetSession()->SendPacket( &data );
|
||||||
@@ -20138,7 +20124,7 @@ void Player::ApplyEquipCooldown( Item * pItem )
|
|||||||
if( spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE )
|
if( spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), sGameTime.GetGameTime() + 30);
|
AddSpellCooldown(spellData.SpellId, pItem->GetEntry(), time(NULL) + 30);
|
||||||
|
|
||||||
WorldPacket data(SMSG_ITEM_COOLDOWN, 12);
|
WorldPacket data(SMSG_ITEM_COOLDOWN, 12);
|
||||||
data << pItem->GetGUID();
|
data << pItem->GetGUID();
|
||||||
@@ -20389,7 +20375,7 @@ void Player::SetDailyQuestStatus( uint32 quest_id )
|
|||||||
if(!GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx))
|
if(!GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx))
|
||||||
{
|
{
|
||||||
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx,quest_id);
|
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx,quest_id);
|
||||||
m_lastDailyQuestTime = sGameTime.GetGameTime(); // last daily quest time
|
m_lastDailyQuestTime = time(NULL); // last daily quest time
|
||||||
m_DailyQuestChanged = true;
|
m_DailyQuestChanged = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -20559,15 +20545,6 @@ void Player::UpdateForQuestWorldObjects()
|
|||||||
GetSession()->SendPacket(&packet);
|
GetSession()->SendPacket(&packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetSummonPoint(uint32 mapid, float x, float y, float z)
|
|
||||||
{
|
|
||||||
m_summon_expire = sGameTime.GetGameTime() + MAX_PLAYER_SUMMON_DELAY;
|
|
||||||
m_summon_mapid = mapid;
|
|
||||||
m_summon_x = x;
|
|
||||||
m_summon_y = y;
|
|
||||||
m_summon_z = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Player::SummonIfPossible(bool agree)
|
void Player::SummonIfPossible(bool agree)
|
||||||
{
|
{
|
||||||
if (!agree)
|
if (!agree)
|
||||||
@@ -20577,7 +20554,7 @@ void Player::SummonIfPossible(bool agree)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// expire and auto declined
|
// expire and auto declined
|
||||||
if (m_summon_expire < sGameTime.GetGameTime())
|
if (m_summon_expire < time(NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// stop taxi flight at summon
|
// stop taxi flight at summon
|
||||||
@@ -21070,7 +21047,7 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
|
|||||||
else if(!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
|
else if(!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
// 0..2 full period
|
// 0..2 full period
|
||||||
// should be ceil(x)-1 but not floor(x)
|
// should be ceil(x)-1 but not floor(x)
|
||||||
uint32 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now)/DEATH_EXPIRE_STEP : 0;
|
uint32 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now)/DEATH_EXPIRE_STEP : 0;
|
||||||
@@ -21085,7 +21062,7 @@ void Player::UpdateCorpseReclaimDelay()
|
|||||||
(!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
|
(!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
if(now < m_deathExpireTime)
|
if(now < m_deathExpireTime)
|
||||||
{
|
{
|
||||||
// full and partly periods 1..3
|
// full and partly periods 1..3
|
||||||
@@ -21130,7 +21107,7 @@ void Player::SendCorpseReclaimDelay(bool load)
|
|||||||
|
|
||||||
time_t expected_time = corpse->GetGhostTime()+copseReclaimDelay[count];
|
time_t expected_time = corpse->GetGhostTime()+copseReclaimDelay[count];
|
||||||
|
|
||||||
time_t now = sGameTime.GetGameTime();
|
time_t now = time(NULL);
|
||||||
if(now >= expected_time)
|
if(now >= expected_time)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
+19
-4
@@ -39,7 +39,6 @@
|
|||||||
#include "ReputationMgr.h"
|
#include "ReputationMgr.h"
|
||||||
#include "BattleGround.h"
|
#include "BattleGround.h"
|
||||||
#include "DBCEnums.h"
|
#include "DBCEnums.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
#include<string>
|
#include<string>
|
||||||
#include<vector>
|
#include<vector>
|
||||||
@@ -988,7 +987,14 @@ class TRINITY_DLL_SPEC Player : public Unit
|
|||||||
|
|
||||||
bool TeleportToBGEntryPoint();
|
bool TeleportToBGEntryPoint();
|
||||||
|
|
||||||
void SetSummonPoint(uint32 mapid, float x, float y, float z);
|
void SetSummonPoint(uint32 mapid, float x, float y, float z)
|
||||||
|
{
|
||||||
|
m_summon_expire = time(NULL) + MAX_PLAYER_SUMMON_DELAY;
|
||||||
|
m_summon_mapid = mapid;
|
||||||
|
m_summon_x = x;
|
||||||
|
m_summon_y = y;
|
||||||
|
m_summon_z = z;
|
||||||
|
}
|
||||||
void SummonIfPossible(bool agree);
|
void SummonIfPossible(bool agree);
|
||||||
|
|
||||||
bool Create( uint32 guidlow, const std::string& name, uint8 race, uint8 class_, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair, uint8 outfitId );
|
bool Create( uint32 guidlow, const std::string& name, uint8 race, uint8 class_, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair, uint8 outfitId );
|
||||||
@@ -1565,8 +1571,17 @@ class TRINITY_DLL_SPEC Player : public Unit
|
|||||||
|
|
||||||
static uint32 const infinityCooldownDelay = MONTH; // used for set "infinity cooldowns" for spells and check
|
static uint32 const infinityCooldownDelay = MONTH; // used for set "infinity cooldowns" for spells and check
|
||||||
static uint32 const infinityCooldownDelayCheck = MONTH/2;
|
static uint32 const infinityCooldownDelayCheck = MONTH/2;
|
||||||
bool HasSpellCooldown(uint32 spell_id) const;
|
bool HasSpellCooldown(uint32 spell_id) const
|
||||||
uint32 GetSpellCooldownDelay(uint32 spell_id) const;
|
{
|
||||||
|
SpellCooldowns::const_iterator itr = m_spellCooldowns.find(spell_id);
|
||||||
|
return itr != m_spellCooldowns.end() && itr->second.end > time(NULL);
|
||||||
|
}
|
||||||
|
uint32 GetSpellCooldownDelay(uint32 spell_id) const
|
||||||
|
{
|
||||||
|
SpellCooldowns::const_iterator itr = m_spellCooldowns.find(spell_id);
|
||||||
|
time_t t = time(NULL);
|
||||||
|
return itr != m_spellCooldowns.end() && itr->second.end > t ? itr->second.end - t : 0;
|
||||||
|
}
|
||||||
void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false );
|
void AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 itemId, Spell* spell = NULL, bool infinityCooldown = false );
|
||||||
void AddSpellCooldown(uint32 spell_id, uint32 itemid, time_t end_time);
|
void AddSpellCooldown(uint32 spell_id, uint32 itemid, time_t end_time);
|
||||||
void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
|
void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL);
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "NPCHandler.h"
|
#include "NPCHandler.h"
|
||||||
#include "Pet.h"
|
#include "Pet.h"
|
||||||
#include "MapManager.h"
|
#include "MapManager.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::SendNameQueryOpcode(Player *p)
|
void WorldSession::SendNameQueryOpcode(Player *p)
|
||||||
{
|
{
|
||||||
@@ -143,7 +142,7 @@ void WorldSession::HandleNameQueryOpcode( WorldPacket & recv_data )
|
|||||||
void WorldSession::HandleQueryTimeOpcode( WorldPacket & /*recv_data*/ )
|
void WorldSession::HandleQueryTimeOpcode( WorldPacket & /*recv_data*/ )
|
||||||
{
|
{
|
||||||
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||||
data << (uint32)sGameTime.GetGameTime();
|
data << (uint32)time(NULL);
|
||||||
data << (uint32)0;
|
data << (uint32)0;
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff
|
|||||||
{
|
{
|
||||||
if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED))
|
||||||
{
|
{
|
||||||
i_nextMoveTime.Update(i_nextMoveTime.GetExpireTime()); // Expire the timer
|
i_nextMoveTime.Update(i_nextMoveTime.GetExpiry()); // Expire the timer
|
||||||
creature.clearUnitState(UNIT_STAT_ROAMING);
|
creature.clearUnitState(UNIT_STAT_ROAMING);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
#include "GridNotifiersImpl.h"
|
#include "GridNotifiersImpl.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
#define Aura AuraEffect
|
#define Aura AuraEffect
|
||||||
pAuraHandler AuraHandler[TOTAL_AURAS]=
|
pAuraHandler AuraHandler[TOTAL_AURAS]=
|
||||||
@@ -367,7 +366,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
|||||||
Aura::Aura(SpellEntry const* spellproto, uint32 effMask, Unit *target, WorldObject *source, Unit *caster, int32 *currentBasePoints, Item* castItem) :
|
Aura::Aura(SpellEntry const* spellproto, uint32 effMask, Unit *target, WorldObject *source, Unit *caster, int32 *currentBasePoints, Item* castItem) :
|
||||||
m_spellProto(spellproto),
|
m_spellProto(spellproto),
|
||||||
m_target(target), m_sourceGuid(source->GetGUID()), m_casterGuid(caster->GetGUID()), m_castItemGuid(castItem ? castItem->GetGUID() : 0),
|
m_target(target), m_sourceGuid(source->GetGUID()), m_casterGuid(caster->GetGUID()), m_castItemGuid(castItem ? castItem->GetGUID() : 0),
|
||||||
m_applyTime(sGameTime.GetGameTime()),
|
m_applyTime(time(NULL)),
|
||||||
m_timeCla(0), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE),
|
m_timeCla(0), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE),
|
||||||
m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1), m_isRemoved(false)
|
m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1), m_isRemoved(false)
|
||||||
{
|
{
|
||||||
@@ -1331,7 +1330,7 @@ void Aura::HandleAuraSpecificMods(bool apply)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
player->RemoveSpellCooldown(m_spellProto->Id, true);
|
player->RemoveSpellCooldown(m_spellProto->Id, true);
|
||||||
player->AddSpellCooldown(m_spellProto->Id, 0, uint32(sGameTime.GetGameTime() + aurEff->GetAmount()));
|
player->AddSpellCooldown(m_spellProto->Id, 0, uint32(time(NULL) + aurEff->GetAmount()));
|
||||||
|
|
||||||
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4);
|
WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4);
|
||||||
data << uint64(player->GetGUID());
|
data << uint64(player->GetGUID());
|
||||||
|
|||||||
@@ -61,7 +61,6 @@
|
|||||||
#include "SkillDiscovery.h"
|
#include "SkillDiscovery.h"
|
||||||
#include "Formulas.h"
|
#include "Formulas.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||||
{
|
{
|
||||||
@@ -999,7 +998,7 @@ void Spell::EffectDummy(uint32 i)
|
|||||||
|
|
||||||
Creature* creatureTarget = (Creature*)unitTarget;
|
Creature* creatureTarget = (Creature*)unitTarget;
|
||||||
|
|
||||||
GameObject* Crystal_Prison = m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, creatureTarget->GetRespawnTime()-sGameTime.GetGameTime());
|
GameObject* Crystal_Prison = m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, creatureTarget->GetRespawnTime()-time(NULL));
|
||||||
sLog.outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019");
|
sLog.outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019");
|
||||||
|
|
||||||
creatureTarget->ForcedDespawn();
|
creatureTarget->ForcedDespawn();
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
@@ -53,12 +52,12 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data )
|
|||||||
ticket->guid = objmgr.GenerateGMTicketId();
|
ticket->guid = objmgr.GenerateGMTicketId();
|
||||||
ticket->playerGuid = GetPlayer()->GetGUID();
|
ticket->playerGuid = GetPlayer()->GetGUID();
|
||||||
ticket->message = ticketText;
|
ticket->message = ticketText;
|
||||||
ticket->createtime = sGameTime.GetGameTime();
|
ticket->createtime = time(NULL);
|
||||||
ticket->map = map;
|
ticket->map = map;
|
||||||
ticket->pos_x = x;
|
ticket->pos_x = x;
|
||||||
ticket->pos_y = y;
|
ticket->pos_y = y;
|
||||||
ticket->pos_z = z;
|
ticket->pos_z = z;
|
||||||
ticket->timestamp = sGameTime.GetGameTime();
|
ticket->timestamp = time(NULL);
|
||||||
ticket->closed = 0;
|
ticket->closed = 0;
|
||||||
ticket->assignedToGM = 0;
|
ticket->assignedToGM = 0;
|
||||||
ticket->comment = "";
|
ticket->comment = "";
|
||||||
@@ -88,7 +87,7 @@ void WorldSession::HandleGMTicketUpdateOpcode( WorldPacket & recv_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ticket->message = message;
|
ticket->message = message;
|
||||||
ticket->timestamp = sGameTime.GetGameTime();
|
ticket->timestamp = time(NULL);
|
||||||
|
|
||||||
objmgr.AddOrUpdateGMTicket(*ticket);
|
objmgr.AddOrUpdateGMTicket(*ticket);
|
||||||
|
|
||||||
@@ -118,7 +117,7 @@ void WorldSession::HandleGMTicketDeleteOpcode( WorldPacket & /*recv_data*/)
|
|||||||
void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/)
|
void WorldSession::HandleGMTicketGetTicketOpcode( WorldPacket & /*recv_data*/)
|
||||||
{
|
{
|
||||||
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
WorldPacket data( SMSG_QUERY_TIME_RESPONSE, 4+4 );
|
||||||
data << (uint32)sGameTime.GetGameTime();
|
data << (uint32)time(NULL);
|
||||||
data << (uint32)0;
|
data << (uint32)0;
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
#define TRINITY_TOTEMAI_H
|
#define TRINITY_TOTEMAI_H
|
||||||
|
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
class Creature;
|
class Creature;
|
||||||
class Totem;
|
class Totem;
|
||||||
|
|||||||
+13
-14
@@ -54,7 +54,6 @@
|
|||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "Transports.h"
|
#include "Transports.h"
|
||||||
#include "ScriptCalls.h"
|
#include "ScriptCalls.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@@ -2008,7 +2007,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
|
|||||||
|
|
||||||
int32 healAmount = pVictim->GetMaxHealth() * (*i)->GetAmount() / 100.0f * pctFromDefense;
|
int32 healAmount = pVictim->GetMaxHealth() * (*i)->GetAmount() / 100.0f * pctFromDefense;
|
||||||
pVictim->CastCustomSpell(pVictim, 66235, &healAmount, NULL, NULL, true);
|
pVictim->CastCustomSpell(pVictim, 66235, &healAmount, NULL, NULL, true);
|
||||||
((Player*)pVictim)->AddSpellCooldown(66235,0,sGameTime.GetGameTime() + 120);
|
((Player*)pVictim)->AddSpellCooldown(66235,0,time(NULL) + 120);
|
||||||
}
|
}
|
||||||
else if (remainingHealth < allowedHealth)
|
else if (remainingHealth < allowedHealth)
|
||||||
{
|
{
|
||||||
@@ -2255,7 +2254,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
|
|||||||
if (preventDeathSpell->SpellIconID == 2109)
|
if (preventDeathSpell->SpellIconID == 2109)
|
||||||
{
|
{
|
||||||
pVictim->CastSpell(pVictim,31231,true);
|
pVictim->CastSpell(pVictim,31231,true);
|
||||||
((Player*)pVictim)->AddSpellCooldown(31231,0,sGameTime.GetGameTime()+60);
|
((Player*)pVictim)->AddSpellCooldown(31231,0,time(NULL)+60);
|
||||||
// with health > 10% lost health until health==10%, in other case no losses
|
// with health > 10% lost health until health==10%, in other case no losses
|
||||||
uint32 health10 = pVictim->GetMaxHealth()/10;
|
uint32 health10 = pVictim->GetMaxHealth()/10;
|
||||||
RemainingDamage = pVictim->GetHealth() > health10 ? pVictim->GetHealth() - health10 : 0;
|
RemainingDamage = pVictim->GetHealth() > health10 ? pVictim->GetHealth() - health10 : 0;
|
||||||
@@ -4899,7 +4898,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
||||||
|
|
||||||
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
if (cooldown && GetTypeId() == TYPEID_PLAYER)
|
||||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -4961,7 +4960,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*damage*/, AuraE
|
|||||||
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -6718,7 +6717,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
|
|
||||||
// apply cooldown before cast to prevent processing itself
|
// apply cooldown before cast to prevent processing itself
|
||||||
if( cooldown )
|
if( cooldown )
|
||||||
((Player*)this)->AddSpellCooldown(dummySpell->Id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
// Attack Twice
|
// Attack Twice
|
||||||
for (uint32 i = 0; i<2; ++i )
|
for (uint32 i = 0; i<2; ++i )
|
||||||
@@ -6958,7 +6957,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
((Player*)this)->AddSpellMod(mod, false);
|
((Player*)this)->AddSpellMod(mod, false);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(dummySpell->Id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -7241,7 +7240,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
|||||||
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura, originalCaster);
|
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura, originalCaster);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -7299,7 +7298,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, AuraEffect*
|
|||||||
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
|
bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
|
||||||
@@ -7357,7 +7356,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEff
|
|||||||
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -7995,7 +7994,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
|||||||
target->CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);
|
target->CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(trigger_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Cast positive spell on enemy target
|
// Cast positive spell on enemy target
|
||||||
@@ -8167,7 +8166,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
|||||||
CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);
|
CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(trigger_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -8265,7 +8264,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE
|
|||||||
CastSpell(pVictim, triggered_spell_id, true, castItem, triggeredByAura);
|
CastSpell(pVictim, triggered_spell_id, true, castItem, triggeredByAura);
|
||||||
|
|
||||||
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
if( cooldown && GetTypeId() == TYPEID_PLAYER )
|
||||||
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,sGameTime.GetGameTime() + cooldown);
|
((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -14596,7 +14595,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
|||||||
GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
|
GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true);
|
||||||
|
|
||||||
//if charmed two demons the same session, the 2nd gets the 1st one's name
|
//if charmed two demons the same session, the 2nd gets the 1st one's name
|
||||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, sGameTime.GetGameTime());
|
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
((Player*)charmer)->CharmSpellInitialize();
|
((Player*)charmer)->CharmSpellInitialize();
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ bool Weather::ReGenerate()
|
|||||||
|
|
||||||
//78 days between January 1st and March 20nd; 365/4=91 days by season
|
//78 days between January 1st and March 20nd; 365/4=91 days by season
|
||||||
// season source http://aa.usno.navy.mil/data/docs/EarthSeasons.html
|
// season source http://aa.usno.navy.mil/data/docs/EarthSeasons.html
|
||||||
time_t gtime = sGameTime.GetGameTime();
|
time_t gtime = sWorld.GetGameTime();
|
||||||
struct tm * ltime = localtime(>ime);
|
struct tm * ltime = localtime(>ime);
|
||||||
uint32 season = ((ltime->tm_yday - 78 + 365)/91)%4;
|
uint32 season = ((ltime->tm_yday - 78 + 365)/91)%4;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
class Player;
|
class Player;
|
||||||
|
|
||||||
|
|||||||
+13
-14
@@ -68,7 +68,6 @@
|
|||||||
#include "CreatureGroups.h"
|
#include "CreatureGroups.h"
|
||||||
#include "Transports.h"
|
#include "Transports.h"
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
|
|
||||||
INSTANTIATE_SINGLETON_1(World);
|
INSTANTIATE_SINGLETON_1(World);
|
||||||
|
|
||||||
@@ -97,7 +96,7 @@ World::World()
|
|||||||
m_allowMovement = true;
|
m_allowMovement = true;
|
||||||
m_ShutdownMask = 0;
|
m_ShutdownMask = 0;
|
||||||
m_ShutdownTimer = 0;
|
m_ShutdownTimer = 0;
|
||||||
m_gameTime=sGameTime.GetGameTime();
|
m_gameTime=time(NULL);
|
||||||
m_startTime=m_gameTime;
|
m_startTime=m_gameTime;
|
||||||
m_maxActiveSessionCount = 0;
|
m_maxActiveSessionCount = 0;
|
||||||
m_maxQueuedSessionCount = 0;
|
m_maxQueuedSessionCount = 0;
|
||||||
@@ -288,7 +287,7 @@ bool World::HasRecentlyDisconnected(WorldSession* session)
|
|||||||
{
|
{
|
||||||
for (DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end();)
|
for (DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end();)
|
||||||
{
|
{
|
||||||
if (difftime(i->second, sGameTime.GetGameTime()) < tolerance)
|
if (difftime(i->second, time(NULL)) < tolerance)
|
||||||
{
|
{
|
||||||
if (i->first == session->GetAccountId())
|
if (i->first == session->GetAccountId())
|
||||||
return true;
|
return true;
|
||||||
@@ -1235,7 +1234,7 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
void World::SetInitialWorldSettings()
|
void World::SetInitialWorldSettings()
|
||||||
{
|
{
|
||||||
///- Initialize the random number generator
|
///- Initialize the random number generator
|
||||||
srand((unsigned int)sGameTime.GetGameTime());
|
srand((unsigned int)time(NULL));
|
||||||
|
|
||||||
///- Initialize config settings
|
///- Initialize config settings
|
||||||
LoadConfigSettings();
|
LoadConfigSettings();
|
||||||
@@ -1626,7 +1625,7 @@ void World::SetInitialWorldSettings()
|
|||||||
|
|
||||||
///- Initialize game time and timers
|
///- Initialize game time and timers
|
||||||
sLog.outDebug("DEBUG:: Initialize game time and timers");
|
sLog.outDebug("DEBUG:: Initialize game time and timers");
|
||||||
m_gameTime=sGameTime.GetGameTime();
|
m_gameTime = time(NULL);
|
||||||
m_startTime=m_gameTime;
|
m_startTime=m_gameTime;
|
||||||
|
|
||||||
tm local;
|
tm local;
|
||||||
@@ -1638,7 +1637,7 @@ void World::SetInitialWorldSettings()
|
|||||||
local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
|
local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
|
||||||
|
|
||||||
loginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')",
|
loginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')",
|
||||||
realmID, m_startTime, isoDate, _FULLVERSION);
|
realmID, uint64(m_startTime), isoDate, _FULLVERSION);
|
||||||
|
|
||||||
static uint32 abtimer = 0;
|
static uint32 abtimer = 0;
|
||||||
abtimer = sConfig.GetIntDefault("AutoBroadcast.Timer", 60000);
|
abtimer = sConfig.GetIntDefault("AutoBroadcast.Timer", 60000);
|
||||||
@@ -1657,7 +1656,7 @@ void World::SetInitialWorldSettings()
|
|||||||
//to set mailtimer to return mails every day between 4 and 5 am
|
//to set mailtimer to return mails every day between 4 and 5 am
|
||||||
//mailtimer is increased when updating auctions
|
//mailtimer is increased when updating auctions
|
||||||
//one second is 1000 -(tested on win system)
|
//one second is 1000 -(tested on win system)
|
||||||
mail_timer = ((((localtime(&sGameTime.GetGameTime())->tm_hour + 20) % 24)* HOUR * IN_MILISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
|
mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
|
||||||
//1440
|
//1440
|
||||||
mail_timer_expires = ((DAY * IN_MILISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
|
mail_timer_expires = ((DAY * IN_MILISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
|
||||||
sLog.outDebug("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires);
|
sLog.outDebug("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires);
|
||||||
@@ -1858,7 +1857,7 @@ void World::Update(uint32 diff)
|
|||||||
_UpdateGameTime();
|
_UpdateGameTime();
|
||||||
|
|
||||||
/// Handle daily quests reset time
|
/// Handle daily quests reset time
|
||||||
if (sGameTime.GetGameTime() > m_NextDailyQuestReset)
|
if (m_gameTime > m_NextDailyQuestReset)
|
||||||
{
|
{
|
||||||
ResetDailyQuests();
|
ResetDailyQuests();
|
||||||
m_NextDailyQuestReset += DAY;
|
m_NextDailyQuestReset += DAY;
|
||||||
@@ -1915,7 +1914,7 @@ void World::Update(uint32 diff)
|
|||||||
uint32 maxClientsNum = GetMaxActiveSessionCount();
|
uint32 maxClientsNum = GetMaxActiveSessionCount();
|
||||||
|
|
||||||
m_timers[WUPDATE_UPTIME].Reset();
|
m_timers[WUPDATE_UPTIME].Reset();
|
||||||
loginDatabase.PExecute("UPDATE uptime SET uptime = %u, maxplayers = %u WHERE realmid = %u AND starttime = " UI64FMTD, tmpDiff, maxClientsNum, realmID, m_startTime);
|
loginDatabase.PExecute("UPDATE uptime SET uptime = %u, maxplayers = %u WHERE realmid = %u AND starttime = " UI64FMTD, tmpDiff, maxClientsNum, realmID, uint64(m_startTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <li> Clean logs table
|
/// <li> Clean logs table
|
||||||
@@ -2282,9 +2281,9 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP)
|
|||||||
void World::_UpdateGameTime()
|
void World::_UpdateGameTime()
|
||||||
{
|
{
|
||||||
///- update the time
|
///- update the time
|
||||||
time_t thisTime = sGameTime.GetGameTime();
|
time_t thisTime = time(NULL);
|
||||||
uint32 elapsed = uint32(thisTime - sGameTime.GetGameTime());
|
uint32 elapsed = uint32(thisTime - m_gameTime);
|
||||||
sGameTime.SetGameTime();
|
m_gameTime = thisTime;
|
||||||
|
|
||||||
///- if there is a shutdown timer
|
///- if there is a shutdown timer
|
||||||
if (!m_stopEvent && m_ShutdownTimer > 0 && elapsed > 0)
|
if (!m_stopEvent && m_ShutdownTimer > 0 && elapsed > 0)
|
||||||
@@ -2413,7 +2412,7 @@ void World::UpdateSessions(uint32 diff)
|
|||||||
if (!itr->second->Update(diff)) // As interval = 0
|
if (!itr->second->Update(diff)) // As interval = 0
|
||||||
{
|
{
|
||||||
if (!RemoveQueuedPlayer(itr->second) && itr->second && getConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
|
if (!RemoveQueuedPlayer(itr->second) && itr->second && getConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
|
||||||
m_disconnects[itr->second->GetAccountId()] = sGameTime.GetGameTime();
|
m_disconnects[itr->second->GetAccountId()] = time(NULL);
|
||||||
delete itr->second;
|
delete itr->second;
|
||||||
m_sessions.erase(itr);
|
m_sessions.erase(itr);
|
||||||
}
|
}
|
||||||
@@ -2524,7 +2523,7 @@ void World::InitDailyQuestResetTime()
|
|||||||
|
|
||||||
// client built-in time for reset is 6:00 AM
|
// client built-in time for reset is 6:00 AM
|
||||||
// FIX ME: client not show day start time
|
// FIX ME: client not show day start time
|
||||||
time_t curTime = sGameTime.GetGameTime();
|
time_t curTime = time(NULL);
|
||||||
tm localTm = *localtime(&curTime);
|
tm localTm = *localtime(&curTime);
|
||||||
localTm.tm_hour = 6;
|
localTm.tm_hour = 6;
|
||||||
localTm.tm_min = 0;
|
localTm.tm_min = 0;
|
||||||
|
|||||||
+7
-1
@@ -26,7 +26,7 @@
|
|||||||
#define __WORLD_H
|
#define __WORLD_H
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
#include "Policies/Singleton.h"
|
#include "Policies/Singleton.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "ace/Atomic_Op.h"
|
#include "ace/Atomic_Op.h"
|
||||||
@@ -516,6 +516,12 @@ class World
|
|||||||
/// Get the path where data (dbc, maps) are stored on disk
|
/// Get the path where data (dbc, maps) are stored on disk
|
||||||
std::string GetDataPath() const { return m_dataPath; }
|
std::string GetDataPath() const { return m_dataPath; }
|
||||||
|
|
||||||
|
/// When server started?
|
||||||
|
time_t const& GetStartTime() const { return m_startTime; }
|
||||||
|
/// What time is it?
|
||||||
|
time_t const& GetGameTime() const { return m_gameTime; }
|
||||||
|
/// Uptime (in secs)
|
||||||
|
uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); }
|
||||||
/// Update time
|
/// Update time
|
||||||
uint32 GetUpdateTime() const { return m_updateTime; }
|
uint32 GetUpdateTime() const { return m_updateTime; }
|
||||||
void SetRecordDiffInterval(int32 t) { if(t >= 0) m_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; }
|
void SetRecordDiffInterval(int32 t) { if(t >= 0) m_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; }
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
#include "OutdoorPvPMgr.h"
|
#include "OutdoorPvPMgr.h"
|
||||||
#include "MapManager.h"
|
#include "MapManager.h"
|
||||||
#include "SocialMgr.h"
|
#include "SocialMgr.h"
|
||||||
#include "TimeMgr.h"
|
|
||||||
#include "zlib/zlib.h"
|
#include "zlib/zlib.h"
|
||||||
#include "ScriptCalls.h"
|
#include "ScriptCalls.h"
|
||||||
|
|
||||||
@@ -107,13 +106,13 @@ void WorldSession::SendPacket(WorldPacket const* packet)
|
|||||||
static uint64 sendPacketCount = 0;
|
static uint64 sendPacketCount = 0;
|
||||||
static uint64 sendPacketBytes = 0;
|
static uint64 sendPacketBytes = 0;
|
||||||
|
|
||||||
static time_t firstTime = sGameTime.GetGameTime();
|
static time_t firstTime = time(NULL);
|
||||||
static time_t lastTime = firstTime; // next 60 secs start time
|
static time_t lastTime = firstTime; // next 60 secs start time
|
||||||
|
|
||||||
static uint64 sendLastPacketCount = 0;
|
static uint64 sendLastPacketCount = 0;
|
||||||
static uint64 sendLastPacketBytes = 0;
|
static uint64 sendLastPacketBytes = 0;
|
||||||
|
|
||||||
time_t cur_time = sGameTime.GetGameTime();
|
time_t cur_time = time(NULL);
|
||||||
|
|
||||||
if((cur_time - lastTime) < 60)
|
if((cur_time - lastTime) < 60)
|
||||||
{
|
{
|
||||||
@@ -282,7 +281,7 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||||||
}
|
}
|
||||||
|
|
||||||
///- If necessary, log the player out
|
///- If necessary, log the player out
|
||||||
time_t currTime = sGameTime.GetGameTime();
|
time_t currTime = time(NULL);
|
||||||
if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading))
|
if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading))
|
||||||
LogoutPlayer(true);
|
LogoutPlayer(true);
|
||||||
|
|
||||||
@@ -659,7 +658,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::strin
|
|||||||
void WorldSession::SendAccountDataTimes(uint32 mask)
|
void WorldSession::SendAccountDataTimes(uint32 mask)
|
||||||
{
|
{
|
||||||
WorldPacket data( SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4 ); // changed in WotLK
|
WorldPacket data( SMSG_ACCOUNT_DATA_TIMES, 4+1+4+8*4 ); // changed in WotLK
|
||||||
data << uint32(sGameTime.GetGameTime()); // unix time of something
|
data << uint32(time(NULL)); // unix time of something
|
||||||
data << uint8(1);
|
data << uint8(1);
|
||||||
data << uint32(mask); // type mask
|
data << uint32(mask); // type mask
|
||||||
for(uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
|
for(uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
|
||||||
|
|||||||
+75
-4
@@ -18,13 +18,21 @@
|
|||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _TIMER_H
|
#ifndef TRINITY_TIMER_H
|
||||||
#define _TIMER_H
|
#define TRINITY_TIMER_H
|
||||||
|
|
||||||
#include "Platform/Define.h"
|
#include "Platform/CompilerDefs.h"
|
||||||
|
|
||||||
#if (PLATFORM != PLATFORM_WINDOWS)
|
#if PLATFORM == PLATFORM_WINDOWS
|
||||||
|
# include <ace/config-all.h>
|
||||||
|
# include <mmsystem.h>
|
||||||
|
# include <time.h>
|
||||||
|
#else
|
||||||
|
# if defined(__APPLE_CC__)
|
||||||
|
# include <time.h>
|
||||||
|
# endif
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
|
# include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PLATFORM == PLATFORM_WINDOWS
|
#if PLATFORM == PLATFORM_WINDOWS
|
||||||
@@ -48,4 +56,67 @@ inline uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
|
|||||||
return newMSTime - oldMSTime;
|
return newMSTime - oldMSTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class IntervalTimer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IntervalTimer() : _interval(0), _current(0) {}
|
||||||
|
|
||||||
|
void Update(time_t diff) { _current += diff; if(_current<0) _current=0;}
|
||||||
|
bool Passed() { return _current >= _interval; }
|
||||||
|
void Reset() { if(_current >= _interval) _current -= _interval; }
|
||||||
|
|
||||||
|
void SetCurrent(time_t current) { _current = current; }
|
||||||
|
void SetInterval(time_t interval) { _interval = interval; }
|
||||||
|
time_t GetInterval() const { return _interval; }
|
||||||
|
time_t GetCurrent() const { return _current; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
time_t _interval;
|
||||||
|
time_t _current;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TimeTracker
|
||||||
|
{
|
||||||
|
TimeTracker(time_t expiry) : i_expiryTime(expiry) {}
|
||||||
|
void Update(time_t diff) { i_expiryTime -= diff; }
|
||||||
|
bool Passed(void) const { return (i_expiryTime <= 0); }
|
||||||
|
void Reset(time_t interval) { i_expiryTime = interval; }
|
||||||
|
time_t GetExpiry(void) const { return i_expiryTime; }
|
||||||
|
time_t i_expiryTime;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TimeTrackerSmall
|
||||||
|
{
|
||||||
|
TimeTrackerSmall(int32 expiry) : i_expiryTime(expiry) {}
|
||||||
|
void Update(int32 diff) { i_expiryTime -= diff; }
|
||||||
|
bool Passed(void) const { return (i_expiryTime <= 0); }
|
||||||
|
void Reset(int32 interval) { i_expiryTime = interval; }
|
||||||
|
int32 GetExpiry(void) const { return i_expiryTime; }
|
||||||
|
int32 i_expiryTime;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct PeriodicTimer
|
||||||
|
{
|
||||||
|
PeriodicTimer(int32 period, int32 start_time) :
|
||||||
|
i_expireTime(start_time), i_period(period) {}
|
||||||
|
|
||||||
|
bool Update(const uint32 &diff)
|
||||||
|
{
|
||||||
|
if((i_expireTime -= diff) > 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
i_expireTime += i_period > diff ? i_period : diff;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetPeriodic(int32 period, int32 start_time)
|
||||||
|
{
|
||||||
|
i_expireTime=start_time, i_period=period;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32 i_period;
|
||||||
|
int32 i_expireTime;
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include "Master.h"
|
#include "Master.h"
|
||||||
#include "RASocket.h"
|
#include "RASocket.h"
|
||||||
#include "ScriptCalls.h"
|
#include "ScriptCalls.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
|
||||||
#include "sockets/TcpSocket.h"
|
#include "sockets/TcpSocket.h"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "BattleGroundMgr.h"
|
#include "BattleGroundMgr.h"
|
||||||
#include "MapManager.h"
|
#include "MapManager.h"
|
||||||
#include "TimeMgr.h"
|
#include "Timer.h"
|
||||||
#include "WorldRunnable.h"
|
#include "WorldRunnable.h"
|
||||||
|
|
||||||
#define WORLD_SLEEP_CONST 50
|
#define WORLD_SLEEP_CONST 50
|
||||||
|
|||||||
@@ -1218,14 +1218,6 @@
|
|||||||
RelativePath="..\..\src\game\TemporarySummon.h"
|
RelativePath="..\..\src\game\TemporarySummon.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\game\TimeMgr.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\..\src\game\TimeMgr.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\game\Totem.cpp"
|
RelativePath="..\..\src\game\Totem.cpp"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user