You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
static ConVar net_maxcleartime( "holylib_net_maxcleartime", "4.0", 0, "Max # of seconds we can wait for next packets to be sent based on rate setting (0 == no limit)." );
// We cannot stackallocate this amount as else we can easily crash!
1625
+
// We also use static so that each thread only allocates this once instead of on every call & we use a std::unique_ptr so that our memory is freed when the thread dies.
Copy file name to clipboardExpand all lines: source/sourcesdk/custom_net_chan.h
+31-4Lines changed: 31 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,38 @@
21
21
#include"const.h"
22
22
#include"inetchannel.h"
23
23
24
+
// Flow control bytes per second limits
25
+
#undef MAX_RATE
26
+
#undef MIN_RATE
27
+
#undef DEFAULT_RATE
28
+
#defineMAX_RATE (1024*1024*16)
29
+
#defineMIN_RATE4000
30
+
#defineDEFAULT_RATE240000
31
+
32
+
#undef FRAGMENT_BITS
33
+
#undef FRAGMENT_SIZE
34
+
#undef MAX_FILE_SIZE_BITS
35
+
#undef MAX_FILE_SIZE
36
+
#defineFRAGMENT_BITS13
37
+
constexprint FRAGMENT_SIZE = 1 << FRAGMENT_BITS;
38
+
#defineMAX_FILE_SIZE_BITS29
39
+
constexprint MAX_FILE_SIZE = (1 << MAX_FILE_SIZE_BITS) - 1; // maximum transferable size is 4GB
40
+
41
+
#undef NET_MAX_PAYLOAD
42
+
#undef NET_MAX_DATAGRAM_PAYLOAD
43
+
// This is the packet payload without any header bytes (which are attached for actual sending)
44
+
#defineNET_MAX_PAYLOAD576000// largest message we can send in bytes
45
+
#defineNET_MAX_DATAGRAM_PAYLOAD8000// = maximum unreliable payload size
46
+
24
47
#defineMAX_FRAGMENTS_BITS5// How many fragments we can send at once
25
-
#defineMAX_FRAGMENTS(1 << MAX_FRAGMENTS_BITS) - 1// Maximum number of fragments we can safely transmit. -1 as else we would go over MAX_FRAGMENTS_BITS
48
+
constexprintMAX_FRAGMENTS = (1 << MAX_FRAGMENTS_BITS) - 1;// Maximum number of fragments we can safely transmit. -1 as else we would go over MAX_FRAGMENTS_BITS
#defineSUBCHANNEL_BITS4// raising it above 5 would require changes to m_nOutReliableState & m_nInReliableState as they couldn't hold the states anymore.
40
-
#defineMAX_SUBCHANNELS(1 << SUBCHANNEL_BITS) // we have 16 alternative send&wait bits
67
+
constexprintMAX_SUBCHANNELS = (1 << SUBCHANNEL_BITS);// we have 16 alternative send&wait bits
41
68
42
69
#defineSUBCHANNEL_FREE0// subchannel is free to use
43
70
#defineSUBCHANNEL_TOSEND1// subchannel has data, but not send yet
0 commit comments