Autodownload
This commit is contained in:
parent
4fa6413d78
commit
1244832f41
96 changed files with 167 additions and 0 deletions
37
systems/auto_update.gd
Normal file
37
systems/auto_update.gd
Normal 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()
|
||||
1
systems/auto_update.gd.uid
Normal file
1
systems/auto_update.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cqt20fdcn0d
|
||||
1
systems/debug/inventory_preview.gdc.uid
Normal file
1
systems/debug/inventory_preview.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c18gj5657p45i
|
||||
1
systems/debug/property_shower.gdc.uid
Normal file
1
systems/debug/property_shower.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c8siqhsdtuyht
|
||||
1
systems/interaction_system/interactible.gdc.uid
Normal file
1
systems/interaction_system/interactible.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b3n0jer2ecba2
|
||||
1
systems/item_spawner.gdc.uid
Normal file
1
systems/item_spawner.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dvf1qigg8irga
|
||||
1
systems/object_container.gdc.uid
Normal file
1
systems/object_container.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ccojsbjgsgd8x
|
||||
1
systems/registry.gdc.uid
Normal file
1
systems/registry.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cb5ys8ilbj0xm
|
||||
1
systems/state_machine/machine.gdc.uid
Normal file
1
systems/state_machine/machine.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dtp6m2ax3oah0
|
||||
1
systems/state_machine/state.gdc.uid
Normal file
1
systems/state_machine/state.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d3d8t0u62hic
|
||||
1
systems/state_machine/substate_machine.gdc.uid
Normal file
1
systems/state_machine/substate_machine.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cimypk7ksstis
|
||||
5
systems/version_resource.gd
Normal file
5
systems/version_resource.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends Resource
|
||||
|
||||
class_name Version
|
||||
|
||||
@export var version: String
|
||||
1
systems/version_resource.gd.uid
Normal file
1
systems/version_resource.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b1505nhdlfed
|
||||
1
systems/weapon_system/dropped_weapon.gdc.uid
Normal file
1
systems/weapon_system/dropped_weapon.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dx3kvptfticnm
|
||||
1
systems/weapon_system/starting_weapon_spawner.gdc.uid
Normal file
1
systems/weapon_system/starting_weapon_spawner.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c7gvuaka250sd
|
||||
1
systems/weapon_system/weapon_resource.gdc.uid
Normal file
1
systems/weapon_system/weapon_resource.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d0m2i8y55bbh4
|
||||
1
systems/weapon_system/weapon_state.gdc.uid
Normal file
1
systems/weapon_system/weapon_state.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://vmkau6agbuwg
|
||||
1
systems/weapon_system/weapon_substate_machine.gdc.uid
Normal file
1
systems/weapon_system/weapon_substate_machine.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b6pyovvq68yal
|
||||
1
systems/weapon_system/weapon_system.gdc.uid
Normal file
1
systems/weapon_system/weapon_system.gdc.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d2x8ioa1n78lp
|
||||
Loading…
Add table
Add a link
Reference in a new issue