fix some of the things that baker didn't like. sorry it took so long.
try to appease msvc6, just because. update the downloads menu. now even betterer!... fix proquake server angle snapping precision issue. also accept _glow textures as an alternative to the more standard _luma. compat for dp_water shader terms. tcgen stuff is still fscked up. menu tooltip code can now properly deal with variable width etc stuff. add missing te_flamejet builtin. r_dynamic -1 can now cope with q3bsp for a small speedup. added -watch commandline arg, to make it easier to figure out where cvar changes are coming from. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5015 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
8d2af6ff7b
commit
c08a0aa139
104 changed files with 3629 additions and 2828 deletions
|
@ -6101,8 +6101,6 @@ void QCBUILTIN PF_sqlversion (pubprogfuncs_t *prinst, struct globalvars_s *pr_gl
|
|||
|
||||
void PR_SQLCycle(void)
|
||||
{
|
||||
if (!SQL_Available())
|
||||
return;
|
||||
SQL_ServerCycle();
|
||||
}
|
||||
#endif
|
||||
|
@ -8313,6 +8311,36 @@ static void QCBUILTIN PF_te_explosion2(pubprogfuncs_t *prinst, struct globalvars
|
|||
SV_MulticastProtExt(org, MULTICAST_PHS, pr_global_struct->dimension_send, 0, 0);
|
||||
}
|
||||
|
||||
//DP_TE_FLAMEJET
|
||||
static void QCBUILTIN PF_te_flamejet(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
{
|
||||
float *org = G_VECTOR(OFS_PARM0);
|
||||
float *vel = G_VECTOR(OFS_PARM1);
|
||||
float howmany = bound(0,G_FLOAT(OFS_PARM2),255);
|
||||
|
||||
MSG_WriteByte (&sv.multicast, svc_temp_entity);
|
||||
MSG_WriteByte (&sv.multicast, TEDP_FLAMEJET);
|
||||
MSG_WriteCoord (&sv.multicast, org[0]);
|
||||
MSG_WriteCoord (&sv.multicast, org[1]);
|
||||
MSG_WriteCoord (&sv.multicast, org[2]);
|
||||
MSG_WriteCoord (&sv.multicast, vel[0]);
|
||||
MSG_WriteCoord (&sv.multicast, vel[1]);
|
||||
MSG_WriteCoord (&sv.multicast, vel[2]);
|
||||
MSG_WriteByte (&sv.multicast, howmany);
|
||||
#ifdef NQPROT
|
||||
MSG_WriteByte (&sv.nqmulticast, svc_temp_entity);
|
||||
MSG_WriteByte (&sv.nqmulticast, TEDP_FLAMEJET);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[0]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[1]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, org[2]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, vel[0]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, vel[1]);
|
||||
MSG_WriteCoord (&sv.nqmulticast, vel[2]);
|
||||
MSG_WriteByte (&sv.nqmulticast, howmany);
|
||||
#endif
|
||||
SV_MulticastProtExt(org, MULTICAST_PHS, pr_global_struct->dimension_send, 0, 0);
|
||||
}
|
||||
|
||||
//DP_TE_STANDARDEFFECTBUILTINS
|
||||
//void(entity own, vector start, vector end) te_lightning1 = #428;
|
||||
static void QCBUILTIN PF_te_lightning1(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||
|
@ -9843,6 +9871,8 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
|
|||
{"fputs", PF_fputs, 0, 0, 0, 113, D("void(filestream fhandle, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7)", "Writes the given string(s) into the file. For compatibility with fgets, you should ensure that the string is terminated with a \\n - this will not otherwise be done for you. It is up to the engine whether dos or unix line endings are actually written.")}, // (FRIK_FILE)
|
||||
{"fread", PF_fread, 0, 0, 0, 0, D("int(filestream fhandle, void *ptr, int size)", "Reads binary data out of the file. Returns truncated lengths if the read exceeds the length of the file.")},
|
||||
{"fwrite", PF_fwrite, 0, 0, 0, 0, D("int(filestream fhandle, void *ptr, int size)", "Writes binary data out of the file.")},
|
||||
{"fseek", PF_fseek, 0, 0, 0, 0, D("#define ftell fseek //c compat\nint(filestream fhandle, optional int newoffset)", "Changes the current position of the file, if specified. Returns prior position, in bytes.")},
|
||||
{"fsize", PF_fsize, 0, 0, 0, 0, D("int(filestream fhandle, optional int newsize)", "Reports the total size of the file, in bytes. Can also be used to truncate/extend the file")},
|
||||
{"strlen", PF_strlen, 0, 0, 0, 114, "float(string s)"}, // (FRIK_FILE)
|
||||
{"strcat", PF_strcat, 0, 0, 0, 115, "string(string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8)"}, // (FRIK_FILE)
|
||||
{"substring", PF_substring, 0, 0, 0, 116, "string(string s, float start, float length)"}, // (FRIK_FILE)
|
||||
|
@ -10279,7 +10309,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
|
|||
{"spawnclient", PF_spawnclient, 0, 0, 0, 454, "entity()"},//DP_SV_BOTCLIENT
|
||||
{"clienttype", PF_clienttype, 0, 0, 0, 455, "float(entity client)"},//botclient
|
||||
{"WriteUnterminatedString",PF_WriteString2,0, 0, 0, 456, "void(float target, string str)"}, //writestring but without the null terminator. makes things a little nicer.
|
||||
// {"te_flamejet", PF_te_flamejet, 0, 0, 0, 457, "void(vector org, vector vel, float howmany)"},//DP_TE_FLAMEJET
|
||||
{"te_flamejet", PF_te_flamejet, 0, 0, 0, 457, "void(vector org, vector vel, float howmany)"},//DP_TE_FLAMEJET
|
||||
// {"undefined", PF_Fixme, 0, 0, 0, 458, ""},
|
||||
{"edict_num", PF_edict_for_num, 0, 0, 0, 459, "entity(float entnum)"},//DP_QC_EDICT_NUM
|
||||
{"buf_create", PF_buf_create, 0, 0, 0, 460, "strbuf()"},//DP_QC_STRINGBUFFERS
|
||||
|
|
|
@ -1436,11 +1436,11 @@ static qintptr_t QVM_NextClient (void *offset, quintptr_t mask, const qintptr_t
|
|||
static qintptr_t QVM_SetPause (void *offset, quintptr_t mask, const qintptr_t *arg)
|
||||
{
|
||||
int pause = VM_LONG(arg[0]);
|
||||
if ((sv.paused&1) == (pause&1))
|
||||
return sv.paused&1; //nothing changed, ignore it.
|
||||
if ((sv.paused&PAUSE_EXPLICIT) == (pause&PAUSE_EXPLICIT))
|
||||
return !!(sv.paused&PAUSE_EXPLICIT); //nothing changed, ignore it.
|
||||
sv.paused = pause;
|
||||
sv.pausedstart = Sys_DoubleTime();
|
||||
return sv.paused&1;
|
||||
return !!(sv.paused&PAUSE_EXPLICIT);
|
||||
}
|
||||
static qintptr_t QVM_NotYetImplemented (void *offset, quintptr_t mask, const qintptr_t *arg)
|
||||
{
|
||||
|
|
|
@ -122,8 +122,13 @@ typedef struct
|
|||
int framenum;
|
||||
int logindatabase;
|
||||
|
||||
qboolean paused; // are we paused?
|
||||
float pausedstart;
|
||||
enum
|
||||
{
|
||||
PAUSE_EXPLICIT = 1, //someone hit pause
|
||||
PAUSE_SERVICE = 2, //we're running as a service and someone paused us rather than killing us.
|
||||
PAUSE_AUTO = 4 //console is down in a singleplayer game.
|
||||
} paused;
|
||||
float pausedstart;
|
||||
|
||||
//check player/eyes models for hacks
|
||||
unsigned model_player_checksum;
|
||||
|
|
|
@ -1198,10 +1198,6 @@ char *SV_BannedReason (netadr_t *a)
|
|||
return reason;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define strtoull _strtoui64
|
||||
#endif
|
||||
|
||||
static void SV_FilterIP_f (void)
|
||||
{
|
||||
bannedips_t proto;
|
||||
|
@ -2425,36 +2421,64 @@ static void SV_Gamedir (void)
|
|||
SV_Gamedir_f
|
||||
|
||||
Sets the gamedir and path to a different directory.
|
||||
FIXME: should block this if we're on a server at the time
|
||||
================
|
||||
*/
|
||||
static void SV_Gamedir_f (void)
|
||||
{
|
||||
char *dir;
|
||||
int argc = Cmd_Argc();
|
||||
|
||||
if (Cmd_Argc() == 1)
|
||||
if (argc == 1)
|
||||
{
|
||||
Con_TPrintf ("Current gamedir: %s\n", FS_GetGamedir(true));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
if (argc < 2)
|
||||
{
|
||||
Con_TPrintf ("Usage: gamedir <newgamedir>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dir = Cmd_Argv(1);
|
||||
if (argc == 2)
|
||||
dir = Z_StrDup(Cmd_Argv(1));
|
||||
else
|
||||
{
|
||||
int i;
|
||||
size_t l = 1;
|
||||
for (i = 1; i < argc; i++)
|
||||
l += strlen(Cmd_Argv(i))+1;
|
||||
dir = Z_Malloc(l);
|
||||
for (i = 1; i < argc; i++)
|
||||
{ //disgusting hack for quakespasm's "game extendedgame -missionpack" crap.
|
||||
//games with a leading hypen are inserted before others, with the hyphen ignored.
|
||||
if (*Cmd_Argv(i) != '-')
|
||||
continue;
|
||||
if (*dir)
|
||||
Q_strncatz(dir, ";", l);
|
||||
Q_strncatz(dir, Cmd_Argv(i)+1, l);
|
||||
}
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (*Cmd_Argv(i) == '-')
|
||||
continue;
|
||||
if (*dir)
|
||||
Q_strncatz(dir, ";", l);
|
||||
Q_strncatz(dir, Cmd_Argv(i), l);
|
||||
}
|
||||
}
|
||||
|
||||
if (strstr(dir, "..") || strstr(dir, "/")
|
||||
|| strstr(dir, "\\") || strstr(dir, ":") )
|
||||
{
|
||||
Con_TPrintf ("%s should be a single filename, not a path\n", Cmd_Argv(0));
|
||||
return;
|
||||
}
|
||||
|
||||
dir = Z_StrDup(dir);
|
||||
COM_Gamedir (dir, NULL);
|
||||
Info_SetValueForStarKey (svs.info, "*gamedir", dir, MAX_SERVERINFO_STRING);
|
||||
else
|
||||
{
|
||||
COM_Gamedir (dir, NULL);
|
||||
Info_SetValueForStarKey (svs.info, "*gamedir", dir, MAX_SERVERINFO_STRING);
|
||||
}
|
||||
Z_Free(dir);
|
||||
}
|
||||
|
||||
|
|
|
@ -260,6 +260,7 @@ void SV_Shutdown (void)
|
|||
#endif
|
||||
Cvar_Shutdown();
|
||||
Cmd_Shutdown();
|
||||
PM_Shutdown();
|
||||
|
||||
#ifdef WEBSERVER
|
||||
IWebShutdown();
|
||||
|
@ -764,7 +765,7 @@ void PIN_SaveMessages(void)
|
|||
f = FS_OpenVFS("pinned.txt", "wb", FS_GAMEONLY);
|
||||
if (!f)
|
||||
{
|
||||
Con_TPrintf("couldn't write to %s\n", "pinned.txt");
|
||||
Con_TPrintf(CON_ERROR "couldn't write to %s\n", "pinned.txt");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4203,7 +4204,7 @@ void SV_CheckTimeouts (void)
|
|||
cl->netchan.remote_address.type = NA_INVALID; //don't mess up from not knowing their address.
|
||||
}
|
||||
}
|
||||
if ((sv.paused&1) && !nclients)
|
||||
if ((sv.paused&PAUSE_EXPLICIT) && !nclients)
|
||||
{
|
||||
// nobody left, unpause the server
|
||||
if (SV_TogglePause(NULL))
|
||||
|
@ -4454,8 +4455,8 @@ float SV_Frame (void)
|
|||
/*server is effectively paused if there are no clients*/
|
||||
// if (sv.spawned_client_slots == 0 && sv.spawned_observer_slots == 0 && (cls.state != ca_connected))
|
||||
// isidle = true;
|
||||
if ((sv.paused & 4) != ((isidle||(sv.spawned_client_slots==0&&!deathmatch.ival))?4:0))
|
||||
sv.paused ^= 4;
|
||||
if ((sv.paused & PAUSE_AUTO) != ((isidle||(sv.spawned_client_slots==0&&!deathmatch.ival))?PAUSE_AUTO:0))
|
||||
sv.paused ^= PAUSE_AUTO;
|
||||
#endif
|
||||
|
||||
if (oldpaused != sv.paused)
|
||||
|
@ -5269,6 +5270,9 @@ void SV_ExecInitialConfigs(char *defaultexec)
|
|||
Cbuf_AddText("cvar_purgedefaults\n", RESTRICT_LOCAL); //reset cvar defaults to their engine-specified values. the tail end of 'exec default.cfg' will update non-cheat defaults to mod-specified values.
|
||||
Cbuf_AddText("cvarreset *\n", RESTRICT_LOCAL); //reset all cvars to their current (engine) defaults
|
||||
Cbuf_AddText("alias restart \"changelevel .\"\n",RESTRICT_LOCAL);
|
||||
|
||||
Cbuf_AddText(va("sv_gamedir \"%s\"\n", FS_GetGamedir(true)), RESTRICT_LOCAL);
|
||||
|
||||
Cbuf_AddText(defaultexec, RESTRICT_LOCAL);
|
||||
Cbuf_AddText("\n", RESTRICT_LOCAL);
|
||||
|
||||
|
@ -5360,6 +5364,7 @@ void SV_Init (quakeparms_t *parms)
|
|||
Plug_Initialise(true);
|
||||
#endif
|
||||
|
||||
Cvar_ParseWatches();
|
||||
host_initialized = true;
|
||||
|
||||
|
||||
|
|
|
@ -1777,7 +1777,7 @@ void SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg)
|
|||
bits |= SU_EXTEND1;
|
||||
if (bits >= (1u<<24))
|
||||
bits |= SU_EXTEND2;
|
||||
if (bits >= (1ull<<32))
|
||||
if (bits >= ((quint64_t)1u<<32))
|
||||
bits |= SU_EXTEND3;
|
||||
|
||||
// send the data
|
||||
|
|
|
@ -169,6 +169,7 @@ queryrequest_t *SQL_PullRequest(sqlserver_t *server, qboolean lock)
|
|||
sqlserver_t **sqlservers;
|
||||
int sqlservercount;
|
||||
int sqlavailable;
|
||||
int sqlinited;
|
||||
|
||||
#ifdef USE_SQLITE
|
||||
//this is to try to sandbox sqlite so it can only edit the file its originally opened with.
|
||||
|
@ -821,6 +822,9 @@ int SQL_NewServer(const char *driver, const char **paramstr)
|
|||
else // invalid driver choice so we bomb out
|
||||
return -1;
|
||||
|
||||
if (!SQL_Available()) //also makes sure the drivers are actually loaded.
|
||||
return -1;
|
||||
|
||||
if (!(sqlavailable & (1u<<drvchoice)))
|
||||
return -1;
|
||||
|
||||
|
@ -1020,6 +1024,25 @@ const char *SQL_Info(sqlserver_t *server)
|
|||
|
||||
qboolean SQL_Available(void)
|
||||
{
|
||||
if (!sqlinited)
|
||||
{
|
||||
sqlinited = true;
|
||||
#ifdef USE_MYSQL
|
||||
//mysql pokes network etc. there's no sandbox. people can use quake clients to pry upon private databases.
|
||||
if (COM_CheckParm("-mysql"))
|
||||
if (SQL_MYSQLInit())
|
||||
sqlavailable |= 1u<<SQLDRV_MYSQL;
|
||||
#endif
|
||||
#ifdef USE_SQLITE
|
||||
//our sqlite implementation is sandboxed. we block database attachments, and restrict the master database name.
|
||||
sqlitehandle = Sys_LoadLibrary("sqlite3", sqlitefuncs);
|
||||
if (sqlitehandle)
|
||||
{
|
||||
sqlavailable |= 1u<<SQLDRV_SQLITE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return !!sqlavailable;
|
||||
}
|
||||
|
||||
|
@ -1029,10 +1052,22 @@ void SQL_Status_f(void)
|
|||
int i;
|
||||
char *stat;
|
||||
|
||||
if (!SQL_Available())
|
||||
Con_Printf("No SQL library available.\n");
|
||||
SQL_Available(); //also ensures any drivers are loaded.
|
||||
#ifdef USE_MYSQL
|
||||
if (!COM_CheckParm("-mysql"))
|
||||
Con_Printf("mysql: %s\n", "requires -mysql cmdline argument");
|
||||
else
|
||||
Con_Printf("%i connections\n", sqlservercount);
|
||||
Con_Printf("mysql: %s\n", (sqlavailable&(1u<<SQLDRV_MYSQL))?"loaded":"unavailable");
|
||||
#else
|
||||
Con_Printf("mysql: %s\n", "disabled at compile time");
|
||||
#endif
|
||||
#ifdef USE_SQLITE
|
||||
Con_Printf("sqlite: %s\n", (sqlavailable&(1u<<SQLDRV_SQLITE))?"loaded":"unavailable");
|
||||
#else
|
||||
Con_Printf("sqlite: %s\n", "disabled at compile time");
|
||||
#endif
|
||||
|
||||
Con_Printf("%i connections\n", sqlservercount);
|
||||
for (i = 0; i < sqlservercount; i++)
|
||||
{
|
||||
int reqnum = 0;
|
||||
|
@ -1243,20 +1278,6 @@ qboolean SQL_MYSQLInit(void)
|
|||
void SQL_Init(void)
|
||||
{
|
||||
sqlavailable = 0;
|
||||
#ifdef USE_MYSQL
|
||||
//mysql pokes network etc. there's no sandbox. people can use quake clients to pry upon private databases.
|
||||
if (COM_CheckParm("-mysql"))
|
||||
if (SQL_MYSQLInit())
|
||||
sqlavailable |= 1u<<SQLDRV_MYSQL;
|
||||
#endif
|
||||
#ifdef USE_SQLITE
|
||||
//our sqlite implementation is sandboxed. we block database attachments, and restrict the master database name.
|
||||
sqlitehandle = Sys_LoadLibrary("sqlite3", sqlitefuncs);
|
||||
if (sqlitehandle)
|
||||
{
|
||||
sqlavailable |= 1u<<SQLDRV_SQLITE;
|
||||
}
|
||||
#endif
|
||||
|
||||
Cmd_AddCommand ("sqlstatus", SQL_Status_f);
|
||||
Cmd_AddCommand ("sqlkill", SQL_Kill_f);
|
||||
|
@ -1291,6 +1312,7 @@ void SQL_DeInit(void)
|
|||
sqlavailable = 0;
|
||||
|
||||
SQL_KillServers();
|
||||
sqlinited = false;
|
||||
|
||||
#ifdef USE_MYSQL
|
||||
if (qmysql_library_end)
|
||||
|
|
|
@ -1456,7 +1456,7 @@ void ServerMainLoop(void)
|
|||
MyServiceStatus.dwWaitHint = 0;
|
||||
|
||||
SetServiceStatus (ServerServiceStatusHandle, &MyServiceStatus);
|
||||
sv.paused |= 2;
|
||||
sv.paused |= PAUSE_SERVICE;
|
||||
break;
|
||||
case SERVICE_CONTROL_CONTINUE:
|
||||
// Initialization complete - report running status.
|
||||
|
@ -1466,7 +1466,7 @@ void ServerMainLoop(void)
|
|||
|
||||
SetServiceStatus (ServerServiceStatusHandle, &MyServiceStatus);
|
||||
|
||||
sv.paused &= ~2;
|
||||
sv.paused &= ~PAUSE_SERVICE;
|
||||
break;
|
||||
case SERVICE_CONTROL_STOP: //leave the loop
|
||||
return;
|
||||
|
|
|
@ -1069,15 +1069,17 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
|||
|
||||
if (client->prespawn_idx >= maxclientsupportedsounds || !sv.strings.sound_precache[client->prespawn_idx])
|
||||
{
|
||||
//write final-end-of-list
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
started = 0;
|
||||
|
||||
if (sv.strings.sound_precache[client->prespawn_idx] && !(client->plimitwarned & PLIMIT_SOUNDS))
|
||||
{
|
||||
client->plimitwarned |= PLIMIT_SOUNDS;
|
||||
SV_ClientPrintf(client, PRINT_HIGH, "WARNING: Your client's network protocol only supports %i sounds. Please upgrade or enable extensions.\n", client->prespawn_idx);
|
||||
}
|
||||
//write final-end-of-list
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
started = 0;
|
||||
|
||||
client->prespawn_stage++;
|
||||
client->prespawn_idx = 0;
|
||||
break;
|
||||
|
@ -1171,15 +1173,16 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
|||
|
||||
if (client->prespawn_idx >= client->maxmodels || !sv.strings.model_precache[client->prespawn_idx])
|
||||
{
|
||||
//write final-end-of-list
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
started = 0;
|
||||
|
||||
if (sv.strings.model_precache[client->prespawn_idx] && !(client->plimitwarned & PLIMIT_MODELS))
|
||||
{
|
||||
client->plimitwarned |= PLIMIT_MODELS;
|
||||
SV_ClientPrintf(client, PRINT_HIGH, "WARNING: Your client's network protocol only supports %i models. Please upgrade or enable extensions.\n", client->prespawn_idx);
|
||||
}
|
||||
//write final-end-of-list
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
MSG_WriteByte (&client->netchan.message, 0);
|
||||
started = 0;
|
||||
|
||||
client->prespawn_stage++;
|
||||
client->prespawn_idx = 0;
|
||||
|
@ -2045,7 +2048,7 @@ void SV_Begin_f (void)
|
|||
ClientReliableWrite_Begin (host_client, svc_setpause, 2);
|
||||
ClientReliableWrite_Byte (host_client, sv.paused!=0);
|
||||
}
|
||||
if (sv.paused&~4)
|
||||
if (sv.paused&~PAUSE_AUTO)
|
||||
SV_ClientTPrintf(host_client, PRINT_HIGH, "server is paused\n");
|
||||
}
|
||||
|
||||
|
@ -3781,7 +3784,7 @@ qboolean SV_TogglePause (client_t *initiator)
|
|||
{
|
||||
int newv;
|
||||
|
||||
newv = sv.paused^1;
|
||||
newv = sv.paused^PAUSE_EXPLICIT;
|
||||
|
||||
if (!PR_ShouldTogglePause(initiator, newv))
|
||||
return false;
|
||||
|
@ -3815,7 +3818,7 @@ void SV_Pause_f (void)
|
|||
|
||||
if (SV_TogglePause(host_client))
|
||||
{
|
||||
if (sv.paused & 1)
|
||||
if (sv.paused & PAUSE_EXPLICIT)
|
||||
SV_BroadcastTPrintf (PRINT_HIGH, "%s paused the game\n", host_client->name);
|
||||
else
|
||||
SV_BroadcastTPrintf (PRINT_HIGH, "%s unpaused the game\n", host_client->name);
|
||||
|
@ -5420,7 +5423,7 @@ void SVNQ_Begin_f (void)
|
|||
ClientReliableWrite_Begin (host_client, svc_setpause, 2);
|
||||
ClientReliableWrite_Byte (host_client, sv.paused!=0);
|
||||
}
|
||||
if (sv.paused&~4)
|
||||
if (sv.paused&~PAUSE_AUTO)
|
||||
SV_ClientTPrintf(host_client, PRINT_HIGH, "server is paused\n");
|
||||
}
|
||||
|
||||
|
@ -7238,11 +7241,6 @@ void SV_ExecuteClientMessage (client_t *cl)
|
|||
|
||||
if (sv_antilag.ival || !*sv_antilag.string)
|
||||
{
|
||||
/*
|
||||
extern cvar_t temp1;
|
||||
if (temp1.ival)
|
||||
frame = &cl->frameunion.frames[(cl->netchan.incoming_acknowledged+temp1.ival) & UPDATE_MASK];
|
||||
*/
|
||||
#ifdef warningmsg
|
||||
#pragma warningmsg("FIXME: make antilag optionally support non-player ents too")
|
||||
#endif
|
||||
|
|
|
@ -23,12 +23,12 @@ I think globals.maxentities is the hard cap, rather than current max like in q1.
|
|||
//I hope you're c99 and have a __func__
|
||||
#endif
|
||||
|
||||
extern cvar_t temp1;
|
||||
//extern cvar_t temp1;
|
||||
#define ignore(s) Con_DPrintf("Fixme: " s "\n")
|
||||
#define notimpl(l) Con_Printf("halflife sv builtin not implemented on line %i\n", l)
|
||||
#define notimpf(f) Con_Printf("halflife sv builtin %s not implemented\n", f)
|
||||
#define bi_begin() if (temp1.ival)Con_Printf("enter %s\n", __func__)
|
||||
#define bi_end() if (temp1.ival)Con_Printf("leave %s\n", __func__)
|
||||
#define bi_begin() //if (temp1.ival)Con_Printf("enter %s\n", __func__)
|
||||
#define bi_end() //if (temp1.ival)Con_Printf("leave %s\n", __func__)
|
||||
#define bi_trace() bi_begin(); bi_end()
|
||||
|
||||
|
||||
|
@ -2055,7 +2055,6 @@ static void SVHL_RunCmdR(hledict_t *ed, usercmd_t *ucmd)
|
|||
{
|
||||
int i;
|
||||
hledict_t *other;
|
||||
extern cvar_t temp1;
|
||||
|
||||
// chop up very long commands
|
||||
if (ucmd->msec > 50)
|
||||
|
|
|
@ -687,12 +687,25 @@ static int VARGS SVQ2_PointContents (vec3_t p)
|
|||
|
||||
static cvar_t *VARGS Q2Cvar_Get (const char *var_name, const char *value, int flags)
|
||||
{
|
||||
cvar_t *var = Cvar_Get(var_name, value, flags, "Quake2 game variables");
|
||||
cvar_t *var;
|
||||
//q2 gamecode knows about these flags. anything else is probably a bug, or 3rd-party extension.
|
||||
flags &= (CVAR_NOSET|CVAR_SERVERINFO|CVAR_USERINFO|CVAR_ARCHIVE|CVAR_LATCH);
|
||||
|
||||
var = Cvar_Get(var_name, value, flags, "Quake2 game variables");
|
||||
if (!var)
|
||||
{
|
||||
Con_Printf("Q2Cvar_Get: variable %s not creatable\n", var_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//allow this to change all < cvar_latch values.
|
||||
//this allows q2 dlls to apply different flags to a cvar without destroying our important ones (like cheat).
|
||||
flags |= var->flags;
|
||||
if (flags != var->flags)
|
||||
{
|
||||
var->flags = flags;
|
||||
Cvar_Set(var, var->string);
|
||||
}
|
||||
return var;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#define Z_TAG_BOTLIB 221726
|
||||
|
||||
botlib_export_t *FTE_GetBotLibAPI(int apiVersion, botlib_import_t *import)
|
||||
static botlib_export_t *FTE_GetBotLibAPI(int apiVersion, botlib_import_t *import)
|
||||
{ //a stub that will prevent botlib from loading.
|
||||
#ifdef BOTLIB_STATIC
|
||||
return GetBotLibAPI(apiVersion, import);
|
||||
|
@ -1598,22 +1598,22 @@ static int QDECL BL_FOpenFile(const char *name, fileHandle_t *handle, fsMode_t m
|
|||
{
|
||||
return VM_fopen((char*)name, (int*)handle, mode, Z_TAG_BOTLIB);
|
||||
}
|
||||
static int QDECL BL_FRead( void *buffer, int len, fileHandle_t f )
|
||||
static int QDECL BL_FRead(void *buffer, int len, fileHandle_t f)
|
||||
{
|
||||
return VM_FRead(buffer, len, (int)f, Z_TAG_BOTLIB);
|
||||
}
|
||||
//int BL_FWrite( const void *buffer, int len, fileHandle_t f )
|
||||
//{
|
||||
// return VM_FWrite(buffer, len, f, Z_TAG_BOTLIB);
|
||||
//}
|
||||
static void QDECL BL_FCloseFile( fileHandle_t f )
|
||||
static int QDECL BL_FWrite(const void *buffer, int len, fileHandle_t f)
|
||||
{
|
||||
return VM_FWrite(buffer, len, (int)f, Z_TAG_BOTLIB);
|
||||
}
|
||||
static void QDECL BL_FCloseFile(fileHandle_t f)
|
||||
{
|
||||
VM_fclose((int)f, Z_TAG_BOTLIB);
|
||||
}
|
||||
//int BL_Seek( fileHandle_t f )
|
||||
//{
|
||||
// VM_fseek(f, Z_TAG_BOTLIB)
|
||||
//}
|
||||
static int QDECL BL_Seek(fileHandle_t f, long offset, int seektype)
|
||||
{ // on success, apparently returns 0
|
||||
return VM_FSeek((int)f, offset, seektype, Z_TAG_BOTLIB)?0:-1;
|
||||
}
|
||||
static char *QDECL BL_BSPEntityData(void)
|
||||
{
|
||||
return sv.world.worldmodel->entities;
|
||||
|
@ -1705,6 +1705,12 @@ static void QDECL BL_BotClientCommand(int clientnum, char *command)
|
|||
VM_Call(q3gamevm, GAME_CLIENT_COMMAND, clientnum);
|
||||
}
|
||||
|
||||
static int QDECL BL_DebugLineCreate(void) {return 0;}
|
||||
static void QDECL BL_DebugLineDelete(int line) {}
|
||||
static void QDECL BL_DebugLineShow(int line, vec3_t start, vec3_t end, int color) {}
|
||||
static int QDECL BL_DebugPolygonCreate(int color, int numPoints, vec3_t *points) {return 0;}
|
||||
static void QDECL BL_DebugPolygonDelete(int id) {}
|
||||
|
||||
#endif
|
||||
|
||||
static void SV_InitBotLib(void)
|
||||
|
@ -1731,15 +1737,15 @@ static void SV_InitBotLib(void)
|
|||
import.HunkAlloc = BL_HunkMalloc;
|
||||
import.FS_FOpenFile = BL_FOpenFile;
|
||||
import.FS_Read = BL_FRead;
|
||||
// import.FS_Write = BL_FWrite;
|
||||
import.FS_Write = BL_FWrite;
|
||||
import.FS_FCloseFile = BL_FCloseFile;
|
||||
// import.FS_Seek = BL_Seek;
|
||||
// import.DebugLineCreate
|
||||
// import.DebugLineDelete
|
||||
// import.DebugLineShow
|
||||
//
|
||||
// import.DebugPolygonCreate
|
||||
// import.DebugPolygonDelete
|
||||
import.FS_Seek = BL_Seek;
|
||||
|
||||
import.DebugLineCreate = BL_DebugLineCreate;
|
||||
import.DebugLineDelete = BL_DebugLineDelete;
|
||||
import.DebugLineShow = BL_DebugLineShow;
|
||||
import.DebugPolygonCreate= BL_DebugPolygonCreate;
|
||||
import.DebugPolygonDelete = BL_DebugPolygonDelete;
|
||||
|
||||
// Z_FreeTags(Z_TAG_BOTLIB);
|
||||
botlibmemoryavailable = 1024*1024*16;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue