Skip to content

Commit 7d6fff5

Browse files
committed
Changed fullscreen auto-fixer to work with all Windows versions.
Updated logging.
1 parent 2e25d9e commit 7d6fff5

File tree

3 files changed

+61
-35
lines changed

3 files changed

+61
-35
lines changed

MTA10/core/CConnectManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,6 @@ void CConnectManager::OpenServerFirewall( in_addr Address, ushort usHttpPort, bo
479479
uiTimeOut = 1000;
480480
}
481481

482-
SString strDummyUrl( "http://%s:%d/.dummy/", inet_ntoa( Address ), usHttpPort );
482+
SString strDummyUrl( "http://%s:%d/mta_client_firewall_probe/", inet_ntoa( Address ), usHttpPort );
483483
g_pCore->GetNetwork()->GetHTTPDownloadManager( EDownloadMode::CONNECT_TCP_SEND )->QueueFile( strDummyUrl, NULL, 0, "", 0, true, NULL, NULL, false, 1, uiTimeOut );
484484
}

MTA10/loader/MainFunctions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,12 @@ void HandleResetSettings ( void )
327327
// HandleNotUsedMainMenu
328328
//
329329
// Called when a problem occured before the main menu was used by user
330-
// If Win10 and fullscreen, then maybe change fullscreen mode
330+
// If fullscreen, then maybe change fullscreen mode
331331
//
332332
//////////////////////////////////////////////////////////
333333
void HandleNotUsedMainMenu ( void )
334334
{
335335
AddReportLog( 9310, "Loader - HandleNotUsedMainMenu" );
336-
if ( IsWindows10OrGreater() )
337336
{
338337
// Slighty hacky way of checking in-game settings
339338
SString strCoreConfigFilename = CalcMTASAPath( PathJoin( "mta", "config", "coreconfig.xml" ) );

MTA10/loader/Utils.cpp

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,41 +2041,68 @@ bool VerifyEmbeddedSignature( const SString& strFilename )
20412041
//////////////////////////////////////////////////////////
20422042
void LogSettings( void )
20432043
{
2044-
const char* szSettings[] = {
2045-
"general", "aero-enabled",
2046-
"general", "aero-changeable",
2047-
"general", "driver-overrides-disabled",
2048-
"general", "device-selection-disabled",
2049-
"general", "customized-sa-files-using",
2050-
"general", "times-connected",
2051-
"general", "times-connected-editor",
2052-
"nvhacks", "optimus-force-detection",
2053-
"nvhacks", "optimus-export-enablement",
2054-
"nvhacks", "optimus",
2055-
"nvhacks", "optimus-rename-exe",
2056-
"nvhacks", "optimus-alt-startup",
2057-
"nvhacks", "optimus-force-windowed",
2058-
"nvhacks", "optimus-dialog-skip",
2059-
"nvhacks", "optimus-startup-option",
2060-
"diagnostics", "send-dumps",
2061-
"diagnostics", "last-minidump-time",
2062-
"diagnostics", "user-confirmed-bsod-time",
2063-
DIAG_MINIDUMP_DETECTED_COUNT,
2064-
DIAG_MINIDUMP_CONFIRMED_COUNT,
2065-
DIAG_PRELOAD_UPGRADES_LOWEST_UNSAFE,
2066-
"general", "noav-user-says-skip",
2067-
"general", "noav-last-asked-time",
2068-
};
2069-
2070-
for ( uint i = 0 ; i < NUMELMS( szSettings ) ; i += 2 )
2071-
{
2072-
WriteDebugEvent( SString( "%s: %s", szSettings[i+1], *GetApplicationSetting( szSettings[i], szSettings[i+1] ) ) );
2044+
struct {
2045+
int bSkipIfZero;
2046+
const char* szPath;
2047+
const char* szName;
2048+
const char* szDesc;
2049+
} const settings[] = {
2050+
{ false, "general", GENERAL_PROGRESS_ANIMATION_DISABLE, "", },
2051+
{ false, "general", "aero-enabled", "", },
2052+
{ false, "general", "aero-changeable", "", },
2053+
{ false, "general", "driver-overrides-disabled", "", },
2054+
{ false, "general", "device-selection-disabled", "", },
2055+
{ false, "general", "customized-sa-files-using", "", },
2056+
{ false, "general", "times-connected", "", },
2057+
{ false, "general", "times-connected-editor", "", },
2058+
{ false, "nvhacks", "nvidia", "", },
2059+
{ false, "nvhacks", "optimus-force-detection", "", },
2060+
{ false, "nvhacks", "optimus-export-enablement", "", },
2061+
{ false, "nvhacks", "optimus", "", },
2062+
{ false, "nvhacks", "optimus-rename-exe", "", },
2063+
{ false, "nvhacks", "optimus-alt-startup", "", },
2064+
{ false, "nvhacks", "optimus-force-windowed", "", },
2065+
{ false, "nvhacks", "optimus-dialog-skip", "", },
2066+
{ false, "nvhacks", "optimus-startup-option", "", },
2067+
{ true, "watchdog", "CR1", "COUNTER_CRASH_CHAIN_BEFORE_ONLINE_GAME", },
2068+
{ true, "watchdog", "CR2", "COUNTER_CRASH_CHAIN_BEFORE_LOADING_SCREEN", },
2069+
{ true, "watchdog", "CR3", "COUNTER_CRASH_CHAIN_BEFORE_USED_MAIN_MENU", },
2070+
{ true, "watchdog", "L0", "SECTION_NOT_CLEAN_GTA_EXIT", },
2071+
{ true, "watchdog", "L1", "SECTION_NOT_STARTED_ONLINE_GAME", },
2072+
{ true, "watchdog", "L2", "SECTION_NOT_SHOWN_LOADING_SCREEN", },
2073+
{ true, "watchdog", "L3", "SECTION_STARTUP_FREEZE", },
2074+
{ true, "watchdog", "L4", "SECTION_NOT_USED_MAIN_MENU", },
2075+
{ true, "watchdog", "L5", "SECTION_POST_INSTALL", },
2076+
{ true, "watchdog", "lastruncrash", "", },
2077+
{ true, "watchdog", "preload-upgrades", "", },
2078+
{ true, "watchdog", "Q0", "SECTION_IS_QUITTING", },
2079+
{ true, "watchdog", "uncleanstop", "", },
2080+
{ false, "diagnostics", "send-dumps", "", },
2081+
{ true, "diagnostics", "last-minidump-time", "", },
2082+
{ true, "diagnostics", "user-confirmed-bsod-time", "", },
2083+
{ true, DIAG_MINIDUMP_DETECTED_COUNT, "", },
2084+
{ true, DIAG_MINIDUMP_CONFIRMED_COUNT, "", },
2085+
{ true, DIAG_PRELOAD_UPGRADES_LOWEST_UNSAFE, "", },
2086+
{ false, "general", "noav-user-says-skip", "", },
2087+
{ false, "general", "noav-last-asked-time", "", },
2088+
};
2089+
2090+
for ( uint i = 0 ; i < NUMELMS( settings ) ; i++ )
2091+
{
2092+
SString strValue = GetApplicationSetting( settings[i].szPath, settings[i].szName );
2093+
if ( !settings[i].bSkipIfZero || atoi( strValue ) != 0 )
2094+
{
2095+
WriteDebugEvent( SString( "%s.%s: %s %s", settings[i].szPath, settings[i].szName, *strValue, settings[i].szDesc ) );
2096+
}
20732097
}
20742098

20752099
uint uiTimeLastAsked = GetApplicationSettingInt( "noav-last-asked-time" );
2076-
uint uiTimeNow = static_cast < uint >( time( NULL ) / 3600LL );
2077-
uint uiHoursSinceLastAsked = uiTimeNow - uiTimeLastAsked;
2078-
WriteDebugEvent( SString( "noav-last-asked-time-hours-delta: %d", uiHoursSinceLastAsked ) );
2100+
if ( uiTimeLastAsked )
2101+
{
2102+
uint uiTimeNow = static_cast < uint >( time( NULL ) / 3600LL );
2103+
uint uiHoursSinceLastAsked = uiTimeNow - uiTimeLastAsked;
2104+
WriteDebugEvent( SString( "noav-last-asked-time-hours-delta: %d", uiHoursSinceLastAsked ) );
2105+
}
20792106
}
20802107

20812108

0 commit comments

Comments
 (0)