mirror of
https://github.com/moonlight-stream/Internet-Hosting-Tool.git
synced 2025-07-01 07:15:32 +00:00
Avoid extra GameStream state prints when the state isn't changing
This commit is contained in:
parent
021474cdd2
commit
8066cf4be1
@ -533,14 +533,8 @@ bool IsGameStreamEnabled()
|
||||
printf("RegQueryValueExA() failed: %d" NL, error);
|
||||
return false;
|
||||
}
|
||||
else if (!enabled) {
|
||||
printf("GameStream is OFF!" NL);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
printf("GameStream is ON!" NL);
|
||||
return true;
|
||||
}
|
||||
|
||||
return enabled != 0;
|
||||
}
|
||||
|
||||
void UpdatePortMappingsForTarget(bool enable, char* targetAddressIP4, char* internalAddressIP4, char* upstreamAddressIP4)
|
||||
@ -904,7 +898,17 @@ int Run(bool standaloneExe)
|
||||
for (;;) {
|
||||
ResetEvent(gsChangeEvent);
|
||||
ResetEvent(ifaceChangeEvent);
|
||||
UpdatePortMappings(IsGameStreamEnabled());
|
||||
|
||||
bool gameStreamEnabled = IsGameStreamEnabled();
|
||||
|
||||
if (gameStreamEnabled) {
|
||||
printf("GameStream is ON!" NL);
|
||||
}
|
||||
else {
|
||||
printf("GameStream is OFF!" NL);
|
||||
}
|
||||
|
||||
UpdatePortMappings(gameStreamEnabled);
|
||||
|
||||
// Refresh when half the duration is expired or if an IP interface
|
||||
// change event occurs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user