29 Commits
Author SHA1 Message Date
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
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
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-pieand552eden 92891de261 Fix: PS3 SPU build task (#25)
Fixed PS3 SPU build task

---------

Co-authored-by: 552eden <552eden@gmail.com>
Reviewed-on: pieeebot/cafeberry#25
Co-authored-by: ubergamer-pie <16+ubergamer-pie@noreply.localhost>
2026-08-06 04:04:50 +00:00
ubergamer-pieand552eden 6167e04f82 Disable _LARGE_WORLDS for PS4 (#24)
Temporarily disabled _LARGE_WORLDS to get all platforms communicating with eachother.

---------

Co-authored-by: 552eden <552eden@gmail.com>
Reviewed-on: pieeebot/cafeberry#24
Co-authored-by: ubergamer-pie <16+ubergamer-pie@noreply.localhost>
2026-08-05 20:02:49 +00:00
ubergamer-pieand552eden 0443166b6a fix: vita networking(#23)
VITA Networking is now working. but it can only connect to non LARGE_WORLDS.

---------

Co-authored-by: 552eden <552eden@gmail.com>
Reviewed-on: pieeebot/cafeberry#23
Co-authored-by: ubergamer-pie <16+ubergamer-pie@noreply.localhost>
2026-08-05 16:59:22 +00:00
NaN 4b0520c938 fix PS4 networking support (#20)
gonna mark this a WIP till i test more with large worlds and achievements issues i dont wanna break the PS3 and other builds by enabling it freely,

ideally i can get it to work without it

also i wanna remove the GetLocalIPv4Interfaces auto discovery feature i just did that cause i had so many local networks it got confusing, will remove on Final PR editReviewed-on: pieeebot/cafeberry#20

Co-authored-by: NaN <nan@str1k3r.xyz>
2026-08-04 22:49:46 +00:00
ubergamer-pieand552eden 2840b7620b fix psvita being in trial mode + play game button freezing the entire game (#22)
fixed lock crash and enabled full mode for vita

---------

Co-authored-by: 552eden <552eden@gmail.com>
Reviewed-on: pieeebot/cafeberry#22
Co-authored-by: ubergamer-pie <16+ubergamer-pie@noreply.localhost>
2026-08-04 22:19:29 +00:00
ubergamer-pieand552eden 5451249347 fixed vita startup crash by guarding commerce calls (#21)
Commerce calls are now guarded with `#elif defined(__PSVITA__) && !defined(DISABLE_PSN)`

---------

Co-authored-by: 552eden <552eden@gmail.com>
Reviewed-on: pieeebot/cafeberry#21
Co-authored-by: ubergamer-pie <16+ubergamer-pie@noreply.localhost>
2026-08-04 21:41:13 +00:00
str1k3r de8bf25fbe Merge branch 'main' into networking 2026-08-04 09:39:41 -04:00
pieeebot 64e95393c8 fix ps3 compile errors 2026-08-04 07:40:52 +03:00
pieeebot ea3621971f psvita networking (Experimental) 2026-08-04 07:04:38 +03:00
pieeebot ce3e83039d rename network scripts 2026-08-03 04:18:33 +03:00
pieeebot 42f09f93e5 Fix Windows64 720p crash 2026-08-03 04:11:11 +03:00
pieeebot 9f8dab8ebb Merge branch 'main' into networking 2026-08-03 02:03:23 +03:00
pieeebot 5ebaab0ac9 Fix Shadps4 crash 2026-08-02 23:05:25 +03:00
pieeebot 92209cf909 add ps4 support 2026-08-02 22:06:27 +03:00
pieeebot 94f1cefcf9 Merge branch 'main' into networking 2026-08-02 18:58:23 +03:00
pieeebot e254228cf5 update lcemp networking 2026-08-02 03:33:11 +03:00
pieeebot b87d044cf0 fix crash when opening loadorjoin a second time 2026-08-01 22:56:12 +03:00
pieeebot 01abe05b18 attempt at trying to get XB360 to work 2026-08-01 06:15:37 +03:00
pieeebot 2170209e26 Merge branch 'main' into networking 2026-08-01 02:04:05 +03:00
pieeebot 991369547a fix compile error 2026-07-31 22:35:05 +03:00
pieeebot dbd90a75c9 add lcemp networking + ps3 support
YES I KNOW ITS GARBAGE, THATS WHY ITS NOT ON MAIN

ILL FIX IT UP IN FUTURE COMMITS THEN MERGE TO MAIN
2026-07-31 22:08:30 +03:00
1800 changed files with 19995 additions and 11484 deletions

No files matched your search

-114
View File
@@ -1,114 +0,0 @@
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 }}
+3 -4
View File
@@ -18,7 +18,7 @@ jobs:
steps: steps:
- name: Validate version format - name: Validate version format
run: | run: |
if (-not ("${{ inputs.version }}" -match '^[vb]\d+\.\d+\.\d+[a-zA-Z0-9.-]*$')) { 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)" Write-Error "Version '${{ inputs.version }}' doesn't match expected format (e.g. v1.0.0)"
exit 1 exit 1
} }
@@ -27,7 +27,7 @@ jobs:
needs: validate needs: validate
strategy: strategy:
matrix: matrix:
configuration: [ContentPackage] configuration: [Release]
platform: [Windows64, Xbox360, Orbis, PSVita, PS3] platform: [Windows64, Xbox360, Orbis, PSVita, PS3]
include: include:
- platform: Windows64 - platform: Windows64
@@ -45,12 +45,11 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v6 uses: https://github.com/actions/checkout@v4
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: |
-5
View File
@@ -28,10 +28,6 @@
/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
@@ -43,4 +39,3 @@ Minecraft.Client/Common/Media/XURs
*.opensdf *.opensdf
*.v11.suo *.v11.suo
*.vcxproj.user *.vcxproj.user
*.aps
+3 -5
View File
@@ -1,5 +1,3 @@
[submodule "Minecraft.Client/Windows64/4JLibs"] [submodule "Minecraft.Server"]
path = Minecraft.Client/Windows64/4JLibs path = Minecraft.Server
url = https://gitea.str1k3r.xyz/cafeberry/4JLibs.git url = https://gitea.str1k3r.xyz/cafeberry/Cafeberry-Server.git
ignore = untracked
branch = main
+1 -1
View File
@@ -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.ReloadSkins(); ui.ReloadSkin();
#endif #endif
} }
+13 -1
View File
@@ -93,13 +93,14 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f
if(bTitleUpdateTexture) if(bTitleUpdateTexture)
{ {
// Make the content package point to to the UPDATE: drive is needed
wDrive= wstr + L"\\Common\\res\\TitleUpdate\\"; wDrive= wstr + L"\\Common\\res\\TitleUpdate\\";
} }
else else
{ {
wDrive= wstr + L"/Common/"; wDrive= wstr + L"/Common/";
} }
//#elif __PSVITA__ #elif __PSVITA__
/*char *pchUsrDir=getUsrDirPath(); /*char *pchUsrDir=getUsrDirPath();
@@ -114,9 +115,20 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f
{ {
wDrive= wstr + L"/Common/"; wDrive= wstr + L"/Common/";
}*/ }*/
if(bTitleUpdateTexture)
{
// Make the content package point to to the UPDATE: drive is needed
wDrive= L"Common\\res\\TitleUpdate\\";
}
else
{
wDrive= L"Common/";
}
#else #else
if(bTitleUpdateTexture) if(bTitleUpdateTexture)
{ {
// Make the content package point to to the UPDATE: drive is needed
wDrive= L"Common\\res\\TitleUpdate\\"; wDrive= L"Common\\res\\TitleUpdate\\";
} }
else else
+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)
+56 -7
View File
@@ -50,11 +50,16 @@
#else #else
#include "Common\UI\UI.h" #include "Common\UI\UI.h"
#endif #endif
#ifdef __PS3__ #if defined __PS3__ && !defined DISABLE_PSN
#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"
@@ -771,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
@@ -781,6 +787,32 @@ 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;
@@ -1004,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 )
{ {
@@ -1073,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 )
{ {
@@ -1130,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 )
{ {
@@ -1365,7 +1401,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
break; break;
case ChatPacket::e_ChatCannotPlaceLava: case ChatPacket::e_ChatCannotPlaceLava:
displayOnGui = false; displayOnGui = false;
app.SetGlobalUIAction(eAppAction_DisplayLavaMessage); app.SetGlobalXuiAction(eAppAction_DisplayLavaMessage);
break; break;
case ChatPacket::e_ChatDeathInFire: case ChatPacket::e_ChatDeathInFire:
message=app.GetString(IDS_DEATH_INFIRE); message=app.GetString(IDS_DEATH_INFIRE);
@@ -1769,6 +1805,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
@@ -1784,16 +1821,14 @@ 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() )
@@ -1937,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;
@@ -1944,7 +1989,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
isAtLeastOneFriend = TRUE; isAtLeastOneFriend = TRUE;
cantPlayContentRestricted= FALSE; cantPlayContentRestricted= FALSE;
#if ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__) #if !defined DISABLE_PSN && ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends)) if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends))
{ {
@@ -2226,6 +2271,7 @@ 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 ))));
@@ -2276,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;
@@ -3519,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);
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);
} }
+16 -17
View File
@@ -31,7 +31,7 @@ enum eFont
eFont_None, // to fallback to nothing eFont_None, // to fallback to nothing
}; };
enum eUIAction enum eXuiAction
{ {
eAppAction_Idle=0, eAppAction_Idle=0,
eAppAction_SaveGame, eAppAction_SaveGame,
@@ -112,21 +112,21 @@ enum eTMSAction
// The server runs on its own thread, so we need to call its actions there rather than where all other Xui actions are performed // The server runs on its own thread, so we need to call its actions there rather than where all other Xui actions are performed
// In general these are debugging options // In general these are debugging options
enum eUIServerAction enum eXuiServerAction
{ {
eUIServerAction_Idle=0, eXuiServerAction_Idle=0,
eUIServerAction_DropItem, // Debug eXuiServerAction_DropItem, // Debug
eUIServerAction_SaveGame, eXuiServerAction_SaveGame,
eUIServerAction_AutoSaveGame, eXuiServerAction_AutoSaveGame,
eUIServerAction_SpawnMob, // Debug eXuiServerAction_SpawnMob, // Debug
eUIServerAction_PauseServer, eXuiServerAction_PauseServer,
eUIServerAction_ToggleRain, // Debug eXuiServerAction_ToggleRain, // Debug
eUIServerAction_ToggleThunder, // Debug eXuiServerAction_ToggleThunder, // Debug
eUIServerAction_ServerSettingChanged_Gamertags, eXuiServerAction_ServerSettingChanged_Gamertags,
eUIServerAction_ServerSettingChanged_Difficulty, eXuiServerAction_ServerSettingChanged_Difficulty,
eUIServerAction_ExportSchematic, //Debug eXuiServerAction_ExportSchematic, //Debug
eUIServerAction_ServerSettingChanged_BedrockFog, eXuiServerAction_ServerSettingChanged_BedrockFog,
eUIServerAction_SetCameraLocation, //Debug eXuiServerAction_SetCameraLocation, //Debug
}; };
enum eGameSetting enum eGameSetting
@@ -875,8 +875,7 @@ 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
+3 -3
View File
@@ -138,9 +138,9 @@ typedef std::vector <PBANNEDLISTDATA> VBANNEDLIST;
typedef struct typedef struct
{ {
int iPad; int iPad;
eUIAction action; eXuiAction action;
} }
UIActionParam; XuiActionParam;
// tips // tips
typedef struct typedef struct
@@ -162,7 +162,7 @@ MOJANG_DATA;
typedef struct typedef struct
{ {
eDLCContentType eDLCType; eDLCContentType eDLCType;
#if defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
char chImageURL[256];//SCE_NP_COMMERCE2_URL_LEN char chImageURL[256];//SCE_NP_COMMERCE2_URL_LEN
#else #else
+86 -27
View File
@@ -24,11 +24,42 @@
//#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[]={"Windows64\\redist64"}; //str1k3r - moved this to the Windows64 dir so its out of plain view char SoundEngine::m_szRedistName[]={"redist64"};
#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\\"};
@@ -48,7 +79,7 @@ char SoundEngine::m_szMusicPath[]={"music/"};
char SoundEngine::m_szRedistName[]={"redist"}; char SoundEngine::m_szRedistName[]={"redist"};
#endif #endif
/*#ifdef _CONTENT_PACKAGE // str1k3r - not needed use default paths instead. /*#ifdef _CONTENT_PACKAGE // strk1k3r - 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/"};
@@ -80,6 +111,7 @@ 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",
@@ -91,9 +123,11 @@ 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",
@@ -274,7 +308,9 @@ void SoundEngine::init(Options *pOptions)
sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath ); sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath );
} }
#elif (defined __PSVITA__ || __ORBIS__) #elif defined __PSVITA__
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);
@@ -755,9 +791,7 @@ 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);
#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);
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;
@@ -812,11 +846,9 @@ 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);
#ifdef _DEBUG //app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName);
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));
@@ -1100,18 +1132,15 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
{ {
#ifdef __DISABLE_MILES__ #ifdef __DISABLE_MILES__
return 0; return 0;
#else #endif
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;
#endif
} }
///////////////////////////////////////////// /////////////////////////////////////////////
@@ -1121,7 +1150,8 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
///////////////////////////////////////////// /////////////////////////////////////////////
void SoundEngine::playMusicTick() void SoundEngine::playMusicTick()
{ {
#ifndef __PSVITA__ // AP - vita will update the music during the mixer callback // AP - vita will update the music during the mixer callback
#ifndef __PSVITA__
playMusicUpdate(); playMusicUpdate();
#endif #endif
} }
@@ -1130,17 +1160,13 @@ void SoundEngine::playMusicTick()
void SoundEngine::playMusicUpdate() void SoundEngine::playMusicUpdate()
{ {
//return; //return;
static float fMusicVol = 0.0f;
#ifndef _WINDOWS64 //str1k3r - if used on windows64 volume doesnt update
static bool firstCall = true; static bool firstCall = true;
static float fMusicVol = 0.0f;
if( firstCall ) if( firstCall )
{ {
fMusicVol = getMasterMusicVolume(); fMusicVol = getMasterMusicVolume();
firstCall = false; firstCall = false;
} }
#else
fMusicVol = getMasterMusicVolume();
#endif
switch(m_StreamState) switch(m_StreamState)
{ {
@@ -1156,6 +1182,10 @@ void SoundEngine::playMusicUpdate()
if(m_musicID!=-1) if(m_musicID!=-1)
{ {
// start playing it // start playing it
#if ( defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ )
#ifdef __PS3__ #ifdef __PS3__
// 4J-PB - Need to check if we are a patched BD build // 4J-PB - Need to check if we are a patched BD build
if(app.GetBootedFromDiscPatch()) if(app.GetBootedFromDiscPatch())
@@ -1167,12 +1197,13 @@ void SoundEngine::playMusicUpdate()
{ {
sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath ); sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath );
} }
#elif (defined __PSVITA__ || __ORBIS__) #else
sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath ); sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath );
#endif
#else #else
strcpy((char *)m_szStreamName,m_szMusicPath); strcpy((char *)m_szStreamName,m_szMusicPath);
#endif #endif
// are we using a mash-up pack? // are we using a mash-up pack?
//if(pMinecraft && !pMinecraft->skins->isUsingDefaultSkin() && pMinecraft->skins->getSelected()->hasAudio()) //if(pMinecraft && !pMinecraft->skins->isUsingDefaultSkin() && pMinecraft->skins->getSelected()->hasAudio())
if(Minecraft::GetInstance()->skins->getSelected()->hasAudio()) if(Minecraft::GetInstance()->skins->getSelected()->hasAudio())
@@ -1195,7 +1226,7 @@ void SoundEngine::playMusicUpdate()
m_MusicType=eMusicType_Game; m_MusicType=eMusicType_Game;
m_StreamingAudioInfo.bIs3D=false; m_StreamingAudioInfo.bIs3D=false;
#if (defined _XBOX_ONE || _WINDOWS64) #ifdef _XBOX_ONE
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);
@@ -1204,7 +1235,12 @@ 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
@@ -1246,9 +1282,30 @@ void SoundEngine::playMusicUpdate()
m_StreamingAudioInfo.bIs3D=false; m_StreamingAudioInfo.bIs3D=false;
} }
else if(m_musicID<m_iStream_CD_1) else if(m_musicID<m_iStream_CD_1)
{
SetIsPlayingStreamingGameMusic(true);
SetIsPlayingStreamingCDMusic(false);
m_MusicType=eMusicType_Game;
m_StreamingAudioInfo.bIs3D=false;
// build the name
strcat((char *)m_szStreamName,"music/");
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]);
strcat((char *)m_szStreamName,".binka");
}
else
{
SetIsPlayingStreamingGameMusic(false);
SetIsPlayingStreamingCDMusic(true);
m_MusicType=eMusicType_CD;
m_StreamingAudioInfo.bIs3D=true;
// build the name
strcat((char *)m_szStreamName,"cds/");
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]);
strcat((char *)m_szStreamName,".binka");
}
#else #else
if(m_musicID<m_iStream_CD_1) if(m_musicID<m_iStream_CD_1)
#endif
{ {
SetIsPlayingStreamingGameMusic(true); SetIsPlayingStreamingGameMusic(true);
SetIsPlayingStreamingCDMusic(false); SetIsPlayingStreamingCDMusic(false);
@@ -1268,6 +1325,8 @@ void SoundEngine::playMusicUpdate()
} }
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]); strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]);
strcat((char *)m_szStreamName,".binka"); strcat((char *)m_szStreamName,".binka");
#endif
} }
// wstring name = m_szStreamFileA[m_musicID]; // wstring name = m_szStreamFileA[m_musicID];
@@ -1455,9 +1514,7 @@ void SoundEngine::playMusicUpdate()
} }
// volume change required? // volume change required?
#ifndef _WINDOWS64 if(fMusicVol!=getMasterMusicVolume())
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);
@@ -1599,6 +1656,8 @@ 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,
@@ -1,80 +0,0 @@
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."
}
@@ -1,104 +0,0 @@
param(
[string]$OutDir,
[string]$ProjectDir,
[string]$Configuration
)
Write-Host "PS3 Postbuild: script started. Output Directory: $OutDir, Project Directory: $ProjectDir"
$directories = @(
"PS3_GAME\USRDIR\music",
"PS3_GAME\USRDIR\DLC",
"PS3_GAME\USRDIR\Common\Media",
"PS3_GAME\USRDIR\Common\res",
"PS3_GAME\USRDIR\PS3\Tutorial",
"PS3_GAME\USRDIR\PS3\Sound"
)
foreach ($dir in $directories) {
New-Item -ItemType Directory -Path (Join-Path $OutDir $dir) -Force | Out-Null
}
$folderCopies = @(
@{ Source = "music"; Dest = "PS3_GAME\USRDIR\music" },
@{ Source = "Common\Media\Font";Dest = "PS3_GAME\USRDIR\Common\Media\Font" },
@{ Source = "Common\res"; Dest = "PS3_GAME\USRDIR\Common\res" },
@{ Source = "PS3Media\DLC"; Dest = "PS3_GAME\USRDIR\DLC" },
@{ Source = "PS3\Sound"; Dest = "PS3_GAME\USRDIR\PS3\Sound" },
#@{ Source = "PSVita\Tutorial"; Dest = "PS3_GAME\USRDIR\PS3\Tutorial" }, # str1k3r - softlocks game
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\LICDIR"; Dest = "PS3_GAME\LICDIR" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\TROPDIR"; Dest = "PS3_GAME\TROPDIR" }
)
foreach ($copy in $folderCopies) {
$src = Join-Path $ProjectDir $copy.Source
$dst = Join-Path $OutDir $copy.Dest
if (Test-Path $src) {
xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null
}
}
$fileCopies = @(
@{ Source = "PS3\PS3ProductCodes.bin"; Dest = "PS3_GAME\USRDIR\PS3\PS3ProductCodes.bin" },
@{ Source = "Common\Media\MediaPS3.arc"; Dest = "PS3_GAME\USRDIR\Common\Media\MediaPS3.arc" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_DISC.SFB"; Dest = "PS3_DISC.SFB" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\ICON0.PNG"; Dest = "PS3_GAME\ICON0.PNG" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\PARAM.SFO"; Dest = "PS3_GAME\PARAM.SFO" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\PIC1.PNG"; Dest = "PS3_GAME\PIC1.PNG" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\PS3GAME.BG0"; Dest = "PS3_GAME\PS3GAME.BG0" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\PS3GAME.BG1"; Dest = "PS3_GAME\PS3GAME.BG1" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\PS3GAME.VR0"; Dest = "PS3_GAME\PS3GAME.VR0" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\PS3LOGO.DAT"; Dest = "PS3_GAME\PS3GAME.DAT" },
@{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\SND0.AT3"; Dest = "PS3_GAME\SND0.AT3" }
)
foreach ($copy in $fileCopies) {
$src = $copy.Source
$dst = Join-Path $OutDir $copy.Dest
if (Test-Path $src) {
Copy-Item -Path $src -Destination $dst -Force
}
}
if ($Configuration -match "ContentPackage") {
$builtFile = Join-Path $OutDir "Minecraft.Client.elf"
} else {
$builtFile = Join-Path $OutDir "Minecraft.Client.self"
}
$newName = "EBOOT.BIN"
$destDir = Join-Path $OutDir "PS3_GAME\USRDIR"
$destPath = Join-Path $destDir $newName
if (Test-Path $builtFile) {
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
Copy-Item -Path $builtFile -Destination $destPath -Force
}
$deleteDirs = @(
"PS3_GAME\USRDIR\Common\Media\font\RU",
"PS3_GAME\USRDIR\Common\res\TitleUpdate\DLC",
"PS3_GAME\USRDIR\Common\res\TitleUpdate\Audio"
)
foreach ($dir in $deleteDirs) {
$path = Join-Path $OutDir $dir
if (Test-Path $path) {
Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue
}
}
$delDirs = @(
"PS3_GAME\USRDIR\Common\Media\font",
"PS3_GAME\USRDIR\Common\Media\font\*",
"PS3_GAME\USRDIR\Common\res\TitleUpdate\GameRules"
)
foreach ($dir in $delDirs) {
$path = Join-Path $OutDir $dir
if (Test-Path $path) {
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "MSYH.ttf" -File |
Remove-Item -Force -ErrorAction SilentlyContinue
}
}
@@ -1,81 +0,0 @@
param(
[string]$OutDir,
[string]$ProjectDir
)
Write-Host "Windows64 Postbuild: script started. Output Directory: $OutDir, Project Directory: $ProjectDir"
$directories = @(
"music",
"Common\Media",
"Windows64Media",
"Windows64\GameHDD",
"Windows64\redist64"
)
foreach ($dir in $directories) {
New-Item -ItemType Directory -Path (Join-Path $OutDir $dir) -Force | Out-Null
}
$folderCopies = @(
@{ Source = "music"; Dest = "music" },
@{ Source = "Common\Media"; Dest = "Common\Media" },
@{ Source = "Common\res"; Dest = "Common\res" },
@{ Source = "Windows64Media\DLC"; Dest = "Windows64Media\DLC" },
@{ Source = "Windows64\Sound"; Dest = "Windows64Media\Sound" },
#@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }, # str1k3r - doesnt even work bru
@{ Source = "Windows64\Miles\lib\redist64"; Dest = "Windows64\redist64" }
)
foreach ($copy in $folderCopies) {
$src = Join-Path $ProjectDir $copy.Source
$dst = Join-Path $OutDir $copy.Dest
if (Test-Path $src) {
xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null
}
}
$fileCopies = @(
@{ Source = Join-Path $ProjectDir "Windows64\4JLibs\4J_Input\Windows64\vendor\SDL\lib\x64\SDL3.dll"; Dest = "SDL3.dll" },
@{ Source = "Common\Media\MediaWindows64.arc"; Dest = "Common\Media\MediaWindows64.arc" },
@{ Source = Join-Path $PSScriptRoot "Contents\Windows64\iggy_w64.dll"; Dest = "iggy_w64.dll" },
@{ Source = Join-Path $PSScriptRoot "Contents\Windows64\mss64.dll"; Dest = "mss64.dll" }
)
foreach ($copy in $fileCopies) {
$src = $copy.Source
$dst = Join-Path $OutDir $copy.Dest
if (Test-Path $src) {
Copy-Item -Path $src -Destination $dst -Force
} else {
Write-Host "Windows64 Postbuild: source not found, skipping: $src"
}
}
$deleteDirs = @(
"Common\Media\font\RU", #str1k3r - russian font?
"Common\res\TitleUpdate\DLC",
"Common\res\TitleUpdate\Audio"
)
foreach ($dir in $deleteDirs) {
$path = Join-Path $OutDir $dir
if (Test-Path $path) {
Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue
}
}
$delDirs = @(
"Common\Media\font",
"Common\Media\font\*",
"Common\res\TitleUpdate\GameRules"
)
foreach ($dir in $delDirs) {
$path = Join-Path $OutDir $dir
if (Test-Path $path) {
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "DF-DotDotGothic16.ttf", "DFTT_R5.TTC", "candadite2.ttf" -File |
Remove-Item -Force -ErrorAction SilentlyContinue
}
}
+151 -85
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"
@@ -89,8 +91,8 @@ CMinecraftApp::CMinecraftApp()
for(int i=0;i<XUSER_MAX_COUNT;i++) for(int i=0;i<XUSER_MAX_COUNT;i++)
{ {
m_eTMSAction[i]=eTMSAction_Idle; m_eTMSAction[i]=eTMSAction_Idle;
m_eUIAction[i]=eAppAction_Idle; m_eXuiAction[i]=eAppAction_Idle;
m_eUIActionParam[i] = NULL; m_eXuiActionParam[i] = NULL;
//m_dwAdditionalModelParts[i] = 0; //m_dwAdditionalModelParts[i] = 0;
if(FAILED(XUserGetSigninInfo(i,XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY ,&m_currentSigninInfo[i]))) if(FAILED(XUserGetSigninInfo(i,XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY ,&m_currentSigninInfo[i])))
@@ -106,8 +108,8 @@ CMinecraftApp::CMinecraftApp()
m_uiOpacityCountDown[i]=0; m_uiOpacityCountDown[i]=0;
} }
m_eGlobalUIAction=eAppAction_Idle; m_eGlobalXuiAction=eAppAction_Idle;
m_eGlobalUIServerAction=eUIServerAction_Idle; m_eGlobalXuiServerAction=eXuiServerAction_Idle;
m_bResourcesLoaded=false; m_bResourcesLoaded=false;
m_bGameStarted=false; m_bGameStarted=false;
@@ -199,13 +201,13 @@ CMinecraftApp::CMinecraftApp()
// m_uiTransferSlotC=5; // m_uiTransferSlotC=5;
#endif #endif
#if (defined _CONTENT_PACAKGE || _XBOX) #if (defined _CONTENT_PACAKGE) || (defined _XBOX)
m_bUseDPadForDebug = false; m_bUseDPadForDebug = false;
#else #else
m_bUseDPadForDebug = true; m_bUseDPadForDebug = true;
#endif #endif
#if !(defined _WINDOWS64 || _XBOX) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
for(int i=0;i<XUSER_MAX_COUNT;i++) for(int i=0;i<XUSER_MAX_COUNT;i++)
{ {
m_eOptionsStatusA[i]=C4JStorage::eOptions_Callback_Idle; m_eOptionsStatusA[i]=C4JStorage::eOptions_Callback_Idle;
@@ -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,28 +320,31 @@ 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);
} }
void CMinecraftApp::SetAction(int iPad, eUIAction action, LPVOID param) void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param)
{ {
if( ( m_eUIAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_EthernetDisconnected ) ) if( ( m_eXuiAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_EthernetDisconnected ) )
{ {
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action); app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action);
} }
else if( ( m_eUIAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_ExitWorld ) ) else if( ( m_eXuiAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_ExitWorld ) )
{ {
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action); app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action);
} }
else if(m_eUIAction[iPad] == eAppAction_ExitWorldCapturedThumbnail && action != eAppAction_Idle) else if(m_eXuiAction[iPad] == eAppAction_ExitWorldCapturedThumbnail && action != eAppAction_Idle)
{ {
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action); app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action);
} }
else else
{ {
app.DebugPrintf("Changing App action for pad %d from %d to %d\n", iPad, m_eUIAction[iPad], action); app.DebugPrintf("Changing App action for pad %d from %d to %d\n", iPad, m_eXuiAction[iPad], action);
m_eUIAction[iPad]=action; m_eXuiAction[iPad]=action;
m_eUIActionParam[iPad] = param; m_eXuiActionParam[iPad] = param;
} }
} }
@@ -344,6 +369,30 @@ void CMinecraftApp::SetAppPaused(bool val)
m_bIsAppPaused = val; m_bIsAppPaused = val;
} }
void CMinecraftApp::HandleButtonPresses()
{
for(int i=0;i<4;i++)
{
HandleButtonPresses(i);
}
}
void CMinecraftApp::HandleButtonPresses(int iPad)
{
// // test an update of the profile data
// void *pData=ProfileManager.GetGameDefinedProfileData(iPad);
//
// unsigned char *pchData= (unsigned char *)pData;
// int iCount=0;
// for(int i=0;i<GAME_DEFINED_PROFILE_DATA_BYTES;i++)
// {
// pchData[i]=0xBC;
// //if(iCount==255) iCount = 0;
// }
// ProfileManager.WriteToProfile(iPad,true);
}
bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack) bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack)
{ {
bool success = true; bool success = true;
@@ -729,7 +778,7 @@ void CMinecraftApp::InitGameSettings()
{ {
for(int i=0;i<XUSER_MAX_COUNT;i++) for(int i=0;i<XUSER_MAX_COUNT;i++)
{ {
#if !(defined _WINDOWS64 || _XBOX) #if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
GameSettingsA[i]=(GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(i); GameSettingsA[i]=(GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(i);
#else #else
GameSettingsA[i]=(GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(i); GameSettingsA[i]=(GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(i);
@@ -740,20 +789,21 @@ void CMinecraftApp::InitGameSettings()
//SetDefaultGameSettings(i); - done on a callback from the profile manager //SetDefaultGameSettings(i); - done on a callback from the profile manager
// 4J-PB - adding in for Windows & PS3 to set the defaults for the joypad // 4J-PB - adding in for Windows & PS3 to set the defaults for the joypad
#ifdef _WINDOWS64 #if defined _WINDOWS64// || defined __PSVITA__
C_4JProfile::PROFILESETTINGS *pProfileSettings=ProfileManager.GetDashboardProfileSettings(i); C_4JProfile::PROFILESETTINGS *pProfileSettings=ProfileManager.GetDashboardProfileSettings(i);
// clear this for now - it will come from reading the system values
memset(pProfileSettings,0,sizeof(C_4JProfile::PROFILESETTINGS));
SetDefaultOptions(pProfileSettings,i); SetDefaultOptions(pProfileSettings,i);
ProfileManager.LoadSettings(GameSettingsA[i], sizeof(GAME_SETTINGS)); #elif defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__
ApplyGameSettingsChanged(i);
#elif !defined(_XBOX)
C4JStorage::PROFILESETTINGS *pProfileSettings=StorageManager.GetDashboardProfileSettings(i); C4JStorage::PROFILESETTINGS *pProfileSettings=StorageManager.GetDashboardProfileSettings(i);
// 4J-PB - don't cause an options write to happen here // 4J-PB - don't cause an options write to happen here
SetDefaultOptions(pProfileSettings,i,false); SetDefaultOptions(pProfileSettings,i,false);
#endif #endif
} }
} }
#if !(defined _WINDOWS64 || _XBOX) #if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
int CMinecraftApp::SetDefaultOptions(C4JStorage::PROFILESETTINGS *pSettings,const int iPad,bool bWriteProfile) int CMinecraftApp::SetDefaultOptions(C4JStorage::PROFILESETTINGS *pSettings,const int iPad,bool bWriteProfile)
#else #else
int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,const int iPad) int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,const int iPad)
@@ -846,7 +896,7 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con
//#endif //#endif
#if !(defined _WINDOWS64 || _XBOX) #if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
GameSettingsA[iPad]->bSettingsChanged=bWriteProfile; GameSettingsA[iPad]->bSettingsChanged=bWriteProfile;
#endif #endif
@@ -874,7 +924,8 @@ int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETT
return 0; return 0;
} }
#if !(defined _WINDOWS64 || _XBOX) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
wstring CMinecraftApp::toStringOptionsStatus(const C4JStorage::eOptionsCallback &eStatus) wstring CMinecraftApp::toStringOptionsStatus(const C4JStorage::eOptionsCallback &eStatus)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
@@ -1201,6 +1252,9 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat
{ {
// This might be from a version during testing of new profile updates // This might be from a version during testing of new profile updates
app.DebugPrintf("Don't know what to do with this profile version!\n"); app.DebugPrintf("Don't know what to do with this profile version!\n");
#ifndef _CONTENT_PACKAGE
// __debugbreak();
#endif
GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData;
pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu
@@ -1323,7 +1377,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
// Game Host only (and for now we can't change the diff while in game, so this shouldn't happen) // Game Host only (and for now we can't change the diff while in game, so this shouldn't happen)
if(bInGame && g_NetworkManager.IsHost() && (iPad==ProfileManager.GetPrimaryPad())) if(bInGame && g_NetworkManager.IsHost() && (iPad==ProfileManager.GetPrimaryPad()))
{ {
app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_Difficulty); app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_Difficulty);
} }
} }
else else
@@ -1389,7 +1443,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
{ {
// Update the Game Host setting if you are the host and you are in-game // Update the Game Host setting if you are the host and you are in-game
app.SetGameHostOption(eGameHostOption_Gamertags,((GameSettingsA[iPad]->usBitmaskValues&0x0008)!=0)?1:0); app.SetGameHostOption(eGameHostOption_Gamertags,((GameSettingsA[iPad]->usBitmaskValues&0x0008)!=0)?1:0);
app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_Gamertags); app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_Gamertags);
PlayerList *players = MinecraftServer::getInstance()->getPlayerList(); PlayerList *players = MinecraftServer::getInstance()->getPlayerList();
for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3) for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3)
@@ -1465,7 +1519,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
{ {
// Update the Game Host setting if you are the host and you are in-game // Update the Game Host setting if you are the host and you are in-game
app.SetGameHostOption(eGameHostOption_BedrockFog,GetGameSettings(iPad,eGameSetting_BedrockFog)?1:0); app.SetGameHostOption(eGameHostOption_BedrockFog,GetGameSettings(iPad,eGameSetting_BedrockFog)?1:0);
app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_BedrockFog); app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_BedrockFog);
} }
} }
break; break;
@@ -2326,8 +2380,6 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa
{ {
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ ) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ )
StorageManager.WriteToProfile(i,true, bOverride5MinuteTimer); StorageManager.WriteToProfile(i,true, bOverride5MinuteTimer);
#elif _WINDOWS64
ProfileManager.SaveSettings(GameSettingsA[i], sizeof(GAME_SETTINGS));
#else #else
ProfileManager.WriteToProfile(i,true, bOverride5MinuteTimer); ProfileManager.WriteToProfile(i,true, bOverride5MinuteTimer);
#endif #endif
@@ -2341,8 +2393,6 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa
{ {
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
StorageManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); StorageManager.WriteToProfile(iPad,true, bOverride5MinuteTimer);
#elif _WINDOWS64
ProfileManager.SaveSettings(GameSettingsA[iPad], sizeof(GAME_SETTINGS));
#else #else
ProfileManager.WriteToProfile(iPad,true, bOverride5MinuteTimer); ProfileManager.WriteToProfile(iPad,true, bOverride5MinuteTimer);
#endif #endif
@@ -2361,7 +2411,7 @@ void CMinecraftApp::ClearGameSettingsChangedFlag(int iPad)
// Remove the debug settings in the content package build // Remove the debug settings in the content package build
// //
//////////////////////////// ////////////////////////////
#ifndef _DEBUG_MENUS_ENABLED #ifdef _DEBUG_MENUS_ENABLED
unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlayer) //bOverridePlayer is to force the send for the server to get the read options unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlayer) //bOverridePlayer is to force the send for the server to get the read options
{ {
return 0; return 0;
@@ -2374,7 +2424,9 @@ void CMinecraftApp::SetGameSettingsDebugMask(int iPad, unsigned int uiVal)
void CMinecraftApp::ActionDebugMask(int iPad,bool bSetAllClear) void CMinecraftApp::ActionDebugMask(int iPad,bool bSetAllClear)
{ {
} }
#else #else
unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlayer) //bOverridePlayer is to force the send for the server to get the read options unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlayer) //bOverridePlayer is to force the send for the server to get the read options
{ {
if(iPad==-1) if(iPad==-1)
@@ -2559,21 +2611,21 @@ int CMinecraftApp::DisplaySavingMessage(void *pParam, C4JStorage::ESavingMessage
void CMinecraftApp::SetActionConfirmed(LPVOID param) void CMinecraftApp::SetActionConfirmed(LPVOID param)
{ {
UIActionParam *actionInfo = (UIActionParam *)param; XuiActionParam *actionInfo = (XuiActionParam *)param;
app.SetAction(actionInfo->iPad, actionInfo->action); app.SetAction(actionInfo->iPad, actionInfo->action);
} }
void CMinecraftApp::HandleUIActions(void) void CMinecraftApp::HandleXuiActions(void)
{ {
eUIAction eAction; eXuiAction eAction;
eTMSAction eTMS; eTMSAction eTMS;
LPVOID param; LPVOID param;
Minecraft *pMinecraft=Minecraft::GetInstance(); Minecraft *pMinecraft=Minecraft::GetInstance();
shared_ptr<MultiplayerLocalPlayer> player; shared_ptr<MultiplayerLocalPlayer> player;
// are there any global actions to deal with? // are there any global actions to deal with?
eAction = app.GetGlobalUIAction(); eAction = app.GetGlobalXuiAction();
if(eAction!=eAppAction_Idle) if(eAction!=eAppAction_Idle)
{ {
switch(eAction) switch(eAction)
@@ -2584,7 +2636,7 @@ void CMinecraftApp::HandleUIActions(void)
UINT uiIDA[1]; UINT uiIDA[1];
uiIDA[0]=IDS_CONFIRM_OK; uiIDA[0]=IDS_CONFIRM_OK;
C4JStorage::EMessageResult result = ui.RequestErrorMessage( IDS_CANT_PLACE_NEAR_SPAWN_TITLE, IDS_CANT_PLACE_NEAR_SPAWN_TEXT, uiIDA,1,XUSER_INDEX_ANY); C4JStorage::EMessageResult result = ui.RequestErrorMessage( IDS_CANT_PLACE_NEAR_SPAWN_TITLE, IDS_CANT_PLACE_NEAR_SPAWN_TEXT, uiIDA,1,XUSER_INDEX_ANY);
if(result != C4JStorage::EMessage_Busy) SetGlobalUIAction(eAppAction_Idle); if(result != C4JStorage::EMessage_Busy) SetGlobalXuiAction(eAppAction_Idle);
} }
break; break;
@@ -2596,8 +2648,8 @@ void CMinecraftApp::HandleUIActions(void)
// are there any app actions to deal with? // are there any app actions to deal with?
for(int i=0;i<XUSER_MAX_COUNT;i++) for(int i=0;i<XUSER_MAX_COUNT;i++)
{ {
eAction = app.GetUIAction(i); eAction = app.GetXuiAction(i);
param = m_eUIActionParam[i]; param = m_eXuiActionParam[i];
if(eAction!=eAppAction_Idle) if(eAction!=eAppAction_Idle)
{ {
@@ -2632,7 +2684,7 @@ void CMinecraftApp::HandleUIActions(void)
bool bKeepHiding = false; bool bKeepHiding = false;
for(int j=0; j < XUSER_MAX_COUNT;++j) for(int j=0; j < XUSER_MAX_COUNT;++j)
{ {
if(app.GetUIAction(j) == eAppAction_SocialPostScreenshot) if(app.GetXuiAction(j) == eAppAction_SocialPostScreenshot)
{ {
bKeepHiding = true; bKeepHiding = true;
break; break;
@@ -2754,7 +2806,7 @@ void CMinecraftApp::HandleUIActions(void)
SetAction(i,eAppAction_Idle); SetAction(i,eAppAction_Idle);
#if defined(_XBOX_ONE) || defined(__ORBIS__) #if defined(_XBOX_ONE) || defined(__ORBIS__)
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_AutoSaveGame); app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame);
if(app.GetGameHostOption(eGameHostOption_DisableSaving)) StorageManager.SetSaveDisabled(true); if(app.GetGameHostOption(eGameHostOption_DisableSaving)) StorageManager.SetSaveDisabled(true);
#else #else
@@ -3236,7 +3288,7 @@ void CMinecraftApp::HandleUIActions(void)
pMinecraft->localplayers[i]->respawn(); pMinecraft->localplayers[i]->respawn();
// If the respawn requires a dimension change then the action will have changed // If the respawn requires a dimension change then the action will have changed
//if(app.GetUIAction(i) == eAppAction_Respawn) //if(app.GetXuiAction(i) == eAppAction_Respawn)
//{ //{
// SetAction(i,eAppAction_Idle); // SetAction(i,eAppAction_Idle);
// CloseXuiScenes(i); // CloseXuiScenes(i);
@@ -3645,7 +3697,7 @@ void CMinecraftApp::HandleUIActions(void)
pDLCTexPack->m_pSoundBank->Destroy(); pDLCTexPack->m_pSoundBank->Destroy();
} }
#endif #endif
#if (defined _DURANGO || _WINDOWS64) #ifdef _DURANGO
DWORD result = StorageManager.UnmountInstalledDLC(L"TPACK"); DWORD result = StorageManager.UnmountInstalledDLC(L"TPACK");
#else #else
DWORD result = StorageManager.UnmountInstalledDLC("TPACK"); DWORD result = StorageManager.UnmountInstalledDLC("TPACK");
@@ -4010,8 +4062,8 @@ void CMinecraftApp::HandleUIActions(void)
ui.SetTooltips(i, -1); ui.SetTooltips(i, -1);
ui.ReloadSkins(); ui.ReloadSkin();
ui.StartReloadSkinsThread(); ui.StartReloadSkinThread();
ui.setCleanupOnReload(); ui.setCleanupOnReload();
#endif #endif
@@ -4390,7 +4442,9 @@ int CMinecraftApp::EthernetDisconnectReturned(void *pParam,int iPad,const C4JSto
else else
{ {
// 4J-PB - turn off the PSN store icon just in case this happened when we were in one of the DLC menus // 4J-PB - turn off the PSN store icon just in case this happened when we were in one of the DLC menus
#if defined __PSVITA__ || defined __ORBIS__ #ifdef __ORBIS__
sceNpCommerceHidePsStoreIcon();
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
app.GetCommerce()->HidePsStoreIcon(); app.GetCommerce()->HidePsStoreIcon();
#endif #endif
app.SetAction(iPad,eAppAction_EthernetDisconnectedReturned_Menus); app.SetAction(iPad,eAppAction_EthernetDisconnectedReturned_Menus);
@@ -4860,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)
@@ -4929,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() ) )
@@ -4940,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.
@@ -5065,6 +5123,9 @@ void CMinecraftApp::NotificationsCallback(LPVOID pParam,DWORD dwNotification, un
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ #if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
int CMinecraftApp::MustSignInFullVersionPurchaseReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) int CMinecraftApp::MustSignInFullVersionPurchaseReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{ {
#ifdef DISABLE_PSN
return 0;
#else
if(result==C4JStorage::EMessage_ResultAccept) if(result==C4JStorage::EMessage_ResultAccept)
{ {
#ifdef __PS3__ #ifdef __PS3__
@@ -5077,11 +5138,15 @@ int CMinecraftApp::MustSignInFullVersionPurchaseReturned(void *pParam,int iPad,C
} }
return 0; return 0;
#endif
} }
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ #if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
int CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial(void *pParam,int iPad,C4JStorage::EMessageResult result) int CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial(void *pParam,int iPad,C4JStorage::EMessageResult result)
{ {
#ifdef DISABLE_PSN
return 0;
#else
if(result==C4JStorage::EMessage_ResultAccept) if(result==C4JStorage::EMessage_ResultAccept)
{ {
#ifdef __PS3__ #ifdef __PS3__
@@ -5097,6 +5162,7 @@ int CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial(void *pParam,i
app.SetAction(iPad,eAppAction_ExitWorldTrial); app.SetAction(iPad,eAppAction_ExitWorldTrial);
return 0; return 0;
#endif
} }
#endif #endif
@@ -5428,9 +5494,9 @@ void CMinecraftApp::HandleDLC(DLCPack *pack)
{ {
DWORD dwFilesProcessed = 0; DWORD dwFilesProcessed = 0;
#ifndef _XBOX #ifndef _XBOX
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #if defined(__PS3__) || defined(__ORBIS__) || defined(_WINDOWS64) || defined (__PSVITA__)
std::vector<std::string> dlcFilenames; std::vector<std::string> dlcFilenames;
#elif (defined _DURANGO || _WINDOWS64) #elif defined _DURANGO
std::vector<std::wstring> dlcFilenames; std::vector<std::wstring> dlcFilenames;
#endif #endif
StorageManager.GetMountedDLCFileList("DLCDrive", dlcFilenames); StorageManager.GetMountedDLCFileList("DLCDrive", dlcFilenames);
@@ -6290,9 +6356,6 @@ void CMinecraftApp::InitialiseTips()
UINT CMinecraftApp::GetNextTip() UINT CMinecraftApp::GetNextTip()
{ {
static bool bShowSkinDLCTip=true; static bool bShowSkinDLCTip=true;
//str1k3r - if uiStringID is IDS_TIPS_GAMETIP_0 then dont do this, fixes a bug with IDS_TIPS_GAMETIP_0 not showing on Windows64 if not high def
if(m_GameTipA[0].uiStringID != IDS_TIPS_GAMETIP_0)
{
// don't display the DLC tip in the trial game // don't display the DLC tip in the trial game
if(ProfileManager.IsFullVersion() && app.GetNewDLCAvailable() && app.DisplayNewDLCTip()) if(ProfileManager.IsFullVersion() && app.GetNewDLCAvailable() && app.DisplayNewDLCTip())
{ {
@@ -6316,7 +6379,6 @@ UINT CMinecraftApp::GetNextTip()
} }
} }
} }
}
if(m_uiCurrentTip==MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP) m_uiCurrentTip=0; if(m_uiCurrentTip==MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP) m_uiCurrentTip=0;
@@ -6430,7 +6492,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_DOWN*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_DOWN ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_DOWN*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_DOWN ) );
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_RIGHT ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_RIGHT ) );
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_LEFT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_LEFT ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_LEFT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_LEFT ) );
#if !(defined __ORBIS__ || __PS3__ || _XBOX) #if defined _XBOX_ONE || defined __PSVITA__
text = replaceAll(text, L"{*CONTROLLER_VK_START*}", GetVKReplacement(VK_PAD_START ) ); text = replaceAll(text, L"{*CONTROLLER_VK_START*}", GetVKReplacement(VK_PAD_START ) );
text = replaceAll(text, L"{*CONTROLLER_VK_BACK*}", GetVKReplacement(VK_PAD_BACK ) ); text = replaceAll(text, L"{*CONTROLLER_VK_BACK*}", GetVKReplacement(VK_PAD_BACK ) );
#endif #endif
@@ -6553,12 +6615,8 @@ wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction)
#ifdef __PS3__ #ifdef __PS3__
int size = 30; int size = 30;
#elif defined _WIN64 #elif defined _WIN64
int size = 30; int size = 45;
if(ui.getScreenWidth() < 1920) size = 30;
if(ui.getScreenWidth() >= 1920)
{
size = 45;
}
#else #else
int size = 45; int size = 45;
#endif #endif
@@ -6670,7 +6728,7 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey)
case VK_PAD_RTHUMB_DOWNLEFT : case VK_PAD_RTHUMB_DOWNLEFT :
replacement = L"ButtonRightStick"; replacement = L"ButtonRightStick";
break; break;
#if defined _XBOX_ONE || defined __PSVITA__ || defined _WINDOWS64 #if defined _XBOX_ONE || defined __PSVITA__
case VK_PAD_START: case VK_PAD_START:
replacement = L"ButtonStart"; replacement = L"ButtonStart";
break; break;
@@ -6686,12 +6744,8 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey)
#ifdef __PS3__ #ifdef __PS3__
int size = 30; int size = 30;
#elif defined _WIN64 #elif defined _WIN64
int size = 30; int size = 45;
if(ui.getScreenWidth() < 1920) size = 30;
if(ui.getScreenWidth() >= 1920)
{
size = 45;
}
#else #else
int size = 45; int size = 45;
#endif #endif
@@ -6721,12 +6775,8 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
#ifdef __PS3__ #ifdef __PS3__
int size = 22; int size = 22;
#elif defined _WIN64 #elif defined _WIN64
int size = 22; int size = 33;
if(ui.getScreenWidth() < 1920) size = 22;
if(ui.getScreenWidth() >= 1920)
{
size = 33;
}
#else #else
int size = 33; int size = 33;
#endif #endif
@@ -6748,7 +6798,7 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
#endif #endif
} }
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
unordered_map<PlayerUID, MOJANG_DATA *, PlayerUID::Hash> CMinecraftApp::MojangData; unordered_map<PlayerUID, MOJANG_DATA *, PlayerUID::Hash> CMinecraftApp::MojangData;
unordered_map<int, char * > CMinecraftApp::DLCTextures_PackID; unordered_map<int, char * > CMinecraftApp::DLCTextures_PackID;
unordered_map<string, DLC_INFO * > CMinecraftApp::DLCInfo; unordered_map<string, DLC_INFO * > CMinecraftApp::DLCInfo;
@@ -6759,6 +6809,12 @@ unordered_map<int, wstring > CMinecraftApp::DLCTextures_PackID; // for mash-up
//unordered_map<ULONGLONG,DLC_INFO * > CMinecraftApp::DLCInfo_Trial; // full offerid, dlc_info //unordered_map<ULONGLONG,DLC_INFO * > CMinecraftApp::DLCInfo_Trial; // full offerid, dlc_info
unordered_map<wstring,DLC_INFO * > CMinecraftApp::DLCInfo_Full; // full offerid, dlc_info unordered_map<wstring,DLC_INFO * > CMinecraftApp::DLCInfo_Full; // full offerid, dlc_info
unordered_map<wstring, wstring > CMinecraftApp::DLCInfo_SkinName; // skin name, full offer id unordered_map<wstring, wstring > CMinecraftApp::DLCInfo_SkinName; // skin name, full offer id
#elif defined(DISABLE_PSN)
unordered_map<PlayerUID, MOJANG_DATA *, PlayerUID::Hash> CMinecraftApp::MojangData;
unordered_map<int, ULONGLONG > CMinecraftApp::DLCTextures_PackID;
unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Trial;
unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Full;
unordered_map<wstring, ULONGLONG > CMinecraftApp::DLCInfo_SkinName;
#else #else
unordered_map<PlayerUID, MOJANG_DATA *> CMinecraftApp::MojangData; unordered_map<PlayerUID, MOJANG_DATA *> CMinecraftApp::MojangData;
unordered_map<int, ULONGLONG > CMinecraftApp::DLCTextures_PackID; unordered_map<int, ULONGLONG > CMinecraftApp::DLCTextures_PackID;
@@ -6841,7 +6897,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue)
return hr; return hr;
} }
#if (defined _XBOX || defined _WINDOWS64) #if (defined _XBOX || defined _WINDOWS64 || defined DISABLE_PSN)
HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, __uint64 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, __uint64 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile)
{ {
HRESULT hr=S_OK; HRESULT hr=S_OK;
@@ -6858,12 +6914,20 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGe
// ignore the names if we don't recognize them // ignore the names if we don't recognize them
if(pBannerName!=L"") if(pBannerName!=L"")
{ {
#ifdef __PSVITA__
wcsncpy_s( pDLCData->wchBanner, MAX_BANNERNAME_SIZE, pBannerName, MAX_BANNERNAME_SIZE);
#else
wcsncpy_s( pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE); wcsncpy_s( pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE);
#endif
} }
if(pDataFile[0]!=0) if(pDataFile[0]!=0)
{ {
#ifdef __PSVITA__
wcsncpy_s( pDLCData->wchDataFile, MAX_BANNERNAME_SIZE, pDataFile, MAX_BANNERNAME_SIZE);
#else
wcsncpy_s( pDLCData->wchDataFile, pDataFile, MAX_BANNERNAME_SIZE); wcsncpy_s( pDLCData->wchDataFile, pDataFile, MAX_BANNERNAME_SIZE);
#endif
} }
#endif #endif
@@ -7033,7 +7097,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortInde
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__) #if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal) bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal)
{ {
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
@@ -7301,7 +7365,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName)
return NULL; return NULL;
} }
#elif defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #elif !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
#else #else
DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full)
@@ -7336,7 +7400,7 @@ void CMinecraftApp::EnterSaveNotificationSection()
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
{ {
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE); app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE);
} }
} }
} }
@@ -7354,7 +7418,7 @@ void CMinecraftApp::LeaveSaveNotificationSection()
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 ) if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
{ {
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE); app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
} }
} }
} }
@@ -7383,14 +7447,14 @@ int CMinecraftApp::RemoteSaveThreadProc( void* lpParameter )
pMinecraft->progressRenderer->progressStage( -1 ); pMinecraft->progressRenderer->progressStage( -1 );
pMinecraft->progressRenderer->progressStagePercentage(0); pMinecraft->progressRenderer->progressStagePercentage(0);
while( !app.GetGameStarted() && app.GetUIAction( ProfileManager.GetPrimaryPad() ) == eAppAction_WaitRemoteServerSaveComplete ) while( !app.GetGameStarted() && app.GetXuiAction( ProfileManager.GetPrimaryPad() ) == eAppAction_WaitRemoteServerSaveComplete )
{ {
// Tick all the games connections // Tick all the games connections
pMinecraft->tickAllConnections(); pMinecraft->tickAllConnections();
Sleep( 100 ); Sleep( 100 );
} }
if( app.GetUIAction( ProfileManager.GetPrimaryPad() ) != eAppAction_WaitRemoteServerSaveComplete ) if( app.GetXuiAction( ProfileManager.GetPrimaryPad() ) != eAppAction_WaitRemoteServerSaveComplete )
{ {
// Something cancelled us? // Something cancelled us?
return ERROR_CANCELLED; return ERROR_CANCELLED;
@@ -9412,7 +9476,7 @@ byteArray CMinecraftApp::getArchiveFile(const wstring &filename)
// DLC // DLC
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
int CMinecraftApp::GetDLCInfoCount() int CMinecraftApp::GetDLCInfoCount()
{ {
return (int)DLCInfo.size(); return (int)DLCInfo.size();
@@ -9704,6 +9768,7 @@ void CMinecraftApp::getLocale(vector<wstring> &vecWstrLocales)
locales.push_back(eMCLang_zhCN); locales.push_back(eMCLang_zhCN);
break; break;
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ || defined _DURANGO
case XC_LANGUAGE_DANISH: case XC_LANGUAGE_DANISH:
locales.push_back(eMCLang_daDA); locales.push_back(eMCLang_daDA);
locales.push_back(eMCLang_daDK); locales.push_back(eMCLang_daDK);
@@ -9729,6 +9794,7 @@ void CMinecraftApp::getLocale(vector<wstring> &vecWstrLocales)
locales.push_back(eMCLang_enGR); locales.push_back(eMCLang_enGR);
locales.push_back(eMCLang_enGB); locales.push_back(eMCLang_enGB);
break; break;
#endif
} }
#endif #endif
@@ -10017,13 +10083,13 @@ enum ETitleUpdateTexturePacks
}; };
#ifdef _WINDOWS64 #ifdef _WINDOWS64
wstring titleUpdateTexturePackRoot = L"Windows64Media\\DLC\\"; wstring titleUpdateTexturePackRoot = L"Windows64\\DLC\\";
#elif defined(__ORBIS__) #elif defined(__ORBIS__)
wstring titleUpdateTexturePackRoot = L"app0/Orbis/DLC/"; wstring titleUpdateTexturePackRoot = L"/app0/orbis/CU/DLC/";
#elif defined(__PSVITA__) #elif defined(__PSVITA__)
wstring titleUpdateTexturePackRoot = L"PSVita/DLC/"; wstring titleUpdateTexturePackRoot = L"PSVita/CU/DLC/";
#elif defined(__PS3__) #elif defined(__PS3__)
wstring titleUpdateTexturePackRoot = L"PS3/DLC/"; wstring titleUpdateTexturePackRoot = L"PS3/CU/DLC/";
#else #else
wstring titleUpdateTexturePackRoot = L"CU\\DLC\\"; wstring titleUpdateTexturePackRoot = L"CU\\DLC\\";
#endif #endif
+37 -19
View File
@@ -114,6 +114,7 @@ public:
static const int USER_SR = 6; static const int USER_SR = 6;
static const int USER_UI = 7; // 4J Stu - This also makes it appear on the UI console static const int USER_UI = 7; // 4J Stu - This also makes it appear on the UI console
void HandleButtonPresses();
bool IntroRunning() { return m_bIntroRunning;} bool IntroRunning() { return m_bIntroRunning;}
void SetIntroRunning(bool bSet) {m_bIntroRunning=bSet;} void SetIntroRunning(bool bSet) {m_bIntroRunning=bSet;}
#ifdef _CONTENT_PACKAGE #ifdef _CONTENT_PACKAGE
@@ -159,17 +160,17 @@ public:
eGameMode GetGameMode() { return m_eGameMode;} eGameMode GetGameMode() { return m_eGameMode;}
void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;} void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;}
eUIAction GetGlobalUIAction() {return m_eGlobalUIAction;} eXuiAction GetGlobalXuiAction() {return m_eGlobalXuiAction;}
void SetGlobalUIAction(eUIAction action) {m_eGlobalUIAction=action;} void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;}
eUIAction GetUIAction(int iPad) {return m_eUIAction[iPad];} eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];}
void SetAction(int iPad, eUIAction action, LPVOID param = NULL); void SetAction(int iPad, eXuiAction action, LPVOID param = NULL);
void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; } void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; }
eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];} eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];}
eUIServerAction GetUIServerAction(int iPad) {return m_eUIServerAction[iPad];} eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];}
LPVOID GetUIServerActionParam(int iPad) {return m_eUIServerActionParam[iPad];} LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];}
void SetUIServerAction(int iPad, eUIServerAction action, LPVOID param = NULL) {m_eUIServerAction[iPad]=action; m_eUIServerActionParam[iPad] = param;} void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;}
eUIServerAction GetGlobalUIServerAction() {return m_eGlobalUIServerAction;} eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;}
void SetGlobalUIServerAction(eUIServerAction action) {m_eGlobalUIServerAction=action;} void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;}
DisconnectPacket::eDisconnectReason GetDisconnectReason() { return m_disconnectReason; } DisconnectPacket::eDisconnectReason GetDisconnectReason() { return m_disconnectReason; }
void SetDisconnectReason(DisconnectPacket::eDisconnectReason bVal) { m_disconnectReason = bVal; } void SetDisconnectReason(DisconnectPacket::eDisconnectReason bVal) { m_disconnectReason = bVal; }
@@ -183,7 +184,7 @@ public:
// 4J Stu - Added so that we can call this when a confirmation box is selected // 4J Stu - Added so that we can call this when a confirmation box is selected
static void SetActionConfirmed(LPVOID param); static void SetActionConfirmed(LPVOID param);
void HandleUIActions(void); void HandleXuiActions(void);
// 4J Stu - Functions used for Minecon and other promo work // 4J Stu - Functions used for Minecon and other promo work
bool GetLoadSavesFromFolderEnabled() { return m_bLoadSavesFromFolderEnabled; } bool GetLoadSavesFromFolderEnabled() { return m_bLoadSavesFromFolderEnabled; }
@@ -445,6 +446,8 @@ private:
VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT]; VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT];
void HandleButtonPresses(int iPad);
bool m_bResourcesLoaded; bool m_bResourcesLoaded;
// Global string table for this application. // Global string table for this application.
@@ -511,13 +514,13 @@ private:
// To avoid problems with threads being kicked off from xuis that alter things that may be in progress within the run_middle, // To avoid problems with threads being kicked off from xuis that alter things that may be in progress within the run_middle,
// we'll action these at the end of the game loop // we'll action these at the end of the game loop
eUIAction m_eUIAction[XUSER_MAX_COUNT]; eXuiAction m_eXuiAction[XUSER_MAX_COUNT];
eTMSAction m_eTMSAction[XUSER_MAX_COUNT]; eTMSAction m_eTMSAction[XUSER_MAX_COUNT];
LPVOID m_eUIActionParam[XUSER_MAX_COUNT]; LPVOID m_eXuiActionParam[XUSER_MAX_COUNT];
eUIAction m_eGlobalUIAction; eXuiAction m_eGlobalXuiAction;
eUIServerAction m_eUIServerAction[XUSER_MAX_COUNT]; eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT];
LPVOID m_eUIServerActionParam[XUSER_MAX_COUNT]; LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT];
eUIServerAction m_eGlobalUIServerAction; eXuiServerAction m_eGlobalXuiServerAction;
bool m_bLiveLinkRequired; bool m_bLiveLinkRequired;
@@ -591,7 +594,7 @@ public:
MOJANG_DATA *GetMojangDataForXuid(PlayerUID xuid); MOJANG_DATA *GetMojangDataForXuid(PlayerUID xuid);
static HRESULT RegisterConfigValues(WCHAR *pType, int iValue); static HRESULT RegisterConfigValues(WCHAR *pType, int iValue);
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) #if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
HRESULT RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL); HRESULT RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL);
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal);
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
@@ -628,7 +631,7 @@ private:
std::vector <SCreditTextItemDef *> vDLCCredits; std::vector <SCreditTextItemDef *> vDLCCredits;
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData; static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
static unordered_map<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs static unordered_map<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs
static unordered_map<string,DLC_INFO * > DLCInfo; static unordered_map<string,DLC_INFO * > DLCInfo;
@@ -639,6 +642,12 @@ private:
//static unordered_map<wstring,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info //static unordered_map<wstring,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
static unordered_map<wstring,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info static unordered_map<wstring,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
static unordered_map<wstring, wstring > DLCInfo_SkinName; // skin name, full offer id static unordered_map<wstring, wstring > DLCInfo_SkinName; // skin name, full offer id
#elif defined(DISABLE_PSN)
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
#else #else
static unordered_map<PlayerUID,MOJANG_DATA * > MojangData; static unordered_map<PlayerUID,MOJANG_DATA * > MojangData;
static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs
@@ -769,7 +778,7 @@ public:
void ClearTMSPPFilesRetrieved(); void ClearTMSPPFilesRetrieved();
unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromote=false); unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromote=false);
int GetDLCInfoTexturesOffersCount(); int GetDLCInfoTexturesOffersCount();
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__) #if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
DLC_INFO *GetDLCInfo(int iIndex); DLC_INFO *GetDLCInfo(int iIndex);
DLC_INFO *GetDLCInfo(char *); DLC_INFO *GetDLCInfo(char *);
DLC_INFO *GetDLCInfoFromTPackID(int iTPID); DLC_INFO *GetDLCInfoFromTPackID(int iTPID);
@@ -848,6 +857,15 @@ public:
static DWORD getSkinIdFromPath(const wstring &skin); static DWORD getSkinIdFromPath(const wstring &skin);
static wstring getSkinPathFromId(DWORD skinId); static wstring getSkinPathFromId(DWORD skinId);
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile)=0;
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)=0;
virtual void FreeLocalTMSFiles(eTMSFileType eType)=0;
virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)=0;
virtual bool GetTMSGlobalFileListRead() { return true;}
virtual bool GetTMSDLCInfoRead() { return true;}
virtual bool GetTMSXUIDsFileRead() { return true;}
bool GetBanListRead(int iPad) { return m_bRead_BannedListA[iPad];} bool GetBanListRead(int iPad) { return m_bRead_BannedListA[iPad];}
void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;} void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;}
void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;} void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;}
+10 -21
View File
@@ -344,14 +344,14 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL
} }
else if (fromArchive) return false; else if (fromArchive) return false;
#if (defined _DURANGO || _WINDOWS64) #ifdef _WINDOWS64
string finalPath = StorageManager.GetMountedPath(path.c_str());
if(finalPath.size() == 0) finalPath = path;
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#elif defined(_DURANGO)
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str()); wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
if(finalPath.size() == 0) finalPath = wPath; if(finalPath.size() == 0) finalPath = wPath;
#ifdef _DURANGO
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#else
HANDLE file = CreateFileW(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#endif
#else #else
HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#endif #endif
@@ -406,12 +406,6 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
unsigned int uiVersion=*(unsigned int *)pbData; unsigned int uiVersion=*(unsigned int *)pbData;
uiCurrentByte+=sizeof(int); uiCurrentByte+=sizeof(int);
if(uiVersion > CURRENT_DLC_VERSION_NUM)
{
if(pbData!=NULL) delete [] pbData;
app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM);
return false;
}
if(uiVersion < CURRENT_DLC_VERSION_NUM) if(uiVersion < CURRENT_DLC_VERSION_NUM)
{ {
if(pbData!=NULL) delete [] pbData; if(pbData!=NULL) delete [] pbData;
@@ -557,14 +551,14 @@ DWORD DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pac
DWORD packId = 0; DWORD packId = 0;
wstring wPath = convStringToWstring(path); wstring wPath = convStringToWstring(path);
#if (defined _DURANGO || _WINDOWS64) #ifdef _WINDOWS64
string finalPath = StorageManager.GetMountedPath(path.c_str());
if(finalPath.size() == 0) finalPath = path;
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#elif defined(_DURANGO)
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str()); wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
if(finalPath.size() == 0) finalPath = wPath; if(finalPath.size() == 0) finalPath = wPath;
#ifdef _DURANGO
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#else
HANDLE file = CreateFileW(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#endif
#else #else
HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#endif #endif
@@ -619,11 +613,6 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
unsigned int uiVersion=*(unsigned int *)pbData; unsigned int uiVersion=*(unsigned int *)pbData;
uiCurrentByte+=sizeof(int); uiCurrentByte+=sizeof(int);
if(uiVersion > CURRENT_DLC_VERSION_NUM)
{
app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM);
return 0;
}
if(uiVersion < CURRENT_DLC_VERSION_NUM) if(uiVersion < CURRENT_DLC_VERSION_NUM)
{ {
app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion); app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion);
@@ -464,7 +464,7 @@ void LevelGenerationOptions::loadBaseSaveData()
if(mountIndex > -1) if(mountIndex > -1)
{ {
#if (defined _DURANGO || _WINDOWS64) #ifdef _DURANGO
if(StorageManager.MountInstalledDLC(ProfileManager.GetPrimaryPad(),mountIndex,&LevelGenerationOptions::packMounted,this,L"WPACK")!=ERROR_IO_PENDING) if(StorageManager.MountInstalledDLC(ProfileManager.GetPrimaryPad(),mountIndex,&LevelGenerationOptions::packMounted,this,L"WPACK")!=ERROR_IO_PENDING)
#else #else
if(StorageManager.MountInstalledDLC(ProfileManager.GetPrimaryPad(),mountIndex,&LevelGenerationOptions::packMounted,this,"WPACK")!=ERROR_IO_PENDING) if(StorageManager.MountInstalledDLC(ProfileManager.GetPrimaryPad(),mountIndex,&LevelGenerationOptions::packMounted,this,"WPACK")!=ERROR_IO_PENDING)
@@ -604,7 +604,7 @@ int LevelGenerationOptions::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD
} }
} }
#if (defined _DURANGO || _WINDOWS64) #ifdef _DURANGO
DWORD result = StorageManager.UnmountInstalledDLC(L"WPACK"); DWORD result = StorageManager.UnmountInstalledDLC(L"WPACK");
#else #else
DWORD result = StorageManager.UnmountInstalledDLC("WPACK"); DWORD result = StorageManager.UnmountInstalledDLC("WPACK");
@@ -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);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 1800 files, more files were not shown because too many files have changed in this diff. Show more