portmapper integration
This commit is contained in:
parent
5002021a11
commit
3b0ae50517
|
|
@ -18,6 +18,7 @@
|
||||||
public static int ServerPort = 53640;
|
public static int ServerPort = 53640;
|
||||||
public static int DefaultRobloxPort = 53640;
|
public static int DefaultRobloxPort = 53640;
|
||||||
public static int PlayerLimit = 12;
|
public static int PlayerLimit = 12;
|
||||||
|
public static string MyIP = "localhost";
|
||||||
// player settings
|
// player settings
|
||||||
public static int UserID = 0;
|
public static int UserID = 0;
|
||||||
public static string PlayerName = "Player";
|
public static string PlayerName = "Player";
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,12 @@ namespace RBXLegacyLauncher
|
||||||
|
|
||||||
void Button2Click(object sender, EventArgs e)
|
void Button2Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Process pmap = new Process();
|
||||||
|
pmap.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Java -jar portmapper.jar";
|
||||||
|
pmap.StartInfo.Arguments = "-add -externalPort" + GlobalVars.ServerPort + " -internalPort" + GlobalVars.ServerPort + "-ip" + GlobalVars.MyIP + " -protocol udp";
|
||||||
|
pmap.StartInfo.UseShellExecute = false;
|
||||||
|
pmap.StartInfo.CreateNoWindow = true;
|
||||||
|
pmap.Start();
|
||||||
WriteConfigValues();
|
WriteConfigValues();
|
||||||
StartServer();
|
StartServer();
|
||||||
|
|
||||||
|
|
@ -187,6 +193,17 @@ namespace RBXLegacyLauncher
|
||||||
label11.Text = version;
|
label11.Text = version;
|
||||||
GlobalVars.Version = version;
|
GlobalVars.Version = version;
|
||||||
ReadConfigValues();
|
ReadConfigValues();
|
||||||
|
using (WebClient wc = new WebClient())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
GlobalVars.MyIP = wc.DownloadString("http://ipv4.icanhazip.com");
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
GlobalVars.MyIP = "localhost" + Environment.NewLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadConfigValues()
|
void ReadConfigValues()
|
||||||
|
|
@ -868,14 +885,32 @@ namespace RBXLegacyLauncher
|
||||||
string important = SecurityFuncs.Base64Decode("cmJ4bGVnYWN5IGthbnJpc2hh");
|
string important = SecurityFuncs.Base64Decode("cmJ4bGVnYWN5IGthbnJpc2hh");
|
||||||
if (command.Equals("rbxlegacy server"))
|
if (command.Equals("rbxlegacy server"))
|
||||||
{
|
{
|
||||||
|
Process pmap = new Process();
|
||||||
|
pmap.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Java -jar portmapper.jar";
|
||||||
|
pmap.StartInfo.Arguments = "-add -externalPort" + GlobalVars.ServerPort + " -internalPort" + GlobalVars.ServerPort + "-ip" + GlobalVars.MyIP + " -protocol udp";
|
||||||
|
pmap.StartInfo.UseShellExecute = false;
|
||||||
|
pmap.StartInfo.CreateNoWindow = true;
|
||||||
|
pmap.Start();
|
||||||
StartServer();
|
StartServer();
|
||||||
}
|
}
|
||||||
else if (command.Equals("rbxlegacy server no3d"))
|
else if (command.Equals("rbxlegacy server no3d"))
|
||||||
{
|
{
|
||||||
|
Process pmap = new Process();
|
||||||
|
pmap.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Java -jar portmapper.jar";
|
||||||
|
pmap.StartInfo.Arguments = "-add -externalPort" + GlobalVars.ServerPort + " -internalPort" + GlobalVars.ServerPort + "-ip" + GlobalVars.MyIP + " -protocol udp";
|
||||||
|
pmap.StartInfo.UseShellExecute = false;
|
||||||
|
pmap.StartInfo.CreateNoWindow = true;
|
||||||
|
pmap.Start();
|
||||||
StartServerNo3D();
|
StartServerNo3D();
|
||||||
}
|
}
|
||||||
else if (command.Equals("rbxlegacy no3d"))
|
else if (command.Equals("rbxlegacy no3d"))
|
||||||
{
|
{
|
||||||
|
Process pmap = new Process();
|
||||||
|
pmap.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Java -jar portmapper.jar";
|
||||||
|
pmap.StartInfo.Arguments = "-add -externalPort" + GlobalVars.ServerPort + " -internalPort" + GlobalVars.ServerPort + "-ip" + GlobalVars.MyIP + " -protocol udp";
|
||||||
|
pmap.StartInfo.UseShellExecute = false;
|
||||||
|
pmap.StartInfo.CreateNoWindow = true;
|
||||||
|
pmap.Start();
|
||||||
StartServerNo3D();
|
StartServerNo3D();
|
||||||
}
|
}
|
||||||
else if (command.Equals("rbxlegacy client"))
|
else if (command.Equals("rbxlegacy client"))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue