mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-25 21:31:37 +00:00
*** empty log message ***
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@894 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
061024cf36
commit
2621cc6aad
19 changed files with 263 additions and 102 deletions
|
@ -2777,7 +2777,7 @@ void CL_SetInfo (void)
|
|||
|
||||
Con_DPrintf("SETINFO %s: %s=%s\n", player->name, key, value);
|
||||
|
||||
Info_SetValueForStarKey (player->userinfo, key, value, MAX_INFO_STRING);
|
||||
Info_SetValueForStarKey (player->userinfo, key, value, sizeof(player->userinfo));
|
||||
|
||||
CL_ProcessUserInfo (slot, player);
|
||||
}
|
||||
|
|
|
@ -439,7 +439,6 @@ int VM_LerpTag(void *out, model_t *model, int f1, int f2, float l2, char *tagnam
|
|||
|
||||
#define MAX_RENDER_STRINGS 8
|
||||
#define MAX_RENDER_STRING_LENGTH 32
|
||||
#define MAX_MAP_AREA_BYTES 16
|
||||
|
||||
typedef struct q3refdef_s {
|
||||
int x, y, width, height;
|
||||
|
@ -508,7 +507,7 @@ void VQ3_RenderView(const q3refdef_t *ref)
|
|||
|
||||
|
||||
|
||||
|
||||
#ifndef Q3CLIENT
|
||||
typedef struct {
|
||||
int handle;
|
||||
int modificationCount;
|
||||
|
@ -516,6 +515,7 @@ typedef struct {
|
|||
int integer;
|
||||
char string[256];
|
||||
} vmcvar_t;
|
||||
#endif
|
||||
|
||||
#ifndef _DEBUG
|
||||
static
|
||||
|
|
|
@ -26,6 +26,7 @@ int menuentsize;
|
|||
void VARGS PR_BIError(progfuncs_t *progfuncs, char *format, ...);
|
||||
void PF_cvar_string (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_cvar_set (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_dprint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_error (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
void PF_rint (progfuncs_t *prinst, struct globalvars_s *pr_globals);
|
||||
|
@ -362,24 +363,6 @@ void PF_search_getfilename (progfuncs_t *prinst, struct globalvars_s *pr_globals
|
|||
|
||||
|
||||
|
||||
void PF_developerprint (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
char *s;
|
||||
if (!developer.value)
|
||||
return;
|
||||
s = PF_VarString(prinst, 0, pr_globals);
|
||||
Con_Printf("%s", s);
|
||||
}
|
||||
void PF_print (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
char *s;
|
||||
s = PF_VarString(prinst, 0, pr_globals);
|
||||
Con_Printf("%s", s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void PF_cvar (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
@ -1123,7 +1106,7 @@ builtin_t menu_builtins[] = {
|
|||
PF_localcmd,//13
|
||||
PF_cvar,//14
|
||||
PF_cvar_set,//15
|
||||
PF_developerprint,//16
|
||||
PF_dprint,//16
|
||||
PF_ftos,//17
|
||||
PF_fabs,//18
|
||||
PF_vtos,//19
|
||||
|
|
|
@ -4750,7 +4750,7 @@ void Info_SetValueForStarKey (char *s, char *key, char *value, int maxsize)
|
|||
if (!value || !strlen(value))
|
||||
return;
|
||||
|
||||
sprintf (new, "\\%s\\%s", key, value);
|
||||
_snprintf (new, sizeof(new), "\\%s\\%s", key, value);
|
||||
|
||||
if ((int)(strlen(new) + strlen(s) + 1) > maxsize)
|
||||
{
|
||||
|
|
|
@ -32,8 +32,9 @@ typedef enum qboolean;//false and true are forcivly defined.
|
|||
typedef enum {false, true} qboolean;
|
||||
#endif
|
||||
|
||||
#define MAX_INFO_STRING 196
|
||||
#define MAX_SERVERINFO_STRING 512
|
||||
#define MAX_INFO_STRING 196 //regular quakeworld. Sickening isn't it.
|
||||
#define EXTENDED_INFO_STRING 1024
|
||||
#define MAX_SERVERINFO_STRING 1024 //standard quake has 512 here.
|
||||
#define MAX_LOCALINFO_STRING 32768
|
||||
|
||||
//============================================================================
|
||||
|
|
|
@ -863,7 +863,7 @@ typedef struct q1usercmd_s
|
|||
//ROGUE
|
||||
|
||||
|
||||
|
||||
#define MAX_MAP_AREA_BYTES 32
|
||||
|
||||
// edict->drawflags (hexen2 stuff)
|
||||
#define MLS_MASKIN 7 // Model Light Style
|
||||
|
|
|
@ -1039,6 +1039,17 @@ qboolean VM_Restart(vm_t *vm)
|
|||
return VM_Create(vm, name, syscall, syscallex)!=NULL;
|
||||
}
|
||||
|
||||
void *VM_MemoryBase(vm_t *vm)
|
||||
{
|
||||
switch(vm->type)
|
||||
{
|
||||
case VM_NATIVE:
|
||||
return NULL;
|
||||
case VM_BYTECODE:
|
||||
return ((qvm_t*)vm->hInst)->ds;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** VM_Call
|
||||
*/
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
//these structures are shared with the exe.
|
||||
|
||||
#define UIMAX_SCOREBOARDNAME 16
|
||||
#define UIMAX_INFO_STRING 196
|
||||
|
||||
#ifdef UIMAX_INFO_STRING
|
||||
#if MAX_INFO_STRING != UIMAX_INFO_STRING
|
||||
#pragma message("MAX_INFO_STRING doesn't match UIMAX_INFO_STRING")
|
||||
#endif
|
||||
#endif
|
||||
#define UIMAX_INFO_STRING EXTENDED_INFO_STRING
|
||||
|
||||
typedef struct {
|
||||
int userid;
|
||||
|
|
|
@ -356,7 +356,7 @@ LINK32=link.exe
|
|||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /G5 /ML /W3 /GX /ZI /Od /I "..\client" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /I "../libs/dxsdk7/include" /D "_DEBUG" /D "GLQUAKE" /D "WIN32" /D "_WINDOWS" /D "AVAIL_OGGVORBIS" /D "Q3CLIENT" /FR".\GLDebug/" /Fp".\GLDebug/qwcl.pch" /YX /Fo".\GLDebug/" /Fd".\GLDebug/" /FD /c
|
||||
# SUBTRACT BASE CPP /X
|
||||
# ADD CPP /nologo /G5 /W3 /GX /ZI /Od /I "..\client" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /I "../libs/dxsdk7/include" /D "_DEBUG" /D "GLQUAKE" /D "WIN32" /D "_WINDOWS" /D "AVAIL_OGGVORBIS" /D "Q3CLIENT" /Fp".\GLDebugQ3/qwcl.pch" /Yu"quakedef.h" /Fo".\GLDebugQ3/" /Fd".\GLDebugQ3/" /FD /c
|
||||
# ADD CPP /nologo /G5 /W3 /GX /ZI /Od /I "..\client" /I "../common" /I "../server" /I "../gl" /I "../sw" /I "../qclib" /I "../libs" /I "../libs/dxsdk7/include" /D "_DEBUG" /D "GLQUAKE" /D "WIN32" /D "_WINDOWS" /D "AVAIL_OGGVORBIS" /D "Q3CLIENT" /D "Q3SERVER" /FR /Fp".\GLDebugQ3/qwcl.pch" /Yu"quakedef.h" /Fo".\GLDebugQ3/" /Fd".\GLDebugQ3/" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
|
@ -367,7 +367,8 @@ BSC32=bscmake.exe
|
|||
LINK32=link.exe
|
||||
# ADD BASE LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /pdb:".\GLDebug/dglqwcl.pdb" /debug /machine:I386 /out:"../../fteglqw_dbg.exe"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"../../fteglqw_dbg.exe"
|
||||
# ADD LINK32 comctl32.lib wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteglqw_dbg.exe"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
@ -488,6 +489,59 @@ SOURCE=..\server\svq2_game.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\server\svq3_game.c
|
||||
|
||||
!IF "$(CFG)" == "ftequake - Win32 Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MinSW"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebugQ3"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\server\world.c
|
||||
# ADD CPP /Yu"qwsvdef.h"
|
||||
# End Source File
|
||||
|
@ -581,6 +635,8 @@ SOURCE=..\client\cl_cg.c
|
|||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
@ -1033,6 +1089,8 @@ SOURCE=..\client\clq3_parse.c
|
|||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
|
|
@ -1056,6 +1056,7 @@ void R_SetFrustum (void)
|
|||
if ((int)r_novis.value & 4)
|
||||
return;
|
||||
|
||||
/* removed - assumes fov_x == fov_y
|
||||
if (r_refdef.fov_x == 90)
|
||||
{
|
||||
// front side is visible
|
||||
|
@ -1067,6 +1068,7 @@ void R_SetFrustum (void)
|
|||
VectorSubtract (vpn, vup, frustum[3].normal);
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
|
||||
// rotate VPN right by FOV_X/2 degrees
|
||||
|
|
|
@ -573,14 +573,14 @@ void R_Set2DFrustum (void)
|
|||
viewang[2] = 0;
|
||||
AngleVectors (viewang, vpn, vright, vup);
|
||||
|
||||
if (r_refdef.fov_x == 90)
|
||||
/* if (r_refdef.fov_x == 90)
|
||||
{
|
||||
// front side is visible
|
||||
|
||||
VectorAdd (vpn, vright, frustum2d[0].normal);
|
||||
VectorSubtract (vpn, vright, frustum2d[1].normal);
|
||||
}
|
||||
else
|
||||
else*/
|
||||
{
|
||||
|
||||
// rotate VPN right by FOV_X/2 degrees
|
||||
|
|
|
@ -41,7 +41,7 @@ sizebuf_t *NQWriteDest (int dest);
|
|||
void NPP_SetInfo(client_t *cl, char *key, char *value)
|
||||
{
|
||||
int i;
|
||||
Info_SetValueForKey (cl->userinfo, key, value, MAX_INFO_STRING);
|
||||
Info_SetValueForKey (cl->userinfo, key, value, sizeof(cl->userinfo));
|
||||
if (!*Info_ValueForKey (cl->userinfo, "name"))
|
||||
cl->name[0] = '\0';
|
||||
else // process any changed values
|
||||
|
|
|
@ -42,7 +42,7 @@ typedef struct pmove_s pmove_t;
|
|||
|
||||
|
||||
|
||||
#define GAME_API_VERSION 3
|
||||
#define Q2GAME_API_VERSION 3
|
||||
|
||||
// edict->svflags
|
||||
|
||||
|
|
|
@ -292,6 +292,19 @@ typedef struct //merge?
|
|||
int senttime; // for ping calculations
|
||||
} q2client_frame_t;
|
||||
#endif
|
||||
#ifdef Q3SERVER
|
||||
#include "clq3defs.h"
|
||||
typedef struct //merge?
|
||||
{
|
||||
int flags;
|
||||
int areabytes;
|
||||
qbyte areabits[MAX_Q2MAP_AREAS/8]; // portalarea visibility bits
|
||||
q3playerState_t ps;
|
||||
int num_entities;
|
||||
int first_entity; // into the circular sv_packet_entities[]
|
||||
int senttime; // for ping calculations
|
||||
} q3client_frame_t;
|
||||
#endif
|
||||
|
||||
#define MAXCACHEDSOUNDBUFFERS 8
|
||||
typedef struct {
|
||||
|
@ -336,8 +349,9 @@ typedef struct client_s
|
|||
qboolean drop; // lose this guy next opportunity
|
||||
int lossage; // loss percentage
|
||||
|
||||
int challenge;
|
||||
int userid; // identifying number
|
||||
char userinfo[MAX_INFO_STRING]; // infostring
|
||||
char userinfo[EXTENDED_INFO_STRING]; // infostring
|
||||
|
||||
usercmd_t lastcmd; // for filling in big drops and partial predictions
|
||||
double localtime; // of last message
|
||||
|
@ -392,6 +406,9 @@ typedef struct client_s
|
|||
client_frame_t *frames; // updates can be deltad from here
|
||||
#ifdef Q2SERVER
|
||||
q2client_frame_t *q2frames;
|
||||
#endif
|
||||
#ifdef Q3SERVER
|
||||
q3client_frame_t *q3frames;
|
||||
#endif
|
||||
};
|
||||
FILE *download; // file being downloaded
|
||||
|
@ -400,6 +417,15 @@ typedef struct client_s
|
|||
|
||||
int spec_track; // entnum of player tracking
|
||||
|
||||
#ifdef Q3SERVER
|
||||
int gamestatesequence; //the sequence number the initial gamestate was sent in.
|
||||
int last_server_command_num;
|
||||
int last_client_command_num;
|
||||
int num_server_commands;
|
||||
int num_client_commands;
|
||||
char server_commands[1024][64];
|
||||
char last_client_command[1024];
|
||||
#endif
|
||||
#ifdef PEXT_CSQC
|
||||
int csqclastsentsequence;
|
||||
int csqcentsequence[MAX_EDICTS];//the sequence number a csqc entity was sent in
|
||||
|
@ -427,6 +453,7 @@ typedef struct client_s
|
|||
//===== NETWORK ============
|
||||
int chokecount;
|
||||
int delta_sequence; // -1 = no compression
|
||||
int last_sequence;
|
||||
netchan_t netchan;
|
||||
|
||||
int lastsequence_acknoledged;
|
||||
|
@ -618,8 +645,15 @@ typedef struct levelcache_s {
|
|||
char *mapname;
|
||||
} levelcache_t;
|
||||
|
||||
typedef enum {
|
||||
GT_PROGS, //q1, qw, h2 are similar enough that we consider it only one game mode. (We don't support the h2 protocol)
|
||||
GT_QUAKE2, //q2 servers run from a q2 game dll
|
||||
GT_QUAKE3 //q3 servers run off the q3 qvm api
|
||||
} gametype_e;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gametype_e gametype;
|
||||
int spawncount; // number of servers spawned since start,
|
||||
// used to check late spawns
|
||||
|
||||
|
|
|
@ -474,6 +474,8 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
func_t f;
|
||||
char *file;
|
||||
|
||||
gametype_e oldgametype;
|
||||
|
||||
edict_t *ent;
|
||||
#ifdef Q2SERVER
|
||||
q2edict_t *q2ent;
|
||||
|
@ -699,35 +701,44 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
svprogfuncs = NULL;
|
||||
}
|
||||
|
||||
sv.state = ss_loading;
|
||||
|
||||
oldgametype = svs.gametype;
|
||||
#ifdef Q3SERVER
|
||||
if (SVQ3_InitGame())
|
||||
svs.gametype = GT_QUAKE3;
|
||||
else
|
||||
#endif
|
||||
#ifdef Q2SERVER
|
||||
if ((sv.worldmodel->fromgame == fg_quake2 || sv.worldmodel->fromgame == fg_quake3) && !*progs.string && SVQ2_InitGameProgs()) //full q2 dll decision in one if statement
|
||||
{ //quake2 game support depends upon q2 style bsp clipping (fixable if we tried) also, don't use q2 dlls if a progs.dat was specified.
|
||||
for (i=0 ; i<MAX_CLIENTS ; i++) //we need to drop all non-q2 clients. We don't mix q1w with q2.
|
||||
{
|
||||
if (!svs.clients[i].isq2client && svs.clients[i].state)
|
||||
SV_DropClient(&svs.clients[i]);
|
||||
}
|
||||
}
|
||||
if ((sv.worldmodel->fromgame == fg_quake2 || sv.worldmodel->fromgame == fg_quake3) && !*progs.string && SVQ2_InitGameProgs()) //these are the rules for running a q2 server
|
||||
svs.gametype = GT_QUAKE2; //we loaded the dll
|
||||
else
|
||||
#endif
|
||||
{
|
||||
for (i=0 ; i<MAX_CLIENTS ; i++) //we need to drop all q2 clients. We don't mix q1w with q2.
|
||||
{
|
||||
if (svs.clients[i].isq2client && svs.clients[i].state)
|
||||
SV_DropClient(&svs.clients[i]);
|
||||
}
|
||||
svs.gametype = GT_PROGS; //let's just hope this loads.
|
||||
Q_InitProgs();
|
||||
}
|
||||
|
||||
#ifdef Q3SERVER
|
||||
if (svs.gametype != GT_QUAKE3)
|
||||
SVQ3_ShutdownGame();
|
||||
#endif
|
||||
#ifdef Q2SERVER
|
||||
if (ge) //we don't want the q2 stuff anymore.
|
||||
{
|
||||
SVQ2_ShutdownGameProgs ();
|
||||
ge = NULL;
|
||||
}
|
||||
if (svs.gametype != GT_QUAKE2) //we don't want the q2 stuff anymore.
|
||||
SVQ2_ShutdownGameProgs ();
|
||||
#endif
|
||||
|
||||
//load the progs.
|
||||
sv.state = ss_loading;
|
||||
Q_InitProgs();
|
||||
// if ((sv.worldmodel->fromgame == fg_quake2 || sv.worldmodel->fromgame == fg_quake3) && !*progs.string && SVQ2_InitGameProgs()) //full q2 dll decision in one if statement
|
||||
|
||||
if (oldgametype != svs.gametype)
|
||||
{
|
||||
for (i=0 ; i<MAX_CLIENTS ; i++) //server type changed, so we need to drop all clients. :(
|
||||
{
|
||||
if (svs.clients[i].state)
|
||||
SV_DropClient(&svs.clients[i]);
|
||||
|
||||
svs.clients[i].name[0] = '\0'; //kill all bots
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SERVERONLY
|
||||
|
@ -735,8 +746,9 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
SCR_BeginLoadingPlaque();
|
||||
#endif
|
||||
|
||||
if (svprogfuncs)
|
||||
switch (svs.gametype)
|
||||
{
|
||||
case GT_PROGS:
|
||||
ent = EDICT_NUM(svprogfuncs, 0);
|
||||
ent->isfree = false;
|
||||
|
||||
|
@ -767,10 +779,9 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
sv.csqcentversion[i] = 1; //force all csqc edicts to start off as version 1
|
||||
#endif
|
||||
|
||||
}
|
||||
break;
|
||||
#ifdef Q2SERVER
|
||||
else
|
||||
{
|
||||
case GT_QUAKE2:
|
||||
for (i=0 ; i<MAX_CLIENTS ; i++)
|
||||
{
|
||||
q2ent = Q2EDICT_NUM(i+1);
|
||||
|
@ -778,8 +789,9 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
svs.clients[i].q2edict = q2ent;
|
||||
}
|
||||
sv.allocated_client_slots = i;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef SERVERONLY
|
||||
current_loading_size+=10;
|
||||
|
@ -834,7 +846,7 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
if (eval) eval->_float = deathmatch.value;
|
||||
}
|
||||
eval = PR_FindGlobal(svprogfuncs, "randomclass", 0);
|
||||
if (eval) eval->_float = 1;
|
||||
if (eval) eval->_float = Cvar_Get("randomclass", "1", CVAR_LATCH, "Hexen2 rules")->value;
|
||||
|
||||
eval = PR_FindGlobal(svprogfuncs, "cl_playerclass", 0);
|
||||
if (eval) eval->_float = 1;
|
||||
|
@ -902,23 +914,33 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
char crc[12];
|
||||
sprintf(crc, "%i", CRC_Block(file, com_filesize));
|
||||
Info_SetValueForStarKey(svs.info, "*entfile", crc, MAX_SERVERINFO_STRING);
|
||||
if (svprogfuncs)
|
||||
switch(svs.gametype)
|
||||
{
|
||||
case GT_PROGS:
|
||||
pr_edict_size = PR_LoadEnts(svprogfuncs, file, spawnflagmask);
|
||||
break;
|
||||
#ifdef Q2SERVER
|
||||
else
|
||||
case GT_QUAKE2:
|
||||
ge->SpawnEntities(sv.name, file, startspot?startspot:"");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
BZ_Free(file);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info_SetValueForStarKey(svs.info, "*entfile", "", MAX_SERVERINFO_STRING);
|
||||
if (svprogfuncs)
|
||||
switch(svs.gametype)
|
||||
{
|
||||
case GT_PROGS:
|
||||
pr_edict_size = PR_LoadEnts(svprogfuncs, sv.worldmodel->entities, spawnflagmask);
|
||||
break;
|
||||
#ifdef Q2SERVER
|
||||
else
|
||||
case GT_QUAKE2:
|
||||
ge->SpawnEntities(sv.name, sv.worldmodel->entities, startspot?startspot:"");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SERVERONLY
|
||||
|
|
|
@ -845,14 +845,22 @@ void SVC_GetChallenge (void)
|
|||
char *buf;
|
||||
int lng;
|
||||
char *over;
|
||||
if (!svprogfuncs)//htons(net_from.port) == PORT_CLIENT) //quake 2 client port - this is a hack based on an evil assumtion.
|
||||
|
||||
#ifdef Q3SERVER
|
||||
if (svs.gametype == GT_QUAKE3) //q3 servers
|
||||
buf = va("challengeResponse %i", svs.challenges[i].challenge);
|
||||
else
|
||||
#endif
|
||||
#ifdef Q2SERVER
|
||||
if (svs.gametype == GT_QUAKE2) //quake 2 servers give a different challenge responce
|
||||
buf = va("challenge %i", svs.challenges[i].challenge);
|
||||
else
|
||||
#endif
|
||||
buf = va("%c%i", S2C_CHALLENGE, svs.challenges[i].challenge);
|
||||
|
||||
over = buf + strlen(buf) + 1;
|
||||
|
||||
if (svprogfuncs)
|
||||
if (svs.gametype == GT_PROGS)
|
||||
{
|
||||
#ifdef PROTOCOL_VERSION_FTE
|
||||
//tell the client what fte extensions we support
|
||||
|
@ -1048,6 +1056,21 @@ void VARGS SV_OutOfBandTPrintf (int q2, netadr_t adr, int language, translation_
|
|||
Netchan_OutOfBand (NS_SERVER, adr, strlen(string), (qbyte *)string);
|
||||
}
|
||||
|
||||
qboolean SV_ChallengePasses(int challenge)
|
||||
{
|
||||
int i;
|
||||
for (i=0 ; i<MAX_CHALLENGES ; i++)
|
||||
{ //one per ip.
|
||||
if (NET_CompareBaseAdr (net_from, svs.challenges[i].adr))
|
||||
{
|
||||
if (challenge == svs.challenges[i].challenge)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
SVC_DirectConnect
|
||||
|
@ -1164,17 +1187,14 @@ void SVC_DirectConnect
|
|||
if (sv.msgfromdemo || net_from.type == NA_LOOPBACK) //normal rules don't apply
|
||||
i=0;
|
||||
else
|
||||
{
|
||||
// see if the challenge is valid
|
||||
for (i=0 ; i<MAX_CHALLENGES ; i++)
|
||||
if (!SV_ChallengePasses(challenge))
|
||||
{
|
||||
if (NET_CompareBaseAdr (net_from, svs.challenges[i].adr))
|
||||
{
|
||||
if (challenge == svs.challenges[i].challenge)
|
||||
break; // good
|
||||
SV_OutOfBandPrintf (isquake2client, net_from, "\nBad challenge.\n");
|
||||
return;
|
||||
}
|
||||
SV_OutOfBandPrintf (isquake2client, net_from, "\nBad challenge.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (i == MAX_CHALLENGES)
|
||||
{
|
||||
SV_OutOfBandPrintf (isquake2client, net_from, "No challenge for address.\n");
|
||||
|
@ -1196,7 +1216,7 @@ void SVC_DirectConnect
|
|||
return;
|
||||
}
|
||||
Info_RemoveKey (userinfo[0], "spectator"); // remove key
|
||||
Info_SetValueForStarKey (userinfo[0], "*spectator", "1", MAX_INFO_STRING);
|
||||
Info_SetValueForStarKey (userinfo[0], "*spectator", "1", sizeof(userinfo[0]));
|
||||
spectator = true;
|
||||
}
|
||||
else
|
||||
|
@ -1685,7 +1705,7 @@ void SVC_DirectConnect
|
|||
if (spectator)
|
||||
{
|
||||
Info_RemoveKey (cl->userinfo, "spectator");
|
||||
Info_SetValueForStarKey (cl->userinfo, "*spectator", "1", MAX_INFO_STRING);
|
||||
Info_SetValueForStarKey (cl->userinfo, "*spectator", "1", sizeof(cl->userinfo));
|
||||
}
|
||||
else
|
||||
Info_RemoveKey (cl->userinfo, "*spectator");
|
||||
|
@ -1803,7 +1823,7 @@ void SVNQ_CheckForNewClients(void)
|
|||
{
|
||||
cl->state = cs_connected; //this is a real player
|
||||
*cl->userinfo = '\0';
|
||||
Info_SetValueForKey(cl->userinfo, "name", "unnamed", MAX_INFO_STRING);
|
||||
Info_SetValueForKey(cl->userinfo, "name", "unnamed", sizeof(cl->userinfo));
|
||||
SV_ExtractFromUserinfo(cl);
|
||||
|
||||
if (pr_global_struct->SetNewParms)
|
||||
|
@ -1998,7 +2018,15 @@ qboolean SV_ConnectionlessPacket (void)
|
|||
SVC_InfoQ2 ();
|
||||
else if (!strncmp(c,"connect", 7))
|
||||
{
|
||||
if (secure.value) //FIXME: possible problem for nq clients when enabled
|
||||
#ifdef Q3SERVER
|
||||
if (svs.gametype == GT_QUAKE3)
|
||||
{
|
||||
SVQ3_DirectConnect();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (secure.value) //FIXME: possible problem for nq clients when enabled
|
||||
Netchan_OutOfBandPrint (NS_SERVER, net_from, "%c\nThis server requires client validation.\nPlease use the "DISTRIBUTION" validation program\n", A2C_PRINT);
|
||||
else
|
||||
{
|
||||
|
@ -2433,6 +2461,14 @@ void SV_ReadPackets (void)
|
|||
continue;
|
||||
}
|
||||
|
||||
#ifdef Q3SERVER
|
||||
if (svs.gametype == GT_QUAKE3)
|
||||
{
|
||||
SVQ3_HandleClient();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
// read the qport out of the message so we can fix up
|
||||
// stupid address translating routers
|
||||
MSG_BeginReading ();
|
||||
|
@ -3310,7 +3346,7 @@ void SV_ExtractFromUserinfo (client_t *cl)
|
|||
else
|
||||
{
|
||||
|
||||
Info_SetValueForKey (cl->userinfo, "name", newname, MAX_INFO_STRING);
|
||||
Info_SetValueForKey (cl->userinfo, "name", newname, sizeof(cl->userinfo));
|
||||
if (!sv.paused) {
|
||||
if (!cl->lastnametime || realtime - cl->lastnametime > 5) {
|
||||
cl->lastnamecount = 0;
|
||||
|
@ -3342,7 +3378,7 @@ void SV_ExtractFromUserinfo (client_t *cl)
|
|||
}
|
||||
}
|
||||
|
||||
Info_SetValueForKey(cl->userinfo, "name", newname, MAX_INFO_STRING);
|
||||
Info_SetValueForKey(cl->userinfo, "name", newname, sizeof(cl->userinfo));
|
||||
|
||||
val = Info_ValueForKey (cl->userinfo, "lang");
|
||||
cl->language = atoi(val);
|
||||
|
@ -3494,6 +3530,8 @@ void SV_Init (quakeparms_t *parms)
|
|||
|
||||
Cmd_StuffCmds();
|
||||
|
||||
Cbuf_Execute ();
|
||||
|
||||
// if a map wasn't specified on the command line, spawn start.map
|
||||
if (sv.state == ss_dead)
|
||||
Cmd_ExecuteString ("map start", RESTRICT_LOCAL);
|
||||
|
|
|
@ -1940,8 +1940,8 @@ qboolean SV_Physics (void)
|
|||
edict_t *ent;
|
||||
static double old_time;
|
||||
|
||||
#ifdef Q2SERVER
|
||||
if (!svprogfuncs) //make tics multiples of sv_maxtic (defaults to 0.1)
|
||||
|
||||
if (svs.gametype != GT_PROGS) //make tics multiples of sv_maxtic (defaults to 0.1)
|
||||
{
|
||||
host_frametime = realtime - old_time;
|
||||
if (host_frametime < sv_maxtic.value && realtime)
|
||||
|
@ -1956,10 +1956,24 @@ qboolean SV_Physics (void)
|
|||
|
||||
sv.framenum++;
|
||||
sv.time = sv.framenum*100;
|
||||
ge->RunFrame();
|
||||
switch(svs.gametype)
|
||||
{
|
||||
#ifdef Q2SERVER
|
||||
case GT_QUAKE2:
|
||||
ge->RunFrame();
|
||||
break;
|
||||
#endif
|
||||
#ifdef Q3SERVER
|
||||
case GT_QUAKE3:
|
||||
SVQ3_RunFrame();
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// don't bother running a frame if sys_ticrate seconds haven't passed
|
||||
host_frametime = realtime - old_time;
|
||||
|
|
|
@ -1583,6 +1583,10 @@ void SV_BeginDownload_f(void)
|
|||
|
||||
|
||||
name = Cmd_Argv(1);
|
||||
|
||||
if (!strncmp(name, "demonum/", 8))
|
||||
name = SV_MVDNum(atoi(name+8));
|
||||
|
||||
// hacked by zoid to allow more conrol over download
|
||||
if (!SV_AllowDownload(name))
|
||||
{ // don't allow anything with .. path
|
||||
|
@ -2202,7 +2206,7 @@ void SV_SetInfo_f (void)
|
|||
|
||||
strcpy(oldval, Info_ValueForKey(host_client->userinfo, Cmd_Argv(1)));
|
||||
|
||||
Info_SetValueForKey (host_client->userinfo, Cmd_Argv(1), Cmd_Argv(2), MAX_INFO_STRING);
|
||||
Info_SetValueForKey (host_client->userinfo, Cmd_Argv(1), Cmd_Argv(2), sizeof(host_client->userinfo));
|
||||
// name is extracted below in ExtractFromUserInfo
|
||||
// strncpy (host_client->name, Info_ValueForKey (host_client->userinfo, "name")
|
||||
// , sizeof(host_client->name)-1);
|
||||
|
@ -2743,7 +2747,7 @@ void Cmd_Observe_f (void)
|
|||
|
||||
// turn the player into a spectator
|
||||
host_client->spectator = true;
|
||||
Info_SetValueForStarKey (host_client->userinfo, "*spectator", "1", MAX_INFO_STRING);
|
||||
Info_SetValueForStarKey (host_client->userinfo, "*spectator", "1", sizeof(host_client->userinfo));
|
||||
|
||||
// FIXME, bump the client's userid?
|
||||
|
||||
|
@ -3261,18 +3265,18 @@ void SVNQ_NQColour_f (void)
|
|||
if (progstype != PROG_QW)
|
||||
host_client->edict->v.team = bottom + 1;
|
||||
|
||||
Info_SetValueForKey(host_client->userinfo, "topcolor", va("%i", top), MAX_INFO_STRING);
|
||||
Info_SetValueForKey(host_client->userinfo, "bottomcolor", va("%i", bottom), MAX_INFO_STRING);
|
||||
Info_SetValueForKey(host_client->userinfo, "topcolor", va("%i", top), sizeof(host_client->userinfo));
|
||||
Info_SetValueForKey(host_client->userinfo, "bottomcolor", va("%i", bottom), sizeof(host_client->userinfo));
|
||||
switch(bottom)
|
||||
{
|
||||
case 4:
|
||||
Info_SetValueForKey(host_client->userinfo, "team", "red", MAX_INFO_STRING);
|
||||
Info_SetValueForKey(host_client->userinfo, "team", "red", sizeof(host_client->userinfo));
|
||||
break;
|
||||
case 14:
|
||||
Info_SetValueForKey(host_client->userinfo, "team", "blue", MAX_INFO_STRING);
|
||||
Info_SetValueForKey(host_client->userinfo, "team", "blue", sizeof(host_client->userinfo));
|
||||
break;
|
||||
default:
|
||||
Info_SetValueForKey(host_client->userinfo, "team", va("t%i", bottom+1), MAX_INFO_STRING);
|
||||
Info_SetValueForKey(host_client->userinfo, "team", va("t%i", bottom+1), sizeof(host_client->userinfo));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -729,9 +729,9 @@ qboolean SVQ2_InitGameProgs(void)
|
|||
|
||||
if (!ge)
|
||||
return false;
|
||||
if (ge->apiversion != GAME_API_VERSION)
|
||||
if (ge->apiversion != Q2GAME_API_VERSION)
|
||||
{
|
||||
Con_Printf("game is version %i, not %i", ge->apiversion, GAME_API_VERSION);
|
||||
Con_Printf("game is version %i, not %i", ge->apiversion, Q2GAME_API_VERSION);
|
||||
SVQ2_ShutdownGameProgs();
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue