diff --git a/Doc/updater.md b/Doc/updater.md new file mode 100644 index 0000000..1b13f0c --- /dev/null +++ b/Doc/updater.md @@ -0,0 +1,52 @@ +# Updater WIP DOC! + +The Updater is a self writen Script that updates the Game modifications to the latest build. + +In the future there will also be a in-game part that will show you when you need a update. + +# 1. Script explained + +## 1.1 Script Part X + + +# 2. Endpoints + +These Endpoints are used by the updater to download its files, check for newer versions,... + +ROOT: /updater/ + +## 2.1 /updater/version/* +Type: GET + +Response Type: JSON + +Example: {"version": 1} + +Description: Used to check for newer Versions. + +### 2.1.1 Sub-Endpoints +/script + +/pak + +/sig + +## 2.2 /updater/files/* +Type: GET + +Response: FILE + +Description: Used for downloading Files. + +### 2.2.1 Sub-Endpoints +/script + +/pak + +/sig + +# 3. In-Game Part + +What it does + +How its done \ No newline at end of file diff --git a/src/files/TheExit-Rebirth-Updater.bat b/src/files/TheExit-Rebirth-Updater.bat new file mode 100644 index 0000000..cc22ba4 --- /dev/null +++ b/src/files/TheExit-Rebirth-Updater.bat @@ -0,0 +1,35 @@ +@echo off +setlocal enabledelayedexpansion + +TITLE The Exit Rebirth Updater + +set version_url=http://localhost:8080/updater/version/pak +set download_url=http://localhost:8080/updater/files/pak +set path_value=C:\tmp\ + +if not exist "updater_versions" ( + mkdir "updater_versions" +) + +if not exist "updater_versions\pak_version.txt" ( + echo 0 > "updater_versions\pak_version.txt" +) + +for /f %%i in ('type "updater_versions\pak_version.txt"') do set current_version=%%i + +for /f %%i in ('powershell -command "(Invoke-WebRequest '%version_url%' -UseBasicParsing).Content | ConvertFrom-Json"') do ( + set json_version=%%i +) + +if %json_version% gtr %current_version% ( + echo Updating... + + powershell -command "Invoke-WebRequest '%download_url%' -OutFile '%path_value%\pak'" + + echo %json_version% > "updater_versions\pak_version.txt" + echo Update complete. +) else ( + echo No update required. +) + +pause diff --git a/src/templates/updater.html b/src/templates/updater.html new file mode 100644 index 0000000..7a55eb8 --- /dev/null +++ b/src/templates/updater.html @@ -0,0 +1,16 @@ + + + + + Deathgarden Bloodharvest testing API Updater Endpoint + + +

This Endpoint is used to update any files that we provide.

+

For more information read the doc.

+ + + +