SuperMarioOdysseyOnline/include/packets/ServerCommand.h
Nick Renieris ffa0b225b0 packets: Fix struct packing related bugs
- sizeof(bool) is implementation defined. The server assumes it's 4 but for me it was 1 (tested with Release too) which caused some bugs
- Structs aren't guaranteed to be packed. The compiler is free to change the layout, which we wouldn't want to for the Packet structs that we deserialize on the server.
2022-06-22 20:16:15 +03:00

8 lines
No EOL
274 B
C

#pragma once
#include "Packet.h"
struct PACKED ServerCommand : Packet {
ServerCommand(const char *command) : Packet() {this->mType = PacketType::CMD; strcpy(srvCmd, command); mPacketSize = sizeof(ServerCommand) - sizeof(Packet);};
char srvCmd[PACKBUFSIZE] = {};
};