1.1 progress!!!!!!!!
This commit is contained in:
parent
c706098d2e
commit
c359239794
|
|
@ -11,5 +11,7 @@ namespace NovetusCMD
|
|||
public static bool StartInNo3D = false;
|
||||
public static bool OverrideINI = false;
|
||||
public static bool RequestToOutputInfo = false;
|
||||
public static bool DebugMode = false;
|
||||
public static int ProcessID = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
|
|
|
|||
|
|
@ -151,6 +151,14 @@ namespace NovetusCMD
|
|||
{
|
||||
StopWebServer();
|
||||
}
|
||||
if (LocalVars.ProcessID != 0)
|
||||
{
|
||||
if (GlobalVars.ProcessExists(LocalVars.ProcessID))
|
||||
{
|
||||
Process proc = Process.GetProcessById(LocalVars.ProcessID);
|
||||
proc.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ReadConfigValues()
|
||||
|
|
@ -201,6 +209,7 @@ namespace NovetusCMD
|
|||
ConsolePrint("-script <path to script> | Loads an additional server script.", 4);
|
||||
ConsolePrint("-outputinfo | Outputs all information about the running server to a text file.", 4);
|
||||
ConsolePrint("-overrideconfig | Override the launcher settings.", 4);
|
||||
ConsolePrint("-debug | Disables launching of the server for debugging purposes.", 4);
|
||||
ConsolePrint("---------", 1);
|
||||
ConsolePrint("Custom server options", 3);
|
||||
ConsolePrint("-overrideconfig must be added in order for the below commands to function.", 5);
|
||||
|
|
@ -266,6 +275,11 @@ namespace NovetusCMD
|
|||
LocalVars.RequestToOutputInfo = true;
|
||||
}
|
||||
|
||||
if (CommandLine["debug"] != null)
|
||||
{
|
||||
LocalVars.DebugMode = true;
|
||||
}
|
||||
|
||||
if (CommandLine["script"] != null)
|
||||
{
|
||||
GlobalVars.AddonScriptPath = CommandLine["script"].Replace(@"\", @"\\");
|
||||
|
|
@ -292,12 +306,19 @@ namespace NovetusCMD
|
|||
|
||||
InitUPnP();
|
||||
StartWebServer();
|
||||
|
||||
|
||||
AppDomain.CurrentDomain.ProcessExit += new EventHandler(ProgramClose);
|
||||
|
||||
ConsolePrint("Launching a " + GlobalVars.SelectedClient + " server on " + GlobalVars.Map + " with " + GlobalVars.PlayerLimit + " players.", 1);
|
||||
StartServer(LocalVars.StartInNo3D);
|
||||
|
||||
if (!LocalVars.DebugMode)
|
||||
{
|
||||
StartServer(LocalVars.StartInNo3D);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateTXT();
|
||||
}
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
|
|
@ -359,7 +380,8 @@ namespace NovetusCMD
|
|||
client.Exited += new EventHandler(ServerExited);
|
||||
client.Start();
|
||||
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Server);
|
||||
CreateTXT(client);
|
||||
LocalVars.ProcessID = client.Id;
|
||||
CreateTXT();
|
||||
}
|
||||
catch (Exception ex) when (!Env.Debugging)
|
||||
{
|
||||
|
|
@ -372,7 +394,7 @@ namespace NovetusCMD
|
|||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
static void CreateTXT(Process process)
|
||||
static void CreateTXT()
|
||||
{
|
||||
if (LocalVars.RequestToOutputInfo)
|
||||
{
|
||||
|
|
@ -389,10 +411,9 @@ namespace NovetusCMD
|
|||
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
|
||||
};
|
||||
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2));
|
||||
int pid = process.Id;
|
||||
|
||||
string text = GlobalVars.MultiLine(
|
||||
"Process ID: " + pid.ToString(),
|
||||
"Process ID: " + (LocalVars.ProcessID == 0 ? "N/A" : LocalVars.ProcessID.ToString()),
|
||||
"Don't copy the Process ID when sharing the server.",
|
||||
"--------------------",
|
||||
"Server Info:",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
|
@ -234,4 +236,9 @@ public static class GlobalVars
|
|||
{
|
||||
return Regex.Replace(lines, @"^\s*$\n|\r", string.Empty, RegexOptions.Multiline).TrimEnd();
|
||||
}
|
||||
|
||||
public static bool ProcessExists(int id)
|
||||
{
|
||||
return Process.GetProcesses().Any(x => x.Id == id);
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ public class ScriptGenerator
|
|||
rbxexe = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\clients\\" + client + @"\\RobloxApp_client.exe";
|
||||
}
|
||||
|
||||
string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location);
|
||||
string md5dir = SecurityFuncs.CalculateMD5(GlobalVars.BasePath + @"\\Novetus.exe");
|
||||
string md5script = SecurityFuncs.CalculateMD5(GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua");
|
||||
string md5exe = SecurityFuncs.CalculateMD5(rbxexe);
|
||||
string md5s = "'" + md5exe + "','" + md5dir + "','" + md5script + "'";
|
||||
|
|
|
|||
|
|
@ -187,16 +187,22 @@ public class SecurityFuncs
|
|||
public static string GetExternalIPAddress()
|
||||
{
|
||||
string ipAddress;
|
||||
using (WebClient wc = new WebClient())
|
||||
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
ipAddress = wc.DownloadString("http://ipv4.icanhazip.com/");
|
||||
}
|
||||
catch (Exception) when (!Env.Debugging)
|
||||
{
|
||||
ipAddress = "localhost" + Environment.NewLine;
|
||||
}
|
||||
string url = "http://checkip.dyndns.org";
|
||||
WebRequest req = WebRequest.Create(url);
|
||||
WebResponse resp = req.GetResponse();
|
||||
StreamReader sr = new StreamReader(resp.GetResponseStream());
|
||||
string response = sr.ReadToEnd().Trim();
|
||||
string[] a = response.Split(':');
|
||||
string a2 = a[1].Substring(1);
|
||||
string[] a3 = a2.Split('<');
|
||||
ipAddress = a3[0];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
ipAddress = "localhost";
|
||||
}
|
||||
|
||||
return ipAddress;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NovetusLauncher
|
||||
{
|
||||
class LocalVars
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -69,6 +69,7 @@
|
|||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
|
|
@ -82,6 +83,7 @@
|
|||
<Compile Include="CharacterCustomization.Designer.cs">
|
||||
<DependentUpon>CharacterCustomization.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LocalVars.cs" />
|
||||
<Compile Include="SDK\ClientinfoCreator.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace NovetusLauncher
|
|||
GlobalVars.DefaultClient = lines[1];
|
||||
GlobalVars.DefaultMap = lines[2];
|
||||
GlobalVars.SelectedClient = GlobalVars.DefaultClient;
|
||||
GlobalVars.Map = GlobalVars.DefaultMap;
|
||||
GlobalVars.Map = GlobalVars.DefaultMap;
|
||||
QuickConfigure main = new QuickConfigure();
|
||||
main.ShowDialog();
|
||||
System.Threading.Timer timer = new System.Threading.Timer(new TimerCallback(CheckIfFinished), null, 1, 0);
|
||||
|
|
@ -94,7 +94,8 @@ namespace NovetusLauncher
|
|||
string ip = SecurityFuncs.Base64Decode(SplitArg[0]);
|
||||
string port = SecurityFuncs.Base64Decode(SplitArg[1]);
|
||||
string client = SecurityFuncs.Base64Decode(SplitArg[2]);
|
||||
GlobalVars.IP = ip;
|
||||
GlobalVars.SelectedClient = client;
|
||||
GlobalVars.IP = ip;
|
||||
GlobalVars.RobloxPort = Convert.ToInt32(port);
|
||||
ReadClientValues(client);
|
||||
string luafile = "";
|
||||
|
|
|
|||
Loading…
Reference in New Issue