2001-02-19 21:15:25 +00:00
|
|
|
/*
|
|
|
|
server.h
|
|
|
|
|
|
|
|
(description)
|
|
|
|
|
|
|
|
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 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:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
// server.h
|
|
|
|
|
|
|
|
#ifndef _SERVER_H
|
|
|
|
#define _SERVER_H
|
|
|
|
|
2001-09-21 04:22:46 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2002-08-27 07:16:28 +00:00
|
|
|
#include "QF/info.h"
|
2001-04-10 06:55:28 +00:00
|
|
|
#include "QF/model.h"
|
2002-08-27 07:16:28 +00:00
|
|
|
#include "QF/quakeio.h"
|
2001-03-27 20:33:07 +00:00
|
|
|
#include "QF/sizebuf.h"
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-28 07:03:56 +00:00
|
|
|
#include "world.h"
|
|
|
|
|
2001-05-31 03:41:35 +00:00
|
|
|
#include "host.h"
|
2003-02-11 22:48:57 +00:00
|
|
|
#include "netchan.h"
|
2010-08-24 00:53:54 +00:00
|
|
|
#include "qw/bothdefs.h"
|
2004-02-22 05:40:08 +00:00
|
|
|
#include "qw/msg_backbuf.h"
|
2004-02-21 02:31:22 +00:00
|
|
|
#include "qw/protocol.h"
|
2001-05-31 03:41:35 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
#define QW_SERVER
|
|
|
|
|
2001-10-03 03:42:28 +00:00
|
|
|
#define MAX_MASTERS 32 // max recipients for heartbeat packets
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
#define MAX_SIGNON_BUFFERS 8
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
ss_dead, // no map loaded
|
|
|
|
ss_loading, // spawning level edicts
|
|
|
|
ss_active // actively running
|
|
|
|
} server_state_t;
|
2010-01-13 06:42:26 +00:00
|
|
|
// some qc commands are valid only before the server has finished
|
2001-02-19 21:15:25 +00:00
|
|
|
// initializing (precache commands, static sounds / objects, etc)
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef struct {
|
2023-06-13 09:06:11 +00:00
|
|
|
bool active; // false when server is going down
|
2010-01-13 06:42:26 +00:00
|
|
|
server_state_t state; // precache commands are valid only during load
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
double time;
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
int lastcheck; // used by PF_checkclient
|
2012-05-21 23:23:22 +00:00
|
|
|
double lastchecktime; // for monster ai
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2023-06-13 09:06:11 +00:00
|
|
|
bool paused; // are we paused?
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
//check player/eyes models for hacks
|
|
|
|
unsigned int model_player_checksum;
|
|
|
|
unsigned int eyes_player_checksum;
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2018-08-19 15:05:00 +00:00
|
|
|
char *name; // map name
|
2001-02-19 21:15:25 +00:00
|
|
|
char modelname[MAX_QPATH]; // maps/<name>.bsp, for model_precache[0]
|
|
|
|
struct model_s *worldmodel;
|
2001-07-15 07:04:17 +00:00
|
|
|
const char *model_precache[MAX_MODELS]; // NULL terminated
|
|
|
|
const char *sound_precache[MAX_SOUNDS]; // NULL terminated
|
|
|
|
const char *lightstyles[MAX_LIGHTSTYLES];
|
2001-02-19 21:15:25 +00:00
|
|
|
struct model_s *models[MAX_MODELS];
|
|
|
|
|
2022-01-16 13:15:18 +00:00
|
|
|
unsigned num_edicts; // increases towards MAX_EDICTS
|
2001-08-27 21:09:13 +00:00
|
|
|
struct edict_s *edicts; // can NOT be array indexed, because
|
|
|
|
// struct edict_s is variable sized, but can
|
2001-02-19 21:15:25 +00:00
|
|
|
// be used to reference the world ent
|
|
|
|
|
2021-07-26 02:15:51 +00:00
|
|
|
struct set_s *pvs, *phs; // fully expanded and decompressed
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-28 07:03:56 +00:00
|
|
|
//antilag
|
|
|
|
float lagentsfrac;
|
|
|
|
laggedentinfo_t *lagents;
|
|
|
|
unsigned maxlagents;
|
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
// added to every client's unreliable buffer each frame, then cleared
|
|
|
|
sizebuf_t datagram;
|
|
|
|
byte datagram_buf[MAX_DATAGRAM];
|
|
|
|
|
|
|
|
// added to every client's reliable buffer each frame, then cleared
|
|
|
|
sizebuf_t reliable_datagram;
|
|
|
|
byte reliable_datagram_buf[MAX_MSGLEN];
|
|
|
|
|
|
|
|
// the multicast buffer is used to send a message to a set of clients
|
|
|
|
sizebuf_t multicast;
|
|
|
|
byte multicast_buf[MAX_MSGLEN];
|
|
|
|
|
|
|
|
// the master buffer is used for building log packets
|
|
|
|
sizebuf_t master;
|
|
|
|
byte master_buf[MAX_DATAGRAM];
|
|
|
|
|
|
|
|
// the signon buffer will be sent to each client as they connect
|
|
|
|
// includes the entity baselines, the static entities, etc
|
2012-05-21 23:23:22 +00:00
|
|
|
// large levels will have >MAX_DATAGRAM sized signons, so
|
2001-02-19 21:15:25 +00:00
|
|
|
// multiple signon messages are kept
|
|
|
|
sizebuf_t signon;
|
|
|
|
int num_signon_buffers;
|
2012-07-13 06:22:53 +00:00
|
|
|
int max_signon_buffers; // grows;
|
|
|
|
int *signon_buffer_size;
|
|
|
|
byte (*signon_buffers)[MAX_DATAGRAM];
|
2002-10-03 21:00:35 +00:00
|
|
|
|
|
|
|
// demo stuff
|
2010-01-13 06:44:29 +00:00
|
|
|
int recording_demo;
|
2005-05-01 09:07:20 +00:00
|
|
|
struct recorder_s *recorders;
|
2001-02-19 21:15:25 +00:00
|
|
|
} server_t;
|
|
|
|
|
|
|
|
#define NUM_SPAWN_PARMS 16
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef enum {
|
2001-02-19 21:15:25 +00:00
|
|
|
cs_free, // can be reused for a new connection
|
2003-03-03 17:08:45 +00:00
|
|
|
cs_server, // client is grabbed by the server for its own purposes
|
2001-02-19 21:15:25 +00:00
|
|
|
cs_zombie, // client has been disconnected, but don't reuse
|
|
|
|
// connection for a couple seconds
|
|
|
|
cs_connected, // has been assigned to a client_t, but not in game yet
|
|
|
|
cs_spawned // client is fully in game
|
|
|
|
} sv_client_state_t;
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef struct {
|
2001-02-19 21:15:25 +00:00
|
|
|
// received from client
|
|
|
|
|
|
|
|
// reply
|
|
|
|
double senttime;
|
|
|
|
float ping_time;
|
2012-06-28 07:03:56 +00:00
|
|
|
vec3_t playerpositions[MAX_CLIENTS];
|
2023-06-13 09:06:11 +00:00
|
|
|
bool playerpresent[MAX_CLIENTS];
|
2001-02-19 21:15:25 +00:00
|
|
|
packet_entities_t entities;
|
2005-04-30 03:59:23 +00:00
|
|
|
packet_players_t players;
|
2001-02-19 21:15:25 +00:00
|
|
|
} client_frame_t;
|
|
|
|
|
2005-05-02 00:45:25 +00:00
|
|
|
typedef enum {
|
|
|
|
dt_tp_normal,
|
|
|
|
dt_tp_demo,
|
2005-05-09 12:12:48 +00:00
|
|
|
dt_tp_qtv,
|
2005-05-02 00:45:25 +00:00
|
|
|
} delta_type_t;
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef enum {
|
|
|
|
dt_pvs_normal,
|
|
|
|
dt_pvs_fat,
|
|
|
|
dt_pvs_none,
|
|
|
|
} delta_pvs_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2005-05-02 00:45:25 +00:00
|
|
|
delta_type_t type;
|
2005-04-30 03:59:23 +00:00
|
|
|
delta_pvs_t pvs;
|
|
|
|
int delta_sequence;
|
|
|
|
int cur_frame;
|
|
|
|
int out_frame;
|
2005-04-30 08:45:17 +00:00
|
|
|
int in_frame;
|
2005-04-30 03:59:23 +00:00
|
|
|
struct client_s *client;
|
|
|
|
client_frame_t frames[UPDATE_BACKUP]; // updates can be deltad from here
|
|
|
|
} delta_t;
|
|
|
|
|
2001-07-22 07:03:32 +00:00
|
|
|
#define MAX_BACK_BUFFERS 8
|
2001-02-19 21:15:25 +00:00
|
|
|
#define MAX_STUFFTEXT 512
|
- fix a little mistake in SV_PrintToClient that'd cause it to
segfault if your first call was with "". Probably could cause
crashes too
- add a string.c file to libQFutil, with a Q_strcasestr function,
which strcasestr is defined to if it's not already defined. (we'd
get that with glibc if we defined __USE_GNU, but we don't)
- make client_t and SV_ExtractFromUserinfo both use NAME_MAX for
their name arrays, instead of 32 for one and 80 for the other
- rewrite almost all of SV_ExtractFromUserinfo's name handling.
- \r, \n, and \t are all converted to spaces
- leading/trailing spaces are stripped
- consecutive spaces are reduced to a single space
- empty names are considered bad
- user-* nicks are considered bad (unless forced to them)
- a name containing console or admin is considered bad
- a name that already exists is considered bad
- if they have a bad name it gets forced to user-%d, where %d is
their userid
- netname in the progs is now updated properly
- name changes are always reported unless it's the initial setting,
rather than only if they're full connected and not a spectator
- finally, if the name change fails (info string exceeded), give
them the boot. (before this was only done for duplicate names)
That's about it :)
2001-10-04 19:11:39 +00:00
|
|
|
#define MAX_NAME 32
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2001-09-09 04:51:08 +00:00
|
|
|
typedef enum {
|
|
|
|
ft_ban,
|
|
|
|
ft_mute, // mute penalty save over disconnect
|
|
|
|
ft_cuff, // cuff penatly save over disconnect
|
|
|
|
} filtertype_t;
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef struct client_s {
|
2001-02-19 21:15:25 +00:00
|
|
|
sv_client_state_t state;
|
2003-03-05 03:56:50 +00:00
|
|
|
int ping; // fake ping for server clients
|
2023-06-13 09:06:11 +00:00
|
|
|
bool prespawned;
|
|
|
|
bool spawned;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
int spectator; // non-interactive
|
|
|
|
|
2023-06-13 09:06:11 +00:00
|
|
|
bool sendinfo; // at end of frame, send info to all
|
2005-04-30 03:59:23 +00:00
|
|
|
// this prevents malicious multiple
|
|
|
|
// broadcasts
|
2001-02-19 21:15:25 +00:00
|
|
|
float lastnametime; // time of last name change
|
|
|
|
int lastnamecount; // time of last name change
|
2023-06-13 09:06:11 +00:00
|
|
|
bool drop; // lose this guy next opportunity
|
2001-02-19 21:15:25 +00:00
|
|
|
int lossage; // loss percentage
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
int userid; // identifying number
|
2001-11-04 07:50:39 +00:00
|
|
|
struct info_s *userinfo; // infostring
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
usercmd_t lastcmd; // for filling in big drops and partial predictions
|
|
|
|
double localtime; // of last message
|
|
|
|
int oldbuttons;
|
2002-09-13 04:30:18 +00:00
|
|
|
int oldonground;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
float maxspeed; // localized maxspeed
|
|
|
|
float entgravity; // localized ent gravity
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
struct edict_s *edict; // EDICT_NUM(clientnum+1)
|
|
|
|
char name[MAX_NAME]; // for printing to other people
|
2001-02-19 21:15:25 +00:00
|
|
|
// extracted from userinfo
|
|
|
|
int messagelevel; // for filtering printed messages
|
|
|
|
|
2010-01-13 06:42:26 +00:00
|
|
|
// the datagram is written to after every frame, but cleared only
|
2001-02-19 21:15:25 +00:00
|
|
|
// when it is sent out to the client. overflow is tolerated.
|
|
|
|
sizebuf_t datagram;
|
|
|
|
byte datagram_buf[MAX_DATAGRAM];
|
|
|
|
|
|
|
|
// back buffers for client reliable data
|
2004-02-22 05:40:08 +00:00
|
|
|
backbuf_t backbuf;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2005-06-08 06:35:48 +00:00
|
|
|
char stufftext_buf[MAX_STUFFTEXT];
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
double connection_started; // or time of disconnect for zombies
|
2023-06-13 09:06:11 +00:00
|
|
|
bool send_message; // set on frames a datagram arived on
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2012-06-28 07:03:56 +00:00
|
|
|
//antilag stuff
|
|
|
|
laggedentinfo_t laggedents[MAX_CLIENTS];
|
|
|
|
unsigned laggedents_count;
|
|
|
|
float laggedents_frac;
|
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
// spawn parms are carried from level to level
|
|
|
|
float spawn_parms[NUM_SPAWN_PARMS];
|
|
|
|
|
2012-05-21 23:23:22 +00:00
|
|
|
// client known data for deltas
|
2001-02-19 21:15:25 +00:00
|
|
|
int old_frags;
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
int stats[MAX_CL_STATS];
|
|
|
|
|
2005-04-30 08:45:17 +00:00
|
|
|
delta_t delta;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2002-08-27 07:16:28 +00:00
|
|
|
QFile *download; // file being downloaded
|
2001-02-19 21:15:25 +00:00
|
|
|
int downloadsize; // total bytes
|
|
|
|
int downloadcount; // bytes sent
|
|
|
|
|
|
|
|
int spec_track; // entnum of player tracking
|
|
|
|
|
|
|
|
double whensaid[10]; // JACK: For floodprots
|
|
|
|
int whensaidhead; // Head value for floodprots
|
|
|
|
double lockedtill;
|
|
|
|
|
2002-08-27 07:16:28 +00:00
|
|
|
QFile *upload;
|
2003-05-23 17:17:01 +00:00
|
|
|
struct dstring_s *uploadfn;
|
2022-03-31 08:27:04 +00:00
|
|
|
int upload_started;
|
2001-02-19 21:15:25 +00:00
|
|
|
netadr_t snap_from;
|
2023-06-13 09:06:11 +00:00
|
|
|
bool remote_snap;
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
//===== NETWORK ============
|
|
|
|
int chokecount;
|
|
|
|
netchan_t netchan;
|
|
|
|
int msecs, msec_cheating;
|
|
|
|
double last_check;
|
2001-09-09 04:51:08 +00:00
|
|
|
double cuff_time;
|
2001-09-11 03:50:24 +00:00
|
|
|
float stdver;
|
2001-02-19 21:15:25 +00:00
|
|
|
} client_t;
|
|
|
|
|
|
|
|
// a client can leave the server in one of four ways:
|
|
|
|
// dropping properly by quiting or disconnecting
|
|
|
|
// timing out if no valid messages are received for timeout->value seconds
|
|
|
|
// getting kicked off by the server operator
|
|
|
|
// a program error, like an overflowed reliable buffer
|
|
|
|
|
2023-06-13 09:06:11 +00:00
|
|
|
extern bool rcon_from_user; // current command is a from a user
|
2001-07-09 23:33:35 +00:00
|
|
|
|
|
|
|
//============================================================================
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define STATFRAMES 100
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef struct {
|
2001-02-19 21:15:25 +00:00
|
|
|
double active;
|
|
|
|
double idle;
|
2002-10-04 02:29:03 +00:00
|
|
|
double demo;
|
2001-02-19 21:15:25 +00:00
|
|
|
int count;
|
|
|
|
int packets;
|
|
|
|
|
|
|
|
double latched_active;
|
|
|
|
double latched_idle;
|
2002-10-04 02:29:03 +00:00
|
|
|
double latched_demo;
|
2001-02-19 21:15:25 +00:00
|
|
|
int latched_packets;
|
|
|
|
} svstats_t;
|
|
|
|
|
|
|
|
// MAX_CHALLENGES is made large to prevent a denial
|
|
|
|
// of service attack that could cycle all of them
|
|
|
|
// out before legitimate users connected
|
|
|
|
#define MAX_CHALLENGES 1024
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef struct {
|
2001-02-19 21:15:25 +00:00
|
|
|
netadr_t adr;
|
|
|
|
int challenge;
|
|
|
|
int time;
|
|
|
|
} challenge_t;
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef struct {
|
2001-02-19 21:15:25 +00:00
|
|
|
int spawncount; // number of servers spawned since start,
|
|
|
|
// used to check late spawns
|
|
|
|
client_t clients[MAX_CLIENTS];
|
2022-01-16 13:15:18 +00:00
|
|
|
unsigned maxclients;
|
|
|
|
unsigned num_clients;
|
2001-02-19 21:15:25 +00:00
|
|
|
int serverflags; // episode completion information
|
2011-12-22 04:42:39 +00:00
|
|
|
void (*phys_client) (struct edict_s *ent, int num);
|
2012-05-21 23:23:22 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
double last_heartbeat;
|
|
|
|
int heartbeat_sequence;
|
|
|
|
svstats_t stats;
|
|
|
|
|
2001-11-04 07:50:39 +00:00
|
|
|
info_t *info;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
// log messages are used so that fraglog processes can get stats
|
|
|
|
int logsequence; // the message currently being filled
|
|
|
|
double logtime; // time of last swap
|
|
|
|
sizebuf_t log[2];
|
|
|
|
byte log_buf[2][MAX_DATAGRAM];
|
|
|
|
|
|
|
|
challenge_t challenges[MAX_CHALLENGES]; // to prevent invalid IPs from connecting
|
2002-10-03 21:00:35 +00:00
|
|
|
|
|
|
|
// demo stuff
|
|
|
|
byte *demomem;
|
|
|
|
int demomemsize;
|
2001-02-19 21:15:25 +00:00
|
|
|
} server_static_t;
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// DoSflood protection
|
|
|
|
//=============================================================================
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef struct {
|
2001-02-19 21:15:25 +00:00
|
|
|
netadr_t adr;
|
|
|
|
double issued;
|
|
|
|
int floodcount;
|
|
|
|
int cmdcount;
|
|
|
|
double firstseen;
|
|
|
|
} flood_t;
|
|
|
|
|
2005-04-30 03:59:23 +00:00
|
|
|
typedef enum {
|
2001-02-19 21:15:25 +00:00
|
|
|
FLOOD_PING,
|
|
|
|
FLOOD_LOG,
|
|
|
|
FLOOD_CONNECT,
|
|
|
|
FLOOD_STATUS,
|
|
|
|
FLOOD_RCON,
|
|
|
|
FLOOD_BAN
|
|
|
|
} flood_enum_t;
|
|
|
|
|
|
|
|
#define DOSFLOODCMDS 6
|
|
|
|
#define DOSFLOODIP 64 // remember latest 64 IP's for each cmd.
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
// edict->movetype values
|
|
|
|
#define MOVETYPE_NONE 0 // never moves
|
|
|
|
#define MOVETYPE_ANGLENOCLIP 1
|
|
|
|
#define MOVETYPE_ANGLECLIP 2
|
|
|
|
#define MOVETYPE_WALK 3 // gravity
|
|
|
|
#define MOVETYPE_STEP 4 // gravity, special edge handling
|
|
|
|
#define MOVETYPE_FLY 5
|
|
|
|
#define MOVETYPE_TOSS 6 // gravity
|
|
|
|
#define MOVETYPE_PUSH 7 // no clip to world, push and crush
|
|
|
|
#define MOVETYPE_NOCLIP 8
|
|
|
|
#define MOVETYPE_FLYMISSILE 9 // extra size to monsters
|
|
|
|
#define MOVETYPE_BOUNCE 10
|
|
|
|
#define MOVETYPE_PPUSH 13 // no clip to world, push and crush
|
|
|
|
|
|
|
|
// edict->solid values
|
|
|
|
#define SOLID_NOT 0 // no interaction with other objects
|
|
|
|
#define SOLID_TRIGGER 1 // touch on edge, but not blocking
|
|
|
|
#define SOLID_BBOX 2 // touch on edge, block
|
|
|
|
#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground
|
|
|
|
#define SOLID_BSP 4 // bsp clip, touch on edge, block
|
|
|
|
|
|
|
|
// edict->deadflag values
|
|
|
|
#define DEAD_NO 0
|
|
|
|
#define DEAD_DYING 1
|
|
|
|
#define DEAD_DEAD 2
|
|
|
|
|
|
|
|
#define DAMAGE_NO 0
|
|
|
|
#define DAMAGE_YES 1
|
|
|
|
#define DAMAGE_AIM 2
|
|
|
|
|
|
|
|
// edict->flags
|
2012-06-28 07:03:56 +00:00
|
|
|
#define FL_FLY (1<<0)
|
|
|
|
#define FL_SWIM (1<<1)
|
|
|
|
#define FL_GLIMPSE (1<<2)
|
|
|
|
#define FL_CLIENT (1<<3)
|
|
|
|
#define FL_INWATER (1<<4)
|
|
|
|
#define FL_MONSTER (1<<5)
|
|
|
|
#define FL_GODMODE (1<<6)
|
|
|
|
#define FL_NOTARGET (1<<7)
|
|
|
|
#define FL_ITEM (1<<8)
|
|
|
|
#define FL_ONGROUND (1<<9)
|
|
|
|
#define FL_PARTIALGROUND (1<<10) // not all corners are valid
|
|
|
|
#define FL_WATERJUMP (1<<11) // player jumping out of water
|
2007-04-07 13:35:36 +00:00
|
|
|
// 4096 used by quakec
|
2012-06-28 07:03:56 +00:00
|
|
|
#define FL_FINALIZED (1<<13)
|
|
|
|
#define FL_FINDABLE_NONSOLID (1<<14)
|
|
|
|
#define FLQW_LAGGEDMOVE (1<<16)
|
2007-04-07 13:35:36 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
// entity effects
|
|
|
|
|
|
|
|
//define EF_BRIGHTFIELD 1
|
|
|
|
//define EF_MUZZLEFLASH 2
|
|
|
|
#define EF_BRIGHTLIGHT 4
|
|
|
|
#define EF_DIMLIGHT 8
|
|
|
|
|
|
|
|
|
|
|
|
#define SPAWNFLAG_NOT_EASY 256
|
|
|
|
#define SPAWNFLAG_NOT_MEDIUM 512
|
|
|
|
#define SPAWNFLAG_NOT_HARD 1024
|
|
|
|
#define SPAWNFLAG_NOT_DEATHMATCH 2048
|
|
|
|
|
|
|
|
#define MULTICAST_ALL 0
|
|
|
|
#define MULTICAST_PHS 1
|
|
|
|
#define MULTICAST_PVS 2
|
|
|
|
|
|
|
|
#define MULTICAST_ALL_R 3
|
|
|
|
#define MULTICAST_PHS_R 4
|
|
|
|
#define MULTICAST_PVS_R 5
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
// FIXME: declare exported variables in their own relevant .h
|
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int sv_hide_version_info;
|
|
|
|
extern int sv_highchars;
|
2001-07-31 18:27:49 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern float sv_mintic;
|
|
|
|
extern float sv_maxtic;
|
|
|
|
extern float sv_maxspeed;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern float sv_timeout;
|
2004-03-05 23:42:15 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
extern netadr_t master_adr[MAX_MASTERS]; // address of the master server
|
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int teamplay;
|
|
|
|
extern int deathmatch;
|
|
|
|
extern int timelimit;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
extern server_static_t svs; // persistant server info
|
|
|
|
extern server_t sv; // local server
|
|
|
|
|
|
|
|
extern client_t *host_client;
|
|
|
|
|
2001-08-27 21:09:13 +00:00
|
|
|
extern struct edict_s *sv_player;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
extern char localmodels[MAX_MODELS][5]; // inline model names for precache
|
|
|
|
|
2001-11-04 07:50:39 +00:00
|
|
|
extern struct info_s *localinfo;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2021-07-29 02:12:37 +00:00
|
|
|
extern size_t host_hunklevel;
|
2002-08-27 07:16:28 +00:00
|
|
|
extern QFile *sv_logfile;
|
|
|
|
extern QFile *sv_fraglogfile;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
extern double sv_frametime;
|
2001-04-10 06:55:28 +00:00
|
|
|
extern double realtime;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2001-09-11 03:10:29 +00:00
|
|
|
extern const char *client_info_filters[];
|
|
|
|
|
2002-07-31 05:19:03 +00:00
|
|
|
extern struct cbuf_s *sv_cbuf;
|
|
|
|
extern struct cbuf_args_s *sv_args;
|
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
//===========================================================
|
|
|
|
// FIXME: declare exported functions in their own relevant .h
|
|
|
|
|
|
|
|
void SV_Init (void);
|
2007-04-09 00:10:10 +00:00
|
|
|
void SV_Sbar_Init (void);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_Progs_Init (void);
|
|
|
|
void SV_Progs_Init_Cvars (void);
|
2001-08-03 06:40:28 +00:00
|
|
|
void SV_PR_Cmds_Init (void);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_LoadProgs (void);
|
|
|
|
|
2021-03-27 10:52:59 +00:00
|
|
|
void Con_Printf (const char *fmt, ...) __attribute__((format(PRINTF,1,2)));
|
|
|
|
void Con_DPrintf (const char *fmt, ...) __attribute__((format(PRINTF,1,2)));
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2003-01-06 18:28:13 +00:00
|
|
|
extern struct clip_hull_s *pf_hull_list[];
|
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
//
|
|
|
|
// sv_main.c
|
|
|
|
//
|
2001-09-09 04:51:08 +00:00
|
|
|
|
2021-12-27 08:54:58 +00:00
|
|
|
void SV_OutOfBand (netadr_t adr, unsigned length, byte *data);
|
|
|
|
void SV_OutOfBandPrint (netadr_t adr, const char *format, ...)
|
|
|
|
__attribute__ ((format (PRINTF,2,3)));
|
|
|
|
|
|
|
|
|
2003-03-04 03:35:12 +00:00
|
|
|
client_t *SV_AllocClient (int spectator, int server);
|
|
|
|
|
2001-09-09 04:51:08 +00:00
|
|
|
void SV_SavePenaltyFilter (client_t *cl, filtertype_t type, double pentime);
|
|
|
|
double SV_RestorePenaltyFilter (client_t *cl, filtertype_t type);
|
|
|
|
|
2020-03-21 13:24:11 +00:00
|
|
|
void SV_Shutdown (void *data);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_Frame (float time);
|
2001-07-15 07:04:17 +00:00
|
|
|
void SV_FinalMessage (const char *message);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_DropClient (client_t *drop);
|
2018-10-09 03:35:01 +00:00
|
|
|
int SV_CalcPing (client_t *cl) __attribute__((pure));
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_FullClientUpdate (client_t *client, sizebuf_t *buf);
|
2005-05-05 07:31:31 +00:00
|
|
|
void SV_FullClientUpdateToClient (client_t *client, backbuf_t *backbuf);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2018-10-09 03:35:01 +00:00
|
|
|
int SV_ModelIndex (const char *name) __attribute__((pure));
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2023-06-13 09:06:11 +00:00
|
|
|
bool SV_CheckBottom (struct edict_s *ent);
|
|
|
|
bool SV_movestep (struct edict_s *ent, const vec3_t move, bool relink);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
void SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg);
|
|
|
|
|
|
|
|
struct progs_s;
|
2022-02-14 03:28:38 +00:00
|
|
|
void SV_MoveToGoal (struct progs_s *pr, void *data);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
void SV_SaveSpawnparms (void);
|
|
|
|
|
2001-08-27 21:09:13 +00:00
|
|
|
void SV_Physics_Client (struct edict_s *ent);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2003-03-10 16:39:40 +00:00
|
|
|
void SV_PreRunCmd (void);
|
2023-06-13 09:06:11 +00:00
|
|
|
void SV_RunCmd (usercmd_t *ucmd, bool inside);
|
2003-03-10 16:39:40 +00:00
|
|
|
void SV_PostRunCmd (void);
|
2002-07-05 06:43:47 +00:00
|
|
|
void SV_SetupUserCommands (void);
|
2001-07-15 07:04:17 +00:00
|
|
|
void SV_ExecuteUserCommand (const char *s);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_InitOperatorCommands (void);
|
2003-02-16 19:46:34 +00:00
|
|
|
void SV_GIB_Init (void);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
void SV_SendServerinfo (client_t *client);
|
|
|
|
void SV_ExtractFromUserinfo (client_t *cl);
|
|
|
|
|
|
|
|
|
|
|
|
void Master_Heartbeat (void);
|
|
|
|
void Master_Packet (void);
|
|
|
|
|
|
|
|
//
|
|
|
|
// sv_init.c
|
|
|
|
//
|
2001-07-15 07:04:17 +00:00
|
|
|
void SV_SpawnServer (const char *server);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_FlushSignon (void);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// sv_phys.c
|
|
|
|
//
|
|
|
|
void SV_ProgStartFrame (void);
|
|
|
|
void SV_Physics (void);
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
void SV_Physics_Init_Cvars (void);
|
2001-08-27 21:09:13 +00:00
|
|
|
void SV_CheckVelocity (struct edict_s *ent);
|
2002-02-22 05:28:17 +00:00
|
|
|
void SV_AddGravity (struct edict_s *ent);
|
2012-04-28 05:53:15 +00:00
|
|
|
void SV_FinishGravity (struct edict_s *ent, vec3_t move);
|
2023-06-13 09:06:11 +00:00
|
|
|
bool SV_RunThink (struct edict_s *ent);
|
2001-08-27 21:09:13 +00:00
|
|
|
void SV_Physics_Toss (struct edict_s *ent);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_RunNewmis (void);
|
|
|
|
void SV_SetMoveVars(void);
|
2010-12-08 23:52:40 +00:00
|
|
|
struct trace_s;
|
|
|
|
int SV_FlyMove (struct edict_s *ent, float time, struct trace_s *steptrace);
|
2012-06-28 07:03:56 +00:00
|
|
|
struct trace_s SV_PushEntity (struct edict_s *ent, vec3_t push,
|
|
|
|
unsigned traceflags);
|
2018-10-09 03:35:01 +00:00
|
|
|
int SV_EntCanSupportJump (struct edict_s *ent) __attribute__((pure));
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// sv_send.c
|
|
|
|
//
|
2021-03-27 10:52:59 +00:00
|
|
|
void SV_Print (const char *fmt, va_list args) __attribute__((format(PRINTF, 1, 0)));
|
|
|
|
void SV_Printf (const char *fmt, ...) __attribute__((format(PRINTF,1,2)));
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_SendClientMessages (void);
|
2005-05-01 09:07:20 +00:00
|
|
|
void SV_GetStats (struct edict_s *ent, int spectator, int stats[]);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
2002-01-03 05:29:38 +00:00
|
|
|
void SV_Multicast (const vec3_t origin, int to);
|
2001-11-02 10:40:20 +00:00
|
|
|
void SV_StartSound (struct edict_s *entity, int channel, const char *sample,
|
2001-11-07 08:24:56 +00:00
|
|
|
int volume, float attenuation);
|
2021-03-27 10:52:59 +00:00
|
|
|
void SV_ClientPrintf (int recorder, client_t *cl, int level, const char *fmt, ...) __attribute__((format(PRINTF,4,5)));
|
|
|
|
void SV_BroadcastPrintf (int level, const char *fmt, ...) __attribute__((format(PRINTF,2,3)));
|
|
|
|
void SV_BroadcastCommand (const char *fmt, ...) __attribute__((format(PRINTF,1,2)));
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_SendMessagesToAll (void);
|
|
|
|
void SV_FindModelNumbers (void);
|
|
|
|
|
|
|
|
//
|
|
|
|
// sv_user.c
|
|
|
|
//
|
2003-04-28 15:56:09 +00:00
|
|
|
|
|
|
|
#define UCMD_NO_REDIRECT 1
|
|
|
|
#define UCMD_OVERRIDABLE 2
|
|
|
|
|
2005-05-02 04:09:15 +00:00
|
|
|
void SV_WriteWorldVars (netchan_t *netchan);
|
2005-05-02 09:00:17 +00:00
|
|
|
void SV_WriteSoundlist (netchan_t *netchan, int n);
|
|
|
|
void SV_WriteModellist (netchan_t *netchan, int n);
|
2005-05-05 07:31:31 +00:00
|
|
|
void SV_WriteSpawn1 (backbuf_t *backbuf, int n);
|
|
|
|
void SV_WriteSpawn2 (backbuf_t *backbuf);
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_ExecuteClientMessage (client_t *cl);
|
|
|
|
void SV_UserInit (void);
|
|
|
|
void SV_TogglePause (const char *msg);
|
2003-04-28 15:56:09 +00:00
|
|
|
void *SV_AddUserCommand (const char *name, void (*func) (void *userdata),
|
2003-05-16 16:17:24 +00:00
|
|
|
int flags,
|
|
|
|
void *userdata,
|
|
|
|
void (*on_free) (void *userdata));
|
2003-04-28 15:56:09 +00:00
|
|
|
int SV_RemoveUserCommand (void *cmd);
|
2003-08-21 03:50:30 +00:00
|
|
|
void SV_Spawn (client_t *client);
|
2003-11-21 06:09:21 +00:00
|
|
|
void SV_SetUserinfo (client_t *client, const char *key, const char *value);
|
|
|
|
extern int (*ucmd_unknown)(void);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// svonly.c
|
|
|
|
//
|
2003-11-21 06:09:21 +00:00
|
|
|
typedef enum {
|
|
|
|
RD_NONE,
|
|
|
|
RD_CLIENT,
|
|
|
|
RD_PACKET,
|
|
|
|
RD_MOD,
|
|
|
|
} redirect_t;
|
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
void SV_BeginRedirect (redirect_t rd);
|
|
|
|
void SV_EndRedirect (void);
|
2001-10-28 04:23:37 +00:00
|
|
|
extern redirect_t sv_redirected;
|
2003-12-22 20:51:08 +00:00
|
|
|
extern struct dstring_s outputbuf;
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// sv_ccmds.c
|
|
|
|
//
|
|
|
|
void SV_Status_f (void);
|
2018-10-09 03:35:01 +00:00
|
|
|
const char *SV_Current_Map (void) __attribute__((pure));
|
2003-11-21 06:09:21 +00:00
|
|
|
void SV_SetLocalinfo (const char *key, const char *value);
|
2003-04-13 20:31:06 +00:00
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// sv_ents.c
|
|
|
|
//
|
2005-04-30 08:45:17 +00:00
|
|
|
void SV_WriteEntitiesToClient (delta_t *delta, sizebuf_t *msg);
|
2001-02-19 21:15:25 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// sv_nchan.c
|
|
|
|
//
|
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
struct cvar_s;
|
|
|
|
void Cvar_Info (void *data, const struct cvar_s *cvar);
|
|
|
|
|
|
|
|
extern int sv_antilag;
|
|
|
|
extern float sv_antilag_frac;
|
|
|
|
extern int sv_timecheck_fuzz;
|
|
|
|
extern int sv_timecheck_decay;
|
|
|
|
extern int sv_maxrate;
|
|
|
|
extern int sv_timestamps;
|
|
|
|
extern char *sv_timefmt;
|
|
|
|
extern int sv_phs;
|
|
|
|
extern float sv_maxvelocity;
|
|
|
|
extern float sv_gravity;
|
|
|
|
extern int sv_jump_any;
|
|
|
|
extern float sv_aim;
|
|
|
|
extern float sv_stopspeed;
|
|
|
|
extern float sv_spectatormaxspeed;
|
|
|
|
extern float sv_accelerate;
|
|
|
|
extern float sv_airaccelerate;
|
|
|
|
extern float sv_wateraccelerate;
|
|
|
|
extern float sv_friction;
|
|
|
|
extern float sv_waterfriction;
|
|
|
|
extern int pr_double_remove;
|
|
|
|
extern int allow_download;
|
|
|
|
extern int allow_download_skins;
|
|
|
|
extern int allow_download_models;
|
|
|
|
extern int allow_download_sounds;
|
|
|
|
extern int allow_download_maps;
|
2001-10-29 17:46:03 +00:00
|
|
|
|
2001-10-28 04:23:37 +00:00
|
|
|
extern int fp_messages;
|
|
|
|
extern int fp_persecond;
|
|
|
|
extern int fp_secondsdead;
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int pausable;
|
2023-06-13 09:06:11 +00:00
|
|
|
extern bool nouse;
|
2001-10-28 04:23:37 +00:00
|
|
|
|
|
|
|
extern char fp_msg[255];
|
|
|
|
|
|
|
|
extern int sv_nailmodel, sv_supernailmodel, sv_playermodel;
|
|
|
|
|
2001-10-29 17:46:03 +00:00
|
|
|
extern int con_printf_no_log;
|
|
|
|
|
2011-12-22 04:42:39 +00:00
|
|
|
//FIXME location
|
|
|
|
#define STOP_EPSILON 0.1
|
|
|
|
|
2001-02-19 21:15:25 +00:00
|
|
|
#endif // _SERVER_H
|