diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-01 19:31:19 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-01 19:31:19 +0200 |
commit | 6fdbdea4e65b75ac9ebda91320deb656655d3af5 (patch) | |
tree | 409c8a8da5ccdf8b527ffec9632ec3d6fbb9609e /game.h | |
parent | 8771dde21514e754a7eb774f7047d17c226d6212 (diff) |
A bunch of network-related changes.
Diffstat (limited to 'game.h')
-rw-r--r-- | game.h | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -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 |