Core/Misc: Replace Time.UnixTime with GameTime.GetGameTime()
Port From (https://github.com/TrinityCore/TrinityCore/commit/e17e4e6f0700c7d950e1b2654c217ec8b28ae79e)
This commit is contained in:
@@ -279,7 +279,7 @@ namespace Game.Achievements
|
|||||||
|
|
||||||
if (!criteriaResult.IsEmpty())
|
if (!criteriaResult.IsEmpty())
|
||||||
{
|
{
|
||||||
var now = Time.UnixTime;
|
var now = GameTime.GetGameTime();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint id = criteriaResult.Read<uint>(0);
|
uint id = criteriaResult.Read<uint>(0);
|
||||||
@@ -518,7 +518,7 @@ namespace Game.Achievements
|
|||||||
Log.outDebug(LogFilter.Achievement, "PlayerAchievementMgr.CompletedAchievement({0}). {1}", achievement.Id, GetOwnerInfo());
|
Log.outDebug(LogFilter.Achievement, "PlayerAchievementMgr.CompletedAchievement({0}). {1}", achievement.Id, GetOwnerInfo());
|
||||||
|
|
||||||
CompletedAchievementData ca = new();
|
CompletedAchievementData ca = new();
|
||||||
ca.Date = Time.UnixTime;
|
ca.Date = GameTime.GetGameTime();
|
||||||
ca.Changed = true;
|
ca.Changed = true;
|
||||||
_completedAchievements[achievement.Id] = ca;
|
_completedAchievements[achievement.Id] = ca;
|
||||||
|
|
||||||
@@ -687,7 +687,7 @@ namespace Game.Achievements
|
|||||||
achievementEarned.Earner = _owner.GetGUID();
|
achievementEarned.Earner = _owner.GetGUID();
|
||||||
achievementEarned.EarnerNativeRealm = achievementEarned.EarnerVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
achievementEarned.EarnerNativeRealm = achievementEarned.EarnerVirtualRealm = Global.WorldMgr.GetVirtualRealmAddress();
|
||||||
achievementEarned.AchievementID = achievement.Id;
|
achievementEarned.AchievementID = achievement.Id;
|
||||||
achievementEarned.Time = Time.UnixTime;
|
achievementEarned.Time = GameTime.GetGameTime();
|
||||||
|
|
||||||
if (!achievement.Flags.HasAnyFlag(AchievementFlags.TrackingFlag))
|
if (!achievement.Flags.HasAnyFlag(AchievementFlags.TrackingFlag))
|
||||||
_owner.SendMessageToSetInRange(achievementEarned, WorldConfig.GetFloatValue(WorldCfg.ListenRangeSay), true);
|
_owner.SendMessageToSetInRange(achievementEarned, WorldConfig.GetFloatValue(WorldCfg.ListenRangeSay), true);
|
||||||
@@ -730,7 +730,7 @@ namespace Game.Achievements
|
|||||||
GuildAchievementDeleted guildAchievementDeleted = new();
|
GuildAchievementDeleted guildAchievementDeleted = new();
|
||||||
guildAchievementDeleted.AchievementID = iter.Key;
|
guildAchievementDeleted.AchievementID = iter.Key;
|
||||||
guildAchievementDeleted.GuildGUID = guid;
|
guildAchievementDeleted.GuildGUID = guid;
|
||||||
guildAchievementDeleted.TimeDeleted = Time.UnixTime;
|
guildAchievementDeleted.TimeDeleted = GameTime.GetGameTime();
|
||||||
SendPacket(guildAchievementDeleted);
|
SendPacket(guildAchievementDeleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -787,7 +787,7 @@ namespace Game.Achievements
|
|||||||
|
|
||||||
if (!criteriaResult.IsEmpty())
|
if (!criteriaResult.IsEmpty())
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint id = criteriaResult.Read<uint>(0);
|
uint id = criteriaResult.Read<uint>(0);
|
||||||
@@ -980,7 +980,7 @@ namespace Game.Achievements
|
|||||||
|
|
||||||
SendAchievementEarned(achievement);
|
SendAchievementEarned(achievement);
|
||||||
CompletedAchievementData ca = new();
|
CompletedAchievementData ca = new();
|
||||||
ca.Date = Time.UnixTime;
|
ca.Date = GameTime.GetGameTime();
|
||||||
ca.Changed = true;
|
ca.Changed = true;
|
||||||
|
|
||||||
if (achievement.Flags.HasAnyFlag(AchievementFlags.ShowGuildMembers))
|
if (achievement.Flags.HasAnyFlag(AchievementFlags.ShowGuildMembers))
|
||||||
@@ -1055,7 +1055,7 @@ namespace Game.Achievements
|
|||||||
GuildAchievementEarned guildAchievementEarned = new();
|
GuildAchievementEarned guildAchievementEarned = new();
|
||||||
guildAchievementEarned.AchievementID = achievement.Id;
|
guildAchievementEarned.AchievementID = achievement.Id;
|
||||||
guildAchievementEarned.GuildGUID = _owner.GetGUID();
|
guildAchievementEarned.GuildGUID = _owner.GetGUID();
|
||||||
guildAchievementEarned.TimeEarned = Time.UnixTime;
|
guildAchievementEarned.TimeEarned = GameTime.GetGameTime();
|
||||||
SendPacket(guildAchievementEarned);
|
SendPacket(guildAchievementEarned);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ namespace Game.Achievements
|
|||||||
}
|
}
|
||||||
|
|
||||||
progress.Changed = true;
|
progress.Changed = true;
|
||||||
progress.Date = Time.UnixTime; // set the date to the latest update.
|
progress.Date = GameTime.GetGameTime(); // set the date to the latest update.
|
||||||
progress.PlayerGUID = referencePlayer ? referencePlayer.GetGUID() : ObjectGuid.Empty;
|
progress.PlayerGUID = referencePlayer ? referencePlayer.GetGUID() : ObjectGuid.Empty;
|
||||||
_criteriaProgress[criteria.Id] = progress;
|
_criteriaProgress[criteria.Id] = progress;
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Game.BattleFields
|
|||||||
else // No more vacant places
|
else // No more vacant places
|
||||||
{
|
{
|
||||||
// todo Send a packet to announce it to player
|
// todo Send a packet to announce it to player
|
||||||
m_PlayersWillBeKick[player.GetTeamId()][player.GetGUID()] = Time.UnixTime + 10;
|
m_PlayersWillBeKick[player.GetTeamId()][player.GetGUID()] = GameTime.GetGameTime() + 10;
|
||||||
InvitePlayerToQueue(player);
|
InvitePlayerToQueue(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ namespace Game.BattleFields
|
|||||||
// Kick players who chose not to accept invitation to the battle
|
// Kick players who chose not to accept invitation to the battle
|
||||||
if (m_uiKickDontAcceptTimer <= diff)
|
if (m_uiKickDontAcceptTimer <= diff)
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
for (int team = 0; team < SharedConst.BGTeamsCount; team++)
|
for (int team = 0; team < SharedConst.BGTeamsCount; team++)
|
||||||
{
|
{
|
||||||
foreach (var pair in m_InvitedPlayers[team])
|
foreach (var pair in m_InvitedPlayers[team])
|
||||||
@@ -247,7 +247,7 @@ namespace Game.BattleFields
|
|||||||
if (m_PlayersInWar[player.GetTeamId()].Count + m_InvitedPlayers[player.GetTeamId()].Count < m_MaxPlayer)
|
if (m_PlayersInWar[player.GetTeamId()].Count + m_InvitedPlayers[player.GetTeamId()].Count < m_MaxPlayer)
|
||||||
InvitePlayerToWar(player);
|
InvitePlayerToWar(player);
|
||||||
else // Battlefield is full of players
|
else // Battlefield is full of players
|
||||||
m_PlayersWillBeKick[player.GetTeamId()][player.GetGUID()] = Time.UnixTime + 10;
|
m_PlayersWillBeKick[player.GetTeamId()][player.GetGUID()] = GameTime.GetGameTime() + 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,7 @@ namespace Game.BattleFields
|
|||||||
if (player.GetLevel() < m_MinLevel)
|
if (player.GetLevel() < m_MinLevel)
|
||||||
{
|
{
|
||||||
if (!m_PlayersWillBeKick[player.GetTeamId()].ContainsKey(player.GetGUID()))
|
if (!m_PlayersWillBeKick[player.GetTeamId()].ContainsKey(player.GetGUID()))
|
||||||
m_PlayersWillBeKick[player.GetTeamId()][player.GetGUID()] = Time.UnixTime + 10;
|
m_PlayersWillBeKick[player.GetTeamId()][player.GetGUID()] = GameTime.GetGameTime() + 10;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ namespace Game.BattleFields
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_PlayersWillBeKick[player.GetTeamId()].Remove(player.GetGUID());
|
m_PlayersWillBeKick[player.GetTeamId()].Remove(player.GetGUID());
|
||||||
m_InvitedPlayers[player.GetTeamId()][player.GetGUID()] = Time.UnixTime + m_TimeForAcceptInvite;
|
m_InvitedPlayers[player.GetTeamId()][player.GetGUID()] = GameTime.GetGameTime() + m_TimeForAcceptInvite;
|
||||||
player.GetSession().SendBfInvitePlayerToWar(GetQueueId(), m_ZoneId, m_TimeForAcceptInvite);
|
player.GetSession().SendBfInvitePlayerToWar(GetQueueId(), m_ZoneId, m_TimeForAcceptInvite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -766,7 +766,7 @@ namespace Game.BattleFields
|
|||||||
packet.AddState(WGWorldStates.ShowWorldstate, IsWarTime());
|
packet.AddState(WGWorldStates.ShowWorldstate, IsWarTime());
|
||||||
|
|
||||||
for (uint i = 0; i < 2; ++i)
|
for (uint i = 0; i < 2; ++i)
|
||||||
packet.AddState(WGConst.ClockWorldState[i], (int)(Time.UnixTime + (m_Timer / 1000)));
|
packet.AddState(WGConst.ClockWorldState[i], (int)(GameTime.GetGameTime() + (m_Timer / 1000)));
|
||||||
|
|
||||||
packet.AddState(WGWorldStates.VehicleH, (int)GetData(WGData.VehicleH));
|
packet.AddState(WGWorldStates.VehicleH, (int)GetData(WGData.VehicleH));
|
||||||
packet.AddState(WGWorldStates.MaxVehicleH, (int)GetData(WGData.MaxVehicleH));
|
packet.AddState(WGWorldStates.MaxVehicleH, (int)GetData(WGData.MaxVehicleH));
|
||||||
|
|||||||
@@ -98,12 +98,12 @@ namespace Game.BlackMarket
|
|||||||
|
|
||||||
public uint GetSecondsRemaining()
|
public uint GetSecondsRemaining()
|
||||||
{
|
{
|
||||||
return (uint)(_secondsRemaining - (Time.UnixTime - Global.BlackMarketMgr.GetLastUpdate()));
|
return (uint)(_secondsRemaining - (GameTime.GetGameTime() - Global.BlackMarketMgr.GetLastUpdate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
long GetExpirationTime()
|
long GetExpirationTime()
|
||||||
{
|
{
|
||||||
return Time.UnixTime + GetSecondsRemaining();
|
return GameTime.GetGameTime() + GetSecondsRemaining();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsCompleted()
|
public bool IsCompleted()
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Game.BlackMarket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastUpdate = Time.UnixTime; //Set update time before loading
|
_lastUpdate = GameTime.GetGameTime(); //Set update time before loading
|
||||||
|
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
do
|
do
|
||||||
@@ -100,7 +100,7 @@ namespace Game.BlackMarket
|
|||||||
public void Update(bool updateTime = false)
|
public void Update(bool updateTime = false)
|
||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
foreach (var entry in _auctions.Values)
|
foreach (var entry in _auctions.Values)
|
||||||
{
|
{
|
||||||
if (entry.IsCompleted() && entry.GetBidder() != 0)
|
if (entry.IsCompleted() && entry.GetBidder() != 0)
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ namespace Game
|
|||||||
public CalendarInvite()
|
public CalendarInvite()
|
||||||
{
|
{
|
||||||
InviteId = 1;
|
InviteId = 1;
|
||||||
ResponseTime = Time.UnixTime;
|
ResponseTime = 0;
|
||||||
Status = CalendarInviteStatus.Invited;
|
Status = CalendarInviteStatus.Invited;
|
||||||
Rank = CalendarModerationRank.Player;
|
Rank = CalendarModerationRank.Player;
|
||||||
Note = "";
|
Note = "";
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ namespace Game.Chat.Commands
|
|||||||
{
|
{
|
||||||
long unbanDate = result.Read<long>(3);
|
long unbanDate = result.Read<long>(3);
|
||||||
bool active = false;
|
bool active = false;
|
||||||
if (result.Read<bool>(2) && (result.Read<long>(1) == 0L || unbanDate >= Time.UnixTime))
|
if (result.Read<bool>(2) && (result.Read<long>(1) == 0L || unbanDate >= GameTime.GetGameTime()))
|
||||||
active = true;
|
active = true;
|
||||||
bool permanent = (result.Read<long>(1) == 0L);
|
bool permanent = (result.Read<long>(1) == 0L);
|
||||||
string banTime = permanent ? handler.GetCypherString(CypherStrings.BaninfoInfinite) : Time.secsToTimeString(result.Read<ulong>(1), true);
|
string banTime = permanent ? handler.GetCypherString(CypherStrings.BaninfoInfinite) : Time.secsToTimeString(result.Read<ulong>(1), true);
|
||||||
@@ -297,7 +297,7 @@ namespace Game.Chat.Commands
|
|||||||
{
|
{
|
||||||
long unbanDate = result.Read<uint>(3);
|
long unbanDate = result.Read<uint>(3);
|
||||||
bool active = false;
|
bool active = false;
|
||||||
if (result.Read<bool>(2) && (result.Read<ulong>(1) == 0 || unbanDate >= Time.UnixTime))
|
if (result.Read<bool>(2) && (result.Read<ulong>(1) == 0 || unbanDate >= GameTime.GetGameTime()))
|
||||||
active = true;
|
active = true;
|
||||||
bool permanent = (result.Read<ulong>(1) == 0);
|
bool permanent = (result.Read<ulong>(1) == 0);
|
||||||
string banTime = permanent ? handler.GetCypherString(CypherStrings.BaninfoInfinite) : Time.secsToTimeString(result.Read<ulong>(1), true);
|
string banTime = permanent ? handler.GetCypherString(CypherStrings.BaninfoInfinite) : Time.secsToTimeString(result.Read<ulong>(1), true);
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ namespace Game.Chat
|
|||||||
string endTimeStr = Time.UnixTimeToDateTime(eventData.end).ToLongDateString();
|
string endTimeStr = Time.UnixTimeToDateTime(eventData.end).ToLongDateString();
|
||||||
|
|
||||||
uint delay = Global.GameEventMgr.NextCheck(eventId);
|
uint delay = Global.GameEventMgr.NextCheck(eventId);
|
||||||
long nextTime = Time.UnixTime + delay;
|
long nextTime = GameTime.GetGameTime() + delay;
|
||||||
string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? Time.UnixTimeToDateTime(Time.UnixTime + delay).ToShortTimeString() : "-";
|
string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? Time.UnixTimeToDateTime(GameTime.GetGameTime() + delay).ToShortTimeString() : "-";
|
||||||
|
|
||||||
string occurenceStr = Time.secsToTimeString(eventData.occurence * Time.Minute);
|
string occurenceStr = Time.secsToTimeString(eventData.occurence * Time.Minute);
|
||||||
string lengthStr = Time.secsToTimeString(eventData.length * Time.Minute);
|
string lengthStr = Time.secsToTimeString(eventData.length * Time.Minute);
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ namespace Game.Chat
|
|||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
int curRespawnDelay = (int)(target.GetRespawnTimeEx() - Time.UnixTime);
|
int curRespawnDelay = (int)(target.GetRespawnTimeEx() - GameTime.GetGameTime());
|
||||||
if (curRespawnDelay < 0)
|
if (curRespawnDelay < 0)
|
||||||
curRespawnDelay = 0;
|
curRespawnDelay = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Game.Chat
|
|||||||
foreach (var pair in binds)
|
foreach (var pair in binds)
|
||||||
{
|
{
|
||||||
InstanceSave save = pair.Value.save;
|
InstanceSave save = pair.Value.save;
|
||||||
string timeleft = Time.GetTimeString(save.GetResetTime() - Time.UnixTime);
|
string timeleft = Time.GetTimeString(save.GetResetTime() - GameTime.GetGameTime());
|
||||||
handler.SendSysMessage(format, pair.Key, save.GetInstanceId(), pair.Value.perm ? "yes" : "no", save.GetDifficultyID(), save.CanReset() ? "yes" : "no", timeleft);
|
handler.SendSysMessage(format, pair.Key, save.GetInstanceId(), pair.Value.perm ? "yes" : "no", save.GetDifficultyID(), save.CanReset() ? "yes" : "no", timeleft);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ namespace Game.Chat
|
|||||||
foreach (var pair in binds)
|
foreach (var pair in binds)
|
||||||
{
|
{
|
||||||
InstanceSave save = pair.Value.save;
|
InstanceSave save = pair.Value.save;
|
||||||
string timeleft = Time.GetTimeString(save.GetResetTime() - Time.UnixTime);
|
string timeleft = Time.GetTimeString(save.GetResetTime() - GameTime.GetGameTime());
|
||||||
handler.SendSysMessage(format, pair.Key, save.GetInstanceId(), pair.Value.perm ? "yes" : "no", save.GetDifficultyID(), save.CanReset() ? "yes" : "no", timeleft);
|
handler.SendSysMessage(format, pair.Key, save.GetInstanceId(), pair.Value.perm ? "yes" : "no", save.GetDifficultyID(), save.CanReset() ? "yes" : "no", timeleft);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ namespace Game.Chat
|
|||||||
InstanceSave save = pair.Value.save;
|
InstanceSave save = pair.Value.save;
|
||||||
if (pair.Key != player.GetMapId() && (MapId == 0 || MapId == pair.Key) && (diff == -1 || diff == (sbyte)save.GetDifficultyID()))
|
if (pair.Key != player.GetMapId() && (MapId == 0 || MapId == pair.Key) && (diff == -1 || diff == (sbyte)save.GetDifficultyID()))
|
||||||
{
|
{
|
||||||
string timeleft = Time.GetTimeString(save.GetResetTime() - Time.UnixTime);
|
string timeleft = Time.GetTimeString(save.GetResetTime() - GameTime.GetGameTime());
|
||||||
handler.SendSysMessage("unbinding map: {0} inst: {1} perm: {2} diff: {3} canReset: {4} TTR: {5}", pair.Key, save.GetInstanceId(),
|
handler.SendSysMessage("unbinding map: {0} inst: {1} perm: {2} diff: {3} canReset: {4} TTR: {5}", pair.Key, save.GetInstanceId(),
|
||||||
pair.Value.perm ? "yes" : "no", save.GetDifficultyID(), save.CanReset() ? "yes" : "no", timeleft);
|
pair.Value.perm ? "yes" : "no", save.GetDifficultyID(), save.CanReset() ? "yes" : "no", timeleft);
|
||||||
player.UnbindInstance(pair.Key, (Difficulty)difficulty.Id);
|
player.UnbindInstance(pair.Key, (Difficulty)difficulty.Id);
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ namespace Game.Chat.Commands
|
|||||||
uint gridY = ri.gridId / MapConst.MaxGrids;
|
uint gridY = ri.gridId / MapConst.MaxGrids;
|
||||||
uint gridX = ri.gridId % MapConst.MaxGrids;
|
uint gridX = ri.gridId % MapConst.MaxGrids;
|
||||||
|
|
||||||
string respawnTime = ri.respawnTime > Time.UnixTime ? Time.secsToTimeString((ulong)(ri.respawnTime - Time.UnixTime), true) : stringOverdue;
|
string respawnTime = ri.respawnTime > GameTime.GetGameTime() ? Time.secsToTimeString((ulong)(ri.respawnTime - GameTime.GetGameTime()), true) : stringOverdue;
|
||||||
handler.SendSysMessage($"{ri.spawnId} | {ri.entry} | [{gridX},{gridY}] | {GetZoneName(ri.zoneId, handler.GetSessionDbcLocale())} ({ri.zoneId}) | {(map.IsSpawnGroupActive(data.spawnGroupData.groupId) ? respawnTime : "inactive")}");
|
handler.SendSysMessage($"{ri.spawnId} | {ri.entry} | [{gridX},{gridY}] | {GetZoneName(ri.zoneId, handler.GetSessionDbcLocale())} ({ri.zoneId}) | {(map.IsSpawnGroupActive(data.spawnGroupData.groupId) ? respawnTime : "inactive")}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,7 +625,7 @@ namespace Game.Chat.Commands
|
|||||||
uint gridY = ri.gridId / MapConst.MaxGrids;
|
uint gridY = ri.gridId / MapConst.MaxGrids;
|
||||||
uint gridX = ri.gridId % MapConst.MaxGrids;
|
uint gridX = ri.gridId % MapConst.MaxGrids;
|
||||||
|
|
||||||
string respawnTime = ri.respawnTime > Time.UnixTime ? Time.secsToTimeString((ulong)(ri.respawnTime - Time.UnixTime), true) : stringOverdue;
|
string respawnTime = ri.respawnTime > GameTime.GetGameTime() ? Time.secsToTimeString((ulong)(ri.respawnTime - GameTime.GetGameTime()), true) : stringOverdue;
|
||||||
handler.SendSysMessage($"{ri.spawnId} | {ri.entry} | [{gridX},{gridY}] | {GetZoneName(ri.zoneId, handler.GetSessionDbcLocale())} ({ri.zoneId}) | {(map.IsSpawnGroupActive(data.spawnGroupData.groupId) ? respawnTime : "inactive")}");
|
handler.SendSysMessage($"{ri.spawnId} | {ri.entry} | [{gridX},{gridY}] | {GetZoneName(ri.zoneId, handler.GetSessionDbcLocale())} ({ri.zoneId}) | {(map.IsSpawnGroupActive(data.spawnGroupData.groupId) ? respawnTime : "inactive")}");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1334,7 +1334,7 @@ namespace Game.Chat
|
|||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
// Target is online, mute will be in effect right away.
|
// Target is online, mute will be in effect right away.
|
||||||
long muteTime = Time.UnixTime + notSpeakTime * Time.Minute;
|
long muteTime = GameTime.GetGameTime() + notSpeakTime * Time.Minute;
|
||||||
target.GetSession().m_muteTime = muteTime;
|
target.GetSession().m_muteTime = muteTime;
|
||||||
stmt.AddValue(0, muteTime);
|
stmt.AddValue(0, muteTime);
|
||||||
string nameLink = handler.PlayerLink(targetName);
|
string nameLink = handler.PlayerLink(targetName);
|
||||||
@@ -1727,11 +1727,11 @@ namespace Game.Chat
|
|||||||
|
|
||||||
// Output III. LANG_PINFO_BANNED if ban exists and is applied
|
// Output III. LANG_PINFO_BANNED if ban exists and is applied
|
||||||
if (banTime >= 0)
|
if (banTime >= 0)
|
||||||
handler.SendSysMessage(CypherStrings.PinfoBanned, banType, banReason, banTime > 0 ? Time.secsToTimeString((ulong)(banTime - Time.UnixTime), true) : handler.GetCypherString(CypherStrings.Permanently), bannedBy);
|
handler.SendSysMessage(CypherStrings.PinfoBanned, banType, banReason, banTime > 0 ? Time.secsToTimeString((ulong)(banTime - GameTime.GetGameTime()), true) : handler.GetCypherString(CypherStrings.Permanently), bannedBy);
|
||||||
|
|
||||||
// Output IV. LANG_PINFO_MUTED if mute is applied
|
// Output IV. LANG_PINFO_MUTED if mute is applied
|
||||||
if (muteTime > 0)
|
if (muteTime > 0)
|
||||||
handler.SendSysMessage(CypherStrings.PinfoMuted, muteReason, Time.secsToTimeString((ulong)(muteTime - Time.UnixTime), true), muteBy);
|
handler.SendSysMessage(CypherStrings.PinfoMuted, muteReason, Time.secsToTimeString((ulong)(muteTime - GameTime.GetGameTime()), true), muteBy);
|
||||||
|
|
||||||
// Output V. LANG_PINFO_ACC_ACCOUNT
|
// Output V. LANG_PINFO_ACC_ACCOUNT
|
||||||
handler.SendSysMessage(CypherStrings.PinfoAccAccount, userName, accId, security);
|
handler.SendSysMessage(CypherStrings.PinfoAccAccount, userName, accId, security);
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ namespace Game.Chat
|
|||||||
uint nativeid = target.GetNativeDisplayId();
|
uint nativeid = target.GetNativeDisplayId();
|
||||||
uint Entry = target.GetEntry();
|
uint Entry = target.GetEntry();
|
||||||
|
|
||||||
long curRespawnDelay = target.GetRespawnCompatibilityMode() ? target.GetRespawnTimeEx() - Time.UnixTime : target.GetMap().GetCreatureRespawnTime(target.GetSpawnId()) - Time.UnixTime;
|
long curRespawnDelay = target.GetRespawnCompatibilityMode() ? target.GetRespawnTimeEx() - GameTime.GetGameTime() : target.GetMap().GetCreatureRespawnTime(target.GetSpawnId()) - GameTime.GetGameTime();
|
||||||
if (curRespawnDelay < 0)
|
if (curRespawnDelay < 0)
|
||||||
curRespawnDelay = 0;
|
curRespawnDelay = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ namespace Game.DungeonFinding
|
|||||||
if (!IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser))
|
if (!IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
long currTime = Time.UnixTime;
|
long currTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
// Remove obsolete role checks
|
// Remove obsolete role checks
|
||||||
foreach (var pairCheck in RoleChecksStore)
|
foreach (var pairCheck in RoleChecksStore)
|
||||||
@@ -500,14 +500,14 @@ namespace Game.DungeonFinding
|
|||||||
ticket.RequesterGuid = guid;
|
ticket.RequesterGuid = guid;
|
||||||
ticket.Id = GetQueueId(gguid);
|
ticket.Id = GetQueueId(gguid);
|
||||||
ticket.Type = RideType.Lfg;
|
ticket.Type = RideType.Lfg;
|
||||||
ticket.Time = (int)Time.UnixTime;
|
ticket.Time = GameTime.GetGameTime();
|
||||||
|
|
||||||
string debugNames = "";
|
string debugNames = "";
|
||||||
if (grp) // Begin rolecheck
|
if (grp) // Begin rolecheck
|
||||||
{
|
{
|
||||||
// Create new rolecheck
|
// Create new rolecheck
|
||||||
LfgRoleCheck roleCheck = new();
|
LfgRoleCheck roleCheck = new();
|
||||||
roleCheck.cancelTime = Time.UnixTime + SharedConst.LFGTimeRolecheck;
|
roleCheck.cancelTime = GameTime.GetGameTime() + SharedConst.LFGTimeRolecheck;
|
||||||
roleCheck.state = LfgRoleCheckState.Initialiting;
|
roleCheck.state = LfgRoleCheckState.Initialiting;
|
||||||
roleCheck.leader = guid;
|
roleCheck.leader = guid;
|
||||||
roleCheck.dungeons = dungeons;
|
roleCheck.dungeons = dungeons;
|
||||||
@@ -549,7 +549,7 @@ namespace Game.DungeonFinding
|
|||||||
Dictionary<ObjectGuid, LfgRoles> rolesMap = new();
|
Dictionary<ObjectGuid, LfgRoles> rolesMap = new();
|
||||||
rolesMap[guid] = roles;
|
rolesMap[guid] = roles;
|
||||||
LFGQueue queue = GetQueue(guid);
|
LFGQueue queue = GetQueue(guid);
|
||||||
queue.AddQueueData(guid, Time.UnixTime, dungeons, rolesMap);
|
queue.AddQueueData(guid, GameTime.GetGameTime(), dungeons, rolesMap);
|
||||||
|
|
||||||
if (!isContinue)
|
if (!isContinue)
|
||||||
{
|
{
|
||||||
@@ -723,7 +723,7 @@ namespace Game.DungeonFinding
|
|||||||
{
|
{
|
||||||
SetState(gguid, LfgState.Queued);
|
SetState(gguid, LfgState.Queued);
|
||||||
LFGQueue queue = GetQueue(gguid);
|
LFGQueue queue = GetQueue(gguid);
|
||||||
queue.AddQueueData(gguid, Time.UnixTime, roleCheck.dungeons, roleCheck.roles);
|
queue.AddQueueData(gguid, GameTime.GetGameTime(), roleCheck.dungeons, roleCheck.roles);
|
||||||
RoleChecksStore.Remove(gguid);
|
RoleChecksStore.Remove(gguid);
|
||||||
}
|
}
|
||||||
else if (roleCheck.state != LfgRoleCheckState.Initialiting)
|
else if (roleCheck.state != LfgRoleCheckState.Initialiting)
|
||||||
@@ -978,7 +978,7 @@ namespace Game.DungeonFinding
|
|||||||
|
|
||||||
bool sendUpdate = proposal.state != LfgProposalState.Success;
|
bool sendUpdate = proposal.state != LfgProposalState.Success;
|
||||||
proposal.state = LfgProposalState.Success;
|
proposal.state = LfgProposalState.Success;
|
||||||
long joinTime = Time.UnixTime;
|
long joinTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
LFGQueue queue = GetQueue(guid);
|
LFGQueue queue = GetQueue(guid);
|
||||||
LfgUpdateData updateData = new(LfgUpdateType.GroupFound);
|
LfgUpdateData updateData = new(LfgUpdateType.GroupFound);
|
||||||
@@ -1129,7 +1129,7 @@ namespace Game.DungeonFinding
|
|||||||
|
|
||||||
LfgPlayerBoot boot = BootsStore[gguid];
|
LfgPlayerBoot boot = BootsStore[gguid];
|
||||||
boot.inProgress = true;
|
boot.inProgress = true;
|
||||||
boot.cancelTime = Time.UnixTime + SharedConst.LFGTimeBoot;
|
boot.cancelTime = GameTime.GetGameTime() + SharedConst.LFGTimeBoot;
|
||||||
boot.reason = reason;
|
boot.reason = reason;
|
||||||
boot.victim = victim;
|
boot.victim = victim;
|
||||||
|
|
||||||
|
|||||||
@@ -522,7 +522,7 @@ namespace Game.DungeonFinding
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a new proposal
|
// Create a new proposal
|
||||||
proposal.cancelTime = Time.UnixTime + SharedConst.LFGTimeProposal;
|
proposal.cancelTime = GameTime.GetGameTime() + SharedConst.LFGTimeProposal;
|
||||||
proposal.state = LfgProposalState.Initiating;
|
proposal.state = LfgProposalState.Initiating;
|
||||||
proposal.leader = ObjectGuid.Empty;
|
proposal.leader = ObjectGuid.Empty;
|
||||||
proposal.dungeonId = proposalDungeons.SelectRandom();
|
proposal.dungeonId = proposalDungeons.SelectRandom();
|
||||||
@@ -746,7 +746,7 @@ namespace Game.DungeonFinding
|
|||||||
{
|
{
|
||||||
public LfgQueueData()
|
public LfgQueueData()
|
||||||
{
|
{
|
||||||
joinTime = Time.UnixTime;
|
joinTime = GameTime.GetGameTime();
|
||||||
tanks = SharedConst.LFGTanksNeeded;
|
tanks = SharedConst.LFGTanksNeeded;
|
||||||
healers = SharedConst.LFGHealersNeeded;
|
healers = SharedConst.LFGHealersNeeded;
|
||||||
dps = SharedConst.LFGDPSNeeded;
|
dps = SharedConst.LFGDPSNeeded;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
m_corpseData = new CorpseData();
|
m_corpseData = new CorpseData();
|
||||||
|
|
||||||
m_time = Time.UnixTime;
|
m_time = GameTime.GetGameTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddToWorld()
|
public override void AddToWorld()
|
||||||
@@ -312,7 +312,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long GetGhostTime() { return m_time; }
|
public long GetGhostTime() { return m_time; }
|
||||||
public void ResetGhostTime() { m_time = Time.UnixTime; }
|
public void ResetGhostTime() { m_time = GameTime.GetGameTime(); }
|
||||||
public CorpseType GetCorpseType() { return m_type; }
|
public CorpseType GetCorpseType() { return m_type; }
|
||||||
|
|
||||||
public CellCoord GetCellCoord() { return _cellCoord; }
|
public CellCoord GetCellCoord() { return _cellCoord; }
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (m_respawnCompatibilityMode)
|
if (m_respawnCompatibilityMode)
|
||||||
{
|
{
|
||||||
m_corpseRemoveTime = Time.UnixTime;
|
m_corpseRemoveTime = GameTime.GetGameTime();
|
||||||
SetDeathState(DeathState.Dead);
|
SetDeathState(DeathState.Dead);
|
||||||
RemoveAllAuras();
|
RemoveAllAuras();
|
||||||
//DestroyForNearbyPlayers(); // old UpdateObjectVisibility()
|
//DestroyForNearbyPlayers(); // old UpdateObjectVisibility()
|
||||||
@@ -177,7 +177,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// Should get removed later, just keep "compatibility" with scripts
|
// Should get removed later, just keep "compatibility" with scripts
|
||||||
if (setSpawnTime)
|
if (setSpawnTime)
|
||||||
m_respawnTime = Math.Max(Time.UnixTime + respawnDelay, m_respawnTime);
|
m_respawnTime = Math.Max(GameTime.GetGameTime() + respawnDelay, m_respawnTime);
|
||||||
|
|
||||||
// if corpse was removed during falling, the falling will continue and override relocation to respawn position
|
// if corpse was removed during falling, the falling will continue and override relocation to respawn position
|
||||||
if (IsFalling())
|
if (IsFalling())
|
||||||
@@ -211,7 +211,7 @@ namespace Game.Entities
|
|||||||
if (setSpawnTime)
|
if (setSpawnTime)
|
||||||
{
|
{
|
||||||
uint respawnDelay = m_respawnDelay;
|
uint respawnDelay = m_respawnDelay;
|
||||||
m_respawnTime = Math.Max(Time.UnixTime + respawnDelay, m_respawnTime);
|
m_respawnTime = Math.Max(GameTime.GetGameTime() + respawnDelay, m_respawnTime);
|
||||||
|
|
||||||
SaveRespawnTime(0, false);
|
SaveRespawnTime(0, false);
|
||||||
}
|
}
|
||||||
@@ -444,7 +444,7 @@ namespace Game.Entities
|
|||||||
break;
|
break;
|
||||||
case DeathState.Dead:
|
case DeathState.Dead:
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
if (m_respawnTime <= now)
|
if (m_respawnTime <= now)
|
||||||
{
|
{
|
||||||
// First check if there are any scripts that object to us respawning
|
// First check if there are any scripts that object to us respawning
|
||||||
@@ -499,7 +499,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
else m_groupLootTimer -= diff;
|
else m_groupLootTimer -= diff;
|
||||||
}
|
}
|
||||||
else if (m_corpseRemoveTime <= Time.UnixTime)
|
else if (m_corpseRemoveTime <= GameTime.GetGameTime())
|
||||||
{
|
{
|
||||||
RemoveCorpse(false);
|
RemoveCorpse(false);
|
||||||
Log.outDebug(LogFilter.Unit, "Removing corpse... {0} ", GetEntry());
|
Log.outDebug(LogFilter.Unit, "Removing corpse... {0} ", GetEntry());
|
||||||
@@ -1025,10 +1025,10 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public void StartPickPocketRefillTimer()
|
public void StartPickPocketRefillTimer()
|
||||||
{
|
{
|
||||||
_pickpocketLootRestore = Time.UnixTime + WorldConfig.GetIntValue(WorldCfg.CreaturePickpocketRefill);
|
_pickpocketLootRestore = GameTime.GetGameTime() + WorldConfig.GetIntValue(WorldCfg.CreaturePickpocketRefill);
|
||||||
}
|
}
|
||||||
public void ResetPickPocketRefillTimer() { _pickpocketLootRestore = 0; }
|
public void ResetPickPocketRefillTimer() { _pickpocketLootRestore = 0; }
|
||||||
public bool CanGeneratePickPocketLoot() { return _pickpocketLootRestore <= Time.UnixTime; }
|
public bool CanGeneratePickPocketLoot() { return _pickpocketLootRestore <= GameTime.GetGameTime(); }
|
||||||
public ObjectGuid GetLootRecipientGUID() { return m_lootRecipient; }
|
public ObjectGuid GetLootRecipientGUID() { return m_lootRecipient; }
|
||||||
|
|
||||||
public Player GetLootRecipient()
|
public Player GetLootRecipient()
|
||||||
@@ -1536,7 +1536,7 @@ namespace Game.Entities
|
|||||||
if (base.IsInvisibleDueToDespawn())
|
if (base.IsInvisibleDueToDespawn())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (IsAlive() || m_corpseRemoveTime > Time.UnixTime)
|
if (IsAlive() || m_corpseRemoveTime > GameTime.GetGameTime())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -1641,7 +1641,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (s == DeathState.JustDied)
|
if (s == DeathState.JustDied)
|
||||||
{
|
{
|
||||||
m_corpseRemoveTime = Time.UnixTime + m_corpseDelay;
|
m_corpseRemoveTime = GameTime.GetGameTime() + m_corpseDelay;
|
||||||
uint respawnDelay = m_respawnDelay;
|
uint respawnDelay = m_respawnDelay;
|
||||||
uint scalingMode = WorldConfig.GetUIntValue(WorldCfg.RespawnDynamicMode);
|
uint scalingMode = WorldConfig.GetUIntValue(WorldCfg.RespawnDynamicMode);
|
||||||
if (scalingMode != 0)
|
if (scalingMode != 0)
|
||||||
@@ -1652,14 +1652,14 @@ namespace Game.Entities
|
|||||||
if (IsDungeonBoss() && m_respawnDelay == 0)
|
if (IsDungeonBoss() && m_respawnDelay == 0)
|
||||||
m_respawnTime = long.MaxValue; // never respawn in this instance
|
m_respawnTime = long.MaxValue; // never respawn in this instance
|
||||||
else
|
else
|
||||||
m_respawnTime = Time.UnixTime + respawnDelay + m_corpseDelay;
|
m_respawnTime = GameTime.GetGameTime() + respawnDelay + m_corpseDelay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsDungeonBoss() && m_respawnDelay == 0)
|
if (IsDungeonBoss() && m_respawnDelay == 0)
|
||||||
m_respawnTime = long.MaxValue; // never respawn in this instance
|
m_respawnTime = long.MaxValue; // never respawn in this instance
|
||||||
else
|
else
|
||||||
m_respawnTime = Time.UnixTime + respawnDelay;
|
m_respawnTime = GameTime.GetGameTime() + respawnDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
// always save boss respawn time at death to prevent crash cheating
|
// always save boss respawn time at death to prevent crash cheating
|
||||||
@@ -1848,7 +1848,7 @@ namespace Game.Entities
|
|||||||
uint scalingMode = WorldConfig.GetUIntValue(WorldCfg.RespawnDynamicMode);
|
uint scalingMode = WorldConfig.GetUIntValue(WorldCfg.RespawnDynamicMode);
|
||||||
if (scalingMode != 0)
|
if (scalingMode != 0)
|
||||||
GetMap().ApplyDynamicModeRespawnScaling(this, m_spawnId, ref respawnDelay, scalingMode);
|
GetMap().ApplyDynamicModeRespawnScaling(this, m_spawnId, ref respawnDelay, scalingMode);
|
||||||
m_respawnTime = Time.UnixTime + respawnDelay;
|
m_respawnTime = GameTime.GetGameTime() + respawnDelay;
|
||||||
SaveRespawnTime();
|
SaveRespawnTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2128,7 +2128,7 @@ namespace Game.Entities
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long thisRespawnTime = forceDelay != 0 ? Time.UnixTime + forceDelay : m_respawnTime;
|
long thisRespawnTime = forceDelay != 0 ? GameTime.GetGameTime() + forceDelay : m_respawnTime;
|
||||||
GetMap().SaveRespawnTime(SpawnObjectType.Creature, m_spawnId, GetEntry(), thisRespawnTime, GetMap().GetZoneId(GetPhaseShift(), GetHomePosition()), GridDefines.ComputeGridCoord(GetHomePosition().GetPositionX(), GetHomePosition().GetPositionY()).GetId(), saveToDb && m_creatureData != null && m_creatureData.dbData);
|
GetMap().SaveRespawnTime(SpawnObjectType.Creature, m_spawnId, GetEntry(), thisRespawnTime, GetMap().GetZoneId(GetPhaseShift(), GetHomePosition()), GridDefines.ComputeGridCoord(GetHomePosition().GetPositionX(), GetHomePosition().GetPositionY()).GetId(), saveToDb && m_creatureData != null && m_creatureData.dbData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2326,7 +2326,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public long GetRespawnTimeEx()
|
public long GetRespawnTimeEx()
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
if (m_respawnTime > now)
|
if (m_respawnTime > now)
|
||||||
return m_respawnTime;
|
return m_respawnTime;
|
||||||
else
|
else
|
||||||
@@ -2364,7 +2364,7 @@ namespace Game.Entities
|
|||||||
if (LootStorage.Skinning.HaveLootFor(GetCreatureTemplate().SkinLootId))
|
if (LootStorage.Skinning.HaveLootFor(GetCreatureTemplate().SkinLootId))
|
||||||
AddUnitFlag(UnitFlags.Skinnable);
|
AddUnitFlag(UnitFlags.Skinnable);
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
// Do not reset corpse remove time if corpse is already removed
|
// Do not reset corpse remove time if corpse is already removed
|
||||||
if (m_corpseRemoveTime <= now)
|
if (m_corpseRemoveTime <= now)
|
||||||
return;
|
return;
|
||||||
@@ -2532,7 +2532,7 @@ namespace Game.Entities
|
|||||||
if (vCount == null)
|
if (vCount == null)
|
||||||
return vItem.maxcount;
|
return vItem.maxcount;
|
||||||
|
|
||||||
long ptime = Time.UnixTime;
|
long ptime = GameTime.GetGameTime();
|
||||||
|
|
||||||
if (vCount.lastIncrementTime + vItem.incrtime <= ptime)
|
if (vCount.lastIncrementTime + vItem.incrtime <= ptime)
|
||||||
{
|
{
|
||||||
@@ -2572,7 +2572,7 @@ namespace Game.Entities
|
|||||||
return new_count;
|
return new_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
long ptime = Time.UnixTime;
|
long ptime = GameTime.GetGameTime();
|
||||||
|
|
||||||
if (vCount.lastIncrementTime + vItem.incrtime <= ptime)
|
if (vCount.lastIncrementTime + vItem.incrtime <= ptime)
|
||||||
{
|
{
|
||||||
@@ -3032,7 +3032,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// Is the creature script objecting to us spawning? If yes, delay by a little bit (then re-check in ::Update)
|
// Is the creature script objecting to us spawning? If yes, delay by a little bit (then re-check in ::Update)
|
||||||
if (m_respawnCompatibilityMode && m_respawnTime == 0 && !Global.ScriptMgr.CanSpawn(spawnId, GetEntry(), GetCreatureData(), map))
|
if (m_respawnCompatibilityMode && m_respawnTime == 0 && !Global.ScriptMgr.CanSpawn(spawnId, GetEntry(), GetCreatureData(), map))
|
||||||
m_respawnTime = Time.UnixTime + RandomHelper.URand(4, 7);
|
m_respawnTime = GameTime.GetGameTime() + RandomHelper.URand(4, 7);
|
||||||
|
|
||||||
if (m_respawnTime != 0) // respawn on UpdateLoadCreatureFromDB
|
if (m_respawnTime != 0) // respawn on UpdateLoadCreatureFromDB
|
||||||
{
|
{
|
||||||
@@ -3074,7 +3074,7 @@ namespace Game.Entities
|
|||||||
public void SetDefaultMovementType(MovementGeneratorType mgt) { DefaultMovementType = mgt; }
|
public void SetDefaultMovementType(MovementGeneratorType mgt) { DefaultMovementType = mgt; }
|
||||||
|
|
||||||
public long GetRespawnTime() { return m_respawnTime; }
|
public long GetRespawnTime() { return m_respawnTime; }
|
||||||
public void SetRespawnTime(uint respawn) { m_respawnTime = respawn != 0 ? Time.UnixTime + respawn : 0; }
|
public void SetRespawnTime(uint respawn) { m_respawnTime = respawn != 0 ? GameTime.GetGameTime() + respawn : 0; }
|
||||||
|
|
||||||
public uint GetRespawnDelay() { return m_respawnDelay; }
|
public uint GetRespawnDelay() { return m_respawnDelay; }
|
||||||
public void SetRespawnDelay(uint delay) { m_respawnDelay = delay; }
|
public void SetRespawnDelay(uint delay) { m_respawnDelay = delay; }
|
||||||
@@ -3276,7 +3276,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
itemId = _item;
|
itemId = _item;
|
||||||
count = _count;
|
count = _count;
|
||||||
lastIncrementTime = Time.UnixTime;
|
lastIncrementTime = GameTime.GetGameTime();
|
||||||
}
|
}
|
||||||
public uint itemId;
|
public uint itemId;
|
||||||
public uint count;
|
public uint count;
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ namespace Game.Entities
|
|||||||
case GameObjectTypes.FishingNode:
|
case GameObjectTypes.FishingNode:
|
||||||
{
|
{
|
||||||
// fishing code (bobber ready)
|
// fishing code (bobber ready)
|
||||||
if (Time.UnixTime > m_respawnTime - 5)
|
if (GameTime.GetGameTime() > m_respawnTime - 5)
|
||||||
{
|
{
|
||||||
// splash bobber (bobber ready now)
|
// splash bobber (bobber ready now)
|
||||||
Unit caster = GetOwner();
|
Unit caster = GetOwner();
|
||||||
@@ -527,7 +527,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (m_respawnTime > 0) // timer on
|
if (m_respawnTime > 0) // timer on
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
if (m_respawnTime <= now) // timer expired
|
if (m_respawnTime <= now) // timer expired
|
||||||
{
|
{
|
||||||
ObjectGuid dbtableHighGuid = ObjectGuid.Create(HighGuid.GameObject, GetMapId(), GetEntry(), m_spawnId);
|
ObjectGuid dbtableHighGuid = ObjectGuid.Create(HighGuid.GameObject, GetMapId(), GetEntry(), m_spawnId);
|
||||||
@@ -820,7 +820,7 @@ namespace Game.Entities
|
|||||||
uint scalingMode = WorldConfig.GetUIntValue(WorldCfg.RespawnDynamicMode);
|
uint scalingMode = WorldConfig.GetUIntValue(WorldCfg.RespawnDynamicMode);
|
||||||
if (scalingMode != 0)
|
if (scalingMode != 0)
|
||||||
GetMap().ApplyDynamicModeRespawnScaling(this, m_spawnId, ref respawnDelay, scalingMode);
|
GetMap().ApplyDynamicModeRespawnScaling(this, m_spawnId, ref respawnDelay, scalingMode);
|
||||||
m_respawnTime = Time.UnixTime + respawnDelay;
|
m_respawnTime = GameTime.GetGameTime() + respawnDelay;
|
||||||
|
|
||||||
// if option not set then object will be saved at grid unload
|
// if option not set then object will be saved at grid unload
|
||||||
// Otherwise just save respawn time to map object memory
|
// Otherwise just save respawn time to map object memory
|
||||||
@@ -1038,7 +1038,7 @@ namespace Game.Entities
|
|||||||
m_respawnTime = GetMap().GetGORespawnTime(m_spawnId);
|
m_respawnTime = GetMap().GetGORespawnTime(m_spawnId);
|
||||||
|
|
||||||
// ready to respawn
|
// ready to respawn
|
||||||
if (m_respawnTime != 0 && m_respawnTime <= Time.UnixTime)
|
if (m_respawnTime != 0 && m_respawnTime <= GameTime.GetGameTime())
|
||||||
{
|
{
|
||||||
m_respawnTime = 0;
|
m_respawnTime = 0;
|
||||||
GetMap().RemoveRespawnTime(SpawnObjectType.GameObject, m_spawnId);
|
GetMap().RemoveRespawnTime(SpawnObjectType.GameObject, m_spawnId);
|
||||||
@@ -1140,7 +1140,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public override void SaveRespawnTime(uint forceDelay = 0, bool savetodb = true)
|
public override void SaveRespawnTime(uint forceDelay = 0, bool savetodb = true)
|
||||||
{
|
{
|
||||||
if (m_goData != null && m_respawnTime > Time.UnixTime && m_spawnedByDefault)
|
if (m_goData != null && m_respawnTime > GameTime.GetGameTime() && m_spawnedByDefault)
|
||||||
{
|
{
|
||||||
if (m_respawnCompatibilityMode)
|
if (m_respawnCompatibilityMode)
|
||||||
{
|
{
|
||||||
@@ -1148,7 +1148,7 @@ namespace Game.Entities
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long thisRespawnTime = forceDelay != 0 ? Time.UnixTime + forceDelay : m_respawnTime;
|
long thisRespawnTime = forceDelay != 0 ? GameTime.GetGameTime() + forceDelay : m_respawnTime;
|
||||||
GetMap().SaveRespawnTime(SpawnObjectType.GameObject, m_spawnId, GetEntry(), thisRespawnTime, GetZoneId(), GridDefines.ComputeGridCoord(GetPositionX(), GetPositionY()).GetId(), m_goData.dbData ? savetodb : false);
|
GetMap().SaveRespawnTime(SpawnObjectType.GameObject, m_spawnId, GetEntry(), thisRespawnTime, GetZoneId(), GridDefines.ComputeGridCoord(GetPositionX(), GetPositionY()).GetId(), m_goData.dbData ? savetodb : false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1209,7 +1209,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (m_spawnedByDefault && m_respawnTime > 0)
|
if (m_spawnedByDefault && m_respawnTime > 0)
|
||||||
{
|
{
|
||||||
m_respawnTime = Time.UnixTime;
|
m_respawnTime = GameTime.GetGameTime();
|
||||||
GetMap().RemoveRespawnTime(SpawnObjectType.GameObject, m_spawnId, true);
|
GetMap().RemoveRespawnTime(SpawnObjectType.GameObject, m_spawnId, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2709,7 +2709,7 @@ namespace Game.Entities
|
|||||||
public long GetRespawnTime() { return m_respawnTime; }
|
public long GetRespawnTime() { return m_respawnTime; }
|
||||||
public long GetRespawnTimeEx()
|
public long GetRespawnTimeEx()
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
if (m_respawnTime > now)
|
if (m_respawnTime > now)
|
||||||
return m_respawnTime;
|
return m_respawnTime;
|
||||||
else
|
else
|
||||||
@@ -2718,7 +2718,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public void SetRespawnTime(int respawn)
|
public void SetRespawnTime(int respawn)
|
||||||
{
|
{
|
||||||
m_respawnTime = respawn > 0 ? Time.UnixTime + respawn : 0;
|
m_respawnTime = respawn > 0 ? GameTime.GetGameTime() + respawn : 0;
|
||||||
m_respawnDelayTime = (uint)(respawn > 0 ? respawn : 0);
|
m_respawnDelayTime = (uint)(respawn > 0 ? respawn : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2752,7 +2752,7 @@ namespace Game.Entities
|
|||||||
void AddLootMode(LootModes lootMode) { m_LootMode |= lootMode; }
|
void AddLootMode(LootModes lootMode) { m_LootMode |= lootMode; }
|
||||||
void RemoveLootMode(LootModes lootMode) { m_LootMode &= ~lootMode; }
|
void RemoveLootMode(LootModes lootMode) { m_LootMode &= ~lootMode; }
|
||||||
void ResetLootMode() { m_LootMode = LootModes.Default; }
|
void ResetLootMode() { m_LootMode = LootModes.Default; }
|
||||||
public void SetLootGenerationTime() { m_lootGenerationTime = (uint)Time.UnixTime; }
|
public void SetLootGenerationTime() { m_lootGenerationTime = (uint)GameTime.GetGameTime(); }
|
||||||
public uint GetLootGenerationTime() { return m_lootGenerationTime; }
|
public uint GetLootGenerationTime() { return m_lootGenerationTime; }
|
||||||
|
|
||||||
public void AddToSkillupList(ObjectGuid PlayerGuid) { m_SkillupList.Add(PlayerGuid); }
|
public void AddToSkillupList(ObjectGuid PlayerGuid) { m_SkillupList.Add(PlayerGuid); }
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
uState = ItemUpdateState.New;
|
uState = ItemUpdateState.New;
|
||||||
uQueuePos = -1;
|
uQueuePos = -1;
|
||||||
m_lastPlayedTimeUpdate = Time.UnixTime;
|
m_lastPlayedTimeUpdate = GameTime.GetGameTime();
|
||||||
|
|
||||||
loot = new Loot();
|
loot = new Loot();
|
||||||
}
|
}
|
||||||
@@ -1356,7 +1356,7 @@ namespace Game.Entities
|
|||||||
// Get current played time
|
// Get current played time
|
||||||
uint current_playtime = m_itemData.CreatePlayedTime;
|
uint current_playtime = m_itemData.CreatePlayedTime;
|
||||||
// Calculate time elapsed since last played time update
|
// Calculate time elapsed since last played time update
|
||||||
long curtime = Time.UnixTime;
|
long curtime = GameTime.GetGameTime();
|
||||||
uint elapsed = (uint)(curtime - m_lastPlayedTimeUpdate);
|
uint elapsed = (uint)(curtime - m_lastPlayedTimeUpdate);
|
||||||
uint new_playtime = current_playtime + elapsed;
|
uint new_playtime = current_playtime + elapsed;
|
||||||
// Check if the refund timer has expired yet
|
// Check if the refund timer has expired yet
|
||||||
@@ -1377,7 +1377,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public uint GetPlayedTime()
|
public uint GetPlayedTime()
|
||||||
{
|
{
|
||||||
long curtime = Time.UnixTime;
|
long curtime = GameTime.GetGameTime();
|
||||||
uint elapsed = (uint)(curtime - m_lastPlayedTimeUpdate);
|
uint elapsed = (uint)(curtime - m_lastPlayedTimeUpdate);
|
||||||
return m_itemData.CreatePlayedTime + elapsed;
|
return m_itemData.CreatePlayedTime + elapsed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ namespace Game.Entities
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetPetNameTimestamp((uint)Time.UnixTime); // cast can't be helped here
|
SetPetNameTimestamp((uint)GameTime.GetGameTime()); // cast can't be helped here
|
||||||
SetCreatorGUID(owner.GetGUID());
|
SetCreatorGUID(owner.GetGUID());
|
||||||
|
|
||||||
InitStatsForLevel(petlevel);
|
InitStatsForLevel(petlevel);
|
||||||
@@ -299,7 +299,7 @@ namespace Game.Entities
|
|||||||
owner.SetMinion(this, true);
|
owner.SetMinion(this, true);
|
||||||
map.AddToMap(ToCreature());
|
map.AddToMap(ToCreature());
|
||||||
|
|
||||||
uint timediff = (uint)(Time.UnixTime - result.Read<uint>(13));
|
uint timediff = (uint)(GameTime.GetGameTime() - result.Read<uint>(13));
|
||||||
_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.
|
||||||
@@ -453,7 +453,7 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(10, curhealth);
|
stmt.AddValue(10, curhealth);
|
||||||
stmt.AddValue(11, curmana);
|
stmt.AddValue(11, curmana);
|
||||||
stmt.AddValue(12, GenerateActionBarData());
|
stmt.AddValue(12, GenerateActionBarData());
|
||||||
stmt.AddValue(13, Time.UnixTime);
|
stmt.AddValue(13, GameTime.GetGameTime());
|
||||||
stmt.AddValue(14, (uint)m_unitData.CreatedBySpell);
|
stmt.AddValue(14, (uint)m_unitData.CreatedBySpell);
|
||||||
stmt.AddValue(15, GetPetType());
|
stmt.AddValue(15, GetPetType());
|
||||||
stmt.AddValue(16, m_petSpecialization);
|
stmt.AddValue(16, m_petSpecialization);
|
||||||
@@ -534,7 +534,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
case DeathState.Corpse:
|
case DeathState.Corpse:
|
||||||
{
|
{
|
||||||
if (GetPetType() != PetType.Hunter || m_corpseRemoveTime <= Time.UnixTime)
|
if (GetPetType() != PetType.Hunter || m_corpseRemoveTime <= GameTime.GetGameTime())
|
||||||
{
|
{
|
||||||
Remove(PetSaveMode.NotInSlot); //hunters' pets never get removed because of death, NEVER!
|
Remove(PetSaveMode.NotInSlot); //hunters' pets never get removed because of death, NEVER!
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -621,7 +621,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pvpInfo.EndTimer = Time.UnixTime;
|
pvpInfo.EndTimer = GameTime.GetGameTime();
|
||||||
SetPvP(state);
|
SetPvP(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -658,7 +658,7 @@ namespace Game.Entities
|
|||||||
else // in friendly area
|
else // in friendly area
|
||||||
{
|
{
|
||||||
if (IsPvP() && !HasPlayerFlag(PlayerFlags.InPVP) && pvpInfo.EndTimer == 0)
|
if (IsPvP() && !HasPlayerFlag(PlayerFlags.InPVP) && pvpInfo.EndTimer == 0)
|
||||||
pvpInfo.EndTimer = Time.UnixTime; // start toggle-off
|
pvpInfo.EndTimer = GameTime.GetGameTime(); // start toggle-off
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3012,7 +3012,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
SaveRecallPosition();
|
SaveRecallPosition();
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
long logoutTime = logout_time;
|
long logoutTime = logout_time;
|
||||||
|
|
||||||
// since last logout (in seconds)
|
// since last logout (in seconds)
|
||||||
@@ -3381,7 +3381,7 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(index++, m_PlayedTimeTotal);
|
stmt.AddValue(index++, m_PlayedTimeTotal);
|
||||||
stmt.AddValue(index++, m_PlayedTimeLevel);
|
stmt.AddValue(index++, m_PlayedTimeLevel);
|
||||||
stmt.AddValue(index++, finiteAlways(_restMgr.GetRestBonus(RestTypes.XP)));
|
stmt.AddValue(index++, finiteAlways(_restMgr.GetRestBonus(RestTypes.XP)));
|
||||||
stmt.AddValue(index++, Time.UnixTime);
|
stmt.AddValue(index++, GameTime.GetGameTime());
|
||||||
stmt.AddValue(index++, (HasPlayerFlag(PlayerFlags.Resting) ? 1 : 0));
|
stmt.AddValue(index++, (HasPlayerFlag(PlayerFlags.Resting) ? 1 : 0));
|
||||||
//save, far from tavern/city
|
//save, far from tavern/city
|
||||||
//save, but in tavern/city
|
//save, but in tavern/city
|
||||||
@@ -3521,7 +3521,7 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(index++, m_PlayedTimeTotal);
|
stmt.AddValue(index++, m_PlayedTimeTotal);
|
||||||
stmt.AddValue(index++, m_PlayedTimeLevel);
|
stmt.AddValue(index++, m_PlayedTimeLevel);
|
||||||
stmt.AddValue(index++, finiteAlways(_restMgr.GetRestBonus(RestTypes.XP)));
|
stmt.AddValue(index++, finiteAlways(_restMgr.GetRestBonus(RestTypes.XP)));
|
||||||
stmt.AddValue(index++, Time.UnixTime);
|
stmt.AddValue(index++, GameTime.GetGameTime());
|
||||||
stmt.AddValue(index++, (HasPlayerFlag(PlayerFlags.Resting) ? 1 : 0));
|
stmt.AddValue(index++, (HasPlayerFlag(PlayerFlags.Resting) ? 1 : 0));
|
||||||
//save, far from tavern/city
|
//save, far from tavern/city
|
||||||
//save, but in tavern/city
|
//save, but in tavern/city
|
||||||
@@ -3678,7 +3678,7 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(3, Global.WorldMgr.GetRealmId().Index);
|
stmt.AddValue(3, Global.WorldMgr.GetRealmId().Index);
|
||||||
stmt.AddValue(4, GetName());
|
stmt.AddValue(4, GetName());
|
||||||
stmt.AddValue(5, GetGUID().GetCounter());
|
stmt.AddValue(5, GetGUID().GetCounter());
|
||||||
stmt.AddValue(6, Time.UnixTime);
|
stmt.AddValue(6, GameTime.GetGameTime());
|
||||||
loginTransaction.Append(stmt);
|
loginTransaction.Append(stmt);
|
||||||
|
|
||||||
// save pet (hunter pet level and experience and all type pets health/mana).
|
// save pet (hunter pet level and experience and all type pets health/mana).
|
||||||
@@ -4215,7 +4215,7 @@ namespace Game.Entities
|
|||||||
Log.outInfo(LogFilter.Player, "Player:DeleteOldChars: Deleting all characters which have been deleted {0} days before...", keepDays);
|
Log.outInfo(LogFilter.Player, "Player:DeleteOldChars: Deleting all characters which have been deleted {0} days before...", keepDays);
|
||||||
|
|
||||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_OLD_CHARS);
|
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHAR_OLD_CHARS);
|
||||||
stmt.AddValue(0, (uint)(Time.UnixTime - keepDays * Time.Day));
|
stmt.AddValue(0, (uint)(GameTime.GetGameTime() - keepDays * Time.Day));
|
||||||
SQLResult result = DB.Characters.Query(stmt);
|
SQLResult result = DB.Characters.Query(stmt);
|
||||||
|
|
||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
|
|||||||
@@ -3041,7 +3041,7 @@ namespace Game.Entities
|
|||||||
Log.outDebug(LogFilter.Player, "STORAGE: AddItemToBuyBackSlot item = {0}, slot = {1}", pItem.GetEntry(), slot);
|
Log.outDebug(LogFilter.Player, "STORAGE: AddItemToBuyBackSlot item = {0}, slot = {1}", pItem.GetEntry(), slot);
|
||||||
|
|
||||||
m_items[slot] = pItem;
|
m_items[slot] = pItem;
|
||||||
var time = Time.UnixTime;
|
var time = GameTime.GetGameTime();
|
||||||
uint etime = (uint)(time - m_logintime + (30 * 3600));
|
uint etime = (uint)(time - m_logintime + (30 * 3600));
|
||||||
uint eslot = slot - InventorySlots.BuyBackStart;
|
uint eslot = slot - InventorySlots.BuyBackStart;
|
||||||
|
|
||||||
@@ -5968,7 +5968,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// loot was generated and respawntime has passed since then, allow to recreate loot
|
// loot was generated and respawntime has passed since then, allow to recreate loot
|
||||||
// to avoid bugs, this rule covers spawned gameobjects only
|
// to avoid bugs, this rule covers spawned gameobjects only
|
||||||
if (go.IsSpawnedByDefault() && go.GetLootState() == LootState.Activated && !go.loot.IsLooted() && go.GetLootGenerationTime() + go.GetRespawnDelay() < Time.UnixTime)
|
if (go.IsSpawnedByDefault() && go.GetLootState() == LootState.Activated && !go.loot.IsLooted() && go.GetLootGenerationTime() + go.GetRespawnDelay() < GameTime.GetGameTime())
|
||||||
go.SetLootState(LootState.Ready);
|
go.SetLootState(LootState.Ready);
|
||||||
|
|
||||||
if (go.GetLootState() == LootState.Ready)
|
if (go.GetLootState() == LootState.Ready)
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
InstanceInfoPkt instanceInfo = new();
|
InstanceInfoPkt instanceInfo = new();
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
foreach (var difficultyDic in m_boundInstances.Values)
|
foreach (var difficultyDic in m_boundInstances.Values)
|
||||||
{
|
{
|
||||||
foreach (var instanceBind in difficultyDic.Values)
|
foreach (var instanceBind in difficultyDic.Values)
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ namespace Game.Entities
|
|||||||
public void UpdateHonorFields()
|
public void UpdateHonorFields()
|
||||||
{
|
{
|
||||||
// called when rewarding honor and at each save
|
// called when rewarding honor and at each save
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
long today = (Time.UnixTime / Time.Day) * Time.Day;
|
long today = (GameTime.GetGameTime() / Time.Day) * Time.Day;
|
||||||
|
|
||||||
if (m_lastHonorUpdateTime < today)
|
if (m_lastHonorUpdateTime < today)
|
||||||
{
|
{
|
||||||
@@ -876,7 +876,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
SendUpdateWorldState(3801, (uint)(wg.IsWarTime() ? 0 : 1));
|
SendUpdateWorldState(3801, (uint)(wg.IsWarTime() ? 0 : 1));
|
||||||
uint timer = wg.IsWarTime() ? 0 : (wg.GetTimer() / 1000); // 0 - Time to next battle
|
uint timer = wg.IsWarTime() ? 0 : (wg.GetTimer() / 1000); // 0 - Time to next battle
|
||||||
SendUpdateWorldState(4354, (uint)(Time.UnixTime + timer));
|
SendUpdateWorldState(4354, (uint)(GameTime.GetGameTime() + timer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -778,7 +778,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
AddTimedQuest(quest_id);
|
AddTimedQuest(quest_id);
|
||||||
questStatusData.Timer = limittime * Time.InMilliseconds;
|
questStatusData.Timer = limittime * Time.InMilliseconds;
|
||||||
qtime = (uint)(Time.UnixTime + limittime);
|
qtime = (uint)(GameTime.GetGameTime() + limittime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
questStatusData.Timer = 0;
|
questStatusData.Timer = 0;
|
||||||
@@ -3073,14 +3073,14 @@ namespace Game.Entities
|
|||||||
if (!qQuest.IsDFQuest())
|
if (!qQuest.IsDFQuest())
|
||||||
{
|
{
|
||||||
AddDynamicUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.DailyQuestsCompleted), quest_id);
|
AddDynamicUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.DailyQuestsCompleted), quest_id);
|
||||||
m_lastDailyQuestTime = Time.UnixTime; // last daily quest time
|
m_lastDailyQuestTime = GameTime.GetGameTime(); // last daily quest time
|
||||||
m_DailyQuestChanged = true;
|
m_DailyQuestChanged = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_DFQuests.Add(quest_id);
|
m_DFQuests.Add(quest_id);
|
||||||
m_lastDailyQuestTime = Time.UnixTime;
|
m_lastDailyQuestTime = GameTime.GetGameTime();
|
||||||
m_DailyQuestChanged = true;
|
m_DailyQuestChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ namespace Game.Entities
|
|||||||
UpdateCriteria(CriteriaTypes.NumberOfTalentResets, 1);
|
UpdateCriteria(CriteriaTypes.NumberOfTalentResets, 1);
|
||||||
|
|
||||||
SetTalentResetCost(cost);
|
SetTalentResetCost(cost);
|
||||||
SetTalentResetTime(Time.UnixTime);
|
SetTalentResetTime(GameTime.GetGameTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace Game.Entities
|
|||||||
for (byte i = 0; i < (int)MirrorTimerType.Max; i++)
|
for (byte i = 0; i < (int)MirrorTimerType.Max; i++)
|
||||||
m_MirrorTimer[i] = -1;
|
m_MirrorTimer[i] = -1;
|
||||||
|
|
||||||
m_logintime = Time.UnixTime;
|
m_logintime = GameTime.GetGameTime();
|
||||||
m_Last_tick = m_logintime;
|
m_Last_tick = m_logintime;
|
||||||
|
|
||||||
m_timeSyncServer = GameTime.GetGameTimeMS();
|
m_timeSyncServer = GameTime.GetGameTimeMS();
|
||||||
@@ -99,7 +99,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Honor System
|
// Honor System
|
||||||
m_lastHonorUpdateTime = Time.UnixTime;
|
m_lastHonorUpdateTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
m_unitMovedByMe = this;
|
m_unitMovedByMe = this;
|
||||||
m_playerMovingMe = this;
|
m_playerMovingMe = this;
|
||||||
@@ -241,7 +241,7 @@ namespace Game.Entities
|
|||||||
SetCreateCurrency(CurrencyTypes.JusticePoints, WorldConfig.GetUIntValue(WorldCfg.CurrencyStartJusticePoints));
|
SetCreateCurrency(CurrencyTypes.JusticePoints, WorldConfig.GetUIntValue(WorldCfg.CurrencyStartJusticePoints));
|
||||||
|
|
||||||
// Played time
|
// Played time
|
||||||
m_Last_tick = Time.UnixTime;
|
m_Last_tick = GameTime.GetGameTime();
|
||||||
m_PlayedTimeTotal = 0;
|
m_PlayedTimeTotal = 0;
|
||||||
m_PlayedTimeLevel = 0;
|
m_PlayedTimeLevel = 0;
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ namespace Game.Entities
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// undelivered mail
|
// undelivered mail
|
||||||
if (m_nextMailDelivereTime != 0 && m_nextMailDelivereTime <= Time.UnixTime)
|
if (m_nextMailDelivereTime != 0 && m_nextMailDelivereTime <= GameTime.GetGameTime())
|
||||||
{
|
{
|
||||||
SendNewMail();
|
SendNewMail();
|
||||||
++unReadMails;
|
++unReadMails;
|
||||||
@@ -346,7 +346,7 @@ namespace Game.Entities
|
|||||||
base.Update(diff);
|
base.Update(diff);
|
||||||
SetCanDelayTeleport(false);
|
SetCanDelayTeleport(false);
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
|
|
||||||
UpdatePvPFlag(now);
|
UpdatePvPFlag(now);
|
||||||
|
|
||||||
@@ -2041,7 +2041,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public bool HasSummonPending()
|
public bool HasSummonPending()
|
||||||
{
|
{
|
||||||
return m_summon_expire >= Time.UnixTime;
|
return m_summon_expire >= GameTime.GetGameTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendSummonRequestFrom(Unit summoner)
|
public void SendSummonRequestFrom(Unit summoner)
|
||||||
@@ -2057,7 +2057,7 @@ namespace Game.Entities
|
|||||||
if (HasAura(23445))
|
if (HasAura(23445))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_summon_expire = Time.UnixTime + PlayerConst.MaxPlayerSummonDelay;
|
m_summon_expire = GameTime.GetGameTime() + PlayerConst.MaxPlayerSummonDelay;
|
||||||
m_summon_location = new WorldLocation(summoner);
|
m_summon_location = new WorldLocation(summoner);
|
||||||
|
|
||||||
SummonRequest summonRequest = new();
|
SummonRequest summonRequest = new();
|
||||||
@@ -2104,7 +2104,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
// expire and auto declined
|
// expire and auto declined
|
||||||
if (m_summon_expire < Time.UnixTime)
|
if (m_summon_expire < GameTime.GetGameTime())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// stop taxi flight at summon
|
// stop taxi flight at summon
|
||||||
@@ -2727,7 +2727,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
// calculate next delivery time (min. from non-delivered mails
|
// calculate next delivery time (min. from non-delivered mails
|
||||||
// and recalculate unReadMail
|
// and recalculate unReadMail
|
||||||
long cTime = Time.UnixTime;
|
long cTime = GameTime.GetGameTime();
|
||||||
m_nextMailDelivereTime = 0;
|
m_nextMailDelivereTime = 0;
|
||||||
unReadMails = 0;
|
unReadMails = 0;
|
||||||
foreach (var mail in m_mail)
|
foreach (var mail in m_mail)
|
||||||
@@ -2743,7 +2743,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
public void AddNewMailDeliverTime(long deliver_time)
|
public void AddNewMailDeliverTime(long deliver_time)
|
||||||
{
|
{
|
||||||
if (deliver_time <= Time.UnixTime) // ready now
|
if (deliver_time <= GameTime.GetGameTime()) // ready now
|
||||||
{
|
{
|
||||||
++unReadMails;
|
++unReadMails;
|
||||||
SendNewMail();
|
SendNewMail();
|
||||||
@@ -4554,7 +4554,7 @@ namespace Game.Entities
|
|||||||
else if (!WorldConfig.GetBoolValue(WorldCfg.DeathCorpseReclaimDelayPve))
|
else if (!WorldConfig.GetBoolValue(WorldCfg.DeathCorpseReclaimDelayPve))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
// 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)
|
||||||
ulong count = (ulong)((now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now) / PlayerConst.DeathExpireStep : 0);
|
ulong count = (ulong)((now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now) / PlayerConst.DeathExpireStep : 0);
|
||||||
@@ -4567,7 +4567,7 @@ namespace Game.Entities
|
|||||||
if ((pvp && !WorldConfig.GetBoolValue(WorldCfg.DeathCorpseReclaimDelayPvp)) ||
|
if ((pvp && !WorldConfig.GetBoolValue(WorldCfg.DeathCorpseReclaimDelayPvp)) ||
|
||||||
(!pvp && !WorldConfig.GetBoolValue(WorldCfg.DeathCorpseReclaimDelayPve)))
|
(!pvp && !WorldConfig.GetBoolValue(WorldCfg.DeathCorpseReclaimDelayPve)))
|
||||||
return;
|
return;
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
if (now < m_deathExpireTime)
|
if (now < m_deathExpireTime)
|
||||||
{
|
{
|
||||||
// full and partly periods 1..3
|
// full and partly periods 1..3
|
||||||
@@ -4605,7 +4605,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
long expected_time = corpse.GetGhostTime() + PlayerConst.copseReclaimDelay[count];
|
long expected_time = corpse.GetGhostTime() + PlayerConst.copseReclaimDelay[count];
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
|
|
||||||
if (now >= expected_time)
|
if (now >= expected_time)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -4696,7 +4696,7 @@ namespace Game.Entities
|
|||||||
pet.SetPetNextLevelExperience(1000);
|
pet.SetPetNextLevelExperience(1000);
|
||||||
pet.SetFullHealth();
|
pet.SetFullHealth();
|
||||||
pet.SetFullPower(PowerType.Mana);
|
pet.SetFullPower(PowerType.Mana);
|
||||||
pet.SetPetNameTimestamp((uint)Time.UnixTime);
|
pet.SetPetNameTimestamp((uint)GameTime.GetGameTime());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
if (oldRestMask == 0 && _restFlagMask != 0) // only set flag/time on the first rest state
|
if (oldRestMask == 0 && _restFlagMask != 0) // only set flag/time on the first rest state
|
||||||
{
|
{
|
||||||
_restTime = Time.UnixTime;
|
_restTime = GameTime.GetGameTime();
|
||||||
_player.AddPlayerFlag(PlayerFlags.Resting);
|
_player.AddPlayerFlag(PlayerFlags.Resting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ namespace Game.Entities
|
|||||||
GetCharmInfo().SetPetNumber(Global.ObjectMgr.GeneratePetNumber(), true);
|
GetCharmInfo().SetPetNumber(Global.ObjectMgr.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
|
||||||
SetPetNameTimestamp((uint)Time.UnixTime); // cast can't be helped
|
SetPetNameTimestamp((uint)GameTime.GetGameTime()); // cast can't be helped
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
playerCharmer.CharmSpellInitialize();
|
playerCharmer.CharmSpellInitialize();
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Game
|
|||||||
default:
|
default:
|
||||||
case GameEventState.Normal:
|
case GameEventState.Normal:
|
||||||
{
|
{
|
||||||
long currenttime = Time.UnixTime;
|
long currenttime = GameTime.GetGameTime();
|
||||||
// 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
|
||||||
@@ -56,7 +56,7 @@ namespace Game
|
|||||||
// if inactive world event, check the prerequisite events
|
// if inactive world event, check the prerequisite events
|
||||||
case GameEventState.WorldInactive:
|
case GameEventState.WorldInactive:
|
||||||
{
|
{
|
||||||
long currenttime = Time.UnixTime;
|
long currenttime = GameTime.GetGameTime();
|
||||||
foreach (var gameEventId in mGameEvent[entry].prerequisite_events)
|
foreach (var gameEventId in mGameEvent[entry].prerequisite_events)
|
||||||
{
|
{
|
||||||
if ((mGameEvent[gameEventId].state != GameEventState.WorldNextPhase && mGameEvent[gameEventId].state != GameEventState.WorldFinished) || // if prereq not in nextphase or finished state, then can't start this one
|
if ((mGameEvent[gameEventId].state != GameEventState.WorldNextPhase && mGameEvent[gameEventId].state != GameEventState.WorldFinished) || // if prereq not in nextphase or finished state, then can't start this one
|
||||||
@@ -72,7 +72,7 @@ namespace Game
|
|||||||
|
|
||||||
public uint NextCheck(ushort entry)
|
public uint NextCheck(ushort entry)
|
||||||
{
|
{
|
||||||
long currenttime = Time.UnixTime;
|
long currenttime = GameTime.GetGameTime();
|
||||||
|
|
||||||
// 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 == GameEventState.WorldNextPhase || mGameEvent[entry].state == GameEventState.WorldFinished) && mGameEvent[entry].nextstart >= currenttime)
|
if ((mGameEvent[entry].state == GameEventState.WorldNextPhase || mGameEvent[entry].state == GameEventState.WorldFinished) && mGameEvent[entry].nextstart >= currenttime)
|
||||||
@@ -132,13 +132,13 @@ namespace Game
|
|||||||
ApplyNewEvent(event_id);
|
ApplyNewEvent(event_id);
|
||||||
if (overwrite)
|
if (overwrite)
|
||||||
{
|
{
|
||||||
mGameEvent[event_id].start = Time.UnixTime;
|
mGameEvent[event_id].start = GameTime.GetGameTime();
|
||||||
if (data.end <= data.start)
|
if (data.end <= data.start)
|
||||||
data.end = data.start + data.length;
|
data.end = data.start + data.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When event is started, set its worldstate to current time
|
// When event is started, set its worldstate to current time
|
||||||
Global.WorldMgr.SetWorldState(event_id, Time.UnixTime);
|
Global.WorldMgr.SetWorldState(event_id, GameTime.GetGameTime());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -179,7 +179,7 @@ namespace Game
|
|||||||
|
|
||||||
if (overwrite && !serverwide_evt)
|
if (overwrite && !serverwide_evt)
|
||||||
{
|
{
|
||||||
data.start = Time.UnixTime - data.length * Time.Minute;
|
data.start = GameTime.GetGameTime() - data.length * Time.Minute;
|
||||||
if (data.end <= data.start)
|
if (data.end <= data.start)
|
||||||
data.end = data.start + data.length;
|
data.end = data.start + data.length;
|
||||||
}
|
}
|
||||||
@@ -971,7 +971,7 @@ namespace Game
|
|||||||
|
|
||||||
public uint Update() // return the next event delay in ms
|
public uint Update() // return the next event delay in ms
|
||||||
{
|
{
|
||||||
long currenttime = Time.UnixTime;
|
long currenttime = GameTime.GetGameTime();
|
||||||
uint nextEventDelay = Time.Day; // 1 day
|
uint nextEventDelay = Time.Day; // 1 day
|
||||||
uint calcDelay;
|
uint calcDelay;
|
||||||
List<ushort> activate = new();
|
List<ushort> activate = new();
|
||||||
@@ -1526,7 +1526,7 @@ namespace Game
|
|||||||
// set the followup events' start time
|
// set the followup events' start time
|
||||||
if (mGameEvent[event_id].nextstart == 0)
|
if (mGameEvent[event_id].nextstart == 0)
|
||||||
{
|
{
|
||||||
long currenttime = Time.UnixTime;
|
long currenttime = GameTime.GetGameTime();
|
||||||
mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
|
mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -1613,7 +1613,7 @@ namespace Game
|
|||||||
|
|
||||||
bool singleDate = ((holiday.Date[0] >> 24) & 0x1F) == 31; // Events with fixed date within year have - 1
|
bool singleDate = ((holiday.Date[0] >> 24) & 0x1F) == 31; // Events with fixed date within year have - 1
|
||||||
|
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
for (int i = 0; i < SharedConst.MaxHolidayDates && holiday.Date[i] != 0; ++i)
|
for (int i = 0; i < SharedConst.MaxHolidayDates && holiday.Date[i] != 0; ++i)
|
||||||
{
|
{
|
||||||
uint date = holiday.Date[i];
|
uint date = holiday.Date[i];
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ namespace Game.Garrisons
|
|||||||
{
|
{
|
||||||
placeBuildingResult.BuildingInfo.GarrPlotInstanceID = garrPlotInstanceId;
|
placeBuildingResult.BuildingInfo.GarrPlotInstanceID = garrPlotInstanceId;
|
||||||
placeBuildingResult.BuildingInfo.GarrBuildingID = garrBuildingId;
|
placeBuildingResult.BuildingInfo.GarrBuildingID = garrBuildingId;
|
||||||
placeBuildingResult.BuildingInfo.TimeBuilt = Time.UnixTime;
|
placeBuildingResult.BuildingInfo.TimeBuilt = GameTime.GetGameTime();
|
||||||
|
|
||||||
Plot plot = GetPlot(garrPlotInstanceId);
|
Plot plot = GetPlot(garrPlotInstanceId);
|
||||||
uint oldBuildingId = 0;
|
uint oldBuildingId = 0;
|
||||||
@@ -438,7 +438,7 @@ namespace Game.Garrisons
|
|||||||
placeBuildingResult.Result = GarrisonError.Success;
|
placeBuildingResult.Result = GarrisonError.Success;
|
||||||
placeBuildingResult.BuildingInfo.GarrPlotInstanceID = garrPlotInstanceId;
|
placeBuildingResult.BuildingInfo.GarrPlotInstanceID = garrPlotInstanceId;
|
||||||
placeBuildingResult.BuildingInfo.GarrBuildingID = restored;
|
placeBuildingResult.BuildingInfo.GarrBuildingID = restored;
|
||||||
placeBuildingResult.BuildingInfo.TimeBuilt = Time.UnixTime;
|
placeBuildingResult.BuildingInfo.TimeBuilt = GameTime.GetGameTime();
|
||||||
placeBuildingResult.BuildingInfo.Active = true;
|
placeBuildingResult.BuildingInfo.Active = true;
|
||||||
|
|
||||||
plot.SetBuildingInfo(placeBuildingResult.BuildingInfo, _owner);
|
plot.SetBuildingInfo(placeBuildingResult.BuildingInfo, _owner);
|
||||||
@@ -689,7 +689,7 @@ namespace Game.Garrisons
|
|||||||
if (PacketInfo.HasValue)
|
if (PacketInfo.HasValue)
|
||||||
{
|
{
|
||||||
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(PacketInfo.Value.GarrBuildingID);
|
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(PacketInfo.Value.GarrBuildingID);
|
||||||
if (PacketInfo.Value.TimeBuilt + building.BuildSeconds <= Time.UnixTime)
|
if (PacketInfo.Value.TimeBuilt + building.BuildSeconds <= GameTime.GetGameTime())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9091,7 +9091,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
uint oldMSTime = Time.GetMSTime();
|
uint oldMSTime = Time.GetMSTime();
|
||||||
|
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
DateTime lt = Time.UnixTimeToDateTime(curTime).ToLocalTime();
|
DateTime lt = Time.UnixTimeToDateTime(curTime).ToLocalTime();
|
||||||
Log.outInfo(LogFilter.Server, "Returning mails current time: hour: {0}, minute: {1}, second: {2} ", lt.Hour, lt.Minute, lt.Second);
|
Log.outInfo(LogFilter.Server, "Returning mails current time: hour: {0}, minute: {1}, second: {2} ", lt.Hour, lt.Minute, lt.Second);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Game.Guilds
|
|||||||
m_info = "";
|
m_info = "";
|
||||||
m_motd = "No message set.";
|
m_motd = "No message set.";
|
||||||
m_bankMoney = 0;
|
m_bankMoney = 0;
|
||||||
m_createdDate = Time.UnixTime;
|
m_createdDate = GameTime.GetGameTime();
|
||||||
_CreateLogHolders();
|
_CreateLogHolders();
|
||||||
|
|
||||||
Log.outDebug(LogFilter.Guild, "GUILD: creating guild [{0}] for leader {1} ({2})",
|
Log.outDebug(LogFilter.Guild, "GUILD: creating guild [{0}] for leader {1} ({2})",
|
||||||
@@ -2490,7 +2490,7 @@ namespace Game.Guilds
|
|||||||
m_level = 0;
|
m_level = 0;
|
||||||
m_class = 0;
|
m_class = 0;
|
||||||
m_flags = GuildMemberFlags.None;
|
m_flags = GuildMemberFlags.None;
|
||||||
m_logoutTime = (ulong)Time.UnixTime;
|
m_logoutTime = (ulong)GameTime.GetGameTime();
|
||||||
m_accountId = 0;
|
m_accountId = 0;
|
||||||
m_rankId = rankId;
|
m_rankId = rankId;
|
||||||
m_achievementPoints = 0;
|
m_achievementPoints = 0;
|
||||||
@@ -2628,7 +2628,7 @@ namespace Game.Guilds
|
|||||||
{
|
{
|
||||||
if (IsOnline())
|
if (IsOnline())
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
return (float)((Time.UnixTime - (long)GetLogoutTime()) / (float)Time.Day);
|
return (float)((GameTime.GetGameTime() - (long)GetLogoutTime()) / (float)Time.Day);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decreases amount of slots left for today.
|
// Decreases amount of slots left for today.
|
||||||
@@ -2707,7 +2707,7 @@ namespace Game.Guilds
|
|||||||
public bool IsTrackingCriteriaId(uint criteriaId) { return m_trackedCriteriaIds.Contains(criteriaId); }
|
public bool IsTrackingCriteriaId(uint criteriaId) { return m_trackedCriteriaIds.Contains(criteriaId); }
|
||||||
public bool IsOnline() { return m_flags.HasAnyFlag(GuildMemberFlags.Online); }
|
public bool IsOnline() { return m_flags.HasAnyFlag(GuildMemberFlags.Online); }
|
||||||
|
|
||||||
public void UpdateLogoutTime() { m_logoutTime = (ulong)Time.UnixTime; }
|
public void UpdateLogoutTime() { m_logoutTime = (ulong)GameTime.GetGameTime(); }
|
||||||
public bool IsRank(byte rankId) { return m_rankId == rankId; }
|
public bool IsRank(byte rankId) { return m_rankId == rankId; }
|
||||||
public bool IsRankNotLower(uint rankId) { return m_rankId <= rankId; }
|
public bool IsRankNotLower(uint rankId) { return m_rankId <= rankId; }
|
||||||
public bool IsSamePlayer(ObjectGuid guid) { return m_guid == guid; }
|
public bool IsSamePlayer(ObjectGuid guid) { return m_guid == guid; }
|
||||||
@@ -2751,7 +2751,7 @@ namespace Game.Guilds
|
|||||||
{
|
{
|
||||||
m_guildId = guildId;
|
m_guildId = guildId;
|
||||||
m_guid = guid;
|
m_guid = guid;
|
||||||
m_timestamp = Time.UnixTime;
|
m_timestamp = GameTime.GetGameTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogEntry(ulong guildId, uint guid, long timestamp)
|
public LogEntry(ulong guildId, uint guid, long timestamp)
|
||||||
@@ -2819,7 +2819,7 @@ namespace Game.Guilds
|
|||||||
eventEntry.PlayerGUID = playerGUID;
|
eventEntry.PlayerGUID = playerGUID;
|
||||||
eventEntry.OtherGUID = otherGUID;
|
eventEntry.OtherGUID = otherGUID;
|
||||||
eventEntry.TransactionType = (byte)m_eventType;
|
eventEntry.TransactionType = (byte)m_eventType;
|
||||||
eventEntry.TransactionDate = (uint)(Time.UnixTime - m_timestamp);
|
eventEntry.TransactionDate = (uint)(GameTime.GetGameTime() - m_timestamp);
|
||||||
eventEntry.RankID = m_newRank;
|
eventEntry.RankID = m_newRank;
|
||||||
packet.Entry.Add(eventEntry);
|
packet.Entry.Add(eventEntry);
|
||||||
}
|
}
|
||||||
@@ -2905,7 +2905,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
GuildBankLogEntry bankLogEntry = new();
|
GuildBankLogEntry bankLogEntry = new();
|
||||||
bankLogEntry.PlayerGUID = logGuid;
|
bankLogEntry.PlayerGUID = logGuid;
|
||||||
bankLogEntry.TimeOffset = (uint)(Time.UnixTime - m_timestamp);
|
bankLogEntry.TimeOffset = (uint)(GameTime.GetGameTime() - m_timestamp);
|
||||||
bankLogEntry.EntryType = (sbyte)m_eventType;
|
bankLogEntry.EntryType = (sbyte)m_eventType;
|
||||||
|
|
||||||
if (hasStack)
|
if (hasStack)
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ namespace Game.Guilds
|
|||||||
|
|
||||||
public MembershipRequest()
|
public MembershipRequest()
|
||||||
{
|
{
|
||||||
_time = Time.UnixTime;
|
_time = GameTime.GetGameTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectGuid GetGuildGuid() { return _guildId; }
|
public ObjectGuid GetGuildGuid() { return _guildId; }
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Game
|
|||||||
BFMgrEntryInvite bfMgrEntryInvite = new();
|
BFMgrEntryInvite bfMgrEntryInvite = new();
|
||||||
bfMgrEntryInvite.QueueID = queueId;
|
bfMgrEntryInvite.QueueID = queueId;
|
||||||
bfMgrEntryInvite.AreaID = (int)zoneId;
|
bfMgrEntryInvite.AreaID = (int)zoneId;
|
||||||
bfMgrEntryInvite.ExpireTime = Time.UnixTime + acceptTime;
|
bfMgrEntryInvite.ExpireTime = GameTime.GetGameTime() + acceptTime;
|
||||||
SendPacket(bfMgrEntryInvite);
|
SendPacket(bfMgrEntryInvite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
ObjectGuid guid = GetPlayer().GetGUID();
|
ObjectGuid guid = GetPlayer().GetGUID();
|
||||||
|
|
||||||
long currTime = Time.UnixTime;
|
long currTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
CalendarSendCalendar packet = new();
|
CalendarSendCalendar packet = new();
|
||||||
packet.ServerTime = currTime;
|
packet.ServerTime = currTime;
|
||||||
@@ -123,7 +123,7 @@ namespace Game
|
|||||||
|
|
||||||
// prevent events in the past
|
// prevent events in the past
|
||||||
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
||||||
if (calendarAddEvent.EventInfo.Time < (Time.UnixTime - 86400L))
|
if (calendarAddEvent.EventInfo.Time < (GameTime.GetGameTime() - 86400L))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CalendarEvent calendarEvent = new(Global.CalendarMgr.GetFreeEventId(), guid, 0, (CalendarEventType)calendarAddEvent.EventInfo.EventType, calendarAddEvent.EventInfo.TextureID,
|
CalendarEvent calendarEvent = new(Global.CalendarMgr.GetFreeEventId(), guid, 0, (CalendarEventType)calendarAddEvent.EventInfo.EventType, calendarAddEvent.EventInfo.TextureID,
|
||||||
@@ -172,7 +172,7 @@ namespace Game
|
|||||||
|
|
||||||
// prevent events in the past
|
// prevent events in the past
|
||||||
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
||||||
if (calendarUpdateEvent.EventInfo.Time < (Time.UnixTime - 86400L))
|
if (calendarUpdateEvent.EventInfo.Time < (GameTime.GetGameTime() - 86400L))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarUpdateEvent.EventInfo.EventID);
|
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarUpdateEvent.EventInfo.EventID);
|
||||||
@@ -208,7 +208,7 @@ namespace Game
|
|||||||
|
|
||||||
// prevent events in the past
|
// prevent events in the past
|
||||||
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
||||||
if (calendarCopyEvent.Date < (Time.UnixTime - 86400L))
|
if (calendarCopyEvent.Date < (GameTime.GetGameTime() - 86400L))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CalendarEvent oldEvent = Global.CalendarMgr.GetEvent(calendarCopyEvent.EventID);
|
CalendarEvent oldEvent = Global.CalendarMgr.GetEvent(calendarCopyEvent.EventID);
|
||||||
@@ -339,7 +339,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
CalendarInviteStatus status = calendarEventSignUp.Tentative ? CalendarInviteStatus.Tentative : CalendarInviteStatus.SignedUp;
|
CalendarInviteStatus status = calendarEventSignUp.Tentative ? CalendarInviteStatus.Tentative : CalendarInviteStatus.SignedUp;
|
||||||
CalendarInvite invite = new(Global.CalendarMgr.GetFreeInviteId(), calendarEventSignUp.EventID, guid, guid, Time.UnixTime, status, CalendarModerationRank.Player, "");
|
CalendarInvite invite = new(Global.CalendarMgr.GetFreeInviteId(), calendarEventSignUp.EventID, guid, guid, GameTime.GetGameTime(), status, CalendarModerationRank.Player, "");
|
||||||
Global.CalendarMgr.AddInvite(calendarEvent, invite);
|
Global.CalendarMgr.AddInvite(calendarEvent, invite);
|
||||||
Global.CalendarMgr.SendCalendarClearPendingAction(guid);
|
Global.CalendarMgr.SendCalendarClearPendingAction(guid);
|
||||||
}
|
}
|
||||||
@@ -366,7 +366,7 @@ namespace Game
|
|||||||
if (invite != null)
|
if (invite != null)
|
||||||
{
|
{
|
||||||
invite.Status = calendarRSVP.Status;
|
invite.Status = calendarRSVP.Status;
|
||||||
invite.ResponseTime = Time.UnixTime;
|
invite.ResponseTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
Global.CalendarMgr.UpdateInvite(invite);
|
Global.CalendarMgr.UpdateInvite(invite);
|
||||||
Global.CalendarMgr.SendCalendarEventStatus(calendarEvent, invite);
|
Global.CalendarMgr.SendCalendarEventStatus(calendarEvent, invite);
|
||||||
@@ -491,7 +491,7 @@ namespace Game
|
|||||||
|
|
||||||
public void SendCalendarRaidLockout(InstanceSave save, bool add)
|
public void SendCalendarRaidLockout(InstanceSave save, bool add)
|
||||||
{
|
{
|
||||||
long currTime = Time.UnixTime;
|
long currTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
if (add)
|
if (add)
|
||||||
{
|
{
|
||||||
@@ -518,7 +518,7 @@ namespace Game
|
|||||||
if (save == null)
|
if (save == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
long currTime = Time.UnixTime;
|
long currTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
CalendarRaidLockoutUpdated packet = new();
|
CalendarRaidLockoutUpdated packet = new();
|
||||||
packet.DifficultyID = (uint)save.GetDifficultyID();
|
packet.DifficultyID = (uint)save.GetDifficultyID();
|
||||||
|
|||||||
@@ -2204,7 +2204,7 @@ namespace Game
|
|||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
uint lastUndelete = result.Read<uint>(0);
|
uint lastUndelete = result.Read<uint>(0);
|
||||||
uint now = (uint)Time.UnixTime;
|
uint now = (uint)GameTime.GetGameTime();
|
||||||
if (lastUndelete + maxCooldown > now)
|
if (lastUndelete + maxCooldown > now)
|
||||||
cooldown = Math.Max(0, lastUndelete + maxCooldown - now);
|
cooldown = Math.Max(0, lastUndelete + maxCooldown - now);
|
||||||
}
|
}
|
||||||
@@ -2231,7 +2231,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
uint lastUndelete = result.Read<uint>(0);
|
uint lastUndelete = result.Read<uint>(0);
|
||||||
uint maxCooldown = WorldConfig.GetUIntValue(WorldCfg.FeatureSystemCharacterUndeleteCooldown);
|
uint maxCooldown = WorldConfig.GetUIntValue(WorldCfg.FeatureSystemCharacterUndeleteCooldown);
|
||||||
if (lastUndelete != 0 && (lastUndelete + maxCooldown > Time.UnixTime))
|
if (lastUndelete != 0 && (lastUndelete + maxCooldown > GameTime.GetGameTime()))
|
||||||
{
|
{
|
||||||
SendUndeleteCharacterResponse(CharacterUndeleteResult.Cooldown, undeleteInfo);
|
SendUndeleteCharacterResponse(CharacterUndeleteResult.Cooldown, undeleteInfo);
|
||||||
return;
|
return;
|
||||||
@@ -2390,7 +2390,7 @@ namespace Game
|
|||||||
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.GetCorpseType() == CorpseType.ResurrectablePVP)) > Time.UnixTime)
|
if ((corpse.GetGhostTime() + GetPlayer().GetCorpseReclaimDelay(corpse.GetCorpseType() == CorpseType.ResurrectablePVP)) > GameTime.GetGameTime())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!corpse.IsWithinDistInMap(GetPlayer(), 39, true))
|
if (!corpse.IsWithinDistInMap(GetPlayer(), 39, true))
|
||||||
@@ -2648,7 +2648,7 @@ namespace Game
|
|||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_MAILCOUNT);
|
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_MAILCOUNT);
|
||||||
stmt.AddValue(0, lowGuid);
|
stmt.AddValue(0, lowGuid);
|
||||||
stmt.AddValue(1, Time.UnixTime);
|
stmt.AddValue(1, GameTime.GetGameTime());
|
||||||
SetQuery(PlayerLoginQueryLoad.MailCount, stmt);
|
SetQuery(PlayerLoginQueryLoad.MailCount, stmt);
|
||||||
|
|
||||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_MAILDATE);
|
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_MAILDATE);
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ namespace Game
|
|||||||
|
|
||||||
if (!CanSpeak())
|
if (!CanSpeak())
|
||||||
{
|
{
|
||||||
string timeStr = Time.secsToTimeString((ulong)(m_muteTime - Time.UnixTime));
|
string timeStr = Time.secsToTimeString((ulong)(m_muteTime - GameTime.GetGameTime()));
|
||||||
SendNotification(CypherStrings.WaitBeforeSpeaking, timeStr);
|
SendNotification(CypherStrings.WaitBeforeSpeaking, timeStr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -560,7 +560,7 @@ namespace Game
|
|||||||
|
|
||||||
if (!CanSpeak())
|
if (!CanSpeak())
|
||||||
{
|
{
|
||||||
string timeStr = Time.secsToTimeString((ulong)(m_muteTime - Time.UnixTime));
|
string timeStr = Time.secsToTimeString((ulong)(m_muteTime - GameTime.GetGameTime()));
|
||||||
SendNotification(CypherStrings.WaitBeforeSpeaking, timeStr);
|
SendNotification(CypherStrings.WaitBeforeSpeaking, timeStr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace Game
|
|||||||
Log.outDebug(LogFilter.Network, "Player 1 is: {0} ({1})", player.GetGUID().ToString(), player.GetName());
|
Log.outDebug(LogFilter.Network, "Player 1 is: {0} ({1})", player.GetGUID().ToString(), player.GetName());
|
||||||
Log.outDebug(LogFilter.Network, "Player 2 is: {0} ({1})", plTarget.GetGUID().ToString(), plTarget.GetName());
|
Log.outDebug(LogFilter.Network, "Player 2 is: {0} ({1})", plTarget.GetGUID().ToString(), plTarget.GetName());
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
player.duel.startTimer = now;
|
player.duel.startTimer = now;
|
||||||
plTarget.duel.startTimer = now;
|
plTarget.duel.startTimer = now;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
MembershipRequest request = new(GetPlayer().GetGUID(), lfGuildAddRecruit.GuildGUID, lfGuildAddRecruit.Availability,
|
MembershipRequest request = new(GetPlayer().GetGUID(), lfGuildAddRecruit.GuildGUID, lfGuildAddRecruit.Availability,
|
||||||
lfGuildAddRecruit.ClassRoles, lfGuildAddRecruit.PlayStyle, lfGuildAddRecruit.Comment, Time.UnixTime);
|
lfGuildAddRecruit.ClassRoles, lfGuildAddRecruit.PlayStyle, lfGuildAddRecruit.Comment, GameTime.GetGameTime());
|
||||||
Global.GuildFinderMgr.AddMembershipRequest(lfGuildAddRecruit.GuildGUID, request);
|
Global.GuildFinderMgr.AddMembershipRequest(lfGuildAddRecruit.GuildGUID, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,8 +129,8 @@ namespace Game
|
|||||||
applicationData.ClassRoles = guildSettings.GetClassRoles();
|
applicationData.ClassRoles = guildSettings.GetClassRoles();
|
||||||
applicationData.PlayStyle = guildSettings.GetInterests();
|
applicationData.PlayStyle = guildSettings.GetInterests();
|
||||||
applicationData.Availability = guildSettings.GetAvailability();
|
applicationData.Availability = guildSettings.GetAvailability();
|
||||||
applicationData.SecondsSinceCreated = (uint)(Time.UnixTime - application.GetSubmitTime());
|
applicationData.SecondsSinceCreated = (uint)(GameTime.GetGameTime() - application.GetSubmitTime());
|
||||||
applicationData.SecondsUntilExpiration = (uint)(application.GetExpiryTime() - Time.UnixTime);
|
applicationData.SecondsUntilExpiration = (uint)(application.GetExpiryTime() - GameTime.GetGameTime());
|
||||||
applicationData.Comment = application.GetComment();
|
applicationData.Comment = application.GetComment();
|
||||||
|
|
||||||
lfGuildApplications.Application.Add(applicationData);
|
lfGuildApplications.Application.Add(applicationData);
|
||||||
@@ -176,7 +176,7 @@ namespace Game
|
|||||||
if (!guild)
|
if (!guild)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
LFGuildRecruits lfGuildRecruits = new();
|
LFGuildRecruits lfGuildRecruits = new();
|
||||||
lfGuildRecruits.UpdateTime = now;
|
lfGuildRecruits.UpdateTime = now;
|
||||||
var recruitsList = Global.GuildFinderMgr.GetAllMembershipRequestsForGuild(guild.GetGUID());
|
var recruitsList = Global.GuildFinderMgr.GetAllMembershipRequestsForGuild(guild.GetGUID());
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ namespace Game
|
|||||||
var rewards = Global.GuildMgr.GetGuildRewards();
|
var rewards = Global.GuildMgr.GetGuildRewards();
|
||||||
|
|
||||||
GuildRewardList rewardList = new();
|
GuildRewardList rewardList = new();
|
||||||
rewardList.Version = Time.UnixTime;
|
rewardList.Version = GameTime.GetGameTime();
|
||||||
|
|
||||||
for (int i = 0; i < rewards.Count; i++)
|
for (int i = 0; i < rewards.Count; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Game
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log.outTrace(LogFilter.Network, "CMSG_DB_QUERY_BULK: {0} requested non-existing entry {1} in datastore: {2}", GetPlayerInfo(), record.RecordID, dbQuery.TableHash);
|
Log.outTrace(LogFilter.Network, "CMSG_DB_QUERY_BULK: {0} requested non-existing entry {1} in datastore: {2}", GetPlayerInfo(), record.RecordID, dbQuery.TableHash);
|
||||||
dbReply.Timestamp = (uint)Time.UnixTime;
|
dbReply.Timestamp = (uint)GameTime.GetGameTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
SendPacket(dbReply);
|
SendPacket(dbReply);
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ namespace Game
|
|||||||
LfgAnswer playerVote = boot.votes.LookupByKey(GetPlayer().GetGUID());
|
LfgAnswer playerVote = boot.votes.LookupByKey(GetPlayer().GetGUID());
|
||||||
byte votesNum = 0;
|
byte votesNum = 0;
|
||||||
byte agreeNum = 0;
|
byte agreeNum = 0;
|
||||||
uint secsleft = (uint)((boot.cancelTime - Time.UnixTime) / 1000);
|
uint secsleft = (uint)((boot.cancelTime - GameTime.GetGameTime()) / 1000);
|
||||||
foreach (var it in boot.votes)
|
foreach (var it in boot.votes)
|
||||||
{
|
{
|
||||||
if (it.Value != LfgAnswer.Pending)
|
if (it.Value != LfgAnswer.Pending)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace Game
|
|||||||
pl.AddUnitFlag(UnitFlags.Stunned);
|
pl.AddUnitFlag(UnitFlags.Stunned);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLogoutStartTime(Time.UnixTime);
|
SetLogoutStartTime(GameTime.GetGameTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
[WorldPacketHandler(ClientOpcodes.LogoutCancel)]
|
[WorldPacketHandler(ClientOpcodes.LogoutCancel)]
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ namespace Game
|
|||||||
|
|
||||||
Player player = GetPlayer();
|
Player player = GetPlayer();
|
||||||
Mail m = player.GetMail(packet.MailID);
|
Mail m = player.GetMail(packet.MailID);
|
||||||
if (m == null || m.state == MailState.Deleted || m.deliver_time > Time.UnixTime || m.sender != packet.SenderGUID.GetCounter())
|
if (m == null || m.state == MailState.Deleted || m.deliver_time > GameTime.GetGameTime() || m.sender != packet.SenderGUID.GetCounter())
|
||||||
{
|
{
|
||||||
player.SendMailResult(packet.MailID, MailResponseType.ReturnedToSender, MailResponseResult.InternalError);
|
player.SendMailResult(packet.MailID, MailResponseType.ReturnedToSender, MailResponseResult.InternalError);
|
||||||
return;
|
return;
|
||||||
@@ -433,7 +433,7 @@ namespace Game
|
|||||||
Player player = GetPlayer();
|
Player player = GetPlayer();
|
||||||
|
|
||||||
Mail m = player.GetMail(packet.MailID);
|
Mail m = player.GetMail(packet.MailID);
|
||||||
if (m == null || m.state == MailState.Deleted || m.deliver_time > Time.UnixTime)
|
if (m == null || m.state == MailState.Deleted || m.deliver_time > GameTime.GetGameTime())
|
||||||
{
|
{
|
||||||
player.SendMailResult(packet.MailID, MailResponseType.ItemTaken, MailResponseResult.InternalError);
|
player.SendMailResult(packet.MailID, MailResponseType.ItemTaken, MailResponseResult.InternalError);
|
||||||
return;
|
return;
|
||||||
@@ -530,7 +530,7 @@ namespace Game
|
|||||||
Player player = GetPlayer();
|
Player player = GetPlayer();
|
||||||
|
|
||||||
Mail m = player.GetMail(packet.MailID);
|
Mail m = player.GetMail(packet.MailID);
|
||||||
if ((m == null || m.state == MailState.Deleted || m.deliver_time > Time.UnixTime) ||
|
if ((m == null || m.state == MailState.Deleted || m.deliver_time > GameTime.GetGameTime()) ||
|
||||||
(packet.Money > 0 && m.money != (ulong)packet.Money))
|
(packet.Money > 0 && m.money != (ulong)packet.Money))
|
||||||
{
|
{
|
||||||
player.SendMailResult(packet.MailID, MailResponseType.MoneyTaken, MailResponseResult.InternalError);
|
player.SendMailResult(packet.MailID, MailResponseType.MoneyTaken, MailResponseResult.InternalError);
|
||||||
@@ -572,7 +572,7 @@ namespace Game
|
|||||||
var mails = player.GetMails();
|
var mails = player.GetMails();
|
||||||
|
|
||||||
MailListResult response = new();
|
MailListResult response = new();
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
foreach (Mail m in mails)
|
foreach (Mail m in mails)
|
||||||
{
|
{
|
||||||
@@ -603,7 +603,7 @@ namespace Game
|
|||||||
Player player = GetPlayer();
|
Player player = GetPlayer();
|
||||||
|
|
||||||
Mail m = player.GetMail(packet.MailID);
|
Mail m = player.GetMail(packet.MailID);
|
||||||
if (m == null || (string.IsNullOrEmpty(m.body) && m.mailTemplateId == 0) || m.state == MailState.Deleted || m.deliver_time > Time.UnixTime)
|
if (m == null || (string.IsNullOrEmpty(m.body) && m.mailTemplateId == 0) || m.state == MailState.Deleted || m.deliver_time > GameTime.GetGameTime())
|
||||||
{
|
{
|
||||||
player.SendMailResult(packet.MailID, MailResponseType.MadePermanent, MailResponseResult.InternalError);
|
player.SendMailResult(packet.MailID, MailResponseType.MadePermanent, MailResponseResult.InternalError);
|
||||||
return;
|
return;
|
||||||
@@ -662,7 +662,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
result.NextMailTime = 0.0f;
|
result.NextMailTime = 0.0f;
|
||||||
|
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
List<ulong> sentSenders = new();
|
List<ulong> sentSenders = new();
|
||||||
|
|
||||||
foreach (Mail mail in GetPlayer().GetMails())
|
foreach (Mail mail in GetPlayer().GetMails())
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ namespace Game
|
|||||||
GetPlayer().RemovePlayerFlag(PlayerFlags.InPVP);
|
GetPlayer().RemovePlayerFlag(PlayerFlags.InPVP);
|
||||||
GetPlayer().AddPlayerFlag(PlayerFlags.PVPTimer);
|
GetPlayer().AddPlayerFlag(PlayerFlags.PVPTimer);
|
||||||
if (!GetPlayer().pvpInfo.IsHostile && GetPlayer().IsPvP())
|
if (!GetPlayer().pvpInfo.IsHostile && GetPlayer().IsPvP())
|
||||||
GetPlayer().pvpInfo.EndTimer = Time.UnixTime; // start toggle-off
|
GetPlayer().pvpInfo.EndTimer = GameTime.GetGameTime(); // start toggle-off
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -483,7 +483,7 @@ namespace Game
|
|||||||
GetPlayer().RemovePlayerFlag(PlayerFlags.InPVP);
|
GetPlayer().RemovePlayerFlag(PlayerFlags.InPVP);
|
||||||
GetPlayer().AddPlayerFlag(PlayerFlags.PVPTimer);
|
GetPlayer().AddPlayerFlag(PlayerFlags.PVPTimer);
|
||||||
if (!GetPlayer().pvpInfo.IsHostile && GetPlayer().IsPvP())
|
if (!GetPlayer().pvpInfo.IsHostile && GetPlayer().IsPvP())
|
||||||
GetPlayer().pvpInfo.EndTimer = Time.UnixTime; // start toggle-off
|
GetPlayer().pvpInfo.EndTimer = GameTime.GetGameTime(); // start toggle-off
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ namespace Game
|
|||||||
long timeReset = Global.InstanceSaveMgr.GetResetTimeFor(mapEntry.Id, diff);
|
long timeReset = Global.InstanceSaveMgr.GetResetTimeFor(mapEntry.Id, diff);
|
||||||
if (timeReset != 0)
|
if (timeReset != 0)
|
||||||
{
|
{
|
||||||
uint timeleft = (uint)(timeReset - Time.UnixTime);
|
uint timeleft = (uint)(timeReset - GameTime.GetGameTime());
|
||||||
GetPlayer().SendInstanceResetWarning(mapEntry.Id, diff, timeleft, true);
|
GetPlayer().SendInstanceResetWarning(mapEntry.Id, diff, timeleft, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -585,7 +585,7 @@ namespace Game
|
|||||||
|
|
||||||
DB.Characters.CommitTransaction(trans);
|
DB.Characters.CommitTransaction(trans);
|
||||||
|
|
||||||
pet.SetPetNameTimestamp((uint)Time.UnixTime); // cast can't be helped
|
pet.SetPetNameTimestamp((uint)GameTime.GetGameTime()); // cast can't be helped
|
||||||
}
|
}
|
||||||
|
|
||||||
[WorldPacketHandler(ClientOpcodes.PetAbandon)]
|
[WorldPacketHandler(ClientOpcodes.PetAbandon)]
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Game
|
|||||||
void SendQueryTimeResponse()
|
void SendQueryTimeResponse()
|
||||||
{
|
{
|
||||||
QueryTimeResponse queryTimeResponse = new();
|
QueryTimeResponse queryTimeResponse = new();
|
||||||
queryTimeResponse.CurrentTime = Time.UnixTime;
|
queryTimeResponse.CurrentTime = GameTime.GetGameTime();
|
||||||
SendPacket(queryTimeResponse);
|
SendPacket(queryTimeResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Game
|
|||||||
void HandleServerTimeOffsetRequest(ServerTimeOffsetRequest packet)
|
void HandleServerTimeOffsetRequest(ServerTimeOffsetRequest packet)
|
||||||
{
|
{
|
||||||
ServerTimeOffset response = new();
|
ServerTimeOffset response = new();
|
||||||
response.Time = Time.UnixTime;
|
response.Time = GameTime.GetGameTime();
|
||||||
SendPacket(response);
|
SendPacket(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace Game.Mails
|
|||||||
|
|
||||||
uint mailId = Global.ObjectMgr.GenerateMailID();
|
uint mailId = Global.ObjectMgr.GenerateMailID();
|
||||||
|
|
||||||
long deliver_time = Time.UnixTime + deliver_delay;
|
long deliver_time = GameTime.GetGameTime() + 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
|
||||||
uint expire_delay;
|
uint expire_delay;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace Game.Maps
|
|||||||
resetTime = GetResetTimeFor(mapId, difficulty);
|
resetTime = GetResetTimeFor(mapId, difficulty);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resetTime = Time.UnixTime + 2 * Time.Hour;
|
resetTime = GameTime.GetGameTime() + 2 * Time.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, new InstResetEvent(0, mapId, difficulty, instanceId));
|
ScheduleReset(true, resetTime, new InstResetEvent(0, mapId, difficulty, instanceId));
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ namespace Game.Maps
|
|||||||
|
|
||||||
void LoadResetTimes()
|
void LoadResetTimes()
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
long today = (now / Time.Day) * Time.Day;
|
long today = (now / Time.Day) * Time.Day;
|
||||||
|
|
||||||
// NOTE: Use DirectPExecute for tables that will be queried later
|
// NOTE: Use DirectPExecute for tables that will be queried later
|
||||||
@@ -375,12 +375,12 @@ namespace Game.Maps
|
|||||||
ScheduleReset(false, 0, new InstResetEvent(1, mapId, difficulty, 0));
|
ScheduleReset(false, 0, new InstResetEvent(1, mapId, difficulty, 0));
|
||||||
ScheduleReset(false, 0, new InstResetEvent(4, mapId, difficulty, 0));
|
ScheduleReset(false, 0, new InstResetEvent(4, mapId, difficulty, 0));
|
||||||
// force global reset on the instance
|
// force global reset on the instance
|
||||||
_ResetOrWarnAll(mapId, difficulty, false, Time.UnixTime);
|
_ResetOrWarnAll(mapId, difficulty, false, GameTime.GetGameTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
|
|
||||||
while (!m_resetTimeQueue.Empty())
|
while (!m_resetTimeQueue.Empty())
|
||||||
{
|
{
|
||||||
@@ -489,7 +489,7 @@ namespace Game.Maps
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Log.outDebug(LogFilter.Misc, "InstanceSaveManager.ResetOrWarnAll: Processing map {0} ({1}) on difficulty {2} (warn? {3})", mapEntry.MapName[Global.WorldMgr.GetDefaultDbcLocale()], mapid, difficulty, warn);
|
Log.outDebug(LogFilter.Misc, "InstanceSaveManager.ResetOrWarnAll: Processing map {0} ({1}) on difficulty {2} (warn? {3})", mapEntry.MapName[Global.WorldMgr.GetDefaultDbcLocale()], mapid, difficulty, warn);
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
|
|
||||||
if (!warn)
|
if (!warn)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2393,7 +2393,7 @@ namespace Game.Maps
|
|||||||
long linkedTime = GetLinkedRespawnTime(thisGUID);
|
long linkedTime = GetLinkedRespawnTime(thisGUID);
|
||||||
if (linkedTime != 0)
|
if (linkedTime != 0)
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
long respawnTime;
|
long respawnTime;
|
||||||
if (linkedTime == long.MaxValue)
|
if (linkedTime == long.MaxValue)
|
||||||
respawnTime = linkedTime;
|
respawnTime = linkedTime;
|
||||||
@@ -2424,7 +2424,7 @@ namespace Game.Maps
|
|||||||
{
|
{
|
||||||
if (!Global.ScriptMgr.CanSpawn(info.spawnId, info.entry, Global.ObjectMgr.GetCreatureData(info.spawnId), this))
|
if (!Global.ScriptMgr.CanSpawn(info.spawnId, info.entry, Global.ObjectMgr.GetCreatureData(info.spawnId), this))
|
||||||
{ // if a script blocks our respawn, schedule next check in a little bit
|
{ // if a script blocks our respawn, schedule next check in a little bit
|
||||||
info.respawnTime = Time.UnixTime + RandomHelper.URand(4, 7);
|
info.respawnTime = GameTime.GetGameTime() + RandomHelper.URand(4, 7);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2614,7 +2614,7 @@ namespace Game.Maps
|
|||||||
|
|
||||||
void ProcessRespawns()
|
void ProcessRespawns()
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
while (!_respawnTimes.Empty())
|
while (!_respawnTimes.Empty())
|
||||||
{
|
{
|
||||||
RespawnInfo next = _respawnTimes.First();
|
RespawnInfo next = _respawnTimes.First();
|
||||||
@@ -2715,7 +2715,7 @@ namespace Game.Maps
|
|||||||
}
|
}
|
||||||
|
|
||||||
long respawnTime = GetRespawnTime(data.type, data.spawnId);
|
long respawnTime = GetRespawnTime(data.type, data.spawnId);
|
||||||
if (respawnTime != 0 && respawnTime > Time.UnixTime)
|
if (respawnTime != 0 && respawnTime > GameTime.GetGameTime())
|
||||||
{
|
{
|
||||||
if (!force && !ignoreRespawn)
|
if (!force && !ignoreRespawn)
|
||||||
continue;
|
continue;
|
||||||
@@ -3351,7 +3351,7 @@ namespace Game.Maps
|
|||||||
|
|
||||||
public void RemoveOldCorpses()
|
public void RemoveOldCorpses()
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
|
|
||||||
List<ObjectGuid> corpses = new();
|
List<ObjectGuid> corpses = new();
|
||||||
|
|
||||||
@@ -5035,7 +5035,7 @@ namespace Game.Maps
|
|||||||
|
|
||||||
// increase current instances (hourly limit)
|
// increase current instances (hourly limit)
|
||||||
if (!group || !group.IsLFGGroup())
|
if (!group || !group.IsLFGGroup())
|
||||||
player.AddInstanceEnterTime(GetInstanceId(), Time.UnixTime);
|
player.AddInstanceEnterTime(GetInstanceId(), GameTime.GetGameTime());
|
||||||
|
|
||||||
// get or create an instance save for the map
|
// get or create an instance save for the map
|
||||||
InstanceSave mapSave = Global.InstanceSaveMgr.GetInstanceSave(GetInstanceId());
|
InstanceSave mapSave = Global.InstanceSaveMgr.GetInstanceSave(GetInstanceId());
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ namespace Game.Maps
|
|||||||
// If script is blocking spawn, don't spawn but queue for a re-check in a little bit
|
// If script is blocking spawn, don't spawn but queue for a re-check in a little bit
|
||||||
if (!group.flags.HasFlag(SpawnGroupFlags.CompatibilityMode) && !Global.ScriptMgr.CanSpawn(guid, cdata.Id, cdata, map))
|
if (!group.flags.HasFlag(SpawnGroupFlags.CompatibilityMode) && !Global.ScriptMgr.CanSpawn(guid, cdata.Id, cdata, map))
|
||||||
{
|
{
|
||||||
map.SaveRespawnTime(SpawnObjectType.Creature, guid, cdata.Id, Time.UnixTime + RandomHelper.URand(4, 7), map.GetZoneId(PhasingHandler.EmptyPhaseShift, cdata.spawnPoint), GridDefines.ComputeGridCoord(cdata.spawnPoint.GetPositionX(), cdata.spawnPoint.GetPositionY()).GetId(), false);
|
map.SaveRespawnTime(SpawnObjectType.Creature, guid, cdata.Id, GameTime.GetGameTime() + RandomHelper.URand(4, 7), map.GetZoneId(PhasingHandler.EmptyPhaseShift, cdata.spawnPoint), GridDefines.ComputeGridCoord(cdata.spawnPoint.GetPositionX(), cdata.spawnPoint.GetPositionY()).GetId(), false);
|
||||||
obj.Dispose();
|
obj.Dispose();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class PacketLog
|
|||||||
writer.Write(Global.WorldMgr.GetRealm().Build);
|
writer.Write(Global.WorldMgr.GetRealm().Build);
|
||||||
writer.Write(Encoding.ASCII.GetBytes("enUS"));
|
writer.Write(Encoding.ASCII.GetBytes("enUS"));
|
||||||
writer.Write(new byte[40]);//SessionKey
|
writer.Write(new byte[40]);//SessionKey
|
||||||
writer.Write((uint)Time.UnixTime);
|
writer.Write((uint)GameTime.GetGameTime());
|
||||||
writer.Write(Time.GetMSTime());
|
writer.Write(Time.GetMSTime());
|
||||||
writer.Write(0);
|
writer.Write(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ namespace Game.Networking.Packets
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeLeft = mail.deliver_time - Time.UnixTime;
|
TimeLeft = mail.deliver_time - GameTime.GetGameTime();
|
||||||
AltSenderType = (sbyte)mail.messageType;
|
AltSenderType = (sbyte)mail.messageType;
|
||||||
StationeryID = (int)mail.stationery;
|
StationeryID = (int)mail.stationery;
|
||||||
}
|
}
|
||||||
@@ -400,7 +400,7 @@ namespace Game.Networking.Packets
|
|||||||
StationeryID = (int)mail.stationery;
|
StationeryID = (int)mail.stationery;
|
||||||
SentMoney = mail.money;
|
SentMoney = mail.money;
|
||||||
Flags = (int)mail.checkMask;
|
Flags = (int)mail.checkMask;
|
||||||
DaysLeft = (float)(mail.expire_time - Time.UnixTime) / Time.Day;
|
DaysLeft = (float)(mail.expire_time - GameTime.GetGameTime()) / Time.Day;
|
||||||
MailTemplateID = (int)mail.mailTemplateId;
|
MailTemplateID = (int)mail.mailTemplateId;
|
||||||
Subject = mail.subject;
|
Subject = mail.subject;
|
||||||
Body = mail.body;
|
Body = mail.body;
|
||||||
|
|||||||
@@ -607,7 +607,7 @@ namespace Game.Networking
|
|||||||
//! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now.
|
//! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now.
|
||||||
if (mutetime < 0)
|
if (mutetime < 0)
|
||||||
{
|
{
|
||||||
mutetime = Time.UnixTime + mutetime;
|
mutetime = GameTime.GetGameTime() + mutetime;
|
||||||
|
|
||||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME_LOGIN);
|
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_MUTE_TIME_LOGIN);
|
||||||
stmt.AddValue(0, mutetime);
|
stmt.AddValue(0, mutetime);
|
||||||
@@ -781,10 +781,10 @@ namespace Game.Networking
|
|||||||
bool HandlePing(Ping ping)
|
bool HandlePing(Ping ping)
|
||||||
{
|
{
|
||||||
if (_LastPingTime == 0)
|
if (_LastPingTime == 0)
|
||||||
_LastPingTime = Time.UnixTime; // for 1st ping
|
_LastPingTime = GameTime.GetGameTime(); // for 1st ping
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
long diff = now - _LastPingTime;
|
long diff = now - _LastPingTime;
|
||||||
_LastPingTime = now;
|
_LastPingTime = now;
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace Game
|
|||||||
|
|
||||||
if (!criteriaResult.IsEmpty())
|
if (!criteriaResult.IsEmpty())
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint criteriaId = criteriaResult.Read<uint>(0);
|
uint criteriaId = criteriaResult.Read<uint>(0);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace Game.Scenarios
|
|||||||
if (!result.IsEmpty())
|
if (!result.IsEmpty())
|
||||||
{
|
{
|
||||||
SQLTransaction trans = new();
|
SQLTransaction trans = new();
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
|
|
||||||
List<CriteriaTree> criteriaTrees = new();
|
List<CriteriaTree> criteriaTrees = new();
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace Game
|
|||||||
_realm = new Realm();
|
_realm = new Realm();
|
||||||
|
|
||||||
_worldUpdateTime = new WorldUpdateTime();
|
_worldUpdateTime = new WorldUpdateTime();
|
||||||
_warnShutdownTime = Time.UnixTime;
|
_warnShutdownTime = GameTime.GetGameTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player FindPlayerInZone(uint zone)
|
public Player FindPlayerInZone(uint zone)
|
||||||
@@ -271,7 +271,7 @@ namespace Game
|
|||||||
{
|
{
|
||||||
foreach (var disconnect in m_disconnects)
|
foreach (var disconnect in m_disconnects)
|
||||||
{
|
{
|
||||||
if ((disconnect.Value - Time.UnixTime) < tolerance)
|
if ((disconnect.Value - GameTime.GetGameTime()) < tolerance)
|
||||||
{
|
{
|
||||||
if (disconnect.Key == session.GetAccountId())
|
if (disconnect.Key == session.GetAccountId())
|
||||||
return true;
|
return true;
|
||||||
@@ -1858,7 +1858,7 @@ namespace Game
|
|||||||
if (!session.Update(diff, updater)) // As interval = 0
|
if (!session.Update(diff, updater)) // As interval = 0
|
||||||
{
|
{
|
||||||
if (!RemoveQueuedPlayer(session) && session != null && WorldConfig.GetIntValue(WorldCfg.IntervalDisconnectTolerance) != 0)
|
if (!RemoveQueuedPlayer(session) && session != null && WorldConfig.GetIntValue(WorldCfg.IntervalDisconnectTolerance) != 0)
|
||||||
m_disconnects[session.GetAccountId()] = Time.UnixTime;
|
m_disconnects[session.GetAccountId()] = GameTime.GetGameTime();
|
||||||
|
|
||||||
RemoveQueuedPlayer(session);
|
RemoveQueuedPlayer(session);
|
||||||
m_sessions.TryRemove(pair.Key, out _);
|
m_sessions.TryRemove(pair.Key, out _);
|
||||||
@@ -1923,7 +1923,7 @@ namespace Game
|
|||||||
void InitWeeklyQuestResetTime()
|
void InitWeeklyQuestResetTime()
|
||||||
{
|
{
|
||||||
long wstime = GetWorldState(WorldStates.WeeklyQuestResetTime);
|
long wstime = GetWorldState(WorldStates.WeeklyQuestResetTime);
|
||||||
long curtime = Time.UnixTime;
|
long curtime = GameTime.GetGameTime();
|
||||||
m_NextWeeklyQuestReset = wstime < curtime ? curtime : wstime;
|
m_NextWeeklyQuestReset = wstime < curtime ? curtime : wstime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1942,7 +1942,7 @@ namespace Game
|
|||||||
|
|
||||||
|
|
||||||
// FIX ME: client not show day start time
|
// FIX ME: client not show day start time
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
// current day reset time
|
// current day reset time
|
||||||
long curDayResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.DailyQuestResetTimeHour));
|
long curDayResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.DailyQuestResetTimeHour));
|
||||||
@@ -1960,7 +1960,7 @@ namespace Game
|
|||||||
void InitMonthlyQuestResetTime()
|
void InitMonthlyQuestResetTime()
|
||||||
{
|
{
|
||||||
long wstime = GetWorldState(WorldStates.MonthlyQuestResetTime);
|
long wstime = GetWorldState(WorldStates.MonthlyQuestResetTime);
|
||||||
long curtime = Time.UnixTime;
|
long curtime = GameTime.GetGameTime();
|
||||||
m_NextMonthlyQuestReset = wstime < curtime ? curtime : wstime;
|
m_NextMonthlyQuestReset = wstime < curtime ? curtime : wstime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1968,10 +1968,10 @@ namespace Game
|
|||||||
{
|
{
|
||||||
long bgtime = GetWorldState(WorldStates.BGDailyResetTime);
|
long bgtime = GetWorldState(WorldStates.BGDailyResetTime);
|
||||||
if (bgtime == 0)
|
if (bgtime == 0)
|
||||||
m_NextRandomBGReset = Time.UnixTime; // game time not yet init
|
m_NextRandomBGReset = GameTime.GetGameTime(); // game time not yet init
|
||||||
|
|
||||||
// generate time by config
|
// generate time by config
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
// current day reset time
|
// current day reset time
|
||||||
long nextDayResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.RandomBgResetHour));
|
long nextDayResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.RandomBgResetHour));
|
||||||
@@ -1991,9 +1991,9 @@ namespace Game
|
|||||||
{
|
{
|
||||||
long gtime = GetWorldState(WorldStates.GuildDailyResetTime);
|
long gtime = GetWorldState(WorldStates.GuildDailyResetTime);
|
||||||
if (gtime == 0)
|
if (gtime == 0)
|
||||||
m_NextGuildReset = Time.UnixTime; // game time not yet init
|
m_NextGuildReset = GameTime.GetGameTime(); // game time not yet init
|
||||||
|
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
var nextDayResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.GuildResetHour));
|
var nextDayResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.GuildResetHour));
|
||||||
|
|
||||||
if (curTime >= nextDayResetTime)
|
if (curTime >= nextDayResetTime)
|
||||||
@@ -2010,10 +2010,10 @@ namespace Game
|
|||||||
{
|
{
|
||||||
long currencytime = GetWorldState(WorldStates.CurrencyResetTime);
|
long currencytime = GetWorldState(WorldStates.CurrencyResetTime);
|
||||||
if (currencytime == 0)
|
if (currencytime == 0)
|
||||||
m_NextCurrencyReset = Time.UnixTime; // game time not yet init
|
m_NextCurrencyReset = GameTime.GetGameTime(); // game time not yet init
|
||||||
|
|
||||||
// generate time by config
|
// generate time by config
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
var nextWeekResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.CurrencyResetDay), WorldConfig.GetIntValue(WorldCfg.CurrencyResetHour));
|
var nextWeekResetTime = Time.GetNextResetUnixTime(WorldConfig.GetIntValue(WorldCfg.CurrencyResetDay), WorldConfig.GetIntValue(WorldCfg.CurrencyResetHour));
|
||||||
|
|
||||||
@@ -2107,7 +2107,7 @@ namespace Game
|
|||||||
if (session.GetPlayer() != null)
|
if (session.GetPlayer() != null)
|
||||||
session.GetPlayer().ResetMonthlyQuestStatus();
|
session.GetPlayer().ResetMonthlyQuestStatus();
|
||||||
|
|
||||||
long curTime = Time.UnixTime;
|
long curTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
// current day reset time
|
// current day reset time
|
||||||
long curDayResetTime = Time.GetNextResetUnixTime(30, 1, 0);
|
long curDayResetTime = Time.GetNextResetUnixTime(30, 1, 0);
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ namespace Game
|
|||||||
|
|
||||||
WorldPacket firstDelayedPacket = null;
|
WorldPacket firstDelayedPacket = null;
|
||||||
uint processedPackets = 0;
|
uint processedPackets = 0;
|
||||||
long currentTime = Time.UnixTime;
|
long currentTime = GameTime.GetGameTime();
|
||||||
|
|
||||||
WorldPacket packet;
|
WorldPacket packet;
|
||||||
//Check for any packets they was not recived yet.
|
//Check for any packets they was not recived yet.
|
||||||
@@ -332,9 +332,8 @@ namespace Game
|
|||||||
|
|
||||||
if (updater.ProcessUnsafe())
|
if (updater.ProcessUnsafe())
|
||||||
{
|
{
|
||||||
long currTime = Time.UnixTime;
|
|
||||||
// If necessary, log the player out
|
// If necessary, log the player out
|
||||||
if (ShouldLogOut(currTime) && m_playerLoading.IsEmpty())
|
if (ShouldLogOut(currentTime) && m_playerLoading.IsEmpty())
|
||||||
LogoutPlayer(true);
|
LogoutPlayer(true);
|
||||||
|
|
||||||
if (m_Socket[(int)ConnectionType.Realm] != null && GetPlayer() && _warden != null)
|
if (m_Socket[(int)ConnectionType.Realm] != null && GetPlayer() && _warden != null)
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ namespace Game.Spells
|
|||||||
m_castItemId = castItem != null ? castItem.GetEntry() : castItemId;
|
m_castItemId = castItem != null ? castItem.GetEntry() : castItemId;
|
||||||
m_castItemLevel = castItemLevel;
|
m_castItemLevel = castItemLevel;
|
||||||
m_spellVisual = new SpellCastVisual(caster ? caster.GetCastSpellXSpellVisualId(spellproto) : spellproto.GetSpellXSpellVisualId(), 0);
|
m_spellVisual = new SpellCastVisual(caster ? caster.GetCastSpellXSpellVisualId(spellproto) : spellproto.GetSpellXSpellVisualId(), 0);
|
||||||
m_applyTime = Time.UnixTime;
|
m_applyTime = GameTime.GetGameTime();
|
||||||
m_owner = owner;
|
m_owner = owner;
|
||||||
m_timeCla = 0;
|
m_timeCla = 0;
|
||||||
m_updateTargetMapInterval = 0;
|
m_updateTargetMapInterval = 0;
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ namespace Game.SupportSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long GetAge(ulong t) { return (Time.UnixTime - (long)t) / Time.Day; }
|
long GetAge(ulong t) { return (GameTime.GetGameTime() - (long)t) / Time.Day; }
|
||||||
|
|
||||||
IEnumerable<KeyValuePair<uint, ComplaintTicket>> GetComplaintsByPlayerGuid(ObjectGuid playerGuid)
|
IEnumerable<KeyValuePair<uint, ComplaintTicket>> GetComplaintsByPlayerGuid(ObjectGuid playerGuid)
|
||||||
{
|
{
|
||||||
@@ -361,7 +361,7 @@ namespace Game.SupportSystem
|
|||||||
public void SetComplaintSystemStatus(bool status) { _complaintSystemStatus = status; }
|
public void SetComplaintSystemStatus(bool status) { _complaintSystemStatus = status; }
|
||||||
public void SetSuggestionSystemStatus(bool status) { _suggestionSystemStatus = status; }
|
public void SetSuggestionSystemStatus(bool status) { _suggestionSystemStatus = status; }
|
||||||
|
|
||||||
public void UpdateLastChange() { _lastChange = (ulong)Time.UnixTime; }
|
public void UpdateLastChange() { _lastChange = (ulong)GameTime.GetGameTime(); }
|
||||||
|
|
||||||
public uint GenerateBugId() { return ++_lastBugId; }
|
public uint GenerateBugId() { return ++_lastBugId; }
|
||||||
public uint GenerateComplaintId() { return ++_lastComplaintId; }
|
public uint GenerateComplaintId() { return ++_lastComplaintId; }
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Game.SupportSystem
|
|||||||
public Ticket() { }
|
public Ticket() { }
|
||||||
public Ticket(Player player)
|
public Ticket(Player player)
|
||||||
{
|
{
|
||||||
_createTime = (ulong)Time.UnixTime;
|
_createTime = (ulong)GameTime.GetGameTime();
|
||||||
_playerGuid = player.GetGUID();
|
_playerGuid = player.GetGUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
public override string FormatViewMessageString(CommandHandler handler, bool detailed = false)
|
public override string FormatViewMessageString(CommandHandler handler, bool detailed = false)
|
||||||
{
|
{
|
||||||
var curTime = (ulong)Time.UnixTime;
|
var curTime = (ulong)GameTime.GetGameTime();
|
||||||
|
|
||||||
StringBuilder ss = new();
|
StringBuilder ss = new();
|
||||||
ss.Append(handler.GetParsedString(CypherStrings.CommandTicketlistguid, _id));
|
ss.Append(handler.GetParsedString(CypherStrings.CommandTicketlistguid, _id));
|
||||||
@@ -322,7 +322,7 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
public override string FormatViewMessageString(CommandHandler handler, bool detailed = false)
|
public override string FormatViewMessageString(CommandHandler handler, bool detailed = false)
|
||||||
{
|
{
|
||||||
ulong curTime = (ulong)Time.UnixTime;
|
ulong curTime = (ulong)GameTime.GetGameTime();
|
||||||
|
|
||||||
StringBuilder ss = new();
|
StringBuilder ss = new();
|
||||||
ss.Append(handler.GetParsedString(CypherStrings.CommandTicketlistguid, _id));
|
ss.Append(handler.GetParsedString(CypherStrings.CommandTicketlistguid, _id));
|
||||||
@@ -428,7 +428,7 @@ namespace Game.SupportSystem
|
|||||||
|
|
||||||
public override string FormatViewMessageString(CommandHandler handler, bool detailed = false)
|
public override string FormatViewMessageString(CommandHandler handler, bool detailed = false)
|
||||||
{
|
{
|
||||||
ulong curTime = (ulong)Time.UnixTime;
|
ulong curTime = (ulong)GameTime.GetGameTime();
|
||||||
|
|
||||||
StringBuilder ss = new();
|
StringBuilder ss = new();
|
||||||
ss.Append(handler.GetParsedString(CypherStrings.CommandTicketlistguid, _id));
|
ss.Append(handler.GetParsedString(CypherStrings.CommandTicketlistguid, _id));
|
||||||
|
|||||||
@@ -2287,7 +2287,7 @@ namespace Scripts.Spells.Items
|
|||||||
{
|
{
|
||||||
if (target.IsDead() && !target.IsPet())
|
if (target.IsDead() && !target.IsPet())
|
||||||
{
|
{
|
||||||
GetCaster().SummonGameObject(ObjectIds.ImprisonedDoomguard, target, Quaternion.fromEulerAnglesZYX(target.GetOrientation(), 0.0f, 0.0f), (uint)(target.GetRespawnTime() - Time.UnixTime));
|
GetCaster().SummonGameObject(ObjectIds.ImprisonedDoomguard, target, Quaternion.fromEulerAnglesZYX(target.GetOrientation(), 0.0f, 0.0f), (uint)(target.GetRespawnTime() - GameTime.GetGameTime()));
|
||||||
target.DespawnOrUnsummon();
|
target.DespawnOrUnsummon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1551,7 +1551,7 @@ namespace Scripts.World.NpcSpecial
|
|||||||
{
|
{
|
||||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
|
_scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
|
||||||
{
|
{
|
||||||
long now = Time.UnixTime;
|
long now = GameTime.GetGameTime();
|
||||||
foreach (var pair in _damageTimes.ToList())
|
foreach (var pair in _damageTimes.ToList())
|
||||||
{
|
{
|
||||||
// If unit has not dealt damage to training dummy for 5 seconds, Remove him from combat
|
// If unit has not dealt damage to training dummy for 5 seconds, Remove him from combat
|
||||||
@@ -1582,7 +1582,7 @@ namespace Scripts.World.NpcSpecial
|
|||||||
public override void DamageTaken(Unit doneBy, ref uint damage)
|
public override void DamageTaken(Unit doneBy, ref uint damage)
|
||||||
{
|
{
|
||||||
AddThreat(doneBy, damage); // just to create threat reference
|
AddThreat(doneBy, damage); // just to create threat reference
|
||||||
_damageTimes[doneBy.GetGUID()] = Time.UnixTime;
|
_damageTimes[doneBy.GetGUID()] = GameTime.GetGameTime();
|
||||||
damage = 0;
|
damage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user