mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
WIP debugging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "BitStreamUtils.h"
|
||||
#include "dServer.h"
|
||||
#include "BitStream.h"
|
||||
#include "PacketUtils.h"
|
||||
|
||||
|
||||
void LUBitStream::WriteHeader(RakNet::BitStream& bitStream) const {
|
||||
@@ -25,5 +26,7 @@ void LUBitStream::Send(const SystemAddress& sysAddr) const {
|
||||
RakNet::BitStream bitStream;
|
||||
this->WriteHeader(bitStream);
|
||||
this->Serialize(bitStream);
|
||||
LOG("%s", sysAddr.ToString(true));
|
||||
PacketUtils::SavePacket("mailv2", reinterpret_cast<const char *>(bitStream.GetData()), bitStream.GetNumberOfBytesUsed());
|
||||
Game::server->Send(bitStream, sysAddr, sysAddr == UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ set(DNET_SOURCES "AuthPackets.cpp"
|
||||
"ChatPackets.cpp"
|
||||
"ClientPackets.cpp"
|
||||
"dServer.cpp"
|
||||
"MailInfo.cpp"
|
||||
"MasterPackets.cpp"
|
||||
"PacketUtils.cpp"
|
||||
"WorldPackets.cpp"
|
||||
|
@@ -3,22 +3,26 @@
|
||||
#include "DluAssert.h"
|
||||
|
||||
void MailInfo::Serialize(RakNet::BitStream& bitStream) const {
|
||||
LOG("Writing MailInfo");
|
||||
LOG("ID: %llu", id);
|
||||
bitStream.Write(id);
|
||||
|
||||
LOG("Subject: %s", subject.c_str());
|
||||
const LUWString subject(this->subject, 50);
|
||||
bitStream.Write(subject);
|
||||
|
||||
LOG("Body: %s", body.c_str());
|
||||
const LUWString body(this->body, 400);
|
||||
bitStream.Write(body);
|
||||
|
||||
LOG("Sender: %s", senderUsername.c_str());
|
||||
const LUWString sender(this->senderUsername, 32);
|
||||
bitStream.Write(sender);
|
||||
bitStream.Write<uint32_t>(0); // packing
|
||||
|
||||
bitStream.Write<uint64_t>(0); // attachedCurrency
|
||||
LOG("ItemID: %llu", itemID);
|
||||
bitStream.Write(itemID);
|
||||
|
||||
LOT lot = itemLOT;
|
||||
LOG("ItemLOT: %u", lot);
|
||||
if (lot <= 0) bitStream.Write<LOT>(LOT_NULL);
|
||||
else bitStream.Write(lot);
|
||||
bitStream.Write<uint32_t>(0); // packing
|
||||
|
@@ -26,8 +26,8 @@ struct MailInfo {
|
||||
LWOOBJID itemSubkey{};
|
||||
};
|
||||
|
||||
void Serialize(RakNet::BitStream& bitStream) const {}
|
||||
bool Deserialize(RakNet::BitStream& bitStream) { return true; }
|
||||
void Serialize(RakNet::BitStream& bitStream) const;
|
||||
bool Deserialize(RakNet::BitStream& bitStream);
|
||||
};
|
||||
|
||||
#endif // __MAILINFO_H__
|
||||
|
Reference in New Issue
Block a user