X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=cl_demo.c;h=2b7f060b062bb0fe67b52814721799f29a8da0c8;hb=9c0b9e9bf48754ac5984a5eb5682fc869bb98277;hp=c6402413e5239946dc832227a7cfc798694d4c8e;hpb=ff46d6ff516fda192c5adc55a5c9b82007545bd2;p=xonotic%2Fdarkplaces.git diff --git a/cl_demo.c b/cl_demo.c index c6402413..2b7f060b 100644 --- a/cl_demo.c +++ b/cl_demo.c @@ -188,6 +188,10 @@ void CL_ReadDemoMessage(void) { MSG_BeginReading(); CL_ParseServerMessage(); + + // In case the demo contains a "svc_disconnect" message + if (!cls.demoplayback) + return; } else { @@ -319,6 +323,7 @@ void CL_PlayDemo_f (void) // disconnect from server CL_Disconnect (); + Host_ShutdownServer (false); // update networking ports (this is mainly just needed at startup) NetConn_ClientFrame(); @@ -338,6 +343,7 @@ void CL_PlayDemo_f (void) SCR_BeginLoadingPlaque (); + strlcpy(cls.demoname, name, sizeof(cls.demoname)); cls.demoplayback = true; cls.state = ca_connected; cls.forcetrack = 0; @@ -374,6 +380,9 @@ void CL_FinishTimeDemo (void) fpsmax = cls.td_minframetime > 0 ? 1.0 / cls.td_minframetime : 0; // LordHavoc: timedemo now prints out 7 digits of fraction, and min/avg/max Con_Printf("%i frames %5.7f seconds %5.7f fps\nmin/avg/max: %5.7f/%5.7f/%5.7f\n", frames, time, fpsavg, fpsmin, fpsavg, fpsmax); + Log_Printf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | result %i frames %5.7f seconds %5.7f fps min/avg/max: %5.7f/%5.7f/%5.7f\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), buildstring, cls.demoname, cmdline.string, frames, time, fpsavg, fpsmin, fpsavg, fpsmax); + if (COM_CheckParm("-benchmark")) + Host_Quit_f(); } /*