mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCEMP-Server.git
synced 2026-06-04 06:34:51 +00:00
fix max players
This commit is contained in:
@@ -64,6 +64,9 @@ bool DedicatedServer::init()
|
||||
extern bool g_ServerAdvertiseLAN;
|
||||
g_ServerAdvertiseLAN = m_properties.advertiseLan;
|
||||
|
||||
extern int g_ServerMaxPlayers;
|
||||
g_ServerMaxPlayers = m_properties.maxPlayers;
|
||||
|
||||
extern char g_ServerBindAddress[256];
|
||||
if (!m_properties.serverIp.empty())
|
||||
{
|
||||
|
||||
@@ -79,6 +79,7 @@ bool ServerProperties::load(const wstring& path)
|
||||
difficulty = getInt(L"difficulty", 2);
|
||||
maxPlayers = getInt(L"max-players", 8);
|
||||
if (maxPlayers < 1) maxPlayers = 1;
|
||||
if (maxPlayers > 32) maxPlayers = 32;
|
||||
pvp = getBool(L"pvp", true);
|
||||
trustPlayers = getBool(L"trust-players", true);
|
||||
fireSpreads = getBool(L"fire-spreads", true);
|
||||
|
||||
@@ -73,6 +73,7 @@ char g_Win64MultiplayerIP[256] = "127.0.0.1";
|
||||
|
||||
bool g_ServerAdvertiseLAN = true;
|
||||
char g_ServerBindAddress[256] = "";
|
||||
int g_ServerMaxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
|
||||
static void InitMutex(pthread_mutex_t* m)
|
||||
{
|
||||
@@ -560,7 +561,7 @@ void* WinsockNetLayer::AcceptThreadProc(void* /*param*/)
|
||||
assignedSmallId = s_freeSmallIds.back();
|
||||
s_freeSmallIds.pop_back();
|
||||
}
|
||||
else if (s_nextSmallId < MINECRAFT_NET_MAX_PLAYERS)
|
||||
else if (s_nextSmallId < g_ServerMaxPlayers)
|
||||
{
|
||||
assignedSmallId = s_nextSmallId++;
|
||||
}
|
||||
@@ -799,7 +800,7 @@ bool WinsockNetLayer::StartAdvertising(int gamePort, const wchar_t *hostName, un
|
||||
for (int i = 0; i < 31 && hostName[i] != L'\0'; i++)
|
||||
s_advertiseData.hostName[i] = (uint16_t)hostName[i];
|
||||
s_advertiseData.playerCount = 1;
|
||||
s_advertiseData.maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
s_advertiseData.maxPlayers = g_ServerMaxPlayers;
|
||||
s_advertiseData.gameHostSettings = gameSettings;
|
||||
s_advertiseData.texturePackParentId = texPackId;
|
||||
s_advertiseData.subTexturePackId = subTexId;
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef int SOCKET;
|
||||
inline int closesocket(SOCKET s) { return close(s); }
|
||||
|
||||
#define WIN64_NET_DEFAULT_PORT 25565
|
||||
#define WIN64_NET_MAX_CLIENTS 7
|
||||
#define WIN64_NET_MAX_CLIENTS 31
|
||||
#define WIN64_NET_RECV_BUFFER_SIZE 65536
|
||||
#define WIN64_NET_MAX_PACKET_SIZE (3 * 1024 * 1024)
|
||||
#define WIN64_LAN_DISCOVERY_PORT 25566
|
||||
|
||||
Reference in New Issue
Block a user