#include "netplay_manager.h" #include "kage_input.h" #include "log.h" #include "platform.h" // 00906d60 Starts the netplay layer. Everything it set up is for a session: the streak, lobby popup and spinner sprites, // the version tags lobbies are matched by, the chat and its local profile, the mute list and the lobby listener. // Offline, none of it is ever shown or asked, so nothing is set up. Its one local listener is device_disconnect. void NetplayManager::Init() { KAGE::Input::manager.disconnectListeners.push_back([this](KAGE::Input::InputDevice& device) { device_disconnect(device.id); }); } // 0090b150 Runs a frame of the session and says whether the game's frame goes ahead. // Without a session it receives nothing, has nobody to drop, revive or vote with, and always lets the frame through. bool NetplayManager::Update() { return true; } // 0090b900 Draws the session's status line, chat and lobby prompts, none of which exist offline. void NetplayManager::Render() {} // 00913760 Logs a disconnected input device, at the session's frame, which stays 0 offline. // Online it also drops the players the device controlled. void NetplayManager::device_disconnect(int deviceId) { log_printf(LOG_INFO, "[Frame: %d] Input device (ID = %d) disconnected \n", 0, deviceId); } // Whether a session is running, as the game tested its list of session players. Never offline. bool NetplayManager::is_online() { return false; } // 0090b100 Whether a controller index is a player on this machine: every one is when no session lists them. bool NetplayManager::IsIdxLocalPlayer(int) { return true; } // 0090e6d0 Whether the session's service is connected. It never is offline, so the first ask opens the lost connection // popup and says no, and later asks say yes until the popup is closed, as the game does. bool NetplayManager::check_connection() { if (lostConnectionPopupId != -1) return true; reconstruction_missing("NetplayManager::check_connection's lost connection popup (netplay_lost_connection_callback " "00908070)"); }