Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions gframe/duelclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ class DuelClient {
template<typename ST>
static void SendPacketToServer(unsigned char proto, const ST& st) {
auto p = duel_client_write;
if (sizeof(ST) > MAX_DATA_SIZE)
return;
static_assert(sizeof(ST) <= MAX_DATA_SIZE, "Packet size is too large.");
Comment thread
salix5 marked this conversation as resolved.
buffer_write<uint16_t>(p, (uint16_t)(1 + sizeof(ST)));
buffer_write<uint8_t>(p, proto);
std::memcpy(p, &st, sizeof(ST));
Expand Down
3 changes: 1 addition & 2 deletions gframe/netserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class NetServer {
template<typename ST>
static void SendPacketToPlayer(DuelPlayer* dp, unsigned char proto, const ST& st) {
auto p = net_server_write;
if (sizeof(ST) > MAX_DATA_SIZE)
return;
static_assert(sizeof(ST) <= MAX_DATA_SIZE, "Packet size is too large.");
Comment thread
salix5 marked this conversation as resolved.
buffer_write<uint16_t>(p, (uint16_t)(1 + sizeof(ST)));
buffer_write<uint8_t>(p, proto);
std::memcpy(p, &st, sizeof(ST));
Expand Down