2008-07-26 09:42:12 +03:00
|
|
|
#pragma once
|
|
|
|
#include "../global.h"
|
|
|
|
#include <set>
|
2008-07-30 20:51:19 +03:00
|
|
|
class CConnection;
|
2008-07-26 09:42:12 +03:00
|
|
|
namespace boost
|
|
|
|
{
|
|
|
|
namespace asio
|
|
|
|
{
|
|
|
|
class io_service;
|
|
|
|
namespace ip
|
|
|
|
{
|
|
|
|
class tcp;
|
|
|
|
}
|
|
|
|
template <typename Protocol> class socket_acceptor_service;
|
|
|
|
template <typename Protocol,typename SocketAcceptorService>
|
|
|
|
class basic_socket_acceptor;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class CVCMIServer
|
|
|
|
{
|
|
|
|
boost::asio::io_service *io;
|
|
|
|
boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::socket_acceptor_service<boost::asio::ip::tcp> > * acceptor;
|
|
|
|
std::map<int,CConnection*> connections;
|
|
|
|
std::set<CConnection*> conns;
|
|
|
|
public:
|
|
|
|
CVCMIServer();
|
|
|
|
~CVCMIServer();
|
|
|
|
void setUpConnection(CConnection *c, std::string mapname, si32 checksum);
|
2008-08-04 12:05:52 +03:00
|
|
|
void newGame(CConnection *c);
|
2008-07-26 09:42:12 +03:00
|
|
|
void start();
|
2008-08-04 12:05:52 +03:00
|
|
|
};
|