mirror of
https://github.com/wolfswolke/DeathGarden_API_Rebirth.git
synced 2026-03-21 17:54:09 -05:00
Added WIP updater Files. (Script doesn't work atm.)
This commit is contained in:
parent
1c1d829484
commit
5cc2f58701
52
Doc/updater.md
Normal file
52
Doc/updater.md
Normal file
|
|
@ -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
|
||||
35
src/files/TheExit-Rebirth-Updater.bat
Normal file
35
src/files/TheExit-Rebirth-Updater.bat
Normal file
|
|
@ -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
|
||||
16
src/templates/updater.html
Normal file
16
src/templates/updater.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<meta
|
||||
name = "color-scheme"
|
||||
content = "light dark"
|
||||
/>
|
||||
<html>
|
||||
<head>
|
||||
<title>Deathgarden Bloodharvest testing API Updater Endpoint</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>This Endpoint is used to update any files that we provide.</h1>
|
||||
<p>For more information read the doc.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user