time_t conversions made explicit

This commit is contained in:
Arthur Dene Ice 2014-05-10 21:50:08 -07:00
parent 6985f90477
commit 5a49cdf938
10 changed files with 15 additions and 15 deletions

View File

@ -941,7 +941,7 @@ void EQStream::SendSessionRequest()
EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(SessionRequest));
SessionRequest *Request=(SessionRequest *)out->pBuffer;
memset(Request,0,sizeof(SessionRequest));
Request->Session=htonl(time(nullptr));
Request->Session=htonl((u_long)time(nullptr));
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));

View File

@ -540,7 +540,7 @@ ENCODE(OP_TaskDescription)
outapp->WriteUInt32(in->ReadUInt32()); // Duration
outapp->WriteUInt32(in->ReadUInt32()); // Unknown
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
uint32 BytesLeftToCopy = in->size - in->GetReadPosition();

View File

@ -72,7 +72,7 @@ int gettimeofday (timeval *tp, ...)
ftime (&tb);
tp->tv_sec = tb.time;
tp->tv_sec = (long)tb.time;
tp->tv_usec = tb.millitm * 1000;
return 0;

View File

@ -331,7 +331,7 @@ Client::~Client() {
Bot::ProcessBotOwnerRefDelete(this);
#endif
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());
if (horse)
@ -551,7 +551,7 @@ bool Client::Save(uint8 iCommitNow) {
database.SaveBuffs(this);
TotalSecondsPlayed += (time(nullptr) - m_pp.lastlogin);
TotalSecondsPlayed = (int)(TotalSecondsPlayed+(time(nullptr) - m_pp.lastlogin));
m_pp.timePlayedMin = (TotalSecondsPlayed / 60);
m_pp.RestTimer = rest_timer.GetRemainingTime() / 1000;
@ -568,7 +568,7 @@ bool Client::Save(uint8 iCommitNow) {
memset(&m_mercinfo, 0, sizeof(struct MercInfo));
}
m_pp.lastlogin = time(nullptr);
m_pp.lastlogin = (uint32)time(nullptr);
if (pQueuedSaveWorkID) {
dbasync->CancelWork(pQueuedSaveWorkID);
pQueuedSaveWorkID = 0;

View File

@ -9603,7 +9603,7 @@ void Client::CompleteConnect()
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());
}

View File

@ -2684,7 +2684,7 @@ void EntityList::SendPetitionToAdmins(Petition *pet)
strcpy(pcus->gmsenttoo, "");
} else {
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
strcpy(pcus->accountid, pet->GetAccountName());
strcpy(pcus->charname, pet->GetCharName());

View File

@ -472,7 +472,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer;
char Name[64];
gmus->LastSeen = time(nullptr);
gmus->LastSeen = (uint32)time(nullptr);
gmus->InstanceID = 0;
gmus->GuildID = c->GuildID();
for (int i=0;i<Count;i++)

View File

@ -5497,7 +5497,7 @@ bool Merc::Suspend() {
SetSuspended(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().Stance = GetStance();
Save();

View File

@ -1506,7 +1506,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
CompletedTaskInformation cti;
cti.TaskID = ActiveTasks[TaskIndex].TaskID;
cti.CompletedTime = time(nullptr);
cti.CompletedTime = (int)time(nullptr);
for(int i=0; i<Task->ActivityCount; i++)
cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted);
@ -1578,7 +1578,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
}
CompletedTaskInformation cti;
cti.TaskID = ActiveTasks[TaskIndex].TaskID;
cti.CompletedTime = time(nullptr);
cti.CompletedTime = (int)time(nullptr);
for(int i=0; i<Task->ActivityCount; i++)
cti.ActivityDone[i] = (ActiveTasks[TaskIndex].Activity[i].State == ActivityCompleted);
@ -2294,7 +2294,7 @@ int ClientTaskState::TaskTimeLeft(int TaskID) {
if(ActiveTasks[i].TaskID != TaskID) continue;
int Now = time(nullptr);
int Now = (int)time(nullptr);
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].AcceptedTime = time(nullptr);
ActiveTasks[FreeSlot].AcceptedTime = (int)time(nullptr);
ActiveTasks[FreeSlot].Updated = true;
ActiveTasks[FreeSlot].CurrentStep = -1;

View File

@ -922,7 +922,7 @@ bool ZoneDatabase::GetCharacterInfoForLogin_result(MYSQL_RES* result,
pp->y = (float)atof(row[4]);
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)
GetSafePoints(pp->zone_id, database.GetInstanceVersion(pp->zoneInstance), &pp->x, &pp->y, &pp->z);