diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-31 20:15:51 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-31 20:15:51 +0000 |
commit | 713254672b345150fe5d0c40d229e9dff1a80d89 (patch) | |
tree | e54c443996da862d44ff911a5419beedca1bf73e /src/net | |
parent | aff167beefadc32add4b44626cc2f1cbef800c7b (diff) | |
download | mana-713254672b345150fe5d0c40d229e9dff1a80d89.tar.gz mana-713254672b345150fe5d0c40d229e9dff1a80d89.tar.bz2 mana-713254672b345150fe5d0c40d229e9dff1a80d89.tar.xz mana-713254672b345150fe5d0c40d229e9dff1a80d89.zip |
Corrected an off by one error in packet size.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/network.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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); } |