diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 17:40:12 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 17:40:12 +0000 |
commit | 30d192259e6913a210156da2abce16e05b5a5825 (patch) | |
tree | 5c618bf3ffde465ae836d23156bdd761dc2b2a14 /src/connectionhandler.cpp | |
parent | c2717aecc26d52d8be6d1b9350e9b0ff9dec1fc8 (diff) | |
download | manaserv-30d192259e6913a210156da2abce16e05b5a5825.tar.gz manaserv-30d192259e6913a210156da2abce16e05b5a5825.tar.bz2 manaserv-30d192259e6913a210156da2abce16e05b5a5825.tar.xz manaserv-30d192259e6913a210156da2abce16e05b5a5825.zip |
Applied patch by Rogier, adding a stream operator to NetComputer for logging purposes.
Diffstat (limited to 'src/connectionhandler.cpp')
-rw-r--r-- | src/connectionhandler.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/connectionhandler.cpp b/src/connectionhandler.cpp index 1c73d758..96affdc6 100644 --- a/src/connectionhandler.cpp +++ b/src/connectionhandler.cpp @@ -116,11 +116,7 @@ void ConnectionHandler::process() case ENET_EVENT_TYPE_RECEIVE: { - // Convert the client IP address to string - // representation - std::string ipaddr = ip4ToString(event.peer->address.host); - - NetComputer *comp = (NetComputer *)event.peer->data; + NetComputer *comp = (NetComputer*) event.peer->data; #ifdef SCRIPT_SUPPORT // This could be good if you wanted to extend the @@ -140,11 +136,11 @@ void ConnectionHandler::process() event.packet->dataLength); LOG_INFO("Received message " << msg.getId() << " (" << event.packet->dataLength << " B) from " - << ipaddr, 2); + << *comp, 2); processMessage(comp, msg); } else { - LOG_ERROR("Message too short from " << ipaddr, 0); + LOG_ERROR("Message too short from " << *comp, 0); } /* Clean up the packet now that we're done using it. */ |