mirror of
https://github.com/Novetus/Novetus_src.git
synced 2025-01-31 09:41:33 +02:00
add console detection
This commit is contained in:
parent
b3eef48006
commit
e6d2858ccf
@ -1015,7 +1015,10 @@ public class ClientManagement
|
||||
Util.ConsolePrint("ERROR - Failed to launch Novetus. (A server is already running.)", 2);
|
||||
|
||||
#if LAUNCHER
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: A server is already running.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
if (!GlobalVars.isConsoleOnly)
|
||||
{
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: A server is already running.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -1027,7 +1030,10 @@ public class ClientManagement
|
||||
"Roblox does NOT use TCP, only UDP. However, if your server doesn't work with just UDP, feel free to set up TCP too as that might help the issue in some cases.";
|
||||
#pragma warning restore CS0219 // Variable is assigned but its value is never used
|
||||
#if LAUNCHER
|
||||
MessageBox.Show(hostingTips, "Novetus - Hosting Tips", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
if (!GlobalVars.isConsoleOnly)
|
||||
{
|
||||
MessageBox.Show(hostingTips, "Novetus - Hosting Tips", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
#elif CMD
|
||||
Util.ConsolePrint(hostingTips + "\nPress any key to continue...", 4);
|
||||
Console.ReadKey();
|
||||
@ -1048,7 +1054,10 @@ public class ClientManagement
|
||||
Util.ConsolePrint("ERROR - Failed to launch Novetus. (A game is already running.)", 2);
|
||||
|
||||
#if LAUNCHER
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: A game is already running.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
if (!GlobalVars.isConsoleOnly)
|
||||
{
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: A game is already running.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -1095,7 +1104,10 @@ public class ClientManagement
|
||||
#endif
|
||||
|
||||
#if LAUNCHER
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: The client has been detected as modified.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
if (!GlobalVars.isConsoleOnly)
|
||||
{
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: The client has been detected as modified.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if URI
|
||||
@ -1185,7 +1197,10 @@ public class ClientManagement
|
||||
#endif
|
||||
|
||||
#if LAUNCHER
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: The client has been detected as modified.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
if (!GlobalVars.isConsoleOnly)
|
||||
{
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: The client has been detected as modified.)", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if URI
|
||||
@ -1243,7 +1258,10 @@ public class ClientManagement
|
||||
#endif
|
||||
|
||||
#if URI || LAUNCHER
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: " + ex.Message + ")", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
if (!GlobalVars.isConsoleOnly)
|
||||
{
|
||||
MessageBox.Show("Failed to launch Novetus. (Error: " + ex.Message + ")", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
#endif
|
||||
#if URI || LAUNCHER || CMD || BASICLAUNCHER
|
||||
Util.LogExceptions(ex);
|
||||
|
@ -109,6 +109,7 @@ public static class GlobalVars
|
||||
public static string Important2 = "";
|
||||
public static string NextCommand = "";
|
||||
public static bool AppClosed = false;
|
||||
public static bool isConsoleOnly = false;
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
@ -351,7 +351,7 @@ namespace NovetusLauncher
|
||||
break;
|
||||
}
|
||||
|
||||
if (GlobalVars.UserConfiguration.CloseOnLaunch)
|
||||
if (GlobalVars.UserConfiguration.CloseOnLaunch && !GlobalVars.isConsoleOnly)
|
||||
{
|
||||
Parent.Visible = false;
|
||||
}
|
||||
@ -431,6 +431,11 @@ namespace NovetusLauncher
|
||||
{
|
||||
Parent.Visible = true;
|
||||
}
|
||||
|
||||
if (GlobalVars.isConsoleOnly && !GlobalVars.isConsoleOnly)
|
||||
{
|
||||
CloseEventInternal();
|
||||
}
|
||||
}
|
||||
|
||||
// FINALLY. https://stackoverflow.com/questions/11530643/treeview-search
|
||||
|
@ -41,7 +41,6 @@ namespace NovetusLauncher
|
||||
GlobalVars.ColorsLoaded = FileManagement.InitColors();
|
||||
|
||||
bool isSDK = false;
|
||||
bool isCMD = false;
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
@ -54,7 +53,7 @@ namespace NovetusLauncher
|
||||
|
||||
if (CommandLine["cmd"] != null)
|
||||
{
|
||||
isCMD = true;
|
||||
GlobalVars.isConsoleOnly = true;
|
||||
}
|
||||
|
||||
if (CommandLine["nofilelist"] != null)
|
||||
@ -63,7 +62,7 @@ namespace NovetusLauncher
|
||||
}
|
||||
}
|
||||
|
||||
Run(args, isSDK, isCMD);
|
||||
Run(args, isSDK, GlobalVars.isConsoleOnly);
|
||||
}
|
||||
|
||||
static void Run(string[] args, bool sdk = false, bool cmdonly = false)
|
||||
|
Loading…
Reference in New Issue
Block a user