diff --git a/protocol.txt b/protocol.txt index 670be76..8ace0af 100644 --- a/protocol.txt +++ b/protocol.txt @@ -6,6 +6,7 @@ Parameters as GET: * password: User's password in plain text. * version: Client's version, for example 3.3.1762. * os: Computer's operating system, at the moment only "windows", "mac" and "linux" are supported. + * os_version: Full version of os, for example "Windows 8.1". * bits: Architecture size, at the moment only "32bit" and "64bit" are supported. * cpu_family: CPU's family, on linux it can be found in /proc/cpuinfo via the attribute "cpu family". * cpu_model: CPU's model, on linux it can be found in /proc/cpuinfo via the attribute "model". diff --git a/src/com/sheepit/client/Server.java b/src/com/sheepit/client/Server.java index d271942..f82be4d 100644 --- a/src/com/sheepit/client/Server.java +++ b/src/com/sheepit/client/Server.java @@ -197,6 +197,7 @@ public class Server extends Thread { .add("cpu_model_name", os.getCPU().name()) .add("cpu_cores", String.valueOf(user_config.getNbCores() == -1 ? os.getCPU().cores() : user_config.getNbCores())) .add("os", os.name()) + .add("os_version", os.getVersion()) .add("ram", String.valueOf(os.getMemory())) .add("bits", os.getCPU().arch()) .add("version", user_config.getJarVersion()) diff --git a/src/com/sheepit/client/os/OS.java b/src/com/sheepit/client/os/OS.java index 5b9eafc..63f1f12 100644 --- a/src/com/sheepit/client/os/OS.java +++ b/src/com/sheepit/client/os/OS.java @@ -29,6 +29,13 @@ public abstract class OS { public abstract String name(); + /** Get the full version of the os. + * For example windows, should give "windows 8.1" + */ + public String getVersion() { + return System.getProperty("os.name").toLowerCase(); + } + public abstract CPU getCPU(); public abstract long getMemory();