feat: added client node and registered clue id
This commit is contained in:
parent
38081a7fd0
commit
acb7351ea7
11 changed files with 167 additions and 82 deletions
27
modules/you_done_it/client_node.cpp
Normal file
27
modules/you_done_it/client_node.cpp
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue