summaryrefslogtreecommitdiff
path: root/game.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-06-01 19:31:19 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-06-01 19:31:19 +0200
commit6fdbdea4e65b75ac9ebda91320deb656655d3af5 (patch)
tree409c8a8da5ccdf8b527ffec9632ec3d6fbb9609e /game.h
parent8771dde21514e754a7eb774f7047d17c226d6212 (diff)
A bunch of network-related changes.
Diffstat (limited to 'game.h')
-rw-r--r--game.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/game.h b/game.h
new file mode 100644
index 0000000..f950b64
--- /dev/null
+++ b/game.h
@@ -0,0 +1,32 @@
+#ifndef GAME_H
+#define GAME_H
+
+#include "scene.h"
+
+#include <boost/asio.hpp>
+
+#include <string>
+
+class Game {
+ private:
+ static Game *game;
+ Scene *scene;
+
+ boost::asio::io_service io_service;
+ boost::asio::ip::tcp::socket socket;
+
+ public:
+ Game();
+ ~Game();
+
+ void run(std::string host, unsigned int port);
+ void run(std::string host, std::string port);
+
+ void async_read();
+ void handle_message(const boost::system::error_code& error, std::size_t bytes_transferred, uint8_t *type);
+ void handle_chunk();
+
+ static Game& get_instance();
+};
+
+#endif