diff --git a/common/EQStream.cpp b/common/EQStream.cpp index c2b744464..f45a3f496 100644 --- a/common/EQStream.cpp +++ b/common/EQStream.cpp @@ -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)); diff --git a/common/patches/RoF.cpp b/common/patches/RoF.cpp index 4feea5c39..93beb1670 100644 --- a/common/patches/RoF.cpp +++ b/common/patches/RoF.cpp @@ -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(); diff --git a/common/timer.cpp b/common/timer.cpp index eb6a081c2..2ed79b85e 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -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; diff --git a/zone/client.cpp b/zone/client.cpp index f2272d834..6da2d5c8f 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -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; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 2c6a39ffd..22640dd48 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -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()); } diff --git a/zone/entity.cpp b/zone/entity.cpp index c16ea74d0..b2e4652fb 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -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()); diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index f6f57fe51..534662293 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -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;iGetMercInfo().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(); diff --git a/zone/tasks.cpp b/zone/tasks.cpp index b7182ee05..5f16d94ef 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -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; iActivityCount; 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; iActivityCount; 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; diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 15142a08b..1123076ab 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -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);