LCEMP commit: support more max players
This commit is contained in:
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)
|
||||
{
|
||||
|
||||
@@ -1597,7 +1597,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
bool isClientSide = false;
|
||||
bool isPrivate = false;
|
||||
// TODO int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
int maxPlayers = 8;
|
||||
int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
|
||||
if( app.GetTutorialMode() )
|
||||
{
|
||||
|
||||
@@ -598,7 +598,8 @@ IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex)
|
||||
static bool Win64_IsActivePlayer(IQNetPlayer *p, DWORD index)
|
||||
{
|
||||
if (index == 0) return true;
|
||||
return (p->GetCustomDataValue() != 0);
|
||||
if (p->GetCustomDataValue() != 0) return true;
|
||||
return (p->m_isRemote && p->m_gamertag[0] != 0);
|
||||
}
|
||||
|
||||
IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex)
|
||||
|
||||
@@ -531,7 +531,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
int offs = 0;
|
||||
|
||||
wstring playerName;
|
||||
WCHAR wchName[2];
|
||||
WCHAR wchName[8];
|
||||
|
||||
if(mob->instanceof(eTYPE_PLAYER))
|
||||
{
|
||||
@@ -551,7 +551,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(wchName,0,sizeof(WCHAR)*2);
|
||||
memset(wchName,0,sizeof(wchName));
|
||||
swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1);
|
||||
playerName=wchName;
|
||||
player->SetPlayerNameValidState(false);
|
||||
@@ -561,7 +561,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
playerName=name;
|
||||
break;
|
||||
case Player::ePlayerNameValid_False:
|
||||
memset(wchName,0,sizeof(WCHAR)*2);
|
||||
memset(wchName,0,sizeof(wchName)d);
|
||||
swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1);
|
||||
playerName=wchName;
|
||||
break;
|
||||
|
||||
@@ -16586,7 +16586,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Xbox\Network\extra.h" />
|
||||
<ClInclude Include="Xbox\Network\NetworkPlayerXbox.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
|
||||
@@ -36696,4 +36695,4 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -3611,9 +3611,6 @@
|
||||
<ClInclude Include="Orbis\Network\PsPlusUpsellWrapper_Orbis.h">
|
||||
<Filter>Orbis\Network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Xbox\Network\extra.h">
|
||||
<Filter>Xbox\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\UI\UIScene_Keyboard.h">
|
||||
<Filter>Common\Source Files\UI\Scenes</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -38,13 +38,35 @@ PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0
|
||||
armorParts2 = new HumanoidModel(0.5f);
|
||||
}
|
||||
|
||||
static unsigned int HsvToArgb(float h, float s, float v)
|
||||
{
|
||||
float c = v * s;
|
||||
float x = c * (1.0f - fabsf(fmodf(h / 60.0f, 2.0f) - 1.0f));
|
||||
float m = v - c;
|
||||
float r, g, b;
|
||||
if (h < 60) { r = c; g = x; b = 0; }
|
||||
else if (h < 120) { r = x; g = c; b = 0; }
|
||||
else if (h < 180) { r = 0; g = c; b = x; }
|
||||
else if (h < 240) { r = 0; g = x; b = c; }
|
||||
else if (h < 300) { r = x; g = 0; b = c; }
|
||||
else { r = c; g = 0; b = x; }
|
||||
unsigned int ri = (unsigned int)((r + m) * 255.0f);
|
||||
unsigned int gi = (unsigned int)((g + m) * 255.0f);
|
||||
unsigned int bi = (unsigned int)((b + m) * 255.0f);
|
||||
return 0xFF000000 | (ri << 16) | (gi << 8) | bi;
|
||||
}
|
||||
|
||||
unsigned int PlayerRenderer::getNametagColour(int index)
|
||||
{
|
||||
if( index >= 0 && index < MINECRAFT_NET_MAX_PLAYERS)
|
||||
{
|
||||
return s_nametagColors[index];
|
||||
}
|
||||
return 0xFF000000;
|
||||
|
||||
float hue = fmodf(index * 137.508f, 360.0f);
|
||||
float sat = 0.65f + (float)(index % 3) * 0.15f;
|
||||
float val = 0.75f + (float)(index % 4) * 0.08f;
|
||||
return HsvToArgb(hue, sat, val);
|
||||
}
|
||||
|
||||
int PlayerRenderer::prepareArmor(shared_ptr<LivingEntity> _player, int layer, float a)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
const int MINECRAFT_NET_MAX_PLAYERS = 8;
|
||||
@@ -131,8 +131,6 @@ typedef XUID GameSessionUID;
|
||||
|
||||
#ifndef _XBOX
|
||||
#include "extraX64.h"
|
||||
#else
|
||||
#include "..\Minecraft.Client\xbox\network\extra.h"
|
||||
#endif
|
||||
|
||||
#include "Definitions.h"
|
||||
|
||||
Reference in new issue
Block a user