둘 다 동시 디버깅을 위해 push
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user