v1-b5
This commit is contained in:
parent
7c3d796659
commit
9987a1cf48
3 changed files with 5 additions and 5 deletions
|
@ -83,8 +83,8 @@ func start_download(id: int, parse_utf8: bool) -> void:
|
|||
download.accept_gzip = true
|
||||
download.use_threads = true
|
||||
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")
|
||||
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 "" } })
|
||||
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_active.erase(id)
|
||||
remove_child(httprequest)
|
||||
httprequest.queue_free()
|
||||
|
|
|
@ -47,7 +47,7 @@ func _cleanup() -> void:
|
|||
func _pull_config() -> void:
|
||||
if core.config.headless:
|
||||
# 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)
|
||||
|
||||
# Add a scene to some scene collection
|
||||
|
|
|
@ -92,11 +92,11 @@ func nuke_storage(autosave: bool = true) -> bool:
|
|||
if autosave: save_storage()
|
||||
return true
|
||||
|
||||
func get_key(key: String, default: Variant) -> Variant:
|
||||
func get_key(key: String, default: Variant = null) -> Variant:
|
||||
if !is_open:
|
||||
logger.errorf("storage", "Failed to get key: No storage file is open")
|
||||
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)
|
||||
|
||||
func set_key(key: String, value: Variant, overwrite: bool = true, autosave: bool = true) -> bool:
|
||||
|
|
Loading…
Reference in a new issue