3 #ifndef ERIS_METASERVER_H 4 #define ERIS_METASERVER_H 7 #include "ServerInfo.h" 9 #include <Atlas/Objects/Decoder.h> 11 #include <sigc++/trackable.h> 12 #include <sigc++/signal.h> 14 #include <boost/asio.hpp> 30 const int DATA_BUFFER_SIZE = 4096;
36 class Meta :
virtual public sigc::trackable,
37 public Atlas::Objects::ObjectsDecoder
60 Meta(boost::asio::io_service& io_service,
EventService& eventService,
const std::string &msv,
unsigned int maxQueries);
91 MetaStatus getStatus()
const {
112 sigc::signal<void, const std::string&>
Failure;
117 virtual void objectArrived(
const Atlas::Objects::Root& obj);
119 void doFailure(
const std::string &msg);
120 void queryFailure(
MetaQuery *q,
const std::string& msg);
135 void connect(boost::asio::ip::udp::endpoint endpoint);
144 void recvCmd(uint32_t op);
151 void listReq(
unsigned int offset = 0);
154 void setupRecvData(
int words, uint32_t got);
158 void internalQuery(
size_t index);
162 boost::asio::io_service& m_io_service;
166 const std::string m_clientName;
170 const std::string m_metaHost;
172 typedef std::set<MetaQuery*> QuerySet;
173 QuerySet m_activeQueries;
175 size_t m_maxActiveQueries;
178 typedef std::vector<ServerInfo> ServerInfoArray;
179 ServerInfoArray m_gameServers,
182 boost::asio::ip::udp::resolver m_resolver;
185 boost::asio::ip::udp::socket m_socket;
187 boost::asio::deadline_timer m_metaTimer;
189 boost::asio::streambuf m_receive_buffer;
190 std::iostream m_receive_stream;
192 boost::asio::streambuf* m_send_buffer;
193 std::iostream m_send_stream;
195 char _data[DATA_BUFFER_SIZE];
198 std::streamsize _bytesToRecv;
199 unsigned int _totalServers,
Information about a specific game server, retrieved via the Meta-server and anonymous GETs...
Definition: ServerInfo.h:22
Every Eris class and type lives inside the Eris namespace; certain utility functions live in the Util...
Definition: Account.cpp:34
Handles polling of the IO system as well as making sure that registered handlers are run on the main ...
Definition: EventService.h:43
std::list< ServerInfo > ServerList
Storage of server information.
Definition: Metaserver.h:33