From e8e41d852993e277c990f63c4d94b1e2b3fd80a7 Mon Sep 17 00:00:00 2001 From: Techjar Date: Thu, 6 Feb 2020 06:39:17 -0500 Subject: [PATCH] Core/NetPlayClient: Add documentation for SendPadHostPoll --- Source/Core/Core/NetPlayClient.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 6ddafd2776..bbc52a73fe 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -2045,6 +2045,18 @@ bool NetPlayClient::PollLocalPad(const int local_pad, sf::Packet& packet) void NetPlayClient::SendPadHostPoll(const PadIndex pad_num) { + // Here we handle polling for the Host Input Authority and Golf modes. Pad data is "polled" from + // the most recent data received for the given pad. Passing pad_num < 0 will poll all assigned + // pads (used for batched polls), while 0..3 will poll the respective pad (used for MMIO polls). + // See GetNetPads for more details. + // + // If the local buffer is non-empty, we skip actually buffering and sending new pad data, this way + // don't end up with permanent local latency. It does create a period of time where no inputs are + // accepted, but under typical circumstances this is not noticeable. + // + // Additionally, we wait until some actual pad data has been received before buffering and sending + // it, otherwise controllers get calibrated wrongly with the default values of GCPadStatus. + if (m_local_player->pid != m_current_golfer) return;