45 lines
1.5 KiB
Batchfile
45 lines
1.5 KiB
Batchfile
@echo off
|
|
title Hytale Launcher
|
|
|
|
:player_name
|
|
REM Ask user for their name. Jump here in case needed in future,
|
|
set /p PLAYER_NAME="Set a name: "
|
|
|
|
:uuid8
|
|
REM Ask user for 8 numbers, used to set the final 8 digits of the uuid.
|
|
REM That way on offline mode server(s) there shouldn't be any issues with conflicting users/uuids.
|
|
echo Note, less than 8 will make the game fail to start.
|
|
set /p PLAYER_UUID8="Pick 8 random numbers: "
|
|
set PLAYER_UUID8=%PLAYER_UUID8:~0,8%
|
|
|
|
REM Making sure the user inputs numbers not letters. Game will not launch otherwise.
|
|
setlocal enabledelayedexpansion
|
|
for /f "delims=0123456789" %%a in ("!PLAYER_UUID8!") do set "PLAYER_UUID8="
|
|
endlocal & set "PLAYER_UUID8=%PLAYER_UUID8%"
|
|
|
|
if not defined PLAYER_UUID8 (
|
|
echo Numbers only, must be 8 total.
|
|
goto uuid8
|
|
)
|
|
|
|
REM Set Hytale directory to current folder
|
|
set "HYTALE_DIR=%~dp0"
|
|
|
|
REM Remove trailing backslash if present
|
|
if "%HYTALE_DIR:~-1%"=="\" set "HYTALE_DIR=%HYTALE_DIR:~0,-1%"
|
|
|
|
REM Create UserData folder if missing
|
|
if not exist "%HYTALE_DIR%\UserData" mkdir "%HYTALE_DIR%\UserData"
|
|
start "" "%HYTALE_DIR%\install\release\package\game\latest\Client\HytaleClient.exe" ^
|
|
--app-dir "%HYTALE_DIR%\install\release\package\game\latest" ^
|
|
--user-dir "%HYTALE_DIR%\UserData" ^
|
|
--java-exec "%HYTALE_DIR%\install\release\package\jre\latest\bin\java.exe" ^
|
|
--auth-mode offline ^
|
|
--uuid 13371337-1337-1337-1337-1337%PLAYER_UUID8% ^
|
|
--name "%PLAYER_NAME%"
|
|
|
|
REM Pause script and inform user game is starting.
|
|
echo Hytale starting...
|
|
echo %PLAYER_UUID8%
|
|
pause
|