Permalink
Browse files

NetPlay: Add additional comments for host input authority mode

  • Loading branch information...
Techjar committed Aug 27, 2018
1 parent 0cc3ae7 commit 1ba834d13cab03ede2982b1f31d51a90d568bfe0
Showing with 8 additions and 0 deletions.
  1. +4 −0 Source/Core/Core/NetPlayClient.cpp
  2. +4 −0 Source/Core/Core/NetPlayClient.h
@@ -1452,6 +1452,10 @@ bool NetPlayClient::GetNetPads(const int pad_nb, const bool batching, GCPadStatu
if (m_host_input_authority && !m_local_player->IsHost())
{
// CoreTiming acts funny and causes what looks like frame skip if
// we toggle the emulation speed too quickly, so to prevent this
// we wait until the buffer has been over for at least 1 second.
const bool buffer_over_target = m_pad_buffer[pad_nb].Size() > m_target_buffer_size + 1;
if (!buffer_over_target)
m_buffer_under_target_last = std::chrono::steady_clock::now();
@@ -157,6 +157,10 @@ class NetPlayClient : public TraversalClientClient
Common::Flag m_is_running{false};
Common::Flag m_do_loop{true};
// In non-host input authority mode, this is how many packets each client should
// try to keep in-flight to the other clients. In host input authority mode, this is how
// many incoming input packets need to be queued up before the client starts
// speeding up the game to drain the buffer.
unsigned int m_target_buffer_size = 20;
bool m_host_input_authority = false;

0 comments on commit 1ba834d

Please sign in to comment.