fix spectate functionality

This commit is contained in:
Nikhil Narayana 2023-08-19 22:24:44 -07:00
commit 53bf282001
No known key found for this signature in database
GPG key ID: 1B34839FA8D6245E
3 changed files with 4 additions and 2 deletions

View file

@ -151,6 +151,9 @@ CEXISlippi::CEXISlippi(Core::System& system, const std::string current_file_name
directCodes = std::make_unique<SlippiDirectCodes>("direct-codes.json"); directCodes = std::make_unique<SlippiDirectCodes>("direct-codes.json");
teamsCodes = std::make_unique<SlippiDirectCodes>("teams-codes.json"); teamsCodes = std::make_unique<SlippiDirectCodes>("teams-codes.json");
// initialize the spectate server so we can connect without starting a game
SlippiSpectateServer::getInstance();
generator = std::default_random_engine(Common::Timer::NowMs()); generator = std::default_random_engine(Common::Timer::NowMs());
// Loggers will check 5 bytes, make sure we own that memory // Loggers will check 5 bytes, make sure we own that memory

View file

@ -262,7 +262,6 @@ private:
std::vector<u8> m_read_queue; std::vector<u8> m_read_queue;
std::unique_ptr<Slippi::SlippiGame> m_current_game = nullptr; std::unique_ptr<Slippi::SlippiGame> m_current_game = nullptr;
SlippiSpectateServer* m_slippiserver = nullptr;
SlippiMatchmaking::MatchSearchSettings last_search; SlippiMatchmaking::MatchSearchSettings last_search;
SlippiMatchmaking::MatchmakeResult recent_mm_result; SlippiMatchmaking::MatchmakeResult recent_mm_result;

View file

@ -280,7 +280,7 @@ void SlippiSpectateServer::SlippicommSocketThread(void)
ENetAddress server_address = {0}; ENetAddress server_address = {0};
server_address.host = ENET_HOST_ANY; server_address.host = ENET_HOST_ANY;
server_address.port = Config::Get(Config::SLIPPI_ENABLE_SPECTATOR); server_address.port = Config::Get(Config::SLIPPI_SPECTATOR_LOCAL_PORT);
// Create the spectator server // Create the spectator server
// This call can fail if the system is already listening on the specified port // This call can fail if the system is already listening on the specified port