Skip to content

Commit 7a0c58c

Browse files
committed
Add start param to disable autostop and continue recording at next demo
1 parent 635d84d commit 7a0c58c

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/game_standalone.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ s64 tm_last_frame_time;
364364

365365
s32 recording_state;
366366

367+
bool enable_autostop;
368+
367369
// Velo is restricted to the movement based games.
368370
// This is done in order to increase reach for games, such as Source 2013 mods which may modify client.dll (otherwise every mod may need tailored setup).
369371
// We assume that those games only want the capture part of SVR.
@@ -724,14 +726,25 @@ void update_recording_state()
724726

725727
if (state == SIGNON_STATE_NONE)
726728
{
729+
// Autostop.
727730
if (recording_state == RECORD_STATE_POSSIBLE)
728731
{
729-
recording_state = RECORD_STATE_STOPPED;
732+
if (enable_autostop)
733+
{
734+
recording_state = RECORD_STATE_STOPPED;
735+
}
736+
737+
else
738+
{
739+
// Wait until we connect again.
740+
recording_state = RECORD_STATE_WAITING;
741+
}
730742
}
731743
}
732744

733745
else if (state == SIGNON_STATE_FULL)
734746
{
747+
// Autostart.
735748
if (recording_state == RECORD_STATE_WAITING)
736749
{
737750
recording_state = RECORD_STATE_POSSIBLE;
@@ -1586,6 +1599,17 @@ DWORD WINAPI standalone_init_async(void* param)
15861599
return 1;
15871600
}
15881601

1602+
auto start_args = GetCommandLineA();
1603+
1604+
enable_autostop = true;
1605+
1606+
// Doesn't belong in a profile so here it is.
1607+
if (strstr(start_args, "-svrnoautostop"))
1608+
{
1609+
svr_log("Autostop is disabled\n");
1610+
enable_autostop = false;
1611+
}
1612+
15891613
MH_Initialize();
15901614

15911615
create_game_hooks();

0 commit comments

Comments
 (0)