Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Loopback exemption fixes (#3261)
* Fix potential hang when checking loopback exemptions * Remove single quotes from LoopbackExempt command
Dieser Commit ist enthalten in:
Ursprung
d9db035d95
Commit
f8a84f9777
@ -35,7 +35,7 @@ import java.nio.file.Paths;
|
|||||||
|
|
||||||
public final class LoopbackUtil {
|
public final class LoopbackUtil {
|
||||||
private static final String checkExemption = "CheckNetIsolation LoopbackExempt -s";
|
private static final String checkExemption = "CheckNetIsolation LoopbackExempt -s";
|
||||||
private static final String loopbackCommand = "CheckNetIsolation LoopbackExempt -a -n='Microsoft.MinecraftUWP_8wekyb3d8bbwe'";
|
private static final String loopbackCommand = "CheckNetIsolation LoopbackExempt -a -n=Microsoft.MinecraftUWP_8wekyb3d8bbwe";
|
||||||
/**
|
/**
|
||||||
* This string needs to be checked in the event Minecraft is not installed - no Minecraft string will be present in the checkExemption command.
|
* This string needs to be checked in the event Minecraft is not installed - no Minecraft string will be present in the checkExemption command.
|
||||||
*/
|
*/
|
||||||
@ -50,12 +50,12 @@ public final class LoopbackUtil {
|
|||||||
if (os.equalsIgnoreCase("Windows 10") || os.equalsIgnoreCase("Windows 11")) {
|
if (os.equalsIgnoreCase("Windows 10") || os.equalsIgnoreCase("Windows 11")) {
|
||||||
try {
|
try {
|
||||||
Process process = Runtime.getRuntime().exec(checkExemption);
|
Process process = Runtime.getRuntime().exec(checkExemption);
|
||||||
process.waitFor();
|
|
||||||
InputStream is = process.getInputStream();
|
InputStream is = process.getInputStream();
|
||||||
|
|
||||||
|
int data;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
while (is.available() != 0) {
|
while ((data = is.read()) != -1) {
|
||||||
sb.append((char) is.read());
|
sb.append((char) data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !sb.toString().contains(minecraftApplication);
|
return !sb.toString().contains(minecraftApplication);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren