diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index c66b58d38..b138a5b69 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -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); } diff --git a/engine/client/cl_ui.c b/engine/client/cl_ui.c index 1cbff947b..31982e432 100644 --- a/engine/client/cl_ui.c +++ b/engine/client/cl_ui.c @@ -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 diff --git a/engine/client/pr_menu.c b/engine/client/pr_menu.c index 005211fed..9105dc17b 100644 --- a/engine/client/pr_menu.c +++ b/engine/client/pr_menu.c @@ -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 diff --git a/engine/common/common.c b/engine/common/common.c index d441cd7e5..323abc93a 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -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) { diff --git a/engine/common/common.h b/engine/common/common.h index b4cec52b1..9438039fc 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -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 //============================================================================ diff --git a/engine/common/protocol.h b/engine/common/protocol.h index a731d1982..cae845f0c 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -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 diff --git a/engine/common/qvm.c b/engine/common/qvm.c index 9ee3fca0e..1cefe351d 100644 --- a/engine/common/qvm.c +++ b/engine/common/qvm.c @@ -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 */ diff --git a/engine/common/ui_public.h b/engine/common/ui_public.h index 97b3e61c9..c50b704ff 100644 --- a/engine/common/ui_public.h +++ b/engine/common/ui_public.h @@ -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; diff --git a/engine/ftequake/ftequake.dsp b/engine/ftequake/ftequake.dsp index 92e3e9297..bfdcdde9d 100644 --- a/engine/ftequake/ftequake.dsp +++ b/engine/ftequake/ftequake.dsp @@ -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 diff --git a/engine/gl/gl_rmain.c b/engine/gl/gl_rmain.c index 14d2b3146..4db9c850a 100644 --- a/engine/gl/gl_rmain.c +++ b/engine/gl/gl_rmain.c @@ -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 diff --git a/engine/gl/glmod_doom.c b/engine/gl/glmod_doom.c index c012dec22..87870a2ef 100644 --- a/engine/gl/glmod_doom.c +++ b/engine/gl/glmod_doom.c @@ -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 diff --git a/engine/server/net_preparse.c b/engine/server/net_preparse.c index ebc949780..005b91fec 100644 --- a/engine/server/net_preparse.c +++ b/engine/server/net_preparse.c @@ -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 diff --git a/engine/server/q2game.h b/engine/server/q2game.h index 4698a9356..f6dfc82e2 100644 --- a/engine/server/q2game.h +++ b/engine/server/q2game.h @@ -42,7 +42,7 @@ typedef struct pmove_s pmove_t; -#define GAME_API_VERSION 3 +#define Q2GAME_API_VERSION 3 // edict->svflags diff --git a/engine/server/server.h b/engine/server/server.h index 8778d8d08..4c3ccdaf1 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -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 diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index 7febbb92e..b1e4d776f 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -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 ; ifromgame == 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 ; ifromgame == 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 ; iisfree = 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_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 diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index 2c409bf91..568f2a813 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -844,15 +844,23 @@ 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. + char *over; + +#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 ; iuserinfo, "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 { @@ -2432,7 +2460,15 @@ void SV_ReadPackets (void) #endif 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); diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index c28ef9fe9..492f46adc 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -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; diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index c36f08b63..4d4be5d86 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -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; } diff --git a/engine/server/svq2_game.c b/engine/server/svq2_game.c index 3facb61ef..57a4c0011 100644 --- a/engine/server/svq2_game.c +++ b/engine/server/svq2_game.c @@ -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; }