aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Objects/UserConfig.cs
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-06-05 09:49:46 -0600
committerAShifter <[email protected]>2017-06-05 09:49:46 -0600
commit61c906e596145bbedd60725c6dcee68c34a27907 (patch)
treecd7a00d501affe96028bfb21a8dec90c2ee63f2c /ShiftOS.Objects/UserConfig.cs
parent66ea2cf2fdeeaa025bd22961a0400423233c505d (diff)
parent3e11eca70481841b6e2f2253d667944779cfd5fb (diff)
downloadshiftos_thereturn-61c906e596145bbedd60725c6dcee68c34a27907.tar.gz
shiftos_thereturn-61c906e596145bbedd60725c6dcee68c34a27907.tar.bz2
shiftos_thereturn-61c906e596145bbedd60725c6dcee68c34a27907.zip
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
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;
+ }
+ }
+}