Autodownload

This commit is contained in:
Rendo 2025-12-14 18:49:21 +05:00
commit 1244832f41
96 changed files with 167 additions and 0 deletions

37
systems/auto_update.gd Normal file
View file

@ -0,0 +1,37 @@
extends HTTPRequest
var popup_scene: PackedScene = preload("uid://5goo8fyxkv33")
var new_version_avaiable: bool
var popup: ConfirmationDialog
func _ready() -> void:
request_completed.connect(on_request_completed)
popup = popup_scene.instantiate()
add_child(popup)
popup.confirmed.connect(download_button_pressed)
var patch_request: HTTPRequest = popup.get_node("HTTPRequest")
var exec_path = OS.get_executable_path()
var splitted = exec_path.split("/")
var exec_dir = exec_path.replace(splitted[len(splitted)-1],"")
patch_request.download_file = exec_dir + "chelimbalo.pck"
patch_request.request_completed.connect(patch_downloaded)
request("https://2ndbeam.ru/durenije/chelimbalo/release/deploy_data")
func on_request_completed(result: int, _response_code: int, _headers: PackedStringArray, body: PackedByteArray):
if result != OK:
return
var ver_hash = body.get_string_from_ascii().split("\n")[1]
if ver_hash != load("res://version.tres").version:
popup.popup_centered()
func download_button_pressed() -> void:
popup.get_node("HTTPRequest").request("https://2ndbeam.ru/durenije/chelimbalo/release/chelimbalo.pck")
func patch_downloaded(result: int, _response_code: int, _headers: PackedStringArray, _body: PackedByteArray) -> void:
if result == OK:
get_tree().quit()

View file

@ -0,0 +1 @@
uid://cqt20fdcn0d

View file

@ -0,0 +1 @@
uid://c18gj5657p45i

View file

@ -0,0 +1 @@
uid://c8siqhsdtuyht

View file

@ -0,0 +1 @@
uid://b3n0jer2ecba2

View file

@ -0,0 +1 @@
uid://dvf1qigg8irga

View file

@ -0,0 +1 @@
uid://ccojsbjgsgd8x

1
systems/registry.gdc.uid Normal file
View file

@ -0,0 +1 @@
uid://cb5ys8ilbj0xm

View file

@ -0,0 +1 @@
uid://dtp6m2ax3oah0

View file

@ -0,0 +1 @@
uid://d3d8t0u62hic

View file

@ -0,0 +1 @@
uid://cimypk7ksstis

View file

@ -0,0 +1,5 @@
extends Resource
class_name Version
@export var version: String

View file

@ -0,0 +1 @@
uid://b1505nhdlfed

View file

@ -0,0 +1 @@
uid://dx3kvptfticnm

View file

@ -0,0 +1 @@
uid://c7gvuaka250sd

View file

@ -0,0 +1 @@
uid://d0m2i8y55bbh4

View file

@ -0,0 +1 @@
uid://vmkau6agbuwg

View file

@ -0,0 +1 @@
uid://b6pyovvq68yal

View file

@ -0,0 +1 @@
uid://d2x8ioa1n78lp