aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Objects/UserConfig.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-08 11:31:20 -0400
committerMichael <[email protected]>2017-05-08 11:31:29 -0400
commit75ed7e9215ba88358d9b838dd82fa3841f78ae5a (patch)
treee976fbb38056e38fcd8393c3efcfe3db12f3c4b0 /ShiftOS.Objects/UserConfig.cs
parent4a5db39ea7c0b9be342261ab416dbb5edf50b2ce (diff)
downloadshiftos_thereturn-75ed7e9215ba88358d9b838dd82fa3841f78ae5a.tar.gz
shiftos_thereturn-75ed7e9215ba88358d9b838dd82fa3841f78ae5a.tar.bz2
shiftos_thereturn-75ed7e9215ba88358d9b838dd82fa3841f78ae5a.zip
Fix softlocks on pre-user OOBE.
Diffstat (limited to 'ShiftOS.Objects/UserConfig.cs')
-rw-r--r--ShiftOS.Objects/UserConfig.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/ShiftOS.Objects/UserConfig.cs b/ShiftOS.Objects/UserConfig.cs
new file mode 100644
index 0000000..61d11b8
--- /dev/null
+++ b/ShiftOS.Objects/UserConfig.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+
+namespace ShiftOS.Objects
+{
+ public class UserConfig
+ {
+ public string UniteUrl { get; set; }
+ public string DigitalSocietyAddress { get; set; }
+ public int DigitalSocietyPort { get; set; }
+
+ public static UserConfig Get()
+ {
+ var conf = new UserConfig
+ {
+ UniteUrl = "http://getshiftos.ml",
+ DigitalSocietyAddress = "michaeltheshifter.me",
+ DigitalSocietyPort = 13370
+ };
+
+ if (!File.Exists("servers.json"))
+ {
+ File.WriteAllText("servers.json", JsonConvert.SerializeObject(conf, Formatting.Indented));
+ }
+ else
+ {
+ conf = JsonConvert.DeserializeObject<UserConfig>(File.ReadAllText("servers.json"));
+ }
+ return conf;
+ }
+ }
+}