Compare commits
116
Commits
networking
...
networking
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d24c73d4c7 | ||
|
|
faf3a3edea | ||
|
|
1e747b70e7 | ||
|
|
e16d566853 | ||
|
|
fc988df2cc | ||
|
|
ca4a561d07 | ||
|
|
1e47ff84a9 | ||
|
|
a2dad85bb1 | ||
|
|
0405a47bd1 | ||
|
|
0e7da09615 | ||
|
|
ad7dd528f7 | ||
|
|
83e11bdf9b | ||
|
|
7b4821d329 | ||
|
|
a8a2c5393a | ||
|
|
e21c637b3c | ||
|
|
b22decd65c | ||
|
|
9b7d5a0c25 | ||
|
|
e71fe15126 | ||
|
|
8e471b7e9c | ||
|
|
6800455166 | ||
|
|
1e37e0207c | ||
|
|
195672f73c | ||
|
|
4020b16864 | ||
|
|
5065c28b5c | ||
|
|
39c22195fb | ||
|
|
41b976ed9e | ||
|
|
fc1a6a80e3 | ||
|
|
902a6ca641 | ||
|
|
4e368283e1 | ||
|
|
4b962fcb21 | ||
|
|
81e4a789b6 | ||
|
|
78f192ed76 | ||
|
|
344fd63488 | ||
|
|
1f3664da94 | ||
|
|
a43edb9faa | ||
|
|
b62b7eb04d | ||
|
|
5531c673cd | ||
|
|
91ed8dceb6 | ||
|
|
9cabad158a | ||
|
|
6878c47f24 | ||
|
|
a26fa24890 | ||
|
|
3f8321240f | ||
|
|
e52fce044a | ||
|
|
327da2f843 | ||
|
|
5845c6ce26 | ||
|
|
f615927e0e | ||
|
|
5a3c528ed0 | ||
|
|
fe90a6c640 | ||
|
|
6512a32798 | ||
|
|
8fffd28dda | ||
|
|
e5b6a63d4c | ||
|
|
12a601d478 | ||
|
|
de526b7bd9 | ||
|
|
ad62c603da | ||
|
|
90f771e038 | ||
|
|
c8ffa527c8 | ||
|
|
b1d583721f | ||
|
|
8ee10c3a68 | ||
|
|
c988bd564d | ||
|
|
71a972a033 | ||
|
|
a047df6dc4 | ||
|
|
1763155fc6 | ||
|
|
1a903c65dc | ||
|
|
a1541c590d | ||
|
|
9d19fdc5f5 | ||
|
|
14cd85e7ed | ||
|
|
82e802873f | ||
|
|
ecb1a93444 | ||
|
|
9e3077c3bc | ||
|
|
494235878e | ||
|
|
6a49df36cc | ||
|
|
feeff55924 | ||
|
|
f404e4b4e4 | ||
|
|
67a8111974 | ||
|
|
bad3a41225 | ||
|
|
6853eab85f | ||
|
|
46caf4727c | ||
|
|
47ea98fc86 | ||
|
|
d0362d2458 | ||
|
|
82783c0812 | ||
|
|
bd0cc59a54 | ||
|
|
81d41a6a04 | ||
|
|
0031cae3e3 | ||
|
|
251cd8e304 | ||
|
|
df2a4d85ef | ||
|
|
b737c3eccb | ||
|
|
77a4ee39b5 | ||
|
|
7fb2db5ed7 | ||
|
|
90a2391e92 | ||
|
|
36afa4a59f | ||
|
|
eb317d8fbd | ||
|
|
af2040a849 | ||
|
|
9cba342973 | ||
|
|
8055f4dfc7 | ||
|
|
3ea3c08372 | ||
|
|
9a729de7c3 | ||
|
|
274f2ddc61 | ||
|
|
831ec7292d | ||
|
|
13285fbffa | ||
|
|
125819419f | ||
|
|
ebbd54288b | ||
|
|
92891de261 | ||
|
|
6167e04f82 | ||
|
|
0443166b6a | ||
|
|
4b0520c938 | ||
|
|
3866e525f1 | ||
|
|
9254fbcdb3 | ||
|
|
e8d19516e6 | ||
|
|
8bae3cfbc1 | ||
|
|
7f4227d902 | ||
|
|
d9327ff1f5 | ||
|
|
d770e58992 | ||
|
|
0889edf3bd | ||
|
|
6e13d5d4c0 | ||
|
|
cffdcb1971 | ||
|
|
eb80f3e52b |
No files matched your search
@@ -0,0 +1,114 @@
|
|||||||
|
name: Build & Release Windows64
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Version tag for release (e.g. v1.0.0).'
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
notes:
|
||||||
|
description: 'URL to notes for release.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- name: Validate version format
|
||||||
|
run: |
|
||||||
|
if (-not ("${{ inputs.version }}" -match '^v\d+\.\d+\.\d+[a-zA-Z0-9.-]*$')) {
|
||||||
|
Write-Error "Version '${{ inputs.version }}' doesn't match expected format (e.g. v1.0.0)"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: validate
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
configuration: [ContentPackage]
|
||||||
|
platform: [Windows64]
|
||||||
|
include:
|
||||||
|
- platform: Windows64
|
||||||
|
sdk_label: windows-2022 # str1k3r - can run on any runner
|
||||||
|
|
||||||
|
runs-on: [windows-2022, "${{ matrix.sdk_label }}"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
clean: false
|
||||||
|
lfs: false
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Build Cafeberry
|
||||||
|
run: |
|
||||||
|
& "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" MinecraftConsoles.sln `
|
||||||
|
/p:Configuration=${{ matrix.configuration }} `
|
||||||
|
/p:Platform=${{ matrix.platform }} `
|
||||||
|
/m
|
||||||
|
|
||||||
|
- name: Zip Build
|
||||||
|
run: |
|
||||||
|
7z a -r "LCEWindows64.zip" "./x64/${{ matrix.configuration }}/*" "-x!*.pdb" "-x!*.pch" "-x!*.ilk" "-x!*.lib" "-x!*.exp"
|
||||||
|
|
||||||
|
- name: Stage artifacts
|
||||||
|
run: |
|
||||||
|
New-Item -ItemType Directory -Force -Path staging
|
||||||
|
Copy-Item "LCE${{ matrix.platform }}.zip" staging/
|
||||||
|
Copy-Item "./x64/${{ matrix.configuration }}/Minecraft.Client.exe" staging/
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-${{ matrix.platform }}
|
||||||
|
path: staging/*
|
||||||
|
compression-level: 0
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: build
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- name: Download all build artifacts
|
||||||
|
uses: https://github.com/christopherHX/gitea-download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: downloaded
|
||||||
|
|
||||||
|
- name: Fetch release notes
|
||||||
|
id: notes
|
||||||
|
run: |
|
||||||
|
$notesSource = "${{ inputs.notes }}"
|
||||||
|
$fallback = "## Cafeberry`n`n### Whoever made this release forgot to put notes, sorry!"
|
||||||
|
|
||||||
|
if ($notesSource -match '^https?://') {
|
||||||
|
try {
|
||||||
|
$body = (Invoke-WebRequest -Uri $notesSource -UseBasicParsing).Content
|
||||||
|
if ([string]::IsNullOrWhiteSpace($body)) { $body = $fallback }
|
||||||
|
} catch {
|
||||||
|
$body = $fallback
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$body = $fallback
|
||||||
|
}
|
||||||
|
|
||||||
|
$delimiter = "EOF_$([System.Guid]::NewGuid().ToString('N'))"
|
||||||
|
$content = "description<<$delimiter`n$body`n$delimiter`n"
|
||||||
|
|
||||||
|
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||||||
|
[System.IO.File]::AppendAllText($env:GITHUB_OUTPUT, $content, $utf8NoBom)
|
||||||
|
|
||||||
|
- name: Publish Release
|
||||||
|
uses: akkuman/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.version }}
|
||||||
|
server_url: ${{ gitea.server_url }}
|
||||||
|
repository: ${{ gitea.repository }}
|
||||||
|
token: ${{ gitea.token }}
|
||||||
|
tag_name: ${{ inputs.version }}
|
||||||
|
prerelease: false
|
||||||
|
verbose: true
|
||||||
|
files: downloaded/**/*
|
||||||
|
body: ${{ steps.notes.outputs.description }}
|
||||||
@@ -45,11 +45,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
clean: false
|
clean: false
|
||||||
lfs: false
|
lfs: false
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Build Cafeberry
|
- name: Build Cafeberry
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+16
-2
@@ -6,15 +6,24 @@
|
|||||||
/*Release*
|
/*Release*
|
||||||
/*ContentPackage*
|
/*ContentPackage*
|
||||||
|
|
||||||
|
# Minecraft.Server
|
||||||
|
/Minecraft.Server/x64
|
||||||
|
/Minecraft.Server/x64_*
|
||||||
|
/Minecraft.Server/*Debug
|
||||||
|
/Minecraft.Server/*Release*
|
||||||
|
/Minecraft.Server/*Server*
|
||||||
|
/Minecraft.Server/*ContentPackage*
|
||||||
|
|
||||||
# Minecraft.Client
|
# Minecraft.Client
|
||||||
/Minecraft.Client/x64
|
/Minecraft.Client/x64
|
||||||
/Minecraft.Client/x64_*
|
/Minecraft.Client/x64_*
|
||||||
/Minecraft.Client/*Debug
|
/Minecraft.Client/*Debug
|
||||||
/Minecraft.Client/*Release*
|
/Minecraft.Client/*Release*
|
||||||
|
/Minecraft.Client/*Server*
|
||||||
/Minecraft.Client/*ContentPackage*
|
/Minecraft.Client/*ContentPackage*
|
||||||
/Minecraft.Client/Windows64/GameHDD
|
/Minecraft.Client/Windows64/GameHDD
|
||||||
|
|
||||||
# Minecraft.world
|
# Minecraft.World
|
||||||
/Minecraft.World/x64
|
/Minecraft.World/x64
|
||||||
/Minecraft.World/x64_*
|
/Minecraft.World/x64_*
|
||||||
/Minecraft.World/*Debug
|
/Minecraft.World/*Debug
|
||||||
@@ -28,6 +37,10 @@
|
|||||||
/Minecraft.Client/PS3/SPU_Tasks/*/Release
|
/Minecraft.Client/PS3/SPU_Tasks/*/Release
|
||||||
/Minecraft.Client/PS3/SPU_Tasks/*/ContentPackage
|
/Minecraft.Client/PS3/SPU_Tasks/*/ContentPackage
|
||||||
|
|
||||||
|
# Xbox 360 XZP & XURs
|
||||||
|
Minecraft.Client/XboxMedia/XZP
|
||||||
|
Minecraft.Client/Common/Media/XURs
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
*.ppu.o
|
*.ppu.o
|
||||||
*.pkg
|
*.pkg
|
||||||
@@ -38,4 +51,5 @@
|
|||||||
*.sdf
|
*.sdf
|
||||||
*.opensdf
|
*.opensdf
|
||||||
*.v11.suo
|
*.v11.suo
|
||||||
*.vcxproj.user
|
*.vcxproj.user
|
||||||
|
*.aps
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[submodule "Minecraft.Client/Windows64/4JLibs"]
|
||||||
|
path = Minecraft.Client/Windows64/4JLibs
|
||||||
|
url = https://gitea.str1k3r.xyz/cafeberry/4JLibs.git
|
||||||
|
ignore = untracked
|
||||||
|
branch = main
|
||||||
@@ -248,7 +248,7 @@ void AbstractTexturePack::loadDefaultUI()
|
|||||||
//CXuiSceneBase::GetInstance()->SetVisualPrefix(L"TexturePack");
|
//CXuiSceneBase::GetInstance()->SetVisualPrefix(L"TexturePack");
|
||||||
CXuiSceneBase::GetInstance()->SkinChanged(CXuiSceneBase::GetInstance()->m_hObj);
|
CXuiSceneBase::GetInstance()->SkinChanged(CXuiSceneBase::GetInstance()->m_hObj);
|
||||||
#else
|
#else
|
||||||
ui.ReloadSkin();
|
ui.ReloadSkins();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -303,6 +303,10 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
|||||||
level->isClientSide = true;
|
level->isClientSide = true;
|
||||||
minecraft->setLevel(level);
|
minecraft->setLevel(level);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level = (MultiPlayerLevel *)dimensionLevel;
|
||||||
|
}
|
||||||
|
|
||||||
minecraft->player->setPlayerIndex( packet->m_playerIndex );
|
minecraft->player->setPlayerIndex( packet->m_playerIndex );
|
||||||
minecraft->player->setCustomSkin( app.GetPlayerSkinId(m_userIndex) );
|
minecraft->player->setCustomSkin( app.GetPlayerSkinId(m_userIndex) );
|
||||||
@@ -776,6 +780,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 +793,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 +959,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 +1040,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 +1110,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 +1168,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 )
|
||||||
{
|
{
|
||||||
@@ -1833,6 +1809,7 @@ 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
|
||||||
@@ -1848,13 +1825,17 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
app.SetGameHostOption(eGameHostOption_All,packet->m_serverSettings);
|
app.SetGameHostOption(eGameHostOption_All,packet->m_serverSettings);
|
||||||
|
|
||||||
// 4J-PB - if we go straight in from the menus via an invite, we won't have the DLC info
|
// 4J-PB - if we go straight in from the menus via an invite, we won't have the DLC info
|
||||||
|
//str1k3r - TMS only exists on Xbox 360 therefore, we only need this on Xbox 360.
|
||||||
|
#ifdef _XBOX
|
||||||
if(app.GetTMSGlobalFileListRead()==false)
|
if(app.GetTMSGlobalFileListRead()==false)
|
||||||
{
|
{
|
||||||
app.SetTMSAction(ProfileManager.GetPrimaryPad(),eTMSAction_TMSPP_RetrieveFiles_RunPlayGame);
|
app.SetTMSAction(ProfileManager.GetPrimaryPad(),eTMSAction_TMSPP_RetrieveFiles_RunPlayGame);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#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() )
|
||||||
@@ -1998,6 +1979,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;
|
||||||
@@ -2287,7 +2278,8 @@ 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);
|
||||||
send( shared_ptr<LoginPacket>( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE),
|
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),
|
||||||
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 ))));
|
||||||
|
|
||||||
if(!g_NetworkManager.IsHost() )
|
if(!g_NetworkManager.IsHost() )
|
||||||
@@ -2337,6 +2329,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;
|
||||||
@@ -3580,10 +3573,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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -875,7 +875,8 @@ enum EControllerActions
|
|||||||
MINECRAFT_ACTION_SPAWN_CREEPER,
|
MINECRAFT_ACTION_SPAWN_CREEPER,
|
||||||
MINECRAFT_ACTION_CHANGE_SKIN,
|
MINECRAFT_ACTION_CHANGE_SKIN,
|
||||||
MINECRAFT_ACTION_FLY_TOGGLE,
|
MINECRAFT_ACTION_FLY_TOGGLE,
|
||||||
MINECRAFT_ACTION_RENDER_DEBUG
|
MINECRAFT_ACTION_RENDER_DEBUG,
|
||||||
|
MINECRAFT_ACTION_RENDER_DEBUG_SCREEN
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eMCLang
|
enum eMCLang
|
||||||
|
|||||||
@@ -22,44 +22,13 @@
|
|||||||
#ifdef __ORBIS__
|
#ifdef __ORBIS__
|
||||||
#include <audioout.h>
|
#include <audioout.h>
|
||||||
//#define __DISABLE_MILES__ // MGH disabled for now as it crashes if we call sceNpMatching2Initialize
|
//#define __DISABLE_MILES__ // MGH disabled for now as it crashes if we call sceNpMatching2Initialize
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// take out Orbis until they are done
|
|
||||||
#if defined _XBOX
|
|
||||||
|
|
||||||
SoundEngine::SoundEngine() {}
|
|
||||||
void SoundEngine::init(Options *pOptions)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SoundEngine::tick(shared_ptr<Mob> *players, float a)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
void SoundEngine::destroy() {}
|
|
||||||
void SoundEngine::play(int iSound, float x, float y, float z, float volume, float pitch)
|
|
||||||
{
|
|
||||||
app.DebugPrintf("PlaySound - %d\n",iSound);
|
|
||||||
}
|
|
||||||
void SoundEngine::playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay) {}
|
|
||||||
void SoundEngine::playUI(int iSound, float volume, float pitch) {}
|
|
||||||
|
|
||||||
void SoundEngine::updateMusicVolume(float fVal) {}
|
|
||||||
void SoundEngine::updateSoundEffectVolume(float fVal) {}
|
|
||||||
|
|
||||||
void SoundEngine::add(const wstring& name, File *file) {}
|
|
||||||
void SoundEngine::addMusic(const wstring& name, File *file) {}
|
|
||||||
void SoundEngine::addStreaming(const wstring& name, File *file) {}
|
|
||||||
char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) { return NULL; }
|
|
||||||
bool SoundEngine::isStreamingWavebankReady() { return true; }
|
|
||||||
void SoundEngine::playMusicTick() {};
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
// str1k3r: previously ps4 needed the durango folder to load sound and so did windows this fixes that and makes them use there own folders.
|
// str1k3r: previously ps4 needed the durango folder to load sound and so did windows this fixes that and makes them use there own folders.
|
||||||
#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 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\\"};
|
||||||
@@ -79,7 +48,7 @@ char SoundEngine::m_szMusicPath[]={"music/"};
|
|||||||
char SoundEngine::m_szRedistName[]={"redist"};
|
char SoundEngine::m_szRedistName[]={"redist"};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*#ifdef _CONTENT_PACKAGE // strk1k3r - not needed use default paths instead.
|
/*#ifdef _CONTENT_PACKAGE // str1k3r - not needed use default paths instead.
|
||||||
char SoundEngine::m_szSoundPath[]={"Sound/"};
|
char SoundEngine::m_szSoundPath[]={"Sound/"};
|
||||||
#elif defined _ART_BUILD
|
#elif defined _ART_BUILD
|
||||||
char SoundEngine::m_szSoundPath[]={"Sound/"};
|
char SoundEngine::m_szSoundPath[]={"Sound/"};
|
||||||
@@ -111,7 +80,6 @@ char *SoundEngine::m_szStreamFileA[eStream_Max]=
|
|||||||
"hal4",
|
"hal4",
|
||||||
"nuance1",
|
"nuance1",
|
||||||
"nuance2",
|
"nuance2",
|
||||||
#ifndef _XBOX
|
|
||||||
// add the new music tracks
|
// add the new music tracks
|
||||||
"creative1",
|
"creative1",
|
||||||
"creative2",
|
"creative2",
|
||||||
@@ -123,11 +91,9 @@ char *SoundEngine::m_szStreamFileA[eStream_Max]=
|
|||||||
"menu2",
|
"menu2",
|
||||||
"menu3",
|
"menu3",
|
||||||
"menu4",
|
"menu4",
|
||||||
#endif
|
|
||||||
"piano1",
|
"piano1",
|
||||||
"piano2",
|
"piano2",
|
||||||
"piano3",
|
"piano3",
|
||||||
|
|
||||||
// Nether
|
// Nether
|
||||||
"nether1",
|
"nether1",
|
||||||
"nether2",
|
"nether2",
|
||||||
@@ -308,9 +274,7 @@ void SoundEngine::init(Options *pOptions)
|
|||||||
sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath );
|
sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath );
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined __PSVITA__
|
#elif (defined __PSVITA__ || __ORBIS__)
|
||||||
sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath );
|
|
||||||
#elif defined __ORBIS__
|
|
||||||
sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath );
|
sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath );
|
||||||
#else
|
#else
|
||||||
strcpy((char *)szBankName,m_szSoundPath);
|
strcpy((char *)szBankName,m_szSoundPath);
|
||||||
@@ -791,7 +755,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 +812,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 +1104,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1160,13 +1130,17 @@ void SoundEngine::playMusicTick()
|
|||||||
void SoundEngine::playMusicUpdate()
|
void SoundEngine::playMusicUpdate()
|
||||||
{
|
{
|
||||||
//return;
|
//return;
|
||||||
static bool firstCall = true;
|
|
||||||
static float fMusicVol = 0.0f;
|
static float fMusicVol = 0.0f;
|
||||||
|
#ifndef _WINDOWS64 //str1k3r - if used on windows64 volume doesnt update
|
||||||
|
static bool firstCall = true;
|
||||||
if( firstCall )
|
if( firstCall )
|
||||||
{
|
{
|
||||||
fMusicVol = getMasterMusicVolume();
|
fMusicVol = getMasterMusicVolume();
|
||||||
firstCall = false;
|
firstCall = false;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
fMusicVol = getMasterMusicVolume();
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(m_StreamState)
|
switch(m_StreamState)
|
||||||
{
|
{
|
||||||
@@ -1226,7 +1200,7 @@ void SoundEngine::playMusicUpdate()
|
|||||||
m_MusicType=eMusicType_Game;
|
m_MusicType=eMusicType_Game;
|
||||||
m_StreamingAudioInfo.bIs3D=false;
|
m_StreamingAudioInfo.bIs3D=false;
|
||||||
|
|
||||||
#ifdef _XBOX_ONE
|
#if (defined _XBOX_ONE || _WINDOWS64)
|
||||||
wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID);
|
wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID);
|
||||||
wstring wstrFile=L"TPACK:\\Data\\" + wstrSoundName +L".binka";
|
wstring wstrFile=L"TPACK:\\Data\\" + wstrSoundName +L".binka";
|
||||||
std::wstring mountedPath = StorageManager.GetMountedPath(wstrFile);
|
std::wstring mountedPath = StorageManager.GetMountedPath(wstrFile);
|
||||||
@@ -1235,12 +1209,7 @@ void SoundEngine::playMusicUpdate()
|
|||||||
wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID);
|
wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID);
|
||||||
char szName[255];
|
char szName[255];
|
||||||
wcstombs(szName,wstrSoundName.c_str(),255);
|
wcstombs(szName,wstrSoundName.c_str(),255);
|
||||||
|
|
||||||
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
|
||||||
string strFile="TPACK:/Data/" + string(szName) + ".binka";
|
string strFile="TPACK:/Data/" + string(szName) + ".binka";
|
||||||
#else
|
|
||||||
string strFile="TPACK:\\Data\\" + string(szName) + ".binka";
|
|
||||||
#endif
|
|
||||||
std::string mountedPath = StorageManager.GetMountedPath(strFile);
|
std::string mountedPath = StorageManager.GetMountedPath(strFile);
|
||||||
strcpy(m_szStreamName,mountedPath.c_str());
|
strcpy(m_szStreamName,mountedPath.c_str());
|
||||||
#endif
|
#endif
|
||||||
@@ -1514,7 +1483,9 @@ void SoundEngine::playMusicUpdate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// volume change required?
|
// volume change required?
|
||||||
if(fMusicVol!=getMasterMusicVolume())
|
#ifndef _WINDOWS64
|
||||||
|
if(fMusicVol!=getMasterMusicVolume()) //str1k3r - if used on windows64 music doesnt update its volume
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
fMusicVol=getMasterMusicVolume();
|
fMusicVol=getMasterMusicVolume();
|
||||||
HSAMPLE hSample = AIL_stream_sample_handle( m_hStream);
|
HSAMPLE hSample = AIL_stream_sample_handle( m_hStream);
|
||||||
@@ -1656,8 +1627,6 @@ char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpac
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
F32 AILCALLBACK custom_falloff_function (HSAMPLE S,
|
F32 AILCALLBACK custom_falloff_function (HSAMPLE S,
|
||||||
F32 distance,
|
F32 distance,
|
||||||
|
|||||||
@@ -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.
Loaded 100 of 1684 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user