updated stuff!!
This commit is contained in:
parent
7c4a9a59d5
commit
873d5b137b
25
Program.cs
25
Program.cs
|
|
@ -9,20 +9,21 @@ namespace ConsoleApp1
|
||||||
private static WebClient wc = new WebClient();
|
private static WebClient wc = new WebClient();
|
||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
Console.Clear();
|
|
||||||
byte[] raw = wc.DownloadData("https://archblox.com/client/version.txt");
|
byte[] raw = wc.DownloadData("https://archblox.com/client/version.txt");
|
||||||
string webData = Encoding.UTF8.GetString(raw);
|
string webData = Encoding.UTF8.GetString(raw);
|
||||||
string version_string = webData;
|
string version_string = webData;
|
||||||
string folderPath = Path.Combine(@"C:\ARCHBLOX\", version_string + @"\");
|
string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Archblx\", @"Versions\");
|
||||||
string filePath = Path.Combine(folderPath, "ArchbloxPlayerBeta.exe");
|
string clientPath = Path.Combine(folderPath, version_string + @"\");
|
||||||
Console.WriteLine("ARCHBLOX");
|
string filePath = Path.Combine(clientPath, "ArchbloxPlayerBeta.exe");
|
||||||
Console.WriteLine("1) Join a Game");
|
Console.Clear();
|
||||||
Console.WriteLine("2) Host a Game");
|
Console.WriteLine("ARCHBLOX Launcher");
|
||||||
|
Console.WriteLine("Type 1 to Join a Game");
|
||||||
|
Console.WriteLine("Type 2 to Host a Game");
|
||||||
string number = Console.ReadLine();
|
string number = Console.ReadLine();
|
||||||
if (number == "1")
|
if (number == "1")
|
||||||
{
|
{
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
Console.WriteLine("Server IP:");
|
Console.WriteLine("Server IP (Type \"localhost\" if joining your own server)");
|
||||||
string ip = Console.ReadLine();
|
string ip = Console.ReadLine();
|
||||||
Console.WriteLine("Server Port:");
|
Console.WriteLine("Server Port:");
|
||||||
string port = Console.ReadLine();
|
string port = Console.ReadLine();
|
||||||
|
|
@ -30,8 +31,10 @@ namespace ConsoleApp1
|
||||||
string username = Console.ReadLine();
|
string username = Console.ReadLine();
|
||||||
Console.WriteLine("User ID:");
|
Console.WriteLine("User ID:");
|
||||||
string userid = Console.ReadLine();
|
string userid = Console.ReadLine();
|
||||||
Console.WriteLine("Membership: (None BuildersClub TurboBuildersClub OutrageousBuildersClub)");
|
// Console.WriteLine("Membership: (None BuildersClub TurboBuildersClub OutrageousBuildersClub)");
|
||||||
string membership = Console.ReadLine();
|
// string membership = Console.ReadLine();
|
||||||
|
string membership = "None";
|
||||||
|
Console.WriteLine("Joining game server on " + ip + ":" + port + " as " + username + "(id: " + userid + ")");
|
||||||
using (System.Diagnostics.Process pProcess = new System.Diagnostics.Process())
|
using (System.Diagnostics.Process pProcess = new System.Diagnostics.Process())
|
||||||
{
|
{
|
||||||
pProcess.StartInfo.FileName = filePath;
|
pProcess.StartInfo.FileName = filePath;
|
||||||
|
|
@ -47,8 +50,9 @@ namespace ConsoleApp1
|
||||||
else if (number == "2")
|
else if (number == "2")
|
||||||
{
|
{
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
Console.WriteLine("Server Port:");
|
Console.WriteLine("Server Port (53640 is recommended):");
|
||||||
string port = Console.ReadLine();
|
string port = Console.ReadLine();
|
||||||
|
Console.WriteLine("Launced game server on port " + port + ". You will have to port-forward that port or use tools such as Hamachi or RAdminVPN to let other users join the game.");
|
||||||
using (System.Diagnostics.Process pProcess = new System.Diagnostics.Process())
|
using (System.Diagnostics.Process pProcess = new System.Diagnostics.Process())
|
||||||
{
|
{
|
||||||
pProcess.StartInfo.FileName = filePath;
|
pProcess.StartInfo.FileName = filePath;
|
||||||
|
|
@ -62,6 +66,7 @@ namespace ConsoleApp1
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
Console.WriteLine(number + " is not a correct input!");
|
||||||
Main();
|
Main();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue