summaryrefslogtreecommitdiff
path: root/src/connectionhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/connectionhandler.cpp')
-rw-r--r--src/connectionhandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/connectionhandler.cpp b/src/connectionhandler.cpp
index 8b4d7a9f..75bfe06e 100644
--- a/src/connectionhandler.cpp
+++ b/src/connectionhandler.cpp
@@ -119,8 +119,12 @@ void ConnectionHandler::process()
case ENET_EVENT_TYPE_RECEIVE:
{
+ // Convert the client IP address to string
+ // representation
+ std::string ipaddr = ip4ToString(event.peer->address.host);
+
LOG_INFO("A packet of length " << event.packet->dataLength <<
- " was received from " << event.peer->address.host, 2);
+ " was received from " << ipaddr, 2);
NetComputer *comp = (NetComputer *)event.peer->data;
@@ -136,10 +140,6 @@ void ConnectionHandler::process()
// If the scripting subsystem didn't hook the message
// it will be handled by the default message handler.
- // Convert the client IP address to string
- // representation
- std::string ipaddr = ip4ToString(event.peer->address.host);
-
// Make sure that the packet is big enough (> short)
if (event.packet->dataLength >= 2) {
Packet *packet = new Packet((char *)event.packet->data,