diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/net/network.cpp | 9 |
2 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,7 @@ +2006-07-31 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/net/network.cpp: Corrected an off by one error in packet size. + 2006-07-30 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/openglgraphics.cpp, src/game.cpp, src/main.cpp, diff --git a/src/net/network.cpp b/src/net/network.cpp index 64cbf331..f18cf412 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(NULL, 1, 0, 0); if (!mClient) { @@ -160,10 +160,8 @@ void Network::dispatchMessages() void Network::flush() { - logger->log("Network::flush()"); if (mState == IDLE || mState == NET_ERROR) { - logger->log("Idle or error, returning"); return; } @@ -218,11 +216,14 @@ void Network::send(MessageOut *msg) { if (mState == IDLE || mState == NET_ERROR) { + logger->log("Warning: attempt to send a message while network not " + "ready."); return; } ENetPacket *packet = enet_packet_create(msg->getData(), - msg->getDataSize() + 1, ENET_PACKET_FLAG_RELIABLE); + msg->getDataSize(), + ENET_PACKET_FLAG_RELIABLE); mOutgoingPackets.push(packet); } |