21 Commits
Author SHA1 Message Date
ubergamer-pie 79e40e9233 merge upstream 2026-08-14 19:18:48 +00:00
pieeebot 9e3077c3bc LCEMP commit: world/server linux support, a ton of fixes, initial ded server support 2026-08-14 15:06:42 +03:00
pieeebot 494235878e LCEMP commit: multiple savefile fixes 2026-08-14 14:39:13 +03:00
pieeebot feeff55924 LCEMP Commit: add dedicated server check to sessioninfo 2026-08-14 13:42:38 +03:00
pieeebot f404e4b4e4 LCEMP commit: prepare code for dedicated server support 2026-08-14 13:32:11 +03:00
pieeebot 67a8111974 LCEMP commit: support more max players 2026-08-14 11:46:19 +03:00
pieeebot 6853eab85f update lcemp networking 2026-08-14 07:02:50 +03:00
ubergamer-pie 9498c3c675 merge upstream 2026-08-08 12:56:08 +00:00
qloak 125819419f Xbox 360 fixes (again...) (#29)
Merging main repo undid a lot of my changes so this PR reimplements them. Fixes build and playthrough. Has been tested.Reviewed-on: pieeebot/cafeberry#29

Co-authored-by: qloak <realminecart@gmail.com>
2026-08-08 12:23:28 +00:00
ubergamer-pie fb0f34358c merge upstream 2026-08-07 18:17:54 +00:00
qloak ebbd54288b Fix X360 Crossplay (#26)
^Reviewed-on: pieeebot/cafeberry#26

Co-authored-by: qloak <realminecart@gmail.com>
2026-08-07 17:14:12 +00:00
ubergamer-pie abfb9377e2 merge upstream 2026-08-05 20:10:12 +00:00
552eden 86c574bf7f fix ps3 spu build task 2026-08-05 23:09:41 +03:00
552eden 160f57c64e removed LARGE_WORLDS for now to get all consoles networking correctly. 2026-08-05 22:41:51 +03:00
552eden bb1962fe66 clean notes 2026-08-05 14:13:50 +03:00
552eden fccf648012 Finish fixing VITA networking. 2026-08-05 14:07:03 +03:00
552eden b5c3832e07 fix win64 crashes and enable LARGE_WORLDS 2026-08-05 12:27:03 +03:00
ubergamer-pie 1cb41e61c1 merge upstream 2026-08-04 22:50:57 +00:00
ubergamer-pie 73969c2c9c merge upstream 2026-08-04 22:18:05 +00:00
552eden f1b29767c2 fix lock crashes and enable full mode 2026-08-05 01:17:32 +03:00
552eden 43878b9103 fixed vita startup crash by guarding commerce calls 2026-08-05 00:39:26 +03:00
108 changed files with 2650 additions and 1673 deletions
+3
View File
@@ -0,0 +1,3 @@
[submodule "Minecraft.Server"]
path = Minecraft.Server
url = https://gitea.str1k3r.xyz/cafeberry/Cafeberry-Server.git
+4 -2
View File
@@ -402,6 +402,7 @@ void Chunk::rebuild()
} }
Tile *tile = Tile::tiles[tileId]; Tile *tile = Tile::tiles[tileId];
if (!tile) continue;
if (currentLayer == 0 && tile->isEntityTile()) if (currentLayer == 0 && tile->isEntityTile())
{ {
shared_ptr<TileEntity> et = region->getTileEntity(x, y, z); shared_ptr<TileEntity> et = region->getTileEntity(x, y, z);
@@ -739,9 +740,9 @@ void Chunk::rebuild_SPU()
{ {
// 4J - get tile from those copied into our local array in earlier optimisation // 4J - get tile from those copied into our local array in earlier optimisation
unsigned char tileId = pOutData->getTile(x,y,z); unsigned char tileId = pOutData->getTile(x,y,z);
if (tileId > 0) if (tileId > 0 && tileId != 0xff)
{ {
if (currentLayer == 0 && Tile::tiles[tileId]->isEntityTile()) if (currentLayer == 0 && Tile::tiles[tileId] && Tile::tiles[tileId]->isEntityTile())
{ {
shared_ptr<TileEntity> et = region.getTileEntity(x, y, z); shared_ptr<TileEntity> et = region.getTileEntity(x, y, z);
if (TileEntityRenderDispatcher::instance->hasRenderer(et)) if (TileEntityRenderDispatcher::instance->hasRenderer(et))
@@ -754,6 +755,7 @@ void Chunk::rebuild_SPU()
{ {
Tile *tile = Tile::tiles[tileId]; Tile *tile = Tile::tiles[tileId];
if (!tile) continue;
int renderLayer = tile->getRenderLayer(); int renderLayer = tile->getRenderLayer();
if (renderLayer != currentLayer) if (renderLayer != currentLayer)
+24 -38
View File
@@ -776,6 +776,7 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
player->yRotp = packet->yRot; player->yRotp = packet->yRot;
player->yHeadRot = packet->yHeadRot * 360 / 256.0f; player->yHeadRot = packet->yHeadRot * 360 / 256.0f;
player->setXuid(packet->xuid); player->setXuid(packet->xuid);
player->setOnlineXuid(packet->OnlineXuid);
#ifdef _DURANGO #ifdef _DURANGO
// On Durango request player display name from network manager // On Durango request player display name from network manager
@@ -788,11 +789,11 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
#if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE #if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE
{ {
PlayerUID pktXuid = player->getXuid(); PlayerUID netXuid = packet->OnlineXuid;
const PlayerUID WIN64_XUID_BASE = (PlayerUID)0xe000d45248242f2e; const PlayerUID WIN64_XUID_BASE = (PlayerUID)0xe000d45248242f2e;
if (pktXuid >= WIN64_XUID_BASE && pktXuid < WIN64_XUID_BASE + MINECRAFT_NET_MAX_PLAYERS) if (netXuid >= WIN64_XUID_BASE && netXuid < WIN64_XUID_BASE + MINECRAFT_NET_MAX_PLAYERS)
{ {
BYTE smallId = (BYTE)(pktXuid - WIN64_XUID_BASE); BYTE smallId = (BYTE)(netXuid - WIN64_XUID_BASE);
INetworkPlayer *np = g_NetworkManager.GetPlayerBySmallId(smallId); INetworkPlayer *np = g_NetworkManager.GetPlayerBySmallId(smallId);
if (np != NULL) if (np != NULL)
{ {
@@ -954,39 +955,6 @@ void ClientConnection::handleMoveEntitySmall(shared_ptr<MoveEntityPacketSmall> p
void ClientConnection::handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packet) void ClientConnection::handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packet)
{ {
#if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE
if (!g_NetworkManager.IsHost())
{
for (int i = 0; i < packet->ids.length; i++)
{
shared_ptr<Entity> entity = getEntity(packet->ids[i]);
if (entity != NULL && entity->GetType() == eTYPE_PLAYER)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(entity);
if (player != NULL)
{
PlayerUID xuid = player->getXuid();
INetworkPlayer *np = g_NetworkManager.GetPlayerByXuid(xuid);
if (np != NULL)
{
NetworkPlayerXbox *npx = (NetworkPlayerXbox *)np;
IQNetPlayer *qp = npx->GetQNetPlayer();
if (qp != NULL)
{
extern CPlatformNetworkManagerStub *g_pPlatformNetworkManager;
g_pPlatformNetworkManager->NotifyPlayerLeaving(qp);
qp->m_smallId = 0;
qp->m_isRemote = false;
qp->m_isHostPlayer = false;
qp->m_gamertag[0] = 0;
qp->SetCustomDataValue(0);
}
}
}
}
}
}
#endif
for (int i = 0; i < packet->ids.length; i++) for (int i = 0; i < packet->ids.length; i++)
{ {
level->removeEntity(packet->ids[i]); level->removeEntity(packet->ids[i]);
@@ -1068,6 +1036,7 @@ void ClientConnection::handleChunkVisibility(shared_ptr<ChunkVisibilityPacket> p
void ClientConnection::handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket> packet) void ClientConnection::handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket> packet)
{ {
// 4J - changed to encode level in packet // 4J - changed to encode level in packet
if (packet->levelIdx >= minecraft->levels.length) return;
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx]; MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
if( dimensionLevel ) if( dimensionLevel )
{ {
@@ -1137,6 +1106,7 @@ void ClientConnection::handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket>
void ClientConnection::handleBlockRegionUpdate(shared_ptr<BlockRegionUpdatePacket> packet) void ClientConnection::handleBlockRegionUpdate(shared_ptr<BlockRegionUpdatePacket> packet)
{ {
// 4J - changed to encode level in packet // 4J - changed to encode level in packet
if (packet->levelIdx >= minecraft->levels.length) return;
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx]; MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
if( dimensionLevel ) if( dimensionLevel )
{ {
@@ -1194,6 +1164,8 @@ void ClientConnection::handleTileUpdate(shared_ptr<TileUpdatePacket> packet)
destroyTilePacket = true; destroyTilePacket = true;
} }
// 4J - changed to encode level in packet // 4J - changed to encode level in packet
if (packet->levelIdx >= minecraft->levels.length) return;
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx]; MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
if( dimensionLevel ) if( dimensionLevel )
{ {
@@ -1856,6 +1828,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
} }
#ifdef _XBOX #ifdef _XBOX
#if !defined(_DISABLE_XBLIVE)
if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends)) if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends))
{ {
if(m_userIndex == ProfileManager.GetPrimaryPad() ) if(m_userIndex == ProfileManager.GetPrimaryPad() )
@@ -1999,6 +1972,16 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
} }
} }
} }
#else
// Offline/system-link games have no Xbox Live friend list, so grant all
// pre-login permissions (the Xbox Live-only checks above would otherwise
// fail and reject the client's own pre-login before Login is ever sent).
canPlay = TRUE;
canPlayLocal = TRUE;
isAtLeastOneFriend = TRUE;
isFriendsWithHost = TRUE;
cantPlayContentRestricted = FALSE;
#endif // _DISABLE_XBLIVE
#else #else
// TODO - handle this kind of things for non-360 platforms // TODO - handle this kind of things for non-360 platforms
canPlay = TRUE; canPlay = TRUE;
@@ -2339,6 +2322,7 @@ void ClientConnection::handleAddMob(shared_ptr<AddMobPacket> packet)
float xRot = packet->xRot * 360 / 256.0f; float xRot = packet->xRot * 360 / 256.0f;
shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(EntityIO::newById(packet->type, level)); shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(EntityIO::newById(packet->type, level));
if (mob == NULL) return;
mob->xp = packet->x; mob->xp = packet->x;
mob->yp = packet->y; mob->yp = packet->y;
mob->zp = packet->z; mob->zp = packet->z;
@@ -3582,10 +3566,12 @@ void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> custo
} }
#else #else
UIScene *scene = ui.GetTopScene(m_userIndex, eUILayer_Scene); UIScene *scene = ui.GetTopScene(m_userIndex, eUILayer_Scene);
UIScene_TradingMenu *screen = (UIScene_TradingMenu *)scene; UIScene_TradingMenu *screen = dynamic_cast<UIScene_TradingMenu *>(scene);
trader = screen->getMerchant(); if (screen != NULL)
trader = screen->getMerchant();
#endif #endif
if (trader == NULL) return;
MerchantRecipeList *recipeList = MerchantRecipeList::createFromStream(&input); MerchantRecipeList *recipeList = MerchantRecipeList::createFromStream(&input);
trader->overrideOffers(recipeList); trader->overrideOffers(recipeList);
} }
+29
View File
@@ -1,5 +1,7 @@
 
#include "stdafx.h" #include "stdafx.h"
#include <time.h>
#include "..\..\Minecraft.World\net.minecraft.world.entity.item.h" #include "..\..\Minecraft.World\net.minecraft.world.entity.item.h"
#include "..\..\Minecraft.World\net.minecraft.world.entity.player.h" #include "..\..\Minecraft.World\net.minecraft.world.entity.player.h"
#include "..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h" #include "..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
@@ -236,6 +238,26 @@ void CMinecraftApp::DebugPrintf(const char *szFormat, ...)
vsnprintf(buf, sizeof(buf), szFormat, ap); vsnprintf(buf, sizeof(buf), szFormat, ap);
va_end(ap); va_end(ap);
OutputDebugStringA(buf); OutputDebugStringA(buf);
#ifdef _DEDICATED_SERVER
bool hasContent = false;
for (const char *p = buf; *p; p++) {
if (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\r' && *p != '=') {
hasContent = true;
break;
}
}
if (hasContent)
{
size_t len = strlen(buf);
while (len > 0 && (buf[len-1] == '\n' || buf[len-1] == '\r'))
buf[--len] = '\0';
time_t now = time(NULL);
struct tm t;
localtime_s(&t, &now);
printf("[%02d:%02d:%02d] [Server thread/INFO]: %s\n", t.tm_hour, t.tm_min, t.tm_sec, buf);
}
#endif
#endif #endif
} }
@@ -298,6 +320,9 @@ LPCWSTR CMinecraftApp::GetString(int iID)
{ {
//return L"Değişiklikler ve Yenilikler"; //return L"Değişiklikler ve Yenilikler";
//return L"ÕÕÕÕÖÖÖÖ"; //return L"ÕÕÕÕÖÖÖÖ";
#ifdef _DEDICATED_SERVER
if (!app.m_stringTable) return L"";
#endif
return app.m_stringTable->getString(iID); return app.m_stringTable->getString(iID);
} }
@@ -4889,11 +4914,13 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
// 4J Stu - On PS4 we can also cause to exit players if they are signed out here, but we shouldn't do that if // 4J Stu - On PS4 we can also cause to exit players if they are signed out here, but we shouldn't do that if
// we are going to switch to an offline game as it will likely crash due to incompatible parallel processes // we are going to switch to an offline game as it will likely crash due to incompatible parallel processes
bool switchToOffline = false; bool switchToOffline = false;
#ifndef _DISABLE_XBLIVE
// If it's an online game, and the primary profile is no longer signed into LIVE then we act as if disconnected // If it's an online game, and the primary profile is no longer signed into LIVE then we act as if disconnected
if( !ProfileManager.IsSignedInLive( ProfileManager.GetLockedProfile() ) && !g_NetworkManager.IsLocalGame() ) if( !ProfileManager.IsSignedInLive( ProfileManager.GetLockedProfile() ) && !g_NetworkManager.IsLocalGame() )
{ {
switchToOffline = true; switchToOffline = true;
} }
#endif
//printf("Old: %x, New: %x, Changed: %x\n", m_ulLastSignInData, ulSignInData, changedPlayers); //printf("Old: %x, New: %x, Changed: %x\n", m_ulLastSignInData, ulSignInData, changedPlayers);
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
@@ -4958,6 +4985,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
g_NetworkManager.HandleSignInChange(); g_NetworkManager.HandleSignInChange();
} }
#ifndef _DISABLE_XBLIVE
// Some menus require the player to be signed in to live, so if this callback happens and the primary player is // Some menus require the player to be signed in to live, so if this callback happens and the primary player is
// no longer signed in then nav back // no longer signed in then nav back
else if ( pApp->GetLiveLinkRequired() && !ProfileManager.IsSignedInLive( ProfileManager.GetLockedProfile() ) ) else if ( pApp->GetLiveLinkRequired() && !ProfileManager.IsSignedInLive( ProfileManager.GetLockedProfile() ) )
@@ -4969,6 +4997,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
pApp->SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected); pApp->SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
} }
} }
#endif
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ ) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ )
// 4J-JEV: Need to kick of loading of profile data for sub-sign in players. // 4J-JEV: Need to kick of loading of profile data for sub-sign in players.
@@ -1,7 +1,7 @@
/* /*
base64.cpp and base64.h base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
@@ -21,7 +21,7 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/ */
@@ -41,7 +41,7 @@ static inline bool is_base64(unsigned char c) {
} }
// 4J ADDED, // 4J ADDED,
std::string base64_encode(std::string str) std::string base64_encode(const std::string& str)
{ {
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() ); return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
} }
@@ -2,6 +2,6 @@
#include <string> #include <string>
std::string base64_encode(std::string str); std::string base64_encode(const std::string& str);
std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s); std::string base64_decode(std::string const& s);
@@ -100,12 +100,14 @@ void CGameNetworkManager::DoWork()
{ {
case XN_LIVE_LINK_STATE_CHANGED: case XN_LIVE_LINK_STATE_CHANGED:
{ {
#ifndef _DISABLE_XBLIVE
int iPrimaryPlayer = g_NetworkManager.GetPrimaryPad(); int iPrimaryPlayer = g_NetworkManager.GetPrimaryPad();
bool bConnected = (pNotification->uiParam!=0)?true:false; bool bConnected = (pNotification->uiParam!=0)?true:false;
if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && bConnected == false && g_NetworkManager.IsInSession() ) if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && bConnected == false && g_NetworkManager.IsInSession() )
{ {
app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected); app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
} }
#endif
} }
break; break;
case XN_LIVE_INVITE_ACCEPTED: case XN_LIVE_INVITE_ACCEPTED:
@@ -782,7 +784,11 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
app.DebugPrintf("JoinFromInvite_SignInReturned, iPad %d\n",iPad); app.DebugPrintf("JoinFromInvite_SignInReturned, iPad %d\n",iPad);
// It's possible that the player has not signed in - they can back out // It's possible that the player has not signed in - they can back out
#ifndef _DISABLE_XBLIVE
if(ProfileManager.IsSignedIn(iPad) && ProfileManager.IsSignedInLive(iPad) ) if(ProfileManager.IsSignedIn(iPad) && ProfileManager.IsSignedInLive(iPad) )
#else
if(ProfileManager.IsSignedIn(iPad))
#endif
{ {
app.DebugPrintf("JoinFromInvite_SignInReturned, passed sign-in tests\n"); app.DebugPrintf("JoinFromInvite_SignInReturned, passed sign-in tests\n");
int localUsersMask = 0; int localUsersMask = 0;
@@ -794,7 +800,9 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
if(ProfileManager.IsSignedIn(index) ) if(ProfileManager.IsSignedIn(index) )
{ {
++joiningUsers; ++joiningUsers;
#ifndef _DISABLE_XBLIVE
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true; if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
#endif
localUsersMask |= GetLocalPlayerMask( index ); localUsersMask |= GetLocalPlayerMask( index );
} }
} }
@@ -865,12 +873,14 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
void CGameNetworkManager::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving) void CGameNetworkManager::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving)
{ {
#ifndef _DEDICATED_SERVER
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
TexturePack *tPack = pMinecraft->skins->getSelected(); TexturePack *tPack = pMinecraft->skins->getSelected();
s_pPlatformNetworkManager->SetSessionTexturePackParentId( tPack->getDLCParentPackId() ); s_pPlatformNetworkManager->SetSessionTexturePackParentId( tPack->getDLCParentPackId() );
s_pPlatformNetworkManager->SetSessionSubTexturePackId( tPack->getDLCSubPackId() ); s_pPlatformNetworkManager->SetSessionSubTexturePackId( tPack->getDLCSubPackId() );
s_pPlatformNetworkManager->UpdateAndSetGameSessionData( pNetworkPlayerLeaving ); s_pPlatformNetworkManager->UpdateAndSetGameSessionData( pNetworkPlayerLeaving );
#endif
} }
void CGameNetworkManager::SendInviteGUI(int quadrant) void CGameNetworkManager::SendInviteGUI(int quadrant)
@@ -890,6 +900,12 @@ bool CGameNetworkManager::IsNetworkThreadRunning()
int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter ) int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
{ {
if( g_NetworkManager.m_bNetworkThreadRunning )
{
return -1;
}
g_NetworkManager.m_bNetworkThreadRunning = true;
// Share AABB & Vec3 pools with default (main thread) - should be ok as long as we don't tick the main thread whilst this thread is running // Share AABB & Vec3 pools with default (main thread) - should be ok as long as we don't tick the main thread whilst this thread is running
AABB::UseDefaultThreadStorage(); AABB::UseDefaultThreadStorage();
Vec3::UseDefaultThreadStorage(); Vec3::UseDefaultThreadStorage();
@@ -897,7 +913,6 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
Tile::CreateNewThreadStorage(); Tile::CreateNewThreadStorage();
IntCache::CreateNewThreadStorage(); IntCache::CreateNewThreadStorage();
g_NetworkManager.m_bNetworkThreadRunning = true;
bool success = g_NetworkManager._RunNetworkGame(lpParameter); bool success = g_NetworkManager._RunNetworkGame(lpParameter);
g_NetworkManager.m_bNetworkThreadRunning = false; g_NetworkManager.m_bNetworkThreadRunning = false;
if( !success) if( !success)
@@ -905,7 +920,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) ) while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) )
{ {
Sleep(1); Sleep(0);
} }
ui.CleanUpSkinReload(); ui.CleanUpSkinReload();
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None) if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
@@ -942,7 +957,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
{ {
while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin())) while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()))
{ {
Sleep(1); Sleep(0);
} }
param->levelGen->loadBaseSaveData(); param->levelGen->loadBaseSaveData();
} }
@@ -984,7 +999,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
while( g_NetworkManager.IsInSession() ) while( g_NetworkManager.IsInSession() )
{ {
Sleep(1); Sleep(0);
} }
// Xbox should always be online when receiving invites - on PS3 we need to check & ask the user to sign in // Xbox should always be online when receiving invites - on PS3 we need to check & ask the user to sign in
@@ -1260,7 +1275,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
// wait for the current session to end // wait for the current session to end
while( g_NetworkManager.IsInSession() ) while( g_NetworkManager.IsInSession() )
{ {
Sleep(1); Sleep(0);
} }
// Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same // Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same
@@ -1527,6 +1542,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
// Add this user to the game server if the game is started already // Add this user to the game server if the game is started already
if( g_NetworkManager.IsHost() && g_NetworkManager.IsInGameplay() ) if( g_NetworkManager.IsHost() && g_NetworkManager.IsInGameplay() )
{ {
app.DebugPrintf("Adding incoming socket for smallId=%d\n", pNetworkPlayer->GetSmallId());
Socket::addIncomingSocket(socket); Socket::addIncomingSocket(socket);
} }
@@ -1665,6 +1681,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
{ {
if (ProfileManager.IsSignedIn(i) && (i == ProfileManager.GetPrimaryPad() || isLocalMultiplayerAvailable)) if (ProfileManager.IsSignedIn(i) && (i == ProfileManager.GetPrimaryPad() || isLocalMultiplayerAvailable))
{ {
#ifndef _DISABLE_XBLIVE
if (isSignedInLive && !ProfileManager.IsSignedInLive(i)) if (isSignedInLive && !ProfileManager.IsSignedInLive(i))
{ {
// Record the first non signed in live pad // Record the first non signed in live pad
@@ -1672,6 +1689,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
} }
isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(i); isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(i);
#else
isSignedInLive = true;
#endif
} }
} }
@@ -1743,7 +1763,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
if(index==userIndex || pMinecraft->localplayers[index]!=NULL ) if(index==userIndex || pMinecraft->localplayers[index]!=NULL )
{ {
++joiningUsers; ++joiningUsers;
#ifndef _DISABLE_XBLIVE
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true; if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
#endif
localUsersMask |= GetLocalPlayerMask( index ); localUsersMask |= GetLocalPlayerMask( index );
} }
} }
@@ -1898,6 +1920,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
if(!app.IsLocalMultiplayerAvailable()) if(!app.IsLocalMultiplayerAvailable())
#endif #endif
{ {
#ifndef _DISABLE_XBLIVE
bool noPrivileges=!ProfileManager.AllowedToPlayMultiplayer(userIndex); bool noPrivileges=!ProfileManager.AllowedToPlayMultiplayer(userIndex);
if(noPrivileges) if(noPrivileges)
@@ -1908,6 +1931,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
} }
else else
{ {
#endif
ProfileManager.SetLockedProfile(userIndex); ProfileManager.SetLockedProfile(userIndex);
ProfileManager.SetPrimaryPad(userIndex); ProfileManager.SetPrimaryPad(userIndex);
@@ -1930,7 +1954,9 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
{ {
app.DebugPrintf( "Failed joining game from invite\n" ); app.DebugPrintf( "Failed joining game from invite\n" );
} }
#ifndef _DISABLE_XBLIVE
} }
#endif
} }
else else
{ {
@@ -1,4 +1,4 @@
#include "stdafx.h" #include "stdafx.h"
#include "NetworkSocketLayer.h" #include "NetworkSocketLayer.h"
#include "..\..\Common\Network\PlatformNetworkManager.h" #include "..\..\Common\Network\PlatformNetworkManager.h"
@@ -39,7 +39,7 @@ BYTE NetworkSocketLayer::s_nextSmallId = 1;
CRITICAL_SECTION NetworkSocketLayer::s_sendLock; CRITICAL_SECTION NetworkSocketLayer::s_sendLock;
CRITICAL_SECTION NetworkSocketLayer::s_connectionsLock; CRITICAL_SECTION NetworkSocketLayer::s_connectionsLock;
std::vector<RemoteConnection> NetworkSocketLayer::s_connections; RemoteConnection NetworkSocketLayer::s_connections[NETWORK_LAN_MAX_CLIENTS + 1];
C4JThread* NetworkSocketLayer::s_advertiseThread = NULL; C4JThread* NetworkSocketLayer::s_advertiseThread = NULL;
volatile bool NetworkSocketLayer::s_advertising = false; volatile bool NetworkSocketLayer::s_advertising = false;
@@ -55,9 +55,15 @@ std::vector<LANSession> NetworkSocketLayer::s_discoveredSessions;
CRITICAL_SECTION NetworkSocketLayer::s_disconnectLock; CRITICAL_SECTION NetworkSocketLayer::s_disconnectLock;
std::vector<BYTE> NetworkSocketLayer::s_disconnectedSmallIds; std::vector<BYTE> NetworkSocketLayer::s_disconnectedSmallIds;
CRITICAL_SECTION NetworkSocketLayer::s_pendingJoinLock;
std::vector<BYTE> NetworkSocketLayer::s_pendingJoinSmallIds;
CRITICAL_SECTION NetworkSocketLayer::s_freeSmallIdLock; CRITICAL_SECTION NetworkSocketLayer::s_freeSmallIdLock;
std::vector<BYTE> NetworkSocketLayer::s_freeSmallIds; std::vector<BYTE> NetworkSocketLayer::s_freeSmallIds;
CRITICAL_SECTION NetworkSocketLayer::s_earlyDataLock;
std::vector<BYTE> NetworkSocketLayer::s_earlyDataBuffers[NETWORK_LAN_MAX_CLIENTS + 1];
// only goes true on a successful Initialize(), and a failed one gets retried // only goes true on a successful Initialize(), and a failed one gets retried
static bool s_locksCreated = false; static bool s_locksCreated = false;
#if defined _WINDOWS64 #if defined _WINDOWS64
@@ -83,7 +89,18 @@ bool NetworkSocketLayer::Initialize()
InitializeCriticalSection(&s_advertiseLock); InitializeCriticalSection(&s_advertiseLock);
InitializeCriticalSection(&s_discoveryLock); InitializeCriticalSection(&s_discoveryLock);
InitializeCriticalSection(&s_disconnectLock); InitializeCriticalSection(&s_disconnectLock);
InitializeCriticalSection(&s_pendingJoinLock);
InitializeCriticalSection(&s_freeSmallIdLock); InitializeCriticalSection(&s_freeSmallIdLock);
InitializeCriticalSection(&s_earlyDataLock);
for (int i = 0; i < NETWORK_LAN_MAX_CLIENTS + 1; i++)
{
s_connections[i].tcpSocket = INVALID_SOCKET;
s_connections[i].smallId = 0;
s_connections[i].recvThread = NULL;
s_connections[i].active = false;
InitializeCriticalSection(&s_connections[i].sendLock);
}
s_locksCreated = true; s_locksCreated = true;
} }
@@ -126,7 +143,9 @@ bool NetworkSocketLayer::Initialize()
s_initialized = true; s_initialized = true;
#ifndef _DEDICATED_SERVER
StartDiscovery(); StartDiscovery();
#endif
return true; return true;
} }
@@ -167,7 +186,7 @@ void NetworkSocketLayer::Shutdown()
EnterCriticalSection(&s_connectionsLock); EnterCriticalSection(&s_connectionsLock);
for (size_t i = 0; i < s_connections.size(); i++) for (int i = 0; i < NETWORK_LAN_MAX_CLIENTS + 1; i++)
{ {
s_connections[i].active = false; s_connections[i].active = false;
#if defined _WINDOWS64 || defined _XBOX #if defined _WINDOWS64 || defined _XBOX
@@ -177,9 +196,16 @@ void NetworkSocketLayer::Shutdown()
#endif #endif
{ {
closesocket(s_connections[i].tcpSocket); closesocket(s_connections[i].tcpSocket);
s_connections[i].tcpSocket = INVALID_SOCKET;
} }
if (s_connections[i].recvThread != NULL)
{
s_connections[i].recvThread->WaitForCompletion(2000);
delete s_connections[i].recvThread;
s_connections[i].recvThread = NULL;
}
DeleteCriticalSection(&s_connections[i].sendLock);
} }
s_connections.clear();
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
if (s_acceptThread != NULL) if (s_acceptThread != NULL)
@@ -204,6 +230,8 @@ void NetworkSocketLayer::Shutdown()
DeleteCriticalSection(&s_discoveryLock); DeleteCriticalSection(&s_discoveryLock);
DeleteCriticalSection(&s_disconnectLock); DeleteCriticalSection(&s_disconnectLock);
s_disconnectedSmallIds.clear(); s_disconnectedSmallIds.clear();
DeleteCriticalSection(&s_pendingJoinLock);
s_pendingJoinSmallIds.clear();
DeleteCriticalSection(&s_freeSmallIdLock); DeleteCriticalSection(&s_freeSmallIdLock);
s_freeSmallIds.clear(); s_freeSmallIds.clear();
s_locksCreated = false; s_locksCreated = false;
@@ -219,6 +247,14 @@ bool NetworkSocketLayer::HostGame(int port)
s_isHost = true; s_isHost = true;
s_localSmallId = 0; s_localSmallId = 0;
s_hostSmallId = 0; s_hostSmallId = 0;
s_connected = false;
s_active = false;
if (s_hostConnectionSocket != INVALID_SOCKET)
{
closesocket(s_hostConnectionSocket);
s_hostConnectionSocket = INVALID_SOCKET;
}
s_nextSmallId = 1; s_nextSmallId = 1;
s_hostGamePort = port; s_hostGamePort = port;
@@ -486,31 +522,41 @@ bool NetworkSocketLayer::JoinGame(const char *ip, int port)
s_hostConnectionSocket = INVALID_SOCKET; s_hostConnectionSocket = INVALID_SOCKET;
} }
XNDNS *pDns = NULL; int iResult = 0;
int iResult = XNetDnsLookup(ip, NULL, &pDns);
if (iResult != 0 || pDns == NULL)
{
app.DebugPrintf("XNetDnsLookup failed for %s - %d\n", ip, iResult);
return false;
}
while (pDns->iStatus == WSAEINPROGRESS)
{
Sleep(10);
}
if (pDns->iStatus != 0 || pDns->cina == 0)
{
app.DebugPrintf("pDns->iStatus failed for %s - %d\n", ip, iResult);
XNetDnsRelease(pDns);
return false;
}
struct sockaddr_in addr = {}; struct sockaddr_in addr = {};
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_port = htons((WORD)port); addr.sin_port = htons((WORD)port);
addr.sin_addr = pDns->aina[0];
XNetDnsRelease(pDns); unsigned long ipAddr = inet_addr(ip);
if (ipAddr != INADDR_NONE)
{
addr.sin_addr.s_addr = ipAddr;
}
else
{
XNDNS *pDns = NULL;
iResult = XNetDnsLookup(ip, NULL, &pDns);
if (iResult != 0 || pDns == NULL)
{
app.DebugPrintf("XNetDnsLookup failed for %s - %d\n", ip, iResult);
return false;
}
while (pDns->iStatus == WSAEINPROGRESS)
{
Sleep(10);
}
if (pDns->iStatus != 0 || pDns->cina == 0)
{
app.DebugPrintf("pDns->iStatus failed for %s - %d\n", ip, iResult);
XNetDnsRelease(pDns);
return false;
}
addr.sin_addr = pDns->aina[0];
XNetDnsRelease(pDns);
}
bool connected = false; bool connected = false;
BYTE assignedSmallId = 0; BYTE assignedSmallId = 0;
@@ -761,6 +807,9 @@ bool NetworkSocketLayer::JoinGame(const char *ip, int port)
} }
s_localSmallId = assignedSmallId; s_localSmallId = assignedSmallId;
DWORD noTimeout = 0;
setsockopt(s_hostConnectionSocket, SOL_SOCKET, SO_RCVTIMEO, (const char *)&noTimeout, sizeof(noTimeout));
app.DebugPrintf("LAN: Connected to %s:%d, assigned smallId=%d\n", ip, port, s_localSmallId); app.DebugPrintf("LAN: Connected to %s:%d, assigned smallId=%d\n", ip, port, s_localSmallId);
s_active = true; s_active = true;
@@ -776,9 +825,9 @@ bool NetworkSocketLayer::JoinGame(const char *ip, int port)
bool NetworkSocketLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize) bool NetworkSocketLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize)
{ {
#if defined _WINDOWS64 || defined _XBOX #if defined _WINDOWS64 || defined _XBOX
if (sock == INVALID_SOCKET || dataSize <= 0) return false; if (sock == INVALID_SOCKET || dataSize <= 0 || dataSize > NETWORK_LAN_MAX_PACKET_SIZE) return false;
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ #elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
if (sock < 0 || dataSize <= 0) return false; if (sock < 0 || dataSize <= 0 || dataSize > NETWORK_LAN_MAX_PACKET_SIZE) return false;
#endif #endif
EnterCriticalSection(&s_sendLock); EnterCriticalSection(&s_sendLock);
@@ -799,10 +848,7 @@ bool NetworkSocketLayer::SendOnSocket(SOCKET sock, const void *data, int dataSiz
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ #elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
if (sent < 0 || sent == 0) if (sent < 0 || sent == 0)
#endif #endif
{
LeaveCriticalSection(&s_sendLock);
return false; return false;
}
totalSent += sent; totalSent += sent;
} }
@@ -816,14 +862,10 @@ bool NetworkSocketLayer::SendOnSocket(SOCKET sock, const void *data, int dataSiz
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ #elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
if (sent < 0 || sent == 0) if (sent < 0 || sent == 0)
#endif #endif
{
LeaveCriticalSection(&s_sendLock);
return false; return false;
}
totalSent += sent; totalSent += sent;
} }
LeaveCriticalSection(&s_sendLock);
return true; return true;
} }
@@ -833,31 +875,38 @@ bool NetworkSocketLayer::SendToSmallId(BYTE targetSmallId, const void *data, int
if (s_isHost) if (s_isHost)
{ {
SOCKET sock = GetSocketForSmallId(targetSmallId); EnterCriticalSection(&s_connectionsLock);
#if defined _WINDOWS64 || defined _XBOX if (targetSmallId >= NETWORK_LAN_MAX_CLIENTS + 1 || !s_connections[targetSmallId].active)
if (sock == INVALID_SOCKET) return false; {
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ LeaveCriticalSection(&s_connectionsLock);
if (sock < 0) return false; return false;
#endif }
return SendOnSocket(sock, data, dataSize); SOCKET sock = s_connections[targetSmallId].tcpSocket;
CRITICAL_SECTION *pLock = &s_connections[targetSmallId].sendLock;
LeaveCriticalSection(&s_connectionsLock);
EnterCriticalSection(pLock);
bool result = SendOnSocket(sock, data, dataSize);
LeaveCriticalSection(pLock);
return result;
} }
else else
{ {
return SendOnSocket(s_hostConnectionSocket, data, dataSize); EnterCriticalSection(&s_sendLock);
bool result = SendOnSocket(s_hostConnectionSocket, data, dataSize);
LeaveCriticalSection(&s_sendLock);
return result;
} }
} }
SOCKET NetworkSocketLayer::GetSocketForSmallId(BYTE smallId) SOCKET NetworkSocketLayer::GetSocketForSmallId(BYTE smallId)
{ {
EnterCriticalSection(&s_connectionsLock); EnterCriticalSection(&s_connectionsLock);
for (size_t i = 0; i < s_connections.size(); i++) if (smallId < NETWORK_LAN_MAX_CLIENTS + 1 && s_connections[smallId].active)
{ {
if (s_connections[i].smallId == smallId && s_connections[i].active) SOCKET sock = s_connections[smallId].tcpSocket;
{ LeaveCriticalSection(&s_connectionsLock);
SOCKET sock = s_connections[i].tcpSocket; return sock;
LeaveCriticalSection(&s_connectionsLock);
return sock;
}
} }
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
#if defined _WINDOWS64 || defined _XBOX #if defined _WINDOWS64 || defined _XBOX
@@ -886,9 +935,13 @@ void NetworkSocketLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, un
if (pPlayerFrom == NULL || pPlayerTo == NULL) if (pPlayerFrom == NULL || pPlayerTo == NULL)
{ {
// dropping here is silent and looks identical to the peer never sending if (s_isHost && fromSmallId > 0 && fromSmallId < NETWORK_LAN_MAX_CLIENTS + 1)
app.DebugPrintf("LAN: DROPPED %u bytes - from smallId=%d(%s) to smallId=%d(%s)\n", {
dataSize, fromSmallId, pPlayerFrom ? "ok" : "NULL", toSmallId, pPlayerTo ? "ok" : "NULL"); EnterCriticalSection(&s_earlyDataLock);
s_earlyDataBuffers[fromSmallId].insert(
s_earlyDataBuffers[fromSmallId].end(), data, data + dataSize);
LeaveCriticalSection(&s_earlyDataLock);
}
return; return;
} }
@@ -897,6 +950,13 @@ void NetworkSocketLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, un
::Socket *pSocket = pPlayerFrom->GetSocket(); ::Socket *pSocket = pPlayerFrom->GetSocket();
if (pSocket != NULL) if (pSocket != NULL)
pSocket->pushDataToQueue(data, dataSize, false); pSocket->pushDataToQueue(data, dataSize, false);
else
{
EnterCriticalSection(&s_earlyDataLock);
s_earlyDataBuffers[fromSmallId].insert(
s_earlyDataBuffers[fromSmallId].end(), data, data + dataSize);
LeaveCriticalSection(&s_earlyDataLock);
}
} }
else else
{ {
@@ -906,6 +966,26 @@ void NetworkSocketLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, un
} }
} }
void NetworkSocketLayer::FlushPendingData()
{
EnterCriticalSection(&s_earlyDataLock);
for (int i = 1; i < NETWORK_LAN_MAX_CLIENTS + 1; i++)
{
if (s_earlyDataBuffers[i].empty()) continue;
INetworkPlayer *pPlayer = g_NetworkManager.GetPlayerBySmallId((BYTE)i);
if (pPlayer == NULL) continue;
::Socket *pSocket = pPlayer->GetSocket();
if (pSocket == NULL) continue;
pSocket->pushDataToQueue(s_earlyDataBuffers[i].data(),
(DWORD)s_earlyDataBuffers[i].size(), false);
s_earlyDataBuffers[i].clear();
}
LeaveCriticalSection(&s_earlyDataLock);
}
int NetworkSocketLayer::AcceptThreadProc(LPVOID param) int NetworkSocketLayer::AcceptThreadProc(LPVOID param)
{ {
while (s_active) while (s_active)
@@ -935,7 +1015,7 @@ int NetworkSocketLayer::AcceptThreadProc(LPVOID param)
setsockopt(clientSocket, IPPROTO_TCP, TCP_NODELAY, (const char *)&noDelay, sizeof(noDelay)); setsockopt(clientSocket, IPPROTO_TCP, TCP_NODELAY, (const char *)&noDelay, sizeof(noDelay));
extern QNET_STATE _iQNetStubState; extern QNET_STATE _iQNetStubState;
if (_iQNetStubState != QNET_STATE_GAME_PLAY) if (_iQNetStubState != QNET_STATE_GAME_PLAY && _iQNetStubState != QNET_STATE_SESSION_STARTING)
{ {
app.DebugPrintf("Win64 LAN: Rejecting connection, game not ready\n"); app.DebugPrintf("Win64 LAN: Rejecting connection, game not ready\n");
closesocket(clientSocket); closesocket(clientSocket);
@@ -971,15 +1051,19 @@ int NetworkSocketLayer::AcceptThreadProc(LPVOID param)
continue; continue;
} }
RemoteConnection conn; RemoteConnection &conn = s_connections[assignedSmallId];
EnterCriticalSection(&s_connectionsLock);
if (conn.recvThread != NULL)
{
conn.recvThread->WaitForCompletion(2000);
delete conn.recvThread;
conn.recvThread = NULL;
}
conn.tcpSocket = clientSocket; conn.tcpSocket = clientSocket;
conn.smallId = assignedSmallId; conn.smallId = assignedSmallId;
conn.active = true; conn.active = true;
conn.recvThread = NULL;
EnterCriticalSection(&s_connectionsLock);
s_connections.push_back(conn);
int connIdx = (int)s_connections.size() - 1;
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
app.DebugPrintf("Win64 LAN: Client connected, assigned smallId=%d\n", assignedSmallId); app.DebugPrintf("Win64 LAN: Client connected, assigned smallId=%d\n", assignedSmallId);
@@ -989,17 +1073,17 @@ int NetworkSocketLayer::AcceptThreadProc(LPVOID param)
extern void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost, bool isLocal); extern void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost, bool isLocal);
Win64_SetupRemoteQNetPlayer(qnetPlayer, assignedSmallId, false, false); Win64_SetupRemoteQNetPlayer(qnetPlayer, assignedSmallId, false, false);
extern CPlatformNetworkManagerStub *g_pPlatformNetworkManager; EnterCriticalSection(&s_pendingJoinLock);
g_pPlatformNetworkManager->NotifyPlayerJoined(qnetPlayer); s_pendingJoinSmallIds.push_back(assignedSmallId);
LeaveCriticalSection(&s_pendingJoinLock);
DWORD *threadParam = new DWORD; DWORD *threadParam = new DWORD;
*threadParam = connIdx; *threadParam = assignedSmallId;
C4JThread* hThread = new C4JThread(RecvThreadProc, threadParam, "RecvThreadProc"); C4JThread* hThread = new C4JThread(RecvThreadProc, threadParam, "RecvThreadProc");
hThread->Run(); hThread->Run();
EnterCriticalSection(&s_connectionsLock); EnterCriticalSection(&s_connectionsLock);
if (connIdx < (int)s_connections.size()) s_connections[assignedSmallId].recvThread = hThread;
s_connections[connIdx].recvThread = hThread;
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
} }
return 0; return 0;
@@ -1007,17 +1091,16 @@ int NetworkSocketLayer::AcceptThreadProc(LPVOID param)
int NetworkSocketLayer::RecvThreadProc(LPVOID param) int NetworkSocketLayer::RecvThreadProc(LPVOID param)
{ {
DWORD connIdx = *(DWORD *)param; BYTE clientSmallId = (BYTE)*(DWORD *)param;
delete (DWORD *)param; delete (DWORD *)param;
EnterCriticalSection(&s_connectionsLock); EnterCriticalSection(&s_connectionsLock);
if (connIdx >= (DWORD)s_connections.size()) if (clientSmallId >= NETWORK_LAN_MAX_CLIENTS + 1 || !s_connections[clientSmallId].active)
{ {
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
return 0; return 0;
} }
SOCKET sock = s_connections[connIdx].tcpSocket; SOCKET sock = s_connections[clientSmallId].tcpSocket;
BYTE clientSmallId = s_connections[connIdx].smallId;
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
std::vector<BYTE> recvBuf; std::vector<BYTE> recvBuf;
@@ -1038,7 +1121,7 @@ int NetworkSocketLayer::RecvThreadProc(LPVOID param)
((uint32_t)header[2] << 8) | ((uint32_t)header[2] << 8) |
((uint32_t)header[3]); ((uint32_t)header[3]);
if (packetSize <= 0 || packetSize > NETWORK_LAN_MAX_PACKET_SIZE) if (packetSize <= 0 || (unsigned int)packetSize > NETWORK_LAN_MAX_PACKET_SIZE)
{ {
app.DebugPrintf("LAN: Invalid packet size %d from client smallId=%d (max=%d)\n", app.DebugPrintf("LAN: Invalid packet size %d from client smallId=%d (max=%d)\n",
packetSize, packetSize,
@@ -1063,18 +1146,11 @@ int NetworkSocketLayer::RecvThreadProc(LPVOID param)
} }
EnterCriticalSection(&s_connectionsLock); EnterCriticalSection(&s_connectionsLock);
for (size_t i = 0; i < s_connections.size(); i++) s_connections[clientSmallId].active = false;
if (s_connections[clientSmallId].tcpSocket != INVALID_SOCKET)
{ {
if (s_connections[i].smallId == clientSmallId) closesocket(s_connections[clientSmallId].tcpSocket);
{ s_connections[clientSmallId].tcpSocket = INVALID_SOCKET;
s_connections[i].active = false;
if (s_connections[i].tcpSocket != INVALID_SOCKET)
{
closesocket(s_connections[i].tcpSocket);
s_connections[i].tcpSocket = INVALID_SOCKET;
}
break;
}
} }
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
@@ -1106,20 +1182,41 @@ void NetworkSocketLayer::PushFreeSmallId(BYTE smallId)
LeaveCriticalSection(&s_freeSmallIdLock); LeaveCriticalSection(&s_freeSmallIdLock);
} }
bool NetworkSocketLayer::PopPendingJoinSmallId(BYTE *outSmallId)
{
bool found = false;
EnterCriticalSection(&s_pendingJoinLock);
if (!s_pendingJoinSmallIds.empty())
{
*outSmallId = s_pendingJoinSmallIds.back();
s_pendingJoinSmallIds.pop_back();
found = true;
}
LeaveCriticalSection(&s_pendingJoinLock);
return found;
}
bool NetworkSocketLayer::IsSmallIdConnected(BYTE smallId)
{
if (smallId >= NETWORK_LAN_MAX_CLIENTS + 1) return false;
return s_connections[smallId].active;
}
void NetworkSocketLayer::CloseConnectionBySmallId(BYTE smallId) void NetworkSocketLayer::CloseConnectionBySmallId(BYTE smallId)
{ {
EnterCriticalSection(&s_connectionsLock); EnterCriticalSection(&s_connectionsLock);
for (size_t i = 0; i < s_connections.size(); i++) if (smallId < NETWORK_LAN_MAX_CLIENTS + 1 && s_connections[smallId].active && s_connections[smallId].tcpSocket != INVALID_SOCKET)
{ {
if (s_connections[i].smallId == smallId && s_connections[i].active && s_connections[i].tcpSocket != INVALID_SOCKET) closesocket(s_connections[smallId].tcpSocket);
{ s_connections[smallId].tcpSocket = INVALID_SOCKET;
closesocket(s_connections[i].tcpSocket); app.DebugPrintf("Win64 LAN: Force-closed TCP connection for smallId=%d\n", smallId);
s_connections[i].tcpSocket = INVALID_SOCKET;
app.DebugPrintf("Win64 LAN: Force-closed TCP connection for smallId=%d\n", smallId);
break;
}
} }
LeaveCriticalSection(&s_connectionsLock); LeaveCriticalSection(&s_connectionsLock);
EnterCriticalSection(&s_earlyDataLock);
if (smallId < NETWORK_LAN_MAX_CLIENTS + 1)
s_earlyDataBuffers[smallId].clear();
LeaveCriticalSection(&s_earlyDataLock);
} }
int NetworkSocketLayer::ClientRecvThreadProc(LPVOID param) int NetworkSocketLayer::ClientRecvThreadProc(LPVOID param)
@@ -1140,9 +1237,9 @@ int NetworkSocketLayer::ClientRecvThreadProc(LPVOID param)
break; break;
} }
int packetSize = (header[0] << 24) | (header[1] << 16) | (header[2] << 8) | header[3]; int packetSize = ((uint32_t)header[0] << 24) | ((uint32_t)header[1] << 16) | ((uint32_t)header[2] << 8) | (uint32_t)header[3];
if (packetSize <= 0 || packetSize > NETWORK_LAN_MAX_PACKET_SIZE) if (packetSize <= 0 || (unsigned int)packetSize > NETWORK_LAN_MAX_PACKET_SIZE)
{ {
app.DebugPrintf("LAN: Invalid packet size %d from host\n", packetSize); app.DebugPrintf("LAN: Invalid packet size %d from host\n", packetSize);
break; break;
@@ -1151,7 +1248,6 @@ int NetworkSocketLayer::ClientRecvThreadProc(LPVOID param)
if ((int)recvBuf.size() < packetSize) if ((int)recvBuf.size() < packetSize)
{ {
recvBuf.resize(packetSize); recvBuf.resize(packetSize);
app.DebugPrintf("LAN: Resized client recv buffer to %d bytes\n", packetSize);
} }
if (!RecvExact(s_hostConnectionSocket, &recvBuf[0], packetSize)) if (!RecvExact(s_hostConnectionSocket, &recvBuf[0], packetSize))
@@ -1192,6 +1288,11 @@ bool NetworkSocketLayer::StartAdvertising(int gamePort, const wchar_t *hostName,
s_advertiseData.texturePackParentId = texPackId; s_advertiseData.texturePackParentId = texPackId;
s_advertiseData.subTexturePackId = subTexId; s_advertiseData.subTexturePackId = subTexId;
s_advertiseData.isJoinable = 0; s_advertiseData.isJoinable = 0;
#ifdef _DEDICATED_SERVER
s_advertiseData.isDedicatedServer = 1;
#else
s_advertiseData.isDedicatedServer = 0;
#endif
s_hostGamePort = gamePort; s_hostGamePort = gamePort;
LeaveCriticalSection(&s_advertiseLock); LeaveCriticalSection(&s_advertiseLock);
@@ -1258,9 +1359,10 @@ void NetworkSocketLayer::UpdateAdvertisePlayerNames(BYTE count, const char playe
EnterCriticalSection(&s_advertiseLock); EnterCriticalSection(&s_advertiseLock);
memset(s_advertiseData.playerNames, 0, sizeof(s_advertiseData.playerNames)); memset(s_advertiseData.playerNames, 0, sizeof(s_advertiseData.playerNames));
s_advertiseData.playerCount = count; 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], XUSER_NAME_SIZE); 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);
} }
LeaveCriticalSection(&s_advertiseLock); LeaveCriticalSection(&s_advertiseLock);
} }
@@ -1483,8 +1585,8 @@ std::vector<LANSession> NetworkSocketLayer::GetDiscoveredSessions()
int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param) int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
{ {
app.DebugPrintf("Discovery thread started\n");
char recvBuf[1024]; char recvBuf[1024];
const size_t MAX_DISCOVERED_SESSIONS = 64;
while (s_discovering) while (s_discovering)
{ {
@@ -1533,6 +1635,11 @@ int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
if (broadcast->magic != NETWORK_LAN_BROADCAST_MAGIC) if (broadcast->magic != NETWORK_LAN_BROADCAST_MAGIC)
continue; continue;
broadcast->hostName[31] = L'\0';
for (int pn = 0; pn < NETWORK_LAN_BROADCAST_PLAYERS; pn++)
broadcast->playerNames[pn][XUSER_NAME_SIZE - 1] = '\0';
char senderIP[64]; char senderIP[64];
#if defined _XBOX #if defined _XBOX
unsigned char *ipBytes = (unsigned char *)&senderAddr.sin_addr; unsigned char *ipBytes = (unsigned char *)&senderAddr.sin_addr;
@@ -1566,6 +1673,7 @@ int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
s_discoveredSessions[i].texturePackParentId = broadcast->texturePackParentId; s_discoveredSessions[i].texturePackParentId = broadcast->texturePackParentId;
s_discoveredSessions[i].subTexturePackId = broadcast->subTexturePackId; s_discoveredSessions[i].subTexturePackId = broadcast->subTexturePackId;
s_discoveredSessions[i].isJoinable = (broadcast->isJoinable != 0); s_discoveredSessions[i].isJoinable = (broadcast->isJoinable != 0);
s_discoveredSessions[i].isDedicatedServer = (broadcast->isDedicatedServer != 0);
s_discoveredSessions[i].lastSeenTick = now; s_discoveredSessions[i].lastSeenTick = now;
memcpy(s_discoveredSessions[i].playerNames, broadcast->playerNames, sizeof(broadcast->playerNames)); memcpy(s_discoveredSessions[i].playerNames, broadcast->playerNames, sizeof(broadcast->playerNames));
found = true; found = true;
@@ -1575,6 +1683,12 @@ int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
if (!found) if (!found)
{ {
if (s_discoveredSessions.size() >= MAX_DISCOVERED_SESSIONS)
{
LeaveCriticalSection(&s_discoveryLock);
continue;
}
LANSession session; LANSession session;
memset(&session, 0, sizeof(session)); memset(&session, 0, sizeof(session));
strncpy(session.hostIP, senderIP, sizeof(session.hostIP) - 1); strncpy(session.hostIP, senderIP, sizeof(session.hostIP) - 1);
@@ -1593,6 +1707,7 @@ int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
session.texturePackParentId = broadcast->texturePackParentId; session.texturePackParentId = broadcast->texturePackParentId;
session.subTexturePackId = broadcast->subTexturePackId; session.subTexturePackId = broadcast->subTexturePackId;
session.isJoinable = (broadcast->isJoinable != 0); session.isJoinable = (broadcast->isJoinable != 0);
session.isDedicatedServer = (broadcast->isDedicatedServer != 0);
session.lastSeenTick = now; session.lastSeenTick = now;
memcpy(session.playerNames, broadcast->playerNames, sizeof(broadcast->playerNames)); memcpy(session.playerNames, broadcast->playerNames, sizeof(broadcast->playerNames));
s_discoveredSessions.push_back(session); s_discoveredSessions.push_back(session);
@@ -35,9 +35,10 @@
#define NETWORK_LAN_DEFAULT_PORT 25565 #define NETWORK_LAN_DEFAULT_PORT 25565
#define NETWORK_LAN_MAX_CLIENTS 7 #define NETWORK_LAN_MAX_CLIENTS 7
#define NETWORK_LAN_RECV_BUFFER_SIZE 65536 #define NETWORK_LAN_RECV_BUFFER_SIZE 65536
#define NETWORK_LAN_MAX_PACKET_SIZE (4 * 1024 * 1024) #define NETWORK_LAN_MAX_PACKET_SIZE (3 * 1024 * 1024)
#define NETWORK_LAN_DISCOVERY_PORT 25566 #define NETWORK_LAN_DISCOVERY_PORT 25566
#define NETWORK_LAN_BROADCAST_MAGIC 0x4D434C4E #define NETWORK_LAN_BROADCAST_MAGIC 0x4D434C4E
#define NETWORK_LAN_BROADCAST_PLAYERS 8
#ifdef __PS3__ #ifdef __PS3__
typedef int SOCKET; typedef int SOCKET;
@@ -100,6 +101,8 @@ typedef SceNetSocklen_t socklen_t;
class Socket; class Socket;
#define NETWORK_LAN_PLAYER_NAME_SIZE 32
#pragma pack(push, 1) #pragma pack(push, 1)
struct LANBroadcast struct LANBroadcast
{ {
@@ -113,7 +116,8 @@ struct LANBroadcast
DWORD texturePackParentId; DWORD texturePackParentId;
BYTE subTexturePackId; BYTE subTexturePackId;
BYTE isJoinable; BYTE isJoinable;
char playerNames[8][XUSER_NAME_SIZE]; BYTE isDedicatedServer;
char playerNames[NETWORK_LAN_BROADCAST_PLAYERS][NETWORK_LAN_PLAYER_NAME_SIZE];
}; };
#pragma pack(pop) #pragma pack(pop)
@@ -129,8 +133,9 @@ struct LANSession
unsigned int texturePackParentId; unsigned int texturePackParentId;
unsigned char subTexturePackId; unsigned char subTexturePackId;
bool isJoinable; bool isJoinable;
bool isDedicatedServer;
DWORD lastSeenTick; DWORD lastSeenTick;
char playerNames[8][XUSER_NAME_SIZE]; char playerNames[NETWORK_LAN_BROADCAST_PLAYERS][NETWORK_LAN_PLAYER_NAME_SIZE];
}; };
struct RemoteConnection struct RemoteConnection
@@ -139,6 +144,7 @@ struct RemoteConnection
BYTE smallId; BYTE smallId;
C4JThread* recvThread; C4JThread* recvThread;
volatile bool active; volatile bool active;
CRITICAL_SECTION sendLock;
}; };
class NetworkSocketLayer class NetworkSocketLayer
@@ -163,11 +169,16 @@ public:
static SOCKET GetSocketForSmallId(BYTE smallId); static SOCKET GetSocketForSmallId(BYTE smallId);
static void HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsigned char *data, unsigned int dataSize); static void HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsigned char *data, unsigned int dataSize);
static void FlushPendingData();
static bool PopDisconnectedSmallId(BYTE *outSmallId); static bool PopDisconnectedSmallId(BYTE *outSmallId);
static void PushFreeSmallId(BYTE smallId); static void PushFreeSmallId(BYTE smallId);
static void CloseConnectionBySmallId(BYTE smallId); static void CloseConnectionBySmallId(BYTE smallId);
static bool PopPendingJoinSmallId(BYTE *outSmallId);
static bool IsSmallIdConnected(BYTE smallId);
static bool StartAdvertising(int gamePort, const wchar_t *hostName, unsigned int gameSettings, unsigned int texPackId, unsigned char subTexId, unsigned short netVer); static bool StartAdvertising(int gamePort, const wchar_t *hostName, unsigned int gameSettings, unsigned int texPackId, unsigned char subTexId, unsigned short netVer);
static void StopAdvertising(); static void StopAdvertising();
static void UpdateAdvertisePlayerCount(BYTE count); static void UpdateAdvertisePlayerCount(BYTE count);
@@ -204,7 +215,7 @@ private:
static CRITICAL_SECTION s_sendLock; static CRITICAL_SECTION s_sendLock;
static CRITICAL_SECTION s_connectionsLock; static CRITICAL_SECTION s_connectionsLock;
static std::vector<RemoteConnection> s_connections; static RemoteConnection s_connections[NETWORK_LAN_MAX_CLIENTS + 1];
static SOCKET s_advertiseSock; static SOCKET s_advertiseSock;
static C4JThread* s_advertiseThread; static C4JThread* s_advertiseThread;
@@ -222,8 +233,14 @@ private:
static CRITICAL_SECTION s_disconnectLock; static CRITICAL_SECTION s_disconnectLock;
static std::vector<BYTE> s_disconnectedSmallIds; static std::vector<BYTE> s_disconnectedSmallIds;
static CRITICAL_SECTION s_pendingJoinLock;
static std::vector<BYTE> s_pendingJoinSmallIds;
static CRITICAL_SECTION s_freeSmallIdLock; static CRITICAL_SECTION s_freeSmallIdLock;
static std::vector<BYTE> s_freeSmallIds; static std::vector<BYTE> s_freeSmallIds;
static CRITICAL_SECTION s_earlyDataLock;
static std::vector<BYTE> s_earlyDataBuffers[NETWORK_LAN_MAX_CLIENTS + 1];
}; };
extern bool g_MultiplayerHost; extern bool g_MultiplayerHost;
@@ -1,4 +1,4 @@
#include "stdafx.h" #include "stdafx.h"
#include "..\..\..\Minecraft.World\Socket.h" #include "..\..\..\Minecraft.World\Socket.h"
#include "..\..\..\Minecraft.World\StringHelpers.h" #include "..\..\..\Minecraft.World\StringHelpers.h"
#include "PlatformNetworkManager.h" #include "PlatformNetworkManager.h"
@@ -12,6 +12,9 @@ CPlatformNetworkManagerStub *g_pPlatformNetworkManager;
void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer ) void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
{ {
if (getNetworkPlayer(pQNetPlayer) != NULL)
return;
const char * pszDescription; const char * pszDescription;
// 4J Stu - We create a fake socket for every where that we need an INBOUND queue of game data. Outbound // 4J Stu - We create a fake socket for every where that we need an INBOUND queue of game data. Outbound
@@ -164,6 +167,8 @@ bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkMa
playerChangedCallback[ i ] = NULL; playerChangedCallback[ i ] = NULL;
} }
NetworkSocketLayer::Initialize();
m_bLeavingGame = false; m_bLeavingGame = false;
m_bLeaveGameOnTick = false; m_bLeaveGameOnTick = false;
m_bHostChanged = false; m_bHostChanged = false;
@@ -228,6 +233,8 @@ void CPlatformNetworkManagerStub::DoWork()
BYTE disconnectedSmallId; BYTE disconnectedSmallId;
while (NetworkSocketLayer::PopDisconnectedSmallId(&disconnectedSmallId)) while (NetworkSocketLayer::PopDisconnectedSmallId(&disconnectedSmallId))
{ {
if (disconnectedSmallId == 0) continue;
if (NetworkSocketLayer::IsSmallIdConnected(disconnectedSmallId)) continue;
IQNetPlayer *qnetPlayer = m_pIQNet->GetPlayerBySmallId(disconnectedSmallId); IQNetPlayer *qnetPlayer = m_pIQNet->GetPlayerBySmallId(disconnectedSmallId);
if (qnetPlayer != NULL && qnetPlayer->m_smallId == disconnectedSmallId) if (qnetPlayer != NULL && qnetPlayer->m_smallId == disconnectedSmallId)
{ {
@@ -243,6 +250,16 @@ void CPlatformNetworkManagerStub::DoWork()
} }
} }
BYTE joinedSmallId;
while (NetworkSocketLayer::PopPendingJoinSmallId(&joinedSmallId))
{
IQNetPlayer *qnetPlayer = m_pIQNet->GetPlayerBySmallId(joinedSmallId);
if (qnetPlayer != NULL && qnetPlayer->m_smallId == joinedSmallId)
{
NotifyPlayerJoined(qnetPlayer);
}
}
for (int i = 1; i < MINECRAFT_NET_MAX_PLAYERS; i++) for (int i = 1; i < MINECRAFT_NET_MAX_PLAYERS; i++)
{ {
IQNetPlayer *qp = &IQNet::m_player[i]; IQNetPlayer *qp = &IQNet::m_player[i];
@@ -289,12 +306,27 @@ int CPlatformNetworkManagerStub::GetLocalPlayerMask(int playerIndex)
bool CPlatformNetworkManagerStub::AddLocalPlayerByUserIndex( int userIndex ) bool CPlatformNetworkManagerStub::AddLocalPlayerByUserIndex( int userIndex )
{ {
if (m_pIQNet->AddLocalPlayerByUserIndex(userIndex) != S_OK) return false;
NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(userIndex)); NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(userIndex));
return ( m_pIQNet->AddLocalPlayerByUserIndex(userIndex) == S_OK ); return true;
} }
bool CPlatformNetworkManagerStub::RemoveLocalPlayerByUserIndex( int userIndex ) bool CPlatformNetworkManagerStub::RemoveLocalPlayerByUserIndex( int userIndex )
{ {
if (userIndex > 0 && userIndex < XUSER_MAX_COUNT)
{
IQNetPlayer *qnetPlayer = m_pIQNet->GetLocalPlayerByUserIndex(userIndex);
if (qnetPlayer != NULL)
{
NotifyPlayerLeaving(qnetPlayer);
qnetPlayer->m_isRemote = true;
qnetPlayer->m_isHostPlayer = false;
qnetPlayer->m_gamertag[0] = 0;
qnetPlayer->SetCustomDataValue(0);
if (IQNet::s_playerCount > 1)
IQNet::s_playerCount--;
}
}
return true; return true;
} }
@@ -322,6 +354,10 @@ bool CPlatformNetworkManagerStub::LeaveGame(bool bMigrateHost)
if( m_bLeavingGame ) return true; if( m_bLeavingGame ) return true;
m_bLeavingGame = true; m_bLeavingGame = true;
extern bool g_connectedToDedicatedServer;
g_connectedToDedicatedServer = false;
NetworkSocketLayer::StopAdvertising(); NetworkSocketLayer::StopAdvertising();
// If we are the host wait for the game server to end // If we are the host wait for the game server to end
@@ -372,6 +408,13 @@ void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame,
IQNet::m_player[0].m_isRemote = false; IQNet::m_player[0].m_isRemote = false;
IQNet::m_player[0].m_isHostPlayer = true; IQNet::m_player[0].m_isHostPlayer = true;
IQNet::s_playerCount = 1; IQNet::s_playerCount = 1;
#if defined _WINDOWS64 && !defined WITH_SERVER_CODE
extern wchar_t g_Win64UsernameW[17];
wcscpy_s(IQNet::m_player[0].m_gamertag, 32, g_Win64UsernameW);
#endif
if (getNetworkPlayer(&IQNet::m_player[0]) == NULL)
NotifyPlayerJoined(&IQNet::m_player[0]);
_HostGame( localUsersMask, publicSlots, privateSlots ); _HostGame( localUsersMask, publicSlots, privateSlots );
@@ -413,6 +456,10 @@ int CPlatformNetworkManagerStub::JoinGame(FriendSessionInfo *searchResult, int l
IQNet::m_player[0].m_isRemote = true; IQNet::m_player[0].m_isRemote = true;
IQNet::m_player[0].m_isHostPlayer = true; IQNet::m_player[0].m_isHostPlayer = true;
wcsncpy(IQNet::m_player[0].m_gamertag, searchResult->data.hostName, 31); wcsncpy(IQNet::m_player[0].m_gamertag, searchResult->data.hostName, 31);
IQNet::m_player[0].m_gamertag[31] = L'\0';
extern bool g_connectedToDedicatedServer;
g_connectedToDedicatedServer = searchResult->data.isDedicatedServer;
NetworkSocketLayer::StopDiscovery(); NetworkSocketLayer::StopDiscovery();
@@ -435,8 +482,6 @@ int CPlatformNetworkManagerStub::JoinGame(FriendSessionInfo *searchResult, int l
NotifyPlayerJoined(&IQNet::m_player[0]); NotifyPlayerJoined(&IQNet::m_player[0]);
NotifyPlayerJoined(&IQNet::m_player[localSmallId]); NotifyPlayerJoined(&IQNet::m_player[localSmallId]);
m_pGameNetworkManager->StateChange_AnyToStarting();
return CGameNetworkManager::JOINGAME_SUCCESS; return CGameNetworkManager::JOINGAME_SUCCESS;
} }
@@ -495,6 +540,18 @@ bool CPlatformNetworkManagerStub::_RunNetworkGame()
return true; return true;
} }
void CPlatformNetworkManagerStub::SetGamePlayState()
{
extern QNET_STATE _iQNetStubState;
_iQNetStubState = QNET_STATE_GAME_PLAY;
if (m_pIQNet->IsHost())
{
NetworkSocketLayer::UpdateAdvertiseJoinable(true);
}
}
void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/) void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/)
{ {
if (this->m_bLeavingGame) if (this->m_bLeavingGame)
@@ -751,6 +808,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
info->data.subTexturePackId = lanSessions[i].subTexturePackId; info->data.subTexturePackId = lanSessions[i].subTexturePackId;
info->data.isReadyToJoin = lanSessions[i].isJoinable; info->data.isReadyToJoin = lanSessions[i].isJoinable;
info->data.isJoinable = lanSessions[i].isJoinable; info->data.isJoinable = lanSessions[i].isJoinable;
info->data.isDedicatedServer = lanSessions[i].isDedicatedServer;
strncpy(info->data.hostIP, lanSessions[i].hostIP, sizeof(info->data.hostIP) - 1); strncpy(info->data.hostIP, lanSessions[i].hostIP, sizeof(info->data.hostIP) - 1);
info->data.hostIP[sizeof(info->data.hostIP) - 1] = '\0'; info->data.hostIP[sizeof(info->data.hostIP) - 1] = '\0';
info->data.hostPort = lanSessions[i].hostPort; info->data.hostPort = lanSessions[i].hostPort;
@@ -761,7 +819,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
memset(info->data.players, 0, sizeof(info->data.players)); memset(info->data.players, 0, sizeof(info->data.players));
memset(info->data.szPlayers, 0, sizeof(info->data.szPlayers)); 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) if (lanSessions[i].playerNames[p][0] != 0)
{ {
@@ -801,7 +859,22 @@ vector<FriendSessionInfo *> *CPlatformNetworkManagerStub::GetSessionList(int iPa
{ {
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>(); vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>();
for (size_t i = 0; i < friendsSessions[0].size(); i++) for (size_t i = 0; i < friendsSessions[0].size(); i++)
filteredList->push_back(friendsSessions[0][i]); {
FriendSessionInfo *src = friendsSessions[0][i];
FriendSessionInfo *copy = new FriendSessionInfo();
*copy = *src;
if (src->displayLabel != NULL)
{
copy->displayLabel = new wchar_t[(size_t)src->displayLabelLength + 1];
wcsncpy(copy->displayLabel, src->displayLabel, src->displayLabelLength);
copy->displayLabel[src->displayLabelLength] = L'\0';
}
else
{
copy->displayLabel = NULL;
}
filteredList->push_back(copy);
}
return filteredList; return filteredList;
} }
@@ -820,6 +893,7 @@ bool CPlatformNetworkManagerStub::GetGameSessionInfo(int iPad, SessionID session
return true; return true;
} }
} }
return false;
} }
void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam )
@@ -861,9 +935,11 @@ void CPlatformNetworkManagerStub::removeNetworkPlayer(IQNetPlayer *pQNetPlayer)
if( *it == pNetworkPlayer ) if( *it == pNetworkPlayer )
{ {
currentNetworkPlayers.erase(it); currentNetworkPlayers.erase(it);
return; break;
} }
} }
pQNetPlayer->SetCustomDataValue(0);
} }
INetworkPlayer *CPlatformNetworkManagerStub::getNetworkPlayer(IQNetPlayer *pQNetPlayer) INetworkPlayer *CPlatformNetworkManagerStub::getNetworkPlayer(IQNetPlayer *pQNetPlayer)
@@ -1,4 +1,4 @@
#pragma once #pragma once
using namespace std; using namespace std;
#include <vector> #include <vector>
#include "..\..\..\Minecraft.World\C4JThread.h" #include "..\..\..\Minecraft.World\C4JThread.h"
@@ -54,6 +54,7 @@ public:
virtual void HandleSignInChange(); virtual void HandleSignInChange();
virtual void SetGamePlayState();
virtual bool _RunNetworkGame(); virtual bool _RunNetworkGame();
private: private:
@@ -79,6 +79,7 @@ typedef struct _GameSessionData
bool isReadyToJoin; // 1 byte bool isReadyToJoin; // 1 byte
bool isJoinable; // 1 byte bool isJoinable; // 1 byte
bool isDedicatedServer; // 1 byte
char hostIP[64]; // 64 bytes char hostIP[64]; // 64 bytes
int hostPort; // 4 bytes int hostPort; // 4 bytes
@@ -97,6 +98,7 @@ typedef struct _GameSessionData
subTexturePackId = 0; subTexturePackId = 0;
isReadyToJoin = false; isReadyToJoin = false;
isJoinable = true; isJoinable = true;
isDedicatedServer = false;
memset(hostIP, 0, sizeof(hostIP)); memset(hostIP, 0, sizeof(hostIP));
hostPort = 0; hostPort = 0;
memset(hostName, 0, sizeof(hostName)); memset(hostName, 0, sizeof(hostName));
@@ -959,11 +959,19 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
else else
{ {
//ProfileManager.RequestSignInUI(false, false, false, true, false,&CScene_MultiGameCreate::StartGame_SignInReturned, this,ProfileManager.GetPrimaryPad()); //ProfileManager.RequestSignInUI(false, false, false, true, false,&CScene_MultiGameCreate::StartGame_SignInReturned, this,ProfileManager.GetPrimaryPad());
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
SignInInfo info;
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
info.lpParam = this;
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
UIScene_CreateWorldMenu::StartGame_SignInReturned(this, true, ProfileManager.GetPrimaryPad());
#else
SignInInfo info; SignInInfo info;
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned; info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
info.lpParam = this; info.lpParam = this;
info.requireOnline = m_MoreOptionsParams.bOnlineGame; info.requireOnline = m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info); ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
#endif
} }
} }
else else
@@ -1342,12 +1350,16 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
if(isClientSide && app.IsLocalMultiplayerAvailable()) if(isClientSide && app.IsLocalMultiplayerAvailable())
{ {
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
UIScene_CreateWorldMenu::StartGame_SignInReturned(pClass, true, ProfileManager.GetPrimaryPad());
#else
//ProfileManager.RequestSignInUI(false, false, false, true, false,&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass,ProfileManager.GetPrimaryPad()); //ProfileManager.RequestSignInUI(false, false, false, true, false,&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass,ProfileManager.GetPrimaryPad());
SignInInfo info; SignInInfo info;
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned; info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
info.lpParam = pClass; info.lpParam = pClass;
info.requireOnline = pClass->m_MoreOptionsParams.bOnlineGame; info.requireOnline = pClass->m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info); ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
#endif
} }
else else
{ {
@@ -600,6 +600,21 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
ui.NavigateToHomeMenu(); ui.NavigateToHomeMenu();
} }
} }
else
{
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = NULL;
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground = TRUE;
completionData->bShowLogo = TRUE;
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_FullscreenProgress, loadingParams);
}
} }
} }
@@ -1446,7 +1446,12 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
#endif #endif
else else
{ {
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
StartGameFromSave(pClass, dwLocalUsersMask);
#else
pClass->m_bRequestQuadrantSignin = true; pClass->m_bRequestQuadrantSignin = true;
#endif
} }
} }
} }
@@ -1597,7 +1597,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen)
bool isClientSide = false; bool isClientSide = false;
bool isPrivate = false; bool isPrivate = false;
// TODO int maxPlayers = MINECRAFT_NET_MAX_PLAYERS; // TODO int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
int maxPlayers = 8; int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
if( app.GetTutorialMode() ) if( app.GetTutorialMode() )
{ {
@@ -386,6 +386,10 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
ui.NavigateToScene(primaryPad,eUIScene_TrialExitUpsell); ui.NavigateToScene(primaryPad,eUIScene_TrialExitUpsell);
} }
break; break;
#elif defined _WINDOWS64
case eControl_Exit:
app.ExitGame();
break;
#endif #endif
#ifdef _DURANGO #ifdef _DURANGO
@@ -76,7 +76,19 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
XuiControlSetText(m_ButtonLoad,app.GetString(IDS_LOAD)); XuiControlSetText(m_ButtonLoad,app.GetString(IDS_LOAD));
XuiControlSetText(m_pTexturePacksList->m_hObj,app.GetString(IDS_DLC_MENU_TEXTUREPACKS)); XuiControlSetText(m_pTexturePacksList->m_hObj,app.GetString(IDS_DLC_MENU_TEXTUREPACKS));
#ifndef _DISABLE_XBLIVE
#ifndef _DISABLE_XBLIVE
#ifndef _DISABLE_XBLIVE
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
#else
m_bMultiplayerAllowed = true;
#endif
#else
m_bMultiplayerAllowed = true;
#endif
#else
m_bMultiplayerAllowed = true;
#endif
// 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it. // 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it.
bool bGameSetting_Online=(app.GetGameSettings(m_iPad,eGameSetting_Online)!=0); bool bGameSetting_Online=(app.GetGameSettings(m_iPad,eGameSetting_Online)!=0);
m_MoreOptionsParams.bOnlineSettingChangedBySystem=false; m_MoreOptionsParams.bOnlineSettingChangedBySystem=false;
@@ -741,7 +753,10 @@ HRESULT CScene_LoadGameSettings::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandle
{ {
case GAME_CREATE_ONLINE_TIMER_ID: case GAME_CREATE_ONLINE_TIMER_ID:
{ {
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); bool bMultiplayerAllowed = true;
#ifndef _DISABLE_XBLIVE
bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
#endif
if(bMultiplayerAllowed != m_bMultiplayerAllowed) if(bMultiplayerAllowed != m_bMultiplayerAllowed)
{ {
@@ -1015,7 +1030,9 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu
{ {
if(ProfileManager.IsSignedIn(index) ) if(ProfileManager.IsSignedIn(index) )
{ {
#ifndef _DISABLE_XBLIVE
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true; if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
#endif
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index); dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index);
} }
} }
@@ -67,7 +67,19 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
m_iPad=params->iPad; m_iPad=params->iPad;
delete params; delete params;
#ifndef _DISABLE_XBLIVE
#ifndef _DISABLE_XBLIVE
#ifndef _DISABLE_XBLIVE
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
#else
m_bMultiplayerAllowed = true;
#endif
#else
m_bMultiplayerAllowed = true;
#endif
#else
m_bMultiplayerAllowed = true;
#endif
// 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it. // 4J-PB - read the settings for the online flag. We'll only save this setting if the user changed it.
bool bGameSetting_Online=(app.GetGameSettings(m_iPad,eGameSetting_Online)!=0); bool bGameSetting_Online=(app.GetGameSettings(m_iPad,eGameSetting_Online)!=0);
m_MoreOptionsParams.bOnlineSettingChangedBySystem=false; m_MoreOptionsParams.bOnlineSettingChangedBySystem=false;
@@ -663,7 +675,10 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
case GAME_CREATE_ONLINE_TIMER_ID: case GAME_CREATE_ONLINE_TIMER_ID:
{ {
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); bool bMultiplayerAllowed = true;
#ifndef _DISABLE_XBLIVE
bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
#endif
if(bMultiplayerAllowed != m_bMultiplayerAllowed) if(bMultiplayerAllowed != m_bMultiplayerAllowed)
{ {
@@ -824,7 +839,9 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue
{ {
if(ProfileManager.IsSignedIn(index) ) if(ProfileManager.IsSignedIn(index) )
{ {
#ifndef _DISABLE_XBLIVE
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true; if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
#endif
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index); dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index);
} }
} }
@@ -274,7 +274,9 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass)
if(ProfileManager.IsSignedIn(index) ) if(ProfileManager.IsSignedIn(index) )
{ {
++dwSignedInUsers; ++dwSignedInUsers;
#ifndef _DISABLE_XBLIVE
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true; if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
#endif
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index); dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index);
} }
} }
@@ -284,7 +286,9 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass)
if(ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()) ) if(ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()) )
{ {
++dwSignedInUsers; ++dwSignedInUsers;
#ifndef _DISABLE_XBLIVE
if( !ProfileManager.AllowedToPlayMultiplayer(ProfileManager.GetPrimaryPad()) ) noPrivileges = true; if( !ProfileManager.AllowedToPlayMultiplayer(ProfileManager.GetPrimaryPad()) ) noPrivileges = true;
#endif
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
} }
} }
@@ -348,6 +352,21 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass)
app.NavigateToHomeMenu(); app.NavigateToHomeMenu();
} }
} }
else
{
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = NULL;
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground = TRUE;
completionData->bShowLogo = TRUE;
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
completionData->iPad = DEFAULT_XUI_MENU_USER;
loadingParams->completionData = completionData;
app.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_FullscreenProgress, loadingParams);
}
} }
} }
@@ -73,7 +73,11 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand
// } // }
m_initData= new JoinMenuInitData(); m_initData= new JoinMenuInitData();
#ifndef _DISABLE_XBLIVE
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
#else
m_bMultiplayerAllowed = true;
#endif
XPARTY_USER_LIST partyList; XPARTY_USER_LIST partyList;
@@ -768,7 +772,11 @@ HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled
// start the texture pack timer again // start the texture pack timer again
XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME); XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME);
#ifndef _DISABLE_XBLIVE
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
#else
m_bMultiplayerAllowed = true;
#endif
// re-enable button presses // re-enable button presses
m_bIgnoreInput=false; m_bIgnoreInput=false;
@@ -1643,7 +1651,10 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
m_bInParty=false; m_bInParty=false;
} }
bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); bool bMultiplayerAllowed = true;
#ifndef _DISABLE_XBLIVE
bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
#endif
if(bMultiplayerAllowed != m_bMultiplayerAllowed) if(bMultiplayerAllowed != m_bMultiplayerAllowed)
{ {
if( bMultiplayerAllowed ) if( bMultiplayerAllowed )
+5 -4
View File
@@ -145,10 +145,11 @@ void EnderDragonRenderer::render(shared_ptr<Entity> _mob, double x, double y, do
int steps = 8; int steps = 8;
for (int i = 0; i <= steps; i++) for (int i = 0; i <= steps; i++)
{ {
double d=i % steps * PI * 2 / steps; int idx = i % steps;
float s = sin(i % steps * PI * 2 / steps) * 0.75f; double d = idx * PI * 2 / steps;
float c = cos(i % steps * PI * 2 / steps) * 0.75f; float s = sin(d) * 0.75f;
float u = i % steps * 1.0f / steps; float c = cos(d) * 0.75f;
float u = idx * 1.0f / steps;
//t->color(0x000000); //t->color(0x000000);
t->vertexUV(s * 0.2f, c * 0.2f, 0, u, v1); t->vertexUV(s * 0.2f, c * 0.2f, 0, u, v1);
//t->color(0xffffff); //t->color(0xffffff);
@@ -94,6 +94,17 @@ void EntityRenderDispatcher::staticCtor()
instance = new EntityRenderDispatcher(); instance = new EntityRenderDispatcher();
} }
EntityRenderDispatcher::~EntityRenderDispatcher()
{
AUTO_VAR(itEnd, renderers.end());
for( classToRendererMap::iterator it = renderers.begin(); it != itEnd; it++ )
{
delete it->second;
it->second = NULL;
}
renderers.clear();
}
EntityRenderDispatcher::EntityRenderDispatcher() EntityRenderDispatcher::EntityRenderDispatcher()
{ {
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
+2 -1
View File
@@ -1,7 +1,7 @@
#pragma once #pragma once
#include "EntityRenderer.h" #include "EntityRenderer.h"
#include "..\Minecraft.World\Entity.h"
#include "..\Minecraft.World\JavaIntHash.h" #include "..\Minecraft.World\JavaIntHash.h"
class Entity;
class font; class font;
using namespace std; using namespace std;
@@ -37,6 +37,7 @@ public:
private: private:
EntityRenderDispatcher(); EntityRenderDispatcher();
~EntityRenderDispatcher();
public: public:
EntityRenderer *getRenderer(eINSTANCEOF e); EntityRenderer *getRenderer(eINSTANCEOF e);
+158 -17
View File
@@ -78,6 +78,7 @@ HRESULT XPartyGetUserList(XPARTY_USER_LIST *pUserList) { return S_OK; }
DWORD XContentGetThumbnail(DWORD dwUserIndex, const XCONTENT_DATA *pContentData, PBYTE pbThumbnail, PDWORD pcbThumbnail, PXOVERLAPPED *pOverlapped) { return 0; } DWORD XContentGetThumbnail(DWORD dwUserIndex, const XCONTENT_DATA *pContentData, PBYTE pbThumbnail, PDWORD pcbThumbnail, PXOVERLAPPED *pOverlapped) { return 0; }
void XShowAchievementsUI(int i) {} void XShowAchievementsUI(int i) {}
DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; } DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; }
DWORD XamBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; }
#ifndef _DURANGO #ifndef _DURANGO
void PIXAddNamedCounter(int a, char *b, ...) {} void PIXAddNamedCounter(int a, char *b, ...) {}
@@ -354,7 +355,7 @@ DWORD XEnableGuestSignin(BOOL fEnable) { return 0; }
/////////////////////////////////////////////// Profile library /////////////////////////////////////////////// Profile library
#ifdef _WINDOWS64 #ifdef _WINDOWS64
static void *profileData[4]; static void *profileData[4];
static bool s_bProfileIsFullVersion; static bool s_bProfileIsFullVersion = true;
void C_4JProfile::Initialise( DWORD dwTitleID, void C_4JProfile::Initialise( DWORD dwTitleID,
DWORD dwOfferID, DWORD dwOfferID,
unsigned short usProfileVersion, unsigned short usProfileVersion,
@@ -373,6 +374,7 @@ void C_4JProfile::Initialise( DWORD dwTitleID,
GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)profileData[i]; GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)profileData[i];
pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu
pGameSettings->ucInterfaceOpacity=80; //eGameSetting_Sensitivity_InMenu pGameSettings->ucInterfaceOpacity=80; //eGameSetting_Sensitivity_InMenu
pGameSettings->ucGamma=100; //eGameSetting_Gamma
pGameSettings->usBitmaskValues|=0x0200; //eGameSetting_DisplaySplitscreenGamertags - on pGameSettings->usBitmaskValues|=0x0200; //eGameSetting_DisplaySplitscreenGamertags - on
pGameSettings->usBitmaskValues|=0x0400; //eGameSetting_Hints - on pGameSettings->usBitmaskValues|=0x0400; //eGameSetting_Hints - on
pGameSettings->usBitmaskValues|=0x1000; //eGameSetting_Autosave - 2 pGameSettings->usBitmaskValues|=0x1000; //eGameSetting_Autosave - 2
@@ -436,7 +438,95 @@ DWORD IQNetPlayer::GetCurrentRtt() { return 0; }
bool IQNetPlayer::IsHost() { return m_isHostPlayer; } bool IQNetPlayer::IsHost() { return m_isHostPlayer; }
bool IQNetPlayer::IsGuest() { return false; } bool IQNetPlayer::IsGuest() { return false; }
bool IQNetPlayer::IsLocal() { return !m_isRemote; } bool IQNetPlayer::IsLocal() { return !m_isRemote; }
PlayerUID IQNetPlayer::GetXuid() { return (PlayerUID)(0xe000d45248242f2e + m_smallId); } static void Win64_BuildSplitName(int iPad, char *outName, int outSize);
PlayerUID IQNetPlayer::GetXuid()
{
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
if (!m_isRemote)
{
int idx = (int)(this - &IQNet::m_player[0]);
if (idx == 0)
{
extern char g_Win64Username[17];
return Win64_UsernameToXuid(g_Win64Username);
}
if (idx > 0 && idx < XUSER_MAX_COUNT)
{
char splitName[32];
Win64_BuildSplitName(idx, splitName, sizeof(splitName));
return Win64_UsernameToXuid(splitName);
}
}
#endif
return (PlayerUID)(0xe000d45248242f2e + m_smallId);
}
PlayerUID Win64_UsernameToXuid(const char* username)
{
uint64_t hash = 14695981039346656037ULL;
for (const char* p = username; *p; ++p)
{
hash ^= (uint64_t)(unsigned char)(*p);
hash *= 1099511628211ULL;
}
const uint64_t WIN64_XUID_BASE = 0xe000d45248242f2e;
if (hash >= WIN64_XUID_BASE && hash <= WIN64_XUID_BASE + MINECRAFT_NET_MAX_PLAYERS)
hash = WIN64_XUID_BASE + MINECRAFT_NET_MAX_PLAYERS + 1;
if (hash == 0)
hash = 1;
return (PlayerUID)hash;
}
PlayerUID Win64_UsernameToXuid(const wchar_t* username)
{
char narrow[64];
int i = 0;
for (; username[i] && i < 63; ++i)
narrow[i] = (char)(unsigned char)(username[i] & 0xFF);
narrow[i] = 0;
return Win64_UsernameToXuid(narrow);
}
static void Win64_BuildSplitName(int iPad, char *outName, int outSize)
{
extern char g_Win64Username[17];
char candidate[32];
sprintf(candidate, "%s_%d", g_Win64Username, iPad);
for (DWORD i = 0; i < MINECRAFT_NET_MAX_PLAYERS; i++)
{
if (!IQNet::m_player[i].m_isRemote) continue;
if (IQNet::m_player[i].m_gamertag[0] == 0) continue;
char remoteName[64];
int j = 0;
for (; IQNet::m_player[i].m_gamertag[j] && j < 63; ++j)
remoteName[j] = (char)(unsigned char)(IQNet::m_player[i].m_gamertag[j] & 0xFF);
remoteName[j] = 0;
#if defined(_MSC_VER)
if (_stricmp(candidate, remoteName) == 0)
#else
if (strcasecmp(candidate, remoteName) == 0)
#endif
{
sprintf(candidate, "%s_%d_L", g_Win64Username, iPad);
break;
}
}
strncpy(outName, candidate, outSize - 1);
outName[outSize - 1] = 0;
}
static void Win64_BuildSplitNameW(int iPad, wchar_t *outName, int outSize)
{
char narrow[32];
Win64_BuildSplitName(iPad, narrow, sizeof(narrow));
for (int i = 0; i < outSize - 1 && narrow[i]; ++i)
{
outName[i] = (wchar_t)(unsigned char)narrow[i];
outName[i + 1] = 0;
}
}
LPCWSTR IQNetPlayer::GetGamertag() { return m_gamertag; } LPCWSTR IQNetPlayer::GetGamertag() { return m_gamertag; }
int IQNetPlayer::GetSessionIndex() { return m_smallId; } int IQNetPlayer::GetSessionIndex() { return m_smallId; }
bool IQNetPlayer::IsTalking() { return false; } bool IQNetPlayer::IsTalking() { return false; }
@@ -457,6 +547,8 @@ bool IQNet::s_isHosting = true;
QNET_STATE _iQNetStubState = QNET_STATE_IDLE; QNET_STATE _iQNetStubState = QNET_STATE_IDLE;
bool g_connectedToDedicatedServer = false;
void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost, bool isLocal) void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost, bool isLocal)
{ {
player->m_smallId = smallId; player->m_smallId = smallId;
@@ -469,15 +561,30 @@ void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost,
static bool Win64_IsActivePlayer(IQNetPlayer *p, DWORD index); static bool Win64_IsActivePlayer(IQNetPlayer *p, DWORD index);
HRESULT IQNet::AddLocalPlayerByUserIndex(DWORD dwUserIndex){ return S_OK; } HRESULT IQNet::AddLocalPlayerByUserIndex(DWORD dwUserIndex)
{
// no E_FAIL on PS3.
if (dwUserIndex >= MINECRAFT_NET_MAX_PLAYERS) return (HRESULT)0x80004005L;
m_player[dwUserIndex].m_isRemote = false;
m_player[dwUserIndex].m_smallId = (BYTE)dwUserIndex;
if (dwUserIndex > 0)
{
wchar_t splitNameW[32];
Win64_BuildSplitNameW((int)dwUserIndex, splitNameW, 32);
wcsncpy(m_player[dwUserIndex].m_gamertag, splitNameW, 32 - 1);
m_player[dwUserIndex].m_gamertag[32 - 1] = 0;
}
if (dwUserIndex >= (DWORD)s_playerCount)
s_playerCount = dwUserIndex + 1;
return S_OK;
}
IQNetPlayer *IQNet::GetHostPlayer() { return &m_player[0]; } IQNetPlayer *IQNet::GetHostPlayer() { return &m_player[0]; }
IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex) IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex)
{ {
if (s_isHosting) if (s_isHosting)
{ {
if (dwUserIndex < MINECRAFT_NET_MAX_PLAYERS && if (dwUserIndex < MINECRAFT_NET_MAX_PLAYERS &&
!m_player[dwUserIndex].m_isRemote && !m_player[dwUserIndex].m_isRemote)
Win64_IsActivePlayer(&m_player[dwUserIndex], dwUserIndex))
return &m_player[dwUserIndex]; return &m_player[dwUserIndex];
return NULL; return NULL;
} }
@@ -492,8 +599,15 @@ IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex)
} }
static bool Win64_IsActivePlayer(IQNetPlayer *p, DWORD index) static bool Win64_IsActivePlayer(IQNetPlayer *p, DWORD index)
{ {
if (index == 0) return true; if (index == 0)
return (p->GetCustomDataValue() != 0); {
extern bool g_connectedToDedicatedServer;
if (g_connectedToDedicatedServer && !IQNet::s_isHosting)
return false;
return true;
}
if (p->GetCustomDataValue() != 0) return true;
return (p->m_isRemote && p->m_gamertag[0] != 0);
} }
IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex) IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex)
@@ -574,7 +688,7 @@ void C_4JProfile::SetTrialTextStringTable(CXuiStringTable *pStringTable,int i
void C_4JProfile::SetTrialAwardText(eAwardType AwardType,int iTitle,int iText) {} void C_4JProfile::SetTrialAwardText(eAwardType AwardType,int iTitle,int iText) {}
int C_4JProfile::GetLockedProfile() { return 0; } int C_4JProfile::GetLockedProfile() { return 0; }
void C_4JProfile::SetLockedProfile(int iProf) {} void C_4JProfile::SetLockedProfile(int iProf) {}
bool C_4JProfile::IsSignedIn(int iQuadrant) { return ( iQuadrant == 0); } bool C_4JProfile::IsSignedIn(int iQuadrant) { return (iQuadrant >= 0 && iQuadrant < XUSER_MAX_COUNT); }
bool C_4JProfile::IsSignedInLive(int iProf) { return true; } bool C_4JProfile::IsSignedInLive(int iProf) { return true; }
bool C_4JProfile::IsGuest(int iQuadrant) { return false; } bool C_4JProfile::IsGuest(int iQuadrant) { return false; }
UINT C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant) { return 0; } UINT C_4JProfile::RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant) { return 0; }
@@ -584,16 +698,21 @@ void C_4JProfile::SetPrimaryPlayerChanged(bool bVal) {}
bool C_4JProfile::QuerySigninStatus(void) { return true; } bool C_4JProfile::QuerySigninStatus(void) { return true; }
void C_4JProfile::GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid) void C_4JProfile::GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid)
{ {
if (iPad != 0) if (iPad == 0)
{ {
// previously INVALID_XUID extern char g_Win64Username[17];
*pXuid = 0; *pXuid = Win64_UsernameToXuid(g_Win64Username);
return; }
else if (iPad > 0 && iPad < XUSER_MAX_COUNT)
{
char splitName[32];
Win64_BuildSplitName(iPad, splitName, sizeof(splitName));
*pXuid = Win64_UsernameToXuid(splitName);
} }
if (IQNet::s_isHosting)
*pXuid = 0xe000d45248242f2e;
else else
*pXuid = 0xe000d45248242f2e + NetworkSocketLayer::GetLocalSmallId(); {
*pXuid = INVALID_XUID;
}
} }
BOOL C_4JProfile::AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2) { return xuid1 == xuid2; } BOOL C_4JProfile::AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2) { return xuid1 == xuid2; }
BOOL C_4JProfile::XUIDIsGuest(PlayerUID xuid) { return false; } BOOL C_4JProfile::XUIDIsGuest(PlayerUID xuid) { return false; }
@@ -622,8 +741,30 @@ char fakeGamerTag[32] = "PlayerName";
void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); } void SetFakeGamertag(char *name){ strcpy_s(fakeGamerTag, name); }
char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; } char* C_4JProfile::GetGamertag(int iPad){ return fakeGamerTag; }
#else #else
char* C_4JProfile::GetGamertag(int iPad){ extern char g_Win64Username[17]; return g_Win64Username; } static char s_win64SplitNames[4][32];
wstring C_4JProfile::GetDisplayName(int iPad){ extern wchar_t g_Win64UsernameW[17]; return g_Win64UsernameW; } char* C_4JProfile::GetGamertag(int iPad)
{
extern char g_Win64Username[17];
if (iPad == 0) return g_Win64Username;
if (iPad > 0 && iPad < XUSER_MAX_COUNT)
{
Win64_BuildSplitName(iPad, s_win64SplitNames[iPad], sizeof(s_win64SplitNames[iPad]));
return s_win64SplitNames[iPad];
}
return g_Win64Username;
}
wstring C_4JProfile::GetDisplayName(int iPad)
{
extern wchar_t g_Win64UsernameW[17];
if (iPad == 0) return g_Win64UsernameW;
if (iPad > 0 && iPad < XUSER_MAX_COUNT)
{
wchar_t buf[32];
Win64_BuildSplitNameW(iPad, buf, 32);
return buf;
}
return g_Win64UsernameW;
}
#endif #endif
bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; } bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; }
void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {} void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {}
+33 -27
View File
@@ -105,8 +105,6 @@ GameRenderer::GameRenderer(Minecraft *mc)
zoom = 1; zoom = 1;
zoom_x = 0; zoom_x = 0;
zoom_y = 0; zoom_y = 0;
rainXa = NULL;
rainZa = NULL;
lastActiveTime = Minecraft::currentTimeMillis(); lastActiveTime = Minecraft::currentTimeMillis();
lastNsTime = 0; lastNsTime = 0;
random = new Random(); random = new Random();
@@ -181,8 +179,9 @@ GameRenderer::GameRenderer(Minecraft *mc)
// 4J Stu Added to go with 1.8.2 change // 4J Stu Added to go with 1.8.2 change
GameRenderer::~GameRenderer() GameRenderer::~GameRenderer()
{ {
if(rainXa != NULL) delete [] rainXa; delete random;
if(rainZa != NULL) delete [] rainZa; delete cameraPos;
delete lb;
} }
void GameRenderer::tick(bool first) // 4J - add bFirst void GameRenderer::tick(bool first) // 4J - add bFirst
@@ -838,19 +837,21 @@ void GameRenderer::updateLightTexture(float a)
Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture
float skyDarken1 = level->getSkyDarken((float) 1); float skyDarken1 = level->getSkyDarken((float) 1);
float darken = skyDarken1 * 0.95f + 0.05f;
float rsGsMul = skyDarken1 * 0.65f + 0.35f;
float blockMul = blr * 0.1f + 1.5f;
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
{ {
float darken = skyDarken1 * 0.95f + 0.05f;
float sky = level->dimension->brightnessRamp[i / 16] * darken; float sky = level->dimension->brightnessRamp[i / 16] * darken;
float block = level->dimension->brightnessRamp[i % 16] * (blr * 0.1f + 1.5f); float block = level->dimension->brightnessRamp[i % 16] * blockMul;
if (level->skyFlashTime > 0) if (level->skyFlashTime > 0)
{ {
sky = level->dimension->brightnessRamp[i / 16]; sky = level->dimension->brightnessRamp[i / 16];
} }
float rs = sky * (skyDarken1 * 0.65f + 0.35f); float rs = sky * rsGsMul;
float gs = sky * (skyDarken1 * 0.65f + 0.35f); float gs = sky * rsGsMul;
float bs = sky; float bs = sky;
float rb = block; float rb = block;
@@ -1526,27 +1527,30 @@ void GameRenderer::tickRain()
int x = x0 + random->nextInt(r) - random->nextInt(r); int x = x0 + random->nextInt(r) - random->nextInt(r);
int z = z0 + random->nextInt(r) - random->nextInt(r); int z = z0 + random->nextInt(r) - random->nextInt(r);
int y = level->getTopRainBlock(x, z); int y = level->getTopRainBlock(x, z);
int t = level->getTile(x, y - 1, z); if (y <= y0 + r && y >= y0 - r)
Biome *biome = level->getBiome(x,z);
if (y <= y0 + r && y >= y0 - r && biome->hasRain() && biome->getTemperature() >= 0.2f)
{ {
float xa = random->nextFloat(); int t = level->getTile(x, y - 1, z);
float za = random->nextFloat(); Biome *biome = level->getBiome(x,z);
if (t > 0) if (biome->hasRain() && biome->getTemperature() >= 0.2f)
{ {
if (Tile::tiles[t]->material == Material::lava) float xa = random->nextFloat();
float za = random->nextFloat();
if (t > 0)
{ {
mc->particleEngine->add( shared_ptr<SmokeParticle>( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) ); if (Tile::tiles[t]->material == Material::lava)
}
else
{
if (random->nextInt(++rainPosSamples) == 0)
{ {
rainPosX = x + xa; mc->particleEngine->add( shared_ptr<SmokeParticle>( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) );
rainPosY = y + 0.1f - Tile::tiles[t]->getShapeY0(); }
rainPosZ = z + za; else
{
if (random->nextInt(++rainPosSamples) == 0)
{
rainPosX = x + xa;
rainPosY = y + 0.1f - Tile::tiles[t]->getShapeY0();
rainPosZ = z + za;
}
mc->particleEngine->add( shared_ptr<WaterDropParticle>( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) );
} }
mc->particleEngine->add( shared_ptr<WaterDropParticle>( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) );
} }
} }
} }
@@ -1581,10 +1585,12 @@ void GameRenderer::renderSnowAndRain(float a)
turnOnLightLayer(a); turnOnLightLayer(a);
if (rainXa == NULL) static float rainXa[32 * 32];
static float rainZa[32 * 32];
static bool rainArraysInitialized = false;
if (!rainArraysInitialized)
{ {
rainXa = new float[32 * 32]; rainArraysInitialized = true;
rainZa = new float[32 * 32];
for (int z = 0; z < 32; z++) for (int z = 0; z < 32; z++)
{ {
-2
View File
@@ -128,8 +128,6 @@ private:
void tickRain(); void tickRain();
private: private:
// 4J - brought forward from 1.8.2 // 4J - brought forward from 1.8.2
float *rainXa;
float *rainZa;
protected: protected:
void renderSnowAndRain(float a); void renderSnowAndRain(float a);
volatile int xMod; volatile int xMod;
+4 -4
View File
@@ -10,7 +10,7 @@ ResourceLocation HorseRenderer::HORSE_DONKEY_LOCATION = ResourceLocation(TN_MOB_
ResourceLocation HorseRenderer::HORSE_ZOMBIE_LOCATION = ResourceLocation(TN_MOB_HORSE_ZOMBIE); ResourceLocation HorseRenderer::HORSE_ZOMBIE_LOCATION = ResourceLocation(TN_MOB_HORSE_ZOMBIE);
ResourceLocation HorseRenderer::HORSE_SKELETON_LOCATION = ResourceLocation(TN_MOB_HORSE_SKELETON); ResourceLocation HorseRenderer::HORSE_SKELETON_LOCATION = ResourceLocation(TN_MOB_HORSE_SKELETON);
std::map<wstring, ResourceLocation *> HorseRenderer::LAYERED_LOCATION_CACHE; std::map<wstring, ResourceLocation> HorseRenderer::LAYERED_LOCATION_CACHE;
HorseRenderer::HorseRenderer(Model *model, float f) : MobRenderer(model, f) HorseRenderer::HorseRenderer(Model *model, float f) : MobRenderer(model, f)
{ {
@@ -114,14 +114,14 @@ ResourceLocation *HorseRenderer::getOrCreateLayeredTextureLocation(shared_ptr<En
ResourceLocation *location; ResourceLocation *location;
if (it != LAYERED_LOCATION_CACHE.end()) if (it != LAYERED_LOCATION_CACHE.end())
{ {
location = it->second; location = &(it->second);
} }
else else
{ {
LAYERED_LOCATION_CACHE[textureName] = new ResourceLocation(horse->getLayeredTextureLayers()); LAYERED_LOCATION_CACHE[textureName] = ResourceLocation(horse->getLayeredTextureLayers());
it = LAYERED_LOCATION_CACHE.find(textureName); it = LAYERED_LOCATION_CACHE.find(textureName);
location = it->second; location = &(it->second);
} }
return location; return location;
+1 -1
View File
@@ -8,7 +8,7 @@ class PathfinderMob;
class HorseRenderer : public MobRenderer class HorseRenderer : public MobRenderer
{ {
private: private:
static std::map<wstring, ResourceLocation *> LAYERED_LOCATION_CACHE; static std::map<wstring, ResourceLocation> LAYERED_LOCATION_CACHE;
static ResourceLocation HORSE_LOCATION; static ResourceLocation HORSE_LOCATION;
static ResourceLocation HORSE_MULE_LOCATION; static ResourceLocation HORSE_MULE_LOCATION;
+4
View File
@@ -1964,7 +1964,11 @@ bool LevelRenderer::updateDirtyChunks()
{ {
if( (!onlyRebuild) || if( (!onlyRebuild) ||
globalChunkFlags[ pClipChunk->globalIdx ] & CHUNK_FLAG_COMPILED || globalChunkFlags[ pClipChunk->globalIdx ] & CHUNK_FLAG_COMPILED ||
#ifdef _WINDOWS64
( distSq < 96 * 96 ) ) // Always rebuild really near things or else building (say) at tower up into empty blocks when we are low on memory will not create render data
#else
( distSq < 20 * 20 ) ) // Always rebuild really near things or else building (say) at tower up into empty blocks when we are low on memory will not create render data ( distSq < 20 * 20 ) ) // Always rebuild really near things or else building (say) at tower up into empty blocks when we are low on memory will not create render data
#endif
{ {
considered++; considered++;
// Is this chunk nearer than our nearest? // Is this chunk nearer than our nearest?
+3 -1
View File
@@ -52,7 +52,9 @@ public:
static const int CHUNK_SIZE = 16; static const int CHUNK_SIZE = 16;
#endif #endif
static const int CHUNK_Y_COUNT = Level::maxBuildHeight / CHUNK_SIZE; static const int CHUNK_Y_COUNT = Level::maxBuildHeight / CHUNK_SIZE;
#if ( defined _XBOX_ONE || defined _WINDOWS64 ) #if defined _WINDOWS64
static const int MAX_COMMANDBUFFER_ALLOCATIONS = 2047 * 1024 * 1024; // whisper - added (wow)
#elif ( defined _XBOX_ONE )
static const int MAX_COMMANDBUFFER_ALLOCATIONS = 512 * 1024 * 1024; // 4J - added static const int MAX_COMMANDBUFFER_ALLOCATIONS = 512 * 1024 * 1024; // 4J - added
#elif defined __ORBIS__ #elif defined __ORBIS__
static const int MAX_COMMANDBUFFER_ALLOCATIONS = 448 * 1024 * 1024; // 4J - added - hard limit is 512 so giving a lot of headroom here for fragmentation (have seen 16MB lost to fragmentation in multiplayer crash dump before) static const int MAX_COMMANDBUFFER_ALLOCATIONS = 448 * 1024 * 1024; // 4J - added - hard limit is 512 so giving a lot of headroom here for fragmentation (have seen 16MB lost to fragmentation in multiplayer crash dump before)
+3 -3
View File
@@ -531,7 +531,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
int offs = 0; int offs = 0;
wstring playerName; wstring playerName;
WCHAR wchName[2]; WCHAR wchName[8];
if(mob->instanceof(eTYPE_PLAYER)) if(mob->instanceof(eTYPE_PLAYER))
{ {
@@ -551,7 +551,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
} }
else else
{ {
memset(wchName,0,sizeof(WCHAR)*2); memset(wchName,0,sizeof(wchName));
swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1);
playerName=wchName; playerName=wchName;
player->SetPlayerNameValidState(false); player->SetPlayerNameValidState(false);
@@ -561,7 +561,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
playerName=name; playerName=name;
break; break;
case Player::ePlayerNameValid_False: case Player::ePlayerNameValid_False:
memset(wchName,0,sizeof(WCHAR)*2); memset(wchName,0,sizeof(wchName)d);
swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1);
playerName=wchName; playerName=wchName;
break; break;
+285 -106
View File
@@ -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)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
</ClInclude> </ClInclude>
<ClInclude Include="Xbox\Network\extra.h" />
<ClInclude Include="Xbox\Network\NetworkPlayerXbox.h"> <ClInclude Include="Xbox\Network\NetworkPlayerXbox.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
@@ -23445,13 +23444,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|ORBIS'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|ORBIS'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\adler32.c"> <ClCompile Include="Common\zlib\adler32.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23465,6 +23464,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23491,13 +23502,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">NotUsing</PrecompiledHeader>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\compress.c"> <ClCompile Include="Common\zlib\compress.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23511,6 +23522,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23535,13 +23558,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\crc32.c"> <ClCompile Include="Common\zlib\crc32.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23555,6 +23578,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23579,13 +23614,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\deflate.c"> <ClCompile Include="Common\zlib\deflate.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23599,6 +23634,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23623,13 +23670,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\gzclose.c"> <ClCompile Include="Common\zlib\gzclose.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23643,6 +23690,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23674,13 +23733,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\gzlib.c"> <ClCompile Include="Common\zlib\gzlib.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23694,6 +23753,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23725,13 +23796,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\gzread.c"> <ClCompile Include="Common\zlib\gzread.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23745,6 +23816,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23776,13 +23859,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\gzwrite.c"> <ClCompile Include="Common\zlib\gzwrite.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23796,6 +23879,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23827,13 +23922,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\infback.c"> <ClCompile Include="Common\zlib\infback.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23847,6 +23942,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23871,13 +23978,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\inffast.c"> <ClCompile Include="Common\zlib\inffast.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23891,6 +23998,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23915,13 +24034,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\inflate.c"> <ClCompile Include="Common\zlib\inflate.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23935,6 +24054,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -23959,13 +24090,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\inftrees.c"> <ClCompile Include="Common\zlib\inftrees.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -23979,6 +24110,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -24003,13 +24146,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\trees.c"> <ClCompile Include="Common\zlib\trees.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -24023,6 +24166,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -24047,13 +24202,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\uncompr.c"> <ClCompile Include="Common\zlib\uncompr.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -24067,6 +24222,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -24091,13 +24258,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT> <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">false</CompileAsWinRT>
</ClCompile> </ClCompile>
<ClCompile Include="Common\zlib\zutil.c"> <ClCompile Include="Common\zlib\zutil.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PSVita'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|PS3'">false</ExcludedFromBuild>
@@ -24111,6 +24278,18 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|PS3'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">CompileAsC</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">CompileAsC</CompileAs>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|x64'">NotUsing</PrecompiledHeader>
@@ -3611,9 +3611,6 @@
<ClInclude Include="Orbis\Network\PsPlusUpsellWrapper_Orbis.h"> <ClInclude Include="Orbis\Network\PsPlusUpsellWrapper_Orbis.h">
<Filter>Orbis\Network</Filter> <Filter>Orbis\Network</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Xbox\Network\extra.h">
<Filter>Xbox\Source Files\Network</Filter>
</ClInclude>
<ClInclude Include="Common\UI\UIScene_Keyboard.h"> <ClInclude Include="Common\UI\UIScene_Keyboard.h">
<Filter>Common\Source Files\UI\Scenes</Filter> <Filter>Common\Source Files\UI\Scenes</Filter>
</ClInclude> </ClInclude>
+10 -2
View File
@@ -1298,9 +1298,9 @@ void Minecraft::run_middle()
INetworkPlayer *pHostPlayer = g_NetworkManager.GetHostPlayer(); INetworkPlayer *pHostPlayer = g_NetworkManager.GetHostPlayer();
#ifdef _XBOX #ifdef _XBOX
PlayerUID xuid=((NetworkPlayerXbox *)pHostPlayer)->GetUID(); PlayerUID xuid=((pHostPlayer != NULL) ? ((NetworkPlayerXbox *)pHostPlayer)->GetUID() : 0);
#else #else
PlayerUID xuid=pHostPlayer->GetUID(); PlayerUID xuid=(pHostPlayer != NULL) ? pHostPlayer->GetUID() : 0;
#endif #endif
if(app.IsInBannedLevelList(i,xuid,app.GetUniqueMapName())) if(app.IsInBannedLevelList(i,xuid,app.GetUniqueMapName()))
@@ -4963,11 +4963,18 @@ void Minecraft::handleClientTextureReceived(const wstring &textureName)
unsigned int Minecraft::getCurrentTexturePackId() unsigned int Minecraft::getCurrentTexturePackId()
{ {
#ifdef _DEDICATED_SERVER
return 0;
#else
return skins->getSelected()->getId(); return skins->getSelected()->getId();
#endif
} }
ColourTable *Minecraft::getColourTable() ColourTable *Minecraft::getColourTable()
{ {
#ifdef _DEDICATED_SERVER
return NULL;
#else
TexturePack *selected = skins->getSelected(); TexturePack *selected = skins->getSelected();
ColourTable *colours = selected->getColourTable(); ColourTable *colours = selected->getColourTable();
@@ -4978,6 +4985,7 @@ ColourTable *Minecraft::getColourTable()
} }
return colours; return colours;
#endif
} }
#if defined __ORBIS__ #if defined __ORBIS__
+80 -20
View File
@@ -35,7 +35,11 @@
#include "..\Minecraft.World\net.minecraft.world.entity.h" #include "..\Minecraft.World\net.minecraft.world.entity.h"
#include "ProgressRenderer.h" #include "ProgressRenderer.h"
#include "ServerPlayer.h" #include "ServerPlayer.h"
#include "PlayerConnection.h"
#include "GameRenderer.h" #include "GameRenderer.h"
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
#include "Common\Network\NetworkSocketLayer.h"
#endif
#include "..\Minecraft.World\ThreadName.h" #include "..\Minecraft.World\ThreadName.h"
#include "..\Minecraft.World\IntCache.h" #include "..\Minecraft.World\IntCache.h"
#include "..\Minecraft.World\CompressedTileStorage.h" #include "..\Minecraft.World\CompressedTileStorage.h"
@@ -47,6 +51,11 @@
#endif #endif
#include "PS3\PS3Extras\ShutdownManager.h" #include "PS3\PS3Extras\ShutdownManager.h"
#include "ServerCommandDispatcher.h" #include "ServerCommandDispatcher.h"
#ifdef _DEDICATED_SERVER
#include "..\Minecraft.Server\Commands\ServerCommands.h"
#endif
#include "..\Minecraft.World\BiomeSource.h" #include "..\Minecraft.World\BiomeSource.h"
#include "PlayerChunkMap.h" #include "PlayerChunkMap.h"
#include "Common\Telemetry\TelemetryManager.h" #include "Common\Telemetry\TelemetryManager.h"
@@ -150,13 +159,11 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
#endif #endif
settings = new Settings(new File(L"server.properties")); settings = new Settings(new File(L"server.properties"));
app.DebugPrintf("\n*** SERVER SETTINGS ***\n"); app.DebugPrintf("host-friends-only is %s",(app.GetGameHostOption(eGameHostOption_FriendsOfFriends)>0)?"on":"off");
app.DebugPrintf("ServerSettings: host-friends-only is %s\n",(app.GetGameHostOption(eGameHostOption_FriendsOfFriends)>0)?"on":"off"); app.DebugPrintf("game-type is %s",(app.GetGameHostOption(eGameHostOption_GameType)==0)?"Survival Mode":"Creative Mode");
app.DebugPrintf("ServerSettings: game-type is %s\n",(app.GetGameHostOption(eGameHostOption_GameType)==0)?"Survival Mode":"Creative Mode"); app.DebugPrintf("pvp is %s",(app.GetGameHostOption(eGameHostOption_PvP)>0)?"on":"off");
app.DebugPrintf("ServerSettings: pvp is %s\n",(app.GetGameHostOption(eGameHostOption_PvP)>0)?"on":"off"); app.DebugPrintf("fire-spreads is %s",(app.GetGameHostOption(eGameHostOption_FireSpreads)>0)?"on":"off");
app.DebugPrintf("ServerSettings: fire spreads is %s\n",(app.GetGameHostOption(eGameHostOption_FireSpreads)>0)?"on":"off"); app.DebugPrintf("tnt-explodes is %s",(app.GetGameHostOption(eGameHostOption_TNT)>0)?"on":"off");
app.DebugPrintf("ServerSettings: tnt explodes is %s\n",(app.GetGameHostOption(eGameHostOption_TNT)>0)?"on":"off");
app.DebugPrintf("\n");
// TODO 4J Stu - Init a load of settings based on data passed as params // TODO 4J Stu - Init a load of settings based on data passed as params
//settings->setBooleanAndSave( L"host-friends-only", (app.GetGameHostOption(eGameHostOption_FriendsOfFriends)>0) ); //settings->setBooleanAndSave( L"host-friends-only", (app.GetGameHostOption(eGameHostOption_FriendsOfFriends)>0) );
@@ -165,7 +172,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
//localIp = settings->getString(L"server-ip", L""); //localIp = settings->getString(L"server-ip", L"");
//onlineMode = settings->getBoolean(L"online-mode", true); //onlineMode = settings->getBoolean(L"online-mode", true);
//motd = settings->getString(L"motd", L"A Minecraft Server"); //motd = settings->getString(L"motd", L"A Minecraft Server");
//motd.replace('§', '$'); //motd.replace('§', '$');
setAnimals(settings->getBoolean(L"spawn-animals", true)); setAnimals(settings->getBoolean(L"spawn-animals", true));
setNpcsEnabled(settings->getBoolean(L"spawn-npcs", true)); setNpcsEnabled(settings->getBoolean(L"spawn-npcs", true));
@@ -210,7 +217,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
// 4J-JEV: Need to wait for levelGenerationOptions to load. // 4J-JEV: Need to wait for levelGenerationOptions to load.
while ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->hasLoadedData() ) while ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->hasLoadedData() )
Sleep(1); Sleep(0);
if ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->ready() ) if ( app.getLevelGenerationOptions() != NULL && !app.getLevelGenerationOptions()->ready() )
{ {
@@ -283,6 +290,14 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
} }
g_NetworkManager.ServerReady(); // 4J added g_NetworkManager.ServerReady(); // 4J added
#ifdef _DEDICATED_SERVER
{
extern QNET_STATE _iQNetStubState;
_iQNetStubState = QNET_STATE_GAME_PLAY;
}
#endif
return m_bLoaded; return m_bLoaded;
} }
@@ -319,7 +334,7 @@ int MinecraftServer::runPostUpdate(void* lpParam)
{ {
LeaveCriticalSection(&server->m_postProcessCS); LeaveCriticalSection(&server->m_postProcessCS);
} }
Sleep(1); Sleep(0);
} while (!server->m_postUpdateTerminate && ShutdownManager::ShouldRun(ShutdownManager::ePostProcessThread)); } while (!server->m_postUpdateTerminate && ShutdownManager::ShouldRun(ShutdownManager::ePostProcessThread));
//#ifndef __PS3__ //#ifndef __PS3__
// One final pass through updates to make sure we're done // One final pass through updates to make sure we're done
@@ -405,7 +420,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
int gameTypeId = settings->getInt(L"gamemode", app.GetGameHostOption(eGameHostOption_GameType));//LevelSettings::GAMETYPE_SURVIVAL); int gameTypeId = settings->getInt(L"gamemode", app.GetGameHostOption(eGameHostOption_GameType));//LevelSettings::GAMETYPE_SURVIVAL);
GameType *gameType = LevelSettings::validateGameType(gameTypeId); GameType *gameType = LevelSettings::validateGameType(gameTypeId);
app.DebugPrintf("Default game type: %d\n" , gameTypeId); app.DebugPrintf("Default game type: %d" , gameTypeId);
LevelSettings *levelSettings = new LevelSettings(levelSeed, gameType, app.GetGameHostOption(eGameHostOption_Structures)>0?true:false, isHardcore(), true, pLevelType, initData->xzSize, initData->hellScale); LevelSettings *levelSettings = new LevelSettings(levelSeed, gameType, app.GetGameHostOption(eGameHostOption_Structures)>0?true:false, isHardcore(), true, pLevelType, initData->xzSize, initData->hellScale);
if( app.GetGameHostOption(eGameHostOption_BonusChest ) ) levelSettings->enableStartingBonusItems(); if( app.GetGameHostOption(eGameHostOption_BonusChest ) ) levelSettings->enableStartingBonusItems();
@@ -497,7 +512,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
// m_lastSentDifficulty = pMinecraft->options->difficulty; // m_lastSentDifficulty = pMinecraft->options->difficulty;
levels[i]->difficulty = app.GetGameHostOption(eGameHostOption_Difficulty); //pMinecraft->options->difficulty; levels[i]->difficulty = app.GetGameHostOption(eGameHostOption_Difficulty); //pMinecraft->options->difficulty;
app.DebugPrintf("MinecraftServer::loadLevel - Difficulty = %d\n",levels[i]->difficulty); app.DebugPrintf("MinecraftServer::loadLevel - Difficulty = %d",levels[i]->difficulty);
#if DEBUG_SERVER_DONT_SPAWN_MOBS #if DEBUG_SERVER_DONT_SPAWN_MOBS
levels[i]->setSpawnSettings(false, false); levels[i]->setSpawnSettings(false, false);
@@ -571,6 +586,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
csf->closeHandle(fe); csf->closeHandle(fe);
} }
#ifdef _DEDICATED_SERVER
{
__int64 doneTime = System::currentTimeMillis();
app.DebugPrintf("Done! For help, type \"help\" or \"?\"");
}
#endif
__int64 lastTime = System::currentTimeMillis(); __int64 lastTime = System::currentTimeMillis();
#ifdef _LARGE_WORLDS #ifdef _LARGE_WORLDS
if(app.GetGameNewWorldSize() > levels[0]->getLevelData()->getXZSizeOld()) if(app.GetGameNewWorldSize() > levels[0]->getLevelData()->getXZSizeOld())
@@ -693,9 +715,6 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
// stronghold position? // stronghold position?
if(levels[0]->dimension->id==0) if(levels[0]->dimension->id==0)
{ {
app.DebugPrintf("===================================\n");
if(!levels[0]->getLevelData()->getHasStronghold()) if(!levels[0]->getLevelData()->getHasStronghold())
{ {
int x,z; int x,z;
@@ -705,20 +724,19 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
levels[0]->getLevelData()->setZStronghold(z); levels[0]->getLevelData()->setZStronghold(z);
levels[0]->getLevelData()->setHasStronghold(); levels[0]->getLevelData()->setHasStronghold();
app.DebugPrintf("=== FOUND stronghold in terrain features list\n"); app.DebugPrintf("FOUND stronghold in terrain features list\n");
} }
else else
{ {
// can't find the stronghold position in the terrain feature list. Do we have to run a post-process? // can't find the stronghold position in the terrain feature list. Do we have to run a post-process?
app.DebugPrintf("=== Can't find stronghold in terrain features list\n"); app.DebugPrintf("Can't find stronghold in terrain features list\n");
} }
} }
else else
{ {
app.DebugPrintf("=== Leveldata has stronghold position\n"); app.DebugPrintf("Leveldata has stronghold position\n");
} }
app.DebugPrintf("===================================\n");
} }
// printf("Post processing complete at %dms\n",System::currentTimeMillis() - startTime); // printf("Post processing complete at %dms\n",System::currentTimeMillis() - startTime);
@@ -988,12 +1006,16 @@ void MinecraftServer::stopServer(bool didInit)
// 4J-PB - If the primary player has signed out, then don't attempt to save anything // 4J-PB - If the primary player has signed out, then don't attempt to save anything
// also need to check for a profile switch here - primary player signs out, and another player signs in before dismissing the dash // also need to check for a profile switch here - primary player signs out, and another player signs in before dismissing the dash
#ifdef _DURANGO #ifdef _DEDICATED_SERVER
{
{
#elif defined(_DURANGO)
// On Durango check if the primary user is signed in OR mid-sign-out // On Durango check if the primary user is signed in OR mid-sign-out
if(ProfileManager.GetUser(0, true) != nullptr) if(ProfileManager.GetUser(0, true) != nullptr)
#else #else
if((m_bPrimaryPlayerSignedOut==false) && ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad())) if((m_bPrimaryPlayerSignedOut==false) && ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()))
#endif #endif
#ifndef _DEDICATED_SERVER
{ {
#if defined(_XBOX_ONE) || defined(__ORBIS__) #if defined(_XBOX_ONE) || defined(__ORBIS__)
// Always save on exit! Except if saves are disabled. // Always save on exit! Except if saves are disabled.
@@ -1002,6 +1024,7 @@ void MinecraftServer::stopServer(bool didInit)
// if trial version or saving is disabled, then don't save anything. Also don't save anything if we didn't actually get through the server initialisation. // if trial version or saving is disabled, then don't save anything. Also don't save anything if we didn't actually get through the server initialisation.
if(m_saveOnExit && ProfileManager.IsFullVersion() && (!StorageManager.GetSaveDisabled()) && didInit) if(m_saveOnExit && ProfileManager.IsFullVersion() && (!StorageManager.GetSaveDisabled()) && didInit)
{ {
#endif
if (players != NULL) if (players != NULL)
{ {
players->saveAll(Minecraft::GetInstance()->progressRenderer, true); players->saveAll(Minecraft::GetInstance()->progressRenderer, true);
@@ -1611,6 +1634,33 @@ void MinecraftServer::tick()
tickCount++; tickCount++;
#ifdef _DEDICATED_SERVER
if (tickCount % 6000 == 0 && !s_bServerHalted)
{
app.DebugPrintf("Auto-saving world...\n");
if (players != NULL)
{
players->saveAll(NULL);
}
for (unsigned int j = 0; j < levels.length; j++)
{
if (s_bServerHalted) break;
ServerLevel *level = levels[levels.length - 1 - j];
if (level) level->save(false, NULL, true);
}
if (!s_bServerHalted)
{
saveGameRules();
levels[0]->saveToDisc(NULL, true);
}
while (StorageManager.GetSaveState() != C4JStorage::ESaveGame_Idle)
{
Sleep(10);
}
app.DebugPrintf("Auto-save complete\n");
}
#endif
// 4J We need to update client difficulty levels based on the servers // 4J We need to update client difficulty levels based on the servers
Minecraft *pMinecraft = Minecraft::GetInstance(); Minecraft *pMinecraft = Minecraft::GetInstance();
// 4J-PB - sending this on the host changing the difficulty in the menus // 4J-PB - sending this on the host changing the difficulty in the menus
@@ -1683,6 +1733,10 @@ void MinecraftServer::tick()
} }
} }
Entity::tickExtraWandering(); // 4J added Entity::tickExtraWandering(); // 4J added
#ifdef _DEDICATED_SERVER
g_NetworkManager.DoWork();
NetworkSocketLayer::FlushPendingData();
#endif
PIXBeginNamedEvent(0,"Connection tick"); PIXBeginNamedEvent(0,"Connection tick");
connection->tick(); connection->tick();
@@ -1717,6 +1771,12 @@ void MinecraftServer::handleConsoleInputs()
AUTO_VAR(it, consoleInput.begin()); AUTO_VAR(it, consoleInput.begin());
ConsoleInput *input = *it; ConsoleInput *input = *it;
consoleInput.erase(it); consoleInput.erase(it);
#ifdef _DEDICATED_SERVER
HandleServerCommand(input->msg, input->source, this);
delete input;
#else
delete input;
#endif
// commands->handleCommand(input); // 4J - removed - TODO - do we want equivalent of console commands? // commands->handleCommand(input); // 4J - removed - TODO - do we want equivalent of console commands?
} }
} }
+1 -1
View File
@@ -236,7 +236,7 @@ public:
static void SetTime(__int64 time) { setTimeAtEndOfTick = true; setTime = time; } static void SetTime(__int64 time) { setTimeAtEndOfTick = true; setTime = time; }
C4JThread::Event* m_serverPausedEvent; C4JThread::Event* m_serverPausedEvent;
private: public:
// 4J Added // 4J Added
bool m_isServerPaused; bool m_isServerPaused;
+3 -2
View File
@@ -175,10 +175,11 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z)
if (MinecraftServer::getInstance()->serverHalted()) return NULL; if (MinecraftServer::getInstance()->serverHalted()) return NULL;
// If we're the host, then don't create the chunk, share data from the server's copy // If we're the host, then don't create the chunk, share data from the server's copy
int dimId = level->dimension->id;
#ifdef _LARGE_WORLDS #ifdef _LARGE_WORLDS
LevelChunk *serverChunk = MinecraftServer::getInstance()->getLevel(level->dimension->id)->cache->getChunkLoadedOrUnloaded(x,z); LevelChunk *serverChunk = MinecraftServer::getInstance()->getLevel(dimId)->cache->getChunkLoadedOrUnloaded(x,z);
#else #else
LevelChunk *serverChunk = MinecraftServer::getInstance()->getLevel(level->dimension->id)->cache->getChunk(x,z); LevelChunk *serverChunk = MinecraftServer::getInstance()->getLevel(dimId)->cache->getChunk(x,z);
#endif #endif
chunk = new LevelChunk(level, x, z, serverChunk); chunk = new LevelChunk(level, x, z, serverChunk);
// Let renderer know that this chunk has been created - it might have made render data from the EmptyChunk if it got to a chunk before the server sent it // Let renderer know that this chunk has been created - it might have made render data from the EmptyChunk if it got to a chunk before the server sent it
+14
View File
@@ -85,6 +85,20 @@ bool MultiPlayerGameMode::destroyBlock(int x, int y, int z, int face)
if (oldTile == NULL) return false; if (oldTile == NULL) return false;
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
if (g_NetworkManager.IsHost())
{
level->levelEvent(LevelEvent::PARTICLES_DESTROY_BLOCK, x, y, z, oldTile->id + (level->getData(x, y, z) << Tile::TILE_NUM_SHIFT));
int data = level->getData(x, y, z);
bool changed = level->removeTile(x, y, z);
if (changed)
{
oldTile->destroy(level, x, y, z, data);
}
return changed;
}
#endif
level->levelEvent(LevelEvent::PARTICLES_DESTROY_BLOCK, x, y, z, oldTile->id + (level->getData(x, y, z) << Tile::TILE_NUM_SHIFT)); level->levelEvent(LevelEvent::PARTICLES_DESTROY_BLOCK, x, y, z, oldTile->id + (level->getData(x, y, z) << Tile::TILE_NUM_SHIFT));
int data = level->getData(x, y, z); int data = level->getData(x, y, z);
@@ -1,7 +1,7 @@
/* /*
base64.cpp and base64.h base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
@@ -21,7 +21,7 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/ */
@@ -41,7 +41,7 @@ static inline bool is_base64(unsigned char c) {
} }
// 4J ADDED, // 4J ADDED,
std::string base64_encode(std::string str) std::string base64_encode(const std::string& str)
{ {
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() ); return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
} }
+1 -1
View File
@@ -2,6 +2,6 @@
#include <string> #include <string>
std::string base64_encode(std::string str); std::string base64_encode(const std::string& str);
std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s); std::string base64_decode(std::string const& s);
@@ -80,6 +80,8 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]=
uint8_t * AddRichPresenceString(int iID); uint8_t * AddRichPresenceString(int iID);
void FreeRichPresenceStrings(); void FreeRichPresenceStrings();
char g_Win64Username[17] = {0};
BOOL g_bWidescreen = TRUE; BOOL g_bWidescreen = TRUE;
@@ -984,6 +986,9 @@ int main(int argc, const char *argv[] )
app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT, app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT,
&app.uiGameDefinedDataChangedBitmask); &app.uiGameDefinedDataChangedBitmask);
strncpy(g_Win64Username, ProfileManager.GetGamertag(0), 17);
g_Win64Username[16] = 0;
// register the awards // register the awards
RegisterAwardsWithProfileManager(); RegisterAwardsWithProfileManager();
+3 -3
View File
@@ -1,7 +1,7 @@
/* /*
base64.cpp and base64.h base64.cpp and base64.h
Copyright (C) 2004-2008 René Nyffenegger Copyright (C) 2004-2008 René Nyffenegger
This source code is provided 'as-is', without any express or implied This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
@@ -21,7 +21,7 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
René Nyffenegger rene.nyffenegger@adp-gmbh.ch René Nyffenegger rene.nyffenegger@adp-gmbh.ch
*/ */
@@ -41,7 +41,7 @@ static inline bool is_base64(unsigned char c) {
} }
// 4J ADDED, // 4J ADDED,
std::string base64_encode(std::string str) std::string base64_encode(const std::string& str)
{ {
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() ); return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
} }
+1 -1
View File
@@ -2,6 +2,6 @@
#include <string> #include <string>
std::string base64_encode(std::string str); std::string base64_encode(const std::string& str);
std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s); std::string base64_decode(std::string const& s);
+5
View File
@@ -158,6 +158,8 @@ extern "C" void* __wrap__malloc_init(size_t a_Boundary, size_t a_Size)
// for a long time. // for a long time.
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
char g_Win64Username[17] = {0};
BOOL g_bWidescreen = TRUE; BOOL g_bWidescreen = TRUE;
//int g_numberOfSpeakersForMiles = 2; // number of speakers to pass to Miles, this is setup from init_audio_hardware //int g_numberOfSpeakersForMiles = 2; // number of speakers to pass to Miles, this is setup from init_audio_hardware
@@ -910,6 +912,9 @@ int main()
app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT, app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT,
&app.uiGameDefinedDataChangedBitmask); &app.uiGameDefinedDataChangedBitmask);
strncpy(g_Win64Username, ProfileManager.GetGamertag(0), 17);
g_Win64Username[16] = 0;
app.DebugPrintf("+++Main - after ProfileManager.Initialise\n"); app.DebugPrintf("+++Main - after ProfileManager.Initialise\n");
// register the awards // register the awards
@@ -133,6 +133,8 @@ extern "C" void* __wrap__malloc_init(size_t a_Boundary, size_t a_Size)
// for a long time. // for a long time.
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
char g_Win64Username[17] = {0};
BOOL g_bWidescreen = TRUE; BOOL g_bWidescreen = TRUE;
//int g_numberOfSpeakersForMiles = 2; // number of speakers to pass to Miles, this is setup from init_audio_hardware //int g_numberOfSpeakersForMiles = 2; // number of speakers to pass to Miles, this is setup from init_audio_hardware
@@ -601,6 +603,8 @@ int main()
app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT, app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT,
&app.uiGameDefinedDataChangedBitmask); &app.uiGameDefinedDataChangedBitmask);
strncpy(g_Win64Username, ProfileManager.GetGamertag(0), 17);
g_Win64Username[16] = 0;
// register the awards // register the awards
RegisterAwardsWithProfileManager(); RegisterAwardsWithProfileManager();
+2
View File
@@ -85,6 +85,7 @@ void PendingConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
return; return;
} }
// printf("Server: handlePreLogin\n"); // printf("Server: handlePreLogin\n");
app.DebugPrintf("PreLogin received from \"%ls\"\n", packet->loginKey.c_str());
name = packet->loginKey; // 4J Stu - Change from the login packet as we know better on client end during the pre-login packet name = packet->loginKey; // 4J Stu - Change from the login packet as we know better on client end during the pre-login packet
sendPreLoginResponse(); sendPreLoginResponse();
} }
@@ -139,6 +140,7 @@ void PendingConnection::sendPreLoginResponse()
void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet) void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
{ {
app.DebugPrintf("Login received from \"%ls\" (protocol %d)\n", name.c_str(), packet->clientVersion);
// printf("Server: handleLogin\n"); // printf("Server: handleLogin\n");
//name = packet->userName; //name = packet->userName;
if (packet->clientVersion != SharedConstants::NETWORK_PROTOCOL_VERSION) if (packet->clientVersion != SharedConstants::NETWORK_PROTOCOL_VERSION)
+10 -1
View File
@@ -539,7 +539,12 @@ void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr<ServerPlay
// 4J - added - actually create & add player to a playerchunk, if there is one queued for this player. // 4J - added - actually create & add player to a playerchunk, if there is one queued for this player.
void PlayerChunkMap::tickAddRequests(shared_ptr<ServerPlayer> player) void PlayerChunkMap::tickAddRequests(shared_ptr<ServerPlayer> player)
{ {
if( addRequests.size() ) #ifdef _WINDOWS64
const int maxPerTick = 10;
#else
const int maxPerTick = 1;
#endif
for (int _processed = 0; _processed < maxPerTick && addRequests.size(); _processed++)
{ {
// Find the nearest chunk request to the player // Find the nearest chunk request to the player
int px = (int)player->x; int px = (int)player->x;
@@ -569,6 +574,10 @@ void PlayerChunkMap::tickAddRequests(shared_ptr<ServerPlayer> player)
getChunk(itNearest->x, itNearest->z, true)->add(itNearest->player); getChunk(itNearest->x, itNearest->z, true)->add(itNearest->player);
addRequests.erase(itNearest); addRequests.erase(itNearest);
} }
else
{
break;
}
} }
} }
+15 -2
View File
@@ -116,7 +116,7 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason)
return; return;
} }
app.DebugPrintf("PlayerConnection disconect reason: %d\n", reason ); app.DebugPrintf("PlayerConnection disconect reason: %d", reason );
player->disconnect(); player->disconnect();
// 4J Stu - Need to remove the player from the receiving list before their socket is NULLed so that we can find another player on their system // 4J Stu - Need to remove the player from the receiving list before their socket is NULLed so that we can find another player on their system
@@ -543,10 +543,16 @@ void PlayerConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason,
if(getWasKicked()) if(getWasKicked())
{ {
server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) ); server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) );
#ifdef _DEDICATED_SERVER
app.DebugPrintf("%ls was kicked from the game", player->name.c_str());
#endif
} }
else else
{ {
server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) ); server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) );
#ifdef _DEDICATED_SERVER
app.DebugPrintf("%ls left the game", player->name.c_str());
#endif
} }
server->getPlayers()->remove(player); server->getPlayers()->remove(player);
done = true; done = true;
@@ -1577,7 +1583,10 @@ bool PlayerConnection::isDisconnected()
void PlayerConnection::handleDebugOptions(shared_ptr<DebugOptionsPacket> packet) void PlayerConnection::handleDebugOptions(shared_ptr<DebugOptionsPacket> packet)
{ {
//Player player = dynamic_pointer_cast<Player>( player->shared_from_this() ); //Player player = dynamic_pointer_cast<Player>( player->shared_from_this() );
player->SetDebugOptions(packet->m_uiVal); if(app.DebugSettingsOn())
{
player->SetDebugOptions(packet->m_uiVal);
}
} }
void PlayerConnection::handleCraftItem(shared_ptr<CraftItemPacket> packet) void PlayerConnection::handleCraftItem(shared_ptr<CraftItemPacket> packet)
@@ -1587,6 +1596,10 @@ void PlayerConnection::handleCraftItem(shared_ptr<CraftItemPacket> packet)
if(iRecipe == -1) if(iRecipe == -1)
return; return;
int recipeCount = (int)Recipes::getInstance()->getRecipies()->size();
if(iRecipe < 0 || iRecipe >= recipeCount)
return;
Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray(); Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray();
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "ConsoleInputSource.h" #include "ConsoleInputSource.h"
#include "..\Minecraft.World\PacketListener.h" #include "..\Minecraft.World\PacketListener.h"
#include "..\Minecraft.World\JavaIntHash.h" #include "..\Minecraft.World\JavaIntHash.h"
+4
View File
@@ -243,6 +243,10 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr<ServerPlayer>
//server->players->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(L"§e" + playerEntity->name + L" joined the game.") ) ); //server->players->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(L"§e" + playerEntity->name + L" joined the game.") ) );
broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerJoinedGame) ) ); broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerJoinedGame) ) );
#ifdef _DEDICATED_SERVER
app.DebugPrintf("%ls joined the game", player->name.c_str());
#endif
MemSect(14); MemSect(14);
add(player); add(player);
MemSect(0); MemSect(0);
+23 -1
View File
@@ -38,13 +38,35 @@ PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0
armorParts2 = new HumanoidModel(0.5f); 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) unsigned int PlayerRenderer::getNametagColour(int index)
{ {
if( index >= 0 && index < MINECRAFT_NET_MAX_PLAYERS) if( index >= 0 && index < MINECRAFT_NET_MAX_PLAYERS)
{ {
return s_nametagColors[index]; 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) int PlayerRenderer::prepareArmor(shared_ptr<LivingEntity> _player, int layer, float a)
+2
View File
@@ -151,8 +151,10 @@ LevelChunk *ServerChunkCache::create(int x, int z, bool asyncPostProcess) // 4J
if( ( chunk == NULL ) || ( chunk->x != x ) || ( chunk->z != z ) ) if( ( chunk == NULL ) || ( chunk->x != x ) || ( chunk->z != z ) )
{ {
bool wasLoaded = false;
EnterCriticalSection(&m_csLoadCreate); EnterCriticalSection(&m_csLoadCreate);
chunk = load(x, z); chunk = load(x, z);
wasLoaded = (chunk != NULL);
if (chunk == NULL) if (chunk == NULL)
{ {
if (source == NULL) if (source == NULL)
+5 -1
View File
@@ -1026,6 +1026,7 @@ void ServerLevel::saveToDisc(ProgressListener *progressListener, bool autosave)
// 4J-PB - check that saves are enabled // 4J-PB - check that saves are enabled
if(StorageManager.GetSaveDisabled()) return; if(StorageManager.GetSaveDisabled()) return;
#ifndef _DEDICATED_SERVER
// Check if we are using a trial version of a texture pack (which will be the case for going into the mash-up pack world with a trial version) // Check if we are using a trial version of a texture pack (which will be the case for going into the mash-up pack world with a trial version)
if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin()) if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin())
{ {
@@ -1039,6 +1040,7 @@ void ServerLevel::saveToDisc(ProgressListener *progressListener, bool autosave)
return; return;
} }
} }
#endif
if (progressListener != NULL) progressListener->progressStage(IDS_PROGRESS_SAVING_TO_DISC); if (progressListener != NULL) progressListener->progressStage(IDS_PROGRESS_SAVING_TO_DISC);
levelStorage->flushSaveFile(autosave); levelStorage->flushSaveFile(autosave);
@@ -1086,7 +1088,9 @@ void ServerLevel::entityRemoved(shared_ptr<Entity> e)
shared_ptr<Entity> ServerLevel::getEntity(int id) shared_ptr<Entity> ServerLevel::getEntity(int id)
{ {
return entitiesById[id]; AUTO_VAR(it, entitiesById.find(id));
if(it != entitiesById.end()) return it->second;
return nullptr;
} }
bool ServerLevel::addGlobalEntity(shared_ptr<Entity> e) bool ServerLevel::addGlobalEntity(shared_ptr<Entity> e)
+19
View File
@@ -329,6 +329,10 @@ void ServerPlayer::doTickA()
// 4J - split off the chunk sending bit of the tick here from ::doTick so we can do this exactly once per player per server tick // 4J - split off the chunk sending bit of the tick here from ::doTick so we can do this exactly once per player per server tick
void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) void ServerPlayer::doChunkSendingTick(bool dontDelayChunks)
{ {
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
for (int _w64cs = 0; _w64cs < 4; _w64cs++)
{
#endif
// printf("[%d] %s: sendChunks: %d, empty: %d\n",tickCount, connection->getNetworkPlayer()->GetUID().getOnlineID(),sendChunks,chunksToSend.empty()); // printf("[%d] %s: sendChunks: %d, empty: %d\n",tickCount, connection->getNetworkPlayer()->GetUID().getOnlineID(),sendChunks,chunksToSend.empty());
if (!chunksToSend.empty()) if (!chunksToSend.empty())
{ {
@@ -367,6 +371,17 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks)
} }
else else
{ {
#if defined(_WINDOWS64)
if( dontDelayChunks ||
((connection->countDelayedPackets() < 16 )&&
(g_NetworkManager.GetHostPlayer()->GetSendQueueSizeMessages( NULL, true ) < 16 )&&
!connection->done) )
{
lastBrupSendTickCount = tickCount;
okToSend = true;
MinecraftServer::s_slowQueuePacketSent = true;
}
#else
bool canSendToPlayer = MinecraftServer::chunkPacketManagement_CanSendTo(connection->getNetworkPlayer()); bool canSendToPlayer = MinecraftServer::chunkPacketManagement_CanSendTo(connection->getNetworkPlayer());
// app.DebugPrintf(">>> %d\n", canSendToPlayer); // app.DebugPrintf(">>> %d\n", canSendToPlayer);
@@ -408,6 +423,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks)
{ {
// app.DebugPrintf(" - <NOT OK>\n"); // app.DebugPrintf(" - <NOT OK>\n");
} }
#endif
} }
if (okToSend) if (okToSend)
@@ -485,6 +501,9 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks)
} }
} }
} }
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
}
#endif
} }
void ServerPlayer::doTickB() void ServerPlayer::doTickB()
-4
View File
@@ -1,4 +0,0 @@
#pragma once
const int MINECRAFT_NET_MAX_PLAYERS = 8;
+8
View File
@@ -30,6 +30,7 @@
#include "..\Windows64\Leaderboards\WindowsLeaderboardManager.h" #include "..\Windows64\Leaderboards\WindowsLeaderboardManager.h"
#endif #endif
#include "..\Common\XUI\XUI_Scene_Container.h" #include "..\Common\XUI\XUI_Scene_Container.h"
#include "..\Common\Network\NetworkSocketLayer.h"
#include "..\..\Minecraft.Client\Tesselator.h" #include "..\..\Minecraft.Client\Tesselator.h"
#include "..\..\Minecraft.Client\Options.h" #include "..\..\Minecraft.Client\Options.h"
#include "Sentient\SentientManager.h" #include "Sentient\SentientManager.h"
@@ -93,6 +94,8 @@ D3DSAMPLERSTATETYPE SamplerStateModes[]=
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
char g_Win64Username[17] = {0};
BOOL g_bWidescreen = TRUE; BOOL g_bWidescreen = TRUE;
@@ -432,6 +435,9 @@ int __cdecl main()
&app.uiGameDefinedDataChangedBitmask &app.uiGameDefinedDataChangedBitmask
); );
strncpy(g_Win64Username, ProfileManager.GetGamertag(0), 17);
g_Win64Username[16] = 0;
// register the awards // register the awards
ProfileManager.RegisterAward(eAward_TakingInventory, ACHIEVEMENT_01, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_TakingInventory, ACHIEVEMENT_01, eAwardType_Achievement);
ProfileManager.RegisterAward(eAward_GettingWood, ACHIEVEMENT_02, eAwardType_Achievement); ProfileManager.RegisterAward(eAward_GettingWood, ACHIEVEMENT_02, eAwardType_Achievement);
@@ -494,6 +500,8 @@ int __cdecl main()
// ProfileManager for XN_LIVE_INVITE_ACCEPTED for QNet. // ProfileManager for XN_LIVE_INVITE_ACCEPTED for QNet.
g_NetworkManager.Initialise(); g_NetworkManager.Initialise();
NetworkSocketLayer::Initialize();
app.InitGameSettings(); app.InitGameSettings();
// debug switch to trial version // debug switch to trial version
+6
View File
@@ -5,6 +5,12 @@
#pragma once #pragma once
#ifdef _XBOX
#ifndef _DISABLE_XBLIVE
#define _DISABLE_XBLIVE
#endif
#endif
//#include <xtl.h> //#include <xtl.h>
//#include <xboxmath.h> //#include <xboxmath.h>
+1
Submodule Minecraft.Server added at c356c7b911
-12
View File
@@ -56,15 +56,9 @@ void AddEntityPacket::read(DataInputStream *dis) // throws IOException TODO 4J
{ {
id = dis->readShort(); id = dis->readShort();
type = dis->readByte(); type = dis->readByte();
#ifdef _LARGE_WORLDS
x = dis->readInt(); x = dis->readInt();
y = dis->readInt(); y = dis->readInt();
z = dis->readInt(); z = dis->readInt();
#else
x = dis->readShort();
y = dis->readShort();
z = dis->readShort();
#endif
yRot = dis->readByte(); yRot = dis->readByte();
xRot = dis->readByte(); xRot = dis->readByte();
data = dis->readInt(); data = dis->readInt();
@@ -80,15 +74,9 @@ void AddEntityPacket::write(DataOutputStream *dos) // throws IOException TODO 4J
{ {
dos->writeShort(id); dos->writeShort(id);
dos->writeByte(type); dos->writeByte(type);
#ifdef _LARGE_WORLDS
dos->writeInt(x); dos->writeInt(x);
dos->writeInt(y); dos->writeInt(y);
dos->writeInt(z); dos->writeInt(z);
#else
dos->writeShort(x);
dos->writeShort(y);
dos->writeShort(z);
#endif
dos->writeByte(yRot); dos->writeByte(yRot);
dos->writeByte(xRot); dos->writeByte(xRot);
dos->writeInt(data); dos->writeInt(data);
-12
View File
@@ -68,15 +68,9 @@ void AddMobPacket::read(DataInputStream *dis) //throws IOException
{ {
id = dis->readShort(); id = dis->readShort();
type = dis->readByte() & 0xff; type = dis->readByte() & 0xff;
#ifdef _LARGE_WORLDS
x = dis->readInt(); x = dis->readInt();
y = dis->readInt(); y = dis->readInt();
z = dis->readInt(); z = dis->readInt();
#else
x = dis->readShort();
y = dis->readShort();
z = dis->readShort();
#endif
yRot = dis->readByte(); yRot = dis->readByte();
xRot = dis->readByte(); xRot = dis->readByte();
yHeadRot = dis->readByte(); yHeadRot = dis->readByte();
@@ -92,15 +86,9 @@ void AddMobPacket::write(DataOutputStream *dos) //throws IOException
{ {
dos->writeShort(id); dos->writeShort(id);
dos->writeByte(type & 0xff); dos->writeByte(type & 0xff);
#ifdef _LARGE_WORLDS
dos->writeInt(x); dos->writeInt(x);
dos->writeInt(y); dos->writeInt(y);
dos->writeInt(z); dos->writeInt(z);
#else
dos->writeShort(x);
dos->writeShort(y);
dos->writeShort(z);
#endif
dos->writeByte(yRot); dos->writeByte(yRot);
dos->writeByte(xRot); dos->writeByte(xRot);
dos->writeByte(yHeadRot); dos->writeByte(yHeadRot);
+1 -1
View File
@@ -47,7 +47,7 @@ void AwardStatPacket::read(DataInputStream *dis) //throws IOException
// Read parameter blob. // Read parameter blob.
int length = dis->readInt(); int length = dis->readInt();
if(length > 0) if(length > 0 && length <= 65536)
{ {
m_paramData = byteArray(length); m_paramData = byteArray(length);
dis->readFully(m_paramData); dis->readFully(m_paramData);
+12 -3
View File
@@ -74,7 +74,7 @@ BlockRegionUpdatePacket::BlockRegionUpdatePacket(int x, int y, int z, int xs, in
unsigned char *ucTemp = new unsigned char[(256 * 16 * 16 * 5)/2]; unsigned char *ucTemp = new unsigned char[(256 * 16 * 16 * 5)/2];
unsigned int inputSize = (256 * 16 * 16 * 5)/2; unsigned int inputSize = (256 * 16 * 16 * 5)/2;
Compression::getCompression()->CompressLZXRLE(ucTemp, &inputSize, rawBuffer.data, (unsigned int) rawBuffer.length); Compression::getCompression()->CompressRLE(ucTemp, &inputSize, rawBuffer.data, (unsigned int) rawBuffer.length);
//app.DebugPrintf("Chunk (%d,%d) compressed from %d to size %d\n", x>>4, z>>4, rawBuffer.length, inputSize); //app.DebugPrintf("Chunk (%d,%d) compressed from %d to size %d\n", x>>4, z>>4, rawBuffer.length, inputSize);
unsigned char *ucTemp2 = new unsigned char[inputSize]; unsigned char *ucTemp2 = new unsigned char[inputSize];
memcpy(ucTemp2,ucTemp,inputSize); memcpy(ucTemp2,ucTemp,inputSize);
@@ -103,6 +103,12 @@ void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException
levelIdx = ( size >> 30 ) & 3; levelIdx = ( size >> 30 ) & 3;
size &= 0x3fffffff; size &= 0x3fffffff;
const int MAX_COMPRESSED_CHUNK_SIZE = 5 * 1024 * 1024;
if(size < 0 || size > MAX_COMPRESSED_CHUNK_SIZE)
{
size = 0;
}
if(size == 0) if(size == 0)
{ {
buffer = byteArray(); buffer = byteArray();
@@ -120,7 +126,7 @@ void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException
if( success ) if( success )
{ {
Compression::getCompression()->DecompressLZXRLE( buffer.data, &outputSize, compressedBuffer.data, size); Compression::getCompression()->DecompressRLE( buffer.data, &outputSize, compressedBuffer.data, size);
} }
else else
{ {
@@ -131,7 +137,10 @@ void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException
delete [] compressedBuffer.data; delete [] compressedBuffer.data;
assert(buffer.length == outputSize); if(buffer.length != outputSize)
{
app.DebugPrintf("BlockRegionUpdatePacket: decompressed size mismatch (expected %d, got %d)\n", buffer.length, outputSize);
}
} }
} }
+7 -1
View File
@@ -10,8 +10,14 @@
//offset - the offset in the buffer of the first byte to read. //offset - the offset in the buffer of the first byte to read.
//length - the maximum number of bytes to read from the buffer. //length - the maximum number of bytes to read from the buffer.
ByteArrayInputStream::ByteArrayInputStream(byteArray buf, unsigned int offset, unsigned int length) ByteArrayInputStream::ByteArrayInputStream(byteArray buf, unsigned int offset, unsigned int length)
: pos( offset ), count( min( offset+length, buf.length ) ), mark( offset ) : pos( offset ), mark( offset )
{ {
if( offset > buf.length )
count = buf.length;
else if( length > buf.length - offset )
count = buf.length;
else
count = offset + length;
this->buf = buf; this->buf = buf;
} }
+6 -1
View File
@@ -31,7 +31,12 @@ void ByteArrayOutputStream::write(unsigned int b)
{ {
// If we will fill the buffer we need to make it bigger // If we will fill the buffer we need to make it bigger
if( count + 1 >= buf.length ) if( count + 1 >= buf.length )
buf.resize( buf.length * 2 ); {
unsigned int newSize = buf.length * 2;
if( newSize <= buf.length )
return;
buf.resize( newSize );
}
buf[count] = (byte) b; buf[count] = (byte) b;
count++; count++;
+2
View File
@@ -22,6 +22,8 @@ public:
{ {
int length = dis->readInt(); int length = dis->readInt();
if (length < 0 || length > 2 * 1024 * 1024) length = 0;
if ( data.data ) delete[] data.data; if ( data.data ) delete[] data.data;
data = byteArray(length); data = byteArray(length);
dis->readFully(data); dis->readFully(data);
@@ -51,17 +51,10 @@ ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positi
void ChunkTilesUpdatePacket::read(DataInputStream *dis) //throws IOException void ChunkTilesUpdatePacket::read(DataInputStream *dis) //throws IOException
{ {
// 4J - changed format. See comments in write method. // 4J - changed format. See comments in write method.
#ifdef _LARGE_WORLDS
xc = dis->readShort(); xc = dis->readShort();
zc = dis->readShort(); zc = dis->readShort();
xc = ( xc << 16 ) >> 16; xc = ( xc << 16 ) >> 16;
zc = ( zc << 16 ) >> 16; zc = ( zc << 16 ) >> 16;
#else
xc = dis->read();
zc = dis->read();
xc = ( xc << 24 ) >> 24;
zc = ( zc << 24 ) >> 24;
#endif
int countAndFlags = dis->readByte(); int countAndFlags = dis->readByte();
bool dataAllZero = (( countAndFlags & 0x80 ) == 0x80 ); bool dataAllZero = (( countAndFlags & 0x80 ) == 0x80 );
@@ -97,13 +90,8 @@ void ChunkTilesUpdatePacket::read(DataInputStream *dis) //throws IOException
void ChunkTilesUpdatePacket::write(DataOutputStream *dos) //throws IOException void ChunkTilesUpdatePacket::write(DataOutputStream *dos) //throws IOException
{ {
// 4J - changed format to reduce size of these packets. // 4J - changed format to reduce size of these packets.
#ifdef _LARGE_WORLDS
dos->writeShort(xc); dos->writeShort(xc);
dos->writeShort(zc); dos->writeShort(zc);
#else
dos->write(xc);
dos->write(zc);
#endif
// Determine if we've got any data elements that are non-zero - a large % of these packets set all data to zero, so we don't // Determine if we've got any data elements that are non-zero - a large % of these packets set all data to zero, so we don't
// bother sending all those zeros in that case. // bother sending all those zeros in that case.
bool dataAllZero = true; bool dataAllZero = true;
+3 -1
View File
@@ -32,7 +32,9 @@ void ComplexItemDataPacket::read(DataInputStream *dis) //throws IOException
itemType = dis->readShort(); itemType = dis->readShort();
itemId = dis->readShort(); itemId = dis->readShort();
data = charArray(dis->readUnsignedShort() & 0xffff); int dataLength = dis->readUnsignedShort() & 0xffff;
if(dataLength > 32767) dataLength = 0;
data = charArray(dataLength);
dis->readFully(data); dis->readFully(data);
} }
+3
View File
@@ -43,9 +43,12 @@ public:
} }
tags.clear(); tags.clear();
Tag *tag; Tag *tag;
int tagCount = 0;
const int MAX_COMPOUND_TAGS = 10000;
while ((tag = Tag::readNamedTag(dis))->getId() != Tag::TAG_End) while ((tag = Tag::readNamedTag(dis))->getId() != Tag::TAG_End)
{ {
tags[tag->getName()] = tag; tags[tag->getName()] = tag;
if(++tagCount >= MAX_COMPOUND_TAGS) break;
} }
delete tag; delete tag;
} }
+5 -5
View File
@@ -108,8 +108,8 @@ Connection::Connection(Socket *socket, const wstring& id, PacketListener *packet
const char *szId = wstringtofilename(id); const char *szId = wstringtofilename(id);
char readThreadName[256]; char readThreadName[256];
char writeThreadName[256]; char writeThreadName[256];
sprintf(readThreadName,"%s read\n",szId); sprintf(readThreadName, "%.240s read\n", szId);
sprintf(writeThreadName,"%s write\n",szId); sprintf(writeThreadName, "%.240s write\n", szId);
readThread = new C4JThread(runRead, (void*)this, readThreadName, READ_STACK_SIZE); readThread = new C4JThread(runRead, (void*)this, readThreadName, READ_STACK_SIZE);
writeThread = new C4JThread(runWrite, this, writeThreadName, WRITE_STACK_SIZE); writeThread = new C4JThread(runWrite, this, writeThreadName, WRITE_STACK_SIZE);
@@ -341,7 +341,7 @@ bool Connection::readTick()
// printf("Con:0x%x readTick close EOS\n",this); // printf("Con:0x%x readTick close EOS\n",this);
// 4J Stu - Remove this line // 4J Stu - Remove this line
// Fix for #10410 - UI: If the player is removed from a splitscreened hosts game, the next game that player joins will produce a message stating that the host has left. // Fix for #10410 - UI: If the player is removed from a splitscreened host’s game, the next game that player joins will produce a message stating that the host has left.
//close(DisconnectPacket::eDisconnect_EndOfStream); //close(DisconnectPacket::eDisconnect_EndOfStream);
} }
@@ -666,7 +666,7 @@ int Connection::runClose(void* lpParam)
//try { //try {
Sleep(2000); Sleep(500);
if (con->running) if (con->running)
{ {
// 4J TODO writeThread.interrupt(); // 4J TODO writeThread.interrupt();
@@ -690,7 +690,7 @@ int Connection::runSendAndQuit(void* lpParam)
//try { //try {
Sleep(2000); Sleep(500);
if (con->running) if (con->running)
{ {
// 4J TODO writeThread.interrupt(); // 4J TODO writeThread.interrupt();
@@ -32,6 +32,9 @@ void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException
{ {
containerId = dis->readByte(); containerId = dis->readByte();
int count = dis->readShort(); int count = dis->readShort();
if(count < 0 || count > 256) count = 0;
items = ItemInstanceArray(count); items = ItemInstanceArray(count);
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
+1 -1
View File
@@ -35,7 +35,7 @@ void ContainerSetSlotPacket::read(DataInputStream *dis) //throws IOException
// 4J Stu - TU-1 hotfix // 4J Stu - TU-1 hotfix
// Fix for #13142 - Holding down the A button on the furnace ingredient slot causes the UI to display incorrect item counts // Fix for #13142 - Holding down the A button on the furnace ingredient slot causes the UI to display incorrect item counts
BYTE byteId = dis->readByte(); BYTE byteId = dis->readByte();
containerId = *(char *)&byteId; containerId = (char)(signed char)byteId;
slot = dis->readShort(); slot = dis->readShort();
item = readItem(dis); item = readItem(dis);
} }
+1 -1
View File
@@ -43,7 +43,7 @@ void CustomPayloadPacket::read(DataInputStream *dis)
identifier = readUtf(dis, 20); identifier = readUtf(dis, 20);
length = dis->readShort(); length = dis->readShort();
if (length > 0 && length < Short::MAX_VALUE) if (length > 0 && length <= Short::MAX_VALUE)
{ {
if(data.data != NULL) if(data.data != NULL)
{ {
+4
View File
@@ -303,6 +303,10 @@ wstring DataInputStream::readUTF()
int b = stream->read(); int b = stream->read();
unsigned short UTFLength = (unsigned short) (((a & 0xff) << 8) | (b & 0xff)); unsigned short UTFLength = (unsigned short) (((a & 0xff) << 8) | (b & 0xff));
const unsigned short MAX_UTF_LENGTH = 32767;
if( UTFLength > MAX_UTF_LENGTH )
return outputString;
//// 4J Stu - I decided while writing DataOutputStream that we didn't need to bother using the UTF8 format //// 4J Stu - I decided while writing DataOutputStream that we didn't need to bother using the UTF8 format
//// used in the java libs, and just write in/out as wchar_t all the time //// used in the java libs, and just write in/out as wchar_t all the time
+22
View File
@@ -432,6 +432,28 @@ void DirectoryLevelStorage::save(shared_ptr<Player> player)
CompoundTag *DirectoryLevelStorage::load(shared_ptr<Player> player) CompoundTag *DirectoryLevelStorage::load(shared_ptr<Player> player)
{ {
CompoundTag *tag = loadPlayerDataTag( player->getXuid() ); CompoundTag *tag = loadPlayerDataTag( player->getXuid() );
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
if (tag == NULL)
{
const PlayerUID WIN64_XUID_BASE = (PlayerUID)0xe000d45248242f2e;
for (int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; i++)
{
PlayerUID oldXuid = WIN64_XUID_BASE + i;
tag = loadPlayerDataTag(oldXuid);
if (tag != NULL)
{
ConsoleSavePath oldFile = ConsoleSavePath(playerDir.getName() + _toString(oldXuid) + L".dat");
if (m_saveFile->doesFileExist(oldFile))
{
m_saveFile->deleteFile(m_saveFile->createFile(oldFile));
}
app.DebugPrintf("Migrated player data from old XUID %llu to new XUID %llu\n", oldXuid, player->getXuid());
break;
}
}
}
#endif
if (tag != NULL) if (tag != NULL)
{ {
player->load(tag); player->load(tag);
+2
View File
@@ -56,6 +56,8 @@ void ExplodePacket::read(DataInputStream *dis) //throws IOException
r = dis->readFloat(); r = dis->readFloat();
int count = dis->readInt(); int count = dis->readInt();
if(count < 0 || count > 32768) count = 0;
int xp = (int)x; int xp = (int)x;
int yp = (int)y; int yp = (int)y;
int zp = (int)z; int zp = (int)z;
+1 -1
View File
@@ -40,7 +40,7 @@ void GameCommandPacket::read(DataInputStream *dis)
command = (EGameCommand)dis->readInt(); command = (EGameCommand)dis->readInt();
length = dis->readShort(); length = dis->readShort();
if (length > 0 && length < Short::MAX_VALUE) if (length > 0 && length <= Short::MAX_VALUE)
{ {
if(data.data != NULL) if(data.data != NULL)
{ {
+1
View File
@@ -35,6 +35,7 @@ public:
void load(DataInput *dis, int tagDepth) void load(DataInput *dis, int tagDepth)
{ {
int length = dis->readInt(); int length = dis->readInt();
if (length < 0 || length > 65536) length = 0;
if ( data.data ) delete[] data.data; if ( data.data ) delete[] data.data;
data = intArray(length); data = intArray(length);
+2 -1
View File
@@ -1951,7 +1951,8 @@ AABBList *Level::getCubes(shared_ptr<Entity> source, AABB *box, bool noEntities/
// 4J - now add in collision for any blocks which have actually been removed, but haven't had their render data updated to reflect this yet. This is to stop the player // 4J - now add in collision for any blocks which have actually been removed, but haven't had their render data updated to reflect this yet. This is to stop the player
// being able to move the view position inside a tile which is (visually) still there, and see out of the world. This is particularly a problem when moving upwards in // being able to move the view position inside a tile which is (visually) still there, and see out of the world. This is particularly a problem when moving upwards in
// creative mode as the player can get very close to the edge of tiles whilst looking upwards and can therefore very quickly move inside one. // creative mode as the player can get very close to the edge of tiles whilst looking upwards and can therefore very quickly move inside one.
Minecraft::GetInstance()->levelRenderer->destroyedTileManager->addAABBs( this, box, &boxes); if(Minecraft::GetInstance()->levelRenderer != NULL)
Minecraft::GetInstance()->levelRenderer->destroyedTileManager->addAABBs( this, box, &boxes);
// 4J - added // 4J - added
if( noEntities ) return &boxes; if( noEntities ) return &boxes;
-1
View File
@@ -1197,7 +1197,6 @@ void LevelChunk::addEntity(shared_ptr<Entity> e)
int zc = Mth::floor(e->z / 16); int zc = Mth::floor(e->z / 16);
if (xc != this->x || zc != this->z) if (xc != this->x || zc != this->z)
{ {
app.DebugPrintf("Wrong location!");
// System.out.println("Wrong location! " + e); // System.out.println("Wrong location! " + e);
// Thread.dumpStack(); // Thread.dumpStack();
} }
+2
View File
@@ -37,11 +37,13 @@ public:
} }
type = dis->readByte(); type = dis->readByte();
int size = dis->readInt(); int size = dis->readInt();
if (size < 0 || size > 10000) size = 0;
list.clear(); list.clear();
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
Tag *tag = Tag::newTag(type, L""); Tag *tag = Tag::newTag(type, L"");
if (tag == NULL) break;
tag->load(dis, tagDepth); tag->load(dis, tagDepth);
list.push_back(tag); list.push_back(tag);
} }
-4
View File
@@ -123,10 +123,8 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException
m_isGuest = dis->readBoolean(); m_isGuest = dis->readBoolean();
m_newSeaLevel = dis->readBoolean(); m_newSeaLevel = dis->readBoolean();
m_uiGamePrivileges = dis->readInt(); m_uiGamePrivileges = dis->readInt();
#ifdef _LARGE_WORLDS
m_xzSize = dis->readShort(); m_xzSize = dis->readShort();
m_hellScale = dis->read(); m_hellScale = dis->read();
#endif
app.DebugPrintf("LoginPacket::read - Difficulty = %d\n",difficulty); app.DebugPrintf("LoginPacket::read - Difficulty = %d\n",difficulty);
} }
@@ -160,10 +158,8 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException
dos->writeBoolean(m_isGuest); dos->writeBoolean(m_isGuest);
dos->writeBoolean(m_newSeaLevel); dos->writeBoolean(m_newSeaLevel);
dos->writeInt(m_uiGamePrivileges); dos->writeInt(m_uiGamePrivileges);
#ifdef _LARGE_WORLDS
dos->writeShort(m_xzSize); dos->writeShort(m_xzSize);
dos->write(m_hellScale); dos->write(m_hellScale);
#endif
} }
void LoginPacket::handle(PacketListener *listener) void LoginPacket::handle(PacketListener *listener)
+2 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="ContentPackage_NO_TU|Durango"> <ProjectConfiguration Include="ContentPackage_NO_TU|Durango">
@@ -201,6 +201,7 @@
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Durango'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Durango'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
+14 -15
View File
@@ -476,29 +476,28 @@ LevelChunk *OldChunkStorage::load(Level *level, DataInputStream *dis)
CompoundTag *tag = NbtIo::read(dis); CompoundTag *tag = NbtIo::read(dis);
loadEntities(levelChunk, level, tag); if (tag != NULL)
if (tag->contains(L"TileTicks"))
{ {
PIXBeginNamedEvent(0,"Loading TileTicks"); loadEntities(levelChunk, level, tag);
ListTag<CompoundTag> *tileTicks = (ListTag<CompoundTag> *) tag->getList(L"TileTicks");
if (tileTicks != NULL) if (tag->contains(L"TileTicks"))
{ {
for (int i = 0; i < tileTicks->size(); i++) ListTag<CompoundTag> *tileTicks = (ListTag<CompoundTag> *) tag->getList(L"TileTicks");
{
CompoundTag *teTag = tileTicks->get(i);
level->forceAddTileTick(teTag->getInt(L"x"), teTag->getInt(L"y"), teTag->getInt(L"z"), teTag->getInt(L"i"), teTag->getInt(L"t"), teTag->getInt(L"p")); if (tileTicks != NULL)
{
for (int i = 0; i < tileTicks->size(); i++)
{
CompoundTag *teTag = tileTicks->get(i);
level->forceAddTileTick(teTag->getInt(L"x"), teTag->getInt(L"y"), teTag->getInt(L"z"), teTag->getInt(L"i"), teTag->getInt(L"t"));
}
} }
} }
PIXEndNamedEvent();
delete tag;
} }
delete tag;
PIXEndNamedEvent();
return levelChunk; return levelChunk;
} }
+21 -17
View File
@@ -268,7 +268,13 @@ void Packet::updatePacketStatsPIX()
shared_ptr<Packet> Packet::getPacket(int id) shared_ptr<Packet> Packet::getPacket(int id)
{ {
// 4J: Removed try/catch // 4J: Removed try/catch
return idToCreateMap[id](); #ifdef __PS3__
boost::unordered_map<int, packetCreateFn>::iterator it = idToCreateMap.find(id);
#else
auto it = idToCreateMap.find(id);
#endif
if (it == idToCreateMap.end()) return shared_ptr<Packet>();
return it->second();
} }
void Packet::writeBytes(DataOutputStream *dataoutputstream, byteArray bytes) void Packet::writeBytes(DataOutputStream *dataoutputstream, byteArray bytes)
@@ -330,13 +336,12 @@ shared_ptr<Packet> Packet::readPacket(DataInputStream *dis, bool isServer) // th
if ((isServer && serverReceivedPackets.find(id) == serverReceivedPackets.end()) || (!isServer && clientReceivedPackets.find(id) == clientReceivedPackets.end())) if ((isServer && serverReceivedPackets.find(id) == serverReceivedPackets.end()) || (!isServer && clientReceivedPackets.find(id) == clientReceivedPackets.end()))
{ {
//app.DebugPrintf("Bad packet id %d\n", id); //app.DebugPrintf("Bad packet id %d\n", id);
__debugbreak(); return nullptr;
assert(false);
// throw new IOException(wstring(L"Bad packet id ") + _toString<int>(id)); // throw new IOException(wstring(L"Bad packet id ") + _toString<int>(id));
} }
packet = getPacket(id); packet = getPacket(id);
if (packet == NULL) assert(false);//throw new IOException(wstring(L"Bad packet id ") + _toString<int>(id)); if (packet == NULL) return nullptr;//throw new IOException(wstring(L"Bad packet id ") + _toString<int>(id));
//app.DebugPrintf("%s reading packet %d\n", isServer ? "Server" : "Client", packet->getId()); //app.DebugPrintf("%s reading packet %d\n", isServer ? "Server" : "Client", packet->getId());
packet->read(dis); packet->read(dis);
@@ -394,17 +399,9 @@ wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOExcepti
{ {
short stringLength = dis->readShort(); short stringLength = dis->readShort();
if (stringLength > maxLength) if (stringLength > maxLength || stringLength < 0)
{ {
wstringstream stream; return L"";
stream << L"Received string length longer than maximum allowed (" << stringLength << " > " << maxLength << ")";
assert(false);
// throw new IOException( stream.str() );
}
if (stringLength < 0)
{
assert(false);
// throw new IOException(L"Received string length is less than zero! Weird string!");
} }
wstring builder = L""; wstring builder = L"";
@@ -507,7 +504,7 @@ shared_ptr<ItemInstance> Packet::readItem(DataInputStream *dis)
{ {
shared_ptr<ItemInstance> item = nullptr; shared_ptr<ItemInstance> item = nullptr;
int id = dis->readShort(); int id = dis->readShort();
if (id >= 0) if (id >= 0 && id < 32000) // validate against Item::ITEM_NUM_COUNT
{ {
int count = dis->readByte(); int count = dis->readByte();
int damage = dis->readShort(); int damage = dis->readShort();
@@ -545,9 +542,16 @@ void Packet::writeItem(shared_ptr<ItemInstance> item, DataOutputStream *dos)
CompoundTag *Packet::readNbt(DataInputStream *dis) CompoundTag *Packet::readNbt(DataInputStream *dis)
{ {
int size = dis->readShort(); int size = dis->readShort();
if (size < 0) return NULL; if (size <= 0) return NULL;
const int MAX_NBT_SIZE = 32767;
if (size > MAX_NBT_SIZE) return NULL;
byteArray buff(size); byteArray buff(size);
dis->readFully(buff); if (!dis->readFully(buff))
{
delete [] buff.data;
return NULL;
}
CompoundTag *result = (CompoundTag *) NbtIo::decompress(buff); CompoundTag *result = (CompoundTag *) NbtIo::decompress(buff);
delete [] buff.data; delete [] buff.data;
return result; return result;
+2
View File
@@ -62,6 +62,7 @@ void PreLoginPacket::read(DataInputStream *dis) //throws IOException
m_friendsOnlyBits = dis->readByte(); m_friendsOnlyBits = dis->readByte();
m_ugcPlayersVersion = dis->readInt(); m_ugcPlayersVersion = dis->readInt();
m_dwPlayerCount = dis->readByte(); m_dwPlayerCount = dis->readByte();
if( m_dwPlayerCount > MINECRAFT_NET_MAX_PLAYERS ) m_dwPlayerCount = MINECRAFT_NET_MAX_PLAYERS;
if( m_dwPlayerCount > 0 ) if( m_dwPlayerCount > 0 )
{ {
m_playerXuids = new PlayerUID[m_dwPlayerCount]; m_playerXuids = new PlayerUID[m_dwPlayerCount];
@@ -74,6 +75,7 @@ void PreLoginPacket::read(DataInputStream *dis) //throws IOException
{ {
m_szUniqueSaveName[i]=dis->readByte(); m_szUniqueSaveName[i]=dis->readByte();
} }
m_szUniqueSaveName[m_iSaveNameLen - 1] = 0;
m_serverSettings = dis->readInt(); m_serverSettings = dis->readInt();
m_hostIndex = dis->readByte(); m_hostIndex = dis->readByte();
+1 -1
View File
@@ -778,7 +778,7 @@ void RandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
mineShaftFeature->postProcess(level, pprandom, xt, zt); mineShaftFeature->postProcess(level, pprandom, xt, zt);
hasVillage = villageFeature->postProcess(level, pprandom, xt, zt); hasVillage = villageFeature->postProcess(level, pprandom, xt, zt);
strongholdFeature->postProcess(level, pprandom, xt, zt); strongholdFeature->postProcess(level, pprandom, xt, zt);
scatteredFeature->postProcess(level, random, xt, zt); scatteredFeature->postProcess(level, pprandom, xt, zt);
} }
PIXEndNamedEvent(); PIXEndNamedEvent();
+6 -1
View File
@@ -38,7 +38,12 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
} }
*/ */
fileEntry = m_saveFile->createFile( fileName->getName() ); wstring saveName = fileName->getPath();
for (size_t i = 0; i < saveName.size(); i++)
{
if (saveName[i] == L'\\') saveName[i] = L'/';
}
fileEntry = m_saveFile->createFile( ConsoleSavePath(saveName) );
m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_END ); m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_END );
if ( fileEntry->getFileSize() < SECTOR_BYTES) if ( fileEntry->getFileSize() < SECTOR_BYTES)
+6 -7
View File
@@ -17,7 +17,7 @@ bool RegionFileCache::useSplitSaves(ESavePlatform platform)
}; };
} }
RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) // 4J - TODO was synchronized RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) // 4J - synchronized restored
{ {
// 4J Jev - changed back to use of the File class. // 4J Jev - changed back to use of the File class.
//char file[MAX_PATH_SIZE]; //char file[MAX_PATH_SIZE];
@@ -26,6 +26,7 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst
//File regionDir(basePath, L"region"); //File regionDir(basePath, L"region");
//File file(regionDir, wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" ); //File file(regionDir, wstring(L"r.") + _toString(chunkX>>5) + L"." + _toString(chunkZ>>5) + L".mcr" );
EnterCriticalSection(&m_cs);
MemSect(31); MemSect(31);
File file; File file;
if(useSplitSaves(saveFile->getSavePlatform())) if(useSplitSaves(saveFile->getSavePlatform()))
@@ -46,6 +47,7 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst
// 4J Jev, put back in. // 4J Jev, put back in.
if (ref != NULL) if (ref != NULL)
{ {
LeaveCriticalSection(&m_cs);
return ref; return ref;
} }
@@ -63,12 +65,14 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst
RegionFile *reg = new RegionFile(saveFile, &file); RegionFile *reg = new RegionFile(saveFile, &file);
cache[file] = reg; // 4J - this was originally a softReferenc cache[file] = reg; // 4J - this was originally a softReferenc
LeaveCriticalSection(&m_cs);
return reg; return reg;
} }
void RegionFileCache::_clear() // 4J - TODO was synchronized void RegionFileCache::_clear() // 4J - TODO was synchronized
{ {
EnterCriticalSection(&m_cs);
AUTO_VAR(itEnd, cache.end()); AUTO_VAR(itEnd, cache.end());
for( AUTO_VAR(it, cache.begin()); it != itEnd; it++ ) for( AUTO_VAR(it, cache.begin()); it != itEnd; it++ )
{ {
@@ -85,6 +89,7 @@ void RegionFileCache::_clear() // 4J - TODO was synchronized
// } // }
} }
cache.clear(); cache.clear();
LeaveCriticalSection(&m_cs);
} }
int RegionFileCache::_getSizeDelta(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ) int RegionFileCache::_getSizeDelta(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ)
@@ -120,9 +125,3 @@ DataOutputStream *RegionFileCache::_getChunkDataOutputStream(ConsoleSaveFile *sa
return r->getChunkDataOutputStream(chunkX & 31, chunkZ & 31); return r->getChunkDataOutputStream(chunkX & 31, chunkZ & 31);
} }
} }
RegionFileCache::~RegionFileCache()
{
_clear();
}
+3 -2
View File
@@ -10,13 +10,14 @@ private:
static const int MAX_CACHE_SIZE = 256; static const int MAX_CACHE_SIZE = 256;
unordered_map<File, RegionFile *, FileKeyHash, FileKeyEq> cache; unordered_map<File, RegionFile *, FileKeyHash, FileKeyEq> cache;
CRITICAL_SECTION m_cs;
static RegionFileCache s_defaultCache; static RegionFileCache s_defaultCache;
public: public:
// Made public and non-static so we can have a cache for input and output files // Made public and non-static so we can have a cache for input and output files
RegionFileCache() {} RegionFileCache() { InitializeCriticalSectionAndSpinCount(&m_cs, 4000); }
~RegionFileCache(); ~RegionFileCache() { DeleteCriticalSection(&m_cs); _clear(); }
RegionFile *_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); // 4J - TODO was synchronized RegionFile *_getRegionFile(ConsoleSaveFile *saveFile, const wstring &prefix, int chunkX, int chunkZ); // 4J - TODO was synchronized
void _clear(); // 4J - TODO was synchronized void _clear(); // 4J - TODO was synchronized
+3 -1
View File
@@ -21,7 +21,9 @@ RemoveEntitiesPacket::~RemoveEntitiesPacket()
void RemoveEntitiesPacket::read(DataInputStream *dis) //throws IOException void RemoveEntitiesPacket::read(DataInputStream *dis) //throws IOException
{ {
ids = intArray(dis->readByte()); int count = dis->readByte();
if(count < 0) count = 0;
ids = intArray(count);
for(unsigned int i = 0; i < ids.length; ++i) for(unsigned int i = 0; i < ids.length; ++i)
{ {
ids[i] = dis->readInt(); ids[i] = dis->readInt();
-4
View File
@@ -55,10 +55,8 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException
difficulty = dis->readByte(); difficulty = dis->readByte();
m_newSeaLevel = dis->readBoolean(); m_newSeaLevel = dis->readBoolean();
m_newEntityId = dis->readShort(); m_newEntityId = dis->readShort();
#ifdef _LARGE_WORLDS
m_xzSize = dis->readShort(); m_xzSize = dis->readShort();
m_hellScale = dis->read(); m_hellScale = dis->read();
#endif
app.DebugPrintf("RespawnPacket::read - Difficulty = %d\n",difficulty); app.DebugPrintf("RespawnPacket::read - Difficulty = %d\n",difficulty);
} }
@@ -80,10 +78,8 @@ void RespawnPacket::write(DataOutputStream *dos) //throws IOException
dos->writeByte(difficulty); dos->writeByte(difficulty);
dos->writeBoolean(m_newSeaLevel); dos->writeBoolean(m_newSeaLevel);
dos->writeShort(m_newEntityId); dos->writeShort(m_newEntityId);
#ifdef _LARGE_WORLDS
dos->writeShort(m_xzSize); dos->writeShort(m_xzSize);
dos->write(m_hellScale); dos->write(m_hellScale);
#endif
} }
int RespawnPacket::getEstimatedSize() int RespawnPacket::getEstimatedSize()
+5
View File
@@ -138,6 +138,11 @@ void Socket::pushDataToQueue(const BYTE * pbData, DWORD dwDataSize, bool fromHos
} }
EnterCriticalSection(&m_queueLockNetwork[queueIdx]); EnterCriticalSection(&m_queueLockNetwork[queueIdx]);
if(m_queueNetwork[queueIdx].size() + dwDataSize > 2 * 1024 * 1024)
{
LeaveCriticalSection(&m_queueLockNetwork[queueIdx]);
return;
}
for( unsigned int i = 0; i < dwDataSize; i++ ) for( unsigned int i = 0; i < dwDataSize; i++ )
{ {
m_queueNetwork[queueIdx].push(*pbData++); m_queueNetwork[queueIdx].push(*pbData++);
+3 -2
View File
@@ -602,9 +602,10 @@ bool SparseDataStorage::isCompressed()
void SparseDataStorage::write(DataOutputStream *dos) void SparseDataStorage::write(DataOutputStream *dos)
{ {
int count = ( dataAndCount >> 48 ) & 0xffff; __int64 snapshot = dataAndCount;
int count = ( snapshot >> 48 ) & 0xffff;
dos->writeInt(count); dos->writeInt(count);
unsigned char *dataPointer = (unsigned char *)(dataAndCount & 0x0000ffffffffffff); unsigned char *dataPointer = (unsigned char *)(snapshot & 0x0000ffffffffffff);
byteArray wrapper(dataPointer, count * 128 + 128); byteArray wrapper(dataPointer, count * 128 + 128);
dos->write(wrapper); dos->write(wrapper);
} }
+3 -2
View File
@@ -619,9 +619,10 @@ bool SparseLightStorage::isCompressed()
void SparseLightStorage::write(DataOutputStream *dos) void SparseLightStorage::write(DataOutputStream *dos)
{ {
int count = ( dataAndCount >> 48 ) & 0xffff; __int64 snapshot = dataAndCount;
int count = ( snapshot >> 48 ) & 0xffff;
dos->writeInt(count); dos->writeInt(count);
unsigned char *dataPointer = (unsigned char *)(dataAndCount & 0x0000ffffffffffff); unsigned char *dataPointer = (unsigned char *)(snapshot & 0x0000ffffffffffff);
byteArray wrapper(dataPointer, count * 128 + 128); byteArray wrapper(dataPointer, count * 128 + 128);
dos->write(wrapper); dos->write(wrapper);
} }
+2 -2
View File
@@ -222,7 +222,7 @@ StructurePiece *StrongholdPieces::generateAndAddPiece(StartPiece *startPiece, li
if(piece->pieceClass != EPieceClass_PortalRoom) continue; if(piece->pieceClass != EPieceClass_PortalRoom) continue;
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Portal room forcing attempt\n"); app.DebugPrintf("Portal room forcing attempt\n");
#endif #endif
StrongholdPiece *strongholdPiece = PortalRoom::createPiece(pieces, random, footX, footY, footZ, direction, depth); StrongholdPiece *strongholdPiece = PortalRoom::createPiece(pieces, random, footX, footY, footZ, direction, depth);
if (strongholdPiece != NULL) if (strongholdPiece != NULL)
@@ -235,7 +235,7 @@ StructurePiece *StrongholdPieces::generateAndAddPiece(StartPiece *startPiece, li
currentPieces.remove(piece); currentPieces.remove(piece);
} }
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
printf("Success\n"); app.DebugPrintf("Success\n");
#endif #endif
return strongholdPiece; return strongholdPiece;
} }
+23
View File
@@ -9,6 +9,7 @@
StructureFeature::StructureFeature() StructureFeature::StructureFeature()
{ {
InitializeCriticalSectionAndSpinCount(&m_csCachedStructures, 4000);
#ifdef ENABLE_STRUCTURE_SAVING #ifdef ENABLE_STRUCTURE_SAVING
savedData = nullptr; savedData = nullptr;
#endif #endif
@@ -16,10 +17,13 @@ StructureFeature::StructureFeature()
StructureFeature::~StructureFeature() StructureFeature::~StructureFeature()
{ {
EnterCriticalSection(&m_csCachedStructures);
for( AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); it++ ) for( AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); it++ )
{ {
delete it->second; delete it->second;
} }
LeaveCriticalSection(&m_csCachedStructures);
DeleteCriticalSection(&m_csCachedStructures);
} }
void StructureFeature::addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks) void StructureFeature::addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks)
@@ -28,12 +32,16 @@ void StructureFeature::addFeature(Level *level, int x, int z, int xOffs, int zOf
// the chunk being generated, but not all chunks are the sources of // the chunk being generated, but not all chunks are the sources of
// structures // structures
EnterCriticalSection(&m_csCachedStructures);
restoreSavedData(level); restoreSavedData(level);
if (cachedStructures.find(ChunkPos::hashCode(x, z)) != cachedStructures.end()) if (cachedStructures.find(ChunkPos::hashCode(x, z)) != cachedStructures.end())
{ {
LeaveCriticalSection(&m_csCachedStructures);
return; return;
} }
LeaveCriticalSection(&m_csCachedStructures);
// clear random key // clear random key
random->nextInt(); random->nextInt();
@@ -41,7 +49,9 @@ void StructureFeature::addFeature(Level *level, int x, int z, int xOffs, int zOf
if (isFeatureChunk(x, z,level->getLevelData()->getGenerator() == LevelType::lvl_flat)) if (isFeatureChunk(x, z,level->getLevelData()->getGenerator() == LevelType::lvl_flat))
{ {
StructureStart *start = createStructureStart(x, z); StructureStart *start = createStructureStart(x, z);
EnterCriticalSection(&m_csCachedStructures);
cachedStructures[ChunkPos::hashCode(x, z)] = start; cachedStructures[ChunkPos::hashCode(x, z)] = start;
LeaveCriticalSection(&m_csCachedStructures);
saveFeature(x, z, start); saveFeature(x, z, start);
} }
} }
@@ -58,6 +68,7 @@ bool StructureFeature::postProcess(Level *level, Random *random, int chunkX, int
int cz = (chunkZ << 4); // + 8; int cz = (chunkZ << 4); // + 8;
bool intersection = false; bool intersection = false;
EnterCriticalSection(&m_csCachedStructures);
for( AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); it++ ) for( AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); it++ )
{ {
StructureStart *structureStart = it->second; StructureStart *structureStart = it->second;
@@ -76,12 +87,14 @@ bool StructureFeature::postProcess(Level *level, Random *random, int chunkX, int
} }
} }
} }
LeaveCriticalSection(&m_csCachedStructures);
return intersection; return intersection;
} }
bool StructureFeature::isIntersection(int cellX, int cellZ) bool StructureFeature::isIntersection(int cellX, int cellZ)
{ {
EnterCriticalSection(&m_csCachedStructures);
restoreSavedData(level); restoreSavedData(level);
for( AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); it++ ) for( AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); it++ )
@@ -97,12 +110,14 @@ bool StructureFeature::isIntersection(int cellX, int cellZ)
StructurePiece *next = *it2++; StructurePiece *next = *it2++;
if (next->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ)) if (next->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ))
{ {
LeaveCriticalSection(&m_csCachedStructures);
return true; return true;
} }
} }
} }
} }
} }
LeaveCriticalSection(&m_csCachedStructures);
return false; return false;
} }
@@ -114,6 +129,7 @@ bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ)
StructureStart *StructureFeature::getStructureAt(int cellX, int cellY, int cellZ) StructureStart *StructureFeature::getStructureAt(int cellX, int cellY, int cellZ)
{ {
EnterCriticalSection(&m_csCachedStructures);
//for (StructureStart structureStart : cachedStructures.values()) //for (StructureStart structureStart : cachedStructures.values())
for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it) for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it)
{ {
@@ -138,12 +154,14 @@ StructureStart *StructureFeature::getStructureAt(int cellX, int cellY, int cellZ
StructurePiece* piece = *it2; StructurePiece* piece = *it2;
if ( piece->getBoundingBox()->isInside(cellX, cellY, cellZ) ) if ( piece->getBoundingBox()->isInside(cellX, cellY, cellZ) )
{ {
LeaveCriticalSection(&m_csCachedStructures);
return pStructureStart; return pStructureStart;
} }
} }
} }
} }
} }
LeaveCriticalSection(&m_csCachedStructures);
return NULL; return NULL;
} }
@@ -151,14 +169,17 @@ bool StructureFeature::isInsideBoundingFeature(int cellX, int cellY, int cellZ)
{ {
restoreSavedData(level); restoreSavedData(level);
EnterCriticalSection(&m_csCachedStructures);
for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it) for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it)
{ {
StructureStart *structureStart = it->second; StructureStart *structureStart = it->second;
if (structureStart->isValid()) if (structureStart->isValid())
{ {
LeaveCriticalSection(&m_csCachedStructures);
return (structureStart->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ)); return (structureStart->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ));
} }
} }
LeaveCriticalSection(&m_csCachedStructures);
return false; return false;
} }
@@ -182,6 +203,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
double minDistance = DBL_MAX; double minDistance = DBL_MAX;
TilePos *selected = NULL; TilePos *selected = NULL;
EnterCriticalSection(&m_csCachedStructures);
for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it) for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it)
{ {
StructureStart *pStructureStart = it->second; StructureStart *pStructureStart = it->second;
@@ -205,6 +227,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i
} }
} }
} }
LeaveCriticalSection(&m_csCachedStructures);
if (selected != NULL) if (selected != NULL)
{ {
return selected; return selected;
+1
View File
@@ -27,6 +27,7 @@ private:
protected: protected:
unordered_map<__int64, StructureStart *> cachedStructures; unordered_map<__int64, StructureStart *> cachedStructures;
CRITICAL_SECTION m_csCachedStructures;
public: public:
StructureFeature(); StructureFeature();
+4 -1
View File
@@ -343,8 +343,10 @@ vector<shared_ptr<SynchedEntityData::DataItem> > *SynchedEntityData::unpack(Data
vector<shared_ptr<DataItem> > *result = NULL; vector<shared_ptr<DataItem> > *result = NULL;
int currentHeader = input->readByte(); int currentHeader = input->readByte();
int itemCount = 0;
const int MAX_ENTITY_DATA_ITEMS = 256;
while (currentHeader != EOF_MARKER) while (currentHeader != EOF_MARKER && itemCount < MAX_ENTITY_DATA_ITEMS)
{ {
if (result == NULL) if (result == NULL)
@@ -399,6 +401,7 @@ vector<shared_ptr<SynchedEntityData::DataItem> > *SynchedEntityData::unpack(Data
break; break;
} }
result->push_back(item); result->push_back(item);
itemCount++;
currentHeader = input->readByte(); currentHeader = input->readByte();
} }
+26 -5
View File
@@ -84,27 +84,48 @@ Tag *Tag::readNamedTag(DataInput *dis)
Tag *Tag::readNamedTag(DataInput *dis, int tagDepth) Tag *Tag::readNamedTag(DataInput *dis, int tagDepth)
{ {
static __declspec(thread) int depth = 0;
static __declspec(thread) int totalTagCount = 0;
if (depth == 0)
totalTagCount = 0;
depth++;
if (depth > 256)
{
depth--;
return new EndTag();
}
totalTagCount++;
const int MAX_TOTAL_TAGS = 32768;
if (totalTagCount > MAX_TOTAL_TAGS)
{
depth--;
return new EndTag();
}
byte type = dis->readByte(); byte type = dis->readByte();
if (type == 0) return new EndTag(); if (type == 0) { depth--; return new EndTag(); }
// 4J Stu - readByte can return -1, so if it's that then also mark as the end tag // 4J Stu - readByte can return -1, so if it's that then also mark as the end tag
if(type == 255) if(type == 255)
{ {
app.DebugPrintf("readNamedTag read a type of 255\n"); depth--;
#ifndef _CONTENT_PACKAGE
__debugbreak();
#endif
return new EndTag(); return new EndTag();
} }
wstring name = dis->readUTF();//new String(bytes, "UTF-8"); wstring name = dis->readUTF();//new String(bytes, "UTF-8");
Tag *tag = newTag(type, name); Tag *tag = newTag(type, name);
if (tag == NULL) { depth--; return new EndTag(); }
// short length = dis.readShort(); // short length = dis.readShort();
// byte[] bytes = new byte[length]; // byte[] bytes = new byte[length];
// dis.readFully(bytes); // dis.readFully(bytes);
tag->load(dis, tagDepth); tag->load(dis, tagDepth);
depth--;
return tag; return tag;
} }

Some files were not shown because too many files have changed in this diff Show More