tochie-facade/scenes/App.gd
2023-08-28 14:32:03 +05:00

34 lines
1019 B
GDScript

extends Node
var _connection
onready var n_Connection := get_node("Connections")
func _ready():
_connection = n_Connection.establish_new_connection("poto.cafe", "veclavtalica", "-")
if _connection == null:
push_error("Connection failed")
return
var service_request = load("res://scenes/PolyServiceBuilder.gd").new().request(_connection)
if not service_request.is_done:
yield(service_request, "done")
if not service_request.is_ok:
push_error("Service builder errored out: %s" % [service_request.value])
return
for service in service_request.value.value:
if service.muc == null: continue
var rooms_request = service.muc.request_rooms()
if not rooms_request.is_done:
yield(rooms_request, "done")
if not rooms_request.is_ok:
push_error("Room request errored out: %s" % [rooms_request.value])
return
for room in rooms_request.value.value:
print(room.as_string())