2
0
Fork 0
This commit is contained in:
JeremyStar™ 2024-04-06 14:45:28 +02:00
parent 7c3d796659
commit 9987a1cf48
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
3 changed files with 5 additions and 5 deletions

View file

@ -83,8 +83,8 @@ func start_download(id: int, parse_utf8: bool) -> void:
download.accept_gzip = true download.accept_gzip = true
download.use_threads = true download.use_threads = true
var lambda: Callable = func(result: int, http_code: int, headers: PackedStringArray, body: PackedByteArray, httprequest: HTTPRequest) -> void: var lambda: Callable = func(result: int, http_code: int, headers: PackedStringArray, body: PackedByteArray, httprequest: HTTPRequest) -> void:
logger.verbf("erm", "Request " + str(id) + " completed\nResult: " + str(result) + "\nHTTP response code: " + str(http_code) + "\nHeaders: " + str(headers.size()) + "\nBody size: " + str(body.size()) + " Bytes // " + str(core.misc.byte2mib(body.size(), true)) + " MiB") logger.verbf("erm", "Request " + str(id) + " completed\nResult: " + str(result) + "\nHTTP response code: " + str(http_code) + "\nHeaders: " + str(headers.size()) + "\nBody size: " + str(body.size()) + " Bytes // " + str(core.misc.byte2mib(body.size(), true)) + " MiB\nParse body as UTF-8: " + str(parse_utf8))
list_complete.merge({ id: { "result": result, "http_code": http_code, "headers": headers, "body": body, "body_utf8": body.get_string_from_utf8() if !parse_utf8 else "" } }) list_complete.merge({ id: { "result": result, "http_code": http_code, "headers": headers, "body": body, "body_utf8": body.get_string_from_utf8() if parse_utf8 else "" } })
list_active.erase(id) list_active.erase(id)
remove_child(httprequest) remove_child(httprequest)
httprequest.queue_free() httprequest.queue_free()

View file

@ -47,7 +47,7 @@ func _cleanup() -> void:
func _pull_config() -> void: func _pull_config() -> void:
if core.config.headless: if core.config.headless:
# Remove all scenes # Remove all scenes
logger.verbf("sms", "Removing all scenes (triggered by headless mode)") if is_inside_tree(): logger.verbf("sms", "Removing all scenes (triggered by headless mode)")
for scene in scenes: remove_scene(scene, true) for scene in scenes: remove_scene(scene, true)
# Add a scene to some scene collection # Add a scene to some scene collection

View file

@ -92,11 +92,11 @@ func nuke_storage(autosave: bool = true) -> bool:
if autosave: save_storage() if autosave: save_storage()
return true return true
func get_key(key: String, default: Variant) -> Variant: func get_key(key: String, default: Variant = null) -> Variant:
if !is_open: if !is_open:
logger.errorf("storage", "Failed to get key: No storage file is open") logger.errorf("storage", "Failed to get key: No storage file is open")
return NAN return NAN
logger.diagf("storage", "Returning storage key \"" + key + "\" (default='" + default + "')") logger.diagf("storage", "Returning storage key \"" + key + "\" (default='" + str(default) + "')")
return storage.get(key, default) return storage.get(key, default)
func set_key(key: String, value: Variant, overwrite: bool = true, autosave: bool = true) -> bool: func set_key(key: String, value: Variant, overwrite: bool = true, autosave: bool = true) -> bool: