mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-12 23:44:39 +00:00
Add DP_SV_SHUTDOWN, for qqshka.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6267 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
1068a62d75
commit
d7454f4f78
4 changed files with 29 additions and 3 deletions
|
@ -7969,6 +7969,7 @@ qc_extension_t QSG_Extensions[] = {
|
||||||
{"DP_SV_PRINT", NULL, 1,{"print"}, "Says that the print builtin can be used from nqssqc (as well as just csqc), bypassing the developer cvar issues."},
|
{"DP_SV_PRINT", NULL, 1,{"print"}, "Says that the print builtin can be used from nqssqc (as well as just csqc), bypassing the developer cvar issues."},
|
||||||
{"DP_SV_ROTATINGBMODEL", check_notrerelease,0,{NULL}, "Engines that support this support avelocity on MOVETYPE_PUSH entities, pushing entities out of the way as needed."},
|
{"DP_SV_ROTATINGBMODEL", check_notrerelease,0,{NULL}, "Engines that support this support avelocity on MOVETYPE_PUSH entities, pushing entities out of the way as needed."},
|
||||||
{"DP_SV_SETCOLOR", NULL, 1,{"setcolor"}},
|
{"DP_SV_SETCOLOR", NULL, 1,{"setcolor"}},
|
||||||
|
{"DP_SV_SHUTDOWN"},
|
||||||
{"DP_SV_SPAWNFUNC_PREFIX"},
|
{"DP_SV_SPAWNFUNC_PREFIX"},
|
||||||
{"DP_SV_WRITEPICTURE", NULL, 1,{"WritePicture"}},
|
{"DP_SV_WRITEPICTURE", NULL, 1,{"WritePicture"}},
|
||||||
{"DP_SV_WRITEUNTERMINATEDSTRING", NULL, 1,{"WriteUnterminatedString"}},
|
{"DP_SV_WRITEUNTERMINATEDSTRING", NULL, 1,{"WriteUnterminatedString"}},
|
||||||
|
|
|
@ -168,6 +168,7 @@ static struct {
|
||||||
func_t ParseClusterEvent; //FTE_SV_CLUSTER
|
func_t ParseClusterEvent; //FTE_SV_CLUSTER
|
||||||
func_t ParseClientCommand; //KRIMZON_SV_PARSECLIENTCOMMAND
|
func_t ParseClientCommand; //KRIMZON_SV_PARSECLIENTCOMMAND
|
||||||
func_t ParseConnectionlessPacket; //FTE_QC_SENDPACKET
|
func_t ParseConnectionlessPacket; //FTE_QC_SENDPACKET
|
||||||
|
func_t SV_Shutdown;
|
||||||
|
|
||||||
func_t PausedTic;
|
func_t PausedTic;
|
||||||
func_t ShouldPause;
|
func_t ShouldPause;
|
||||||
|
@ -1117,6 +1118,7 @@ void PR_LoadGlabalStruct(qboolean muted)
|
||||||
gfuncs.ParseClusterEvent = PR_FindFunction(svprogfuncs, "SV_ParseClusterEvent", PR_ANY);
|
gfuncs.ParseClusterEvent = PR_FindFunction(svprogfuncs, "SV_ParseClusterEvent", PR_ANY);
|
||||||
gfuncs.ParseClientCommand = PR_FindFunction(svprogfuncs, "SV_ParseClientCommand", PR_ANY);
|
gfuncs.ParseClientCommand = PR_FindFunction(svprogfuncs, "SV_ParseClientCommand", PR_ANY);
|
||||||
gfuncs.ParseConnectionlessPacket = PR_FindFunction(svprogfuncs, "SV_ParseConnectionlessPacket", PR_ANY);
|
gfuncs.ParseConnectionlessPacket = PR_FindFunction(svprogfuncs, "SV_ParseConnectionlessPacket", PR_ANY);
|
||||||
|
gfuncs.SV_Shutdown = PR_FindFunction(svprogfuncs, "SV_Shutdown", PR_ANY);
|
||||||
|
|
||||||
gfuncs.UserInfo_Changed = PR_FindFunction(svprogfuncs, "UserInfo_Changed", PR_ANY);
|
gfuncs.UserInfo_Changed = PR_FindFunction(svprogfuncs, "UserInfo_Changed", PR_ANY);
|
||||||
gfuncs.localinfoChanged = PR_FindFunction(svprogfuncs, "localinfoChanged", PR_ANY);
|
gfuncs.localinfoChanged = PR_FindFunction(svprogfuncs, "localinfoChanged", PR_ANY);
|
||||||
|
@ -2626,6 +2628,24 @@ void PR_LocalInfoChanged(char *name, char *oldivalue, char *newvalue)
|
||||||
PR_ExecuteProgram (svprogfuncs, gfuncs.localinfoChanged);
|
PR_ExecuteProgram (svprogfuncs, gfuncs.localinfoChanged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void PR_PreShutdown(void)
|
||||||
|
{
|
||||||
|
if (svprogfuncs && gfuncs.SV_Shutdown && sv.state)
|
||||||
|
{
|
||||||
|
func_t f = gfuncs.SV_Shutdown;
|
||||||
|
globalvars_t *pr_globals;
|
||||||
|
gfuncs.SV_Shutdown = 0; //clear it early, to avoid (severe) recursion/whatever problems.
|
||||||
|
pr_globals = PR_globals(svprogfuncs, PR_CURRENT);
|
||||||
|
|
||||||
|
pr_global_struct->time = sv.world.physicstime;
|
||||||
|
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, sv.world.edicts);
|
||||||
|
|
||||||
|
G_INT(OFS_PARM0) = 0;
|
||||||
|
G_INT(OFS_PARM1) = 0;
|
||||||
|
G_INT(OFS_PARM2) = 0;
|
||||||
|
PR_ExecuteProgram (svprogfuncs, f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void QC_Clear(void)
|
void QC_Clear(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,6 +135,7 @@ extern int pr_teamfield;
|
||||||
qboolean PR_QCChat(char *text, int say_type);
|
qboolean PR_QCChat(char *text, int say_type);
|
||||||
|
|
||||||
void PR_ClientUserInfoChanged(char *name, char *oldivalue, char *newvalue);
|
void PR_ClientUserInfoChanged(char *name, char *oldivalue, char *newvalue);
|
||||||
|
void PR_PreShutdown(void);
|
||||||
void PR_LocalInfoChanged(char *name, char *oldivalue, char *newvalue);
|
void PR_LocalInfoChanged(char *name, char *oldivalue, char *newvalue);
|
||||||
void PF_InitTempStrings(pubprogfuncs_t *inst);
|
void PF_InitTempStrings(pubprogfuncs_t *inst);
|
||||||
|
|
||||||
|
|
|
@ -611,6 +611,8 @@ void SV_UnspawnServer (void) //terminate the running server.
|
||||||
Con_TPrintf("Server ended\n");
|
Con_TPrintf("Server ended\n");
|
||||||
SV_FinalMessage("Server unspawned\n");
|
SV_FinalMessage("Server unspawned\n");
|
||||||
|
|
||||||
|
PR_PreShutdown();
|
||||||
|
|
||||||
#ifdef SUBSERVERS
|
#ifdef SUBSERVERS
|
||||||
if (sv.state == ss_clustermode && svs.allocated_client_slots == 1)
|
if (sv.state == ss_clustermode && svs.allocated_client_slots == 1)
|
||||||
MSV_Shutdown();
|
MSV_Shutdown();
|
||||||
|
@ -868,9 +870,6 @@ void SV_SpawnServer (const char *server, const char *startspot, qboolean noents,
|
||||||
|
|
||||||
Con_DPrintf ("SpawnServer: %s\n",server);
|
Con_DPrintf ("SpawnServer: %s\n",server);
|
||||||
|
|
||||||
svs.spawncount++; // any partially connected client will be restarted
|
|
||||||
sv.world.spawncount = svs.spawncount;
|
|
||||||
|
|
||||||
#ifndef SERVERONLY
|
#ifndef SERVERONLY
|
||||||
total_loading_size = 100;
|
total_loading_size = 100;
|
||||||
current_loading_size = 0;
|
current_loading_size = 0;
|
||||||
|
@ -879,6 +878,11 @@ void SV_SpawnServer (const char *server, const char *startspot, qboolean noents,
|
||||||
SCR_ImageName(server);
|
SCR_ImageName(server);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
PR_PreShutdown();
|
||||||
|
|
||||||
|
svs.spawncount++; // any partially connected client will be restarted
|
||||||
|
sv.world.spawncount = svs.spawncount;
|
||||||
|
|
||||||
sv.state = ss_dead;
|
sv.state = ss_dead;
|
||||||
|
|
||||||
if (sv.gamedirchanged)
|
if (sv.gamedirchanged)
|
||||||
|
|
Loading…
Reference in a new issue