aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael VanOverbeek <[email protected]>2017-04-30 15:44:29 +0000
committerMichael VanOverbeek <[email protected]>2017-04-30 15:44:29 +0000
commitbaddaee3a88841fe6305f7d2f4923e46e97cc053 (patch)
treeb1da8b52f96042f601816704882fb15b06a00cf6
parent03d01cdb4de62c1c431aefe9d11f5d276dd21b5a (diff)
downloadshiftos_thereturn-baddaee3a88841fe6305f7d2f4923e46e97cc053.tar.gz
shiftos_thereturn-baddaee3a88841fe6305f7d2f4923e46e97cc053.tar.bz2
shiftos_thereturn-baddaee3a88841fe6305f7d2f4923e46e97cc053.zip
Server-side linking to Unite
-rw-r--r--ShiftOS.Objects/Save.cs2
-rw-r--r--ShiftOS.Server/SaveManager.cs17
2 files changed, 19 insertions, 0 deletions
diff --git a/ShiftOS.Objects/Save.cs b/ShiftOS.Objects/Save.cs
index ef512eb..7208de5 100644
--- a/ShiftOS.Objects/Save.cs
+++ b/ShiftOS.Objects/Save.cs
@@ -45,6 +45,8 @@ namespace ShiftOS.Objects
public int MinorVersion { get; set; }
public int Revision { get; set; }
+ public string UniteAuthToken { get; set; }
+
public bool IsPatreon { get; set; }
public UserClass Class { get; set; }
diff --git a/ShiftOS.Server/SaveManager.cs b/ShiftOS.Server/SaveManager.cs
index 52d665b..41ca226 100644
--- a/ShiftOS.Server/SaveManager.cs
+++ b/ShiftOS.Server/SaveManager.cs
@@ -32,6 +32,7 @@ using System.IO;
using Newtonsoft.Json;
using NetSockets;
using static ShiftOS.Server.Program;
+using System.Net;
namespace ShiftOS.Server
{
@@ -172,6 +173,9 @@ namespace ShiftOS.Server
try
{
+
+
+
Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
{
Name = "mud_saved",
@@ -179,6 +183,19 @@ namespace ShiftOS.Server
}));
}
catch { }
+
+ try
+ {
+ //Update the shiftos website with the user's codepoints.
+ if (!string.IsNullOrWhiteSpace(sav.UniteAuthToken))
+ {
+ var wreq = WebRequest.Create("http://getshiftos.ml/API/SetCodepoints/" + sav.Codepoints.ToString());
+ wreq.Headers.Add("Authentication: Token " + sav.UniteAuthToken);
+ wreq.GetResponse();
+ }
+ }
+ catch { }
+
}
[MudRequest("delete_save", typeof(ClientSave))]