Skip to content

Commit

Permalink
Allowed spectator and global unreliable buffer to overflow
Browse files Browse the repository at this point in the history
Extended spectator buffer
  • Loading branch information
WPMGPRoSToTeMa committed Jan 24, 2017
1 parent 347f42a commit 50dc3ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions rehlds/engine/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ struct rehlds_server_t {
// Extended net buffers
uint8_t reliableDatagramBuffer[NET_MAX_PAYLOAD];
uint8_t signonData[NET_MAX_PAYLOAD];
uint8_t spectatorBuffer[MAX_DATAGRAM];

// Extended resource list
resource_t resources[RESOURCE_MAX_COUNT];
Expand Down
9 changes: 9 additions & 0 deletions rehlds/engine/sv_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5921,6 +5921,9 @@ int SV_SpawnServer(qboolean bIsDemo, char *server, char *startspot)
g_psv.datagram.data = g_psv.datagram_buf;
g_psv.datagram.maxsize = sizeof(g_psv.datagram_buf);
g_psv.datagram.cursize = 0;
#ifdef REHLDS_FIXES
g_psv.datagram.flags = SIZEBUF_ALLOW_OVERFLOW;
#endif

g_psv.reliable_datagram.buffername = "Server Reliable Datagram";
#ifdef REHLDS_FIXES
Expand All @@ -5933,8 +5936,14 @@ int SV_SpawnServer(qboolean bIsDemo, char *server, char *startspot)
g_psv.reliable_datagram.cursize = 0;

g_psv.spectator.buffername = "Server Spectator Buffer";
#ifdef REHLDS_FIXES
g_psv.spectator.data = g_rehlds_sv.spectatorBuffer;
g_psv.spectator.maxsize = sizeof(g_rehlds_sv.spectatorBuffer);
g_psv.spectator.flags = SIZEBUF_ALLOW_OVERFLOW;
#else
g_psv.spectator.data = g_psv.spectator_buf;
g_psv.spectator.maxsize = sizeof(g_psv.spectator_buf);
#endif

g_psv.multicast.buffername = "Server Multicast Buffer";
g_psv.multicast.data = g_psv.multicast_buf;
Expand Down

0 comments on commit 50dc3ac

Please sign in to comment.