Replace the usage of RakString (#648)

This commit is contained in:
Jett
2022-07-17 04:40:46 +01:00
committed by GitHub
parent 9287e5bc4b
commit 77d35019cc
7 changed files with 91 additions and 48 deletions

View File

@@ -2017,11 +2017,15 @@ void SlashCommandHandler::SendAnnouncement(const std::string& title, const std::
CBITSTREAM;
PacketUtils::WriteHeader(bitStream, CHAT_INTERNAL, MSG_CHAT_INTERNAL_ANNOUNCEMENT);
RakNet::RakString rsTitle(title.c_str());
RakNet::RakString rsMsg(message.c_str());
bitStream.Write<uint32_t>(title.size());
for (auto character : title) {
bitStream.Write<char>(character);
}
bitStream.Write(rsTitle);
bitStream.Write(rsMsg);
bitStream.Write<uint32_t>(message.size());
for (auto character : message) {
bitStream.Write<char>(character);
}
Game::chatServer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, Game::chatSysAddr, false);
}