Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c23e3e54c |
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: ❗NEW❗ MinecraftConsoles Community Discord
|
||||
url: https://discord.gg/dH8AZWGcau
|
||||
- name: MinecraftConsoles Community Discord
|
||||
url: https://discord.gg/jrum7HhegA
|
||||
about: If you need help, please ask for it in our Discord! You will get assistance much faster there, including help getting the project to compile.
|
||||
|
||||
+78
-212
@@ -7,7 +7,6 @@ permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
attestations: write
|
||||
packages: write
|
||||
|
||||
concurrency:
|
||||
group: nightly
|
||||
@@ -16,22 +15,20 @@ concurrency:
|
||||
jobs:
|
||||
build-client:
|
||||
name: Build Client
|
||||
runs-on: [self-hosted, windows]
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: https://github.com/ilammy/msvc-dev-cmd@v1
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Setup CMake
|
||||
uses: https://github.com/lukka/get-cmake@latest
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Run CMake
|
||||
uses: https://github.com/lukka/run-cmake@v10
|
||||
uses: lukka/run-cmake@v10
|
||||
env:
|
||||
VCPKG_ROOT: ""
|
||||
with:
|
||||
@@ -48,7 +45,7 @@ jobs:
|
||||
|
||||
# Collect files, excluding unwanted extensions
|
||||
$files = Get-ChildItem -Path $source -Recurse -File |
|
||||
Where-Object { $_.Extension -notin '.pch', '.pdb', '.zip', '.ipdb', '.iobj', '.exp', '.lib' }
|
||||
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj' }
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
@@ -83,37 +80,34 @@ jobs:
|
||||
New-Item -ItemType Directory -Force -Path staging
|
||||
Copy-Item LCE-Revelations-Client-Win64.zip staging/
|
||||
Copy-Item ./build/windows64/Minecraft.Client/Release/Minecraft.Client.exe staging/
|
||||
Copy-Item ./build/windows64/Minecraft.Client/Release/Minecraft.Client.pdb staging/
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: client-build
|
||||
path: staging/*
|
||||
|
||||
build-server:
|
||||
name: Build Server
|
||||
runs-on: [self-hosted, windows]
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: https://github.com/ilammy/msvc-dev-cmd@v1
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Setup CMake
|
||||
uses: https://github.com/lukka/get-cmake@latest
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup .NET
|
||||
uses: https://github.com/actions/setup-dotnet@v4
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
- name: Run CMake
|
||||
uses: https://github.com/lukka/run-cmake@v10
|
||||
uses: lukka/run-cmake@v10
|
||||
env:
|
||||
VCPKG_ROOT: ""
|
||||
with:
|
||||
@@ -129,7 +123,7 @@ jobs:
|
||||
$topLevel = "LCE-Revelations-Server-Win64"
|
||||
|
||||
$files = Get-ChildItem -Path $source -Recurse -File |
|
||||
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj', '.exp', '.lib' }
|
||||
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj' }
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
@@ -164,7 +158,7 @@ jobs:
|
||||
$topLevel = "LCE-Revelations-Server-Win64-FourKit"
|
||||
|
||||
$files = Get-ChildItem -Path $source -Recurse -File |
|
||||
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj', '.exp', '.lib' }
|
||||
Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj' }
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
@@ -199,119 +193,49 @@ jobs:
|
||||
Copy-Item LCE-Revelations-Server-Win64-FourKit.zip staging/
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: server-build
|
||||
path: staging/*
|
||||
|
||||
docker:
|
||||
name: Build Docker (${{ matrix.variant }})
|
||||
needs: build-server
|
||||
runs-on: [self-hosted, linux]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- variant: vanilla
|
||||
zip: LCE-Revelations-Server-Win64.zip
|
||||
subdir: LCE-Revelations-Server-Win64
|
||||
image: lce-revelations-dedicated-server
|
||||
- variant: fourkit
|
||||
zip: LCE-Revelations-Server-Win64-FourKit.zip
|
||||
subdir: LCE-Revelations-Server-Win64-FourKit
|
||||
image: lce-revelations-dedicated-server-fourkit
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v6
|
||||
|
||||
- name: Download server artifacts
|
||||
uses: https://github.com/actions/download-artifact@v3
|
||||
with:
|
||||
name: server-build
|
||||
path: .artifacts/
|
||||
|
||||
- name: Prepare runtime directory
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -rf runtime .extracted
|
||||
unzip -q ".artifacts/${{ matrix.zip }}" -d .extracted
|
||||
mv ".extracted/${{ matrix.subdir }}" runtime
|
||||
# Strip debug symbols to keep image small (zip includes .pdb).
|
||||
find runtime -name '*.pdb' -delete
|
||||
|
||||
- name: Compute image name
|
||||
id: image
|
||||
shell: bash
|
||||
run: |
|
||||
owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
|
||||
echo "image=git.revela.dev/$owner/${{ matrix.image }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: https://github.com/docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ steps.image.outputs.image }}
|
||||
tags: |
|
||||
type=raw,value=nightly
|
||||
|
||||
- name: Login to Forgejo registry
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
registry: git.revela.dev
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push image
|
||||
uses: https://github.com/docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: docker/dedicated-server/Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
MC_RUNTIME_DIR=runtime
|
||||
|
||||
release-server:
|
||||
name: Release Server
|
||||
needs: build-server
|
||||
runs-on: [self-hosted, linux]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v6
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download server artifacts
|
||||
uses: https://github.com/actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: server-build
|
||||
path: artifacts
|
||||
|
||||
- name: Install jq
|
||||
run: apt-get update && apt-get install -y --no-install-recommends jq
|
||||
- name: Attest artifacts
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: |
|
||||
artifacts/LCE-Revelations-Server-Win64.zip
|
||||
artifacts/LCE-Revelations-Server-Win64-FourKit.zip
|
||||
|
||||
- name: Get short SHA
|
||||
id: sha
|
||||
run: echo "short=$(echo '${{ github.sha }}' | cut -c1-7)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Delete old release and tag
|
||||
- name: Delete old release
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG="Nightly-Dedicated-Server"
|
||||
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
||||
AUTH="Authorization: token $FORGEJO_TOKEN"
|
||||
EXISTING_ID=$(curl -sf -H "$AUTH" "$API/releases/tags/$TAG" 2>/dev/null | jq -r '.id // empty' || true)
|
||||
if [ -n "$EXISTING_ID" ]; then
|
||||
curl -sf -X DELETE -H "$AUTH" "$API/releases/$EXISTING_ID"
|
||||
fi
|
||||
curl -s -X DELETE -H "$AUTH" "$API/tags/$TAG" > /dev/null || true
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: gh release delete Nightly-Dedicated-Server --yes || true
|
||||
|
||||
- name: Delete old tag
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: gh api repos/${{ github.repository }}/git/refs/tags/Nightly-Dedicated-Server --method DELETE || true
|
||||
|
||||
- name: Import GPG key
|
||||
uses: https://github.com/crazy-max/ghaction-import-gpg@v6
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
@@ -323,94 +247,59 @@ jobs:
|
||||
git tag -s -f Nightly-Dedicated-Server -m "Nightly server release ${{ steps.sha.outputs.short }}"
|
||||
git push origin Nightly-Dedicated-Server --force
|
||||
|
||||
- name: Create release on Forgejo
|
||||
- name: Create release
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG="Nightly-Dedicated-Server"
|
||||
TITLE="Server: ${{ steps.sha.outputs.short }}"
|
||||
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
||||
AUTH="Authorization: token $FORGEJO_TOKEN"
|
||||
|
||||
NOTES=$(cat <<'EOF'
|
||||
Dedicated Server runtime for Windows64.
|
||||
gh release create Nightly-Dedicated-Server artifacts/* \
|
||||
--title "Server: ${{ steps.sha.outputs.short }}" \
|
||||
--notes "Dedicated Server runtime for Windows64.
|
||||
|
||||
Two flavours are attached:
|
||||
- `LCE-Revelations-Server-Win64.zip`: vanilla server, no plugin support, smallest download.
|
||||
- `LCE-Revelations-Server-Win64-FourKit.zip`: server with the FourKit plugin host, bundled .NET 10 runtime, and an empty `plugins/` folder ready for plugin authors to drop DLLs into.
|
||||
- \`LCE-Revelations-Server-Win64.zip\`: vanilla server, no plugin support, smallest download.
|
||||
- \`LCE-Revelations-Server-Win64-FourKit.zip\`: server with the FourKit plugin host, bundled .NET 10 runtime, and an empty \`plugins/\` folder ready for plugin authors to drop DLLs into.
|
||||
|
||||
Pick the flavour you want and extract it to a folder where you'd like to keep the server runtime.
|
||||
EOF
|
||||
)
|
||||
|
||||
PAYLOAD=$(jq -nc --arg tag "$TAG" --arg name "$TITLE" --arg body "$NOTES" \
|
||||
'{tag_name:$tag, name:$name, body:$body, draft:false, prerelease:false}')
|
||||
|
||||
RID=$(curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD" "$API/releases" | jq -r '.id')
|
||||
|
||||
if [ -z "$RID" ] || [ "$RID" = "null" ]; then
|
||||
echo "Failed to create release" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Created release id=$RID"
|
||||
|
||||
for asset in artifacts/*; do
|
||||
name=$(basename "$asset")
|
||||
size=$(stat -c%s "$asset")
|
||||
echo "Uploading $name ($size bytes)"
|
||||
HTTP=$(curl -sS -w '%{http_code}' -o /tmp/upload-resp -X POST -H "$AUTH" \
|
||||
-F "attachment=@$asset" \
|
||||
"$API/releases/$RID/assets?name=$name")
|
||||
if [ "$HTTP" -lt 200 ] || [ "$HTTP" -ge 300 ]; then
|
||||
echo "Upload failed: HTTP $HTTP" >&2
|
||||
echo "--- response body ---" >&2
|
||||
cat /tmp/upload-resp >&2 || true
|
||||
echo "" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Uploaded $name OK (HTTP $HTTP)"
|
||||
done
|
||||
Pick the flavour you want and extract it to a folder where you'd like to keep the server runtime." \
|
||||
--latest=false
|
||||
|
||||
release-client:
|
||||
name: Release Client
|
||||
needs: [build-client, release-server]
|
||||
runs-on: [self-hosted, linux]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v6
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download client artifacts
|
||||
uses: https://github.com/actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: client-build
|
||||
path: artifacts
|
||||
|
||||
- name: Install jq
|
||||
run: apt-get update && apt-get install -y --no-install-recommends jq
|
||||
- name: Attest artifacts
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: |
|
||||
artifacts/LCE-Revelations-Client-Win64.zip
|
||||
artifacts/Minecraft.Client.exe
|
||||
|
||||
- name: Get short SHA
|
||||
id: sha
|
||||
run: echo "short=$(echo '${{ github.sha }}' | cut -c1-7)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Delete old release and tag
|
||||
- name: Delete old release
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG="Nightly"
|
||||
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
||||
AUTH="Authorization: token $FORGEJO_TOKEN"
|
||||
EXISTING_ID=$(curl -sf -H "$AUTH" "$API/releases/tags/$TAG" 2>/dev/null | jq -r '.id // empty' || true)
|
||||
if [ -n "$EXISTING_ID" ]; then
|
||||
curl -sf -X DELETE -H "$AUTH" "$API/releases/$EXISTING_ID"
|
||||
fi
|
||||
curl -s -X DELETE -H "$AUTH" "$API/tags/$TAG" > /dev/null || true
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: gh release delete Nightly --yes || true
|
||||
|
||||
- name: Delete old tag
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: gh api repos/${{ github.repository }}/git/refs/tags/Nightly --method DELETE || true
|
||||
|
||||
- name: Import GPG key
|
||||
uses: https://github.com/crazy-max/ghaction-import-gpg@v6
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
@@ -432,10 +321,7 @@ jobs:
|
||||
- To play, simply run `Minecraft.Client.exe`.
|
||||
|
||||
**For those that wish to update their existing installation with the latest build:**
|
||||
- Download `Minecraft.Client.exe` and copy it over to your existing LCE-Revelations-Client-Win64 build (overwrite your old version of Minecraft.Client.exe).
|
||||
|
||||
**For developers:**
|
||||
- `Minecraft.Client.pdb` contains debug symbols for crash analysis and development. Place it next to `Minecraft.Client.exe` for stack traces to show function names and line numbers.
|
||||
- Download `Minecraft.Client.exe` and `Minecraft.Client.pdb` and copy them over to your existing LCE-Revelations-Client-Win64 build (overwrite your old version of Minecraft.Client.exe and Minecraft.Client.pdb).
|
||||
|
||||
**Steam Deck & Linux:**
|
||||
- Y'all know the drill. Download the `LCE-Revelations-Client-Win64.zip`, extract it, add the `Minecraft.Client.exe` as a "Non-Steam Game" within the Steam library, turn on compatibility mode with Proton Experimental, and then run it!
|
||||
@@ -457,42 +343,22 @@ jobs:
|
||||
- After creating your tunnel, navigate to the "Tunnels" main page. You'll see the IP address and port for your tunnel. This is what your friends will input when adding your server in order to join your online game!
|
||||
NOTES
|
||||
|
||||
- name: Create release on Forgejo
|
||||
- name: Create release
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG="Nightly"
|
||||
TITLE="Client: ${{ steps.sha.outputs.short }}"
|
||||
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
||||
AUTH="Authorization: token $FORGEJO_TOKEN"
|
||||
gh release create Nightly artifacts/* \
|
||||
--title "Client: ${{ steps.sha.outputs.short }}" \
|
||||
--notes-file notes.md
|
||||
|
||||
BODY=$(cat notes.md)
|
||||
PAYLOAD=$(jq -nc --arg tag "$TAG" --arg name "$TITLE" --arg body "$BODY" \
|
||||
'{tag_name:$tag, name:$name, body:$body, draft:false, prerelease:false}')
|
||||
|
||||
RID=$(curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD" "$API/releases" | jq -r '.id')
|
||||
|
||||
if [ -z "$RID" ] || [ "$RID" = "null" ]; then
|
||||
echo "Failed to create release" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Created release id=$RID"
|
||||
|
||||
for asset in artifacts/*; do
|
||||
name=$(basename "$asset")
|
||||
size=$(stat -c%s "$asset")
|
||||
echo "Uploading $name ($size bytes)"
|
||||
HTTP=$(curl -sS -w '%{http_code}' -o /tmp/upload-resp -X POST -H "$AUTH" \
|
||||
-F "attachment=@$asset" \
|
||||
"$API/releases/$RID/assets?name=$name")
|
||||
if [ "$HTTP" -lt 200 ] || [ "$HTTP" -ge 300 ]; then
|
||||
echo "Upload failed: HTTP $HTTP" >&2
|
||||
echo "--- response body ---" >&2
|
||||
cat /tmp/upload-resp >&2 || true
|
||||
echo "" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Uploaded $name OK (HTTP $HTTP)"
|
||||
done
|
||||
cleanup:
|
||||
needs: [release-client, release-server]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cleanup artifacts
|
||||
uses: geekyeggo/delete-artifact@v5
|
||||
with:
|
||||
name: |
|
||||
client-build
|
||||
server-build
|
||||
|
||||
@@ -11,27 +11,25 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: [self-hosted, windows]
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: https://github.com/ilammy/msvc-dev-cmd@v1
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Setup CMake
|
||||
uses: https://github.com/lukka/get-cmake@latest
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Setup .NET
|
||||
uses: https://github.com/actions/setup-dotnet@v4
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
- name: Run CMake
|
||||
uses: https://github.com/lukka/run-cmake@v10
|
||||
uses: lukka/run-cmake@v10
|
||||
env:
|
||||
VCPKG_ROOT: "" # Disable vcpkg for CI builds
|
||||
with:
|
||||
|
||||
@@ -429,6 +429,3 @@ result-*
|
||||
.direnv/
|
||||
.xwin-cache/
|
||||
.xwin/
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "Minecraft.Client/Windows64/4JLibs"]
|
||||
path = Minecraft.Client/Windows64/4JLibs
|
||||
url = https://github.com/itsRevela/4JLibs.git
|
||||
+2
-4
@@ -39,10 +39,10 @@ function(configure_compiler_target target)
|
||||
# MSVC
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_compile_options(${target} PRIVATE
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL /Zi>
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL>
|
||||
)
|
||||
target_link_options(${target} PRIVATE
|
||||
$<$<CONFIG:Release>:/LTCG:incremental /DEBUG /OPT:REF /OPT:ICF>
|
||||
$<$<CONFIG:Release>:/LTCG:incremental>
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -81,8 +81,6 @@ list(APPEND MINECRAFT_SHARED_DEFINES ${PLATFORM_DEFINES})
|
||||
# ---
|
||||
# Sources
|
||||
# ---
|
||||
add_subdirectory("Minecraft.Client/${PLATFORM_NAME}/4JLibs")
|
||||
|
||||
add_subdirectory(Minecraft.World)
|
||||
add_subdirectory(Minecraft.Client)
|
||||
if(PLATFORM_NAME STREQUAL "Windows64") # Server is only supported on Windows for now
|
||||
|
||||
+1
-2
@@ -15,8 +15,7 @@
|
||||
VS 2022 has built-in CMake support, so there is no need to generate a `.sln` file by hand.
|
||||
|
||||
1. Install the prerequisites above.
|
||||
2. Clone the repo with submodules. If you don't, you will get a build error!
|
||||
- `git clone --recurse-submodules https://github.com/itsRevela/LCE-Revelations.git`
|
||||
2. Clone the repo.
|
||||
3. In Visual Studio: `File > Open > Folder...` and select the **repo root** (the folder that contains `CMakeLists.txt`).
|
||||
4. Wait for CMake to configure (~5 seconds on a warm cache, a few minutes on the first run while assets copy).
|
||||
5. Pick a build configuration in the dropdown, for example `windows64-release`.
|
||||
|
||||
@@ -104,7 +104,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
|
||||
app.DebugPrintf("Couldn't find file in archive\n");
|
||||
app.DebugPrintf("Failed to find file '%ls' in archive\n", filename.c_str());
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
ResourceLocation BeaconRenderer::BEAM_LOCATION = ResourceLocation(TN_MISC_BEACON_BEAM);
|
||||
|
||||
bool BeaconRenderer::s_renderOuterHalo = false;
|
||||
|
||||
void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
|
||||
{
|
||||
shared_ptr<BeaconTileEntity> beacon = dynamic_pointer_cast<BeaconTileEntity>(_beacon);
|
||||
@@ -20,18 +18,21 @@ void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y,
|
||||
|
||||
bindTexture(&BEAM_LOCATION);
|
||||
|
||||
// TODO: 4J: Put this back in
|
||||
//assert(0);
|
||||
//glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
//glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_BLEND);
|
||||
glDepthMask(true);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
|
||||
float tt = beacon->getLevel()->getGameTime() + a;
|
||||
float texVOff = -tt * .20f - floor(-tt * .10f);
|
||||
|
||||
if (!s_renderOuterHalo)
|
||||
{
|
||||
glDisable(GL_BLEND);
|
||||
glDepthMask(true);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
|
||||
int r = 1;
|
||||
|
||||
double rot = tt * .025 * (1 - (r & 1) * 2.5);
|
||||
@@ -72,20 +73,20 @@ void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y,
|
||||
t->vertexUV(x + enx, y, z + enz, uu2, vv2);
|
||||
t->vertexUV(x + esx, y, z + esz, uu1, vv2);
|
||||
t->vertexUV(x + esx, y + top, z + esz, uu1, vv1);
|
||||
|
||||
|
||||
t->vertexUV(x + wsx, y + top, z + wsz, uu2, vv1);
|
||||
t->vertexUV(x + wsx, y, z + wsz, uu2, vv2);
|
||||
t->vertexUV(x + wnx, y, z + wnz, uu1, vv2);
|
||||
t->vertexUV(x + wnx, y + top, z + wnz, uu1, vv1);
|
||||
|
||||
|
||||
t->end();
|
||||
}
|
||||
else
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask(false);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask(false);
|
||||
|
||||
{
|
||||
t->begin();
|
||||
t->color(255, 255, 255, 32);
|
||||
|
||||
@@ -110,22 +111,22 @@ void BeaconRenderer::render(shared_ptr<TileEntity> _beacon, double x, double y,
|
||||
t->vertexUV(x + wnx, y, z + wnz, uu2, vv2);
|
||||
t->vertexUV(x + enx, y, z + enz, uu1, vv2);
|
||||
t->vertexUV(x + enx, y + top, z + enz, uu1, vv1);
|
||||
|
||||
|
||||
t->vertexUV(x + esx, y + top, z + esz, uu2, vv1);
|
||||
t->vertexUV(x + esx, y, z + esz, uu2, vv2);
|
||||
t->vertexUV(x + wsx, y, z + wsz, uu1, vv2);
|
||||
t->vertexUV(x + wsx, y + top, z + wsz, uu1, vv1);
|
||||
|
||||
|
||||
t->vertexUV(x + enx, y + top, z + enz, uu2, vv1);
|
||||
t->vertexUV(x + enx, y, z + enz, uu2, vv2);
|
||||
t->vertexUV(x + esx, y, z + esz, uu1, vv2);
|
||||
t->vertexUV(x + esx, y + top, z + esz, uu1, vv1);
|
||||
|
||||
|
||||
t->vertexUV(x + wsx, y + top, z + wsz, uu2, vv1);
|
||||
t->vertexUV(x + wsx, y, z + wsz, uu2, vv2);
|
||||
t->vertexUV(x + wnx, y, z + wnz, uu1, vv2);
|
||||
t->vertexUV(x + wnx, y + top, z + wnz, uu1, vv1);
|
||||
|
||||
|
||||
t->end();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,5 @@ private:
|
||||
static ResourceLocation BEAM_LOCATION;
|
||||
|
||||
public:
|
||||
static bool s_renderOuterHalo;
|
||||
|
||||
virtual void render(shared_ptr<TileEntity> _beacon, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled);
|
||||
};
|
||||
|
||||
@@ -57,10 +57,16 @@ target_link_libraries(Minecraft.Client PRIVATE
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
4JLibs.${PLATFORM_NAME}.Input
|
||||
4JLibs.${PLATFORM_NAME}.Profile
|
||||
4JLibs.${PLATFORM_NAME}.Storage
|
||||
4JLibs.${PLATFORM_NAME}.Render
|
||||
$<$<CONFIG:Debug>: # Debug 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>: # Release 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
|
||||
# Iggy libs
|
||||
@@ -76,6 +82,8 @@ set(ASSET_FOLDER_PAIRS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/music" "music"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Media" "Common/Media"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/res" "Common/res"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Trial" "Common/Trial"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Tutorial" "Common/Tutorial"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}Media" "${PLATFORM_NAME}Media"
|
||||
)
|
||||
setup_asset_folder_copy(Minecraft.Client "${ASSET_FOLDER_PAIRS}")
|
||||
|
||||
@@ -12,7 +12,6 @@ const wstring ChatScreen::allowedChars = SharedConstants::acceptableLetters;
|
||||
vector<wstring> ChatScreen::s_chatHistory;
|
||||
int ChatScreen::s_historyIndex = -1;
|
||||
wstring ChatScreen::s_historyDraft;
|
||||
int ChatScreen::s_chatIndex = 0;
|
||||
|
||||
bool ChatScreen::isAllowedChatChar(wchar_t c)
|
||||
{
|
||||
@@ -29,8 +28,6 @@ ChatScreen::ChatScreen()
|
||||
frame = 0;
|
||||
cursorIndex = 0;
|
||||
s_historyIndex = -1;
|
||||
|
||||
ChatScreen::s_chatIndex = 0;
|
||||
}
|
||||
|
||||
void ChatScreen::init()
|
||||
@@ -92,20 +89,6 @@ void ChatScreen::handleHistoryDown()
|
||||
applyHistoryMessage();
|
||||
}
|
||||
|
||||
int ChatScreen::getChatIndex()
|
||||
{
|
||||
return ChatScreen::s_chatIndex;
|
||||
}
|
||||
|
||||
void ChatScreen::correctChatIndex(int newChatIndex) {
|
||||
ChatScreen::s_chatIndex = newChatIndex;
|
||||
}
|
||||
|
||||
void ChatScreen::setWheelValue(int wheel) {
|
||||
ChatScreen::s_chatIndex += wheel;
|
||||
if (ChatScreen::s_chatIndex < 0) ChatScreen::s_chatIndex = 0;
|
||||
}
|
||||
|
||||
void ChatScreen::keyPressed(wchar_t ch, int eventKey)
|
||||
{
|
||||
if (eventKey == Keyboard::KEY_ESCAPE)
|
||||
@@ -157,7 +140,7 @@ void ChatScreen::keyPressed(wchar_t ch, int eventKey)
|
||||
cursorIndex--;
|
||||
return;
|
||||
}
|
||||
if (isAllowedChatChar(ch) && static_cast<int>(message.length()) < SharedConstants::maxVisibleLength)
|
||||
if (isAllowedChatChar(ch) && static_cast<int>(message.length()) < SharedConstants::maxChatLength)
|
||||
{
|
||||
message.insert(cursorIndex, 1, ch);
|
||||
cursorIndex++;
|
||||
|
||||
@@ -16,7 +16,6 @@ private:
|
||||
static std::vector<wstring> s_chatHistory;
|
||||
static int s_historyIndex;
|
||||
static wstring s_historyDraft;
|
||||
static int s_chatIndex;
|
||||
static const wstring allowedChars;
|
||||
static bool isAllowedChatChar(wchar_t c);
|
||||
|
||||
@@ -29,9 +28,6 @@ public:
|
||||
virtual void handleHistoryUp();
|
||||
virtual void handleHistoryDown();
|
||||
|
||||
static int getChatIndex();
|
||||
static void correctChatIndex(int newChatIndex);
|
||||
static void setWheelValue(int wheel);
|
||||
protected:
|
||||
void keyPressed(wchar_t ch, int eventKey);
|
||||
public:
|
||||
|
||||
@@ -1016,7 +1016,7 @@ bool Chunk::isEmpty()
|
||||
void Chunk::setDirty()
|
||||
{
|
||||
// 4J - not used, but if this starts being used again then we'll need to investigate how best to handle it.
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
levelRenderer->setGlobalChunkFlag(x, y, z, level, LevelRenderer::CHUNK_FLAG_DIRTY);
|
||||
}
|
||||
|
||||
|
||||
@@ -1607,28 +1607,17 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
||||
bool replaceEntitySource = false;
|
||||
bool replaceItem = false;
|
||||
|
||||
int stringArgsSize = packet->m_stringArgs.size();
|
||||
|
||||
wstring playerDisplayName = L"";
|
||||
wstring sourceDisplayName = L"";
|
||||
|
||||
// On platforms other than Xbox One this just sets display name to gamertag
|
||||
if (stringArgsSize >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]);
|
||||
if (stringArgsSize >= 2) sourceDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[1]);
|
||||
if (packet->m_stringArgs.size() >= 1) playerDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[0]);
|
||||
if (packet->m_stringArgs.size() >= 2) sourceDisplayName = GetDisplayNameByGamertag(packet->m_stringArgs[1]);
|
||||
|
||||
switch(packet->m_messageType)
|
||||
{
|
||||
case ChatPacket::e_ChatCustom:
|
||||
case ChatPacket::e_ChatActionBar:
|
||||
if (stringArgsSize >= 1) {
|
||||
message = packet->m_stringArgs[0];
|
||||
|
||||
message = app.EscapeHTMLString(message); //do this to enforce escaped string
|
||||
message = app.FormatChatMessage(message); //this needs to be last cause it converts colors to html colors that would have been escaped
|
||||
} else {
|
||||
message = L"";
|
||||
}
|
||||
displayOnGui = (packet->m_messageType == ChatPacket::e_ChatCustom);
|
||||
message = (packet->m_stringArgs.size() >= 1) ? packet->m_stringArgs[0] : L"";
|
||||
break;
|
||||
case ChatPacket::e_ChatBedOccupied:
|
||||
message = app.GetString(IDS_TILE_BED_OCCUPIED);
|
||||
@@ -1978,7 +1967,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
||||
|
||||
if(replacePlayer)
|
||||
{
|
||||
message = replaceAll(message,L"{*PLAYER*}", playerDisplayName);
|
||||
message = replaceAll(message,L"{*PLAYER*}",playerDisplayName);
|
||||
}
|
||||
|
||||
if(replaceEntitySource)
|
||||
@@ -2013,9 +2002,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
||||
// flag that a message is a death message
|
||||
bool bIsDeathMessage = (packet->m_messageType>=ChatPacket::e_ChatDeathInFire) && (packet->m_messageType<=ChatPacket::e_ChatDeathIndirectMagicItem);
|
||||
|
||||
if( displayOnGui ) minecraft->gui->addMessage(message, m_userIndex, bIsDeathMessage);
|
||||
|
||||
if (!displayOnGui && !message.empty()) minecraft->gui->setActionBarMessage(message);
|
||||
if( displayOnGui ) minecraft->gui->addMessage(message,m_userIndex, bIsDeathMessage);
|
||||
}
|
||||
|
||||
void ClientConnection::handleAnimate(shared_ptr<AnimatePacket> packet)
|
||||
|
||||
@@ -595,26 +595,23 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
{
|
||||
U8 szSoundName[256];
|
||||
wstring name;
|
||||
const char* soundDir;
|
||||
|
||||
if (iSound >= eSFX_MAX)
|
||||
{
|
||||
strcpy((char*)szSoundName, "Minecraft/");
|
||||
name = wchSoundNames[iSound];
|
||||
soundDir = "Minecraft";
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy((char*)szSoundName, "Minecraft/UI/");
|
||||
name = wchUISoundNames[iSound];
|
||||
soundDir = "Minecraft/UI";
|
||||
}
|
||||
|
||||
char* SoundName = (char*)ConvertSoundPathToName(name);
|
||||
strcat((char*)szSoundName, SoundName);
|
||||
|
||||
char basePath[256];
|
||||
sprintf_s(basePath, "Windows64Media/Sound/%s/%s", soundDir, ConvertSoundPathToName(name));
|
||||
sprintf_s(basePath, "Windows64Media/Sound/Minecraft/UI/%s", ConvertSoundPathToName(name));
|
||||
|
||||
char finalPath[256];
|
||||
|
||||
|
||||
@@ -223,8 +223,6 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
||||
// 4J-PB - Some sounds were updated, but we can't do that for the 360 or we have to do a new sound bank
|
||||
// instead, we'll add the sounds as new ones and change the code to reference them
|
||||
L"fire.new_ignite",
|
||||
|
||||
L"damage.critical", //eSoundType_DAMAGE_CRITICAL,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@
|
||||
#endif
|
||||
|
||||
#include "../Common/Leaderboards/LeaderboardManager.h"
|
||||
#include <regex>
|
||||
|
||||
//CMinecraftApp app;
|
||||
unsigned int CMinecraftApp::m_uiLastSignInData = 0;
|
||||
@@ -96,7 +95,7 @@ CMinecraftApp::CMinecraftApp()
|
||||
// 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES in Xbox_App.h
|
||||
DebugPrintf("WARNING: The size of the profile GAME_SETTINGS struct has changed, so all stat data is likely incorrect. Is: %d, Should be: %d\n",sizeof(GAME_SETTINGS),GAME_SETTINGS_PROFILE_DATA_BYTES);
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1303,6 +1302,9 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat
|
||||
{
|
||||
// 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");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// __debugbreak();
|
||||
#endif
|
||||
|
||||
GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData;
|
||||
pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu
|
||||
@@ -6476,7 +6478,7 @@ void CMinecraftApp::InitialiseTips()
|
||||
{
|
||||
// the m_TriviaTipA or the m_GameTipA are out of sync
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -6651,97 +6653,6 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
|
||||
return text;
|
||||
}
|
||||
|
||||
//found list of html escapes at https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html
|
||||
wstring CMinecraftApp::EscapeHTMLString(const wstring& desc)
|
||||
{
|
||||
static std::unordered_map<wchar_t, wchar_t*> replacementMap = {
|
||||
{L'&', L"&"},
|
||||
{L'<', L"<"},
|
||||
{L'>', L">"},
|
||||
};
|
||||
|
||||
wstring finalString = L"";
|
||||
for (int i = 0; i < desc.size(); i++) {
|
||||
wchar_t _char = desc[i];
|
||||
auto it = replacementMap.find(_char);
|
||||
|
||||
if (it != replacementMap.end()) finalString += it->second;
|
||||
else finalString += _char;
|
||||
}
|
||||
|
||||
return finalString;
|
||||
}
|
||||
|
||||
wstring CMinecraftApp::FormatChatMessage(const wstring& desc, bool applyStyling)
|
||||
{
|
||||
static std::wregex IDS_Pattern(LR"(\{\*IDS_(\d+)\*\})"); //maybe theres a better way to do translateable IDS
|
||||
static std::wstring_view colorFormatString = L"<font color=\"#%08x\">";
|
||||
|
||||
wstring results = desc;
|
||||
wchar_t replacements[64];
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_0), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§0", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_1), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§1", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_2), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§2", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_3), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§3", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_4), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§4", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_5), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§5", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_6), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§6", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_7), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§7", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_8), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§8", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_9), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§9", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_a), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§a", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_b), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§b", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_c), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§c", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_d), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§d", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_e), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§e", replacements);
|
||||
|
||||
swprintf(replacements, 64, (applyStyling ? colorFormatString.data() : L""), GetHTMLColour(eHTMLColor_f), 0xFFFFFFFF);
|
||||
results = replaceAll(results, L"§f", replacements);
|
||||
results = replaceAll(results, L"§r", replacements); //we only support color so reset is the same as white color
|
||||
|
||||
results = replaceAll(results, L"'", L"\u2019");
|
||||
|
||||
if (applyStyling) {
|
||||
std::wsmatch match;
|
||||
while (std::regex_search(results, match, IDS_Pattern)) {
|
||||
results = replaceAll(results, match[0], app.GetString(std::stoi(match[1].str())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
wstring CMinecraftApp::GetActionReplacement(int iPad, unsigned char ucAction)
|
||||
{
|
||||
unsigned int input = InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad) ,ucAction);
|
||||
|
||||
@@ -564,9 +564,7 @@ public:
|
||||
int GetHTMLColour(eMinecraftColour colour);
|
||||
int GetHTMLColor(eMinecraftColour colour) { return GetHTMLColour(colour); }
|
||||
int GetHTMLFontSize(EHTMLFontSize size);
|
||||
wstring FormatHTMLString(int iPad, const wstring& desc, int shadowColour = 0xFFFFFFFF);
|
||||
wstring EscapeHTMLString(const wstring &desc);
|
||||
wstring FormatChatMessage(const wstring& desc, bool applyStyling = true);
|
||||
wstring FormatHTMLString(int iPad, const wstring &desc, int shadowColour = 0xFFFFFFFF);
|
||||
wstring GetActionReplacement(int iPad, unsigned char ucAction);
|
||||
wstring GetVKReplacement(unsigned int uiVKey);
|
||||
wstring GetIconReplacement(unsigned int uiIcon);
|
||||
|
||||
@@ -171,7 +171,7 @@ DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/)
|
||||
if(index >= m_packs.size())
|
||||
{
|
||||
app.DebugPrintf("DLCManager: Trying to access a DLC pack beyond the range of valid packs\n");
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
}
|
||||
pack = m_packs[index];
|
||||
}
|
||||
@@ -186,6 +186,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
|
||||
if(pack == nullptr)
|
||||
{
|
||||
app.DebugPrintf("DLCManager: Attempting to find the index for a nullptr pack\n");
|
||||
//__debugbreak();
|
||||
return foundIndex;
|
||||
}
|
||||
if( type != e_DLCType_All )
|
||||
|
||||
@@ -107,7 +107,7 @@ void DLCPack::addChildPack(DLCPack *childPack)
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if(packId < 0 || packId > 15)
|
||||
{
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
}
|
||||
#endif
|
||||
childPack->SetPackId( (packId<<24) | m_packId );
|
||||
@@ -362,7 +362,7 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo
|
||||
{
|
||||
app.DebugPrintf("Unimplemented\n");
|
||||
#ifndef __CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -392,6 +392,9 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path)
|
||||
/*if(type == DLCManager::e_DLCType_All)
|
||||
{
|
||||
app.DebugPrintf("Unimplemented\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
|
||||
@@ -122,7 +122,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("ConsoleSchematicFile has read a nullptr tile entity\n");
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -635,7 +635,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
}
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if(p!=blockCount) DEBUG_BREAK();
|
||||
if(p!=blockCount) __debugbreak();
|
||||
#endif
|
||||
|
||||
// We don't know how this will compress - just make a fixed length buffer to initially decompress into
|
||||
|
||||
@@ -24,7 +24,7 @@ GameRule::ValueType GameRule::getParameter(const wstring ¶meterName)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
wprintf(L"WARNING: Parameter %ls was not set before being fetched\n", parameterName.c_str());
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
}
|
||||
return m_parameters[parameterName];
|
||||
|
||||
@@ -238,7 +238,7 @@ HRESULT SonyLeaderboardManager::fillByIdsQuery(const SceNpId &myNpId, SceNpId* &
|
||||
{
|
||||
// 4J-JEV: Something terrible must have happend,
|
||||
// 'getFriendslist' was supposed to be a synchronous operation.
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
|
||||
// 4J-JEV: We can at least fall-back to just the players score.
|
||||
len = 1;
|
||||
|
||||
@@ -204,12 +204,6 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
ProfileManager.SetDeferredSignoutEnabled(true);
|
||||
#endif
|
||||
|
||||
// Clear any stale cancel flag latched by the previous join's progress
|
||||
// UI teardown, otherwise the next join's first tick insta-closes.
|
||||
EnterCriticalSection(&bCancelRequestedCS);
|
||||
g_NetworkManager.m_bCancelRequested = false;
|
||||
LeaveCriticalSection(&bCancelRequestedCS);
|
||||
|
||||
int64_t seed = 0;
|
||||
bool dedicatedNoLocalHostPlayer = false;
|
||||
if (lpParameter != nullptr)
|
||||
|
||||
@@ -134,14 +134,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerLeaving(IQNetPlayer* pQNetPlayer)
|
||||
if (socket != nullptr)
|
||||
{
|
||||
if (m_pIQNet->IsHost())
|
||||
{
|
||||
g_NetworkManager.CloseConnection(networkPlayer);
|
||||
|
||||
// Propagate the TCP drop to the game Socket so any orphaned
|
||||
// PendingConnection at this smallId cleans up before its login
|
||||
// timer fires and leaks a DisconnectPacket to the reused slot.
|
||||
socket->close(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pIQNet->IsHost())
|
||||
|
||||
@@ -247,6 +247,8 @@ void CPlatformNetworkManagerSony::HandlePlayerJoined(SQRNetworkPlayer *
|
||||
|
||||
void CPlatformNetworkManagerSony::HandlePlayerLeaving(SQRNetworkPlayer *pSQRPlayer)
|
||||
{
|
||||
//__debugbreak();
|
||||
|
||||
app.DebugPrintf( "Player 0x%p leaving.\n",
|
||||
pSQRPlayer );
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "UIController.h"
|
||||
#include <ChatScreen.h>
|
||||
#include "UI.h"
|
||||
#include "UIScene.h"
|
||||
#include "UIControl_Slider.h"
|
||||
@@ -1439,9 +1438,6 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (key == 4) ChatScreen::setWheelValue(1);
|
||||
if (key == 5) ChatScreen::setWheelValue(-1);
|
||||
|
||||
if(pressed) app.DebugPrintf("Pressed %d\n",key);
|
||||
if(released) app.DebugPrintf("Released %d\n",key);
|
||||
// Repeat handling
|
||||
|
||||
@@ -310,27 +310,19 @@ void UIScene::loadMovie()
|
||||
|
||||
if(!app.hasArchiveFile(moviePath))
|
||||
{
|
||||
app.DebugPrintf("WARNING: Could not find iggy movie %ls, trying other resolutions\n", moviePath.c_str());
|
||||
app.DebugPrintf("WARNING: Could not find iggy movie %ls, falling back on 720\n", moviePath.c_str());
|
||||
|
||||
// Try 720 first, then 1080 as final fallback
|
||||
moviePath = getMoviePath();
|
||||
moviePath.append(L"720.swf");
|
||||
m_loadedResolution = eSceneResolution_720;
|
||||
|
||||
if(!app.hasArchiveFile(moviePath))
|
||||
{
|
||||
moviePath = getMoviePath();
|
||||
moviePath.append(L"1080.swf");
|
||||
m_loadedResolution = eSceneResolution_1080;
|
||||
|
||||
if(!app.hasArchiveFile(moviePath))
|
||||
{
|
||||
app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str());
|
||||
app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str());
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
app.FatalLoadError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +335,7 @@ void UIScene::loadMovie()
|
||||
{
|
||||
app.DebugPrintf("ERROR: Failed to load iggy scene!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
@@ -949,6 +941,9 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt
|
||||
// if(m_parentLayer == nullptr)
|
||||
// {
|
||||
// app.DebugPrintf("A scene is trying to navigate forwards, but it's parent layer is nullptr!\n");
|
||||
//#ifndef _CONTENT_PACKAGE
|
||||
// __debugbreak();
|
||||
//#endif
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@@ -965,6 +960,10 @@ void UIScene::navigateBack()
|
||||
|
||||
if(m_parentLayer == nullptr)
|
||||
{
|
||||
// app.DebugPrintf("A scene is trying to navigate back, but it's parent layer is nullptr!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// __debugbreak();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1195,7 +1194,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handlePress did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1203,7 +1202,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handlePress were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1215,7 +1214,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleFocusChange did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1223,7 +1222,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleFocusChange were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1235,7 +1234,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleInitFocus did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1243,7 +1242,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleInitFocus were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1255,7 +1254,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleCheckboxToggled did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1263,7 +1262,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleCheckboxToggled were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1275,7 +1274,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleSliderMove did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1283,7 +1282,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleSliderMove were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1295,7 +1294,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleAnimationEnd did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1307,7 +1306,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleSelectionChanged did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1315,7 +1314,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleSelectionChanged were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1333,7 +1332,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Callback for handleRequestMoreData did not have the correct number of arguments\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1341,7 +1340,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
|
||||
{
|
||||
app.DebugPrintf("Arguments for handleRequestMoreData were not of the correct type\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "../../EnderDragonRenderer.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.inventory.h"
|
||||
#include "../../../Minecraft.World/StringHelpers.h"
|
||||
#include <ChatScreen.h>
|
||||
|
||||
UIScene_HUD::UIScene_HUD(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
||||
{
|
||||
@@ -24,10 +23,8 @@ UIScene_HUD::UIScene_HUD(int iPad, void *initData, UILayer *parentLayer) : UISce
|
||||
for(unsigned int i = 0; i < CHAT_LINES_COUNT; ++i)
|
||||
{
|
||||
m_labelChatText[i].init(L"");
|
||||
IggyValueSetBooleanRS(m_labelChatText[i].getIggyValuePath(), 0, "m_bUseHtmlText", true);
|
||||
}
|
||||
m_labelJukebox.init(L"");
|
||||
IggyValueSetBooleanRS(m_labelJukebox.getIggyValuePath(), 0, "m_bUseHtmlText", true);
|
||||
|
||||
addTimer(0, 100);
|
||||
}
|
||||
@@ -257,10 +254,8 @@ void UIScene_HUD::handleReload()
|
||||
for(unsigned int i = 0; i < CHAT_LINES_COUNT; ++i)
|
||||
{
|
||||
m_labelChatText[i].init(L"");
|
||||
IggyValueSetBooleanRS(m_labelChatText[i].getIggyValuePath(), 0, "m_bUseHtmlText", true);
|
||||
}
|
||||
m_labelJukebox.init(L"");
|
||||
IggyValueSetBooleanRS(m_labelJukebox.getIggyValuePath(), 0, "m_bUseHtmlText", true);
|
||||
|
||||
int iGuiScale;
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
@@ -783,31 +778,16 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor
|
||||
void UIScene_HUD::handleTimerComplete(int id)
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
bool isChatOpen = (dynamic_cast<ChatScreen*>(pMinecraft->getScreen()) != nullptr);
|
||||
|
||||
bool anyVisible = false;
|
||||
if(pMinecraft->localplayers[m_iPad]!= nullptr)
|
||||
{
|
||||
Gui *pGui = pMinecraft->gui;
|
||||
DWORD totalMessages = pGui->getMessagesCount(m_iPad);
|
||||
DWORD messagesToDisplay = min( CHAT_LINES_COUNT, totalMessages);
|
||||
DWORD maxScroll = max(0, totalMessages - messagesToDisplay);
|
||||
|
||||
bool canScroll = messagesToDisplay < totalMessages;
|
||||
int startIndex = (canScroll && isChatOpen ? ChatScreen::getChatIndex() : 0);
|
||||
|
||||
if (startIndex > maxScroll) {
|
||||
ChatScreen::correctChatIndex(maxScroll);
|
||||
startIndex = maxScroll;
|
||||
}
|
||||
|
||||
app.DebugPrintf("handleTimerComplete: %d | %d | %d\n", maxScroll, startIndex, totalMessages);
|
||||
|
||||
for( unsigned int i = 0; i < messagesToDisplay; ++i )
|
||||
//DWORD messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) );
|
||||
for( unsigned int i = 0; i < CHAT_LINES_COUNT; ++i )
|
||||
{
|
||||
unsigned int msgIndex = startIndex + i;
|
||||
float opacity = pGui->getOpacity(m_iPad, msgIndex);
|
||||
if( opacity > 0 || isChatOpen)
|
||||
float opacity = pGui->getOpacity(m_iPad, i);
|
||||
if( opacity > 0 )
|
||||
{
|
||||
#if 0 // def _WINDOWS64 // Use Iggy chat until Gui::render has visual parity
|
||||
// Chat drawn by Gui::render with color codes. Hides Iggy chat to avoid double chats.
|
||||
@@ -815,10 +795,9 @@ void UIScene_HUD::handleTimerComplete(int id)
|
||||
m_labelChatText[i].setOpacity(0);
|
||||
m_labelChatText[i].setLabel(L"");
|
||||
#else
|
||||
|
||||
m_controlLabelBackground[i].setOpacity((isChatOpen ? 1 : opacity));
|
||||
m_labelChatText[i].setOpacity((isChatOpen ? 1 : opacity));
|
||||
m_labelChatText[i].setLabel(pGui->getMessage(m_iPad, msgIndex));
|
||||
m_controlLabelBackground[i].setOpacity(opacity);
|
||||
m_labelChatText[i].setOpacity(opacity);
|
||||
m_labelChatText[i].setLabel( pGui->getMessagesCount(m_iPad) ? pGui->getMessage(m_iPad,i) : L"" );
|
||||
#endif
|
||||
anyVisible = true;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ private:
|
||||
bool m_bSplitscreen;
|
||||
|
||||
protected:
|
||||
UIControl_HTMLLabel m_labelChatText[CHAT_LINES_COUNT];
|
||||
UIControl_Label m_labelChatText[CHAT_LINES_COUNT];
|
||||
UIControl_Label m_labelJukebox;
|
||||
UIControl m_controlLabelBackground[CHAT_LINES_COUNT];
|
||||
UIControl_Label m_labelDisplayName;
|
||||
|
||||
@@ -281,11 +281,6 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
||||
WCHAR TempString[256];
|
||||
swprintf((WCHAR *)TempString, 256, L"%ls: %ls", app.GetString(IDS_SLIDER_DIFFICULTY), L"Hardcore");
|
||||
m_sliderDifficulty.init(TempString, eControl_Difficulty, 0, 4, 4);
|
||||
|
||||
// Hardcore locks game mode to Survival
|
||||
m_iGameModeId = GameType::SURVIVAL->getId();
|
||||
m_bGameModeCreative = false;
|
||||
m_buttonGamemode.setLabel(app.GetString(IDS_GAMEMODE_SURVIVAL));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -426,7 +421,15 @@ void UIScene_LoadMenu::updateTooltips()
|
||||
void UIScene_LoadMenu::updateComponents()
|
||||
{
|
||||
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
|
||||
m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,false);
|
||||
|
||||
if(RenderManager.IsWidescreen())
|
||||
{
|
||||
m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,false);
|
||||
}
|
||||
}
|
||||
|
||||
wstring UIScene_LoadMenu::getMoviePath()
|
||||
@@ -570,9 +573,7 @@ void UIScene_LoadMenu::tick()
|
||||
m_MoreOptionsParams.bAllowFriendsOfFriends = TRUE;
|
||||
}
|
||||
|
||||
// Use thumbnail host options if available, otherwise preserve the level.dat value
|
||||
if (app.GetGameHostOption(uiHostOptions, eGameHostOption_Hardcore) > 0)
|
||||
m_bHardcore = true;
|
||||
m_bHardcore = app.GetGameHostOption(uiHostOptions, eGameHostOption_Hardcore) > 0;
|
||||
if (m_bHardcore)
|
||||
{
|
||||
WCHAR TempString[256];
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
static wstring ReadLevelNameFromSaveFile(const wstring& filePath, bool *outHardcore = nullptr)
|
||||
{
|
||||
// Check for a worldname.txt sidecar written by the rename feature first
|
||||
wstring sidecarName = L"";
|
||||
size_t slashPos = filePath.rfind(L'\\');
|
||||
if (slashPos != wstring::npos)
|
||||
{
|
||||
@@ -51,7 +50,7 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath, bool *outHardc
|
||||
{
|
||||
wchar_t wbuf[128] = {};
|
||||
MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, 127);
|
||||
sidecarName = wbuf;
|
||||
return wstring(wbuf);
|
||||
}
|
||||
}
|
||||
else fclose(fr);
|
||||
@@ -59,10 +58,10 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath, bool *outHardc
|
||||
}
|
||||
|
||||
HANDLE hFile = CreateFileW(filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr);
|
||||
if (hFile == INVALID_HANDLE_VALUE) return sidecarName;
|
||||
if (hFile == INVALID_HANDLE_VALUE) return L"";
|
||||
|
||||
DWORD fileSize = GetFileSize(hFile, nullptr);
|
||||
if (fileSize < 12 || fileSize == INVALID_FILE_SIZE) { CloseHandle(hFile); return sidecarName; }
|
||||
if (fileSize < 12 || fileSize == INVALID_FILE_SIZE) { CloseHandle(hFile); return L""; }
|
||||
|
||||
unsigned char *rawData = new unsigned char[fileSize];
|
||||
DWORD bytesRead = 0;
|
||||
@@ -70,7 +69,7 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath, bool *outHardc
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
delete[] rawData;
|
||||
return sidecarName;
|
||||
return L"";
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
|
||||
@@ -85,7 +84,7 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath, bool *outHardc
|
||||
if (decompSize == 0 || decompSize > 128 * 1024 * 1024)
|
||||
{
|
||||
delete[] rawData;
|
||||
return sidecarName;
|
||||
return L"";
|
||||
}
|
||||
saveData = new unsigned char[decompSize];
|
||||
Compression::getCompression()->Decompress(saveData, &decompSize, rawData + 8, fileSize - 8);
|
||||
@@ -141,10 +140,6 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath, bool *outHardc
|
||||
|
||||
if (freeSaveData) delete[] saveData;
|
||||
delete[] rawData;
|
||||
|
||||
// Prefer the sidecar name (user-renamed) over the level.dat name
|
||||
if (!sidecarName.empty()) return sidecarName;
|
||||
|
||||
// "world" is the engine default - it means no real name was ever set,
|
||||
// so return empty to let the caller fall back to the save filename (timestamp).
|
||||
if (result == L"world") result = L"";
|
||||
@@ -779,16 +774,7 @@ void UIScene_LoadOrJoinMenu::tick()
|
||||
wchar_t wFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
ZeroMemory(wFilename, sizeof(wFilename));
|
||||
mbstowcs(wFilename, m_pSaveDetails->SaveInfoA[origIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
|
||||
wchar_t wTitle[MAX_DISPLAYNAME_LENGTH];
|
||||
ZeroMemory(wTitle, sizeof(wTitle));
|
||||
mbstowcs(wTitle, m_pSaveDetails->SaveInfoA[origIdx].UTF8SaveTitle, MAX_DISPLAYNAME_LENGTH - 1);
|
||||
wstring filePath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\") + wstring(wTitle) + wstring(L".ms");
|
||||
// Fallback to legacy saveData.ms if new-style filename doesn't exist
|
||||
{
|
||||
DWORD attrs = GetFileAttributesW(filePath.c_str());
|
||||
if (attrs == INVALID_FILE_ATTRIBUTES)
|
||||
filePath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\saveData.ms");
|
||||
}
|
||||
wstring filePath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\saveData.ms");
|
||||
|
||||
HANDLE hFile = CreateFileW(filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr);
|
||||
DWORD fileSize = 0;
|
||||
|
||||
@@ -390,7 +390,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
||||
break;
|
||||
#endif
|
||||
|
||||
default: DEBUG_BREAK();
|
||||
default: __debugbreak();
|
||||
}
|
||||
|
||||
bool confirmUser = false;
|
||||
|
||||
@@ -1127,6 +1127,15 @@ void UIScene_SkinSelectMenu::handlePackIndexChanged()
|
||||
updatePackDisplay();
|
||||
}
|
||||
|
||||
std::wstring fakeWideToRealWide(const wchar_t* original)
|
||||
{
|
||||
const char* name = reinterpret_cast<const char*>(original);
|
||||
int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, nullptr, 0);
|
||||
std::wstring wName(len, 0);
|
||||
MultiByteToWideChar(CP_UTF8, 0, name, -1, &wName[0], len);
|
||||
return wName.c_str();
|
||||
}
|
||||
|
||||
void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
{
|
||||
m_currentPackCount = app.m_dlcManager.getPackCount(DLCManager::e_DLCType_Skin) + SKIN_SELECT_MAX_DEFAULTS;
|
||||
@@ -1134,16 +1143,18 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
if(m_packIndex >= SKIN_SELECT_MAX_DEFAULTS)
|
||||
{
|
||||
DLCPack *thisPack = app.m_dlcManager.getPack(m_packIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
|
||||
setCentreLabel(thisPack->getName().c_str());
|
||||
// Fix the incorrect string type on title to display correctly
|
||||
setCentreLabel(fakeWideToRealWide(thisPack->getName().c_str()));
|
||||
//setCentreLabel(thisPack->getName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(m_packIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
setCentreLabel(app.GetString(IDS_NO_SKIN_PACK));
|
||||
break;
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
setCentreLabel(app.GetString(IDS_FAVORITES_SKIN_PACK));
|
||||
break;
|
||||
}
|
||||
@@ -1153,16 +1164,18 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
if(nextPackIndex >= SKIN_SELECT_MAX_DEFAULTS)
|
||||
{
|
||||
DLCPack *thisPack = app.m_dlcManager.getPack(nextPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
|
||||
setRightLabel(thisPack->getName().c_str());
|
||||
// Fix the incorrect string type on title to display correctly
|
||||
setRightLabel(fakeWideToRealWide(thisPack->getName().c_str()));
|
||||
//setRightLabel(thisPack->getName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(nextPackIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
setRightLabel(app.GetString(IDS_NO_SKIN_PACK));
|
||||
break;
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
setRightLabel(app.GetString(IDS_FAVORITES_SKIN_PACK));
|
||||
break;
|
||||
}
|
||||
@@ -1172,16 +1185,18 @@ void UIScene_SkinSelectMenu::updatePackDisplay()
|
||||
if(previousPackIndex >= SKIN_SELECT_MAX_DEFAULTS)
|
||||
{
|
||||
DLCPack *thisPack = app.m_dlcManager.getPack(previousPackIndex - SKIN_SELECT_MAX_DEFAULTS, DLCManager::e_DLCType_Skin);
|
||||
setLeftLabel(thisPack->getName().c_str());
|
||||
// Fix the incorrect string type on title to display correctly
|
||||
setLeftLabel(fakeWideToRealWide(thisPack->getName().c_str()));
|
||||
//setLeftLabel(thisPack->getName().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(previousPackIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
setLeftLabel(app.GetString(IDS_NO_SKIN_PACK));
|
||||
break;
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
case SKIN_SELECT_PACK_FAVORITES:
|
||||
setLeftLabel(app.GetString(IDS_FAVORITES_SKIN_PACK));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ wstring DLCTexturePack::getResource(const wstring& name)
|
||||
{
|
||||
// 4J Stu - We should never call this function
|
||||
#ifndef __CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return L"";
|
||||
}
|
||||
@@ -115,7 +115,7 @@ InputStream *DLCTexturePack::getResourceImplementation(const wstring &name) //th
|
||||
{
|
||||
// 4J Stu - We should never call this function
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
if(hasFile(name)) return nullptr;
|
||||
#endif
|
||||
return nullptr; //resource;
|
||||
|
||||
@@ -641,7 +641,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i
|
||||
{
|
||||
DWORD error = GetLastError();
|
||||
app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error);
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ void ConsoleUIController::init(Microsoft::WRL::ComPtr<ID3D11Device> dev, Microso
|
||||
{
|
||||
app.DebugPrintf("Failed to initialise GDraw!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -187,6 +187,8 @@ void CPlatformNetworkManagerDurango::HandlePlayerJoined(DQRNetworkPlayer *pDQRPl
|
||||
|
||||
void CPlatformNetworkManagerDurango::HandlePlayerLeaving(DQRNetworkPlayer *pDQRPlayer)
|
||||
{
|
||||
//__debugbreak();
|
||||
|
||||
app.DebugPrintf( "Player 0x%p leaving.\n",
|
||||
pDQRPlayer );
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ EntityRenderer *EntityRenderDispatcher::getRenderer(eINSTANCEOF e)
|
||||
{
|
||||
app.DebugPrintf("Couldn't find renderer for entity of type %d\n", e);
|
||||
// New renderer mapping required in above table
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
}
|
||||
/* 4J - not doing this hierarchical search anymore. We need to explicitly add renderers for any eINSTANCEOF type that we want to be able to render
|
||||
if (it == renderers.end() && e != Entity::_class)
|
||||
|
||||
@@ -85,9 +85,9 @@ void EntityTracker::addEntity(shared_ptr<Entity> e, int range, int updateInterva
|
||||
{
|
||||
assert(false); // Entity already tracked
|
||||
}
|
||||
if( e->entityId >= 16384 )
|
||||
if( e->entityId >= 2048 )
|
||||
{
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
}
|
||||
shared_ptr<TrackedEntity> te = std::make_shared<TrackedEntity>(e, range, updateInterval, trackDeltas);
|
||||
entities.insert(te);
|
||||
|
||||
@@ -404,8 +404,6 @@ void Font::draw(const wstring &str, bool dropShadow, int initialColor)
|
||||
t->begin();
|
||||
t->color(currentColor & 0x00ffffff, (currentColor >> 24) & 255);
|
||||
|
||||
bool prev = t->setMipmapEnable(false); // Disable mipmapping for fonts, and save previous enabled value to be restored later - Botch
|
||||
|
||||
for (int i = 0; i < static_cast<int>(cleanStr.length()); ++i)
|
||||
{
|
||||
// Map character
|
||||
@@ -483,8 +481,6 @@ void Font::draw(const wstring &str, bool dropShadow, int initialColor)
|
||||
}
|
||||
}
|
||||
|
||||
t->setMipmapEnable(prev); //Reinstates previously used enabled value - Botch
|
||||
|
||||
t->end();
|
||||
}
|
||||
|
||||
|
||||
@@ -1558,10 +1558,6 @@ void GameRenderer::renderLevel(float a, int64_t until)
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
|
||||
PIXBeginNamedEvent(0,"Beacon beam halo (after water)");
|
||||
levelRenderer->renderBeaconBeams(a);
|
||||
PIXEndNamedEvent();
|
||||
|
||||
// 4J - added - have split out translucent particle rendering so that it happens after the water is rendered, primarily for fireworks
|
||||
PIXBeginNamedEvent(0,"Particle render (translucent)");
|
||||
Lighting::turnOn();
|
||||
@@ -2116,7 +2112,7 @@ void GameRenderer::setupFog(int i, float alpha)
|
||||
|
||||
if (i == 999)
|
||||
{
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
// 4J TODO
|
||||
/*
|
||||
glFog(GL_FOG_COLOR, getBuffer(0, 0, 0, 1));
|
||||
|
||||
+16
-87
@@ -697,8 +697,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
glEnable(GL_COLOR_MATERIAL);
|
||||
|
||||
// 4J - TomK now using safe zone values directly instead of the magic number calculation that lived here before (which only worked for medium scale, the other two were off!)
|
||||
int xo = iSafezoneXHalf + 10; // TODO: fix relative scaling for atrocious aspect ratios
|
||||
int yo = iSafezoneTopYHalf + 10; // TODO: fix relative scaling for atrocious aspect ratios
|
||||
int xo = iSafezoneXHalf + 10;
|
||||
int yo = iSafezoneTopYHalf + 10;
|
||||
|
||||
#ifdef __PSVITA__
|
||||
// align directly with corners, there are no safe zones on vita
|
||||
@@ -708,29 +708,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(static_cast<float>(xo), static_cast<float>(yo), 50);
|
||||
|
||||
// correct paper doll aspect ratio
|
||||
float ss = 12.0f;
|
||||
float aspectScaleX = 1.0f;
|
||||
float aspectScaleY = 1.0f;
|
||||
|
||||
extern int g_rScreenWidth;
|
||||
extern int g_rScreenHeight;
|
||||
|
||||
if (g_rScreenWidth > 0 && g_rScreenHeight > 0) {
|
||||
float screenAspect = (float)g_rScreenWidth / (float)g_rScreenHeight;
|
||||
const float targetAspect = 16.0f / 9.0f;
|
||||
|
||||
// apply correction if window is not already at a 16:9 aspect ratio
|
||||
if (fabs(screenAspect - targetAspect) > 0.01f) {
|
||||
if (screenAspect > targetAspect)
|
||||
aspectScaleX = targetAspect / screenAspect;
|
||||
else
|
||||
aspectScaleY = screenAspect / targetAspect;
|
||||
}
|
||||
}
|
||||
|
||||
glScalef(-ss * aspectScaleX, ss * aspectScaleY, ss);
|
||||
float ss = 12;
|
||||
glScalef(-ss, ss, ss);
|
||||
glRotatef(180, 0, 0, 1);
|
||||
|
||||
float oyr = minecraft->player->yRot;
|
||||
@@ -1229,20 +1208,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
|
||||
// Disable the depth test so the text shows on top of the paperdoll
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
#ifdef _WINDOWS64
|
||||
float scaleWidth = (g_rScreenWidth / 1920.0f);
|
||||
float scaleHeight = (g_rScreenHeight / 1080.0f);
|
||||
|
||||
float scale = min(scaleWidth, scaleHeight); //stop stretching
|
||||
|
||||
if (scale < 0.5f) scale = 0.5f; // force minimum scale
|
||||
if (scale > 1.2f) // resolutions over 1296 pixels tall
|
||||
{
|
||||
scale = scale - 0.33f; // tame overscaling on 1440p
|
||||
}
|
||||
|
||||
glScalef(scale, scale, 1);
|
||||
#endif
|
||||
// Loop through the lines and draw them all on screen
|
||||
int yPos = debugTop;
|
||||
for (const auto &line : lines)
|
||||
@@ -1251,9 +1217,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
yPos += 10;
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
glScalef(1, 1, 1);
|
||||
#endif
|
||||
// Restore the depth test
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
@@ -1458,37 +1421,6 @@ void Gui::clearMessages(int iPad)
|
||||
}
|
||||
}
|
||||
|
||||
int getVisibleMessageLength(const wstring& _string) {
|
||||
int visibleMessageLength = 0;
|
||||
bool inHtmlTag = false;
|
||||
|
||||
for (wchar_t _char : _string) {
|
||||
if (_char == L'<') inHtmlTag = true;
|
||||
if (_char == L'>') inHtmlTag = false;
|
||||
|
||||
if (!inHtmlTag) visibleMessageLength++;
|
||||
}
|
||||
|
||||
return visibleMessageLength;
|
||||
}
|
||||
|
||||
int getVisibleIndexToRaw(const wstring& _string, size_t target) {
|
||||
int visibleMessageLength = 0;
|
||||
bool inHtmlTag = false;
|
||||
|
||||
for (size_t i = 0; i < _string.size(); i++) {
|
||||
if (_string[i] == L'<') inHtmlTag = true;
|
||||
if (_string[i] == L'>') inHtmlTag = false;
|
||||
|
||||
if (!inHtmlTag) {
|
||||
if (visibleMessageLength == target) return i;
|
||||
|
||||
visibleMessageLength++;
|
||||
}
|
||||
}
|
||||
return _string.size();
|
||||
}
|
||||
|
||||
|
||||
void Gui::addMessage(const wstring& _string,int iPad,bool bIsDeathMessage)
|
||||
{
|
||||
@@ -1572,25 +1504,29 @@ void Gui::addMessage(const wstring& _string,int iPad,bool bIsDeathMessage)
|
||||
break;
|
||||
}
|
||||
|
||||
while (getVisibleMessageLength(string) > maximumChars)
|
||||
{
|
||||
size_t cutOffset = getVisibleIndexToRaw(string, maximumChars);
|
||||
|
||||
size_t iLast=string.find_last_of(L" ", cutOffset);
|
||||
while (string.length() > maximumChars)
|
||||
{
|
||||
unsigned int i = 1;
|
||||
while (i < string.length() && (i + 1) <= maximumChars)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
size_t iLast=string.find_last_of(L" ",i);
|
||||
switch(XGetLanguage())
|
||||
{
|
||||
case XC_LANGUAGE_JAPANESE:
|
||||
case XC_LANGUAGE_TCHINESE:
|
||||
case XC_LANGUAGE_KOREAN:
|
||||
iLast = cutOffset;
|
||||
iLast = maximumChars;
|
||||
break;
|
||||
default:
|
||||
iLast=string.find_last_of(L" ", cutOffset);
|
||||
iLast=string.find_last_of(L" ",i);
|
||||
break;
|
||||
}
|
||||
|
||||
// if a space was found, include the space on this line
|
||||
if(iLast!=cutOffset)
|
||||
if(iLast!=i)
|
||||
{
|
||||
iLast++;
|
||||
}
|
||||
@@ -1642,13 +1578,6 @@ float Gui::getOpacity(int iPad, DWORD index)
|
||||
return opacityPercentage;
|
||||
}
|
||||
|
||||
//just like java functionality it overwrites the jukebox label
|
||||
void Gui::setActionBarMessage(wstring message)
|
||||
{
|
||||
overlayMessageString = message;
|
||||
overlayMessageTime = 20 * 4; //idk how long it should last, need to check java usage
|
||||
}
|
||||
|
||||
float Gui::getJukeboxOpacity(int iPad)
|
||||
{
|
||||
float t = overlayMessageTime - lastTickA;
|
||||
@@ -1664,7 +1593,7 @@ void Gui::setNowPlaying(const wstring& string)
|
||||
// overlayMessageString = L"Now playing: " + string;
|
||||
overlayMessageString = app.GetString(IDS_NOWPLAYING) + string;
|
||||
overlayMessageTime = 20 * 3;
|
||||
animateOverlayMessageColor = true; //appears to be unused, @DrPerkyLegit plans to add in later pr
|
||||
animateOverlayMessageColor = true;
|
||||
}
|
||||
|
||||
void Gui::displayClientMessage(int messageId, int iPad)
|
||||
|
||||
@@ -17,7 +17,6 @@ private:
|
||||
static const int m_iMaxMessageWidth = 280;
|
||||
static ItemRenderer *itemRenderer;
|
||||
vector<GuiMessage> guiMessages[XUSER_MAX_COUNT];
|
||||
int chatIndex = 0;
|
||||
Random *random;
|
||||
|
||||
Minecraft *minecraft;
|
||||
@@ -64,8 +63,6 @@ public:
|
||||
wstring getMessage(int iPad, DWORD index) { return guiMessages[iPad].at(index).string; }
|
||||
float getOpacity(int iPad, DWORD index);
|
||||
|
||||
void setActionBarMessage(wstring message); //uses jukebox label
|
||||
|
||||
wstring getJukeboxMessage(int iPad) { return overlayMessageString; }
|
||||
float getJukeboxOpacity(int iPad);
|
||||
|
||||
|
||||
@@ -567,7 +567,7 @@ void ItemInHandRenderer::render(float a)
|
||||
glPushMatrix();
|
||||
float d = 0.8f;
|
||||
|
||||
#if defined __ORBIS__ || defined __PS3__
|
||||
#if defined __ORBIS__ || defined __PS3__ || defined _WINDOWS64
|
||||
static const float swingPowFactor = 1.0f;
|
||||
#else
|
||||
static const float swingPowFactor = 4.0f; // 4J added, to slow the swing down when nearest the player for avoiding luminance flash issues
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "Chunk.h"
|
||||
#include "EntityRenderDispatcher.h"
|
||||
#include "TileEntityRenderDispatcher.h"
|
||||
#include "BeaconRenderer.h"
|
||||
#include "DistanceChunkSorter.h"
|
||||
#include "DirtyChunkSorter.h"
|
||||
#include "MobSkinTextureProcessor.h"
|
||||
@@ -654,30 +653,6 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a)
|
||||
mc->gameRenderer->turnOffLightLayer(a); // 4J - brought forward from 1.8.2
|
||||
}
|
||||
|
||||
void LevelRenderer::renderBeaconBeams(float a)
|
||||
{
|
||||
if (mc == nullptr || mc->player == nullptr) return;
|
||||
|
||||
int playerIndex = mc->player->GetXboxPad();
|
||||
if (level[playerIndex] == nullptr) return;
|
||||
|
||||
BeaconRenderer::s_renderOuterHalo = true;
|
||||
|
||||
EnterCriticalSection(&m_csRenderableTileEntities);
|
||||
for (auto & it : renderableTileEntities)
|
||||
{
|
||||
if (!isGlobalIndexInSameDimension(it.first, level[playerIndex])) continue;
|
||||
for (auto& te : it.second)
|
||||
{
|
||||
if (te->GetType() != eTYPE_BEACONTILEENTITY) continue;
|
||||
TileEntityRenderDispatcher::instance->render(te, a);
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csRenderableTileEntities);
|
||||
|
||||
BeaconRenderer::s_renderOuterHalo = false;
|
||||
}
|
||||
|
||||
wstring LevelRenderer::gatherStats1()
|
||||
{
|
||||
return L"C: " + std::to_wstring(renderedChunks) + L"/" + std::to_wstring(totalChunks) + L". F: " + std::to_wstring(offscreenChunks) + L", O: " + std::to_wstring(occludedChunks) + L", E: " + std::to_wstring(emptyChunks);
|
||||
|
||||
@@ -77,7 +77,6 @@ public:
|
||||
void AddDLCSkinsToMemTextures();
|
||||
public:
|
||||
void renderEntities(Vec3 *cam, Culler *culler, float a);
|
||||
void renderBeaconBeams(float a);
|
||||
wstring gatherStats1();
|
||||
wstring gatherStats2();
|
||||
private:
|
||||
|
||||
@@ -164,7 +164,14 @@ bool LocalPlayer::isEffectiveAi()
|
||||
|
||||
void LocalPlayer::aiStep()
|
||||
{
|
||||
if (sprintTime > 0) sprintTime--;
|
||||
if (sprintTime > 0)
|
||||
{
|
||||
sprintTime--;
|
||||
if (sprintTime == 0)
|
||||
{
|
||||
setSprinting(false);
|
||||
}
|
||||
}
|
||||
if (sprintTriggerTime > 0) sprintTriggerTime--;
|
||||
if (minecraft->gameMode->isCutScene())
|
||||
{
|
||||
@@ -511,7 +518,7 @@ void LocalPlayer::changeDimension(int i)
|
||||
//minecraft.setScreen(new WinScreen());
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("LocalPlayer::changeDimension from 1 to 1 but WinScreen has not been implemented.\n");
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1542,12 +1542,8 @@ void Minecraft::run_middle()
|
||||
// Utility keys always work regardless of KBM active state
|
||||
if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_PAUSE) && !ui.GetMenuDisplayed(i))
|
||||
{
|
||||
if (dynamic_cast<ChatScreen*>(getScreen()) != nullptr) {
|
||||
setScreen(nullptr);
|
||||
} else {
|
||||
localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_PAUSEMENU;
|
||||
app.DebugPrintf("PAUSE PRESSED (keyboard) - ipad = %d\n",i);
|
||||
}
|
||||
localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_PAUSEMENU;
|
||||
app.DebugPrintf("PAUSE PRESSED (keyboard) - ipad = %d\n",i);
|
||||
}
|
||||
|
||||
if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_THIRD_PERSON))
|
||||
@@ -4812,7 +4808,7 @@ void Minecraft::main()
|
||||
app.DebugPrintf("<xs:enumeration value=\"%d\"><xs:annotation><xs:documentation>%ls</xs:documentation></xs:annotation></xs:enumeration>\n", i, app.GetString( Tile::tiles[i]->getDescriptionId() ));
|
||||
}
|
||||
}
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
|
||||
// 4J-PB - Can't call this for the first 5 seconds of a game - MS rule
|
||||
|
||||
@@ -85,9 +85,6 @@ vector<INetworkPlayer *> MinecraftServer::s_sentTo;
|
||||
int MinecraftServer::s_slowQueuePlayerIndex = 0;
|
||||
int MinecraftServer::s_slowQueueLastTime = 0;
|
||||
bool MinecraftServer::s_slowQueuePacketSent = false;
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
int MinecraftServer::s_dedicatedChunkSendsThisTick = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
unordered_map<wstring, int> MinecraftServer::ironTimers;
|
||||
@@ -1544,12 +1541,6 @@ void MinecraftServer::stopServer(bool didInit)
|
||||
}
|
||||
}
|
||||
}
|
||||
// connection->stop() enqueued disconnects; the run loop is gone, so
|
||||
// drain now or DisconnectPacket + sendAndQuit() never fire.
|
||||
if (players != nullptr)
|
||||
{
|
||||
players->drainPendingDisconnects();
|
||||
}
|
||||
// reset the primary player signout flag
|
||||
m_bPrimaryPlayerSignedOut=false;
|
||||
s_bServerHalted = false;
|
||||
@@ -1779,12 +1770,6 @@ void MinecraftServer::run(int64_t seed, void *lpParameter)
|
||||
int64_t unprocessedTime = 0;
|
||||
while (running && !s_bServerHalted)
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Full wall-clock cost of one run loop iteration (catch-up ticks
|
||||
// + setTime handlers + XUI delayed actions + Sleep).
|
||||
int64_t outerIterStart = getCurrentTimeMillis();
|
||||
int64_t outerIterTickWork = 0;
|
||||
#endif
|
||||
int64_t now = getCurrentTimeMillis();
|
||||
|
||||
// 4J Stu - When we pause the server, we don't want to count that as time passed
|
||||
@@ -1822,39 +1807,14 @@ void MinecraftServer::run(int64_t seed, void *lpParameter)
|
||||
while (unprocessedTime > MS_PER_TICK)
|
||||
{
|
||||
unprocessedTime -= MS_PER_TICK;
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Per-iteration pre/tick/post timing.
|
||||
int64_t iter_t0 = System::currentTimeMillis();
|
||||
#endif
|
||||
chunkPacketManagement_PreTick();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t iter_t1 = System::currentTimeMillis();
|
||||
#endif
|
||||
// int64_t before = System::currentTimeMillis();
|
||||
tick();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t iter_t2 = System::currentTimeMillis();
|
||||
#endif
|
||||
// int64_t after = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time",(float)(after-before));
|
||||
|
||||
chunkPacketManagement_PostTick();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t iter_t3 = System::currentTimeMillis();
|
||||
int64_t iter_total = iter_t3 - iter_t0;
|
||||
outerIterTickWork += iter_total;
|
||||
if (iter_total > 200)
|
||||
{
|
||||
ServerRuntime::LogInfof("perf",
|
||||
"iter total=%lldms pre=%lld tick=%lld post=%lld",
|
||||
(long long)iter_total,
|
||||
(long long)(iter_t1 - iter_t0),
|
||||
(long long)(iter_t2 - iter_t1),
|
||||
(long long)(iter_t3 - iter_t2));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// Do NOT reset lastTime here. Resetting discards the wall
|
||||
// time spent in the catch-up so passedTime restarts from
|
||||
// post-tick, capping effective TPS at 1000 / (MS_PER_TICK
|
||||
// + avgTickBody). Runaway after a real freeze is bounded
|
||||
// by the passedTime > MS_PER_TICK * 40 cap above.
|
||||
// int64_t afterall = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time all",(float)(afterall-beforeall));
|
||||
// PIXReportCounter(L"Server ticks",(float)tickcount);
|
||||
@@ -2140,73 +2100,6 @@ void MinecraftServer::run(int64_t seed, void *lpParameter)
|
||||
}
|
||||
|
||||
Sleep(1);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t outerIterTotal = getCurrentTimeMillis() - outerIterStart;
|
||||
|
||||
// Distribution histogram (gated). Buckets every outer iter, dumps
|
||||
// the bucket counts + a self-computed TPS every ~10 seconds.
|
||||
if (ServerRuntime::g_serverPerfTrace)
|
||||
{
|
||||
static const int kBucketCount = 14;
|
||||
static int64_t s_bucketEdges[kBucketCount] = {
|
||||
2, 5, 10, 20, 30, 40, 50, 60, 80, 100, 200, 500, 1000, INT64_MAX
|
||||
};
|
||||
static unsigned int s_buckets[kBucketCount] = {0};
|
||||
static int64_t s_histWindowStartMs = 0;
|
||||
static int s_histWindowStartTick = 0;
|
||||
static int64_t s_histTotalIterMs = 0;
|
||||
static unsigned int s_histTotalIters = 0;
|
||||
static unsigned int s_histTickIters = 0;
|
||||
int64_t nowMsForHist = getCurrentTimeMillis();
|
||||
if (s_histWindowStartMs == 0)
|
||||
{
|
||||
s_histWindowStartMs = nowMsForHist;
|
||||
s_histWindowStartTick = (int)tickCount;
|
||||
}
|
||||
for (int b = 0; b < kBucketCount; b++)
|
||||
{
|
||||
if (outerIterTotal <= s_bucketEdges[b])
|
||||
{
|
||||
s_buckets[b]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
s_histTotalIterMs += outerIterTotal;
|
||||
s_histTotalIters++;
|
||||
if (outerIterTickWork > 0) s_histTickIters++;
|
||||
int ticksThisWindow = (int)tickCount - s_histWindowStartTick;
|
||||
if (ticksThisWindow >= 200)
|
||||
{
|
||||
int64_t windowMs = nowMsForHist - s_histWindowStartMs;
|
||||
double calcTps = windowMs > 0 ? (ticksThisWindow * 1000.0) / windowMs : 0.0;
|
||||
double avgIterMs = s_histTotalIters > 0 ? (double)s_histTotalIterMs / s_histTotalIters : 0.0;
|
||||
ServerRuntime::LogInfof("perf",
|
||||
"histogram window: %d ticks in %lldms calcTps=%.2f iters=%u tickIters=%u avgIter=%.2fms | "
|
||||
"<=2:%u <=5:%u <=10:%u <=20:%u <=30:%u <=40:%u <=50:%u <=60:%u <=80:%u <=100:%u <=200:%u <=500:%u <=1000:%u >1000:%u",
|
||||
ticksThisWindow, (long long)windowMs, calcTps,
|
||||
s_histTotalIters, s_histTickIters, avgIterMs,
|
||||
s_buckets[0], s_buckets[1], s_buckets[2], s_buckets[3],
|
||||
s_buckets[4], s_buckets[5], s_buckets[6], s_buckets[7],
|
||||
s_buckets[8], s_buckets[9], s_buckets[10], s_buckets[11],
|
||||
s_buckets[12], s_buckets[13]);
|
||||
for (int b = 0; b < kBucketCount; b++) s_buckets[b] = 0;
|
||||
s_histWindowStartMs = nowMsForHist;
|
||||
s_histWindowStartTick = (int)tickCount;
|
||||
s_histTotalIterMs = 0;
|
||||
s_histTotalIters = 0;
|
||||
s_histTickIters = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (outerIterTotal > 200)
|
||||
{
|
||||
ServerRuntime::LogInfof("perf",
|
||||
"outerIter total=%lldms tickWork=%lld postTickOverhead=%lld",
|
||||
(long long)outerIterTotal,
|
||||
(long long)outerIterTickWork,
|
||||
(long long)(outerIterTotal - outerIterTickWork));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
//else
|
||||
@@ -2261,17 +2154,6 @@ void MinecraftServer::broadcastStopSavingPacket()
|
||||
|
||||
void MinecraftServer::tick()
|
||||
{
|
||||
// Per-substep wall-clock timing. Logs one summary line when total tick
|
||||
// exceeds TICK_SLOW_THRESHOLD_MS.
|
||||
const int64_t TICK_SLOW_THRESHOLD_MS = 200;
|
||||
const int kMaxLevelsRecorded = 8;
|
||||
int64_t tickStart = System::currentTimeMillis();
|
||||
int64_t lvlTickMs[kMaxLevelsRecorded] = {0};
|
||||
int64_t lvlEntMs[kMaxLevelsRecorded] = {0};
|
||||
int64_t lvlTrkMs[kMaxLevelsRecorded] = {0};
|
||||
int lvlDimId[kMaxLevelsRecorded] = {0};
|
||||
unsigned int recordedLevels = 0;
|
||||
|
||||
vector<wstring> toRemove;
|
||||
for ( auto& it : ironTimers )
|
||||
{
|
||||
@@ -2335,9 +2217,13 @@ void MinecraftServer::tick()
|
||||
int64_t st2 = System::currentTimeMillis();
|
||||
PIXEndNamedEvent();
|
||||
PIXBeginNamedEvent(0,"Entity tick %d",i);
|
||||
#ifdef __PSVITA__
|
||||
if ((players->getPlayerCount(level) > 0) || level->hasEntitiesToRemove())
|
||||
// 4J added to stop ticking entities in levels when players are not in those levels.
|
||||
// Note: now changed so that we also tick if there are entities to be removed, as this also happens as a result of calling tickEntities. If we don't do this, then the
|
||||
// entities get removed at the first point that there is a player count in the level - this has been causing a problem when going from normal dimension -> nether -> normal,
|
||||
// as the player is getting flagged as to be removed (from the normal dimension) when going to the nether, but Actually gets removed only when it returns
|
||||
if( ( players->getPlayerCount(level) > 0) || ( level->hasEntitiesToRemove() ) )
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
// AP - the PlayerList->viewDistance initially starts out at 3 to make starting a level speedy
|
||||
// the problem with this is that spawned monsters are always generated on the edge of the known map
|
||||
// which means they wont process (unless they are surrounded by 2 visible chunks). This means
|
||||
@@ -2347,13 +2233,11 @@ void MinecraftServer::tick()
|
||||
level->getServer()->getPlayers()->setViewDistance(newViewDistance);
|
||||
level->getTracker()->updateMaxRange();
|
||||
level->getChunkMap()->setRadius(level->getServer()->getPlayers()->getViewDistance());
|
||||
}
|
||||
#endif
|
||||
level->tickEntities();
|
||||
level->tickEntities();
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
|
||||
int64_t stEntDone = System::currentTimeMillis();
|
||||
|
||||
PIXBeginNamedEvent(0,"Entity tracker tick");
|
||||
level->getTracker()->tick();
|
||||
PIXEndNamedEvent();
|
||||
@@ -2362,21 +2246,9 @@ void MinecraftServer::tick()
|
||||
// printf(">>>>>>>>>>>>>>>>>>>>>> Tick %d %d %d : %d\n", st1 - st0, st2 - st1, st3 - st2, st0 - stc );
|
||||
stc = st0;
|
||||
// #endif// __PS3__
|
||||
|
||||
// Record per-level breakdown for the slow-tick summary.
|
||||
if (i < kMaxLevelsRecorded)
|
||||
{
|
||||
lvlTickMs[i] = st1 - st0; // Level::tick (mob spawner, chunk source, tile ticks, etc.)
|
||||
lvlEntMs[i] = stEntDone - st2; // tickEntities (per-entity AI/physics)
|
||||
lvlTrkMs[i] = st3 - stEntDone; // EntityTracker::tick (visibility & broadcasts)
|
||||
lvlDimId[i] = level->dimension->id;
|
||||
recordedLevels = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
int64_t afterLevels = System::currentTimeMillis();
|
||||
Entity::tickExtraWandering(); // 4J added
|
||||
int64_t afterExtraW = System::currentTimeMillis();
|
||||
|
||||
// Process player disconnect/kick queue BEFORE ticking connections.
|
||||
// PendingConnection::handleLogin rejects duplicate XUIDs, so the old
|
||||
@@ -2385,11 +2257,9 @@ void MinecraftServer::tick()
|
||||
PIXBeginNamedEvent(0,"Players tick");
|
||||
players->tick();
|
||||
PIXEndNamedEvent();
|
||||
int64_t afterPlayers = System::currentTimeMillis();
|
||||
PIXBeginNamedEvent(0,"Connection tick");
|
||||
connection->tick();
|
||||
PIXEndNamedEvent();
|
||||
int64_t afterConn = System::currentTimeMillis();
|
||||
|
||||
// 4J - removed
|
||||
#if 0
|
||||
@@ -2403,35 +2273,6 @@ void MinecraftServer::tick()
|
||||
// } catch (Exception e) {
|
||||
// logger.log(Level.WARNING, "Unexpected exception while parsing console command", e);
|
||||
// }
|
||||
|
||||
int64_t totalMs = System::currentTimeMillis() - tickStart;
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (totalMs > TICK_SLOW_THRESHOLD_MS)
|
||||
{
|
||||
// Build a single one-line breakdown so it greps cleanly. Per-level:
|
||||
// Level::tick / tickEntities / tracker tick. Then global subsystems.
|
||||
char buf[512];
|
||||
int n = 0;
|
||||
for (unsigned int i = 0; i < recordedLevels && n >= 0 && n < (int)sizeof(buf); i++)
|
||||
{
|
||||
n += snprintf(buf + n, sizeof(buf) - n,
|
||||
" L%d:tick=%lld ent=%lld trk=%lld",
|
||||
lvlDimId[i],
|
||||
(long long)lvlTickMs[i],
|
||||
(long long)lvlEntMs[i],
|
||||
(long long)lvlTrkMs[i]);
|
||||
}
|
||||
ServerRuntime::LogInfof("perf",
|
||||
"slow tick total=%lldms%s | extraW=%lld players=%lld conn=%lld",
|
||||
(long long)totalMs,
|
||||
buf,
|
||||
(long long)(afterExtraW - afterLevels),
|
||||
(long long)(afterPlayers - afterExtraW),
|
||||
(long long)(afterConn - afterPlayers));
|
||||
}
|
||||
#else
|
||||
(void)totalMs;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MinecraftServer::handleConsoleInput(const wstring& msg, ConsoleInputSource *source)
|
||||
@@ -2575,9 +2416,7 @@ bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player)
|
||||
if( player == nullptr ) return false;
|
||||
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
// Cap chunk-data sends per tick. Other players are served on later ticks
|
||||
// via the per-tick rotation in ServerConnection::tick.
|
||||
return s_dedicatedChunkSendsThisTick < DEDICATED_MAX_CHUNK_SENDS_PER_TICK;
|
||||
return true;
|
||||
#else
|
||||
int time = GetTickCount();
|
||||
DWORD currentPlayerCount = g_NetworkManager.GetPlayerCount();
|
||||
@@ -2596,16 +2435,10 @@ bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player)
|
||||
void MinecraftServer::chunkPacketManagement_DidSendTo(INetworkPlayer *player)
|
||||
{
|
||||
s_slowQueuePacketSent = true;
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
s_dedicatedChunkSendsThisTick++;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MinecraftServer::chunkPacketManagement_PreTick()
|
||||
{
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
s_dedicatedChunkSendsThisTick = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MinecraftServer::chunkPacketManagement_PostTick()
|
||||
|
||||
@@ -258,12 +258,6 @@ private:
|
||||
static int s_slowQueuePlayerIndex;
|
||||
static int s_slowQueueLastTime;
|
||||
static bool s_slowQueuePacketSent;
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
// Cap on chunk-data packet sends per tick. Paired with per-tick rotation
|
||||
// in ServerConnection::tick so every player gets a turn even when bound.
|
||||
static int s_dedicatedChunkSendsThisTick;
|
||||
static const int DEDICATED_MAX_CHUNK_SENDS_PER_TICK = 10;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
bool IsServerPaused() { return m_isServerPaused; }
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -245,7 +245,7 @@ bool OrbisLeaderboardManager::getScoreByIds()
|
||||
{
|
||||
// 4J-JEV: Something terrible must have happend,
|
||||
// 'getFriendslist' was supposed to be a synchronous operation.
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
|
||||
// 4J-JEV: We can at least fall-back to just the players score.
|
||||
num = 1;
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
@@ -218,7 +218,7 @@ void Particle::setTex(Textures *textures, Icon *icon)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Invalid call to Particle.setTex, use coordinate methods\n");
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
//throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods");
|
||||
}
|
||||
@@ -230,7 +230,7 @@ void Particle::setMiscTex(int slotIndex)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Invalid call to Particle.setMixTex\n");
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
//throw new RuntimeException("Invalid call to Particle.setMiscTex");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -13,14 +13,6 @@
|
||||
#include "../Minecraft.World/System.h"
|
||||
#include "PlayerList.h"
|
||||
#include <unordered_set>
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "../Minecraft.Server/ServerLogger.h"
|
||||
|
||||
// Per-tick accumulators for tickAddRequests timing.
|
||||
static int64_t g_findUsAccum = 0;
|
||||
static int64_t g_addUsAccum = 0;
|
||||
static int g_addCount = 0;
|
||||
#endif
|
||||
|
||||
PlayerChunkMap::PlayerChunk::PlayerChunk(int x, int z, PlayerChunkMap *pcm) : pos(x,z)
|
||||
{
|
||||
@@ -82,7 +74,7 @@ void PlayerChunkMap::PlayerChunk::add(shared_ptr<ServerPlayer> player, bool send
|
||||
|
||||
players.push_back(player);
|
||||
|
||||
player->chunksToSend.insert(pos);
|
||||
player->chunksToSend.push_back(pos);
|
||||
|
||||
#ifdef _LARGE_WORLDS
|
||||
parent->getLevel()->cache->dontDrop(pos.x, pos.z); // 4J Added;
|
||||
@@ -126,7 +118,7 @@ void PlayerChunkMap::PlayerChunk::remove(shared_ptr<ServerPlayer> player)
|
||||
parent->getLevel()->cache->drop(pos.x, pos.z);
|
||||
}
|
||||
|
||||
player->chunksToSend.erase(pos);
|
||||
player->chunksToSend.remove(pos);
|
||||
// 4J - I don't think there's any point sending these anymore, as we don't need to unload chunks with fixed sized maps
|
||||
// 4J - We do need to send these to unload entities in chunks when players are dead. If we do not and the entity is removed
|
||||
// while they are dead, that entity will remain in the clients world
|
||||
@@ -377,15 +369,6 @@ ServerLevel *PlayerChunkMap::getLevel()
|
||||
|
||||
void PlayerChunkMap::tick()
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Substep timing for slow chunkMap diagnostics.
|
||||
const int64_t CHUNKMAP_SLOW_THRESHOLD_MS = 150;
|
||||
int64_t cm_t0 = System::currentTimeMillis();
|
||||
int cm_addReqStart = (int)addRequests.size();
|
||||
g_findUsAccum = 0;
|
||||
g_addUsAccum = 0;
|
||||
g_addCount = 0;
|
||||
#endif
|
||||
int64_t time = level->getGameTime();
|
||||
|
||||
if (time - lastInhabitedUpdate > Level::TICKS_PER_DAY / 3)
|
||||
@@ -402,9 +385,6 @@ void PlayerChunkMap::tick()
|
||||
chunk->updateInhabitedTime();
|
||||
}
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t cm_t1 = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
// 4J - some changes here so that we only send one region update per tick. The chunks themselves also
|
||||
// limit their resend rate to once every MIN_TICKS_BETWEEN_REGION_UPDATE ticks
|
||||
@@ -424,35 +404,11 @@ void PlayerChunkMap::tick()
|
||||
i++;
|
||||
}
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t cm_t2 = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
for( unsigned int i = 0; i < players.size(); i++ )
|
||||
{
|
||||
tickAddRequests(players[i]);
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t cm_t3 = System::currentTimeMillis();
|
||||
int64_t cm_total = cm_t3 - cm_t0;
|
||||
if (cm_total > CHUNKMAP_SLOW_THRESHOLD_MS)
|
||||
{
|
||||
ServerRuntime::LogInfof("perf",
|
||||
"L%d chunkMap total=%lldms inhabited=%lld changed=%lld addReq=%lld | players=%d addReqQueue=%d->%d | adds=%d findUs=%lld addUs=%lld avgAddUs=%lld",
|
||||
this->dimension,
|
||||
(long long)cm_total,
|
||||
(long long)(cm_t1 - cm_t0),
|
||||
(long long)(cm_t2 - cm_t1),
|
||||
(long long)(cm_t3 - cm_t2),
|
||||
(int)players.size(),
|
||||
cm_addReqStart,
|
||||
(int)addRequests.size(),
|
||||
g_addCount,
|
||||
(long long)g_findUsAccum,
|
||||
(long long)g_addUsAccum,
|
||||
g_addCount > 0 ? (long long)(g_addUsAccum / g_addCount) : 0LL);
|
||||
}
|
||||
#endif
|
||||
|
||||
// 4J Stu - Added 1.1 but not relevant to us as we never no 0 players anyway, and don't think we should be dropping stuff
|
||||
//if (players.isEmpty()) {
|
||||
@@ -534,11 +490,7 @@ void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr<ServerPlay
|
||||
// Processes up to CHUNKS_PER_PLAYER_PER_TICK requests per call to speed up initial chunk loading.
|
||||
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Per-player drain rate for the addRequest queue. Each PlayerChunk::add
|
||||
// issues a synchronous ChunkVisibilityPacket, so per-tick send volume
|
||||
// scales as players * this. Pair with DEDICATED_MAX_CHUNK_SENDS_PER_TICK
|
||||
// on the chunk-data side.
|
||||
static const int CHUNKS_PER_PLAYER_PER_TICK = 4;
|
||||
static const int CHUNKS_PER_PLAYER_PER_TICK = 16;
|
||||
#else
|
||||
static const int CHUNKS_PER_PLAYER_PER_TICK = 1;
|
||||
#endif
|
||||
@@ -552,11 +504,6 @@ void PlayerChunkMap::tickAddRequests(shared_ptr<ServerPlayer> player)
|
||||
|
||||
for (int processed = 0; processed < CHUNKS_PER_PLAYER_PER_TICK; processed++)
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
LARGE_INTEGER qpcFreq, qpcA, qpcB, qpcC;
|
||||
QueryPerformanceFrequency(&qpcFreq);
|
||||
QueryPerformanceCounter(&qpcA);
|
||||
#endif
|
||||
// Find the nearest chunk request to the player
|
||||
int minDistSq = -1;
|
||||
auto itNearest = addRequests.end();
|
||||
@@ -575,21 +522,12 @@ void PlayerChunkMap::tickAddRequests(shared_ptr<ServerPlayer> player)
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&qpcB);
|
||||
g_findUsAccum += (qpcB.QuadPart - qpcA.QuadPart) * 1000000 / qpcFreq.QuadPart;
|
||||
#endif
|
||||
|
||||
// If we found one, process it and continue; otherwise done
|
||||
if( itNearest != addRequests.end() )
|
||||
{
|
||||
getChunk(itNearest->x, itNearest->z, true)->add(itNearest->player);
|
||||
addRequests.erase(itNearest);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&qpcC);
|
||||
g_addUsAccum += (qpcC.QuadPart - qpcB.QuadPart) * 1000000 / qpcFreq.QuadPart;
|
||||
g_addCount++;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -843,7 +781,7 @@ bool PlayerChunkMap::isPlayerIn(shared_ptr<ServerPlayer> player, int xChunk, int
|
||||
else
|
||||
{
|
||||
auto it1 = find(chunk->players.begin(), chunk->players.end(), player);
|
||||
auto it2 = player->chunksToSend.find(chunk->pos);
|
||||
auto it2 = find(player->chunksToSend.begin(), player->chunksToSend.end(), chunk->pos);
|
||||
return it1 != chunk->players.end() && it2 == player->chunksToSend.end();
|
||||
}
|
||||
|
||||
|
||||
@@ -121,45 +121,6 @@ void PlayerList::queueDisconnect(shared_ptr<ServerPlayer> player, int reason, co
|
||||
LeaveCriticalSection(&m_disconnectCS);
|
||||
}
|
||||
|
||||
void PlayerList::drainPendingDisconnects()
|
||||
{
|
||||
std::deque<PendingDisconnect> dcCopy;
|
||||
EnterCriticalSection(&m_disconnectCS);
|
||||
dcCopy.swap(m_pendingDisconnects);
|
||||
LeaveCriticalSection(&m_disconnectCS);
|
||||
|
||||
while (!dcCopy.empty())
|
||||
{
|
||||
PendingDisconnect pd = dcCopy.front();
|
||||
dcCopy.pop_front();
|
||||
|
||||
server->getPlayers()->removePlayerFromReceiving(pd.player);
|
||||
if (pd.player->connection != nullptr)
|
||||
{
|
||||
pd.player->connection->send(std::make_shared<DisconnectPacket>(static_cast<DisconnectPacket::eDisconnectReason>(pd.reason)));
|
||||
pd.player->connection->connection->sendAndQuit();
|
||||
}
|
||||
|
||||
if (!pd.kickMessage.empty())
|
||||
{
|
||||
broadcastAll(std::make_shared<ChatPacket>(pd.kickMessage));
|
||||
}
|
||||
else if (!pd.fourKitHandledQuit)
|
||||
{
|
||||
if (pd.wasKicked)
|
||||
{
|
||||
broadcastAll(std::make_shared<ChatPacket>(pd.player->name, ChatPacket::e_ChatPlayerKickedFromGame));
|
||||
}
|
||||
else
|
||||
{
|
||||
broadcastAll(std::make_shared<ChatPacket>(pd.player->name, ChatPacket::e_ChatPlayerLeftGame));
|
||||
}
|
||||
}
|
||||
|
||||
remove(pd.player);
|
||||
}
|
||||
}
|
||||
|
||||
bool PlayerList::placeNewPlayer(Connection *connection, shared_ptr<ServerPlayer> player, shared_ptr<LoginPacket> packet)
|
||||
{
|
||||
CompoundTag *playerTag = load(player);
|
||||
@@ -366,9 +327,7 @@ bool PlayerList::placeNewPlayer(Connection *connection, shared_ptr<ServerPlayer>
|
||||
|
||||
// 4J-PB - removed, since it needs to be localised in the language the client is in
|
||||
//server->players->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(L"�e" + playerEntity->name + L" joined the game.") ) );
|
||||
#if !(defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD))
|
||||
broadcastAll(std::make_shared<ChatPacket>(player->name, ChatPacket::e_ChatPlayerJoinedGame));
|
||||
#endif
|
||||
|
||||
MemSect(14);
|
||||
add(player);
|
||||
@@ -913,7 +872,7 @@ shared_ptr<ServerPlayer> PlayerList::respawn(shared_ptr<ServerPlayer> serverPlay
|
||||
// necessary)
|
||||
updatePlayerGameMode(player, serverPlayer, level);
|
||||
|
||||
// 4J Added: Hardcore mode forces Adventure mode on respawn
|
||||
// 4J Added: Hardcore mode — force Adventure mode on respawn
|
||||
if (server->getLevel(0)->getLevelData()->isHardcore())
|
||||
{
|
||||
player->gameMode->setGameModeForPlayer(GameType::ADVENTURE);
|
||||
@@ -1339,7 +1298,43 @@ void PlayerList::tick()
|
||||
|
||||
// Drain the pending disconnect queue. disconnect() enqueues here so it
|
||||
// can release done_cs before the heavy cleanup runs on the tick thread.
|
||||
drainPendingDisconnects();
|
||||
{
|
||||
std::deque<PendingDisconnect> dcCopy;
|
||||
EnterCriticalSection(&m_disconnectCS);
|
||||
dcCopy.swap(m_pendingDisconnects);
|
||||
LeaveCriticalSection(&m_disconnectCS);
|
||||
|
||||
while (!dcCopy.empty())
|
||||
{
|
||||
PendingDisconnect pd = dcCopy.front();
|
||||
dcCopy.pop_front();
|
||||
|
||||
server->getPlayers()->removePlayerFromReceiving(pd.player);
|
||||
if (pd.player->connection != nullptr)
|
||||
{
|
||||
pd.player->connection->send(std::make_shared<DisconnectPacket>(static_cast<DisconnectPacket::eDisconnectReason>(pd.reason)));
|
||||
pd.player->connection->connection->sendAndQuit();
|
||||
}
|
||||
|
||||
if (!pd.kickMessage.empty())
|
||||
{
|
||||
broadcastAll(std::make_shared<ChatPacket>(pd.kickMessage));
|
||||
}
|
||||
else if (!pd.fourKitHandledQuit)
|
||||
{
|
||||
if (pd.wasKicked)
|
||||
{
|
||||
broadcastAll(std::make_shared<ChatPacket>(pd.player->name, ChatPacket::e_ChatPlayerKickedFromGame));
|
||||
}
|
||||
else
|
||||
{
|
||||
broadcastAll(std::make_shared<ChatPacket>(pd.player->name, ChatPacket::e_ChatPlayerLeftGame));
|
||||
}
|
||||
}
|
||||
|
||||
remove(pd.player);
|
||||
}
|
||||
}
|
||||
|
||||
// Drain the close queue: snapshot the deque, then release the CS before
|
||||
// calling disconnect() which may itself try to acquire other locks.
|
||||
@@ -1375,7 +1370,7 @@ void PlayerList::tick()
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
// The old Connection's read/write threads are now dead (disconnect waits
|
||||
// for them). Safe to recycle the smallId: no stale write thread can
|
||||
// for them). Safe to recycle the smallId — no stale write thread can
|
||||
// resolve getPlayer() to a new connection that reuses this slot.
|
||||
WinsockNetLayer::PushFreeSmallId(smallId);
|
||||
WinsockNetLayer::ClearSocketForSmallId(smallId);
|
||||
|
||||
@@ -98,7 +98,6 @@ public:
|
||||
void move(shared_ptr<ServerPlayer> player);
|
||||
void remove(shared_ptr<ServerPlayer> player);
|
||||
void queueDisconnect(shared_ptr<ServerPlayer> player, int reason, const wstring& kickMessage, bool wasKicked, bool fourKitHandledQuit);
|
||||
void drainPendingDisconnects();
|
||||
shared_ptr<ServerPlayer> getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID OnlineXuid);
|
||||
shared_ptr<ServerPlayer> respawn(shared_ptr<ServerPlayer> serverPlayer, int targetDimension, bool keepAllPlayerData);
|
||||
void toggleDimension(shared_ptr<ServerPlayer> player, int targetDimension);
|
||||
|
||||
@@ -618,4 +618,4 @@ ResourceLocation *PlayerRenderer::getTextureLocation(shared_ptr<Entity> entity)
|
||||
{
|
||||
shared_ptr<Player> player = dynamic_pointer_cast<Player>(entity);
|
||||
return new ResourceLocation(static_cast<_TEXTURE_NAME>(player->getTexture()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,6 +227,7 @@ void PreStitchedTextureMap::makeTextureAnimated(TexturePack *texturePack, Stitch
|
||||
if(first->getWidth() != tex->getWidth() || first->getHeight() != tex->getHeight())
|
||||
{
|
||||
app.DebugPrintf("%ls - first w - %d, h - %d, tex w - %d, h - %d\n",textureFileName.c_str(),first->getWidth(),tex->getWidth(),first->getHeight(),tex->getHeight());
|
||||
//__debugbreak();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -245,7 +246,7 @@ StitchedTexture *PreStitchedTextureMap::getTexture(const wstring &name)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("Not implemented!\n");
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
return nullptr;
|
||||
#if 0
|
||||
@@ -276,7 +277,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name)
|
||||
{
|
||||
app.DebugPrintf("Don't register nullptr\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
result = missingPosition;
|
||||
//new RuntimeException("Don't register null!").printStackTrace();
|
||||
@@ -289,7 +290,7 @@ Icon *PreStitchedTextureMap::registerIcon(const wstring &name)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.DebugPrintf("Could not find uv data for icon %ls\n", name.c_str() );
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
result = missingPosition;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ void Screen::updateEvents()
|
||||
static bool s_arrowFirstRepeat[2] = { false, false };
|
||||
const DWORD ARROW_REPEAT_DELAY_MS = 250;
|
||||
const DWORD ARROW_REPEAT_INTERVAL_MS = 50;
|
||||
DWORD now = GetTickCount64();
|
||||
DWORD now = GetTickCount();
|
||||
|
||||
// Poll keyboard events (special keys that may not come through WM_CHAR, e.g. Escape, arrows)
|
||||
for (int vk = 0; vk < 256; vk++)
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
#include "../Minecraft.World/compression.h"
|
||||
#include "../Minecraft.World/OldChunkStorage.h"
|
||||
#include "../Minecraft.World/Tile.h"
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
#include "../Minecraft.Server/FourKitBridge.h"
|
||||
#endif
|
||||
|
||||
ServerChunkCache::ServerChunkCache(ServerLevel *level, ChunkStorage *storage, ChunkSource *source)
|
||||
{
|
||||
@@ -128,10 +125,7 @@ LevelChunk *ServerChunkCache::create(int x, int z, bool asyncPostProcess) // 4J
|
||||
{
|
||||
EnterCriticalSection(&m_csLoadCreate);
|
||||
chunk = load(x, z);
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
bool isNewChunk = (chunk == nullptr);
|
||||
#endif
|
||||
if (chunk == nullptr)
|
||||
if (chunk == nullptr)
|
||||
{
|
||||
if (source == nullptr)
|
||||
{
|
||||
@@ -210,10 +204,6 @@ LevelChunk *ServerChunkCache::create(int x, int z, bool asyncPostProcess) // 4J
|
||||
if( hasChunk( x - 1, z ) && hasChunk( x + 1, z ) && hasChunk ( x, z - 1 ) && hasChunk( x, z + 1 ) ) chunk->checkChests( this, x, z );
|
||||
|
||||
LeaveCriticalSection(&m_csLoadCreate);
|
||||
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
FourKitBridge::FireChunkLoad(level->dimension->id, x, z, isNewChunk);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -361,38 +351,6 @@ void ServerChunkCache::overwriteHellLevelChunkFromSource(int x, int z, int minVa
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
void ServerChunkCache::regenerateChunk(int x, int z)
|
||||
{
|
||||
if (!source)
|
||||
return;
|
||||
|
||||
LevelChunk *freshChunk = source->getChunk(x, z);
|
||||
if (!freshChunk)
|
||||
return;
|
||||
|
||||
LevelChunk *cachedChunk = nullptr;
|
||||
if (hasChunk(x, z))
|
||||
cachedChunk = getChunk(x, z);
|
||||
|
||||
if (cachedChunk && cachedChunk != emptyChunk)
|
||||
{
|
||||
for (int lx = 0; lx < 16; lx++)
|
||||
for (int ly = 0; ly < 128; ly++)
|
||||
for (int lz = 0; lz < 16; lz++)
|
||||
cachedChunk->setTileAndData(lx, ly, lz, freshChunk->getTile(lx, ly, lz), freshChunk->getData(lx, ly, lz));
|
||||
save(cachedChunk);
|
||||
}
|
||||
else
|
||||
{
|
||||
save(freshChunk);
|
||||
}
|
||||
|
||||
freshChunk->unload(false);
|
||||
delete freshChunk;
|
||||
}
|
||||
#endif
|
||||
|
||||
// 4J Added //
|
||||
#ifdef _LARGE_WORLDS
|
||||
void ServerChunkCache::dontDrop(int x, int z)
|
||||
@@ -956,19 +914,15 @@ bool ServerChunkCache::tick()
|
||||
// player's tick is called to remove them from the chunk they used to be in, and add them to their current chunk. This will only be a temporary state and
|
||||
// we should be able to unload the chunk on the next call to this tick.
|
||||
if( !chunk->containsPlayer() )
|
||||
{
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
if (!FourKitBridge::FireChunkUnload(level->dimension->id, chunk->x, chunk->z))
|
||||
{
|
||||
#endif
|
||||
{
|
||||
save(chunk);
|
||||
saveEntities(chunk);
|
||||
chunk->unload(true);
|
||||
|
||||
//loadedChunks.remove(cp);
|
||||
//loadedChunkList.remove(chunk);
|
||||
auto it = std::find(m_loadedChunkList.begin(), m_loadedChunkList.end(), chunk);
|
||||
if(it != m_loadedChunkList.end()) m_loadedChunkList.erase(it);
|
||||
auto it = std::find(m_loadedChunkList.begin(), m_loadedChunkList.end(), chunk);
|
||||
if(it != m_loadedChunkList.end()) m_loadedChunkList.erase(it);
|
||||
|
||||
int ix = chunk->x + XZOFFSET;
|
||||
int iz = chunk->z + XZOFFSET;
|
||||
@@ -976,9 +930,6 @@ bool ServerChunkCache::tick()
|
||||
delete m_unloadedCache[idx];
|
||||
m_unloadedCache[idx] = chunk;
|
||||
cache[idx] = nullptr;
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -53,9 +53,6 @@ public:
|
||||
|
||||
#endif
|
||||
virtual LevelChunk **getCache() { return cache; } // 4J added
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
void regenerateChunk(int x, int z);
|
||||
#endif
|
||||
|
||||
// 4J-JEV Added; Remove chunk from the toDrop queue.
|
||||
#ifdef _LARGE_WORLDS
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "../Minecraft.Server/Security/SecurityConfig.h"
|
||||
#include "../Minecraft.Server/ServerLogManager.h"
|
||||
#include "../Minecraft.Server/ServerLogger.h"
|
||||
#include "../Minecraft.World/System.h"
|
||||
#endif
|
||||
|
||||
ServerConnection::ServerConnection(MinecraftServer *server)
|
||||
@@ -131,45 +129,16 @@ void ServerConnection::tick()
|
||||
vector< shared_ptr<PlayerConnection> > tempPlayers = players;
|
||||
LeaveCriticalSection(&players_cs);
|
||||
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Substep timing for chunk / tick / flush across all players.
|
||||
LARGE_INTEGER scFreq, scA, scB, scC, scD;
|
||||
QueryPerformanceFrequency(&scFreq);
|
||||
int64_t sc_chunkUs = 0;
|
||||
int64_t sc_tickUs = 0;
|
||||
int64_t sc_flushUs = 0;
|
||||
int64_t sc_loopT0 = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
// Rotate the per-tick start offset so the chunk-send cap doesn't
|
||||
// starve players at the back of the vector.
|
||||
static unsigned int s_chunkRotationOffset = 0;
|
||||
s_chunkRotationOffset++;
|
||||
size_t playerCount = tempPlayers.size();
|
||||
size_t startIdx = playerCount > 0 ? (s_chunkRotationOffset % playerCount) : 0;
|
||||
|
||||
for (unsigned int k = 0; k < tempPlayers.size(); k++)
|
||||
for (unsigned int i = 0; i < tempPlayers.size(); i++)
|
||||
{
|
||||
unsigned int i = (unsigned int)((startIdx + k) % playerCount);
|
||||
shared_ptr<PlayerConnection> player = tempPlayers[i];
|
||||
shared_ptr<ServerPlayer> serverPlayer = player->getPlayer();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scA);
|
||||
#endif
|
||||
if( serverPlayer )
|
||||
{
|
||||
serverPlayer->updateFrameTick();
|
||||
serverPlayer->doChunkSendingTick(false);
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scB);
|
||||
sc_chunkUs += (scB.QuadPart - scA.QuadPart) * 1000000 / scFreq.QuadPart;
|
||||
#endif
|
||||
player->tick();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scC);
|
||||
sc_tickUs += (scC.QuadPart - scB.QuadPart) * 1000000 / scFreq.QuadPart;
|
||||
#endif
|
||||
if (player->done)
|
||||
{
|
||||
EnterCriticalSection(&players_cs);
|
||||
@@ -181,28 +150,7 @@ void ServerConnection::tick()
|
||||
{
|
||||
player->connection->flush();
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scD);
|
||||
sc_flushUs += (scD.QuadPart - scC.QuadPart) * 1000000 / scFreq.QuadPart;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t sc_loopTotal = System::currentTimeMillis() - sc_loopT0;
|
||||
if (sc_loopTotal > 150)
|
||||
{
|
||||
ServerRuntime::LogInfof("perf",
|
||||
"conn playerLoop total=%lldms players=%d chunkUs=%lld tickUs=%lld flushUs=%lld | avg chunk=%lld tick=%lld flush=%lld",
|
||||
(long long)sc_loopTotal,
|
||||
(int)tempPlayers.size(),
|
||||
(long long)sc_chunkUs,
|
||||
(long long)sc_tickUs,
|
||||
(long long)sc_flushUs,
|
||||
tempPlayers.size() > 0 ? (long long)(sc_chunkUs / tempPlayers.size()) : 0LL,
|
||||
tempPlayers.size() > 0 ? (long long)(sc_tickUs / tempPlayers.size()) : 0LL,
|
||||
tempPlayers.size() > 0 ? (long long)(sc_flushUs / tempPlayers.size()) : 0LL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include "PlayerChunkMap.h"
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "../Minecraft.Server/FourKitBridge.h"
|
||||
#include "../Minecraft.Server/ServerLogger.h"
|
||||
#endif
|
||||
|
||||
WeighedTreasureArray ServerLevel::RANDOM_BONUS_ITEMS;
|
||||
@@ -198,14 +197,6 @@ ServerLevel::~ServerLevel()
|
||||
|
||||
void ServerLevel::tick()
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// ts[N] = wall-clock at substep N. Logged when level total exceeds
|
||||
// LEVEL_SLOW_THRESHOLD_MS to pinpoint the dominant substep.
|
||||
const int64_t LEVEL_SLOW_THRESHOLD_MS = 150;
|
||||
int64_t ts[13];
|
||||
ts[0] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
Level::tick();
|
||||
if (getLevelData()->isHardcore() && difficulty < 3)
|
||||
{
|
||||
@@ -227,9 +218,6 @@ void ServerLevel::tick()
|
||||
}
|
||||
awakenAllPlayers();
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[1] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
PIXBeginNamedEvent(0,"Mob spawner tick");
|
||||
// for Minecraft 1.8, spawn friendlies really rarely - 4J - altered from once every 400 ticks to 40 ticks as we depend on this a more than the original since we don't have chunk post-process spawning
|
||||
@@ -245,9 +233,6 @@ void ServerLevel::tick()
|
||||
mobSpawner->tick(this, finalSpawnEnemies, finalSpawnFriendlies, finalSpawnPersistent);
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[2] = System::currentTimeMillis();
|
||||
#endif
|
||||
PIXBeginNamedEvent(0,"Chunk source tick");
|
||||
chunkSource->tick();
|
||||
PIXEndNamedEvent();
|
||||
@@ -263,9 +248,6 @@ void ServerLevel::tick()
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[3] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
//4J - temporarily disabling saves as they are causing gameplay to generally stutter quite a lot
|
||||
|
||||
@@ -281,9 +263,6 @@ void ServerLevel::tick()
|
||||
save(false, nullptr);
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[4] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
// 4J : WESTY : Changed so that time update goes through stats tracking update code.
|
||||
//levelData->setTime(time);
|
||||
@@ -299,31 +278,19 @@ void ServerLevel::tick()
|
||||
setDayTime(levelData->getDayTime() + 1);
|
||||
}
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[5] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
PIXBeginNamedEvent(0,"Tick pending ticks");
|
||||
// if (tickCount % 5 == 0) {
|
||||
tickPendingTicks(false);
|
||||
PIXEndNamedEvent();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[6] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
PIXBeginNamedEvent(0,"Tick tiles");
|
||||
MemSect(18);
|
||||
tickTiles();
|
||||
MemSect(0);
|
||||
PIXEndNamedEvent();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[7] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
chunkMap->tick();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[8] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
PIXBeginNamedEvent(0,"Tick villages");
|
||||
//MemSect(18);
|
||||
@@ -331,50 +298,18 @@ void ServerLevel::tick()
|
||||
villageSiege->tick();
|
||||
//MemSect(0);
|
||||
PIXEndNamedEvent();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[9] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
PIXBeginNamedEvent(0,"Tick portal forcer");
|
||||
portalForcer->tick(getGameTime());
|
||||
PIXEndNamedEvent();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[10] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
// repeat after tile ticks
|
||||
PIXBeginNamedEvent(0,"runTileEvents");
|
||||
runTileEvents();
|
||||
PIXEndNamedEvent();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[11] = System::currentTimeMillis();
|
||||
#endif
|
||||
|
||||
// 4J Added
|
||||
runQueuedSendTileUpdates();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
ts[12] = System::currentTimeMillis();
|
||||
int64_t levelTotal = ts[12] - ts[0];
|
||||
if (levelTotal > LEVEL_SLOW_THRESHOLD_MS)
|
||||
{
|
||||
ServerRuntime::LogInfof("perf",
|
||||
"L%d substep total=%lldms base=%lld spawn=%lld chunkSrc=%lld save=%lld time=%lld pending=%lld tiles=%lld chunkMap=%lld villages=%lld portal=%lld evt=%lld sendTU=%lld",
|
||||
dimension->id,
|
||||
(long long)levelTotal,
|
||||
(long long)(ts[1] - ts[0]),
|
||||
(long long)(ts[2] - ts[1]),
|
||||
(long long)(ts[3] - ts[2]),
|
||||
(long long)(ts[4] - ts[3]),
|
||||
(long long)(ts[5] - ts[4]),
|
||||
(long long)(ts[6] - ts[5]),
|
||||
(long long)(ts[7] - ts[6]),
|
||||
(long long)(ts[8] - ts[7]),
|
||||
(long long)(ts[9] - ts[8]),
|
||||
(long long)(ts[10] - ts[9]),
|
||||
(long long)(ts[11] - ts[10]),
|
||||
(long long)(ts[12] - ts[11]));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Biome::MobSpawnerData *ServerLevel::getRandomMobSpawnAt(MobCategory *mobCategory, int x, int y, int z)
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
#include "Settings.h"
|
||||
#include "PlayerList.h"
|
||||
#include "MultiPlayerLevel.h"
|
||||
#include "Minecraft.h"
|
||||
#include "Common/Audio/SoundEngine.h"
|
||||
#include "../Minecraft.World/SoundTypes.h"
|
||||
|
||||
#include "../Minecraft.World/net.minecraft.network.packet.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.damagesource.h"
|
||||
@@ -298,12 +295,12 @@ void ServerPlayer::flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFou
|
||||
{
|
||||
*removedFound = true;
|
||||
// before this left 192 bytes uninitialized!!!!!
|
||||
memset(flags, 0, (16384 / 32) * sizeof(unsigned int));
|
||||
memset(flags, 0, (2048 / 32) * sizeof(unsigned int));
|
||||
}
|
||||
|
||||
for(int index : entitiesToRemove)
|
||||
{
|
||||
if( index < 16384 )
|
||||
if( index < 2048 )
|
||||
{
|
||||
unsigned int i = index / 32;
|
||||
unsigned int j = index % 32;
|
||||
@@ -477,82 +474,28 @@ void ServerPlayer::doTickA()
|
||||
}
|
||||
|
||||
// 4J - split off the chunk sending bit of the tick here from ::doTick so we can do this exactly once per player per server tick
|
||||
//
|
||||
// Find-nearest uses spiral iteration from the player's chunk position with
|
||||
// O(1) hash lookups against chunksToSend. A bounded fallback walk covers
|
||||
// the rare case of a stale entry outside the spiral radius.
|
||||
void ServerPlayer::doChunkSendingTick(bool dontDelayChunks)
|
||||
{
|
||||
// printf("[%d] %s: sendChunks: %d, empty: %d\n",tickCount, connection->getNetworkPlayer()->GetUID().getOnlineID(),sendChunks,chunksToSend.empty());
|
||||
if (!chunksToSend.empty())
|
||||
{
|
||||
ChunkPos nearest(0, 0);
|
||||
ChunkPos nearest = chunksToSend.front();
|
||||
bool nearestValid = false;
|
||||
|
||||
// 4J - reinstated and optimised some code that was commented out in the original, to make sure that we always
|
||||
// send the nearest chunk to the player. The original uses the bukkit sorting thing to try and avoid doing this, but
|
||||
// the player can quickly wander away from the centre of the spiral of chunks that that method creates, long before transmission
|
||||
// of them is complete.
|
||||
double dist = DBL_MAX;
|
||||
|
||||
const int px = (int)floor(x) >> 4;
|
||||
const int pz = (int)floor(z) >> 4;
|
||||
// Bound on spiral radius. Configured view distance is much smaller.
|
||||
const int kMaxSpiralRadius = 32;
|
||||
|
||||
// Inline distance: ChunkPos::distanceToSqr is non-const so it can't
|
||||
// be called on the const refs we get when iterating an unordered_set.
|
||||
auto chunkDistSq = [&](int cx, int cz) -> double {
|
||||
double xPos = cx * 16.0 + 8.0;
|
||||
double zPos = cz * 16.0 + 8.0;
|
||||
double xd = xPos - this->x;
|
||||
double zd = zPos - this->z;
|
||||
return xd * xd + zd * zd;
|
||||
};
|
||||
|
||||
// Ring r=0: the player's own chunk.
|
||||
for(ChunkPos chunk : chunksToSend)
|
||||
{
|
||||
ChunkPos cp(px, pz);
|
||||
auto it = chunksToSend.find(cp);
|
||||
if (it != chunksToSend.end() && level->isChunkFinalised(cp.x, cp.z))
|
||||
if( level->isChunkFinalised(chunk.x, chunk.z) )
|
||||
{
|
||||
nearest = cp;
|
||||
dist = chunkDistSq(cp.x, cp.z);
|
||||
nearestValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Rings r>=1: Chebyshev perimeter. First ring with a match wins;
|
||||
// within it pick the closest by true Euclidean distance.
|
||||
for (int r = 1; r <= kMaxSpiralRadius && !nearestValid; r++)
|
||||
{
|
||||
for (int dx = -r; dx <= r; dx++)
|
||||
{
|
||||
for (int dz = -r; dz <= r; dz++)
|
||||
double newDist = chunk.distanceToSqr(x, z);
|
||||
if ( (!nearestValid) || (newDist < dist) )
|
||||
{
|
||||
int adx = dx < 0 ? -dx : dx;
|
||||
int adz = dz < 0 ? -dz : dz;
|
||||
if ((adx > adz ? adx : adz) != r) continue; // perimeter only
|
||||
ChunkPos cp(px + dx, pz + dz);
|
||||
if (chunksToSend.find(cp) == chunksToSend.end()) continue;
|
||||
if (!level->isChunkFinalised(cp.x, cp.z)) continue;
|
||||
double d = chunkDistSq(cp.x, cp.z);
|
||||
if (!nearestValid || d < dist)
|
||||
{
|
||||
nearest = cp;
|
||||
dist = d;
|
||||
nearestValid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback for chunks outside the spiral radius (rare).
|
||||
if (!nearestValid)
|
||||
{
|
||||
for (const ChunkPos& cp : chunksToSend)
|
||||
{
|
||||
if (!level->isChunkFinalised(cp.x, cp.z)) continue;
|
||||
double d = chunkDistSq(cp.x, cp.z);
|
||||
if (!nearestValid || d < dist)
|
||||
{
|
||||
nearest = cp;
|
||||
dist = d;
|
||||
nearest = chunk;
|
||||
dist = chunk.distanceToSqr(x, z);
|
||||
nearestValid = true;
|
||||
}
|
||||
}
|
||||
@@ -621,7 +564,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks)
|
||||
{
|
||||
ServerLevel *level = server->getLevel(dimension);
|
||||
int flagIndex = getFlagIndexForChunk(nearest,this->level->dimension->id);
|
||||
chunksToSend.erase(nearest);
|
||||
chunksToSend.remove(nearest);
|
||||
|
||||
bool chunkDataSent = false;
|
||||
|
||||
@@ -1092,13 +1035,6 @@ void ServerPlayer::changeDimension(int i)
|
||||
// 4J: Removed on the advice of the mighty King of Achievments (JV)
|
||||
// awardStat(GenericStats::portal(), GenericStats::param_portal());
|
||||
}
|
||||
// play the travel whoosh right before the actual dimension swap
|
||||
Minecraft *mc = Minecraft::GetInstance();
|
||||
if (mc != nullptr && mc->soundEngine != nullptr)
|
||||
{
|
||||
mc->soundEngine->playUI(eSoundType_PORTAL_TRAVEL, 1, 1.0f);
|
||||
}
|
||||
|
||||
server->getPlayers()->toggleDimension( dynamic_pointer_cast<ServerPlayer>(shared_from_this()), i);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (portalDestModified)
|
||||
|
||||
@@ -25,9 +25,7 @@ public:
|
||||
MinecraftServer *server;
|
||||
ServerPlayerGameMode *gameMode;
|
||||
double lastMoveX, lastMoveZ;
|
||||
// Hash set for O(1) membership/erase. Find-nearest is done via
|
||||
// spiral iteration in ServerPlayer::doChunkSendingTick, not a sweep.
|
||||
unordered_set<ChunkPos, ChunkPosKeyHash, ChunkPosKeyEq> chunksToSend;
|
||||
list<ChunkPos> chunksToSend;
|
||||
vector<int> entitiesToRemove;
|
||||
unordered_set<ChunkPos, ChunkPosKeyHash, ChunkPosKeyEq> seenChunks;
|
||||
int spewTimer;
|
||||
|
||||
@@ -87,7 +87,7 @@ void Stitcher::stitch()
|
||||
{
|
||||
app.DebugPrintf("Stitcher exception!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
//throw new StitcherException(textureHolder);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ LPCWSTR StringTable::getString(const wstring &id)
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if (isStatic)
|
||||
{
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
return L"";
|
||||
}
|
||||
#endif
|
||||
@@ -166,7 +166,7 @@ LPCWSTR StringTable::getString(int id)
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if (!isStatic)
|
||||
{
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
return L"";
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -214,7 +214,7 @@ Icon *TextureMap::registerIcon(const wstring &name)
|
||||
{
|
||||
app.DebugPrintf("Don't register nullptr\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
DEBUG_BREAK();
|
||||
__debugbreak();
|
||||
#endif
|
||||
//new RuntimeException("Don't register null!").printStackTrace();
|
||||
}
|
||||
|
||||
@@ -339,6 +339,7 @@ bool TexturePackRepository::selectTexturePackById(DWORD id)
|
||||
app.DebugPrintf("Failed to select texture pack %d as it is not in the list\n", id);
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// TODO - 4J Stu: We should report this to the player in some way
|
||||
//__debugbreak();
|
||||
#endif
|
||||
// Fail safely
|
||||
if( selectSkin( DEFAULT_TEXTURE_PACK ) )
|
||||
|
||||
Submodule Minecraft.Client/Windows64/4JLibs deleted from 8fb036f6d6
@@ -0,0 +1,137 @@
|
||||
#pragma once
|
||||
|
||||
#define MAP_STYLE_0 0
|
||||
#define MAP_STYLE_1 1
|
||||
#define MAP_STYLE_2 2
|
||||
|
||||
#define _360_JOY_BUTTON_A 0x00000001
|
||||
#define _360_JOY_BUTTON_B 0x00000002
|
||||
#define _360_JOY_BUTTON_X 0x00000004
|
||||
#define _360_JOY_BUTTON_Y 0x00000008
|
||||
|
||||
#define _360_JOY_BUTTON_START 0x00000010
|
||||
#define _360_JOY_BUTTON_BACK 0x00000020
|
||||
#define _360_JOY_BUTTON_RB 0x00000040
|
||||
#define _360_JOY_BUTTON_LB 0x00000080
|
||||
|
||||
#define _360_JOY_BUTTON_RTHUMB 0x00000100
|
||||
#define _360_JOY_BUTTON_LTHUMB 0x00000200
|
||||
#define _360_JOY_BUTTON_DPAD_UP 0x00000400
|
||||
#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800
|
||||
|
||||
#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000
|
||||
#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000
|
||||
// fake digital versions of analog values
|
||||
#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000
|
||||
#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000
|
||||
|
||||
#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000
|
||||
#define _360_JOY_BUTTON_RSTICK_UP 0x00020000
|
||||
#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000
|
||||
#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000
|
||||
|
||||
#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000
|
||||
#define _360_JOY_BUTTON_LSTICK_UP 0x00200000
|
||||
#define _360_JOY_BUTTON_RT 0x00400000
|
||||
#define _360_JOY_BUTTON_LT 0x00800000
|
||||
|
||||
// Stick axis maps - to allow changes for SouthPaw in-game axis mapping
|
||||
#define AXIS_MAP_LX 0
|
||||
#define AXIS_MAP_LY 1
|
||||
#define AXIS_MAP_RX 2
|
||||
#define AXIS_MAP_RY 3
|
||||
|
||||
// Trigger map - to allow for swap triggers in-game
|
||||
#define TRIGGER_MAP_0 0
|
||||
#define TRIGGER_MAP_1 1
|
||||
|
||||
enum EKeyboardResult
|
||||
{
|
||||
EKeyboard_Pending,
|
||||
EKeyboard_Cancelled,
|
||||
EKeyboard_ResultAccept,
|
||||
EKeyboard_ResultDecline,
|
||||
};
|
||||
|
||||
typedef struct _STRING_VERIFY_RESPONSE
|
||||
{
|
||||
WORD wNumStrings;
|
||||
HRESULT *pStringResult;
|
||||
}
|
||||
STRING_VERIFY_RESPONSE;
|
||||
|
||||
class C_4JInput
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
enum EKeyboardMode
|
||||
{
|
||||
EKeyboardMode_Default,
|
||||
EKeyboardMode_Numeric,
|
||||
EKeyboardMode_Password,
|
||||
EKeyboardMode_Alphabet,
|
||||
EKeyboardMode_Full,
|
||||
EKeyboardMode_Alphabet_Extended,
|
||||
EKeyboardMode_IP_Address,
|
||||
EKeyboardMode_Phone
|
||||
};
|
||||
|
||||
void Initialise( int iInputStateC, unsigned char ucMapC,unsigned char ucActionC, unsigned char ucMenuActionC );
|
||||
void Tick(void);
|
||||
void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax );
|
||||
void SetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction,unsigned int uiActionVal);
|
||||
unsigned int GetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction);
|
||||
void SetJoypadMapVal(int iPad,unsigned char ucMap);
|
||||
unsigned char GetJoypadMapVal(int iPad);
|
||||
void SetJoypadSensitivity(int iPad, float fSensitivity);
|
||||
unsigned int GetValue(int iPad,unsigned char ucAction, bool bRepeat=false);
|
||||
bool ButtonPressed(int iPad,unsigned char ucAction=255); // toggled
|
||||
bool ButtonReleased(int iPad,unsigned char ucAction); //toggled
|
||||
bool ButtonDown(int iPad,unsigned char ucAction=255); // button held down
|
||||
// Functions to remap the axis and triggers for in-game (not menus) - SouthPaw, etc
|
||||
void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
|
||||
void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
|
||||
void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs);
|
||||
void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam );
|
||||
FLOAT GetIdleSeconds(int iPad);
|
||||
bool IsPadConnected(int iPad);
|
||||
|
||||
// In-Game values which may have been remapped due to Southpaw, swap triggers, etc
|
||||
float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay=true);
|
||||
float GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
unsigned char GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay=true);
|
||||
|
||||
void SetMenuDisplayed(int iPad, bool bVal);
|
||||
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
|
||||
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
|
||||
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
|
||||
void GetText(uint16_t *UTF16String);
|
||||
|
||||
// Online check strings against offensive list - TCR 92
|
||||
// TCR # 092 CMTV Player Text String Verification
|
||||
// Requirement Any player-entered text visible to another player on Xbox LIVE must be verified using the Xbox LIVE service before being transmitted. Text that is rejected by the Xbox LIVE service must not be displayed.
|
||||
//
|
||||
// Remarks
|
||||
// This requirement applies to any player-entered string that can be exposed to other players on Xbox LIVE. It includes session names, content descriptions, text messages, tags, team names, mottos, comments, and so on.
|
||||
//
|
||||
// Games may decide to not send the text, blank it out, or use generic text if the text was rejected by the Xbox LIVE service.
|
||||
//
|
||||
// Games verify the text by calling the XStringVerify function.
|
||||
//
|
||||
// Exemption It is not required to use the Xbox LIVE service to verify real-time text communication. An example of real-time text communication is in-game text chat.
|
||||
//
|
||||
// Intent Protect players from inappropriate language.
|
||||
bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
|
||||
void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
|
||||
void CancelAllVerifyInProgress(void);
|
||||
|
||||
//bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput);
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JInput InputManager;
|
||||
@@ -0,0 +1,128 @@
|
||||
#pragma once
|
||||
|
||||
enum eAwardType
|
||||
{
|
||||
eAwardType_Achievement = 0,
|
||||
eAwardType_GamerPic,
|
||||
eAwardType_Theme,
|
||||
eAwardType_AvatarItem,
|
||||
};
|
||||
|
||||
enum eUpsellType
|
||||
{
|
||||
eUpsellType_Custom = 0, // This is the default, and means that the upsell dialog was initiated in the app code
|
||||
eUpsellType_Achievement,
|
||||
eUpsellType_GamerPic,
|
||||
eUpsellType_Theme,
|
||||
eUpsellType_AvatarItem,
|
||||
};
|
||||
|
||||
enum eUpsellResponse
|
||||
{
|
||||
eUpsellResponse_Declined,
|
||||
eUpsellResponse_Accepted_NoPurchase,
|
||||
eUpsellResponse_Accepted_Purchase,
|
||||
};
|
||||
|
||||
|
||||
|
||||
class C_4JProfile
|
||||
{
|
||||
public:
|
||||
struct PROFILESETTINGS
|
||||
{
|
||||
int iYAxisInversion;
|
||||
int iControllerSensitivity;
|
||||
int iVibration;
|
||||
bool bSwapSticks;
|
||||
};
|
||||
|
||||
|
||||
// 4 players have game defined data, puiGameDefinedDataChangedBitmask needs to be checked by the game side to see if there's an update needed - it'll have the bits set for players to be updated
|
||||
void Initialise( DWORD dwTitleID,
|
||||
DWORD dwOfferID,
|
||||
unsigned short usProfileVersion,
|
||||
UINT uiProfileValuesC,
|
||||
UINT uiProfileSettingsC,
|
||||
DWORD *pdwProfileSettingsA,
|
||||
int iGameDefinedDataSizeX4,
|
||||
unsigned int *puiGameDefinedDataChangedBitmask);
|
||||
void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject);
|
||||
void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game
|
||||
int GetLockedProfile();
|
||||
void SetLockedProfile(int iProf);
|
||||
bool IsSignedIn(int iQuadrant);
|
||||
bool IsSignedInLive(int iProf);
|
||||
bool IsGuest(int iQuadrant);
|
||||
UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
|
||||
void SetPrimaryPlayerChanged(bool bVal);
|
||||
bool QuerySigninStatus(void);
|
||||
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
|
||||
BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
|
||||
BOOL XUIDIsGuest(PlayerUID xuid);
|
||||
bool AllowedToPlayMultiplayer(int iProf);
|
||||
bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
|
||||
void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame
|
||||
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed);
|
||||
BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount );
|
||||
void ShowProfileCard(int iPad, PlayerUID targetUid);
|
||||
bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam);
|
||||
void CancelProfileAvatarRequest();
|
||||
|
||||
|
||||
// SYS
|
||||
int GetPrimaryPad();
|
||||
void SetPrimaryPad(int iPad);
|
||||
char* GetGamertag(int iPad);
|
||||
wstring GetDisplayName(int iPad);
|
||||
bool IsFullVersion();
|
||||
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
|
||||
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
|
||||
bool RegionIsNorthAmerica(void);
|
||||
bool LocaleIsUSorCanada(void);
|
||||
HRESULT GetLiveConnectionStatus();
|
||||
bool IsSystemUIDisplayed();
|
||||
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
|
||||
|
||||
|
||||
// PROFILE DATA
|
||||
int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam);
|
||||
int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam);
|
||||
PROFILESETTINGS * GetDashboardProfileSettings(int iPad);
|
||||
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false);
|
||||
void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY);
|
||||
void *GetGameDefinedProfileData(int iQuadrant);
|
||||
void ResetProfileProcessState(); // after a sign out from the primary player, call this
|
||||
void Tick( void );
|
||||
|
||||
// ACHIEVEMENTS & AWARDS
|
||||
|
||||
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
|
||||
CXuiStringTable*pStringTable=nullptr, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=nullptr, unsigned int uiThemeSize=0L);
|
||||
int GetAwardId(int iAwardNumber);
|
||||
eAwardType GetAwardType(int iAwardNumber);
|
||||
bool CanBeAwarded(int iQuadrant, int iAwardNumber);
|
||||
void Award(int iQuadrant, int iAwardNumber, bool bForce=false);
|
||||
bool IsAwardsFlagSet(int iQuadrant, int iAward);
|
||||
|
||||
// RICH PRESENCE
|
||||
|
||||
void RichPresenceInit(int iPresenceCount, int iContextCount);
|
||||
void RegisterRichPresenceContext(int iGameConfigContextID);
|
||||
void SetRichPresenceContextValue(int iPad,int iContextID, int iVal);
|
||||
void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false);
|
||||
|
||||
// PURCHASE
|
||||
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1);
|
||||
void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam);
|
||||
|
||||
// Debug
|
||||
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
|
||||
|
||||
};
|
||||
|
||||
// Singleton
|
||||
extern C_4JProfile ProfileManager;
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
#pragma once
|
||||
|
||||
class ImageFileBuffer
|
||||
{
|
||||
public:
|
||||
enum EImageType
|
||||
{
|
||||
e_typePNG,
|
||||
e_typeJPG
|
||||
};
|
||||
|
||||
EImageType m_type;
|
||||
void* m_pBuffer;
|
||||
int m_bufferSize;
|
||||
|
||||
int GetType() { return m_type; }
|
||||
void *GetBufferPointer() { return m_pBuffer; }
|
||||
int GetBufferSize() { return m_bufferSize; }
|
||||
void Release() { free(m_pBuffer); m_pBuffer = nullptr; }
|
||||
bool Allocated() { return m_pBuffer != nullptr; }
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int Width;
|
||||
int Height;
|
||||
}D3DXIMAGE_INFO;
|
||||
|
||||
typedef struct _XSOCIAL_PREVIEWIMAGE {
|
||||
BYTE *pBytes;
|
||||
DWORD Pitch;
|
||||
DWORD Width;
|
||||
DWORD Height;
|
||||
// D3DFORMAT Format;
|
||||
} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE;
|
||||
|
||||
class C4JRender
|
||||
{
|
||||
public:
|
||||
void Tick();
|
||||
void UpdateGamma(unsigned short usGamma);
|
||||
|
||||
// Matrix stack
|
||||
void MatrixMode(int type);
|
||||
void MatrixSetIdentity();
|
||||
void MatrixTranslate(float x,float y,float z);
|
||||
void MatrixRotate(float angle, float x, float y, float z);
|
||||
void MatrixScale(float x, float y, float z);
|
||||
void MatrixPerspective(float fovy, float aspect, float zNear, float zFar);
|
||||
void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar);
|
||||
void MatrixPop();
|
||||
void MatrixPush();
|
||||
void MatrixMult(float *mat);
|
||||
const float *MatrixGet(int type);
|
||||
void Set_matrixDirty();
|
||||
|
||||
// Core
|
||||
void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain);
|
||||
void InitialiseContext();
|
||||
void StartFrame();
|
||||
void DoScreenGrabOnNextPresent();
|
||||
void Present();
|
||||
void Clear(int flags, D3D11_RECT *pRect = nullptr);
|
||||
void SetClearColour(const float colourRGBA[4]);
|
||||
bool IsWidescreen();
|
||||
bool IsHiDef();
|
||||
void CaptureThumbnail(ImageFileBuffer *pngOut);
|
||||
void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut);
|
||||
void BeginConditionalSurvey(int identifier);
|
||||
void EndConditionalSurvey();
|
||||
void BeginConditionalRendering(int identifier);
|
||||
void EndConditionalRendering();
|
||||
|
||||
// Vertex data handling
|
||||
typedef enum
|
||||
{
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD
|
||||
VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied,
|
||||
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen
|
||||
VERTEX_TYPE_COUNT
|
||||
} eVertexType;
|
||||
|
||||
// Pixel shader
|
||||
typedef enum
|
||||
{
|
||||
PIXEL_SHADER_TYPE_STANDARD,
|
||||
PIXEL_SHADER_TYPE_PROJECTION,
|
||||
PIXEL_SHADER_TYPE_FORCELOD,
|
||||
PIXEL_SHADER_COUNT
|
||||
} ePixelShaderType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VIEWPORT_TYPE_FULLSCREEN,
|
||||
VIEWPORT_TYPE_SPLIT_TOP,
|
||||
VIEWPORT_TYPE_SPLIT_BOTTOM,
|
||||
VIEWPORT_TYPE_SPLIT_LEFT,
|
||||
VIEWPORT_TYPE_SPLIT_RIGHT,
|
||||
VIEWPORT_TYPE_QUADRANT_TOP_LEFT,
|
||||
VIEWPORT_TYPE_QUADRANT_TOP_RIGHT,
|
||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT,
|
||||
VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT,
|
||||
} eViewportType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PRIMITIVE_TYPE_TRIANGLE_LIST,
|
||||
PRIMITIVE_TYPE_TRIANGLE_STRIP,
|
||||
PRIMITIVE_TYPE_TRIANGLE_FAN,
|
||||
PRIMITIVE_TYPE_QUAD_LIST,
|
||||
PRIMITIVE_TYPE_LINE_LIST,
|
||||
PRIMITIVE_TYPE_LINE_STRIP,
|
||||
PRIMITIVE_TYPE_COUNT
|
||||
} ePrimitiveType;
|
||||
|
||||
void DrawVertices(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType);
|
||||
|
||||
// Command buffers
|
||||
void CBuffLockStaticCreations();
|
||||
int CBuffCreate(int count);
|
||||
void CBuffDelete(int first, int count);
|
||||
void CBuffStart(int index, bool full = false);
|
||||
void CBuffClear(int index);
|
||||
int CBuffSize(int index);
|
||||
void CBuffEnd();
|
||||
bool CBuffCall(int index, bool full = true);
|
||||
void CBuffTick();
|
||||
void CBuffDeferredModeStart();
|
||||
void CBuffDeferredModeEnd();
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component
|
||||
/* Don't think these are all directly available on D3D 11 - leaving for now
|
||||
TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0
|
||||
TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1
|
||||
TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels
|
||||
*/
|
||||
MAX_TEXTURE_FORMATS
|
||||
} eTextureFormat;
|
||||
|
||||
// Textures
|
||||
int TextureCreate();
|
||||
void TextureFree(int idx);
|
||||
void TextureBind(int idx);
|
||||
void TextureBindVertex(int idx);
|
||||
void TextureSetTextureLevels(int levels);
|
||||
int TextureGetTextureLevels();
|
||||
void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw);
|
||||
void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level);
|
||||
void TextureSetParam(int param, int value);
|
||||
void TextureDynamicUpdateStart();
|
||||
void TextureDynamicUpdateEnd();
|
||||
HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
|
||||
HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut);
|
||||
HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn);
|
||||
void TextureGetStats();
|
||||
ID3D11ShaderResourceView *TextureGetTexture(int idx);
|
||||
|
||||
// State control
|
||||
void StateSetColour(float r, float g, float b, float a);
|
||||
void StateSetDepthMask(bool enable);
|
||||
void StateSetBlendEnable(bool enable);
|
||||
void StateSetBlendFunc(int src, int dst);
|
||||
void StateSetBlendFactor(unsigned int colour);
|
||||
void StateSetAlphaFunc(int func, float param);
|
||||
void StateSetDepthFunc(int func);
|
||||
void StateSetFaceCull(bool enable);
|
||||
void StateSetFaceCullCW(bool enable);
|
||||
void StateSetLineWidth(float width);
|
||||
void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha);
|
||||
void StateSetDepthTestEnable(bool enable);
|
||||
void StateSetAlphaTestEnable(bool enable);
|
||||
void StateSetDepthSlopeAndBias(float slope, float bias);
|
||||
void StateSetFogEnable(bool enable);
|
||||
void StateSetFogMode(int mode);
|
||||
void StateSetFogNearDistance(float dist);
|
||||
void StateSetFogFarDistance(float dist);
|
||||
void StateSetFogDensity(float density);
|
||||
void StateSetFogColour(float red, float green, float blue);
|
||||
void StateSetLightingEnable(bool enable);
|
||||
void StateSetVertexTextureUV( float u, float v);
|
||||
void StateSetLightColour(int light, float red, float green, float blue);
|
||||
void StateSetLightAmbientColour(float red, float green, float blue);
|
||||
void StateSetLightDirection(int light, float x, float y, float z);
|
||||
void StateSetLightEnable(int light, bool enable);
|
||||
void StateSetViewport(eViewportType viewportType);
|
||||
void StateSetEnableViewportClipPlanes(bool enable);
|
||||
void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace);
|
||||
void StateSetStencil(int Function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask);
|
||||
void StateSetForceLOD(int LOD);
|
||||
|
||||
// Event tracking
|
||||
void BeginEvent(LPCWSTR eventName);
|
||||
void EndEvent();
|
||||
|
||||
// PLM event handling
|
||||
void Suspend();
|
||||
bool Suspended();
|
||||
void Resume();
|
||||
};
|
||||
|
||||
|
||||
const int GL_MODELVIEW_MATRIX = 0;
|
||||
const int GL_PROJECTION_MATRIX = 1;
|
||||
const int GL_MODELVIEW = 0;
|
||||
const int GL_PROJECTION = 1;
|
||||
const int GL_TEXTURE = 2;
|
||||
|
||||
// These things required for tex gen
|
||||
|
||||
const int GL_S = 0;
|
||||
const int GL_T = 1;
|
||||
const int GL_R = 2;
|
||||
const int GL_Q = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_S = 0;
|
||||
const int GL_TEXTURE_GEN_T = 1;
|
||||
const int GL_TEXTURE_GEN_Q = 2;
|
||||
const int GL_TEXTURE_GEN_R = 3;
|
||||
|
||||
const int GL_TEXTURE_GEN_MODE = 0;
|
||||
const int GL_OBJECT_LINEAR = 0;
|
||||
const int GL_EYE_LINEAR = 1;
|
||||
const int GL_OBJECT_PLANE = 0;
|
||||
const int GL_EYE_PLANE = 1;
|
||||
|
||||
|
||||
// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet)
|
||||
const int GL_TEXTURE_2D = 1;
|
||||
const int GL_BLEND = 2;
|
||||
const int GL_CULL_FACE = 3;
|
||||
const int GL_ALPHA_TEST = 4;
|
||||
const int GL_DEPTH_TEST = 5;
|
||||
const int GL_FOG = 6;
|
||||
const int GL_LIGHTING = 7;
|
||||
const int GL_LIGHT0 = 8;
|
||||
const int GL_LIGHT1 = 9;
|
||||
|
||||
const int CLEAR_DEPTH_FLAG = 1;
|
||||
const int CLEAR_COLOUR_FLAG = 2;
|
||||
|
||||
const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG;
|
||||
const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG;
|
||||
|
||||
const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA;
|
||||
const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA;
|
||||
const int GL_ONE = D3D11_BLEND_ONE;
|
||||
const int GL_ZERO = D3D11_BLEND_ZERO;
|
||||
const int GL_DST_ALPHA = D3D11_BLEND_DEST_ALPHA;
|
||||
const int GL_SRC_COLOR = D3D11_BLEND_SRC_COLOR;
|
||||
const int GL_DST_COLOR = D3D11_BLEND_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_DST_COLOR = D3D11_BLEND_INV_DEST_COLOR;
|
||||
const int GL_ONE_MINUS_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR;
|
||||
const int GL_CONSTANT_ALPHA = D3D11_BLEND_BLEND_FACTOR;
|
||||
const int GL_ONE_MINUS_CONSTANT_ALPHA = D3D11_BLEND_INV_BLEND_FACTOR;
|
||||
|
||||
const int GL_GREATER = D3D11_COMPARISON_GREATER;
|
||||
const int GL_EQUAL = D3D11_COMPARISON_EQUAL;
|
||||
const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL;
|
||||
const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL;
|
||||
const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS;
|
||||
|
||||
const int GL_TEXTURE_MIN_FILTER = 1;
|
||||
const int GL_TEXTURE_MAG_FILTER = 2;
|
||||
const int GL_TEXTURE_WRAP_S = 3;
|
||||
const int GL_TEXTURE_WRAP_T = 4;
|
||||
|
||||
const int GL_NEAREST = 0;
|
||||
const int GL_LINEAR = 1;
|
||||
const int GL_EXP = 2;
|
||||
const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this
|
||||
|
||||
const int GL_CLAMP = 0;
|
||||
const int GL_REPEAT = 1;
|
||||
|
||||
const int GL_FOG_START = 1;
|
||||
const int GL_FOG_END = 2;
|
||||
const int GL_FOG_MODE = 3;
|
||||
const int GL_FOG_DENSITY = 4;
|
||||
const int GL_FOG_COLOR = 5;
|
||||
|
||||
const int GL_POSITION = 1;
|
||||
const int GL_AMBIENT = 2;
|
||||
const int GL_DIFFUSE = 3;
|
||||
const int GL_SPECULAR = 4;
|
||||
|
||||
const int GL_LIGHT_MODEL_AMBIENT = 1;
|
||||
|
||||
const int GL_LINES = C4JRender::PRIMITIVE_TYPE_LINE_LIST;
|
||||
const int GL_LINE_STRIP = C4JRender::PRIMITIVE_TYPE_LINE_STRIP;
|
||||
const int GL_QUADS = C4JRender::PRIMITIVE_TYPE_QUAD_LIST;
|
||||
const int GL_TRIANGLE_FAN = C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN;
|
||||
const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP;
|
||||
|
||||
// Singleton
|
||||
extern C4JRender RenderManager;
|
||||
|
||||
|
||||
@@ -0,0 +1,344 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
//#include <xtms.h>
|
||||
class C4JStringTable;
|
||||
|
||||
#define MAX_DISPLAYNAME_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
#define MAX_DETAILS_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3
|
||||
#define MAX_SAVEFILENAME_LENGTH 32 // CELL_SAVEDATA_DIRNAME_SIZE
|
||||
|
||||
typedef struct
|
||||
{
|
||||
time_t modifiedTime;
|
||||
unsigned int dataSize;
|
||||
unsigned int thumbnailSize;
|
||||
}
|
||||
CONTAINER_METADATA;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
|
||||
CONTAINER_METADATA metaData;
|
||||
PBYTE thumbnailData;
|
||||
}
|
||||
SAVE_INFO,*PSAVE_INFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iSaveC;
|
||||
PSAVE_INFO SaveInfoA;
|
||||
}
|
||||
SAVE_DETAILS,*PSAVE_DETAILS;
|
||||
|
||||
typedef std::vector <PXMARKETPLACE_CONTENTOFFER_INFO> OfferDataArray;
|
||||
typedef std::vector <PXCONTENT_DATA> XContentDataArray;
|
||||
//typedef std::vector <PSAVE_DETAILS> SaveDetailsArray;
|
||||
|
||||
// Current version of the dlc data creator
|
||||
#define CURRENT_DLC_VERSION_NUM 3
|
||||
|
||||
class C4JStorage
|
||||
{
|
||||
|
||||
public:
|
||||
// Structs defined in the DLC_Creator, but added here to be used in the app
|
||||
typedef struct
|
||||
{
|
||||
unsigned int uiFileSize;
|
||||
DWORD dwType;
|
||||
DWORD dwWchCount; // count of WCHAR in next array
|
||||
WCHAR wchFile[1];
|
||||
}
|
||||
DLC_FILE_DETAILS, *PDLC_FILE_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwType;
|
||||
DWORD dwWchCount; // count of WCHAR in next array;
|
||||
WCHAR wchData[1]; // will be an array of size dwBytes
|
||||
}
|
||||
DLC_FILE_PARAM, *PDLC_FILE_PARAM;
|
||||
// End of DLC_Creator structs
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
|
||||
CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH];
|
||||
DWORD dwImageOffset;
|
||||
DWORD dwImageBytes;
|
||||
}
|
||||
CACHEINFOSTRUCT;
|
||||
|
||||
// structure to hold DLC info in TMS
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwVersion;
|
||||
DWORD dwNewOffers;
|
||||
DWORD dwTotalOffers;
|
||||
DWORD dwInstalledTotalOffers;
|
||||
BYTE bPadding[1024-sizeof(DWORD)*4]; // future expansion
|
||||
}
|
||||
DLC_TMS_DETAILS;
|
||||
|
||||
enum eGTS_FileTypes
|
||||
{
|
||||
eGTS_Type_Skin=0,
|
||||
eGTS_Type_Cape,
|
||||
eGTS_Type_MAX
|
||||
};
|
||||
|
||||
enum eGlobalStorage
|
||||
{
|
||||
//eGlobalStorage_GameClip=0,
|
||||
eGlobalStorage_Title=0,
|
||||
eGlobalStorage_TitleUser,
|
||||
eGlobalStorage_Max
|
||||
};
|
||||
|
||||
enum EMessageResult
|
||||
{
|
||||
EMessage_Undefined=0,
|
||||
EMessage_Busy,
|
||||
EMessage_Pending,
|
||||
EMessage_Cancelled,
|
||||
EMessage_ResultAccept,
|
||||
EMessage_ResultDecline,
|
||||
EMessage_ResultThirdOption,
|
||||
EMessage_ResultFourthOption
|
||||
};
|
||||
|
||||
enum ESaveGameControlState
|
||||
{
|
||||
ESaveGameControl_Idle=0,
|
||||
ESaveGameControl_Save,
|
||||
ESaveGameControl_InternalRequestingDevice,
|
||||
ESaveGameControl_InternalGetSaveName,
|
||||
ESaveGameControl_InternalSaving,
|
||||
ESaveGameControl_CopySave,
|
||||
ESaveGameControl_CopyingSave,
|
||||
};
|
||||
|
||||
enum ESaveGameState
|
||||
{
|
||||
ESaveGame_Idle=0,
|
||||
ESaveGame_Save,
|
||||
ESaveGame_InternalRequestingDevice,
|
||||
ESaveGame_InternalGetSaveName,
|
||||
ESaveGame_InternalSaving,
|
||||
ESaveGame_CopySave,
|
||||
ESaveGame_CopyingSave,
|
||||
ESaveGame_Load,
|
||||
ESaveGame_GetSavesInfo,
|
||||
ESaveGame_Rename,
|
||||
ESaveGame_Delete,
|
||||
|
||||
ESaveGame_GetSaveThumbnail // Not used as an actual state in the PS4, but the game expects this to be returned to indicate success when getting a thumbnail
|
||||
|
||||
};
|
||||
enum ELoadGameStatus
|
||||
{
|
||||
ELoadGame_Idle=0,
|
||||
ELoadGame_InProgress,
|
||||
ELoadGame_NoSaves,
|
||||
ELoadGame_ChangedDevice,
|
||||
ELoadGame_DeviceRemoved
|
||||
};
|
||||
|
||||
enum EDeleteGameStatus
|
||||
{
|
||||
EDeleteGame_Idle=0,
|
||||
EDeleteGame_InProgress,
|
||||
};
|
||||
|
||||
|
||||
enum ESGIStatus
|
||||
{
|
||||
ESGIStatus_Error=0,
|
||||
ESGIStatus_Idle,
|
||||
ESGIStatus_ReadInProgress,
|
||||
ESGIStatus_NoSaves,
|
||||
};
|
||||
|
||||
enum EDLCStatus
|
||||
{
|
||||
EDLC_Error=0,
|
||||
EDLC_Idle,
|
||||
EDLC_NoOffers,
|
||||
EDLC_AlreadyEnumeratedAllOffers,
|
||||
EDLC_NoInstalledDLC,
|
||||
EDLC_Pending,
|
||||
EDLC_LoadInProgress,
|
||||
EDLC_Loaded,
|
||||
EDLC_ChangedDevice
|
||||
};
|
||||
|
||||
enum ESavingMessage
|
||||
{
|
||||
ESavingMessage_None=0,
|
||||
ESavingMessage_Short,
|
||||
ESavingMessage_Long
|
||||
};
|
||||
|
||||
enum ETMSStatus
|
||||
{
|
||||
ETMSStatus_Idle=0,
|
||||
ETMSStatus_Fail,
|
||||
ETMSStatus_Fail_ReadInProgress,
|
||||
ETMSStatus_Fail_WriteInProgress,
|
||||
ETMSStatus_Pending,
|
||||
};
|
||||
|
||||
enum eTMS_FileType
|
||||
{
|
||||
eTMS_FileType_Normal=0,
|
||||
eTMS_FileType_Graphic,
|
||||
};
|
||||
|
||||
enum eTMS_FILETYPEVAL
|
||||
{
|
||||
TMS_FILETYPE_BINARY,
|
||||
TMS_FILETYPE_CONFIG,
|
||||
TMS_FILETYPE_JSON,
|
||||
TMS_FILETYPE_MAX
|
||||
};
|
||||
enum eTMS_UGCTYPE
|
||||
{
|
||||
TMS_UGCTYPE_NONE,
|
||||
TMS_UGCTYPE_IMAGE,
|
||||
TMS_UGCTYPE_MAX
|
||||
};
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CHAR szFilename[256];
|
||||
int iFileSize;
|
||||
eTMS_FILETYPEVAL eFileTypeVal;
|
||||
}
|
||||
TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int iCount;
|
||||
PTMSPP_FILE_DETAILS FileDetailsA;
|
||||
}
|
||||
TMSPP_FILE_LIST, *PTMSPP_FILE_LIST;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD dwSize;
|
||||
PBYTE pbData;
|
||||
}
|
||||
TMSPP_FILEDATA, *PTMSPP_FILEDATA;
|
||||
|
||||
|
||||
C4JStorage();
|
||||
|
||||
void Tick(void);
|
||||
|
||||
// Messages
|
||||
C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY,
|
||||
int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=nullptr,LPVOID lpParam=nullptr, C4JStringTable *pStringTable=nullptr, WCHAR *pwchFormatString=nullptr,DWORD dwFocusButton=0);
|
||||
|
||||
|
||||
C4JStorage::EMessageResult GetMessageBoxResult();
|
||||
|
||||
// save device
|
||||
bool SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice=false);
|
||||
|
||||
// savegame
|
||||
void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID);
|
||||
void ResetSaveData(); // Call before a new save to clear out stored save file name
|
||||
void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName);
|
||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||
bool GetSaveUniqueNumber(INT *piVal);
|
||||
bool GetSaveUniqueFilename(char *pszName);
|
||||
void SetSaveUniqueFilename(char *szFilename);
|
||||
void SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam);
|
||||
void SetSaveDisabled(bool bDisable);
|
||||
bool GetSaveDisabled(void);
|
||||
unsigned int GetSaveSize();
|
||||
void GetSaveData(void *pvData,unsigned int *puiBytes);
|
||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
||||
void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png
|
||||
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam);
|
||||
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam);
|
||||
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
|
||||
bool GetSaveDeviceSelected(unsigned int iPad);
|
||||
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists);
|
||||
bool EnoughSpaceForAMinSaveGame();
|
||||
|
||||
void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed
|
||||
// Get the info for the saves
|
||||
C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName);
|
||||
PSAVE_DETAILS ReturnSavesInfo();
|
||||
void ClearSavesInfo(); // Clears results
|
||||
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); // Get the thumbnail for an individual save referenced by pSaveInfo
|
||||
|
||||
void GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData);
|
||||
void GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes);
|
||||
|
||||
// Load the save. Need to call GetSaveData once the callback is called
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam);
|
||||
|
||||
// DLC
|
||||
void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam );
|
||||
void SetDLCPackageRoot(char *pszDLCRoot);
|
||||
C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||
DWORD CancelGetDLCOffers();
|
||||
void ClearDLCOffers();
|
||||
XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw);
|
||||
int GetOfferCount();
|
||||
DWORD InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false);
|
||||
DWORD GetAvailableDLCCount( int iPad);
|
||||
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
|
||||
XCONTENT_DATA& GetDLC(DWORD dw);
|
||||
DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive=nullptr);
|
||||
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = nullptr);
|
||||
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
|
||||
std::string GetMountedPath(std::string szMount);
|
||||
|
||||
// Global title storage
|
||||
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,
|
||||
WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int)=nullptr,LPVOID lpParam=nullptr, int iAction=0);
|
||||
bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize);
|
||||
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename);
|
||||
void StoreTMSPathName(WCHAR *pwchName=nullptr);
|
||||
|
||||
// TMS++
|
||||
#ifdef _XBOX
|
||||
C4JStorage::ETMSStatus WriteTMSFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,TMSCLIENT_CALLBACK Func,LPVOID lpParam);
|
||||
HRESULT GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam);
|
||||
#endif
|
||||
|
||||
// C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=nullptr,LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0);
|
||||
C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=nullptr,LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=nullptr,LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=nullptr, int iUserData=0);
|
||||
// bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename);
|
||||
// unsigned int CRC(unsigned char *buf, int len);
|
||||
|
||||
// enum eXBLWS
|
||||
// {
|
||||
// eXBLWS_GET,
|
||||
// eXBLWS_POST,
|
||||
// eXBLWS_PUT,
|
||||
// eXBLWS_DELETE,
|
||||
// };
|
||||
//bool XBLWS_Command(eXBLWS eCommand);
|
||||
|
||||
|
||||
unsigned int CRC(unsigned char *buf, int len);
|
||||
|
||||
// #ifdef _DEBUG
|
||||
// void SetSaveName(int i);
|
||||
// #endif
|
||||
// string table for all the Storage problems. Loaded by the application
|
||||
C4JStringTable *m_pStringTable;
|
||||
};
|
||||
|
||||
extern C4JStorage StorageManager;
|
||||
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1619,7 +1619,7 @@ RADDEFSTART
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
#define RR_CACHE_LINE_SIZE 32
|
||||
#elif defined(__RADXENON__)
|
||||
#define RR_BREAK() DEBUG_BREAK()
|
||||
#define RR_BREAK() __debugbreak()
|
||||
#define RR_CACHE_LINE_SIZE 128
|
||||
#elif defined(__RADANDROID__)
|
||||
#define RR_BREAK() __builtin_trap()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user