diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/network.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/net/network.cpp b/src/net/network.cpp index 3b0652e2..f519a467 100644 --- a/src/net/network.cpp +++ b/src/net/network.cpp @@ -214,20 +214,20 @@ void Network::clearHandlers() void Network::dispatchMessages() { - if (!messageReady()) - return; - - MessageIn msg = getNextMessage(); + while (messageReady()) + { + MessageIn msg = getNextMessage(); - std::map<Uint16, MessageHandler*>::iterator iter; - iter = mMessageHandlers.find(msg.getId()); + std::map<Uint16, MessageHandler*>::iterator iter; + iter = mMessageHandlers.find(msg.getId()); - if (iter != mMessageHandlers.end()) - iter->second->handleMessage(&msg); - else - logger->log("Unhandled packet: %x", msg.getId()); + if (iter != mMessageHandlers.end()) + iter->second->handleMessage(&msg); + else + logger->log("Unhandled packet: %x", msg.getId()); - skip(msg.getLength()); + skip(msg.getLength()); + } } void Network::flush() |