mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-11 01:48:07 +00:00
chore: Eradicate C-style casts and further clean up some code (#1361)
* cast and code cleanup * cast cleanup * bug fixes and improvements * no getBoolField method exists * fixes * unbroke sg cannon scoring * removing comments * Remove the c-style cast warning I added from CMakeLists now that they're gone (it triggers on 3rd party dependencies and slows down compilation) * (Hopefully) fix MacOS compilation error * partially-implemented feedback * more updates to account for feedback * change bool default --------- Co-authored-by: jadebenn <jonahebenn@yahoo.com>
This commit is contained in:
@@ -17,20 +17,20 @@ void ChatPackets::SendChatMessage(const SystemAddress& sysAddr, char chatChannel
|
||||
CBITSTREAM;
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GENERAL_CHAT_MESSAGE);
|
||||
|
||||
bitStream.Write(static_cast<uint64_t>(0));
|
||||
bitStream.Write<uint64_t>(0);
|
||||
bitStream.Write(chatChannel);
|
||||
|
||||
bitStream.Write(static_cast<uint32_t>(message.size()));
|
||||
bitStream.Write<uint32_t>(message.size());
|
||||
bitStream.Write(LUWString(senderName));
|
||||
|
||||
bitStream.Write(playerObjectID);
|
||||
bitStream.Write(static_cast<uint16_t>(0));
|
||||
bitStream.Write(static_cast<char>(0));
|
||||
bitStream.Write<uint16_t>(0);
|
||||
bitStream.Write<char>(0);
|
||||
|
||||
for (uint32_t i = 0; i < message.size(); ++i) {
|
||||
bitStream.Write(static_cast<uint16_t>(message[i]));
|
||||
bitStream.Write<uint16_t>(message[i]);
|
||||
}
|
||||
bitStream.Write(static_cast<uint16_t>(0));
|
||||
bitStream.Write<uint16_t>(0);
|
||||
|
||||
SEND_PACKET_BROADCAST;
|
||||
}
|
||||
@@ -39,21 +39,21 @@ void ChatPackets::SendSystemMessage(const SystemAddress& sysAddr, const std::u16
|
||||
CBITSTREAM;
|
||||
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GENERAL_CHAT_MESSAGE);
|
||||
|
||||
bitStream.Write(static_cast<uint64_t>(0));
|
||||
bitStream.Write(static_cast<char>(4));
|
||||
bitStream.Write<uint64_t>(0);
|
||||
bitStream.Write<char>(4);
|
||||
|
||||
bitStream.Write(static_cast<uint32_t>(message.size()));
|
||||
bitStream.Write<uint32_t>(message.size());
|
||||
bitStream.Write(LUWString("", 33));
|
||||
|
||||
bitStream.Write(static_cast<uint64_t>(0));
|
||||
bitStream.Write(static_cast<uint16_t>(0));
|
||||
bitStream.Write(static_cast<char>(0));
|
||||
bitStream.Write<uint64_t>(0);
|
||||
bitStream.Write<uint16_t>(0);
|
||||
bitStream.Write<char>(0);
|
||||
|
||||
for (uint32_t i = 0; i < message.size(); ++i) {
|
||||
bitStream.Write(static_cast<uint16_t>(message[i]));
|
||||
bitStream.Write<uint16_t>(message[i]);
|
||||
}
|
||||
|
||||
bitStream.Write(static_cast<uint16_t>(0));
|
||||
bitStream.Write<uint16_t>(0);
|
||||
|
||||
//This is so Wincent's announcement works:
|
||||
if (sysAddr != UNASSIGNED_SYSTEM_ADDRESS) {
|
||||
|
Reference in New Issue
Block a user