bring in sv_demo.c from qwex. This is only the beginning of the mvd server

side support.
This commit is contained in:
Bill Currie 2002-10-03 21:00:35 +00:00
parent d5117e27ee
commit 30c8646e70
5 changed files with 1898 additions and 5 deletions

View file

@ -1,7 +1,8 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS= foreign
EXTRA_DIST = bothdefs.h cl_cam.h cl_demo.h cl_ents.h cl_input.h cl_main.h \
EXTRA_DIST = \
bothdefs.h cl_cam.h cl_demo.h cl_ents.h cl_input.h cl_main.h \
cl_parse.h cl_pred.h cl_skin.h cl_slist.h cl_tent.h client.h \
crudefile.h game.h host.h msg_ucmd.h net.h pmove.h \
protocol.h server.h sv_pr_cmds.h sv_progs.h
protocol.h server.h sv_demo.h sv_pr_cmds.h sv_progs.h

View file

@ -111,6 +111,9 @@ typedef struct
int num_signon_buffers;
int signon_buffer_size[MAX_SIGNON_BUFFERS];
byte signon_buffers[MAX_SIGNON_BUFFERS][MAX_DATAGRAM];
// demo stuff
qboolean demorecording;
} server_t;
#define NUM_SPAWN_PARMS 16
@ -162,6 +165,7 @@ typedef struct client_s
int userid; // identifying number
struct info_s *userinfo; // infostring
const char *team;//FIXME demo
usercmd_t lastcmd; // for filling in big drops and partial predictions
double localtime; // of last message
@ -287,6 +291,10 @@ typedef struct
byte log_buf[2][MAX_DATAGRAM];
challenge_t challenges[MAX_CHALLENGES]; // to prevent invalid IPs from connecting
// demo stuff
byte *demomem;
int demomemsize;
} server_static_t;
//=============================================================================

116
qw/include/sv_demo.h Normal file
View file

@ -0,0 +1,116 @@
/*
Copyright (C) 1996-1997 Id Software, Inc.
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the included (GNU.txt) 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.
*/
#ifndef __sv_demo_h
#define __sv_demo_h
#include "QF/quakeio.h"
#include "QF/sizebuf.h"
#include "server.h"
#define MAX_DEMO_PACKET_ENTITIES 64
typedef struct {
byte *data;
int start, end, last;
int maxsize;
} dbuffer_t;
typedef struct {
byte type;
byte full;
int to;
int size;
byte data[1]; // gcc doesn't allow [] (?)
} header_t;
typedef struct {
vec3_t origin;
vec3_t angles;
int weaponframe;
int skinnum;
int model;
int effects;
} demoinfo_t;
typedef struct {
demoinfo_t info;
float sec;
int parsecount;
qboolean fixangle;
vec3_t angle;
float cmdtime;
int flags;
int frame;
} demo_client_t;
typedef struct {
qboolean allowoverflow; // if false, do a Sys_Error
qboolean overflowed; // set to true if the buffer size
// failed
byte *data;
int maxsize;
int cursize;
int bufsize;
header_t *h;
} demobuf_t;
typedef struct {
demo_client_t clients[MAX_CLIENTS];
double time;
demobuf_t buf;
} demo_frame_t;
#define DEMO_FRAMES 64
#define DEMO_FRAMES_MASK (DEMO_FRAMES - 1)
typedef struct {
QFile *file;
demobuf_t *dbuf;
dbuffer_t dbuffer;
sizebuf_t datagram;
byte datagram_data[MAX_DATAGRAM];
int lastto;
int lasttype;
double time, pingtime;
int stats[MAX_CLIENTS][MAX_CL_STATS]; // ouch!
client_t recorder;
qboolean fixangle[MAX_CLIENTS];
float fixangletime[MAX_CLIENTS];
vec3_t angles[MAX_CLIENTS];
struct dstring_s *name;
struct dstring_s *path;
int parsecount;
int lastwritten;
demo_frame_t frames[DEMO_FRAMES];
demoinfo_t info[MAX_CLIENTS];
int size;
qboolean disk;
void *dest;
byte *mfile;
byte buffer[20 * MAX_MSGLEN];
int bufsize;
} demo_t;
extern demo_t demo;
#endif//__sv_demo_h

View file

@ -77,9 +77,9 @@ syssv_SRC= sv_sys_unix.c
endif
libserver_a_SOURCES= \
crudefile.c sv_ccmds.c sv_ents.c sv_init.c sv_main.c sv_move.c \
sv_nchan.c sv_phys.c sv_pr_cmds.c sv_progs.c sv_send.c sv_user.c \
world.c $(syssv_SRC)
crudefile.c sv_ccmds.c sv_demo.c sv_ents.c sv_init.c sv_main.c \
sv_move.c sv_nchan.c sv_phys.c sv_pr_cmds.c sv_progs.c sv_send.c \
sv_user.c world.c $(syssv_SRC)
qf_server_LIBS= \
$(SERVER_PLUGIN_STATIC_LIBS) \

1768
qw/source/sv_demo.c Normal file

File diff suppressed because it is too large Load diff