Keep network player limit as an int constant

This commit is contained in:
notmatthewbeshay 2026-03-13 15:12:25 +11:00
parent 50693bfc20
commit 85208b12b7
2 changed files with 13 additions and 4 deletions

View file

@ -1,4 +1,8 @@
#pragma once
#include <cstdint>
#include <limits>
const int MINECRAFT_NET_MAX_PLAYERS = 8;
constexpr int MINECRAFT_NET_MAX_PLAYERS = 8;
static_assert(MINECRAFT_NET_MAX_PLAYERS <= std::numeric_limits<std::uint8_t>::max(),
"MINECRAFT_NET_MAX_PLAYERS must fit in the 8-bit network protocol");

View file

@ -3,6 +3,8 @@
#include <stdarg.h>
#include <string>
#include <functional>
#include <cstdint>
#include <limits>
#include "../../../Minecraft.Client/Rendering/Models/SkinBox.h"
@ -17,12 +19,15 @@ const int XUSER_INDEX_FOCUS = 254;
#ifdef __PSVITA__
const int XUSER_MAX_COUNT = 1;
const int MINECRAFT_NET_MAX_PLAYERS = 4;
constexpr int MINECRAFT_NET_MAX_PLAYERS = 4;
#else
const int XUSER_MAX_COUNT = 4;
const int MINECRAFT_NET_MAX_PLAYERS = 8;
constexpr int MINECRAFT_NET_MAX_PLAYERS = 8;
#endif
static_assert(MINECRAFT_NET_MAX_PLAYERS <= std::numeric_limits<std::uint8_t>::max(),
"MINECRAFT_NET_MAX_PLAYERS must fit in the 8-bit network protocol");
#ifdef __ORBIS__
#include <net.h>
#include <np/np_npid.h>