August 3rd 3018 Support

This commit is contained in:
recroom2016
2022-02-20 22:48:36 -05:00
parent 358b654064
commit b85ab57667
2 changed files with 18 additions and 1 deletions

View File

@@ -278,12 +278,24 @@ namespace server
{ {
s = gamesessions2018.GameSessions.JoinRandom(text); s = gamesessions2018.GameSessions.JoinRandom(text);
} }
if (rawUrl == "//api/images/v4/uploadtransient?gameSessionId=2018")
{
File.WriteAllBytes("SaveData\\Images\\image" + Convert.ToString(int.Parse(File.ReadAllText("SaveData\\Images\\count.txt") + 1)) + ".png", Encoding.UTF8.GetBytes(text.Remove(0, 50).Remove(text.Length - 48, 48)));
}
if (Url == "avatar/v3/saved")
{
s = BracketResponse;
}
if (Url == "checklist/v1/current")
{
s = BracketResponse;
}
Console.WriteLine("API Response: " + s); Console.WriteLine("API Response: " + s);
byte[] bytes = Encoding.UTF8.GetBytes(s); byte[] bytes = Encoding.UTF8.GetBytes(s);
response.ContentLength64 = (long)bytes.Length; response.ContentLength64 = (long)bytes.Length;
Stream outputStream = response.OutputStream; Stream outputStream = response.OutputStream;
outputStream.Write(bytes, 0, bytes.Length); outputStream.Write(bytes, 0, bytes.Length);
Thread.Sleep(400); Thread.Sleep(100);
outputStream.Close(); outputStream.Close();
this.listener.Stop(); this.listener.Stop();
} }

View File

@@ -11,6 +11,7 @@ namespace start
public static void setup() public static void setup()
{ {
Console.WriteLine("Setting up..."); Console.WriteLine("Setting up...");
Directory.CreateDirectory("SaveData\\Images\\");
Directory.CreateDirectory("SaveData\\App\\"); Directory.CreateDirectory("SaveData\\App\\");
Directory.CreateDirectory("SaveData\\Profile\\"); Directory.CreateDirectory("SaveData\\Profile\\");
if (!(File.Exists("SaveData\\avatar.txt"))) if (!(File.Exists("SaveData\\avatar.txt")))
@@ -53,6 +54,10 @@ namespace start
{ {
File.WriteAllText("SaveData\\App\\sandbox.txt", "Disabled"); File.WriteAllText("SaveData\\App\\sandbox.txt", "Disabled");
} }
if (!(File.Exists("SaveData\\Images\\count.txt")))
{
File.WriteAllText("SaveData\\Images\\count.txt", "0");
}
if (!(File.Exists("SaveData\\profileimage.png"))) if (!(File.Exists("SaveData\\profileimage.png")))
{ {
File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData("https://github.com/OpenRecRoom/OpenRec/raw/main/profileimage.png")); File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData("https://github.com/OpenRecRoom/OpenRec/raw/main/profileimage.png"));