From 6fdbdea4e65b75ac9ebda91320deb656655d3af5 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 1 Jun 2011 19:31:19 +0200 Subject: A bunch of network-related changes. --- game.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 game.h (limited to 'game.h') 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 + +#include + +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 -- cgit v1.2.3