Removed sendPacket function and destructor.
This commit is contained in:
parent
cf51d2f0e0
commit
0bd2b48ea0
@ -32,15 +32,6 @@ NetworkManager::NetworkManager()
|
||||
{
|
||||
} // NetworkManager
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
NetworkManager::~NetworkManager()
|
||||
{
|
||||
ProtocolManager::kill();
|
||||
|
||||
STKHost::destroy();
|
||||
} // ~Networkmanager
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
/** \brief Function to start the Network Manager (start threads).
|
||||
*/
|
||||
@ -60,16 +51,3 @@ bool NetworkManager::connect(const TransportAddress& address)
|
||||
|
||||
return STKPeer::connectToHost(STKHost::get(), address, 2, 0);
|
||||
} // connect
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void NetworkManager::sendPacket(STKPeer* peer, const NetworkString& data,
|
||||
bool reliable)
|
||||
{
|
||||
if (peer)
|
||||
peer->sendPacket(data, reliable);
|
||||
} // sendPacket
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -49,7 +49,7 @@ class NetworkManager : public AbstractSingleton<NetworkManager>
|
||||
{
|
||||
protected:
|
||||
NetworkManager();
|
||||
virtual ~NetworkManager();
|
||||
virtual ~NetworkManager() {};
|
||||
|
||||
|
||||
private:
|
||||
@ -63,10 +63,6 @@ public:
|
||||
virtual bool connect(const TransportAddress& peer);
|
||||
virtual void sendPacket(const NetworkString& data,
|
||||
bool reliable = true) = 0;
|
||||
virtual void sendPacket(STKPeer* peer,
|
||||
const NetworkString& data,
|
||||
bool reliable = true);
|
||||
|
||||
// Game related functions
|
||||
virtual bool isServer() = 0;
|
||||
|
||||
|
@ -173,20 +173,20 @@ void ProtocolManager::propagateEvent(Event* event)
|
||||
void ProtocolManager::sendMessage(Protocol* sender, const NetworkString& message,
|
||||
bool reliable)
|
||||
{
|
||||
NetworkString newMessage(1+message.size());
|
||||
newMessage.ai8(sender->getProtocolType()); // add one byte to add protocol type
|
||||
newMessage += message;
|
||||
NetworkManager::getInstance()->sendPacket(newMessage, reliable);
|
||||
NetworkString new_message(1+message.size());
|
||||
new_message.ai8(sender->getProtocolType()); // add one byte to add protocol type
|
||||
new_message += message;
|
||||
NetworkManager::getInstance()->sendPacket(new_message, reliable);
|
||||
} // sendMessage
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void ProtocolManager::sendMessage(Protocol* sender, STKPeer* peer,
|
||||
const NetworkString& message, bool reliable)
|
||||
{
|
||||
NetworkString newMessage(1+message.size());
|
||||
newMessage.ai8(sender->getProtocolType()); // add one byte to add protocol type
|
||||
newMessage += message;
|
||||
NetworkManager::getInstance()->sendPacket(peer, newMessage, reliable);
|
||||
NetworkString new_message(1+message.size());
|
||||
new_message.ai8(sender->getProtocolType()); // add one byte to add protocol type
|
||||
new_message += message;
|
||||
peer->sendPacket(new_message, reliable);
|
||||
} // sendMessage
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user