diff --git a/src/Components/Modules/Dedicated.cpp b/src/Components/Modules/Dedicated.cpp index 373f565a..cb9257ea 100644 --- a/src/Components/Modules/Dedicated.cpp +++ b/src/Components/Modules/Dedicated.cpp @@ -43,7 +43,7 @@ namespace Components Command::Execute("com_maxfps 125"); // Process command line? - //Utils::Hook::Call(0x60C3D0)(); + Utils::Hook::Call(0x60C3D0)(); } void __declspec(naked) Dedicated::PostInitializationStub() diff --git a/src/Components/Modules/Party.cpp b/src/Components/Modules/Party.cpp index 06e05255..7b03f297 100644 --- a/src/Components/Modules/Party.cpp +++ b/src/Components/Modules/Party.cpp @@ -82,6 +82,8 @@ namespace Components void Party::PlaylistContinue() { + Dvar::Var("xblive_privateserver").Set(false); + // Ensure we can join *Game::g_lobbyCreateInProgress = false; @@ -118,7 +120,7 @@ namespace Components Party::Party() { - Dvar::Register("party_enable", false, Game::dvar_flag::DVAR_FLAG_NONE, "Enable party system"); + static Game::dvar_t* partyEnable = Dvar::Register("party_enable", false, Game::dvar_flag::DVAR_FLAG_NONE, "Enable party system").Get(); Dvar::Register("xblive_privatematch", true, Game::dvar_flag::DVAR_FLAG_WRITEPROTECTED, "").Get(); // various changes to SV_DirectConnect-y stuff to allow non-party joinees @@ -189,6 +191,16 @@ namespace Components // Disable host migration Utils::Hook::Set(0x5B58B2, 0xEB); + // Patch playlist stuff for non-party behavior + Utils::Hook::Set(0x4A4093, &partyEnable); + Utils::Hook::Set(0x4573F1, &partyEnable); + Utils::Hook::Set(0x5B1A0C, &partyEnable); + + // Invert corresponding jumps + Utils::Hook::Xor(0x4A409B, 1); + Utils::Hook::Xor(0x4573FA, 1); + Utils::Hook::Xor(0x5B1A17, 1); + // Fix xstartlobby //Utils::Hook::Set(0x5B71CD, 0xEB); @@ -341,6 +353,8 @@ namespace Components } else { + Dvar::Var("xblive_privateserver").Set(true); + Game::Menus_CloseAll(Game::uiContext); char xnaddr[32]; diff --git a/src/Components/Modules/Playlist.cpp b/src/Components/Modules/Playlist.cpp index 60b02613..6bd195f8 100644 --- a/src/Components/Modules/Playlist.cpp +++ b/src/Components/Modules/Playlist.cpp @@ -10,6 +10,16 @@ namespace Components // Check if playlist already loaded if (Utils::Hook::Get(0x1AD3680)) return; + // Don't load playlists when dedi and no party + if (Dedicated::IsDedicated() && !Dvar::Var("party_enable").Get()) + { + Utils::Hook::Set(0x1AD3680, true); // Set received to true + Dvar::Var("xblive_privateserver").Set(true); + return; + } + + Dvar::Var("xblive_privateserver").Set(false); + std::string playlistFilename = Dvar::Var("playlistFilename").Get(); FileSystem::File playlist(playlistFilename);