32 lines
757 B
C++
32 lines
757 B
C++
#pragma once
|
|
|
|
#include "scene/main/node.h"
|
|
#include "you_done_it/ydi_networking.h"
|
|
|
|
class ServerNode : public Node {
|
|
GDCLASS(ServerNode, Node);
|
|
static ServerNode *singleton_instance;
|
|
static void _bind_methods();
|
|
void enter_tree();
|
|
void process(double delta);
|
|
void exit_tree();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
public:
|
|
static ServerNode *get_singleton();
|
|
void send_conclusion(NetworkData::ClueID method, NetworkData::ClueID motive, NetworkData::ClueID murderer);
|
|
bool open();
|
|
void close();
|
|
bool is_open() const;
|
|
|
|
public:
|
|
static String const sig_clue_revealed;
|
|
static String const sig_connection_established;
|
|
static String const sig_connection_lost;
|
|
static String const sig_conclusion_sent;
|
|
|
|
private:
|
|
bool is_connected{ false };
|
|
};
|