NetPlay: Implement golf mode

This is an extension of host input authority that allows switching the
host (who has zero latency) on the fly, at the further expense of
everyone else's latency. This is useful for turn-based games where the
latency of players not on their turn doesn't matter.

To become the so-called golfer, the player simply presses a hotkey.
When the host is the golfer, latency is identical to normal host input
authority.
This commit is contained in:
Techjar
2019-04-02 08:08:27 -04:00
parent e2f1da5210
commit 1a12876330
15 changed files with 263 additions and 28 deletions

View File

@ -20,7 +20,7 @@
#include "InputCommon/GCPadStatus.h"
// clang-format off
constexpr std::array<const char*, 132> s_hotkey_labels{{
constexpr std::array<const char*, 133> s_hotkey_labels{{
_trans("Open"),
_trans("Change Disc"),
_trans("Eject Disc"),
@ -32,6 +32,7 @@ constexpr std::array<const char*, 132> s_hotkey_labels{{
_trans("Take Screenshot"),
_trans("Exit"),
_trans("Activate NetPlay Chat"),
_trans("Control NetPlay Golf Mode"),
_trans("Volume Down"),
_trans("Volume Up"),
@ -275,7 +276,7 @@ struct HotkeyGroupInfo
};
constexpr std::array<HotkeyGroupInfo, NUM_HOTKEY_GROUPS> s_groups_info = {
{{_trans("General"), HK_OPEN, HK_ACTIVATE_CHAT},
{{_trans("General"), HK_OPEN, HK_REQUEST_GOLF_CONTROL},
{_trans("Volume"), HK_VOLUME_DOWN, HK_VOLUME_TOGGLE_MUTE},
{_trans("Emulation Speed"), HK_DECREASE_EMULATION_SPEED, HK_TOGGLE_THROTTLE},
{_trans("Frame Advance"), HK_FRAME_ADVANCE, HK_FRAME_ADVANCE_RESET_SPEED},