//static qbool QW_CL_IsUploading(void);
static void QW_CL_StopUpload_f(cmd_state_t *cmd);
+static inline void CL_SetSignonStage_WithMsg(int signon_stage)
+{
+ cls.signon = signon_stage;
+ dpsnprintf(cl_connect_status, sizeof(cl_connect_status), "Connect: signon stage %i of %i", cls.signon, SIGNONS);
+ Con_DPrint(cl_connect_status);
+}
+
/*
==================
CL_ParseStartSoundPacket
// if we're still in signon stages, request the next one
if (cls.signon != SIGNONS)
{
- cls.signon = SIGNONS-1;
+ CL_SetSignonStage_WithMsg(SIGNONS - 1);
// we'll go to SIGNONS when the first entity update is received
MSG_WriteByte(&cls.netcon->message, qw_clc_stringcmd);
MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "begin %i", cl.qw_servercount));
return;
}
- cls.signon = 2;
+ CL_SetSignonStage_WithMsg(2);
cls.qw_downloadnumber = 0;
cls.qw_downloadtype = dl_model;
QW_CL_RequestNextDownload();
return;
}
- cls.signon = 2;
+ CL_SetSignonStage_WithMsg(2);
cls.qw_downloadnumber = 0;
cls.qw_downloadtype = dl_sound;
QW_CL_RequestNextDownload();
S_StopAllSounds();
cl.intermission = 0;
- cls.signon = 1; // not active anymore, but not disconnected
+ CL_SetSignonStage_WithMsg(1); // not active anymore, but not disconnected
Con_Printf("\nChanging map...\n");
}
An svc_signonnum has been received, perform a client side setup
=====================
*/
-static void CL_SignonReply (void)
+static void CL_SignonReply(int signon_stage)
{
+ CL_SetSignonStage_WithMsg(signon_stage);
+
Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
switch (cls.signon)
// (so that the server can see the player name while downloading)
CL_SendPlayerInfo();
- // execute cl_begindownloads next frame
- // (after any commands added by svc_stufftext have been executed)
- // when done with downloads the "prespawn" will be sent
- Cbuf_AddText(cmd_local, "\ncl_begindownloads\n");
-
//MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
//MSG_WriteString (&cls.netcon->message, "prespawn");
}
- else // playing a demo... make sure loading occurs as soon as possible
- CL_BeginDownloads(false);
+ // execute cl_begindownloads next frame
+ // (after any commands added by svc_stufftext have been executed)
+ // when done with downloads the "prespawn" will be sent
+ Cbuf_AddText(cmd_local, "\ncl_begindownloads\n");
break;
case 2:
cl.loadfinished = false;
cls.state = ca_connected;
- cls.signon = 1;
+ CL_SetSignonStage_WithMsg(1);
// note: on QW protocol we can't set up the gameworld until after
// downloads finish...
EntityFrameQW_CL_ReadFrame(false);
// first update is the final signon stage
if (cls.signon == SIGNONS - 1)
- {
- cls.signon = SIGNONS;
- CL_SignonReply ();
- }
+ CL_SignonReply(SIGNONS);
break;
case qw_svc_deltapacketentities:
EntityFrameQW_CL_ReadFrame(true);
// first update is the final signon stage
if (cls.signon == SIGNONS - 1)
- {
- cls.signon = SIGNONS;
- CL_SignonReply ();
- }
+ CL_SignonReply(SIGNONS);
break;
case qw_svc_maxspeed:
cmdlogname[cmdindex] = temp;
SHOWNET("fast update");
if (cls.signon == SIGNONS - 1)
- {
// first update is the final signon stage
- cls.signon = SIGNONS;
- CL_SignonReply ();
- }
+ CL_SignonReply(SIGNONS);
EntityFrameQuake_ReadEntity (cmd&127);
continue;
}
// reconnect somehow, so allow signon 1 even if at signon 1
if (i <= cls.signon && i != 1)
Host_Error ("Received signon %i when at %i", i, cls.signon);
- cls.signon = i;
- CL_SignonReply ();
+ CL_SignonReply(i);
break;
case svc_killedmonster:
break;
case svc_entities:
if (cls.signon == SIGNONS - 1)
- {
// first update is the final signon stage
- cls.signon = SIGNONS;
- CL_SignonReply ();
- }
+ CL_SignonReply(SIGNONS);
if (cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3)
EntityFrame_CL_ReadFrame();
else if (cls.protocol == PROTOCOL_DARKPLACES4)