summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-05 21:27:37 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-05 21:42:06 +0300
commitca8cf76ea713b75db3b573f30c023f7637e9cdf3 (patch)
tree8a3028cf8ba7c9a0c8f113dce13171a9e6b12382 /src/net
parent59087d29cc992a439650616ddf68537cc3ded37d (diff)
downloadplus-ca8cf76ea713b75db3b573f30c023f7637e9cdf3.tar.gz
plus-ca8cf76ea713b75db3b573f30c023f7637e9cdf3.tar.bz2
plus-ca8cf76ea713b75db3b573f30c023f7637e9cdf3.tar.xz
plus-ca8cf76ea713b75db3b573f30c023f7637e9cdf3.zip
Fix send bytes count in messageout.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/messageout.cpp6
-rw-r--r--src/net/tmwa/messageout.cpp5
2 files changed, 2 insertions, 9 deletions
diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp
index 28dd9cf61..58792b0ef 100644
--- a/src/net/eathena/messageout.cpp
+++ b/src/net/eathena/messageout.cpp
@@ -71,7 +71,6 @@ void MessageOut::writeInt16(const int16_t value, const char *const str)
CAST_U16(value))),
mPos, str);
mPos += 2;
- PacketCounters::incOutBytes(2);
}
void MessageOut::writeInt32(const int32_t value, const char *const str)
@@ -88,7 +87,6 @@ void MessageOut::writeInt32(const int32_t value, const char *const str)
#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
mPos += 4;
- PacketCounters::incOutBytes(4);
}
void MessageOut::writeInt64(const int64_t value, const char *const str)
@@ -105,7 +103,6 @@ void MessageOut::writeInt64(const int64_t value, const char *const str)
#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
mPos += 8;
- PacketCounters::incOutBytes(8);
}
void MessageOut::writeBeingId(const BeingId value, const char *const str)
@@ -128,7 +125,7 @@ void MessageOut::writeCoordinates(const uint16_t x,
CAST_U32(direction)), mPos, str);
unsigned char *const data = reinterpret_cast<unsigned char*>(mData)
+ CAST_SIZE(mPos);
- mNetwork->mOutSize += 3;
+ expand(3);
mPos += 3;
uint16_t temp = x;
@@ -144,7 +141,6 @@ void MessageOut::writeCoordinates(const uint16_t x,
data[2] = LOBYTE(temp);
direction = toServerDirection(direction);
data[2] |= direction;
- PacketCounters::incOutBytes(3);
}
} // namespace EAthena
diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp
index 5f325b522..6379b3b1b 100644
--- a/src/net/tmwa/messageout.cpp
+++ b/src/net/tmwa/messageout.cpp
@@ -71,7 +71,6 @@ void MessageOut::writeInt16(const int16_t value, const char *const str)
#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
mPos += 2;
- PacketCounters::incOutBytes(2);
}
void MessageOut::writeInt32(const int32_t value, const char *const str)
@@ -88,7 +87,6 @@ void MessageOut::writeInt32(const int32_t value, const char *const str)
#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
mPos += 4;
- PacketCounters::incOutBytes(4);
}
void MessageOut::writeBeingId(const BeingId value, const char *const str)
@@ -110,7 +108,7 @@ void MessageOut::writeCoordinates(const uint16_t x,
CAST_U32(direction)), mPos, str);
unsigned char *const data = reinterpret_cast<unsigned char*>(mData)
+ CAST_SIZE(mPos);
- mNetwork->mOutSize += 3;
+ expand(3);
mPos += 3;
uint16_t temp = x;
@@ -126,7 +124,6 @@ void MessageOut::writeCoordinates(const uint16_t x,
data[2] = LOBYTE(temp);
direction = toServerDirection(direction);
data[2] |= direction;
- PacketCounters::incOutBytes(3);
}
} // namespace TmwAthena