aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/UniteTestCommands.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/UniteTestCommands.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/UniteTestCommands.cs')
-rw-r--r--ShiftOS_TheReturn/UniteTestCommands.cs74
1 files changed, 0 insertions, 74 deletions
diff --git a/ShiftOS_TheReturn/UniteTestCommands.cs b/ShiftOS_TheReturn/UniteTestCommands.cs
deleted file mode 100644
index 7a83e44..0000000
--- a/ShiftOS_TheReturn/UniteTestCommands.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ShiftOS.Engine
-{
- [Namespace("unite")]
- public static class UniteTestCommands
- {
- [Command("setdisplayname")]
- [RequiresArgument("name")]
- public static bool SetDisplayName(Dictionary<string, object> args)
- {
- string dname = args["name"].ToString();
- var unite = new ShiftOS.Unite.UniteClient("http://getshiftos.ml", SaveSystem.CurrentSave.UniteAuthToken);
- unite.SetDisplayName(dname);
- return true;
- }
-
- [Command("login")]
- [RequiresArgument("username")]
- [RequiresArgument("password")]
- public static bool LoginTest(Dictionary<string, object> args)
- {
- string u = args["username"].ToString();
- string p = args["password"].ToString();
- var webrequest = HttpWebRequest.Create("http://getshiftos.ml/Auth/Login?appname=ShiftOS&appdesc=ShiftOS+client&version=1_0_beta_2_4");
- string base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{u}:{p}"));
- webrequest.Headers.Add("Authentication: Basic " + base64);
- var response = webrequest.GetResponse();
- var str = response.GetResponseStream();
- var reader = new System.IO.StreamReader(str);
- string result = reader.ReadToEnd();
- Console.WriteLine("Server returned: " + result);
- reader.Close();
- str.Close();
- str.Dispose();
- response.Dispose();
-
- return true;
- }
-
- [Command("linklogin")]
- [RequiresArgument("username")]
- [RequiresArgument("password")]
- public static bool LinkLogin(Dictionary<string, object> args)
- {
- string u = args["username"].ToString();
- string p = args["password"].ToString();
- var webrequest = HttpWebRequest.Create("http://getshiftos.ml/Auth/Login?appname=ShiftOS&appdesc=ShiftOS+client&version=1_0_beta_2_4");
- string base64 = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{u}:{p}"));
- webrequest.Headers.Add("Authentication: Basic " + base64);
- var response = webrequest.GetResponse();
- var str = response.GetResponseStream();
- var reader = new System.IO.StreamReader(str);
- string result = reader.ReadToEnd();
- //If we get this far, the token is OURS. :D
- SaveSystem.CurrentSave.UniteAuthToken = result;
- Console.WriteLine("Unite says \"Access Granted!\"");
- SaveSystem.SaveGame();
- reader.Close();
- str.Close();
- str.Dispose();
- response.Dispose();
-
- return true;
- }
-
-
- }
-}