Compare commits
39
Commits
networking
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3e5c54847 | ||
|
|
82e802873f | ||
|
|
ecb1a93444 | ||
|
|
6a49df36cc | ||
|
|
bad3a41225 | ||
|
|
46caf4727c | ||
|
|
47ea98fc86 | ||
|
|
d0362d2458 | ||
|
|
82783c0812 | ||
|
|
bd0cc59a54 | ||
|
|
81d41a6a04 | ||
|
|
0031cae3e3 | ||
|
|
251cd8e304 | ||
|
|
df2a4d85ef | ||
|
|
b737c3eccb | ||
|
|
77a4ee39b5 | ||
|
|
7fb2db5ed7 | ||
|
|
90a2391e92 | ||
|
|
36afa4a59f | ||
|
|
eb317d8fbd | ||
|
|
af2040a849 | ||
|
|
9cba342973 | ||
|
|
8055f4dfc7 | ||
|
|
3ea3c08372 | ||
|
|
9a729de7c3 | ||
|
|
274f2ddc61 | ||
|
|
831ec7292d | ||
|
|
13285fbffa | ||
|
|
3866e525f1 | ||
|
|
9254fbcdb3 | ||
|
|
e8d19516e6 | ||
|
|
8bae3cfbc1 | ||
|
|
7f4227d902 | ||
|
|
d9327ff1f5 | ||
|
|
d770e58992 | ||
|
|
0889edf3bd | ||
|
|
6e13d5d4c0 | ||
|
|
cffdcb1971 | ||
|
|
eb80f3e52b |
No files matched your search
@@ -39,3 +39,4 @@
|
|||||||
*.opensdf
|
*.opensdf
|
||||||
*.v11.suo
|
*.v11.suo
|
||||||
*.vcxproj.user
|
*.vcxproj.user
|
||||||
|
*.aps
|
||||||
+5
-3
@@ -1,3 +1,5 @@
|
|||||||
[submodule "Minecraft.Server"]
|
[submodule "Minecraft.Client/Windows64/4JLibs"]
|
||||||
path = Minecraft.Server
|
path = Minecraft.Client/Windows64/4JLibs
|
||||||
url = https://gitea.str1k3r.xyz/cafeberry/Cafeberry-Server.git
|
url = https://gitea.str1k3r.xyz/pieeebot/Cafeberry-4JLibs
|
||||||
|
ignore = untracked
|
||||||
|
branch = main
|
||||||
@@ -402,7 +402,6 @@ 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);
|
||||||
@@ -740,9 +739,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 && tileId != 0xff)
|
if (tileId > 0)
|
||||||
{
|
{
|
||||||
if (currentLayer == 0 && Tile::tiles[tileId] && Tile::tiles[tileId]->isEntityTile())
|
if (currentLayer == 0 && 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))
|
||||||
@@ -755,7 +754,6 @@ 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)
|
||||||
|
|||||||
@@ -50,16 +50,11 @@
|
|||||||
#else
|
#else
|
||||||
#include "Common\UI\UI.h"
|
#include "Common\UI\UI.h"
|
||||||
#endif
|
#endif
|
||||||
#if defined __PS3__ && !defined DISABLE_PSN
|
#ifdef __PS3__
|
||||||
#include "PS3/Network/SonyVoiceChat.h"
|
#include "PS3/Network/SonyVoiceChat.h"
|
||||||
#endif
|
#endif
|
||||||
#include "DLCTexturePack.h"
|
#include "DLCTexturePack.h"
|
||||||
|
|
||||||
#if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE
|
|
||||||
#include "Xbox\Network\NetworkPlayerXbox.h"
|
|
||||||
#include "Common\Network\PlatformNetworkManager.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _DURANGO
|
#ifdef _DURANGO
|
||||||
#include "..\Minecraft.World\DurangoStats.h"
|
#include "..\Minecraft.World\DurangoStats.h"
|
||||||
#include "..\Minecraft.World\GenericStats.h"
|
#include "..\Minecraft.World\GenericStats.h"
|
||||||
@@ -776,7 +771,6 @@ 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
|
||||||
@@ -787,32 +781,6 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
|
|||||||
player->m_displayName = player->name;
|
player->m_displayName = player->name;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE
|
|
||||||
{
|
|
||||||
PlayerUID netXuid = packet->OnlineXuid;
|
|
||||||
const PlayerUID WIN64_XUID_BASE = (PlayerUID)0xe000d45248242f2e;
|
|
||||||
if (netXuid >= WIN64_XUID_BASE && netXuid < WIN64_XUID_BASE + MINECRAFT_NET_MAX_PLAYERS)
|
|
||||||
{
|
|
||||||
BYTE smallId = (BYTE)(netXuid - WIN64_XUID_BASE);
|
|
||||||
INetworkPlayer *np = g_NetworkManager.GetPlayerBySmallId(smallId);
|
|
||||||
if (np != NULL)
|
|
||||||
{
|
|
||||||
NetworkPlayerXbox *npx = (NetworkPlayerXbox *)np;
|
|
||||||
IQNetPlayer *qp = npx->GetQNetPlayer();
|
|
||||||
if (qp != NULL)
|
|
||||||
{
|
|
||||||
wcsncpy(qp->m_gamertag, packet->name.c_str(), 31);
|
|
||||||
qp->m_gamertag[31] = L'\0';
|
|
||||||
if (g_NetworkManager.IsHost())
|
|
||||||
{
|
|
||||||
g_NetworkManager.UpdateAndSetGameSessionData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// printf("\t\t\t\t%d: Add player\n",packet->id,packet->yRot);
|
// printf("\t\t\t\t%d: Add player\n",packet->id,packet->yRot);
|
||||||
|
|
||||||
int item = packet->carriedItem;
|
int item = packet->carriedItem;
|
||||||
@@ -1036,7 +1004,6 @@ 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 )
|
||||||
{
|
{
|
||||||
@@ -1106,7 +1073,6 @@ 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 )
|
||||||
{
|
{
|
||||||
@@ -1164,8 +1130,6 @@ 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 )
|
||||||
{
|
{
|
||||||
@@ -1805,7 +1769,6 @@ void ClientConnection::handleEntityActionAtPosition(shared_ptr<EntityActionAtPos
|
|||||||
|
|
||||||
void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||||
{
|
{
|
||||||
app.DebugPrintf("ClientConnection::handlePreLogin ENTER (user %d)\n", m_userIndex);
|
|
||||||
// printf("Client: handlePreLogin\n");
|
// printf("Client: handlePreLogin\n");
|
||||||
#if 1
|
#if 1
|
||||||
// 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set
|
// 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set
|
||||||
@@ -1828,7 +1791,6 @@ 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() )
|
||||||
@@ -1972,16 +1934,6 @@ 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;
|
||||||
@@ -1989,7 +1941,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
isAtLeastOneFriend = TRUE;
|
isAtLeastOneFriend = TRUE;
|
||||||
cantPlayContentRestricted= FALSE;
|
cantPlayContentRestricted= FALSE;
|
||||||
|
|
||||||
#if !defined DISABLE_PSN && ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
#if ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||||
|
|
||||||
if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends))
|
if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends))
|
||||||
{
|
{
|
||||||
@@ -2271,7 +2223,6 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
}
|
}
|
||||||
BOOL allAllowed, friendsAllowed;
|
BOOL allAllowed, friendsAllowed;
|
||||||
ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed);
|
ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed);
|
||||||
app.DebugPrintf("ClientConnection::handlePreLogin SENDING LoginPacket (user %d)\n", m_userIndex);
|
|
||||||
send( shared_ptr<LoginPacket>( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE),
|
send( shared_ptr<LoginPacket>( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE),
|
||||||
packet->m_ugcPlayersVersion, app.GetPlayerSkinId(m_userIndex), app.GetPlayerCapeId(m_userIndex), ProfileManager.IsGuest( m_userIndex ))));
|
packet->m_ugcPlayersVersion, app.GetPlayerSkinId(m_userIndex), app.GetPlayerCapeId(m_userIndex), ProfileManager.IsGuest( m_userIndex ))));
|
||||||
|
|
||||||
@@ -2322,7 +2273,6 @@ 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;
|
||||||
@@ -3566,12 +3516,10 @@ 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 = dynamic_cast<UIScene_TradingMenu *>(scene);
|
UIScene_TradingMenu *screen = (UIScene_TradingMenu *)scene;
|
||||||
if (screen != NULL)
|
|
||||||
trader = screen->getMerchant();
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ MOJANG_DATA;
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
eDLCContentType eDLCType;
|
eDLCContentType eDLCType;
|
||||||
#if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
#if defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||||
char chImageURL[256];//SCE_NP_COMMERCE2_URL_LEN
|
char chImageURL[256];//SCE_NP_COMMERCE2_URL_LEN
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void SoundEngine::playMusicTick() {};
|
|||||||
#ifdef _WINDOWS64
|
#ifdef _WINDOWS64
|
||||||
char SoundEngine::m_szSoundPath[]={"Windows64Media\\Sound\\"};
|
char SoundEngine::m_szSoundPath[]={"Windows64Media\\Sound\\"};
|
||||||
char SoundEngine::m_szMusicPath[]={"music\\"};
|
char SoundEngine::m_szMusicPath[]={"music\\"};
|
||||||
char SoundEngine::m_szRedistName[]={"redist64"};
|
char SoundEngine::m_szRedistName[]={"Windows64\\redist64"}; //str1k3r - moved this to a the Windows64 dir so its out of plain view
|
||||||
#elif defined _DURANGO
|
#elif defined _DURANGO
|
||||||
char SoundEngine::m_szSoundPath[]={"Sound\\"};
|
char SoundEngine::m_szSoundPath[]={"Sound\\"};
|
||||||
char SoundEngine::m_szMusicPath[]={"music\\"};
|
char SoundEngine::m_szMusicPath[]={"music\\"};
|
||||||
@@ -791,7 +791,9 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
|||||||
char *SoundName = (char *)ConvertSoundPathToName(name);
|
char *SoundName = (char *)ConvertSoundPathToName(name);
|
||||||
strcat((char *)szSoundName,SoundName);
|
strcat((char *)szSoundName,SoundName);
|
||||||
|
|
||||||
// app.DebugPrintf(6,"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",iSound, SoundName, szSoundName,x,y,z,volume,pitch);
|
#ifdef _DEBUG
|
||||||
|
app.DebugPrintf(6,"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",iSound, SoundName, szSoundName,x,y,z,volume,pitch);
|
||||||
|
#endif
|
||||||
|
|
||||||
AUDIO_INFO AudioInfo;
|
AUDIO_INFO AudioInfo;
|
||||||
AudioInfo.x=x;
|
AudioInfo.x=x;
|
||||||
@@ -846,9 +848,11 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
|||||||
|
|
||||||
char *SoundName = (char *)ConvertSoundPathToName(name);
|
char *SoundName = (char *)ConvertSoundPathToName(name);
|
||||||
strcat((char *)szSoundName,SoundName);
|
strcat((char *)szSoundName,SoundName);
|
||||||
// app.DebugPrintf("UI: Playing %s, volume %f, pitch %f\n",SoundName,volume,pitch);
|
|
||||||
|
|
||||||
//app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName);
|
#ifdef _DEBUG
|
||||||
|
app.DebugPrintf("UI: Playing %s, volume %f, pitch %f\n",SoundName,volume,pitch);
|
||||||
|
app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName);
|
||||||
|
#endif
|
||||||
|
|
||||||
AUDIO_INFO AudioInfo;
|
AUDIO_INFO AudioInfo;
|
||||||
memset(&AudioInfo,0,sizeof(AUDIO_INFO));
|
memset(&AudioInfo,0,sizeof(AUDIO_INFO));
|
||||||
@@ -1136,10 +1140,12 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
|
|||||||
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
|
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
|
||||||
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
|
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
if(soundEngine->m_hStream==0)
|
if(soundEngine->m_hStream==0)
|
||||||
{
|
{
|
||||||
app.DebugPrintf("SoundEngine::OpenStreamThreadProc - Could not open - %s\n",soundEngine->m_szStreamName);
|
app.DebugPrintf("SoundEngine::OpenStreamThreadProc - Could not open - %s\n",soundEngine->m_szStreamName);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
param(
|
||||||
|
[string]$ProjectDir,
|
||||||
|
[string]$Platform,
|
||||||
|
[string]$Configuration
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($ProjectDir -match "Minecraft.World") {
|
||||||
|
$BaseDir = "$ProjectDir..\Minecraft.Client\"
|
||||||
|
} elseif ($ProjectDir -match "Minecraft.Client") {
|
||||||
|
$BaseDir = $ProjectDir
|
||||||
|
} else {
|
||||||
|
Write-Host "4JLibs: Unknown project directory: '$ProjectDir'"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($Platform) {
|
||||||
|
"x64" { $LibsDir = Join-Path $BaseDir "Windows64\4JLibs\"; $ExpectedCount = 4; $PlatformName = "Windows64" }
|
||||||
|
"Durango" { $LibsDir = Join-Path $BaseDir "Durango\4JLibs\"; $ExpectedCount = 4; $PlatformName = "Durango" }
|
||||||
|
"Xbox 360" { $LibsDir = Join-Path $BaseDir "Xbox\4JLibs\"; $ExpectedCount = 5; $PlatformName = "Xbox" }
|
||||||
|
"PS3" { $LibsDir = Join-Path $BaseDir "PS3\4JLibs\"; $ExpectedCount = 4; $PlatformName = "PS3" }
|
||||||
|
"Orbis" { $LibsDir = Join-Path $BaseDir "Orbis\4JLibs\"; $ExpectedCount = 4; $PlatformName = "Orbis" }
|
||||||
|
"PSVita" { $LibsDir = Join-Path $BaseDir "PSVita\4JLibs\"; $ExpectedCount = 4; $PlatformName = "PSVita" }
|
||||||
|
default { Write-Host "4JLibs: Unknown platform: '$Platform'"; exit 1 }
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Configuration -match "ContentPackage" -or $Configuration -match "Release") {
|
||||||
|
$BuildConfig = "Release"
|
||||||
|
} elseif ($Configuration -match "Debug") {
|
||||||
|
$BuildConfig = "Debug"
|
||||||
|
} else {
|
||||||
|
Write-Host "4JLibs: Configuration did not match any known patterns, defaulting to Debug"
|
||||||
|
$BuildConfig = "Debug"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path $LibsDir)) {
|
||||||
|
Write-Host "4JLibs: $PlatformName 4JLibs directory not found"
|
||||||
|
exit 1
|
||||||
|
} elseif (-not (Test-Path "$LibsDir\Headers\$PlatformName")) {
|
||||||
|
Write-Host "4JLibs: $PlatformName 4JLibs Headers directory not found"
|
||||||
|
exit 1
|
||||||
|
} elseif (-not (Test-Path "$LibsDir\Headers")) {
|
||||||
|
Write-Host "4JLibs: Headers directory not found"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
$incPath = Join-Path $LibsDir "inc"
|
||||||
|
$libsPath = Join-Path $LibsDir "libs"
|
||||||
|
|
||||||
|
$incCount = (Get-ChildItem -Path $incPath -Filter "*.h" -ErrorAction SilentlyContinue).Count
|
||||||
|
|
||||||
|
if ($BuildConfig -eq "Release") {
|
||||||
|
$libCount = (Get-ChildItem -Path $libsPath -Filter "*_r.lib" -ErrorAction SilentlyContinue).Count
|
||||||
|
} else {
|
||||||
|
$libCount = (Get-ChildItem -Path $libsPath -Filter "*_d.lib" -ErrorAction SilentlyContinue).Count
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($incCount -lt $ExpectedCount) {
|
||||||
|
Write-Host "4JLibs: Copying header files for $PlatformName"
|
||||||
|
xcopy "$LibsDir\Headers\$PlatformName\*" "$incPath" /E /I /Y
|
||||||
|
} else {
|
||||||
|
Write-Host "4JLibs: inc files already present, skipping copy."
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($libCount -lt $ExpectedCount) {
|
||||||
|
Write-Host "4JLibs: Building 4JLibs for $PlatformName in $BuildConfig"
|
||||||
|
|
||||||
|
& "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" `
|
||||||
|
(Join-Path $LibsDir "4JLibs.sln") `
|
||||||
|
/p:Configuration=$BuildConfig `
|
||||||
|
/p:Platform=$PlatformName `
|
||||||
|
/v:minimal `
|
||||||
|
/m
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Host "4JLibs: Build failed with exit code: $LASTEXITCODE"
|
||||||
|
exit $LASTEXITCODE
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Host "4JLibs: libs already present, skipping build."
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 314 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user