feat: added client node and registered clue id

This commit is contained in:
Sara Gerretsen 2025-10-12 12:54:06 +02:00
parent 38081a7fd0
commit acb7351ea7
11 changed files with 167 additions and 82 deletions

View file

@ -0,0 +1,27 @@
#include "client_node.h"
#include "ydi_client.h"
void ClientNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("connect_to_server"), &self_type::connect_to_server);
}
void ClientNode::exit_tree() {
ydi::client::disconnect();
}
void ClientNode::_notification(int what) {
if (Engine::get_singleton()->is_editor_hint()) {
return;
}
switch (what) {
case NOTIFICATION_EXIT_TREE:
exit_tree();
return;
default:
return;
}
}
void ClientNode::connect_to_server(String const &server) {
ydi::client::connect(server);
}