summaryrefslogtreecommitdiff
path: root/src/net/eathena/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-10 01:40:58 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-10 01:40:58 +0300
commitdd996d01676d7dca3eec442b14c4966ba0bb0935 (patch)
treecf33c3b0ab342ad7eace2c79d75fa5ba3e852f5e /src/net/eathena/network.cpp
parent75d9cadaf376cad8f7244ee4d4632e94c0ef3bc0 (diff)
downloadmv-dd996d01676d7dca3eec442b14c4966ba0bb0935.tar.gz
mv-dd996d01676d7dca3eec442b14c4966ba0bb0935.tar.bz2
mv-dd996d01676d7dca3eec442b14c4966ba0bb0935.tar.xz
mv-dd996d01676d7dca3eec442b14c4966ba0bb0935.zip
Delete copy constructor from net classes.
Diffstat (limited to 'src/net/eathena/network.cpp')
-rw-r--r--src/net/eathena/network.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 8a9a010f8..a240a3a74 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -159,24 +159,26 @@ void Network::dispatchMessages()
{
while (messageReady())
{
- MessageIn msg = getNextMessage();
+ MessageIn *const msg = getNextMessage();
- const MessageHandlerIterator iter = mMessageHandlers.find(msg.getId());
+ const MessageHandlerIterator iter = mMessageHandlers.find(
+ msg->getId());
- if (msg.getLength() == 0)
+ if (msg->getLength() == 0)
logger->safeError("Zero length packet received. Exiting.");
if (iter != mMessageHandlers.end())
{
if (iter->second)
- iter->second->handleMessage(msg);
+ iter->second->handleMessage(*msg);
}
else
{
- logger->log("Unhandled packet: %x", msg.getId());
+ logger->log("Unhandled packet: %x", msg->getId());
}
- skip(msg.getLength());
+ skip(msg->getLength());
+ delete msg;
}
}
@@ -205,7 +207,7 @@ bool Network::messageReady()
return ret;
}
-MessageIn Network::getNextMessage()
+MessageIn *Network::getNextMessage()
{
while (!messageReady())
{
@@ -241,7 +243,7 @@ MessageIn Network::getNextMessage()
msgId, len));
#endif
- MessageIn msg(mInBuffer, len);
+ MessageIn *msg = new MessageIn(mInBuffer, len);
SDL_mutexV(mMutex);
return msg;