summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAnthony Serna <aserna3@gmail.com>2015-12-31 05:15:00 -0600
committerAnthony Serna <aserna3@gmail.com>2015-12-31 18:50:45 -0600
commit42c38cbbd3bdfefd494f60ab6a99a9dfaafa663e (patch)
tree83c8b417e75eb298a7ddcd47fb2801b5cca82e24 /Source/Core
parent787bf156f02c61e0812e8afe673d3bc670dfe717 (diff)
Blocked netplay users from desyncing by messing with savestates.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/State.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp
index a346c2ed96..f1fd56cf7c 100644
--- a/Source/Core/Core/State.cpp
+++ b/Source/Core/Core/State.cpp
@@ -20,6 +20,7 @@
#include "Core/CoreTiming.h"
#include "Core/Host.h"
#include "Core/Movie.h"
+#include "Core/NetPlayClient.h"
#include "Core/State.h"
#include "Core/HW/CPU.h"
#include "Core/HW/DSP.h"
@@ -31,6 +32,7 @@
#include "Core/PowerPC/JitCommon/JitBase.h"
#include "VideoCommon/AVIDump.h"
+#include "VideoCommon/OnScreenDisplay.h"
#include "VideoCommon/VideoBackendBase.h"
namespace State
@@ -198,6 +200,12 @@ static std::string DoState(PointerWrap& p)
void LoadFromBuffer(std::vector<u8>& buffer)
{
+ if (NetPlay::IsNetPlayRunning())
+ {
+ OSD::AddMessage("Loading savestates is disabled in Netplay to prevent desyncs");
+ return;
+ }
+
bool wasUnpaused = Core::PauseAndLock(true);
u8* ptr = &buffer[0];
@@ -531,7 +539,14 @@ static void LoadFileStateData(const std::string& filename, std::vector<u8>& ret_
void LoadAs(const std::string& filename)
{
if (!Core::IsRunning())
+ {
return;
+ }
+ else if (NetPlay::IsNetPlayRunning())
+ {
+ OSD::AddMessage("Loading savestates is disabled in Netplay to prevent desyncs");
+ return;
+ }
// Stop the core while we load the state
bool wasUnpaused = Core::PauseAndLock(true);