LCEMP commit: support more max players

This commit is contained in:
pieeebot committed 2026-08-14 11:46:19 +03:00
1 parent 6853eab85f
commit 67a8111974
11 files changed
+36 -22

No files matched your search

@@ -1309,7 +1309,7 @@ void NetworkSocketLayer::UpdateAdvertisePlayerNames(BYTE count, const char playe
EnterCriticalSection(&s_advertiseLock);
memset(s_advertiseData.playerNames, 0, sizeof(s_advertiseData.playerNames));
s_advertiseData.playerCount = count;
for (int i = 0; i < count && i < 8; i++)
for (int i = 0; i < count && i < NETWORK_LAN_BROADCAST_PLAYERS; i++)
{
memcpy(s_advertiseData.playerNames[i], playerNames[i],
NETWORK_LAN_PLAYER_NAME_SIZE < (int)XUSER_NAME_SIZE ? NETWORK_LAN_PLAYER_NAME_SIZE : (int)XUSER_NAME_SIZE);
@@ -1587,7 +1587,7 @@ int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
broadcast->hostName[31] = L'\0';
for (int pn = 0; pn < 8; pn++)
for (int pn = 0; pn < NETWORK_LAN_BROADCAST_PLAYERS; pn++)
broadcast->playerNames[pn][XUSER_NAME_SIZE - 1] = '\0';
char senderIP[64];
@@ -38,6 +38,7 @@
#define NETWORK_LAN_MAX_PACKET_SIZE (3 * 1024 * 1024)
#define NETWORK_LAN_DISCOVERY_PORT 25566
#define NETWORK_LAN_BROADCAST_MAGIC 0x4D434C4E
#define NETWORK_LAN_BROADCAST_PLAYERS 8
#ifdef __PS3__
typedef int SOCKET;
@@ -115,7 +116,7 @@ struct LANBroadcast
DWORD texturePackParentId;
BYTE subTexturePackId;
BYTE isJoinable;
char playerNames[8][NETWORK_LAN_PLAYER_NAME_SIZE];
char playerNames[NETWORK_LAN_BROADCAST_PLAYERS][NETWORK_LAN_PLAYER_NAME_SIZE];
};
#pragma pack(pop)
@@ -132,7 +133,7 @@ struct LANSession
unsigned char subTexturePackId;
bool isJoinable;
DWORD lastSeenTick;
char playerNames[8][NETWORK_LAN_PLAYER_NAME_SIZE];
char playerNames[NETWORK_LAN_BROADCAST_PLAYERS][NETWORK_LAN_PLAYER_NAME_SIZE];
};
struct RemoteConnection
@@ -811,7 +811,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
memset(info->data.players, 0, sizeof(info->data.players));
memset(info->data.szPlayers, 0, sizeof(info->data.szPlayers));
for (int p = 0; p < MINECRAFT_NET_MAX_PLAYERS && p < lanSessions[i].playerCount; p++)
for (int p = 0; p < NETWORK_LAN_BROADCAST_PLAYERS && p < lanSessions[i].playerCount; p++)
{
if (lanSessions[i].playerNames[p][0] != 0)
{