diff options
| author | Juan Linietsky | 2014-02-09 22:10:30 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-02-09 22:10:30 -0300 |
| commit | 0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac (patch) | |
| tree | 276c4d099e178eb67fbd14f61d77b05e3808e9e3 /tools/editor/fileserver/editor_file_server.h | |
| parent | 0e49da1687bc8192ed210947da52c9e5c5f301bb (diff) | |
| download | godot-0b806ee.tar.gz godot-0b806ee.tar.zst godot-0b806ee.zip | |
GODOT IS OPEN SOURCE
Diffstat (limited to '')
| -rw-r--r-- | tools/editor/fileserver/editor_file_server.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/editor/fileserver/editor_file_server.h b/tools/editor/fileserver/editor_file_server.h new file mode 100644 index 000000000..587b2c4fd --- /dev/null +++ b/tools/editor/fileserver/editor_file_server.h @@ -0,0 +1,59 @@ +#ifndef EDITOR_FILE_SERVER_H +#define EDITOR_FILE_SERVER_H + +#include "object.h" +#include "os/thread.h" +#include "io/tcp_server.h" +#include "io/packet_peer.h" +#include "io/file_access_network.h" + +class EditorFileServer : public Object { + + OBJ_TYPE(EditorFileServer,Object); + + enum Command { + CMD_NONE, + CMD_ACTIVATE, + CMD_STOP, + }; + + + struct ClientData { + + Thread *thread; + Ref<StreamPeerTCP> connection; + Map<int,FileAccess*> files; + EditorFileServer *efs; + bool quit; + + }; + + Ref<TCP_Server> server; + Set<Thread*> to_wait; + + static void _close_client(ClientData *cd); + static void _subthread_start(void*s); + + Mutex *wait_mutex; + Thread *thread; + static void _thread_start(void*); + bool quit; + Command cmd; + + String password; + int port; + bool active; + + +public: + + void start(); + void stop(); + + bool is_active() const; + + EditorFileServer(); + ~EditorFileServer(); +}; + +#endif // EDITOR_FILE_SERVER_H |
