diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-30 14:33:28 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-30 14:33:28 +0000 |
commit | aff167beefadc32add4b44626cc2f1cbef800c7b (patch) | |
tree | 43796105cc107ec55742e88562e064d8031d3b23 /src/net/network.cpp | |
parent | 18b73fdadd715d356416a95c31a25b3293fa2596 (diff) | |
download | mana-aff167beefadc32add4b44626cc2f1cbef800c7b.tar.gz mana-aff167beefadc32add4b44626cc2f1cbef800c7b.tar.bz2 mana-aff167beefadc32add4b44626cc2f1cbef800c7b.tar.xz mana-aff167beefadc32add4b44626cc2f1cbef800c7b.zip |
Updated TMW to be compatible with Guichan 0.5.0 (merged from guichan-0.5.0
branch).
Diffstat (limited to 'src/net/network.cpp')
-rw-r--r-- | src/net/network.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/net/network.cpp b/src/net/network.cpp index aa18e888..64cbf331 100644 --- a/src/net/network.cpp +++ b/src/net/network.cpp @@ -66,7 +66,7 @@ bool Network::connect(const std::string &address, short port) mState = CONNECTING; - mClient = enet_host_create (0, 1, 0, 0); + mClient = enet_host_create(0, 1, 0, 0); if (!mClient) { @@ -160,8 +160,10 @@ void Network::dispatchMessages() void Network::flush() { + logger->log("Network::flush()"); if (mState == IDLE || mState == NET_ERROR) { + logger->log("Idle or error, returning"); return; } @@ -173,20 +175,25 @@ void Network::flush() switch (event.type) { case ENET_EVENT_TYPE_CONNECT: + logger->log("Connected."); mState = CONNECTED; // Store any relevant server information here. event.peer->data = 0; break; case ENET_EVENT_TYPE_RECEIVE: + logger->log("Incoming data..."); mIncomingPackets.push(event.packet); break; case ENET_EVENT_TYPE_DISCONNECT: mState = IDLE; - printf("Disconnected\n"); + logger->log("Disconnected."); // Reset the server information. event.peer->data = 0; break; + case ENET_EVENT_TYPE_NONE: + logger->log("No event during 10 milliseconds."); + break; default: logger->log("Unhandled enet event."); break; |