aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Objects
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.Objects')
-rw-r--r--ShiftOS.Objects/ShiftOS.Objects.csproj1
-rw-r--r--ShiftOS.Objects/UserConfig.cs37
2 files changed, 38 insertions, 0 deletions
diff --git a/ShiftOS.Objects/ShiftOS.Objects.csproj b/ShiftOS.Objects/ShiftOS.Objects.csproj
index 7a19aeb..c2ef5ed 100644
--- a/ShiftOS.Objects/ShiftOS.Objects.csproj
+++ b/ShiftOS.Objects/ShiftOS.Objects.csproj
@@ -58,6 +58,7 @@
<Compile Include="Shop.cs" />
<Compile Include="Unite\Download.cs" />
<Compile Include="Unite\ReleaseQuery.cs" />
+ <Compile Include="UserConfig.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
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;
+ }
+ }
+}