mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 14:49:53 -06:00
attempt at preventing desyncs, let's see
This commit is contained in:
@ -677,8 +677,15 @@ void ProcessMirrorClient()
|
|||||||
{
|
{
|
||||||
if (!MirrorHost) return;
|
if (!MirrorHost) return;
|
||||||
|
|
||||||
|
bool block = false;
|
||||||
|
if (emuThread->emuIsRunning() && NDS::NumFrames > 4)
|
||||||
|
{
|
||||||
|
if (InputQueue.empty())
|
||||||
|
block = true;
|
||||||
|
}
|
||||||
|
|
||||||
ENetEvent event;
|
ENetEvent event;
|
||||||
while (enet_host_service(MirrorHost, &event, 0) > 0)
|
while (enet_host_service(MirrorHost, &event, block ? 5000 : 0) > 0)
|
||||||
{
|
{
|
||||||
switch (event.type)
|
switch (event.type)
|
||||||
{
|
{
|
||||||
@ -839,6 +846,7 @@ void ProcessInput()
|
|||||||
|
|
||||||
if (frame.FrameNum < NDS::NumFrames)
|
if (frame.FrameNum < NDS::NumFrames)
|
||||||
{
|
{
|
||||||
|
// TODO: this situation is a desync
|
||||||
printf("Netplay: BAD! LAGGING BEHIND\n");
|
printf("Netplay: BAD! LAGGING BEHIND\n");
|
||||||
while (frame.FrameNum < NDS::NumFrames)
|
while (frame.FrameNum < NDS::NumFrames)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user