summaryrefslogtreecommitdiff
path: root/src/net/network.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-05 21:16:23 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-09 19:45:29 +0100
commit0fd9aef8bf376d44132edded2cdcb41ba7ee5b2f (patch)
tree24c19cd4af285fd8ede2d9d866668d005b5f6e26 /src/net/network.cpp
parent1a769276ce68285040bffd63bd1c01495ce411a7 (diff)
downloadmana-0fd9aef8bf376d44132edded2cdcb41ba7ee5b2f.tar.gz
mana-0fd9aef8bf376d44132edded2cdcb41ba7ee5b2f.tar.bz2
mana-0fd9aef8bf376d44132edded2cdcb41ba7ee5b2f.tar.xz
mana-0fd9aef8bf376d44132edded2cdcb41ba7ee5b2f.zip
Mostly whitespace and formatting changes
(merged from eAthena client)
Diffstat (limited to 'src/net/network.cpp')
-rw-r--r--src/net/network.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/src/net/network.cpp b/src/net/network.cpp
index a4ea3def..57e368e2 100644
--- a/src/net/network.cpp
+++ b/src/net/network.cpp
@@ -83,8 +83,7 @@ Net::Connection *Net::getConnection()
return new Net::Connection(client);
}
-void
-Net::registerHandler(MessageHandler *handler)
+void Net::registerHandler(MessageHandler *handler)
{
for (const Uint16 *i = handler->handledMessages; *i; i++)
{
@@ -92,8 +91,7 @@ Net::registerHandler(MessageHandler *handler)
}
}
-void
-Net::unregisterHandler(MessageHandler *handler)
+void Net::unregisterHandler(MessageHandler *handler)
{
for (const Uint16 *i = handler->handledMessages; *i; i++)
{
@@ -101,8 +99,7 @@ Net::unregisterHandler(MessageHandler *handler)
}
}
-void
-Net::clearHandlers()
+void Net::clearHandlers()
{
mMessageHandlers.clear();
}
@@ -114,26 +111,25 @@ Net::clearHandlers()
*/
namespace
{
- void
- dispatchMessage(ENetPacket *packet)
- {
- MessageIn msg((const char *)packet->data, packet->dataLength);
-
- MessageHandlerIterator iter = mMessageHandlers.find(msg.getId());
-
- if (iter != mMessageHandlers.end()) {
- //logger->log("Received packet %x (%i B)",
- // msg.getId(), msg.getLength());
- iter->second->handleMessage(msg);
- }
- else {
- logger->log("Unhandled packet %x (%i B)",
- msg.getId(), msg.getLength());
- }
-
- // Clean up the packet now that we're done using it.
- enet_packet_destroy(packet);
+ void dispatchMessage(ENetPacket *packet)
+ {
+ MessageIn msg((const char *)packet->data, packet->dataLength);
+
+ MessageHandlerIterator iter = mMessageHandlers.find(msg.getId());
+
+ if (iter != mMessageHandlers.end()) {
+ //logger->log("Received packet %x (%i B)",
+ // msg.getId(), msg.getLength());
+ iter->second->handleMessage(msg);
}
+ else {
+ logger->log("Unhandled packet %x (%i B)",
+ msg.getId(), msg.getLength());
+ }
+
+ // Clean up the packet now that we're done using it.
+ enet_packet_destroy(packet);
+ }
}
void Net::flush()