Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuOfficial committed Jun 7, 2024
1 parent a99835f commit e2c52f2
Show file tree
Hide file tree
Showing 157 changed files with 25,168 additions and 13,056 deletions.
56 changes: 12 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,29 @@
name: betacraft-build
name: Build

on:
push:
branches: [ "v2" ]
branches: [ "v2-cpp" ]
pull_request:
branches: [ "v2" ]
branches: [ "v2-cpp" ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ubuntu-latest

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive

- uses: lukka/get-cmake@latest

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/[email protected]
- uses: actions/checkout@v4
with:
vcpkgDirectory: '${{github.workspace}}/lib/vcpkg'
submodules: recursive

- if: ${{ (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest') }}
name: Install Qt (ubuntu-latest || macos-latest)
uses: jurplel/install-qt-action@v3
with:
version: '6.5.1'
cache: 'true'
cache-key-prefix: 'install-qt-action'
set-env: 'true'

- if: matrix.os == 'windows-latest'
name: Install Qt (windows-latest)
uses: jurplel/install-qt-action@v3
with:
version: '6.5.1'
cache: 'true'
cache-key-prefix: 'install-qt-action'
set-env: 'true'
arch: 'win64_mingw'
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Run CMake consuming CMakePresets.json and vcpkg.json by mean of vcpkg.
uses: lukka/run-cmake@v10
with:
configurePreset: 'betacraft'
buildPreset: 'betacraft'
buildPresetAdditionalArgs: "['--config Release']"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build/betacraft
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
13 changes: 1 addition & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
.idea
.vs
.vscode
out
build
relbuild
.cache/

build/
.DS_Store
CMakeSettings.json
CMakeLists.txt.user
compile_commands.json

src/core/Constants.h
14 changes: 4 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
[submodule "lib/json-c"]
path = lib/json-c
url = https://github.com/json-c/json-c.git
[submodule "lib/libarchive"]
path = lib/libarchive
url = https://github.com/libarchive/libarchive.git
[submodule "lib/cpr"]
path = lib/cpr
[submodule "externals/cpr"]
path = externals/cpr
url = https://github.com/libcpr/cpr.git
branch = 1.9.x
[submodule "lib/gtest"]
path = lib/gtest
[submodule "externals/googletest"]
path = externals/googletest
url = https://github.com/google/googletest.git
49 changes: 0 additions & 49 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,49 +0,0 @@
<b style="color: #aaaaff;"><u>Betacraft v2.0.0-alpha.20230623</u></b>

- Authentication tokens are now refreshed properly
- Sensitive data no longer writes to game log and launcher log
- Launcher log now clears with every run
- Version jsons now re-download every launch (except for custom ones)
- Thanks to our translators, added Estonian and Russian
- Fixed joining online mode servers
- Fixed German language not loading (invalid json)
- No longer references undefined loadmap_x pointers (possibly caused unexpected behavior)

<b style="color: #aaaaff;"><u>Betacraft v2.0.0-alpha.20230604</u></b>

- Added a robust version picker to Add Instance
- Added Server tab to Edit Instance
- Fixed sound on Linux
- Added Offline Mode
- Allow dots in instance names
- Fixed server list bugs
- Upgrade to Qt 6.5.1
- Fixed game assets being put in the wrong location on Windows
- Donate button now links to the launcher's Patreon page
- Thanks to our translators, added German, Italian, Hungarian, Simplified Chinese, Traditional Chinese, and Brazilian Portuguese
- Translators are now listed in the About section
- Improved progress bar
- Fixed memory leaks

<b style="color: #aaaaff;"><u>Betacraft v2.0.0-alpha.20230520</u></b>

- Changed theme to Qt's 'fusion'
- Added server list
- Added a proper changelog
- Added update notifications
- Added a tarball release alongside the Debian package
- Fixed Discord RPC being enabled after toggling it off in settings
- Fixed play button being unusuable after clicking on an instance group
- Fixed memory leaks
- Fixed running with too many libraries
- Fixed demo mode not triggering before 1.13
- Added additional logging

- Replaced libzip and libtar libraries with libarchive
- Upgraded the project to use Qt 6.5.0
- Running the Linux build doesn't require *sudo* anymore
- Changed the working directory on Linux to ~/.local/share/betacraft

<b style="color: #aaaaff;"><u>Betacraft v2.0.0-alpha.20230501</u></b>

- Everything
63 changes: 7 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,62 +1,13 @@
cmake_minimum_required(VERSION 3.12)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_BUILD_TYPE "Release")

if(APPLE)
set(CMAKE_APPLE_SILICON_PROCESSOR "arm64")

message(STATUS "${CMAKE_APPLE_SILICON_PROCESSOR}")

if(CMAKE_APPLE_SILICON_PROCESSOR STREQUAL "arm64")
set(CMAKE_OSX_ARCHITECTURES "arm64")
file(COPY ${CMAKE_SOURCE_DIR}/lib/discord_game_sdk/aarch64/discord_game_sdk.dylib
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src/ui/)
elseif(CMAKE_APPLE_SILICON_PROCESSOR STREQUAL "x86_64")
set(CMAKE_OSX_ARCHITECTURES "x86_64")
file(COPY ${CMAKE_SOURCE_DIR}/lib/discord_game_sdk/x86_64/discord_game_sdk.dylib
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src/ui/)
endif()
elseif (WIN32)
file(COPY ${CMAKE_SOURCE_DIR}/lib/discord_game_sdk/x86_64/discord_game_sdk.dll
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src/ui/)
elseif (UNIX AND NOT APPLE) # Linux
file(COPY ${CMAKE_SOURCE_DIR}/lib/discord_game_sdk/x86_64/discord_game_sdk.so
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src/ui/)
cmake_minimum_required(VERSION 3.8)

if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/release)
endif()
endif()
project(BetacraftLauncher LANGUAGES CXX)

project(Betacraft)

if (NOT DEFINED ENV{BETACRAFT_API_MICROSOFT_CLIENT_ID})
set(API_MICROSOFT_CLIENT_ID "")
else()
set(API_MICROSOFT_CLIENT_ID $ENV{BETACRAFT_API_MICROSOFT_CLIENT_ID})
endif()

if (NOT DEFINED ENV{BETACRAFT_DISCORD_CLIENT_ID})
set(DISCORD_CLIENT_ID 0)
else()
set(DISCORD_CLIENT_ID $ENV{BETACRAFT_DISCORD_CLIENT_ID})
endif()

add_compile_definitions(API_MICROSOFT_CLIENT_ID="${API_MICROSOFT_CLIENT_ID}")
add_compile_definitions(DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID})

include(CTest)
include(FetchContent)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)
enable_testing()

add_subdirectory(lib/json-c)
add_subdirectory(lib/cpr)
add_subdirectory(lib/libarchive)
add_subdirectory(lib/gtest)
add_subdirectory(externals/googletest)
add_subdirectory(externals/cpr)

add_subdirectory(src)
137 changes: 0 additions & 137 deletions COPYING.md

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -672,3 +672,4 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Betacraft
# Betacraft Launcher

[Website](https://betacraft.uk/) | [Discord](https://discord.gg/d4WvXeQ)

Expand Down Expand Up @@ -26,3 +26,4 @@ Betacraft requires [CMake](https://cmake.org/). Many libraries are bundled with
2. Copy contents of English.json to the newly created file and translate the content
3. Add the path to your translation to `src/ui/assets.qrc`
4. Make a pull request

Binary file removed assets/betacraft.aps
Binary file not shown.
7 changes: 0 additions & 7 deletions assets/betacraft.desktop

This file was deleted.

Binary file removed assets/betacraft.icns
Binary file not shown.
Binary file removed assets/betacraft.o
Binary file not shown.
Binary file removed assets/betacraft.png
Binary file not shown.
1 change: 0 additions & 1 deletion assets/betacraft.rc

This file was deleted.

Binary file removed assets/dirt.png
Binary file not shown.
Binary file removed assets/favicon.ico
Binary file not shown.
Loading

0 comments on commit e2c52f2

Please sign in to comment.