From c42d15d3aa45fc6305dd8ee47079af104080726a Mon Sep 17 00:00:00 2001 From: recroom2016 Date: Tue, 22 Feb 2022 23:39:22 -0500 Subject: [PATCH] working on chat features --- APIServer.cs | 6 +++--- Class2.cs | 10 ++++++++++ OpenRecNet.cs | 30 ++++++++++++++++++++++++++++++ OpenRec_.sln | 2 ++ Program.cs | 26 +++++++++++++++++++++++++- Setup.cs | 4 ++++ 6 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 Class2.cs create mode 100644 OpenRecNet.cs diff --git a/APIServer.cs b/APIServer.cs index 553e637..4d760ef 100644 --- a/APIServer.cs +++ b/APIServer.cs @@ -10,10 +10,8 @@ using Newtonsoft.Json; namespace server { - internal class APIServer { - public APIServer() { try @@ -74,6 +72,7 @@ namespace server s = getorcreate.GetOrCreateArray((ulong.Parse(text.Remove(0, 32)))); CachedPlayerID = ulong.Parse(text.Remove(0, 32)); CachedPlatformID = ulong.Parse(text.Remove(0, 22)); + File.WriteAllText("SaveData\\Profile\\userid.txt", Convert.ToString(CachedPlayerID)); } if (Url == "platformlogin/v6") { @@ -144,6 +143,7 @@ namespace server s = getcachedlogins.GetDebugLogin(ulong.Parse(text.Remove(0, 32)), ulong.Parse(text.Remove(0, 22))); CachedPlayerID = ulong.Parse(text.Remove(0, 32)); CachedPlatformID = ulong.Parse(text.Remove(0, 22)); + File.WriteAllText("SaveData\\Profile\\userid.txt", Convert.ToString(CachedPlayerID)); } if (Url == "platformlogin/v1/loginaccount") { @@ -167,7 +167,7 @@ namespace server } if (Url == "images/v2/named") { - s = BracketResponse; + s = ImagesV2Named; } if (Url == "PlayerReporting/v1/moderationBlockDetails") { diff --git a/Class2.cs b/Class2.cs new file mode 100644 index 0000000..b4f77fc --- /dev/null +++ b/Class2.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenRec +{ + class Class2 + { + } +} diff --git a/OpenRecNet.cs b/OpenRecNet.cs new file mode 100644 index 0000000..2b44bef --- /dev/null +++ b/OpenRecNet.cs @@ -0,0 +1,30 @@ +using System; +using System.Net; +using System.IO; + +namespace start +{ + public class OpenRecNet + { + public OpenRecNet() + { + } + + public static void RecNet() + { + Console.ForegroundColor = ConsoleColor.Blue; + Console.Clear(); + goto ChatStart; + + ChatStart: + Console.WriteLine("Welcome to OpenRecNet!"); + Console.WriteLine("You are logged in as " + File.ReadAllText("SaveData\\Profile\\username.txt")); + Console.WriteLine("Your UserID is " + File.ReadAllText("SaveData\\Profile\\userid.txt")); + Console.WriteLine("In the future, show this message?"); + Console.WriteLine("1) Yes" + Environment.NewLine + "1) No"); + + + + } + } +} diff --git a/OpenRec_.sln b/OpenRec_.sln index 3034407..3f57bad 100644 --- a/OpenRec_.sln +++ b/OpenRec_.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31321.278 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRec_", "OpenRec_.csproj", "{C3C433FC-52FB-4472-81F7-B271A2CDABFE}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3B5E3DA5-F8EC-4767-9BC3-AE95E72631D0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Program.cs b/Program.cs index f65a783..fd7b975 100644 --- a/Program.cs +++ b/Program.cs @@ -10,7 +10,7 @@ namespace start { class Program { - static void Main(string[] args) + static void Main() { Setup.setup(); goto Start; @@ -162,6 +162,30 @@ namespace start } } if (readline == "4") + { + Console.Clear(); + goto ChatStart; + + ChatStart: + Console.WriteLine("Pinging the chat servers..."); + try + { + string ping = new WebClient().DownloadString("https://openrecchat.loca.lt/ping"); + } + catch (Exception ex4) + { + Console.WriteLine("Chat servers currently offline..."); + Console.WriteLine("Press any key to continue:"); + Console.ReadKey(); + goto Start; + } + Console.WriteLine("Success!"); + Console.WriteLine("Press any key to continue:"); + Console.ReadKey(); + OpenRecNet.RecNet(); + + } + if (readline == "5") { Console.WriteLine("Please select the version of RecRoom the server should host: (2017, 2018)"); string readline2 = Console.ReadLine(); diff --git a/Setup.cs b/Setup.cs index b19fb4b..4a23ae9 100644 --- a/Setup.cs +++ b/Setup.cs @@ -42,6 +42,10 @@ namespace start { File.WriteAllText("SaveData\\Profile\\level.txt", "10"); } + if (!(File.Exists("SaveData\\Profile\\userid.txt"))) + { + File.WriteAllText("SaveData\\Profile\\userid.txt", "2"); + } if (!(File.Exists("SaveData\\myrooms.txt"))) { File.WriteAllText("SaveData\\myrooms.txt", "[]");