Improvement: check if the OS and the GPU are supported by the application
This commit is contained in:
@@ -93,6 +93,16 @@ public class Client {
|
||||
}
|
||||
|
||||
public int run() {
|
||||
if (this.config.checkOSisSupported() == false) {
|
||||
this.gui.error(Error.humanString(Error.Type.OS_NOT_SUPPORTED));
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (this.config.checkCPUisSUpported() == false) {
|
||||
this.gui.error(Error.humanString(Error.Type.CPU_NOT_SUPPORTED));
|
||||
return -4;
|
||||
}
|
||||
|
||||
int step;
|
||||
try {
|
||||
step = this.log.newCheckPoint();
|
||||
|
||||
@@ -29,7 +29,9 @@ import java.util.Calendar;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.sheepit.client.hardware.cpu.CPU;
|
||||
import com.sheepit.client.hardware.gpu.GPUDevice;
|
||||
import com.sheepit.client.os.OS;
|
||||
|
||||
public class Configuration {
|
||||
public enum ComputeType {
|
||||
@@ -277,4 +279,17 @@ public class Configuration {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkOSisSupported() {
|
||||
return OS.getOS() != null;
|
||||
}
|
||||
|
||||
public boolean checkCPUisSUpported() {
|
||||
OS os = OS.getOS();
|
||||
if (os != null) {
|
||||
CPU cpu = os.getCPU();
|
||||
return cpu != null && cpu.haveData();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ public class Error {
|
||||
RENDERER_KILLED,
|
||||
RENDERER_MISSING_LIBRARIES,
|
||||
FAILED_TO_EXECUTE,
|
||||
OS_NOT_SUPPORTED,
|
||||
CPU_NOT_SUPPORTED,
|
||||
UNKNOWN
|
||||
};
|
||||
|
||||
@@ -127,6 +129,10 @@ public class Error {
|
||||
return "The renderer stopped because either you asked to stop or the server did (usually for a render time too high).";
|
||||
case SESSION_DISABLED:
|
||||
return "The server have disabled your session. Your client may have generated a broken frame (GPU not compatible, not enough RAM/VRAM, etc).";
|
||||
case OS_NOT_SUPPORTED:
|
||||
return "Operating System not supported.";
|
||||
case CPU_NOT_SUPPORTED:
|
||||
return "CPU not supported.";
|
||||
default:
|
||||
return in.toString();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,12 @@ public class CPU {
|
||||
this.arch = "64bit";
|
||||
}
|
||||
else {
|
||||
this.arch = "xxbit";
|
||||
this.arch = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean haveData() {
|
||||
return this.name != null && this.model != null && this.family != null && this.arch != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user