From 9b59991ab3a934f96d48587b21feee02ef914072 Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 27 Aug 2004 00:45:34 +0000 Subject: [PATCH] Added support for Q2's nextserver command (for when playing cinamatics) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@62 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_user.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 7a394ff93..286f0689e 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -510,6 +510,22 @@ void SVQ2_BaseLines_f (void) MSG_WriteString (&host_client->netchan.message, va("cmd baselines %i %i\n",svs.spawncount, start) ); } } + +void SVQ2_NextServer_f (void) +{ + if (!*sv.modelname && atoi(Cmd_Argv(1)) == svs.spawncount) + { + cvar_t *nsv = Cvar_FindVar("nextserver"); + if (!nsv || !*nsv->string) + return; + + svs.spawncount++; // make sure another doesn't sneak in + + Cbuf_AddText(nsv->string, RESTRICT_LOCAL); + Cbuf_AddText("\n", RESTRICT_LOCAL); + Cvar_Set(nsv, ""); + } +} #endif /* @@ -2550,6 +2566,8 @@ ucmd_t ucmdsq2[] = { {"download", SV_BeginDownload_f}, {"nextdl", SV_NextDownload_f}, + {"nextserver", SVQ2_NextServer_f}, + {"vote", SV_Vote_f}, #ifdef SVRANKING @@ -2614,7 +2632,11 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC) { if (!fromQC) if (PR_UserCmd(s)) + { + host_client = oldhost; + SV_EndRedirect (); return; + } if (sv_cmdlikercon.value && host_client->rankid) { @@ -3914,7 +3936,7 @@ void SVQ2_ExecuteClientMessage (client_t *cl) cl->send_message = false; // don't reply, sequences have slipped // save time for ping calculations - cl->q2frames[cl->netchan.outgoing_sequence & UPDATE_MASK].senttime = realtime; + cl->q2frames[cl->netchan.outgoing_sequence & Q2UPDATE_MASK].senttime = realtime; // cl->q2frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1; host_client = cl;