Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
/*
|
2000-02-19 15:43:42 +00:00
|
|
|
cl_demo.c - demo functions
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
2000-01-08 04:50:26 +00:00
|
|
|
Portions Copyright (C) 1999,2000 Nelson Rush.
|
2000-02-19 15:43:42 +00:00
|
|
|
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
|
|
|
Please see the file "AUTHORS" for a list of contributors
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2000-03-19 15:59:51 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2000-02-19 15:43:42 +00:00
|
|
|
#include "quakedef.h"
|
|
|
|
#include "pmove_simple.h"
|
|
|
|
#include "qtypes.h"
|
|
|
|
#include "client.h"
|
|
|
|
#include "console.h"
|
|
|
|
#include "mathlib.h"
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
|
|
|
|
void CL_FinishTimeDemo (void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
DEMO CODE
|
|
|
|
|
|
|
|
When a demo is playing back, all NET_SendMessages are skipped, and
|
|
|
|
NET_GetMessages are read from the demo file.
|
|
|
|
|
|
|
|
Whenever cl.time gets past the last received message, another message is
|
|
|
|
read from the demo file.
|
|
|
|
==============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
CL_StopPlayback
|
|
|
|
|
|
|
|
Called when a demo file runs out, or the user starts a game
|
|
|
|
==============
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
void
|
|
|
|
CL_StopPlayback ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
if (!cls.demoplayback)
|
|
|
|
return;
|
|
|
|
|
2000-02-08 07:23:09 +00:00
|
|
|
Qclose (cls.demofile);
|
2000-02-19 15:43:42 +00:00
|
|
|
cls.demoplayback = 0;
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
cls.demofile = NULL;
|
|
|
|
cls.state = ca_disconnected;
|
|
|
|
|
|
|
|
if (cls.timedemo)
|
|
|
|
CL_FinishTimeDemo ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CL_WriteDemoMessage
|
|
|
|
|
|
|
|
Dumps the current net message, prefixed by the length and view angles
|
|
|
|
====================
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
void
|
|
|
|
CL_WriteDemoMessage ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
int len;
|
|
|
|
int i;
|
|
|
|
float f;
|
|
|
|
|
|
|
|
len = LittleLong (net_message.cursize);
|
2000-02-08 07:23:09 +00:00
|
|
|
Qwrite (cls.demofile, &len, 4);
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
for (i=0 ; i<3 ; i++)
|
|
|
|
{
|
|
|
|
f = LittleFloat (cl.viewangles[i]);
|
2000-02-08 07:23:09 +00:00
|
|
|
Qwrite (cls.demofile, &f, 4);
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
}
|
2000-02-08 07:23:09 +00:00
|
|
|
Qwrite (cls.demofile, net_message.data, net_message.cursize);
|
|
|
|
Qflush (cls.demofile);
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CL_GetMessage
|
|
|
|
|
|
|
|
Handles recording and playback of demos, on top of NET_ code
|
|
|
|
====================
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
int
|
|
|
|
CL_GetMessage ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
2000-02-19 15:43:42 +00:00
|
|
|
int r, i;
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
float f;
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
if (cls.demoplayback)
|
|
|
|
{
|
2000-03-19 15:59:51 +00:00
|
|
|
// decide if it is time to grab the next message
|
2000-08-12 01:01:30 +00:00
|
|
|
if (cls.signon == SIGNONS) // always grab until fully connected
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
if (cls.timedemo)
|
|
|
|
{
|
|
|
|
if (host_framecount == cls.td_lastframe)
|
2000-08-12 01:01:30 +00:00
|
|
|
return 0; // already read this frame's message
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
cls.td_lastframe = host_framecount;
|
|
|
|
// if this is the second frame, grab the real td_starttime
|
|
|
|
// so the bogus time on the first frame doesn't count
|
|
|
|
if (host_framecount == cls.td_startframe + 1)
|
|
|
|
cls.td_starttime = realtime;
|
|
|
|
}
|
|
|
|
else if ( /* cl.time > 0 && */ cl.time <= cl.mtime[0])
|
|
|
|
{
|
|
|
|
return 0; // don't need another message yet
|
|
|
|
}
|
|
|
|
}
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
// get the next message
|
2000-02-08 07:23:09 +00:00
|
|
|
Qread (cls.demofile, &net_message.cursize, 4);
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
VectorCopy (cl.mviewangles[0], cl.mviewangles[1]);
|
|
|
|
for (i=0 ; i<3 ; i++)
|
|
|
|
{
|
2000-02-08 07:23:09 +00:00
|
|
|
r = Qread (cls.demofile, &f, 4);
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
cl.mviewangles[0][i] = LittleFloat (f);
|
|
|
|
}
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
net_message.cursize = LittleLong (net_message.cursize);
|
|
|
|
if (net_message.cursize > MAX_MSGLEN)
|
|
|
|
Sys_Error ("Demo message > MAX_MSGLEN");
|
2000-02-08 07:23:09 +00:00
|
|
|
r = Qread (cls.demofile, net_message.data, net_message.cursize);
|
2000-02-03 01:49:11 +00:00
|
|
|
if (r != net_message.cursize)
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
CL_StopPlayback ();
|
|
|
|
return 0;
|
|
|
|
}
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
r = NET_GetMessage (cls.netcon);
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
if (r != 1 && r != 2)
|
|
|
|
return r;
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
// discard nop keepalive message
|
|
|
|
if (net_message.cursize == 1 && net_message.data[0] == svc_nop)
|
|
|
|
Con_Printf ("<-- server to client keepalive\n");
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cls.demorecording)
|
|
|
|
CL_WriteDemoMessage ();
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CL_Stop_f
|
|
|
|
|
|
|
|
stop recording a demo
|
|
|
|
====================
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
void
|
|
|
|
CL_Stop_f ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
if (cmd_source != src_command)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!cls.demorecording)
|
|
|
|
{
|
|
|
|
Con_Printf ("Not recording a demo.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// write a disconnect message to the demo file
|
|
|
|
SZ_Clear (&net_message);
|
|
|
|
MSG_WriteByte (&net_message, svc_disconnect);
|
|
|
|
CL_WriteDemoMessage ();
|
|
|
|
|
|
|
|
// finish up
|
2000-02-08 07:23:09 +00:00
|
|
|
Qclose (cls.demofile);
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
cls.demofile = NULL;
|
|
|
|
cls.demorecording = false;
|
|
|
|
Con_Printf ("Completed demo\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CL_Record_f
|
|
|
|
|
|
|
|
record <demoname> <map> [cd track]
|
|
|
|
====================
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
void
|
|
|
|
CL_Record_f ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
int c;
|
|
|
|
char name[MAX_OSPATH];
|
|
|
|
int track;
|
|
|
|
|
|
|
|
if (cmd_source != src_command)
|
|
|
|
return;
|
|
|
|
|
|
|
|
c = Cmd_Argc();
|
|
|
|
if (c != 2 && c != 3 && c != 4)
|
|
|
|
{
|
|
|
|
Con_Printf ("record <demoname> [<map> [cd track]]\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strstr(Cmd_Argv(1), ".."))
|
|
|
|
{
|
|
|
|
Con_Printf ("Relative pathnames are not allowed.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-01-29 18:46:26 +00:00
|
|
|
if (c == 2 && cls.state >= ca_connected)
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
Con_Printf("Can not record - already connected to server\nClient demo recording must be started before connecting\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// write the forced cd track number, or -1
|
|
|
|
if (c == 4)
|
|
|
|
{
|
|
|
|
track = atoi(Cmd_Argv(3));
|
|
|
|
Con_Printf ("Forcing CD track to %i\n", cls.forcetrack);
|
|
|
|
}
|
|
|
|
else
|
2000-03-19 15:59:51 +00:00
|
|
|
track = -1;
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
|
2000-01-05 00:05:48 +00:00
|
|
|
snprintf(name, sizeof(name), "%s/%s", com_gamedir, Cmd_Argv(1));
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
//
|
|
|
|
// start the map up
|
|
|
|
//
|
|
|
|
if (c > 2)
|
|
|
|
Cmd_ExecuteString ( va("map %s", Cmd_Argv(2)), src_command);
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
//
|
|
|
|
// open the demo file
|
|
|
|
//
|
|
|
|
COM_DefaultExtension (name, ".dem");
|
|
|
|
|
|
|
|
Con_Printf ("recording to %s.\n", name);
|
2000-02-08 07:23:09 +00:00
|
|
|
cls.demofile = Qopen (name, "wb");
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
if (!cls.demofile)
|
|
|
|
{
|
|
|
|
Con_Printf ("ERROR: couldn't open.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
cls.forcetrack = track;
|
2000-02-08 07:23:09 +00:00
|
|
|
Qprintf (cls.demofile, "%i\n", cls.forcetrack);
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
cls.demorecording = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CL_PlayDemo_f
|
|
|
|
|
|
|
|
play [demoname]
|
|
|
|
====================
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
void
|
|
|
|
CL_PlayDemo_f ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
char name[256];
|
|
|
|
int c;
|
|
|
|
qboolean neg = false;
|
|
|
|
|
|
|
|
if (cmd_source != src_command)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (Cmd_Argc() != 2)
|
|
|
|
{
|
|
|
|
Con_Printf ("play <demoname> : plays a demo\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// disconnect from server
|
|
|
|
//
|
|
|
|
CL_Disconnect ();
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
//
|
|
|
|
// open the demo file
|
|
|
|
//
|
|
|
|
strcpy (name, Cmd_Argv(1));
|
|
|
|
COM_DefaultExtension (name, ".dem");
|
|
|
|
|
|
|
|
Con_Printf ("Playing demo from %s.\n", name);
|
|
|
|
COM_FOpenFile (name, &cls.demofile);
|
|
|
|
if (!cls.demofile)
|
|
|
|
{
|
|
|
|
Con_Printf ("ERROR: couldn't open.\n");
|
|
|
|
cls.demonum = -1; // stop demo loop
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
cls.demoplayback = true;
|
|
|
|
cls.state = ca_connected;
|
|
|
|
cls.forcetrack = 0;
|
|
|
|
|
2000-02-08 07:23:09 +00:00
|
|
|
while ((c = Qgetc(cls.demofile)) != '\n')
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
if (c == '-')
|
|
|
|
neg = true;
|
|
|
|
else
|
|
|
|
cls.forcetrack = cls.forcetrack * 10 + (c - '0');
|
|
|
|
|
|
|
|
if (neg)
|
|
|
|
cls.forcetrack = -cls.forcetrack;
|
|
|
|
// ZOID, fscanf is evil
|
|
|
|
// fscanf (cls.demofile, "%i\n", &cls.forcetrack);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CL_FinishTimeDemo
|
|
|
|
|
|
|
|
====================
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
void
|
|
|
|
CL_FinishTimeDemo ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
int frames;
|
|
|
|
float time;
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
cls.timedemo = false;
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
// the first frame didn't count
|
|
|
|
frames = (host_framecount - cls.td_startframe) - 1;
|
|
|
|
time = realtime - cls.td_starttime;
|
|
|
|
if (!time)
|
|
|
|
time = 1;
|
|
|
|
Con_Printf ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
CL_TimeDemo_f
|
|
|
|
|
|
|
|
timedemo [demoname]
|
|
|
|
====================
|
|
|
|
*/
|
2000-08-20 13:33:48 +00:00
|
|
|
void
|
|
|
|
CL_TimeDemo_f ( void )
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
{
|
|
|
|
if (cmd_source != src_command)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (Cmd_Argc() != 2)
|
|
|
|
{
|
|
|
|
Con_Printf ("timedemo <demoname> : gets demo speeds\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
CL_PlayDemo_f ();
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
// cls.td_starttime will be grabbed at the second frame of the demo, so
|
|
|
|
// all the loading time doesn't get counted
|
2000-03-19 15:59:51 +00:00
|
|
|
|
Created new subdir: uquake. Pick your favorite U word for the meaning --
Unchained, Ultimate, Ultra, Up Yours, Underworld, Underground, Unified,
Unity, etc. You know the drill.
This takes care of the "standalone" problem with the wrong name, and the
recent snafu with multiple developers working on the same files
simultaneously...expect me (and probably others) to start locking dirs when
updates are taking place.
And yes, this update is really as large as it looks. Software only at the
moment, but I will have the makefile updated to build the GL builds as
well.
1999-12-26 13:51:52 +00:00
|
|
|
cls.timedemo = true;
|
|
|
|
cls.td_startframe = host_framecount;
|
|
|
|
cls.td_lastframe = -1; // get a new message this frame
|
|
|
|
}
|