둘 다 동시 디버깅을 위해 push

This commit is contained in:
2025-05-03 17:58:46 +09:00
parent 4bbb6837e8
commit 6ad787eed7
11 changed files with 305 additions and 97 deletions

View File

@@ -140,7 +140,7 @@ public:
union {
struct {
PacketCategory packetType;
std::uint8_t padding;
RequestType requestType;
DataType dataType;
std::uint16_t packetLength;
std::uint16_t destId[4];
@@ -200,7 +200,33 @@ public:
}
};
class alignas(4) LoginResponsePacket : public ResponsePacket {};
class alignas(4) LoginResponsePacket : public ResponsePacket {
public:
union {
struct {
PacketCategory packetType;
RequestType requestType;
DataType dataType;
std::uint16_t packetLength;
ResponseStatusCode responseStatusCode;
std::uint16_t yourId[4];
std::uint8_t data[];
} __data;
std::uint8_t serialized[1500] = "";
};
std::uint8_t* convToN() {
__data.packetLength = ::htons(__data.packetLength);
for (int i = 0; i < 4; i++)
__data.yourId[i] = ::htons(__data.yourId[i]);
return serialized;
}
std::uint8_t* convToH() {
__data.packetLength = ::ntohs(__data.packetLength);
for (int i = 0; i < 4; i++)
__data.yourId[i] = ::ntohs(__data.yourId[i]);
return serialized;
}
};
class alignas(4) RoomCreateResponsePacket : public ResponsePacket {
public: