mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
time_t conversions made explicit
This commit is contained in:
+1
-1
@@ -941,7 +941,7 @@ void EQStream::SendSessionRequest()
|
|||||||
EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(SessionRequest));
|
EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(SessionRequest));
|
||||||
SessionRequest *Request=(SessionRequest *)out->pBuffer;
|
SessionRequest *Request=(SessionRequest *)out->pBuffer;
|
||||||
memset(Request,0,sizeof(SessionRequest));
|
memset(Request,0,sizeof(SessionRequest));
|
||||||
Request->Session=htonl(time(nullptr));
|
Request->Session=htonl((u_long)time(nullptr));
|
||||||
Request->MaxLength=htonl(512);
|
Request->MaxLength=htonl(512);
|
||||||
|
|
||||||
_log(NET__NET_TRACE, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength));
|
_log(NET__NET_TRACE, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength));
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ ENCODE(OP_TaskDescription)
|
|||||||
outapp->WriteUInt32(in->ReadUInt32()); // Duration
|
outapp->WriteUInt32(in->ReadUInt32()); // Duration
|
||||||
outapp->WriteUInt32(in->ReadUInt32()); // Unknown
|
outapp->WriteUInt32(in->ReadUInt32()); // Unknown
|
||||||
uint32 StartTime = in->ReadUInt32();
|
uint32 StartTime = in->ReadUInt32();
|
||||||
outapp->WriteUInt32(time(nullptr) - StartTime); // RoF has elapsed time here rather than starttime
|
outapp->WriteUInt32((uint32)(time(nullptr) - StartTime)); // RoF has elapsed time here rather than starttime
|
||||||
|
|
||||||
// Copy the rest of the packet verbatim
|
// Copy the rest of the packet verbatim
|
||||||
uint32 BytesLeftToCopy = in->size - in->GetReadPosition();
|
uint32 BytesLeftToCopy = in->size - in->GetReadPosition();
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ int gettimeofday (timeval *tp, ...)
|
|||||||
|
|
||||||
ftime (&tb);
|
ftime (&tb);
|
||||||
|
|
||||||
tp->tv_sec = tb.time;
|
tp->tv_sec = (long)tb.time;
|
||||||
tp->tv_usec = tb.millitm * 1000;
|
tp->tv_usec = tb.millitm * 1000;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+3
-3
@@ -331,7 +331,7 @@ Client::~Client() {
|
|||||||
Bot::ProcessBotOwnerRefDelete(this);
|
Bot::ProcessBotOwnerRefDelete(this);
|
||||||
#endif
|
#endif
|
||||||
if(IsInAGuild())
|
if(IsInAGuild())
|
||||||
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), 0, time(nullptr));
|
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), 0, (uint32)time(nullptr));
|
||||||
|
|
||||||
Mob* horse = entity_list.GetMob(this->CastToClient()->GetHorseId());
|
Mob* horse = entity_list.GetMob(this->CastToClient()->GetHorseId());
|
||||||
if (horse)
|
if (horse)
|
||||||
@@ -551,7 +551,7 @@ bool Client::Save(uint8 iCommitNow) {
|
|||||||
|
|
||||||
database.SaveBuffs(this);
|
database.SaveBuffs(this);
|
||||||
|
|
||||||
TotalSecondsPlayed += (time(nullptr) - m_pp.lastlogin);
|
TotalSecondsPlayed = (int)(TotalSecondsPlayed+(time(nullptr) - m_pp.lastlogin));
|
||||||
m_pp.timePlayedMin = (TotalSecondsPlayed / 60);
|
m_pp.timePlayedMin = (TotalSecondsPlayed / 60);
|
||||||
m_pp.RestTimer = rest_timer.GetRemainingTime() / 1000;
|
m_pp.RestTimer = rest_timer.GetRemainingTime() / 1000;
|
||||||
|
|
||||||
@@ -568,7 +568,7 @@ bool Client::Save(uint8 iCommitNow) {
|
|||||||
memset(&m_mercinfo, 0, sizeof(struct MercInfo));
|
memset(&m_mercinfo, 0, sizeof(struct MercInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pp.lastlogin = time(nullptr);
|
m_pp.lastlogin = (uint32)time(nullptr);
|
||||||
if (pQueuedSaveWorkID) {
|
if (pQueuedSaveWorkID) {
|
||||||
dbasync->CancelWork(pQueuedSaveWorkID);
|
dbasync->CancelWork(pQueuedSaveWorkID);
|
||||||
pQueuedSaveWorkID = 0;
|
pQueuedSaveWorkID = 0;
|
||||||
|
|||||||
@@ -9603,7 +9603,7 @@ void Client::CompleteConnect()
|
|||||||
|
|
||||||
if(IsInAGuild())
|
if(IsInAGuild())
|
||||||
{
|
{
|
||||||
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), zone->GetZoneID(), time(nullptr));
|
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), zone->GetZoneID(), (uint32)time(nullptr));
|
||||||
guild_mgr.RequestOnlineGuildMembers(this->CharacterID(), this->GuildID());
|
guild_mgr.RequestOnlineGuildMembers(this->CharacterID(), this->GuildID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2684,7 +2684,7 @@ void EntityList::SendPetitionToAdmins(Petition *pet)
|
|||||||
strcpy(pcus->gmsenttoo, "");
|
strcpy(pcus->gmsenttoo, "");
|
||||||
} else {
|
} else {
|
||||||
pcus->color = pet->GetUrgency(); // 0x00 = green, 0x01 = yellow, 0x02 = red
|
pcus->color = pet->GetUrgency(); // 0x00 = green, 0x01 = yellow, 0x02 = red
|
||||||
pcus->status = pet->GetSentTime();
|
pcus->status = (uint32)pet->GetSentTime();
|
||||||
pcus->senttime = pet->GetSentTime(); // 4 has to be 0x1F
|
pcus->senttime = pet->GetSentTime(); // 4 has to be 0x1F
|
||||||
strcpy(pcus->accountid, pet->GetAccountName());
|
strcpy(pcus->accountid, pet->GetAccountName());
|
||||||
strcpy(pcus->charname, pet->GetCharName());
|
strcpy(pcus->charname, pet->GetCharName());
|
||||||
|
|||||||
+1
-1
@@ -472,7 +472,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
|||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
|
||||||
GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer;
|
GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer;
|
||||||
char Name[64];
|
char Name[64];
|
||||||
gmus->LastSeen = time(nullptr);
|
gmus->LastSeen = (uint32)time(nullptr);
|
||||||
gmus->InstanceID = 0;
|
gmus->InstanceID = 0;
|
||||||
gmus->GuildID = c->GuildID();
|
gmus->GuildID = c->GuildID();
|
||||||
for (int i=0;i<Count;i++)
|
for (int i=0;i<Count;i++)
|
||||||
|
|||||||
+1
-1
@@ -5497,7 +5497,7 @@ bool Merc::Suspend() {
|
|||||||
SetSuspended(true);
|
SetSuspended(true);
|
||||||
|
|
||||||
mercOwner->GetMercInfo().IsSuspended = true;
|
mercOwner->GetMercInfo().IsSuspended = true;
|
||||||
mercOwner->GetMercInfo().SuspendedTime = time(nullptr) + RuleI(Mercs, SuspendIntervalS);
|
mercOwner->GetMercInfo().SuspendedTime = (uint32)(time(nullptr) + RuleI(Mercs, SuspendIntervalS));
|
||||||
mercOwner->GetMercInfo().MercTimerRemaining = mercOwner->GetMercTimer()->GetRemainingTime();
|
mercOwner->GetMercInfo().MercTimerRemaining = mercOwner->GetMercTimer()->GetRemainingTime();
|
||||||
mercOwner->GetMercInfo().Stance = GetStance();
|
mercOwner->GetMercInfo().Stance = GetStance();
|
||||||
Save();
|
Save();
|
||||||
|
|||||||
+4
-4
@@ -1506,7 +1506,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
|||||||
|
|
||||||
CompletedTaskInformation cti;
|
CompletedTaskInformation cti;
|
||||||
cti.TaskID = ActiveTasks[TaskIndex].TaskID;
|
cti.TaskID = ActiveTasks[TaskIndex].TaskID;
|
||||||
cti.CompletedTime = time(nullptr);
|
cti.CompletedTime = (int)time(nullptr);
|
||||||
|
|
||||||
for(int i=0; i<Task->ActivityCount; i++)
|
for(int i=0; i<Task->ActivityCount; i++)
|
||||||
cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted);
|
cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted);
|
||||||
@@ -1578,7 +1578,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
|||||||
}
|
}
|
||||||
CompletedTaskInformation cti;
|
CompletedTaskInformation cti;
|
||||||
cti.TaskID = ActiveTasks[TaskIndex].TaskID;
|
cti.TaskID = ActiveTasks[TaskIndex].TaskID;
|
||||||
cti.CompletedTime = time(nullptr);
|
cti.CompletedTime = (int)time(nullptr);
|
||||||
|
|
||||||
for(int i=0; i<Task->ActivityCount; i++)
|
for(int i=0; i<Task->ActivityCount; i++)
|
||||||
cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted);
|
cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted);
|
||||||
@@ -2294,7 +2294,7 @@ int ClientTaskState::TaskTimeLeft(int TaskID) {
|
|||||||
|
|
||||||
if(ActiveTasks[i].TaskID != TaskID) continue;
|
if(ActiveTasks[i].TaskID != TaskID) continue;
|
||||||
|
|
||||||
int Now = time(nullptr);
|
int Now = (int)time(nullptr);
|
||||||
|
|
||||||
TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID];
|
TaskInformation* Task = taskmanager->Tasks[ActiveTasks[i].TaskID];
|
||||||
|
|
||||||
@@ -3222,7 +3222,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) {
|
|||||||
|
|
||||||
|
|
||||||
ActiveTasks[FreeSlot].TaskID = TaskID;
|
ActiveTasks[FreeSlot].TaskID = TaskID;
|
||||||
ActiveTasks[FreeSlot].AcceptedTime = time(nullptr);
|
ActiveTasks[FreeSlot].AcceptedTime = (int)time(nullptr);
|
||||||
ActiveTasks[FreeSlot].Updated = true;
|
ActiveTasks[FreeSlot].Updated = true;
|
||||||
ActiveTasks[FreeSlot].CurrentStep = -1;
|
ActiveTasks[FreeSlot].CurrentStep = -1;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -922,7 +922,7 @@ bool ZoneDatabase::GetCharacterInfoForLogin_result(MYSQL_RES* result,
|
|||||||
pp->y = (float)atof(row[4]);
|
pp->y = (float)atof(row[4]);
|
||||||
pp->z = (float)atof(row[5]);
|
pp->z = (float)atof(row[5]);
|
||||||
|
|
||||||
pp->lastlogin = time(nullptr);
|
pp->lastlogin = (uint32)time(nullptr);
|
||||||
|
|
||||||
if (pp->x == -1 && pp->y == -1 && pp->z == -1)
|
if (pp->x == -1 && pp->y == -1 && pp->z == -1)
|
||||||
GetSafePoints(pp->zone_id, database.GetInstanceVersion(pp->zoneInstance), &pp->x, &pp->y, &pp->z);
|
GetSafePoints(pp->zone_id, database.GetInstanceVersion(pp->zoneInstance), &pp->x, &pp->y, &pp->z);
|
||||||
|
|||||||
Reference in New Issue
Block a user