diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 3edc52ed..3a4ebe8d 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -4101,7 +4101,7 @@ void ClientConnection::checkDeferredEntityLinkPackets(int newEntityId) bool remove = false; // Only consider recently deferred packets - int tickInterval = GetTickCount() - deferred->m_recievedTick; + int tickInterval = GetTickCount64() - deferred->m_recievedTick; if (tickInterval < MAX_ENTITY_LINK_DEFERRAL_INTERVAL) { // Note: we assume it's the destination entity @@ -4127,6 +4127,6 @@ void ClientConnection::checkDeferredEntityLinkPackets(int newEntityId) ClientConnection::DeferredEntityLinkPacket::DeferredEntityLinkPacket(shared_ptr packet) { - m_recievedTick = GetTickCount(); + m_recievedTick = GetTickCount64(); m_packet = packet; } diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 1c83043f..09cb72d0 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -9663,20 +9663,20 @@ int CMinecraftApp::GetDLCInfoTexturesOffersCount() void CMinecraftApp::SetAutosaveTimerTime(void) { #if defined(_XBOX_ONE) || defined(__ORBIS__) - m_uiAutosaveTimer= GetTickCount()+1000*60; + m_uiAutosaveTimer= GetTickCount64()+1000*60; #else - m_uiAutosaveTimer= GetTickCount()+GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_Autosave)*1000*60*15; + m_uiAutosaveTimer= GetTickCount64()+GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_Autosave)*1000*60*15; #endif }// value x 15 to get mins, x60 for secs bool CMinecraftApp::AutosaveDue(void) { - return (GetTickCount()>m_uiAutosaveTimer); + return (GetTickCount64()>m_uiAutosaveTimer); } unsigned int CMinecraftApp::SecondsToAutosave() { - return (m_uiAutosaveTimer - GetTickCount() ) / 1000; + return (m_uiAutosaveTimer - GetTickCount64() ) / 1000; } void CMinecraftApp::SetTrialTimerStart(void) diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp index 430f2c11..a30fcf1a 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp @@ -831,7 +831,7 @@ void CPlatformNetworkManagerStub::TickSearch() return; static DWORD lastSearchTime = 0; - DWORD now = GetTickCount(); + DWORD now = GetTickCount64(); if (now - lastSearchTime < 2000) return; lastSearchTime = now; diff --git a/Minecraft.Client/Common/Tutorial/Tutorial.cpp b/Minecraft.Client/Common/Tutorial/Tutorial.cpp index 7005e176..ad9f0c28 100644 --- a/Minecraft.Client/Common/Tutorial/Tutorial.cpp +++ b/Minecraft.Client/Common/Tutorial/Tutorial.cpp @@ -1299,7 +1299,7 @@ void Tutorial::tick() // Don't do anything for the first 2 seconds so that the loading screen is gone if(!m_bHasTickedOnce) { - int time = GetTickCount(); + int time = GetTickCount64(); if(m_firstTickTime == 0) { m_firstTickTime = time; @@ -1363,7 +1363,7 @@ void Tutorial::tick() if(!m_allowShow) { - if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) + if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount64() ) ) { uiTempDisabled = true; } @@ -1413,7 +1413,7 @@ void Tutorial::tick() if(ui.IsPauseMenuDisplayed( m_iPad ) ) { - if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) + if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount64() ) ) { uiTempDisabled = true; } @@ -1423,7 +1423,7 @@ void Tutorial::tick() if( uiTempDisabled ) { ui.SetTutorialVisible( m_iPad, true ); - lastMessageTime = GetTickCount(); + lastMessageTime = GetTickCount64(); uiTempDisabled = false; } @@ -1490,7 +1490,7 @@ void Tutorial::tick() { isCurrentTask = false; if( - ( !task->ShowMinimumTime() || ( task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) ) + ( !task->ShowMinimumTime() || ( task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount64() ) ) && task->isCompleted() ) { @@ -1567,7 +1567,7 @@ void Tutorial::tick() { ++it; } - if( task != nullptr && task->ShowMinimumTime() && task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) + if( task != nullptr && task->ShowMinimumTime() && task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount64() ) { task->setShownForMinimumTime(); @@ -1642,12 +1642,12 @@ void Tutorial::tick() } } - if(m_hintDisplayed && (lastMessageTime + m_iTutorialDisplayMessageTime ) < GetTickCount() ) + if(m_hintDisplayed && (lastMessageTime + m_iTutorialDisplayMessageTime ) < GetTickCount64() ) { m_hintDisplayed = false; } - if( currentFailedConstraint[m_CurrentState] == nullptr && currentTask[m_CurrentState] != nullptr && (m_iTaskReminders!=0) && (lastMessageTime + (m_iTaskReminders * m_iTutorialReminderTime) ) < GetTickCount() ) + if( currentFailedConstraint[m_CurrentState] == nullptr && currentTask[m_CurrentState] != nullptr && (m_iTaskReminders!=0) && (lastMessageTime + (m_iTaskReminders * m_iTutorialReminderTime) ) < GetTickCount64() ) { // Reminder PopupMessageDetails *message = new PopupMessageDetails(); @@ -1675,7 +1675,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) if(message != nullptr && !message->m_forceDisplay && m_lastMessageState == m_CurrentState && message->isSameContent(m_lastMessage) && - ( !message->m_isReminder || ( (lastMessageTime + m_iTutorialReminderTime ) > GetTickCount() && message->m_isReminder ) ) + ( !message->m_isReminder || ( (lastMessageTime + m_iTutorialReminderTime ) > GetTickCount64() && message->m_isReminder ) ) ) { delete message; @@ -1686,7 +1686,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) { m_lastMessageState = m_CurrentState; - if(!message->m_replaceCurrent) lastMessageTime = GetTickCount(); + if(!message->m_replaceCurrent) lastMessageTime = GetTickCount64(); wstring text; if(!message->m_messageString.empty()) @@ -1755,7 +1755,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) ui.SetTutorialDescription( m_iPad, &popupInfo ); } } - else if( (m_lastMessage != nullptr && m_lastMessage->m_messageId != -1) ) //&& (lastMessageTime + m_iTutorialReminderTime ) > GetTickCount() ) + else if( (m_lastMessage != nullptr && m_lastMessage->m_messageId != -1) ) //&& (lastMessageTime + m_iTutorialReminderTime ) > GetTickCount64() ) { // This should cause the popup to dissappear TutorialPopupInfo popupInfo; @@ -1777,7 +1777,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message) bool hintsOn = m_isFullTutorial || (app.GetGameSettings(m_iPad,eGameSetting_Hints) && app.GetGameSettings(m_iPad,eGameSetting_DisplayHUD)); bool messageShown = false; - DWORD time = GetTickCount(); + DWORD time = GetTickCount64(); if(message != nullptr && (message->m_forceDisplay || hintsOn) && (!message->m_delay || ( @@ -1816,7 +1816,7 @@ void Tutorial::showTutorialPopup(bool show) if(!show) { - if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) + if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount64() ) ) { uiTempDisabled = true; } diff --git a/Minecraft.Client/Common/Tutorial/TutorialMode.cpp b/Minecraft.Client/Common/Tutorial/TutorialMode.cpp index 50a45a42..540a7067 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialMode.cpp +++ b/Minecraft.Client/Common/Tutorial/TutorialMode.cpp @@ -69,7 +69,7 @@ void TutorialMode::tick() tutorial->tick(); /* - if( tutorial.m_allTutorialsComplete && (tutorial.lastMessageTime + m_iTutorialDisplayMessageTime) < GetTickCount() ) + if( tutorial.m_allTutorialsComplete && (tutorial.lastMessageTime + m_iTutorialDisplayMessageTime) < GetTickCount64() ) { // Exit tutorial minecraft->gameMode = new SurvivalMode( this ); diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index a633883e..f2449962 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -1323,7 +1323,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) if(pressed) { // Start repeat timer - m_actionRepeatTimer[iPad][key] = GetTickCount() + UI_REPEAT_KEY_DELAY_MS; + m_actionRepeatTimer[iPad][key] = GetTickCount64() + UI_REPEAT_KEY_DELAY_MS; } else if (released) { @@ -1333,7 +1333,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) else if (down) { // Check is enough time has elapsed to be a repeat key - DWORD currentTime = GetTickCount(); + DWORD currentTime = GetTickCount64(); if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key]) { repeat = true; @@ -1435,7 +1435,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) if(pressed) { // Start repeat timer - m_actionRepeatTimer[iPad][key] = GetTickCount() + UI_REPEAT_KEY_DELAY_MS; + m_actionRepeatTimer[iPad][key] = GetTickCount64() + UI_REPEAT_KEY_DELAY_MS; } else if (released) { @@ -1445,7 +1445,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) else if (down) { // Check is enough time has elapsed to be a repeat key - DWORD currentTime = GetTickCount(); + DWORD currentTime = GetTickCount64(); if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key]) { repeat = true; @@ -2129,7 +2129,7 @@ UIScene *UIController::GetTopScene(int iPad, EUILayer layer, EUIGroup group) size_t UIController::RegisterForCallbackId(UIScene *scene) { EnterCriticalSection(&m_registeredCallbackScenesCS); - size_t newId = GetTickCount(); + size_t newId = GetTickCount64(); newId &= 0xFFFFFF; // Chop off the top byte, we don't need any more accuracy than that newId |= (scene->getSceneType() << 24); // Add in the scene's type to help keep this unique m_registeredCallbackScenes[newId] = scene; diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index 96e9b539..ac1ad361 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -2388,7 +2388,7 @@ bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player) #ifdef MINECRAFT_SERVER_BUILD return true; #else - int time = GetTickCount(); + int time = GetTickCount64(); DWORD currentPlayerCount = g_NetworkManager.GetPlayerCount(); if( currentPlayerCount == 0 ) return false; int index = s_slowQueuePlayerIndex % (int)currentPlayerCount; @@ -2414,7 +2414,7 @@ void MinecraftServer::chunkPacketManagement_PreTick() void MinecraftServer::chunkPacketManagement_PostTick() { // 4J Ensure that the slow queue owner keeps cycling if it's not been used in a while - int time = GetTickCount(); + int time = GetTickCount64(); if( ( s_slowQueuePacketSent ) || ( (time - s_slowQueueLastTime) > ( 2 * MINECRAFT_SERVER_SLOW_QUEUE_DELAY ) ) ) { // app.DebugPrintf("Considering cycling: (%d) %d - %d -> %d > %d\n",s_slowQueuePacketSent, time, s_slowQueueLastTime, (time - s_slowQueueLastTime), (2*MINECRAFT_SERVER_SLOW_QUEUE_DELAY)); diff --git a/Minecraft.Client/Screen.cpp b/Minecraft.Client/Screen.cpp index 7966c5c9..efcb148c 100644 --- a/Minecraft.Client/Screen.cpp +++ b/Minecraft.Client/Screen.cpp @@ -161,7 +161,7 @@ void Screen::updateEvents() static bool s_arrowFirstRepeat[2] = { false, false }; const DWORD ARROW_REPEAT_DELAY_MS = 250; const DWORD ARROW_REPEAT_INTERVAL_MS = 50; - DWORD now = GetTickCount(); + DWORD now = GetTickCount64(); // Poll keyboard events (special keys that may not come through WM_CHAR, e.g. Escape, arrows) for (int vk = 0; vk < 256; vk++)