Skip to content

Commit

Permalink
Merge pull request #2989 from HeatXD/nat_traversal
Browse files Browse the repository at this point in the history
Netplay / Nat traversal
  • Loading branch information
stenzek authored Jul 30, 2023
2 parents 36fde62 + 54e8957 commit 05fc4c3
Show file tree
Hide file tree
Showing 19 changed files with 655 additions and 173 deletions.
11 changes: 8 additions & 3 deletions dep/ggpo-x/src/backends/p2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ GGPOErrorCode Peer2PeerBackend::NetworkIdle()
for (UdpProtocol& udp : _endpoints)
udp.NetworkIdle();

for (UdpProtocol& udp : _spectators)
udp.NetworkIdle();

return GGPO_OK;
}

Expand Down Expand Up @@ -657,15 +660,17 @@ Peer2PeerBackend::SetFrameDelay(GGPOPlayerHandle player, int delay)
result = PlayerHandleToQueue(player, &queue);
if (!GGPO_SUCCEEDED(result)) {
return result;
} _sync.SetFrameDelay(queue, delay);

}

_sync.SetFrameDelay(queue, delay);

for (int i = 0; i < _num_players; i++) {
if (_endpoints[i].IsInitialized()) {
_endpoints[i].SetFrameDelay(delay);

}
}
;

return GGPO_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion dep/ggpo-x/src/network/udp_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <cmath>
#include <iostream>
static const int UDP_HEADER_SIZE = 28; /* Size of IP + UDP headers */
static const int NUM_SYNC_PACKETS = 5;
static const int NUM_SYNC_PACKETS = 1;
static const int SYNC_RETRY_INTERVAL = 2000;
static const int SYNC_FIRST_RETRY_INTERVAL = 500;
static const int RUNNING_RETRY_INTERVAL = 200;
Expand Down
2 changes: 1 addition & 1 deletion src/core/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void GPU::UpdateDMARequest()

case BlitterState::ReadingVRAM:
m_GPUSTAT.ready_to_send_vram = true;
m_GPUSTAT.ready_to_recieve_dma = false;
m_GPUSTAT.ready_to_recieve_dma = m_fifo.IsEmpty();
break;
}

Expand Down
Loading

0 comments on commit 05fc4c3

Please sign in to comment.