This commit is contained in:
recroom2016
2022-02-23 15:38:50 -05:00
parent 93e74b51b4
commit a9394b6c46
3 changed files with 101 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Net; using System.Net;
using System.IO; using System.IO;
using System.Threading;
namespace start namespace start
{ {
@@ -14,17 +15,91 @@ namespace start
{ {
Console.ForegroundColor = ConsoleColor.Blue; Console.ForegroundColor = ConsoleColor.Blue;
Console.Clear(); Console.Clear();
if ((File.ReadAllText("SaveData\\App\\showopenrecinfo.txt")) == "Enabled")
{
goto ChatStart; goto ChatStart;
}
else
{
goto SkipStart;
}
ChatStart: ChatStart:
Console.WriteLine("Welcome to OpenRecNet!"); Console.WriteLine("Welcome to OpenRecNet!");
Console.WriteLine("You are logged in as " + File.ReadAllText("SaveData\\Profile\\username.txt")); 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("Your UserID is " + File.ReadAllText("SaveData\\Profile\\userid.txt" + "."));
Console.WriteLine("In the future, show this message?"); Console.WriteLine("In the future, show this message?");
Console.WriteLine("1) Yes" + Environment.NewLine + "1) No"); Console.WriteLine("1) Yes" + Environment.NewLine + "2) No");
string readline = Console.ReadLine();
if (readline == "1")
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Enabled");
justjoined = false;
goto SkipStart;
} }
if (readline == "2")
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Disabled");
justjoined = false;
goto SkipStart;
}
SkipStart:
for (; ; )
{
Console.Clear();
string refresh = new WebClient
{
Headers =
{
{
"username",
File.ReadAllText("SaveData\\Profile\\username.txt")
},
{
"justjoined",
Convert.ToString(justjoined)
}
}
}.DownloadString("https://openrecchat.loca.lt/refresh");
Console.WriteLine(refresh);
Console.WriteLine(Environment.NewLine + "Commands: /r -Refresh /e -Exit");
Console.WriteLine("Type your message below: ");
justjoined = false;
goto Send;
}
Send:
string send = Console.ReadLine();
if (send == "/r")
{
goto SkipStart;
}
else if (send == "/e")
{
Environment.Exit(0);
}
else if (send == "")
{
goto SkipStart;
}
new WebClient
{
Headers =
{
{
"userid",
File.ReadAllText("SaveData\\Profile\\userid.txt")
},
{
"username",
File.ReadAllText("SaveData\\Profile\\username.txt")
}
}
}.UploadString("https://openrecchat.loca.lt/sendmessage", send);
goto SkipStart;
}
public static bool justjoined = false;
} }
} }

View File

@@ -25,7 +25,7 @@ namespace start
{ {
Console.WriteLine("This version of OpenRec is outdated. We recommend you install the latest version, OpenRec " + new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/version.txt")); Console.WriteLine("This version of OpenRec is outdated. We recommend you install the latest version, OpenRec " + new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/version.txt"));
} }
Console.WriteLine("1) Changelog" + Environment.NewLine +"2) Change Settings" + Environment.NewLine + "3) Modify Profile" + Environment.NewLine + "4) Start Server"); Console.WriteLine("1) Changelog" + Environment.NewLine +"2) Change Settings" + Environment.NewLine + "3) Modify Profile" + Environment.NewLine + "4) OpenRecNet" + Environment.NewLine + "5) Start Server");
string readline = Console.ReadLine(); string readline = Console.ReadLine();
if (readline == "1") if (readline == "1")
{ {
@@ -41,8 +41,8 @@ namespace start
Console.Clear(); Console.Clear();
goto Settings; goto Settings;
Settings: //SaveData\\App\\privatedorm.txt Settings:
Console.WriteLine("1) Sandbox Mode: " + File.ReadAllText("SaveData\\App\\sandbox.txt") + Environment.NewLine + "2) Private Dorm: " + File.ReadAllText("SaveData\\App\\privatedorm.txt") + Environment.NewLine + "3) Go Back"); Console.WriteLine("1) Sandbox Mode: " + File.ReadAllText("SaveData\\App\\sandbox.txt") + Environment.NewLine + "2) Private Dorm: " + File.ReadAllText("SaveData\\App\\privatedorm.txt") + Environment.NewLine + "3) OpenRecNet Info Tab: " + File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") + Environment.NewLine + "4) Go Back");
string readline4 = Console.ReadLine(); string readline4 = Console.ReadLine();
if (readline4 == "1") if (readline4 == "1")
{ {
@@ -73,6 +73,20 @@ namespace start
goto Settings; goto Settings;
} }
else if (readline4 == "3") else if (readline4 == "3")
{
if (File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") == "Disabled")
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Enabled");
}
else
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Disabled");
}
Console.Clear();
Console.WriteLine("Success!");
goto Settings;
}
else if (readline4 == "4")
{ {
Console.Clear(); Console.Clear();
goto Start; goto Start;

View File

@@ -62,6 +62,10 @@ namespace start
{ {
File.WriteAllText("SaveData\\App\\privatedorm.txt", "Disabled"); File.WriteAllText("SaveData\\App\\privatedorm.txt", "Disabled");
} }
if (!(File.Exists("SaveData\\App\\showopenrecinfo.txt")))
{
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Enabled");
}
if (!(File.Exists("SaveData\\Images\\count.txt"))) if (!(File.Exists("SaveData\\Images\\count.txt")))
{ {
File.WriteAllText("SaveData\\Images\\count.txt", "0"); File.WriteAllText("SaveData\\Images\\count.txt", "0");