generated: add (generated, scripts)

This commit is contained in:
luk
2026-01-25 21:28:40 +00:00
parent 3bdfaf38b4
commit 70291d69f1
5238 changed files with 655591 additions and 25 deletions

47
scripts/decompile.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
# Decompile HytaleServer.jar and copy to generated/
# Run from project root
set -e
PATCHER_DIR="vendor/hytale-server/patcher"
GENERATED_DIR="vendor/hytale-server/generated"
if [ ! -d "$PATCHER_DIR" ]; then
echo "Error: patcher directory does not exist"
exit 1
fi
if [ ! -d "$PATCHER_DIR/venv" ]; then
echo "[decompile] Creating venv..."
python3 -m venv "$PATCHER_DIR/venv"
fi
echo "[decompile] Activating venv..."
source "$PATCHER_DIR/venv/bin/activate"
if [ -f "$PATCHER_DIR/requirements.txt" ]; then
echo "[decompile] Installing requirements..."
pip install -q -r "$PATCHER_DIR/requirements.txt"
fi
echo "[decompile] Setting up HYTALESERVER_JAR_PATH..."
export HYTALESERVER_JAR_PATH="$(pwd)/vendor/hytale-server/Server/HytaleServer.jar"
echo "[decompile] Cleaning previous work..."
rm -rf "$PATCHER_DIR/work"
rm -rf "$PATCHER_DIR/hytale-server"
echo "[decompile] Running patcher setup..."
cd "$PATCHER_DIR"
python run.py setup
echo "[decompile] Copying decompiled sources to generated/..."
cd -
rm -rf "$GENERATED_DIR"
cp -r "$PATCHER_DIR/work/decompile" "$GENERATED_DIR"
echo "[decompile] Removing fastutil..."
rm -rf "$GENERATED_DIR/com/hypixel/fastutil"
echo "[decompile] Done. Decompiled sources at: $GENERATED_DIR"

View File

@@ -1,23 +1,20 @@
#!/bin/bash
# Pull files from repo/hytale-server/src into vendor/hytale-server/src
# Pull files from generated/ into src/
# Only overrides files that exist in both locations
# Run from project root
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
HYTALE_SERVER_ROOT="$(dirname "$SCRIPT_DIR")"
PROJECT_ROOT="$(dirname "$(dirname "$HYTALE_SERVER_ROOT")")"
PATCHED_SRC="vendor/hytale-server/src"
GENERATED_SRC="vendor/hytale-server/generated"
SRC_DIR="$HYTALE_SERVER_ROOT/src"
REPO_SRC="$PROJECT_ROOT/repo/hytale-server/src"
if [ ! -d "$SRC_DIR" ]; then
echo "Error: src does not exist"
if [ ! -d "$PATCHED_SRC" ]; then
echo "Error: vendor/hytale-server/src does not exist"
exit 1
fi
if [ ! -d "$REPO_SRC" ]; then
echo "Error: repo/hytale-server/src does not exist"
if [ ! -d "$GENERATED_SRC" ]; then
echo "Error: vendor/hytale-server/generated does not exist"
exit 1
fi
@@ -25,18 +22,18 @@ count=0
# Find all files in src
while IFS= read -r -d '' file; do
# Get relative path from SRC_DIR
rel_path="${file#$SRC_DIR/}"
# Get relative path from PATCHED_SRC
rel_path="${file#$PATCHED_SRC/}"
# Check if corresponding file exists in repo
repo_file="$REPO_SRC/$rel_path"
# Check if corresponding file exists in generated
generated_file="$GENERATED_SRC/$rel_path"
if [ -f "$repo_file" ]; then
cp "$repo_file" "$file"
if [ -f "$generated_file" ]; then
cp "$generated_file" "$file"
echo "Updated: $rel_path"
count=$((count + 1))
fi
done < <(find "$SRC_DIR" -type f -print0)
done < <(find "$PATCHED_SRC" -type f -print0)
echo ""
echo "Done. Updated $count file(s)."

View File

@@ -1,11 +1,8 @@
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
HYTALE_SERVER_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
PROJECT_ROOT="$(cd "$HYTALE_SERVER_ROOT/../.." && pwd)"
DOWNLOADER="$SCRIPT_DIR/hytale-downloader-linux-amd64"
OUTPUT_DIR="$HYTALE_SERVER_ROOT"
DOWNLOADER="vendor/hytale-server/scripts/hytale-downloader-linux-amd64"
OUTPUT_DIR="vendor/hytale-server"
if [ ! -f "$DOWNLOADER" ]; then
echo "Error: Downloader not found at $DOWNLOADER"
@@ -16,7 +13,6 @@ echo "[update-server] Creating output directory..."
mkdir -p "$OUTPUT_DIR"
echo "[update-server] Downloading Hytale server files..."
cd "$SCRIPT_DIR"
"$DOWNLOADER" -download-path "$OUTPUT_DIR/game.zip"
echo "[update-server] Extracting server files..."