- Improve snapshot rate and data rate control

- Make server send packet fragments and queued packets when server is idle
- Voip protocol detection is tied to com_protocol making past-end-of-message reading unncessary
- Use Hunk_AllocateTempMemory() for buffering VOIP packets and fix buffering scheme that ryan hates so much
- Disable packet scrambling for new protocol as it is useless now
- Get rid of the old packet scrambling functions predating latest point release
- Use Hunk_AllocateTempMemory() for netchan packet queue to fix memory leak when client gets disconnected with packets in the queue
- Use Hunk_AllocateTempMemory() for download blocks to fix memory leak when client gets disconnected with download blocks in the queue
- Fix SV_RateMsec to account for udp/udp6 packet lengths
This commit is contained in:
Thilo Schulz 2011-07-13 17:11:30 +00:00
parent a844c94af1
commit ac30d86db0
15 changed files with 345 additions and 356 deletions

View file

@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define MAX_ENT_CLUSTERS 16
#ifdef USE_VOIP
#define VOIP_QUEUE_LENGTH 64
typedef struct voipServerPacket_s
{
int generation;
@ -162,7 +164,7 @@ typedef struct client_s {
int nextReliableTime; // svs.time when another reliable command will be allowed
int lastPacketTime; // svs.time when packet was last received
int lastConnectTime; // svs.time when connection started
int nextSnapshotTime; // send another snapshot when svs.time >= nextSnapshotTime
int lastSnapshotTime; // svs.time of last sent snapshot
qboolean rateDelayed; // true if nextSnapshotTime was set based on rate instead of snapshotMsec
int timeoutCount; // must timeout a few frames in a row so debugging doesn't break
clientSnapshot_t frames[PACKET_BACKUP]; // updates can be delta'd from here
@ -183,8 +185,9 @@ typedef struct client_s {
qboolean hasVoip;
qboolean muteAllVoip;
qboolean ignoreVoipFromClient[MAX_CLIENTS];
voipServerPacket_t voipPacket[64]; // !!! FIXME: WAY too much memory!
voipServerPacket_t *voipPacket[VOIP_QUEUE_LENGTH];
int queuedVoipPackets;
int queuedVoipIndex;
#endif
int oldServerTime;
@ -311,6 +314,7 @@ void SV_RemoveOperatorCommands (void);
void SV_MasterShutdown (void);
int SV_RateMsec(client_t *client);
@ -460,6 +464,6 @@ void SV_ClipToEntity( trace_t *trace, const vec3_t start, const vec3_t mins, con
// sv_net_chan.c
//
void SV_Netchan_Transmit( client_t *client, msg_t *msg);
void SV_Netchan_TransmitNextFragment( client_t *client );
int SV_Netchan_TransmitNextFragment(client_t *client);
qboolean SV_Netchan_Process( client_t *client, msg_t *msg );