diff --git a/autoloads/ngio.gd b/autoloads/ngio.gd index 61dcc5e..426f3c2 100644 --- a/autoloads/ngio.gd +++ b/autoloads/ngio.gd @@ -45,36 +45,21 @@ func _ready() -> void: func _test_http() -> void: print(yield(request_execute("Gateway.getDatetime"), "completed")) - print(yield(request_execute(["Gateway.getDatetime", "Gateway.getVersion"], {}, "", ["blep", "bleepo"]), "completed")) ## requests the provided component be executed, do not call async :/ # may call with either single or multiple components -func request_execute(component, parameters = {}, session_id: String = "", echo = null, encrypt: bool = false) -> Dictionary: +func request_execute(component: String, parameters: Dictionary = {}, session_id: String = "", echo: String = "", encrypt: bool = false) -> Dictionary: # build request headers var headers = [ "Content-Type: application/x-www-form-urlencoded", ] # build execute object - var execute - if component is Array: - execute = [] - for i in component.size(): - if component[i] is String: - execute.append({ - component = component[i], - }) - if parameters is Array and parameters[i] is Dictionary: - execute[-1].parameters = parameters[i] - if echo is Array and echo[i] is String: - execute[-1].echo = echo[i] - else: - execute = { - component = component, - parameters = parameters, - } - if echo is String: - execute.echo = echo + var execute = { + component = component, + parameters = parameters, + echo = echo, + } # use encryption if a valid key is available # TODO: implementation messed up in some way. encryption is fine, but # formatting is wrong in some way that newgrounds can not understand