[chronojump] Ping sends also machineID



commit 982e0dfb96af611d2f4bb34cb98da135e8fc303c
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Mar 10 01:57:13 2015 +0100

    Ping sends also machineID

 src/chronojump.cs     |    3 ++-
 src/gui/chronojump.cs |    2 +-
 src/json.cs           |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/chronojump.cs b/src/chronojump.cs
index d59d824..67b7823 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -370,8 +370,9 @@ public class ChronoJump
        
 
                //doing ping using json methods
+               string machineID = SqlitePreferences.Select("machineID", false);
                Json js = new Json();
-               bool success = js.Ping(UtilAll.GetOS(), progVersion);
+               bool success = js.Ping(UtilAll.GetOS(), progVersion, machineID);
                if(success)
                        LogB.Information(js.ResultMessage);
                else
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 95c69b8..368838a 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -5987,7 +5987,7 @@ LogB.Debug("X");
        
        private void on_menuitem_ping_activate (object o, EventArgs args) {
                Json js = new Json();
-               bool success = js.Ping(UtilAll.GetOS(), UtilAll.ReadVersion());
+               bool success = js.Ping(UtilAll.GetOS(), UtilAll.ReadVersion(), preferences.machineID);
 
                if(success) {
                        LogB.Information(js.ResultMessage);
diff --git a/src/json.cs b/src/json.cs
index 2d7e51b..8ae409b 100644
--- a/src/json.cs
+++ b/src/json.cs
@@ -154,7 +154,7 @@ public class Json
                return true;
        }
 
-       public bool Ping(string osVersion, string cjVersion) 
+       public bool Ping(string osVersion, string cjVersion, string machineID) 
        {
                // Create a request using a URL that can receive a post. 
                WebRequest request = WebRequest.Create (serverUrl + "/ping");
@@ -169,6 +169,7 @@ public class Json
                JsonObject json = new JsonObject();
                json.Add("os_version", osVersion);
                json.Add("cj_version", cjVersion);
+               json.Add("machine_id", machineID);
 
                // Converts it to a String
                String js = json.ToString();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]