mirror of
https://github.com/recroom2016/OpenRec.git
synced 2026-04-22 13:25:51 +00:00
openrec 0.7.0
This commit is contained in:
195
Program.cs
195
Program.cs
@@ -6,6 +6,8 @@ using api;
|
||||
using System.Net;
|
||||
using System.Diagnostics;
|
||||
using vaultgamesesh;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace start
|
||||
{
|
||||
@@ -16,12 +18,53 @@ namespace start
|
||||
//startup for openrec
|
||||
|
||||
Setup.setup();
|
||||
goto Start;
|
||||
goto Tutorial;
|
||||
|
||||
Start:
|
||||
Tutorial:
|
||||
if (Setup.firsttime == true)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Title = "OpenRec Intro";
|
||||
Console.WriteLine("Welcome to OpenRec " + appversion + "!");
|
||||
Console.WriteLine("Is this your first time using OpenRec?");
|
||||
Console.WriteLine("Yes or No (Y, N)");
|
||||
string readline22 = Console.ReadLine();
|
||||
if (readline22 == "y" || readline22 == "Y")
|
||||
{
|
||||
Console.Clear();
|
||||
Console.Title = "OpenRec Tutorial";
|
||||
Console.WriteLine("In that case, welcome to OpenRec!");
|
||||
Console.WriteLine("OpenRec is server software that emulates the old servers of previous RecRoom versions.");
|
||||
Console.WriteLine("To use OpenRec, you'll need to have builds aswell!");
|
||||
Console.WriteLine("To download builds, either go to the builds channel or use the links below: (these links are also available from the #builds channel)" + Environment.NewLine);
|
||||
Console.WriteLine(new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Update/builds.txt"));
|
||||
Console.WriteLine("Download a build and press any key to continue:");
|
||||
Console.ReadKey();
|
||||
Console.Clear();
|
||||
Console.WriteLine("Now that you have a build, what you're going to do is as follows:" + Environment.NewLine);
|
||||
Console.WriteLine("1. Unzip the build");
|
||||
Console.WriteLine("2. Start the server by pressing 5 on the main menu and selecting your version as follows");
|
||||
Console.WriteLine("3. Run Recroom_Release.exe from the folder of the build you downloaded." + Environment.NewLine);
|
||||
Console.WriteLine("And that's it! Press any key to go to the main menu, where you will be able to start the server:");
|
||||
Console.ReadKey();
|
||||
Console.Clear();
|
||||
goto Start;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
goto Start;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
goto Start;
|
||||
}
|
||||
|
||||
Start:
|
||||
Console.Title = "OpenRec Startup Menu";
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.WriteLine("OpenRec - Open source RecNet server software. (Version: " + appversion + ")");
|
||||
Console.WriteLine("OpenRec - Open source Old RecRoom server software. (Version: " + appversion + ")");
|
||||
Console.WriteLine("Made and provided by RecRoom 2016.");
|
||||
Console.WriteLine("Download source code here: https://github.com/recroom2016/OpenRec");
|
||||
Console.WriteLine("Discord: https://discord.gg/daC8QUhnFP" + Environment.NewLine);
|
||||
@@ -39,7 +82,8 @@ namespace start
|
||||
bannedflag = true;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("1) Changelog" + Environment.NewLine +"2) Change Settings" + Environment.NewLine + "3) Modify Profile" + Environment.NewLine + "4) Custom Room Downloader (Beta)" + Environment.NewLine + "5) Start Server");
|
||||
Console.WriteLine("//Custom Room Downloader has been moved to the settings tab!" + Environment.NewLine);
|
||||
Console.WriteLine("(1) What's New" + Environment.NewLine +"(2) Change Settings" + Environment.NewLine + "(3) Modify Profile" + Environment.NewLine + "(4) Build Download Links" + Environment.NewLine + "(5) Start Server");
|
||||
string readline = Console.ReadLine();
|
||||
if (readline == "1")
|
||||
{
|
||||
@@ -58,7 +102,7 @@ namespace start
|
||||
|
||||
Settings:
|
||||
Console.Title = "OpenRec Settings Menu";
|
||||
Console.WriteLine("1) Private Rooms: " + File.ReadAllText("SaveData\\App\\privaterooms.txt") + Environment.NewLine + "2) OpenRecNet Info Tab: " + File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") + Environment.NewLine + "3) Reset SaveData" + Environment.NewLine + "4) Go Back");
|
||||
Console.WriteLine("(1) Private Rooms: " + File.ReadAllText("SaveData\\App\\privaterooms.txt") + Environment.NewLine + "(2) Custom Room Downloader " + Environment.NewLine + "(3) Reset SaveData" + Environment.NewLine + "(4) Go Back");
|
||||
string readline4 = Console.ReadLine();
|
||||
if (readline4 == "1")
|
||||
{
|
||||
@@ -76,14 +120,23 @@ namespace start
|
||||
}
|
||||
else if (readline4 == "2")
|
||||
{
|
||||
if (File.ReadAllText("SaveData\\App\\showopenrecinfo.txt") == "Disabled")
|
||||
Console.Title = "OpenRec Custom Room Downloader";
|
||||
Console.Clear();
|
||||
Console.WriteLine("Custom Room Downloader: This tool takes the room data of any room you type in and imports it into ^CustomRoom in September 27th 2018.");
|
||||
Console.WriteLine("Please type in the name of the room you would like to download: (Case sensitive)");
|
||||
string roomname = Console.ReadLine();
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Enabled");
|
||||
text = new WebClient().DownloadString("https://rooms.rec.net/rooms?name=" + roomname + "&include=297");
|
||||
}
|
||||
else
|
||||
catch
|
||||
{
|
||||
File.WriteAllText("SaveData\\App\\showopenrecinfo.txt", "Disabled");
|
||||
Console.Clear();
|
||||
Console.WriteLine("Failed to download room...");
|
||||
goto Settings;
|
||||
}
|
||||
CustomRooms.RoomDecode(text);
|
||||
Console.Clear();
|
||||
Console.WriteLine("Success!");
|
||||
goto Settings;
|
||||
@@ -91,7 +144,7 @@ namespace start
|
||||
else if (readline4 == "3")
|
||||
{
|
||||
File.Delete("SaveData\\avatar.txt");
|
||||
File.Delete("SaveData\\avataritems.txt");
|
||||
File.Delete("SaveData\\avataritems.txt");
|
||||
File.Delete("SaveData\\equipment.txt");
|
||||
File.Delete("SaveData\\consumables.txt");
|
||||
File.Delete("SaveData\\gameconfigs.txt");
|
||||
@@ -102,9 +155,20 @@ namespace start
|
||||
File.Delete("SaveData\\myrooms.txt");
|
||||
File.Delete("SaveData\\settings.txt");
|
||||
File.Delete("SaveData\\App\\privaterooms.txt");
|
||||
File.Delete("SaveData\\App\\showopenrecinfo.txt");
|
||||
File.Delete("SaveData\\App\\facefeaturesadd.txt");
|
||||
File.Delete("SaveData\\profileimage.png");
|
||||
File.Delete("SaveData\\App\\firsttime.txt");
|
||||
|
||||
File.Delete("SaveData\\avataritems2.txt");
|
||||
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\roomname.txt");
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\roomid.txt");
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\datablob.txt");
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\roomsceneid.txt");
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\imagename.txt");
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\cheercount.txt");
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\favcount.txt");
|
||||
File.Delete("SaveData\\Rooms\\Downloaded\\visitcount.txt");
|
||||
Console.WriteLine("Success!");
|
||||
Setup.setup();
|
||||
goto Settings;
|
||||
@@ -122,7 +186,7 @@ namespace start
|
||||
|
||||
Profile:
|
||||
Console.Title = "OpenRec Profile Menu";
|
||||
Console.WriteLine("1) Change Username" + Environment.NewLine + "2) Change Profile Image" + Environment.NewLine + "3) Change Level" + Environment.NewLine + "4) Go Back");
|
||||
Console.WriteLine("(1) Change Username" + Environment.NewLine + "(2) Change Profile Image" + Environment.NewLine + "(3) Change Level" + Environment.NewLine + "(4) Profile Downloader" + Environment.NewLine + "(5) Go Back");
|
||||
string readline3 = Console.ReadLine();
|
||||
if (readline3 == "1")
|
||||
{
|
||||
@@ -137,7 +201,7 @@ namespace start
|
||||
else if (readline3 == "2")
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("1) Upload Media Link" + Environment.NewLine + "2) Drag Image onto this window" + Environment.NewLine + "3) Go Back");
|
||||
Console.WriteLine("1) Upload Media Link" + Environment.NewLine + "2) Drag Image onto this window" + Environment.NewLine + "3) Download Rec.Net Profile Image" + Environment.NewLine + "4) Go Back");
|
||||
string readline4 = Console.ReadLine();
|
||||
if (readline4 == "1")
|
||||
{
|
||||
@@ -147,7 +211,7 @@ namespace start
|
||||
{
|
||||
File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData(medialink));
|
||||
}
|
||||
catch (Exception ex4)
|
||||
catch
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("Invalid Media Link");
|
||||
@@ -166,6 +230,7 @@ namespace start
|
||||
byte[] imagefile = File.ReadAllBytes(imagedir);
|
||||
File.Replace(imagedir, "SaveData\\profileimage.png", "backupfilename.png");
|
||||
File.WriteAllBytes(imagedir, imagefile);
|
||||
File.Delete("backupfilename.png");
|
||||
}
|
||||
catch (Exception ex4)
|
||||
{
|
||||
@@ -178,6 +243,43 @@ namespace start
|
||||
goto Profile;
|
||||
}
|
||||
else if (readline4 == "3")
|
||||
{
|
||||
Console.WriteLine("Type a RecRoom @ username and press enter: ");
|
||||
string username = Console.ReadLine();
|
||||
if (username.StartsWith("@"))
|
||||
{
|
||||
username = username.Remove(0, 1);
|
||||
}
|
||||
try
|
||||
{
|
||||
string data = "";
|
||||
try
|
||||
{
|
||||
data = new WebClient().DownloadString("https://accounts.rec.net/account/search?name=" + username);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("Failed to download profile...");
|
||||
goto Start;
|
||||
}
|
||||
;
|
||||
List<ProfieStealer.Root> profile = JsonConvert.DeserializeObject<List<ProfieStealer.Root>>(data);
|
||||
byte[] profileimage = new WebClient().DownloadData("https://img.rec.net/" + profile[0].profileImage + "?cropSquare=true&width=192&height=192");
|
||||
File.WriteAllBytes("SaveData\\profileimage.png", profileimage);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("Unable to download image...");
|
||||
goto Profile;
|
||||
}
|
||||
Console.Clear();
|
||||
Console.WriteLine("Success!");
|
||||
goto Profile;
|
||||
}
|
||||
else if (readline4 == "4")
|
||||
{
|
||||
Console.Clear();
|
||||
goto Start;
|
||||
@@ -194,6 +296,33 @@ namespace start
|
||||
goto Profile;
|
||||
}
|
||||
else if (readline3 == "4")
|
||||
{
|
||||
Console.Title = "OpenRec Profile Downloader";
|
||||
Console.Clear();
|
||||
Console.WriteLine("Profile Downloader: This tool takes the username and profile image of any username you type in and imports it to OpenRec.");
|
||||
Console.WriteLine("Please type the @ username of the profile you would like:");
|
||||
string readusername = Console.ReadLine();
|
||||
if (readusername.StartsWith("@"))
|
||||
{
|
||||
readusername = readusername.Remove(0, 1);
|
||||
}
|
||||
string data2 = "";
|
||||
try
|
||||
{
|
||||
data2 = new WebClient().DownloadString("https://accounts.rec.net/account/search?name=" + readusername);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("Failed to download profile...");
|
||||
goto Start;
|
||||
}
|
||||
ProfieStealer.ProfileSteal(data2);
|
||||
Console.Clear();
|
||||
Console.WriteLine("Success!");
|
||||
goto Start;
|
||||
}
|
||||
else if (readline3 == "5")
|
||||
{
|
||||
Console.Clear();
|
||||
goto Start;
|
||||
@@ -201,24 +330,13 @@ namespace start
|
||||
}
|
||||
if (readline == "4")
|
||||
{
|
||||
Console.Title = "OpenRec Custom Room Downloader";
|
||||
Console.Title = "OpenRec Build Downloads";
|
||||
Console.Clear();
|
||||
Console.WriteLine("Please type in the name of the room you would like to download: (Case sensitive)");
|
||||
string roomname = Console.ReadLine();
|
||||
string text = "";
|
||||
try
|
||||
{
|
||||
text = new WebClient().DownloadString("https://rooms.rec.net/rooms?name=" + roomname + "&include=297");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine("Failed to download room...");
|
||||
goto Start;
|
||||
}
|
||||
CustomRooms.RoomDecode(text);
|
||||
Console.WriteLine("To download builds, either go to the builds channel or use the links below: (these links are also available from the #builds channel)" + Environment.NewLine);
|
||||
Console.WriteLine(new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Update/builds.txt"));
|
||||
Console.WriteLine("Download a build and press any key to continue:");
|
||||
Console.ReadKey();
|
||||
Console.Clear();
|
||||
Console.WriteLine("Success!");
|
||||
goto Start;
|
||||
}
|
||||
if (readline == "5")
|
||||
@@ -246,7 +364,7 @@ namespace start
|
||||
}
|
||||
else if (readline2 == "2018")
|
||||
{
|
||||
Console.WriteLine("May or September (Beta) 2018: (M, S)");
|
||||
Console.WriteLine("May, July or September (Beta) 2018: (M, J, S)");
|
||||
string readline3 = Console.ReadLine();
|
||||
if ((readline3 == "M") || (readline3 == "m"))
|
||||
{
|
||||
@@ -259,7 +377,7 @@ namespace start
|
||||
new APIServer();
|
||||
new WebSocket();
|
||||
}
|
||||
if ((readline3 == "S") || (readline3 == "s"))
|
||||
else if ((readline3 == "S") || (readline3 == "s"))
|
||||
{
|
||||
Console.Title = "OpenRec September 27th 2018";
|
||||
version = "2018";
|
||||
@@ -270,11 +388,22 @@ namespace start
|
||||
new APIServer();
|
||||
new Late2018WebSock();
|
||||
}
|
||||
else if ((readline3 == "J") || (readline3 == "j"))
|
||||
{
|
||||
Console.Title = "OpenRec July 20th 2018";
|
||||
version = "2018";
|
||||
Console.Clear();
|
||||
Console.WriteLine("Version Selected: July 20th, 2018");
|
||||
new NameServer();
|
||||
new ImageServer();
|
||||
new APIServer();
|
||||
new WebSocket();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static string version = "";
|
||||
public static string appversion = "0.6.1";
|
||||
public static string appversion = "0.7.0";
|
||||
public static bool bannedflag = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user