working on chat features

This commit is contained in:
recroom2016
2022-02-22 23:39:22 -05:00
parent 3f8ff4a98b
commit c42d15d3aa
6 changed files with 74 additions and 4 deletions

View File

@@ -10,10 +10,8 @@ using Newtonsoft.Json;
namespace server namespace server
{ {
internal class APIServer internal class APIServer
{ {
public APIServer() public APIServer()
{ {
try try
@@ -74,6 +72,7 @@ namespace server
s = getorcreate.GetOrCreateArray((ulong.Parse(text.Remove(0, 32)))); s = getorcreate.GetOrCreateArray((ulong.Parse(text.Remove(0, 32))));
CachedPlayerID = ulong.Parse(text.Remove(0, 32)); CachedPlayerID = ulong.Parse(text.Remove(0, 32));
CachedPlatformID = ulong.Parse(text.Remove(0, 22)); CachedPlatformID = ulong.Parse(text.Remove(0, 22));
File.WriteAllText("SaveData\\Profile\\userid.txt", Convert.ToString(CachedPlayerID));
} }
if (Url == "platformlogin/v6") 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))); s = getcachedlogins.GetDebugLogin(ulong.Parse(text.Remove(0, 32)), ulong.Parse(text.Remove(0, 22)));
CachedPlayerID = ulong.Parse(text.Remove(0, 32)); CachedPlayerID = ulong.Parse(text.Remove(0, 32));
CachedPlatformID = ulong.Parse(text.Remove(0, 22)); CachedPlatformID = ulong.Parse(text.Remove(0, 22));
File.WriteAllText("SaveData\\Profile\\userid.txt", Convert.ToString(CachedPlayerID));
} }
if (Url == "platformlogin/v1/loginaccount") if (Url == "platformlogin/v1/loginaccount")
{ {
@@ -167,7 +167,7 @@ namespace server
} }
if (Url == "images/v2/named") if (Url == "images/v2/named")
{ {
s = BracketResponse; s = ImagesV2Named;
} }
if (Url == "PlayerReporting/v1/moderationBlockDetails") if (Url == "PlayerReporting/v1/moderationBlockDetails")
{ {

10
Class2.cs Normal file
View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenRec
{
class Class2
{
}
}

30
OpenRecNet.cs Normal file
View File

@@ -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");
}
}
}

View File

@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31321.278
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRec_", "OpenRec_.csproj", "{C3C433FC-52FB-4472-81F7-B271A2CDABFE}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRec_", "OpenRec_.csproj", "{C3C433FC-52FB-4472-81F7-B271A2CDABFE}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3B5E3DA5-F8EC-4767-9BC3-AE95E72631D0}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU

View File

@@ -10,7 +10,7 @@ namespace start
{ {
class Program class Program
{ {
static void Main(string[] args) static void Main()
{ {
Setup.setup(); Setup.setup();
goto Start; goto Start;
@@ -162,6 +162,30 @@ namespace start
} }
} }
if (readline == "4") 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)"); Console.WriteLine("Please select the version of RecRoom the server should host: (2017, 2018)");
string readline2 = Console.ReadLine(); string readline2 = Console.ReadLine();

View File

@@ -42,6 +42,10 @@ namespace start
{ {
File.WriteAllText("SaveData\\Profile\\level.txt", "10"); 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"))) if (!(File.Exists("SaveData\\myrooms.txt")))
{ {
File.WriteAllText("SaveData\\myrooms.txt", "[]"); File.WriteAllText("SaveData\\myrooms.txt", "[]");