Moved the stufftext_frame global to client_static_t structure and

adjusted CL_GetDemoMessage and CL_ParseServerMessage accordingly.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@644 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2012-03-12 08:24:16 +00:00
parent d15b6575b3
commit e324a7ffc5
3 changed files with 14 additions and 17 deletions

View file

@ -20,8 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
int stufftext_frame;
static void CL_FinishTimeDemo (void);
/*
@ -90,11 +88,11 @@ static int CL_GetDemoMessage (void)
// decide if it is time to grab the next message
if (cls.signon == SIGNONS) // always grab until fully connected
{
// Always wait for full frame update on stuff messages.
// If the server stuffs a reconnect, we must wait for
// the client to re-initialize before accepting further
// messages. Otherwise demo playback may freeze. Pa3PyX
if (stufftext_frame == host_framecount)
// Wait for full frame update on stufftext messages:
// If the server stuffs a "reconnect", failing to wait
// for the client to re-initialize before accepting
// further messages freezes demo playback. -- Pa3PyX
if (host_framecount == cls.stufftext_frame)
return 0;
if (cls.timedemo)

View file

@ -91,7 +91,6 @@ const char *svc_strings[] =
qboolean warn_about_nehahra_protocol; //johnfitz
extern vec3_t v_punchangles[2]; //johnfitz
extern int stufftext_frame;
//=============================================================================
@ -1004,8 +1003,8 @@ void CL_ParseServerMessage (void)
break;
case svc_stufftext:
stufftext_frame = host_framecount; // allow full frame update
// on stuff messages. Pa3PyX
cls.stufftext_frame = host_framecount; // allow full frame update
// in demo playback -- Pa3PyX
Cbuf_AddText (MSG_ReadString ());
break;

View file

@ -120,9 +120,9 @@ typedef struct
FILE *demofile;
int td_lastframe; // to meter out one message a frame
int td_startframe; // host_framecount at start
int stufftext_frame; // host_framecount when svc_stufftext is received
float td_starttime; // realtime at second frame of timedemo
// connection information
int signon; // 0 to SIGNONS
struct qsocket_s *netcon;