From acd4e40fa2c8a0a8094e294dd0e45e8b94831d25 Mon Sep 17 00:00:00 2001 From: RT Date: Sun, 19 Jul 2026 14:37:46 -0500 Subject: [PATCH] Commit 31-player lobby support (untested, needs follow-up) Carry the remaining CTCL, lobby, and player-limit updates onto the new moreplayers branch. This change set is intentionally marked untested and may still be broken. It needs follow-up validation and likely further work before it should be considered stable. Co-authored-by: Claude Sonnet 4.6 (Anthropic) Co-authored-by: GitHub Copilot --- Gameleap/code/Launcher/ctcl.cpp | 4 +- Gameleap/code/mw4/Code/MW4/MW4Shell.cpp | 7 ++- Gameleap/code/mw4/Code/MW4/MWApplication.cpp | 8 +-- Gameleap/code/mw4/Code/MW4/ctcl.h | 2 +- .../Code/MW4Application/MW4Application.cpp | 2 +- .../code/mw4/Code/MW4Application/ctcl.cpp | 4 +- Gameleap/code/mw4/Code/MW4GameEd2/ctcl.cpp | 4 +- .../code/mw4/Libraries/Adept/Application.cpp | 2 +- Gameleap/code/mw4/Tools/AnimScript/ctcl.cpp | 4 +- .../mw4/Content/ShellScripts/ConLobby.script | 58 +++++++++---------- 10 files changed, 48 insertions(+), 47 deletions(-) diff --git a/Gameleap/code/Launcher/ctcl.cpp b/Gameleap/code/Launcher/ctcl.cpp index 8c786d07..d4f89900 100644 --- a/Gameleap/code/Launcher/ctcl.cpp +++ b/Gameleap/code/Launcher/ctcl.cpp @@ -9,7 +9,7 @@ #include "recscore.h" #endif // !defined(CTCLS_EXPORTS) && !defined(CTCL_LAUNCHER) -#define MAX_TESLAS 16 +#define MAX_TESLAS 31 #define MAX_CAMERAS 4 #define PORT_Launcher 1000 @@ -260,7 +260,7 @@ CInviteCOOP g_InviteCOOP; // Mech4 only int g_nMech4Comm = 0; BOOL g_bIsServer = FALSE; -SPlayerInfo g_aPlayerInfos[20]; +SPlayerInfo g_aPlayerInfos[35]; // 31 pilots + 1 CS + 3 spare int g_nPlayerInfos; int g_nServer; int g_nTeslas; diff --git a/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp b/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp index c5670abb..6eca2b74 100644 --- a/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp +++ b/Gameleap/code/mw4/Code/MW4/MW4Shell.cpp @@ -13316,9 +13316,10 @@ void CTCL_API CTCL_DefaultHostSetup(int nMode) params->m_maxBots = 8; //} } else { - params->m_maxPlayers = 16; - Environment.NetworkMaxPlayers = 16; - params->m_maxBots = 16; + params->m_maxPlayers = 31; // 31: max that fits in 5-bit bitstream (0-31) + Environment.NetworkMaxPlayers = 31; + params->m_maxBots = 31; + gos_NetServerCommands(gos_Commend_UpdateMaxPlayers, 0); // push the updated limit to the live DirectPlay session } params->m_allow3rdPerson = 1; if ((nMode != 0) && (nMode != 4)) { diff --git a/Gameleap/code/mw4/Code/MW4/MWApplication.cpp b/Gameleap/code/mw4/Code/MW4/MWApplication.cpp index 26e3dc41..d3ff5081 100644 --- a/Gameleap/code/mw4/Code/MW4/MWApplication.cpp +++ b/Gameleap/code/mw4/Code/MW4/MWApplication.cpp @@ -808,8 +808,8 @@ void NetMissionParameters::MWNetMissionParameters::SaveParameters(DynamicMemoryS stream->WriteBits(&m_pureMapCycle,1); - stream->WriteBits(&m_maxPlayers, 5); // 16 players maximum - stream->WriteBits(&m_maxBots, 5); // 16 players maximum + stream->WriteBits(&m_maxPlayers, 5); // max 31 players + stream->WriteBits(&m_maxBots, 5); // max 31 stream->WriteBits(&m_mapID, 16); // 65535 maps available stream->WriteBits(&m_mapClientCRC, 64); @@ -927,8 +927,8 @@ void NetMissionParameters::MWNetMissionParameters::LoadParameters(MemoryStream * stream->ReadBits(&m_useMapCycle,1); stream->ReadBits(&m_pureMapCycle,1); - stream->ReadBits(&m_maxPlayers, 5); // 16 players max - stream->ReadBits(&m_maxBots, 5); // 16 players max + stream->ReadBits(&m_maxPlayers, 5); // max 31 players + stream->ReadBits(&m_maxBots, 5); // max 31 stream->ReadBits(&m_mapID, 16); // 65535 maps available stream->ReadBits(&m_mapClientCRC, 64); diff --git a/Gameleap/code/mw4/Code/MW4/ctcl.h b/Gameleap/code/mw4/Code/MW4/ctcl.h index 080fbea1..365196dd 100644 --- a/Gameleap/code/mw4/Code/MW4/ctcl.h +++ b/Gameleap/code/mw4/Code/MW4/ctcl.h @@ -150,7 +150,7 @@ extern int g_nMech4Comm; // server & client only extern BOOL g_bIsServer; // console(All), server & client only(g_aPlayerInfos[0]), server only(g_aPlayerInfos[1..g_nBOTs] -extern SPlayerInfo g_aPlayerInfos[20]; +extern SPlayerInfo g_aPlayerInfos[35]; // 31 pilots + 1 CS + 3 spare extern int g_nPlayerInfos; extern int g_nServer; extern int g_nTeslas; diff --git a/Gameleap/code/mw4/Code/MW4Application/MW4Application.cpp b/Gameleap/code/mw4/Code/MW4Application/MW4Application.cpp index 3c051e6d..85ecad32 100644 --- a/Gameleap/code/mw4/Code/MW4Application/MW4Application.cpp +++ b/Gameleap/code/mw4/Code/MW4Application/MW4Application.cpp @@ -885,7 +885,7 @@ void __stdcall GetGameOSEnvironment(char* CommandLine) Environment.allowMultipleApps = false; Environment.AllowJoinInProgress = true; Environment.NetworkGame = true; - Environment.NetworkMaxPlayers = 16; + Environment.NetworkMaxPlayers = 31; // max 31 (fits in 5-bit bitstream) Environment.NetworkGUID[0] = 0x95; Environment.NetworkGUID[1] = 0x78; Environment.NetworkGUID[2] = 0xFF; diff --git a/Gameleap/code/mw4/Code/MW4Application/ctcl.cpp b/Gameleap/code/mw4/Code/MW4Application/ctcl.cpp index e127920e..a12e2deb 100644 --- a/Gameleap/code/mw4/Code/MW4Application/ctcl.cpp +++ b/Gameleap/code/mw4/Code/MW4Application/ctcl.cpp @@ -9,7 +9,7 @@ #include "recscore.h" #endif // !defined(CTCLS_EXPORTS) && !defined(CTCL_LAUNCHER) -#define MAX_TESLAS 16 +#define MAX_TESLAS 31 #define MAX_CAMERAS 4 #define PORT_Launcher 1000 @@ -263,7 +263,7 @@ CInviteCOOP g_InviteCOOP; // Mech4 only int g_nMech4Comm = 0; BOOL g_bIsServer = FALSE; -SPlayerInfo g_aPlayerInfos[20]; +SPlayerInfo g_aPlayerInfos[35]; // 31 pilots + 1 CS + 3 spare int g_nPlayerInfos; int g_nServer; int g_nTeslas; diff --git a/Gameleap/code/mw4/Code/MW4GameEd2/ctcl.cpp b/Gameleap/code/mw4/Code/MW4GameEd2/ctcl.cpp index 1dcc282b..770dec7c 100644 --- a/Gameleap/code/mw4/Code/MW4GameEd2/ctcl.cpp +++ b/Gameleap/code/mw4/Code/MW4GameEd2/ctcl.cpp @@ -9,7 +9,7 @@ #include "recscore.h" #endif // !defined(CTCLS_EXPORTS) && !defined(CTCL_LAUNCHER) -#define MAX_TESLAS 16 +#define MAX_TESLAS 31 #define MAX_CAMERAS 4 #define PORT_Launcher 1000 @@ -263,7 +263,7 @@ CInviteCOOP g_InviteCOOP; // Mech4 only int g_nMech4Comm = 0; BOOL g_bIsServer = FALSE; -SPlayerInfo g_aPlayerInfos[20]; +SPlayerInfo g_aPlayerInfos[35]; // 31 pilots + 1 CS + 3 spare int g_nPlayerInfos; int g_nServer; int g_nTeslas; diff --git a/Gameleap/code/mw4/Libraries/Adept/Application.cpp b/Gameleap/code/mw4/Libraries/Adept/Application.cpp index 05cf112f..7cd4fad2 100644 --- a/Gameleap/code/mw4/Libraries/Adept/Application.cpp +++ b/Gameleap/code/mw4/Libraries/Adept/Application.cpp @@ -86,7 +86,7 @@ void NetMissionParameters::AdeptNetMissionParameters::ResetParameters(void) { m_runDedicated = 0; m_closedGame = 0; - m_playerLimit = 16; + m_playerLimit = 31; // max 31 (fits in 5-bit bitstream) m_visibility = 0; diff --git a/Gameleap/code/mw4/Tools/AnimScript/ctcl.cpp b/Gameleap/code/mw4/Tools/AnimScript/ctcl.cpp index eaae92c3..cf0ac202 100644 --- a/Gameleap/code/mw4/Tools/AnimScript/ctcl.cpp +++ b/Gameleap/code/mw4/Tools/AnimScript/ctcl.cpp @@ -9,7 +9,7 @@ #include "recscore.h" #endif // !defined(CTCLS_EXPORTS) && !defined(CTCL_LAUNCHER) -#define MAX_TESLAS 16 +#define MAX_TESLAS 31 #define MAX_CAMERAS 4 #define PORT_Launcher 1000 @@ -263,7 +263,7 @@ CInviteCOOP g_InviteCOOP; // Mech4 only int g_nMech4Comm = 0; BOOL g_bIsServer = FALSE; -SPlayerInfo g_aPlayerInfos[20]; +SPlayerInfo g_aPlayerInfos[35]; // 31 pilots + 1 CS + 3 spare int g_nPlayerInfos; int g_nServer; int g_nTeslas; diff --git a/Gameleap/mw4/Content/ShellScripts/ConLobby.script b/Gameleap/mw4/Content/ShellScripts/ConLobby.script index 06f5a4d8..5b8e3cd4 100644 --- a/Gameleap/mw4/Content/ShellScripts/ConLobby.script +++ b/Gameleap/mw4/Content/ShellScripts/ConLobby.script @@ -72,8 +72,8 @@ #define USE_O_MORE_PODS $$g_nMechPodNum$$ // 0 = use only 8 #if USE_O_MORE_PODS -#define MAX_ROSTER_COUNT 16 // Was 8 -#define MAX_TEAMMATE_COUNT 8 // Was 4 +#define MAX_ROSTER_COUNT 31 // max within 5-bit bitstream (0-31) +#define MAX_TEAMMATE_COUNT 15 // Was 4, then 8 #else #define MAX_ROSTER_COUNT 8 #define MAX_TEAMMATE_COUNT 4 // Was 4 @@ -364,7 +364,7 @@ main cur_team_val = callback($$CTCL_GetTeamParams$$, cur_team_count[0]) int skin_id ///////VERY IMPORTANT FOR NEW SKIN INTERFACE - int skin_ids[17] + int skin_ids[32] int update_skin = false // MSL 5.05 int decal_id ///////VERY IMPORTANT FOR NEW DECAL INTERFACE @@ -522,7 +522,7 @@ main ///---------holds faction name for scroll list - string faction_name[17] + string faction_name[32] callback($$Shell_CallbackHandler$$, ShellInitMPScreen) @@ -645,12 +645,12 @@ main team_legal_to_join[8] = TRUE int update_team = 0 - int max_players = 16 + int max_players = 31 // max within 5-bit bitstream int player_num = 0 // int num_of_teams = 8 int mech_id - int name_color[17] + int name_color[32] int lupe for lupe = 0; lupe < nRosterCount;lupe++ @@ -675,33 +675,33 @@ main player_num = -1 // ComboBox for the Player Type - object o_BotList[17] - object o_BotList_bu[17] - int m_naLastSelected[17] + object o_BotList[32] + object o_BotList_bu[32] + int m_naLastSelected[32] for x = 0; x < nRosterCount; x++ { m_naLastSelected[x] = 0 } - object o_Editbox[17] - object o_print_text[17] - object o_mech_variant[17] - object o_mech_variant_bu[17] + object o_Editbox[32] + object o_print_text[32] + object o_mech_variant[32] + object o_mech_variant_bu[32] #if USE_O_MECH_VARIANT2 - object o_mech_variant2[17] - object o_mech_variant2_bu[17] + object o_mech_variant2[32] + object o_mech_variant2_bu[32] #endif // USE_O_MECH_VARIANT2 - object o_mech_rand[17] - object o_skins[17] - object o_skins_bu[17] + object o_mech_rand[32] + object o_skins[32] + object o_skins_bu[32] // MSL 5.05 - object o_decal[18] - object o_decal_bu[18] - object o_team[18] - object o_team_bu[18] - object o_decal_box[18] - object o_skin_box[18] - object o_status[18] - int roster_posy[18] + object o_decal[32] + object o_decal_bu[32] + object o_team[32] + object o_team_bu[32] + object o_decal_box[32] + object o_skin_box[32] + object o_status[32] + int roster_posy[32] int coolbaby int stock_size = 0 @@ -1005,7 +1005,7 @@ main o_decal[x].list_item[15] = "16" o_decal[x].list_item[16] = "17" - for coolbaby = 17;coolbaby < o_decal[x].list_size+1;coolbaby++ + for coolbaby = 17;coolbaby < o_decal[x].list_size;coolbaby++ o_decal[x].list_item[coolbaby] = conv$(coolbaby+1) o_decal[x].nselected = 3 @@ -1072,7 +1072,7 @@ main o_skins[x].list_item[14] = "15" o_skins[x].list_item[15] = "16" - for coolbaby = 16;coolbaby < o_skins[x].list_size+1;coolbaby++ + for coolbaby = 16;coolbaby < o_skins[x].list_size;coolbaby++ o_skins[x].list_item[coolbaby] = conv$(coolbaby+1) o_skins[x].nselected = 3 @@ -2714,7 +2714,7 @@ main } } // MSL 5.06 - if nLaunchState == 0 && (nTempPlayerCount > 16) + if nLaunchState == 0 && (nTempPlayerCount > 31) { o_error_string.text = "Too many player/bots" nLaunchState = -7