Server-side linking to Unite
This commit is contained in:
parent
03d01cdb4d
commit
baddaee3a8
2 changed files with 19 additions and 0 deletions
|
@ -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; }
|
||||
|
|
|
@ -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))]
|
||||
|
|
Reference in a new issue