File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ public static class Program
16
16
{
17
17
private static SplashScreen _mainForm ;
18
18
19
+ private static readonly System . Timers . Timer _AliveTimer = new System . Timers . Timer ( 15000 ) ;
20
+
19
21
/// <summary>
20
22
/// The main entry point for the application.
21
23
/// </summary>
@@ -62,6 +64,23 @@ public static void Main(params string[] args)
62
64
_mainForm . SetIcon ( IconManager . GetLargeIcon ( gameExecutable , true , true ) . ToBitmap ( ) ) ;
63
65
64
66
BeginSnapPositionToGameWindow ( gameProcess ) ;
67
+
68
+ // If log messages stop coming, preloader/chainloader has crashed or is stuck
69
+ _AliveTimer . AutoReset = false ;
70
+ _AliveTimer . Elapsed += ( _ , __ ) =>
71
+ {
72
+ try
73
+ {
74
+ Log ( "Stopped receiving log messages from the game, assuming preloader/chainloader has crashed or is stuck" , true ) ;
75
+ }
76
+ catch ( Exception e )
77
+ {
78
+ // ¯\_(ツ)_/¯
79
+ Debug . Fail ( e . ToString ( ) ) ;
80
+ }
81
+ Environment . Exit ( 3 ) ;
82
+ } ;
83
+ _AliveTimer . Start ( ) ;
65
84
}
66
85
catch ( Exception e )
67
86
{
@@ -107,6 +126,10 @@ private static void InputReadingThread(object processArg)
107
126
{
108
127
while ( inStream . CanRead && ! gameProcess . HasExited )
109
128
{
129
+ // Still receiving log messages, so preloader/chainloader is still alive and loading
130
+ _AliveTimer . Stop ( ) ;
131
+ _AliveTimer . Start ( ) ;
132
+
110
133
ProcessInputMessage ( inReader . ReadLine ( ) ) ;
111
134
}
112
135
}
You can’t perform that action at this time.
0 commit comments