29 lines
501 B
C++
29 lines
501 B
C++
#include "server_node.h"
|
|
#include "ydi_server.h"
|
|
#include <core/config/engine.h>
|
|
|
|
void ServerNode::_bind_methods() {}
|
|
|
|
void ServerNode::enter_tree() {
|
|
ydi::server::open();
|
|
}
|
|
|
|
void ServerNode::exit_tree() {
|
|
ydi::server::close();
|
|
}
|
|
|
|
void ServerNode::_notification(int what) {
|
|
if (Engine::get_singleton()->is_editor_hint()) {
|
|
return;
|
|
}
|
|
switch (what) {
|
|
case NOTIFICATION_ENTER_TREE:
|
|
enter_tree();
|
|
return;
|
|
case NOTIFICATION_EXIT_TREE:
|
|
exit_tree();
|
|
return;
|
|
default:
|
|
return;
|
|
}
|
|
}
|