summaryrefslogtreecommitdiff
path: root/src/lobby.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lobby.h')
-rw-r--r--src/lobby.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lobby.h b/src/lobby.h
new file mode 100644
index 0000000..c445506
--- /dev/null
+++ b/src/lobby.h
@@ -0,0 +1,33 @@
+#ifndef LOBBY_H
+#define LOBBY_H
+
+#include <boost/asio.hpp>
+
+#include <vector>
+
+#include "tcpserver.h"
+#include "client.h"
+
+class Lobby {
+ private:
+ boost::asio::io_service io_service;
+ TCPServer server;
+
+ std::vector<Client::p> waiting;
+
+ //! Handle new connection.
+ void handle_connect(Connection::p connection);
+
+ //! Handle login.
+ void handle_login(Connection::p connection, Message::p msg);
+
+ //! Handle action.
+ void handle_action(Client::p client, int game_mode);
+
+ public:
+ Lobby();
+
+ void run();
+};
+
+#endif