I need help with creating accounts in this plugin

Godot version

4.3 -.net

lines of code which may have caused the error:

var GDSync
var connection_controller
var data_controller

var active_lb : String = “”

func _ready():
GDSync = get_node(“/root/GDSync”)
connection_controller = GDSync._connection_controller
data_controller = GDSync._data_controller

func perform_https_request(endpoint : String, message : Dictionary) → Dictionary:
var request : HTTPRequest = HTTPRequest.new()
request.timeout = 20
add_child(request)

message["PublicKey"] = connection_controller._PUBLIC_KEY

request.request(
	active_lb+"/"+endpoint,
	[],
	HTTPClient.METHOD_GET,
	var_to_str(message)
)

var result = await request.request_completed

if result[1] == 200:
	var text : String = result[3].get_string_from_ascii()
	var received_message : Dictionary = str_to_var(text)
	return received_message
else:
	return {"Code" : 1 if result[1] != 503 else 3}

This is from the plugin GD-sync .© 2024 GD-Sync. All rights reserved.

I was making a game using this plugin. The plugin had a error with the script

And what’s the error? Any more details?

Screenshot 2025-01-09 202801

Look into how HTTPRequest class works.

You’re trying to parse active_lb+"/"+endpoint String as first parameter of a request() method, which should be a URL.
active_lb is an empty String.
endpoint is apparently “createaccount” judging from the error message.
Therefore your full URL you are trying to parse is /createaccount, which is not a valid URL, hence the error thrown.

1 Like