diff options
author | Andrey Nazarov <skuller@skuller.net> | 2010-10-05 16:25:05 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2010-10-05 16:25:05 +0400 |
commit | d814a4f0b109140062dd4eb4fb3c103e8d2d970c (patch) | |
tree | 64665e3864040145749b9527b2b04b7d5f45a518 /src/cl_parse.c | |
parent | f5b019b3f8f8fc558887f8fecf2a339abfe60022 (diff) |
Improve client demo handling.
- Extend demo buffer size to 4096 bytes. Allow recording of backwards
incompatibe demos with ‘--extended’ switch passed to ‘record’, use
standard 1400 byte frames by default.
- Count dropped demo messages and frames, and include them in
statistics report.
- Allow ‘record --help’ to be called even if recording/disconnected.
- Calling ‘record’ without arguments while recording will print demo statistics.
- Fix CL_GetDemoInfo failing on MVDs.
Diffstat (limited to 'src/cl_parse.c')
-rw-r--r-- | src/cl_parse.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cl_parse.c b/src/cl_parse.c index 75ed182..7137ace 100644 --- a/src/cl_parse.c +++ b/src/cl_parse.c @@ -1638,15 +1638,19 @@ void CL_ParseServerMessage( void ) { continue; } - // copy protocol invariant stuff + // + // if recording demos, copy off protocol invariant stuff + // if( cls.demo.recording && !cls.demo.paused ) { size_t len = msg_read.readcount - readcount; - // with modern servers, it is easily possible to overflow - // the small protocol 34 demo frame... attempt to preserve - // reliable messages at least, which should come first + // it is very easy to overflow standard 1390 bytes + // demo frame with modern servers... attempt to preserve + // reliable messages at least, assuming they come first if( cls.demo.buffer.cursize + len < cls.demo.buffer.maxsize ) { SZ_Write( &cls.demo.buffer, msg_read.data + readcount, len ); + } else { + cls.demo.messages_dropped++; } } } |