summaryrefslogtreecommitdiffstats
path: root/Tools/ProtoProxy/Connection.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-10-02 17:43:00 +0200
committerMattes D <github@xoft.cz>2015-10-02 17:43:00 +0200
commitc8019856973e0dbca9f1925bb4f163954250869e (patch)
treef229227672d60a983213f8d1ba8ff5981086ca80 /Tools/ProtoProxy/Connection.cpp
parentMerge pull request #2511 from cuberite/BottomLayerSpawn (diff)
parentImproved types of utf 16 strings (diff)
downloadcuberite-c8019856973e0dbca9f1925bb4f163954250869e.tar
cuberite-c8019856973e0dbca9f1925bb4f163954250869e.tar.gz
cuberite-c8019856973e0dbca9f1925bb4f163954250869e.tar.bz2
cuberite-c8019856973e0dbca9f1925bb4f163954250869e.tar.lz
cuberite-c8019856973e0dbca9f1925bb4f163954250869e.tar.xz
cuberite-c8019856973e0dbca9f1925bb4f163954250869e.tar.zst
cuberite-c8019856973e0dbca9f1925bb4f163954250869e.zip
Diffstat (limited to 'Tools/ProtoProxy/Connection.cpp')
-rw-r--r--Tools/ProtoProxy/Connection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp
index f24747a24..62d64c49e 100644
--- a/Tools/ProtoProxy/Connection.cpp
+++ b/Tools/ProtoProxy/Connection.cpp
@@ -1835,12 +1835,12 @@ bool cConnection::HandleServerKick(void)
Reason.append(Split[4]);
Reason.push_back(0);
Reason.append(Split[5]);
- AString ReasonBE16 = UTF8ToRawBEUTF16(Reason.data(), Reason.size());
+ auto ReasonBE16 = UTF8ToRawBEUTF16(Reason);
AString PacketStart("\xff");
- PacketStart.push_back(static_cast<char>((ReasonBE16.size() / 2) / 256));
- PacketStart.push_back(static_cast<char>((ReasonBE16.size() / 2) % 256));
+ PacketStart.push_back(static_cast<char>(ReasonBE16.size() / 256));
+ PacketStart.push_back(static_cast<char>(ReasonBE16.size() % 256));
CLIENTSEND(PacketStart.data(), PacketStart.size());
- CLIENTSEND(ReasonBE16.data(), ReasonBE16.size());
+ CLIENTSEND(reinterpret_cast<const char *>(ReasonBE16.data()), ReasonBE16.size() * sizeof(char16_t));
return true;
}
else