summaryrefslogtreecommitdiffstats
path: root/src/messageout.cpp
diff options
context:
space:
mode:
authorAaron Marks <nymacro@gmail.com>2005-07-16 03:55:54 +0000
committerAaron Marks <nymacro@gmail.com>2005-07-16 03:55:54 +0000
commit34e887895276242efaf2e0b5f1700c1ab1d6b3db (patch)
tree8e2805ad893678364cde6ec1a37146c1bbecf075 /src/messageout.cpp
parentca0ffbbacfcba5e0f019c83fd0b759752b192ca0 (diff)
downloadmanaserv-34e887895276242efaf2e0b5f1700c1ab1d6b3db.tar.gz
manaserv-34e887895276242efaf2e0b5f1700c1ab1d6b3db.tar.xz
manaserv-34e887895276242efaf2e0b5f1700c1ab1d6b3db.zip
Fixed problem with memory expanding in Packet.
Server now handles register requests.
Diffstat (limited to 'src/messageout.cpp')
-rw-r--r--src/messageout.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/messageout.cpp b/src/messageout.cpp
index 2bdc52e..2aca011 100644
--- a/src/messageout.cpp
+++ b/src/messageout.cpp
@@ -26,8 +26,7 @@
#include <cstdlib>
MessageOut::MessageOut():
- packet(0),
- pos(0)
+ packet(0)
{
packet = new Packet(NULL, 0);
}
@@ -72,6 +71,7 @@ void MessageOut::writeString(const std::string &string, int length)
// actual string
memcpy(&packet->data[packet->length + sizeof(unsigned short)],
(void*)string.c_str(), length);
+
packet->length += length + sizeof(unsigned short);
}