mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-07 18:38:30 +00:00
fixed it up again :x
added notice if cs:s doesn't run longer than 10 seconds after start --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40314
This commit is contained in:
parent
1383a414d8
commit
0c59344bc6
@ -53,11 +53,8 @@ var eStream: TFileStream;
|
|||||||
eStr: TStringList;
|
eStr: TStringList;
|
||||||
i: integer;
|
i: integer;
|
||||||
CheckSuccessful: Boolean;
|
CheckSuccessful: Boolean;
|
||||||
|
StartTime: Cardinal;
|
||||||
begin
|
begin
|
||||||
WriteLn(FindWindow(nil, 'STEAM'));
|
|
||||||
readln;
|
|
||||||
exit;
|
|
||||||
|
|
||||||
ePath := ExtractFilePath(ParamStr(0));
|
ePath := ExtractFilePath(ParamStr(0));
|
||||||
for i := 1 to ParamCount do
|
for i := 1 to ParamCount do
|
||||||
eParams := eParams + #32 + ParamStr(i);
|
eParams := eParams + #32 + ParamStr(i);
|
||||||
@ -87,7 +84,7 @@ begin
|
|||||||
ReadLn;
|
ReadLn;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not FileExists(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe') then begin
|
if not FileExists(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath))) + 'steam.exe') then begin
|
||||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
|
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
|
||||||
WriteLn('Error: Cannot find steam.exe! Make sure this application is located in your listen server''s directory.');
|
WriteLn('Error: Cannot find steam.exe! Make sure this application is located in your listen server''s directory.');
|
||||||
ReadLn;
|
ReadLn;
|
||||||
@ -161,13 +158,17 @@ begin
|
|||||||
eStream := nil;
|
eStream := nil;
|
||||||
end;
|
end;
|
||||||
{ Launch Steam if not opened }
|
{ Launch Steam if not opened }
|
||||||
|
ShellExecute(0, 'open', PChar(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath))) + 'steam.exe'), nil, PChar(Copy(ePath, 1, Pos('\steamapps\', LowerCase(ePath)))), SW_SHOW);
|
||||||
ShellExecute(0, 'open', PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath)) + 'steam.exe'), nil, PChar(Copy(ePath, 1, Pos('\SteamApps\', ePath))), SW_SHOW);
|
|
||||||
//ShellExecute(0, 'open',
|
|
||||||
{ Launch game }
|
{ Launch game }
|
||||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
|
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
|
||||||
Write('Starting HL2...');
|
Write('Starting HL2...');
|
||||||
|
StartTime := GetTickCount;
|
||||||
LaunchFile(ePath + 'hl2.exe', Copy(ePath, 1, Pos('Steam', ePath)+5), eParams);
|
LaunchFile(ePath + 'hl2.exe', Copy(ePath, 1, Pos('Steam', ePath)+5), eParams);
|
||||||
|
if (GetTickCount - StartTime < 10000) then begin
|
||||||
|
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
|
||||||
|
WriteLn('Important: If you experience any problems starting HL2 using this program, please start it once via Steam and try again.');
|
||||||
|
ReadLn;
|
||||||
|
end;
|
||||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
|
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
|
||||||
{ Free GameInfo.txt }
|
{ Free GameInfo.txt }
|
||||||
Write('Removing read-only again from GameInfo.txt...');
|
Write('Removing read-only again from GameInfo.txt...');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user