25 #ifndef __I6ENGINE_MODULES_NETWORKMANAGER_H__
26 #define __I6ENGINE_MODULES_NETWORKMANAGER_H__
38 #include "boost/thread/mutex.hpp"
40 #include "m2etis/message/M2Message.h"
41 #include "m2etis/pubsub/DeliverCallbackInterface.h"
45 enum ChannelName : uint16_t;
53 class NetworkController;
56 class NetworkManager :
public m2etis::pubsub::BasicDeliverCallbackInterface<api::GameMessage> {
69 int32_t _counterReceived;
73 m2etis::pubsub::PubSubSystem * _pubsub;
75 uint64_t _lastTickTime;
77 volatile bool _connectionFailed;
79 std::map<uint16_t, uint32_t> _usedChannels;
81 boost::mutex _pubSubLock;
96 void subscribe(uint16_t channel);
101 void unsubscribe(uint16_t channel);
121 void deliverCallback(
const m2etis::message::M2Message<api::GameMessage>::Ptr msg)
override;
126 void connectionFailed() { _connectionFailed =
true; }
131 void publishInternal(m2etis::pubsub::ChannelName channel,
const m2etis::message::M2Message<api::GameMessage>::Ptr & msg)
const;
138 void enablePing(
bool enabled);
boost::shared_ptr< Message > Ptr
#define ASSERT_THREAD_SAFETY_HEADER
Extracts the contents of incoming messages on the "Network" channel and calls the corresponding metho...
This class performs and provides various methods to the engine for the network.