static void ParseServerMessage(string result)
{
if (string.IsNullOrEmpty (result)) {
return;
}
hasParsedServerMessage = true;
#if ASTARDEBUG
Debug.Log ("Result from update check:\n"+result);
#endif
string[] splits = result.Split ('|');
latestVersionDescription = splits.Length > 1 ? splits[1] : "";
if (splits.Length > 4) {
// First 4 are just compatibility fields
var fields = splits.Skip(4).ToArray();
// Take all pairs of fields
for (int i = 0; i < (fields.Length/2)*2; i += 2) {
string key = fields[i];
string val = fields[i+1];
astarServerData[key] = val;
}
}
try {
latestVersion = new System.Version(astarServerData["VERSION:branch"]);
} catch (System.Exception ex) {
Debug.LogWarning ("Could not parse version\n"+ex);
}
try {
latestBetaVersion = new System.Version(astarServerData["VERSION:beta"]);
} catch (System.Exception ex) {
Debug.LogWarning ("Could not parse version\n"+ex);
}
}