mirror of
https://github.com/SourMesen/Mesen.git
synced 2024-05-20 05:01:03 -04:00
Netplay: Fixed desynchronization issue
When the host loaded a game, the client would end up applying the input with a 1 frame offset, causing some games to eventually desync. Pausing, loading a state, resetting, etc. would permanently fix the problem (until another game was loading)
This commit is contained in:
parent
243ffef4fc
commit
5d67994f08
|
@ -436,6 +436,10 @@ bool Console::Initialize(VirtualFile &romFile, VirtualFile &patchFile, bool forP
|
|||
_notificationManager->SendNotification(ConsoleNotificationType::VsDualSystemStarted);
|
||||
}
|
||||
}
|
||||
|
||||
//Used by netplay to take save state after UpdateInputState() is called above, to ensure client+server are in sync
|
||||
_notificationManager->SendNotification(ConsoleNotificationType::GameInitCompleted);
|
||||
|
||||
Resume();
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -191,12 +191,12 @@ void GameServerConnection::ProcessNotification(ConsoleNotificationType type, voi
|
|||
{
|
||||
switch(type) {
|
||||
case ConsoleNotificationType::GamePaused:
|
||||
case ConsoleNotificationType::GameLoaded:
|
||||
case ConsoleNotificationType::GameResumed:
|
||||
case ConsoleNotificationType::GameReset:
|
||||
case ConsoleNotificationType::StateLoaded:
|
||||
case ConsoleNotificationType::CheatAdded:
|
||||
case ConsoleNotificationType::ConfigChanged:
|
||||
case ConsoleNotificationType::GameInitCompleted:
|
||||
SendGameInformation();
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -25,6 +25,7 @@ enum class ConsoleNotificationType
|
|||
BeforeEmulationStop = 19,
|
||||
VsDualSystemStarted = 20,
|
||||
VsDualSystemStopped = 21,
|
||||
GameInitCompleted = 22,
|
||||
};
|
||||
|
||||
class INotificationListener
|
||||
|
|
Loading…
Reference in a new issue