aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml50
-rw-r--r--.github/workflows/codeql.yml35
-rw-r--r--.github/workflows/trigger_builds.yml1
-rw-r--r--.github/workflows/trigger_release.yml1
-rw-r--r--CMakeLists.txt3
-rw-r--r--README.md8
-rw-r--r--flatpak/org.prismlauncher.PrismLauncher.yml83
-rw-r--r--flatpak/prime-run4
-rw-r--r--flatpak/prismlauncher11
-rw-r--r--launcher/Application.cpp2
-rw-r--r--launcher/BaseInstance.h2
-rw-r--r--launcher/BaseVersionList.cpp4
-rw-r--r--launcher/VersionProxyModel.cpp4
-rw-r--r--launcher/icons/IconList.cpp4
-rw-r--r--launcher/meta/Index.cpp4
-rw-r--r--launcher/meta/JsonFormat.h5
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp35
-rw-r--r--launcher/minecraft/MinecraftInstance.h4
-rw-r--r--launcher/minecraft/MojangVersionFormat.cpp17
-rw-r--r--launcher/minecraft/OneSixVersionFormat.cpp29
-rw-r--r--launcher/minecraft/PackProfile.cpp6
-rw-r--r--launcher/minecraft/Rule.h2
-rw-r--r--launcher/minecraft/WorldList.cpp6
-rw-r--r--launcher/minecraft/WorldList.h2
-rw-r--r--launcher/minecraft/auth/AccountList.cpp10
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp2
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.cpp2
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.h6
-rw-r--r--launcher/minecraft/mod/ResourcePackFolderModel.cpp2
-rw-r--r--launcher/minecraft/mod/tasks/LocalModParseTask.cpp2
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp7
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp11
-rw-r--r--launcher/net/HttpMetaCache.cpp72
-rw-r--r--launcher/net/HttpMetaCache.h58
-rw-r--r--launcher/translations/TranslationsModel.cpp9
-rw-r--r--launcher/ui/MainWindow.cpp98
-rw-r--r--launcher/ui/MainWindow.h6
-rw-r--r--launcher/ui/dialogs/BlockedModsDialog.cpp195
-rw-r--r--launcher/ui/dialogs/BlockedModsDialog.h19
-rw-r--r--launcher/ui/dialogs/BlockedModsDialog.ui67
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.ui6
-rw-r--r--launcher/ui/pages/instance/ServersPage.cpp4
-rw-r--r--launcher/ui/pages/instance/VersionPage.ui6
-rw-r--r--launcher/ui/pages/modplatform/ModModel.h8
-rw-r--r--launcher/ui/pages/modplatform/ModPage.cpp4
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlListModel.cpp4
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp4
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModel.cpp4
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbListModel.cpp4
-rw-r--r--launcher/ui/pages/modplatform/legacy_ftb/ListModel.cpp4
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.h6
-rw-r--r--launcher/ui/pages/modplatform/technic/TechnicModel.cpp8
-rw-r--r--libraries/README.md68
-rw-r--r--libraries/launcher/.gitignore1
-rw-r--r--libraries/launcher/CMakeLists.txt15
-rw-r--r--libraries/launcher/net/minecraft/Launcher.java181
-rw-r--r--libraries/launcher/org/prismlauncher/EntryPoint.java160
-rw-r--r--libraries/launcher/org/prismlauncher/Launcher.java23
-rw-r--r--libraries/launcher/org/prismlauncher/applet/LegacyFrame.java163
-rw-r--r--libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java45
-rw-r--r--libraries/launcher/org/prismlauncher/exception/ParseException.java47
-rw-r--r--libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java190
-rw-r--r--libraries/launcher/org/prismlauncher/launcher/Launcher.java44
-rw-r--r--libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java110
-rw-r--r--libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java91
-rw-r--r--libraries/launcher/org/prismlauncher/launcher/impl/legacy/LegacyFrame.java190
-rw-r--r--libraries/launcher/org/prismlauncher/launcher/impl/legacy/LegacyLauncher.java126
-rw-r--r--libraries/launcher/org/prismlauncher/utils/Parameters.java84
-rw-r--r--libraries/launcher/org/prismlauncher/utils/ReflectionUtils.java154
-rw-r--r--libraries/launcher/org/prismlauncher/utils/Utils.java49
-rw-r--r--libraries/launcher/org/prismlauncher/utils/logging/Level.java (renamed from libraries/launcher/org/prismlauncher/LauncherFactory.java)57
-rw-r--r--libraries/launcher/org/prismlauncher/utils/logging/Log.java104
m---------libraries/tomlplusplus0
73 files changed, 1901 insertions, 951 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3225cf1e..c0e5b50a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,6 +7,10 @@ on:
description: Type of build (Debug, Release, RelWithDebInfo, MinSizeRel)
type: string
default: Debug
+ is_qt_cached:
+ description: Enable Qt caching or not
+ type: string
+ default: true
secrets:
SPARKLE_ED25519_KEY:
description: Private key for signing Sparkle updates
@@ -60,7 +64,7 @@ jobs:
qt_ver: 6
qt_host: windows
qt_arch: ''
- qt_version: '6.4.0'
+ qt_version: '6.4.1'
qt_modules: 'qt5compat qtimageformats'
qt_tools: ''
@@ -102,14 +106,6 @@ jobs:
with:
submodules: 'true'
- - name: Initialize CodeQL
- if: runner.os == 'Linux' && matrix.qt_ver == 6
- uses: github/codeql-action/init@v2
- with:
- config-file: ./.github/codeql/codeql-config.yml
- queries: security-and-quality
- languages: cpp, java
-
- name: 'Setup MSYS2'
if: runner.os == 'Windows' && matrix.msystem != ''
uses: msys2/setup-msys2@v2
@@ -200,8 +196,7 @@ jobs:
arch: ${{ matrix.qt_arch }}
modules: ${{ matrix.qt_modules }}
tools: ${{ matrix.qt_tools }}
- cache: true
- cache-key-prefix: ${{ matrix.qt_host }}-${{ matrix.qt_version }}-"${{ matrix.qt_modules }}"-qt_cache
+ cache: ${{ inputs.is_qt_cached }}
- name: Prepare AppImage (Linux)
if: runner.os == 'Linux' && matrix.qt_ver != 5
@@ -293,14 +288,6 @@ jobs:
ctest -E "^example64|example$" --test-dir build --output-on-failure -C ${{ inputs.build_type }}
##
- # CODE SCAN
- ##
-
- - name: Perform CodeQL Analysis
- if: runner.os == 'Linux' && matrix.qt_ver == 6
- uses: github/codeql-action/analyze@v2
-
- ##
# PACKAGE BUILDS
##
@@ -500,21 +487,42 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
+ if: inputs.build_type == 'Debug'
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set short version
shell: bash
+ if: inputs.build_type == 'Debug'
run: |
ver_short=`git rev-parse --short HEAD`
echo "VERSION=$ver_short" >> $GITHUB_ENV
- name: Package Snap (Linux)
id: snapcraft
- if: runner.os == 'Linux' && matrix.qt_ver != 5
+ if: inputs.build_type == 'Debug'
uses: snapcore/action-build@v1
- name: Upload Snap (Linux)
- if: runner.os == 'Linux' && matrix.qt_ver != 5
+ if: inputs.build_type == 'Debug'
uses: actions/upload-artifact@v3
with:
name: prismlauncher_${{ env.VERSION }}_amd64.snap
path: ${{ steps.snapcraft.outputs.snap }}
+
+ flatpak:
+ runs-on: ubuntu-latest
+ container:
+ image: bilelmoussaoui/flatpak-github-actions:kde-5.15-22.08
+ options: --privileged
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ if: inputs.build_type == 'Debug'
+ with:
+ submodules: 'true'
+ - name: Build Flatpak (Linux)
+ if: inputs.build_type == 'Debug'
+ uses: flatpak/flatpak-github-actions/flatpak-builder@v4
+ with:
+ bundle: "Prism Launcher.flatpak"
+ manifest-path: flatpak/org.prismlauncher.PrismLauncher.yml
+ cache-key: flatpak-${{ github.sha }}-x86_64
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 00000000..0cd1f6e4
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,35 @@
+name: "CodeQL Code Scanning"
+
+on: [ push, pull_request, workflow_dispatch ]
+
+jobs:
+ CodeQL:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ with:
+ submodules: 'true'
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ config-file: ./.github/codeql/codeql-config.yml
+ queries: security-and-quality
+ languages: cpp, java
+
+ - name: Install Dependencies
+ run:
+ sudo apt-get -y update
+
+ sudo apt-get -y install ninja-build extra-cmake-modules scdoc qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5
+
+ - name: Configure and Build
+ run: |
+ cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr -DLauncher_QT_VERSION_MAJOR=5 -G Ninja
+
+ cmake --build build
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/trigger_builds.yml b/.github/workflows/trigger_builds.yml
index 8adaa5e5..44751fbc 100644
--- a/.github/workflows/trigger_builds.yml
+++ b/.github/workflows/trigger_builds.yml
@@ -30,5 +30,6 @@ jobs:
uses: ./.github/workflows/build.yml
with:
build_type: Debug
+ is_qt_cached: true
secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}
diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml
index d415b2b1..8baa9693 100644
--- a/.github/workflows/trigger_release.yml
+++ b/.github/workflows/trigger_release.yml
@@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/build.yml
with:
build_type: Release
+ is_qt_cached: false
secrets:
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0db05f98..8fc0d326 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_DISABLE_DEPRECATED_BEFORE=0x050C00")
+# Fix aarch64 build for toml++
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTOML_ENABLE_FLOAT16=0")
+
# set CXXFLAGS for build targets
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS_RELEASE}")
diff --git a/README.md b/README.md
index f8ea2e84..f02b5695 100644
--- a/README.md
+++ b/README.md
@@ -29,19 +29,19 @@ Prebuilt Development builds are provided for **Linux**, **Windows** and **macOS*
For **Arch**, **Debian**, **Fedora**, **OpenSUSE (Tumbleweed)** and **Gentoo**, respectively, you can use these packages for the latest development versions:
-[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-1793D1?style=flat-square&logo=archlinux&logoColor=white)](https://aur.archlinux.org/packages/prismlauncher-qt5-git/) [![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--qt5--git-1793D1?style=flat-square&logo=archlinux&logoColor=white)](https://aur.archlinux.org/packages/prismlauncher-git/) [![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-A80030?style=flat-square&logo=debian&logoColor=white)](https://mpr.makedeb.org/packages/prismlauncher-git) [![prismlauncher-nightly](https://img.shields.io/badge/copr-prismlauncher--nightly-51A2DA?style=flat-square&logo=fedora&logoColor=white)](https://copr.fedorainfracloud.org/coprs/g3tchoo/prismlauncher/) [![prismlauncher-nightly](https://img.shields.io/badge/OBS-prismlauncher--nightly-3AB6A9?style=flat-square&logo=opensuse&logoColor=white)](https://build.opensuse.org/project/show/home:getchoo) [![prismlauncher-9999](https://img.shields.io/badge/gentoo-prismlauncher--9999-4D4270?style=flat-square&logo=gentoo&logoColor=white)](https://packages.gentoo.org/packages/games-action/prismlauncher)
+[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-1793D1?style=flat-square&logo=archlinux&logoColor=white)](https://aur.archlinux.org/packages/prismlauncher-git/) [![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--qt5--git-1793D1?style=flat-square&logo=archlinux&logoColor=white)](https://aur.archlinux.org/packages/prismlauncher-qt5-git/) [![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-A80030?style=flat-square&logo=debian&logoColor=white)](https://mpr.makedeb.org/packages/prismlauncher-git) [![prismlauncher-nightly](https://img.shields.io/badge/copr-prismlauncher--nightly-51A2DA?style=flat-square&logo=fedora&logoColor=white)](https://copr.fedorainfracloud.org/coprs/g3tchoo/prismlauncher/) [![prismlauncher-nightly](https://img.shields.io/badge/OBS-prismlauncher--nightly-3AB6A9?style=flat-square&logo=opensuse&logoColor=white)](https://build.opensuse.org/project/show/home:getchoo) [![prismlauncher-9999](https://img.shields.io/badge/gentoo-prismlauncher--9999-4D4270?style=flat-square&logo=gentoo&logoColor=white)](https://packages.gentoo.org/packages/games-action/prismlauncher)
## Community & Support
-Feel free to create a GitHub issue if you find a bug or want to suggest a new feature. We have multiple communities that can also help you.
+Feel free to create a GitHub issue if you find a bug or want to suggest a new feature. We have multiple community spaces where other community members can help you.
#### Join our Discord server:
[![Prism Launcher Discord server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner2)](https://discord.gg/prismlauncher)
-#### Join our Matrix space (Will be opened at a later date):
+#### Join our Matrix space:
[![PrismLauncher Space](https://img.shields.io/matrix/prismlauncher:matrix.org?style=for-the-badge&logo=matrix)](https://matrix.to/#/#prismlauncher:matrix.org)
-#### Join our SubReddit:
+#### Join our Subreddit:
[![r/PrismLauncher](https://img.shields.io/reddit/subreddit-subscribers/prismlauncher?style=for-the-badge&logo=reddit)](https://www.reddit.com/r/PrismLauncher/)
## Building
diff --git a/flatpak/org.prismlauncher.PrismLauncher.yml b/flatpak/org.prismlauncher.PrismLauncher.yml
new file mode 100644
index 00000000..fca306d7
--- /dev/null
+++ b/flatpak/org.prismlauncher.PrismLauncher.yml
@@ -0,0 +1,83 @@
+id: org.prismlauncher.PrismLauncher
+runtime: org.kde.Platform
+runtime-version: "5.15-22.08"
+sdk: org.kde.Sdk
+sdk-extensions:
+ - org.freedesktop.Sdk.Extension.openjdk17
+ - org.freedesktop.Sdk.Extension.openjdk8
+add-extensions:
+ com.valvesoftware.Steam.Utility.gamescope:
+ version: stable
+ add-ld-path: lib
+ no-autodownload: true
+ autodelete: false
+ directory: utils/gamescope
+
+command: prismlauncher
+finish-args:
+ - --share=ipc
+ - --socket=x11
+ - --socket=wayland
+ - --device=all
+ - --share=network
+ - --socket=pulseaudio
+ # for Discord RPC mods
+ - --filesystem=xdg-run/app/com.discordapp.Discord:create
+ # Mod drag&drop
+ - --filesystem=xdg-download:ro
+
+modules:
+ - name: prismlauncher
+ buildsystem: cmake-ninja
+ config-opts:
+ - -DLauncher_BUILD_PLATFORM=flatpak
+ - -DCMAKE_BUILD_TYPE=Debug
+ build-options:
+ env:
+ JAVA_HOME: /usr/lib/sdk/openjdk17/jvm/openjdk-17
+ JAVA_COMPILER: /usr/lib/sdk/openjdk17/jvm/openjdk-17/bin/javac
+ sources:
+ - type: dir
+ path: ../
+ - name: openjdk
+ buildsystem: simple
+ build-commands:
+ - mkdir -p /app/jdk/
+ - /usr/lib/sdk/openjdk17/install.sh
+ - mv /app/jre /app/jdk/17
+ - /usr/lib/sdk/openjdk8/install.sh
+ - mv /app/jre /app/jdk/8
+ cleanup: [/jre]
+ - name: xrandr
+ buildsystem: autotools
+ sources:
+ - type: archive
+ url: https://xorg.freedesktop.org/archive/individual/app/xrandr-1.5.1.tar.xz
+ sha256: 7bc76daf9d72f8aff885efad04ce06b90488a1a169d118dea8a2b661832e8762
+ cleanup: [/share/man, /bin/xkeystone]
+ - name: gamemode
+ buildsystem: meson
+ config-opts:
+ - -Dwith-sd-bus-provider=no-daemon
+ - -Dwith-examples=false
+ post-install:
+ # gamemoderun is installed for users who want to use wrapper commands
+ # post-install is running inside the build dir, we need it from the source though
+ - install -Dm755 ../data/gamemoderun -t /app/bin
+ sources:
+ - type: git
+ url: https://github.com/FeralInteractive/gamemode
+ tag: "1.7"
+ commit: 4dc99dff76218718763a6b07fc1900fa6d1dafd9
+ - name: enhance
+ buildsystem: simple
+ build-commands:
+ - mkdir -p /app/utils/gamescope
+ - install -Dm755 prime-run /app/bin/prime-run
+ - mv /app/bin/prismlauncher /app/bin/prismrun
+ - install -Dm755 prismlauncher /app/bin/prismlauncher
+ sources:
+ - type: file
+ path: ../flatpak/prime-run
+ - type: file
+ path: ../flatpak/prismlauncher
diff --git a/flatpak/prime-run b/flatpak/prime-run
new file mode 100644
index 00000000..946c28dd
--- /dev/null
+++ b/flatpak/prime-run
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+export __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia
+exec "$@"
diff --git a/flatpak/prismlauncher b/flatpak/prismlauncher
new file mode 100644
index 00000000..bb876711
--- /dev/null
+++ b/flatpak/prismlauncher
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# discord RPC
+for i in {0..9}; do
+ test -S "$XDG_RUNTIME_DIR"/discord-ipc-"$i" || ln -sf {app/com.discordapp.Discord,"$XDG_RUNTIME_DIR"}/discord-ipc-"$i";
+done
+
+export PATH="${PATH}${PATH:+:}/app/utils/gamescope/bin:/usr/lib/extensions/vulkan/MangoHud/bin"
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}/usr/lib/extensions/vulkan/MangoHud/\$LIB/"
+
+exec /app/bin/prismrun "$@"
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 537e3903..ea8d2326 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -233,7 +233,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
setOrganizationDomain(BuildConfig.LAUNCHER_DOMAIN);
setApplicationName(BuildConfig.LAUNCHER_NAME);
setApplicationDisplayName(QString("%1 %2").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString()));
- setApplicationVersion(BuildConfig.printableVersionString());
+ setApplicationVersion(BuildConfig.printableVersionString() + "\n" + BuildConfig.GIT_COMMIT);
setDesktopFileName(BuildConfig.LAUNCHER_DESKTOPFILENAME);
startTime = QDateTime::currentDateTime();
diff --git a/launcher/BaseInstance.h b/launcher/BaseInstance.h
index 307240e0..a2a4f824 100644
--- a/