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))]