This commit is contained in:
TheBrokenRail 2025-02-26 01:03:13 -05:00
parent 0be1f4fce8
commit ac86dc36cf
6 changed files with 82 additions and 45 deletions

View File

@ -32,7 +32,7 @@ jobs:
# Dependencies
- name: Install CMake
run: |
echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
echo 'deb http://archive.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
apt-get update
apt-get install --no-install-recommends -y -t buster-backports cmake
- name: Install Dependencies
@ -64,7 +64,7 @@ jobs:
# Dependencies
- name: Install CMake
run: |
echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
echo 'deb http://archive.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
apt-get update
apt-get install --no-install-recommends -y -t buster-backports cmake
- name: Install Dependencies
@ -83,6 +83,10 @@ jobs:
runs-on: ubuntu-latest
container: node:16-buster
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: false
# Dependencies
- name: Install Go
uses: actions/setup-go@v4
@ -93,11 +97,15 @@ jobs:
uses: actions/download-artifact@v3
with:
path: out
# Get Changelog
- name: Get Changelog
id: release-info
run: ./scripts/get-changelog.mjs >> "${GITHUB_OUTPUT}"
# Create Release
- name: Create Release
uses: https://gitea.com/actions/release-action@main
with:
files: ./out
files: ./out
api_key: ${{ secrets.RELEASE_TOKEN }}
title: v${{ github.ref_name }}
body: "[View Changelog](https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/src/branch/master/docs/CHANGELOG.md)"
title: v${{ steps.release-info.outputs.version }}
body: ${{ steps.release-info.outputs.changelog }}

View File

@ -1 +1 @@
2.5.3
2.5.4

View File

@ -1,5 +1,8 @@
# Changelog
**2.5.4**
* Use Base64-URL Encoding When Accessing The Skin Server
**2.5.3**
* Add ``Replace Block Highlight With Outline`` Feature Flag (Enabled By Default)
* By Default, The Outline Width Is Set Using The GUI Scale

View File

@ -56,7 +56,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
" <p>Minecraft: Pi Edition Modding Project.</p>\n"
" <p>NOTE: This is not verified by, affiliated with, or supported by Mojang or Microsoft.</p>\n"
" </description>\n"
" <url type=\"homepage\">https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn</url>\n"
" <url type=\"homepage\">https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn</url>\n"
" <launchable type=\"desktop-id\">${MCPI_APP_ID}.desktop</launchable>\n"
" <provides>\n"
" <id>com.thebrokenrail.MCPIRebornClient.desktop</id>\n"
@ -93,7 +93,7 @@ if(NOT MCPI_HEADLESS_MODE)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/appstream.xml"
" <screenshots>\n"
" <screenshot type=\"default\">\n"
" <image>https://gitea.thebrokenrail.com/TheBrokenRail/minecraft-pi-reborn/raw/branch/master/images/start.png</image>\n"
" <image>https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/raw/branch/master/images/start.png</image>\n"
" </screenshot>\n"
" </screenshots>\n"
)

View File

@ -1,3 +1,6 @@
#include <string>
#include <vector>
#include <libreborn/libreborn.h>
#include <symbols/minecraft.h>
@ -5,45 +8,32 @@
#include <mods/feature/feature.h>
#include "skin-internal.h"
// Base64 Encode (https://gist.github.com/tomykaira/f0fd86b6c73063283afe550bc5d77594)
static std::string base64_encode(const std::string data) {
static constexpr char encoding_table[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/'
};
size_t in_len = data.size();
size_t out_len = 4 * ((in_len + 2) / 3);
std::string ret(out_len, '\0');
size_t i;
char *p = const_cast<char*>(ret.c_str());
for (i = 0; i < in_len - 2; i += 3) {
*p++ = encoding_table[(data[i] >> 2) & 0x3f];
*p++ = encoding_table[((data[i] & 0x3) << 4) | ((int) (data[i + 1] & 0xf0) >> 4)];
*p++ = encoding_table[((data[i + 1] & 0xf) << 2) | ((int) (data[i + 2] & 0xc0) >> 6)];
*p++ = encoding_table[data[i + 2] & 0x3f];
}
if (i < in_len) {
*p++ = encoding_table[(data[i] >> 2) & 0x3f];
if (i == (in_len - 1)) {
*p++ = encoding_table[((data[i] & 0x3) << 4)];
*p++ = '=';
// Base64-URL Encode/Decode (https://stackoverflow.com/a/57314480)
static constexpr char base64_url_alphabet[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'
};
static std::string base64_encode(const std::string &data) {
std::string out;
int val = 0;
int valb = -6;
const size_t len = data.length();
for (unsigned int i = 0; i < len; i++) {
const unsigned char c = data[i];
val = (val << 8) + c;
valb += 8;
while (valb >= 0) {
out.push_back(base64_url_alphabet[(val >> valb) & 0x3f]);
valb -= 6;
}
else {
*p++ = encoding_table[((data[i] & 0x3) << 4) | ((int) (data[i + 1] & 0xf0) >> 4)];
*p++ = encoding_table[((data[i + 1] & 0xf) << 2)];
}
*p++ = '=';
}
return ret;
if (valb > -6) {
out.push_back(base64_url_alphabet[((val << 8) >> (valb + 8)) & 0x3f]);
}
return out;
}
// Change Texture For Player Entities

36
scripts/get-changelog.mjs Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env node
import * as path from 'node:path';
import * as fs from 'node:fs';
// Read Files
function readFile(...args) {
return fs.readFileSync(path.join(...args), 'utf8').trim();
}
const version = readFile('VERSION');
const changelog = readFile('docs', 'CHANGELOG.md');
// Print Version
console.log('version=' + version);
// Parse Changelog
const out = [];
let foundStart = false;
const lines = changelog.split('\n');
for (const line of lines) {
if (!foundStart) {
// Found Start Of Version Info
foundStart = line.includes(`**${version}**`);
} else if (line.trim().length === 0) {
// Found End
break;
} else {
// Found Entry
out.push(line);
}
}
// Print
const delimiter = 'CHANGELOG_EOF';
console.log('changelog<<' + delimiter);
console.log(out.join('\n'));
console.log(delimiter);