aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/UniteClient.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_TheReturn/UniteClient.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_TheReturn/UniteClient.cs')
-rw-r--r--ShiftOS_TheReturn/UniteClient.cs127
1 files changed, 0 insertions, 127 deletions
diff --git a/ShiftOS_TheReturn/UniteClient.cs b/ShiftOS_TheReturn/UniteClient.cs
deleted file mode 100644
index 1136b5c..0000000
--- a/ShiftOS_TheReturn/UniteClient.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Text;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-
-namespace ShiftOS.Unite
-{
- public class UniteClient
- {
- public string Token { get; private set; }
- public string BaseURL { get; private set; }
-
- public string GetDisplayNameId(string id)
- {
- return MakeCall("/API/GetDisplayName/" + id);
- }
-
- public PongHighscoreModel GetPongHighscores()
- {
- return JsonConvert.DeserializeObject<PongHighscoreModel>(MakeCall("/API/GetPongHighscores"));
- }
-
- public UniteClient(string baseurl, string usertoken)
- {
- BaseURL = baseurl;
- Token = usertoken;
- }
-
- internal string MakeCall(string url)
- {
- var webrequest = WebRequest.Create(BaseURL + url);
- webrequest.Headers.Add("Authentication: Token " + Token);
- using (var response = webrequest.GetResponse())
- {
- using (var stream = response.GetResponseStream())
- {
- using (var reader = new System.IO.StreamReader(stream))
- {
- return reader.ReadToEnd();
- }
- }
- }
- }
-
- public int GetPongCP()
- {
- return Convert.ToInt32(MakeCall("/API/GetPongCP"));
- }
-
- public int GetPongLevel()
- {
- return Convert.ToInt32(MakeCall("/API/GetPongLevel"));
- }
-
- public void SetPongLevel(int value)
- {
- MakeCall("/API/SetPongLevel/" + value.ToString());
- }
-
- public void SetPongCP(int value)
- {
- MakeCall("/API/SetPongCP/" + value.ToString());
- }
-
- public string GetEmail()
- {
- return MakeCall("/API/GetEmail");
- }
-
- public string GetSysName()
- {
- return MakeCall("/API/GetSysName");
- }
-
- public void SetSysName(string value)
- {
- MakeCall("/API/SetSysName/" + value);
- }
-
- public string GetDisplayName()
- {
- return MakeCall("/API/GetDisplayName");
- }
-
- public void SetDisplayName(string value)
- {
- MakeCall("/API/SetDisplayName/" + value.ToString());
- }
-
- public string GetFullName()
- {
- return MakeCall("/API/GetFullName");
- }
-
- public void SetFullName(string value)
- {
- MakeCall("/API/SetFullName/" + value.ToString());
- }
-
-
- public long GetCodepoints()
- {
- return Convert.ToInt64(MakeCall("/API/GetCodepoints"));
- }
-
- public void SetCodepoints(long value)
- {
- MakeCall("/API/SetCodepoints/" + value.ToString());
- }
- }
-
- public class PongHighscoreModel
- {
- public int Pages { get; set; }
- public PongHighscore[] Highscores { get; set; }
- }
-
- public class PongHighscore
- {
- public string UserId { get; set; }
- public int Level { get; set; }
- public long CodepointsCashout { get; set; }
- }
-}