Core/PacketIO: Use new packet writing utilities in a bunch of files

This commit is contained in:
Shauren
2025-03-01 00:43:08 +01:00
parent 464d8e39e0
commit 76352cb391
21 changed files with 351 additions and 391 deletions
@@ -236,12 +236,12 @@ ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterInfoBasi
for (ChrCustomizationChoice const& customization : charInfo.Customizations)
data << customization;
data << BitsSize<6>(charInfo.Name);
data << SizedString::BitsSize<6>(charInfo.Name);
data << Bits<1>(charInfo.FirstLogin);
data.FlushBits();
data.WriteString(charInfo.Name);
data << SizedString::Data(charInfo.Name);
return data;
}
@@ -263,13 +263,12 @@ ByteBuffer& operator<<(ByteBuffer& data, EnumCharactersResult::CharacterRestrict
data.append(restrictionsAndMails.MailSenderTypes.data(), restrictionsAndMails.MailSenderTypes.size());
for (std::string const& str : restrictionsAndMails.MailSenders)
data << Bits<6>(str.length() + 1);
data << SizedCString::BitsSize<6>(str);
data.FlushBits();
for (std::string const& str : restrictionsAndMails.MailSenders)
if (!str.empty())
data << str;
data << SizedCString::Data(str);
return data;
}