1.1.1
This commit is contained in:
parent
cca5e66149
commit
121d929eb6
|
|
@ -100,11 +100,13 @@ namespace NovetusLauncher
|
||||||
|
|
||||||
public static void ResetConfigValues()
|
public static void ResetConfigValues()
|
||||||
{
|
{
|
||||||
|
GlobalVars.SelectedClient = GlobalVars.DefaultClient;
|
||||||
|
GlobalVars.Map = GlobalVars.DefaultMap;
|
||||||
GlobalVars.CloseOnLaunch = false;
|
GlobalVars.CloseOnLaunch = false;
|
||||||
GlobalVars.UserID = 0;
|
GlobalVars.UserID = 0;
|
||||||
GlobalVars.PlayerName = "Player";
|
GlobalVars.PlayerName = "Player";
|
||||||
GlobalVars.SelectedClient = GlobalVars.DefaultClient;
|
GlobalVars.SelectedClient = GlobalVars.DefaultClient;
|
||||||
GlobalVars.Map = "Baseplate.rbxl";
|
GlobalVars.Map = GlobalVars.DefaultMap;
|
||||||
GlobalVars.RobloxPort = 53640;
|
GlobalVars.RobloxPort = 53640;
|
||||||
GlobalVars.PlayerLimit = 12;
|
GlobalVars.PlayerLimit = 12;
|
||||||
GlobalVars.DisableTeapotTurret = false;
|
GlobalVars.DisableTeapotTurret = false;
|
||||||
|
|
@ -661,28 +663,42 @@ namespace NovetusLauncher
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string RandomString(int length)
|
public static string RandomString()
|
||||||
{
|
{
|
||||||
CryptoRandom random = new CryptoRandom();
|
CryptoRandom random = new CryptoRandom();
|
||||||
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
return new String(' ', random.Next(20));
|
||||||
return new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RenameWindow(Process exe, ScriptGenerator.ScriptType type)
|
public static void RenameWindow(Process exe, ScriptGenerator.ScriptType type)
|
||||||
{
|
{
|
||||||
int time = 1000;
|
int time = 500;
|
||||||
BackgroundWorker worker = new BackgroundWorker();
|
BackgroundWorker worker = new BackgroundWorker();
|
||||||
worker.DoWork += (obj, e) => WorkerDoWork(exe, type, time);
|
worker.DoWork += (obj, e) => WorkerDoWork(exe, type, time, worker);
|
||||||
worker.RunWorkerAsync();
|
worker.RunWorkerAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WorkerDoWork(Process exe, ScriptGenerator.ScriptType type, int time)
|
private static void WorkerDoWork(Process exe, ScriptGenerator.ScriptType type, int time, BackgroundWorker worker)
|
||||||
{
|
{
|
||||||
if (exe.IsRunning() == true)
|
if (exe.IsRunning() == true)
|
||||||
{
|
{
|
||||||
while (exe.IsRunning() == true)
|
while (exe.IsRunning() == true)
|
||||||
{
|
{
|
||||||
SetWindowText(exe.MainWindowHandle, "Novetus - " + GlobalVars.SelectedClient + " " + ScriptGenerator.GetNameForType(type) + " [" + RandomString(12) + "]");
|
if (exe.IsRunning() != true)
|
||||||
|
{
|
||||||
|
worker.DoWork -= (obj, e) => WorkerDoWork(exe, type, time, worker);
|
||||||
|
worker.CancelAsync();
|
||||||
|
worker.Dispose();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == ScriptGenerator.ScriptType.Client)
|
||||||
|
{
|
||||||
|
SetWindowText(exe.MainWindowHandle, "Novetus - " + GlobalVars.SelectedClient + " " + ScriptGenerator.GetNameForType(type) + " [" + GlobalVars.IP + ":" + GlobalVars.RobloxPort + "]" + RandomString());
|
||||||
|
}
|
||||||
|
else if (type == ScriptGenerator.ScriptType.Server || type == ScriptGenerator.ScriptType.Solo || type == ScriptGenerator.ScriptType.Studio)
|
||||||
|
{
|
||||||
|
SetWindowText(exe.MainWindowHandle, "Novetus - " + GlobalVars.SelectedClient + " " + ScriptGenerator.GetNameForType(type) + " [" + GlobalVars.Map + "]" + RandomString());
|
||||||
|
}
|
||||||
Thread.Sleep(time);
|
Thread.Sleep(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,8 +212,6 @@ namespace NovetusLauncher
|
||||||
}
|
}
|
||||||
label5.Text = GlobalVars.BasePath;
|
label5.Text = GlobalVars.BasePath;
|
||||||
label8.Text = Application.ProductVersion;
|
label8.Text = Application.ProductVersion;
|
||||||
GlobalVars.IP = "localhost";
|
|
||||||
GlobalVars.Map = "Baseplate.rbxl";
|
|
||||||
GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location);
|
GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location);
|
||||||
label11.Text = version;
|
label11.Text = version;
|
||||||
GlobalVars.Version = version;
|
GlobalVars.Version = version;
|
||||||
|
|
@ -1080,7 +1078,7 @@ namespace NovetusLauncher
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ConsolePrint("ERROR 5 - Failed to install URI. (Did not run as Administrator)", 2);
|
ConsolePrint("ERROR 5 - Failed to install URI. (Did not run as Administrator)", 2);
|
||||||
DialogResult result2 = MessageBox.Show("Failed to install URI. (Error: Did not run as Administrator)","Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
DialogResult result2 = MessageBox.Show("Failed to install URI. (Error: Did not run as Administrator)","Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue