#ifndef SERVER_H #define SERVER_H #include "connection.h" #include "terrain_cache.h" #include #include #include class Server { private: boost::asio::ip::tcp::acceptor acceptor; std::list clients; TerrainCache::p cache; public: Server(boost::asio::io_service& io_service); void run(); void start_accept(); void handle_connect(Connection::p connection); void async_read(Connection::p connection); void handle_type(const boost::system::error_code& error, size_t bytes_transferred, Connection::p connection, uint8_t *_type); void handle_pos(Connection::p c); void handle_chunk(Connection::p c); void handle_message(Connection::p c); }; #endif