From 6dd10033d31c7f1179e0e379ef4f579c149a95ba Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 23 May 2015 22:55:53 -0400 Subject: [PATCH] NetPlayClient: Fix reassembling of system time from packets The shifts need to be swapped to correctly reassemble a 64-bit integer. --- Source/Core/Core/NetPlayClient.cpp | 2 +- Source/Core/Core/NetPlayServer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index b324092d46..ff022e8513 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -395,7 +395,7 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet) u32 x, y; packet >> x; packet >> y; - g_netplay_initial_gctime = x | ((u64)y >> 32); + g_netplay_initial_gctime = x | ((u64)y << 32); } m_dialog->OnMsgStartGame(); diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index c2f0a3f751..ea1de80980 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -657,7 +657,7 @@ bool NetPlayServer::StartGame() *spac << m_settings.m_EXIDevice[0]; *spac << m_settings.m_EXIDevice[1]; *spac << (u32)g_netplay_initial_gctime; - *spac << (u32)g_netplay_initial_gctime << 32; + *spac << (u32)(g_netplay_initial_gctime >> 32); SendAsyncToClients(spac);