diff --git a/Novetus/Novetus.Tools.sln b/Novetus/Novetus.Tools.sln new file mode 100644 index 0000000..ffc0ea5 --- /dev/null +++ b/Novetus/Novetus.Tools.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32630.192 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.ClientScriptTester", "Novetus.ClientScriptTester\Novetus.ClientScriptTester.csproj", "{83B08607-65B8-4F9C-8D0F-AB1C8EEFFAE0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.ReleasePreparer", "Novetus.ReleasePreparer\Novetus.ReleasePreparer.csproj", "{64A99062-3C1C-4D2E-99E4-D6D92443AC98}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F92FFBED-2767-4676-9711-BB89CDA58A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F92FFBED-2767-4676-9711-BB89CDA58A43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F92FFBED-2767-4676-9711-BB89CDA58A43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F92FFBED-2767-4676-9711-BB89CDA58A43}.Release|Any CPU.Build.0 = Release|Any CPU + {2070EAA6-7606-4006-A628-5705C24A3644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2070EAA6-7606-4006-A628-5705C24A3644}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2070EAA6-7606-4006-A628-5705C24A3644}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2070EAA6-7606-4006-A628-5705C24A3644}.Release|Any CPU.Build.0 = Release|Any CPU + {83B08607-65B8-4F9C-8D0F-AB1C8EEFFAE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83B08607-65B8-4F9C-8D0F-AB1C8EEFFAE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83B08607-65B8-4F9C-8D0F-AB1C8EEFFAE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83B08607-65B8-4F9C-8D0F-AB1C8EEFFAE0}.Release|Any CPU.Build.0 = Release|Any CPU + {64A99062-3C1C-4D2E-99E4-D6D92443AC98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64A99062-3C1C-4D2E-99E4-D6D92443AC98}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64A99062-3C1C-4D2E-99E4-D6D92443AC98}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64A99062-3C1C-4D2E-99E4-D6D92443AC98}.Release|Any CPU.Build.0 = Release|Any CPU + {D7B467EE-A4B9-42FB-AA83-F487DA0F5CB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7B467EE-A4B9-42FB-AA83-F487DA0F5CB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7B467EE-A4B9-42FB-AA83-F487DA0F5CB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7B467EE-A4B9-42FB-AA83-F487DA0F5CB1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {66CA6CE5-670E-48AA-A2DA-9347371D4CA0} + EndGlobalSection +EndGlobal diff --git a/Novetus/Novetus.sln b/Novetus/Novetus.sln index df8fc13..20d3b35 100644 --- a/Novetus/Novetus.sln +++ b/Novetus/Novetus.sln @@ -1,30 +1,17 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30114.105 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32630.192 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.Launcher", "NovetusLauncher\Novetus.Launcher.csproj", "{F92FFBED-2767-4676-9711-BB89CDA58A43}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.CMD", "NovetusCMD\Novetus.CMD.csproj", "{BAC99C87-F6C1-4ED0-AA2E-05C6AE8979EA}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.URI", "NovetusURI\Novetus.URI.csproj", "{2070EAA6-7606-4006-A628-5705C24A3644}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Novetus.Core", "NovetusCore\Novetus.Core.shproj", "{DEBCC57D-9A3B-4D7C-8693-FA4AEC56C8C1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.ClientScriptTester", "Novetus.ClientScriptTester\Novetus.ClientScriptTester.csproj", "{83B08607-65B8-4F9C-8D0F-AB1C8EEFFAE0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.ReleasePreparer", "Novetus.ReleasePreparer\Novetus.ReleasePreparer.csproj", "{64A99062-3C1C-4D2E-99E4-D6D92443AC98}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novetus.Bootstrapper", "Novetus.Bootstrapper\Novetus.Bootstrapper.csproj", "{D7B467EE-A4B9-42FB-AA83-F487DA0F5CB1}" EndProject Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - NovetusCore\NovetusCore.projitems*{2070eaa6-7606-4006-a628-5705c24a3644}*SharedItemsImports = 4 - NovetusCore\NovetusCore.projitems*{bac99c87-f6c1-4ed0-aa2e-05c6ae8979ea}*SharedItemsImports = 4 - NovetusCore\NovetusCore.projitems*{d7b467ee-a4b9-42fb-aa83-f487da0f5cb1}*SharedItemsImports = 4 - NovetusCore\NovetusCore.projitems*{debcc57d-9a3b-4d7c-8693-fa4aec56c8c1}*SharedItemsImports = 13 - NovetusCore\NovetusCore.projitems*{f92ffbed-2767-4676-9711-bb89cda58a43}*SharedItemsImports = 4 - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -34,10 +21,6 @@ Global {F92FFBED-2767-4676-9711-BB89CDA58A43}.Debug|Any CPU.Build.0 = Debug|Any CPU {F92FFBED-2767-4676-9711-BB89CDA58A43}.Release|Any CPU.ActiveCfg = Release|Any CPU {F92FFBED-2767-4676-9711-BB89CDA58A43}.Release|Any CPU.Build.0 = Release|Any CPU - {BAC99C87-F6C1-4ED0-AA2E-05C6AE8979EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BAC99C87-F6C1-4ED0-AA2E-05C6AE8979EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BAC99C87-F6C1-4ED0-AA2E-05C6AE8979EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BAC99C87-F6C1-4ED0-AA2E-05C6AE8979EA}.Release|Any CPU.Build.0 = Release|Any CPU {2070EAA6-7606-4006-A628-5705C24A3644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2070EAA6-7606-4006-A628-5705C24A3644}.Debug|Any CPU.Build.0 = Debug|Any CPU {2070EAA6-7606-4006-A628-5705C24A3644}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -61,4 +44,10 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {66CA6CE5-670E-48AA-A2DA-9347371D4CA0} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + NovetusCore\NovetusCore.projitems*{2070eaa6-7606-4006-a628-5705c24a3644}*SharedItemsImports = 4 + NovetusCore\NovetusCore.projitems*{d7b467ee-a4b9-42fb-aa83-f487da0f5cb1}*SharedItemsImports = 4 + NovetusCore\NovetusCore.projitems*{debcc57d-9a3b-4d7c-8693-fa4aec56c8c1}*SharedItemsImports = 13 + NovetusCore\NovetusCore.projitems*{f92ffbed-2767-4676-9711-bb89cda58a43}*SharedItemsImports = 4 + EndGlobalSection EndGlobal diff --git a/Novetus/NovetusCore/Classes/Downloader.cs b/Novetus/NovetusCore/Classes/Downloader.cs index 36d00eb..8cc473b 100644 --- a/Novetus/NovetusCore/Classes/Downloader.cs +++ b/Novetus/NovetusCore/Classes/Downloader.cs @@ -100,7 +100,7 @@ class Downloader { read = DownloadFile(fileURL, name); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -211,7 +211,7 @@ class Downloader } catch (Exception e) { -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER Util.LogExceptions(e); #endif if (e is WebException && bytesProcessed == 0) diff --git a/Novetus/NovetusCore/Classes/INIFile.cs b/Novetus/NovetusCore/Classes/INIFile.cs index 239cd32..9d944c0 100644 --- a/Novetus/NovetusCore/Classes/INIFile.cs +++ b/Novetus/NovetusCore/Classes/INIFile.cs @@ -84,7 +84,7 @@ public class INIFile return false; } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); diff --git a/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs b/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs index 3b11a9f..82bad31 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/ClientManagement.cs @@ -45,7 +45,7 @@ public class ClientManagement GenerateDefaultClientInfo(Path.GetDirectoryName(clientpath)); ReadClientValues(name, initial); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -228,7 +228,7 @@ public class ClientManagement LoadClientValues(info, clientpath); return info; } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -630,7 +630,7 @@ public class ClientManagement } } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -696,7 +696,7 @@ public class ClientManagement ApplyClientSettings(info, ClientName, GraphicsMode, MeshDetail, ShadingQuality, MaterialQuality, AA, AASamples, Bevels, Shadows_2008, Shadows_2007, Style_2007, GFXQualityLevel, WindowResolution, FullscreenResolution, ModernResolution); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -735,7 +735,7 @@ public class ClientManagement fixedfile = RobloxXML.RemoveInvalidXmlChars(RobloxXML.ReplaceHexadecimalSymbols(oldfile)); doc = XDocument.Parse(fixedfile); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -785,7 +785,7 @@ public class ClientManagement RobloxXML.EditRenderSettings(doc, "Resolution", ModernResolution.ToString(), XMLTypes.Token); } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -805,7 +805,7 @@ public class ClientManagement } } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -1024,19 +1024,19 @@ public class ClientManagement } else if (GlobalVars.UserConfiguration.FirstServerLaunch) { -#pragma warning disable CS0219 // Variable is assigned but its value is never used +#if LAUNCHER string hostingTips = "For your first time hosting a server, make sure your server's port forwarded (set up in your router), going through a tunnel server, or running from UPnP.\n" + "If your port is forwarded or you are going through a tunnel server, make sure your port is set up as UDP, not TCP.\n" + "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 + 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(); + else + { + Util.ConsolePrint("Tips: " + hostingTips, 4); + } #endif GlobalVars.UserConfiguration.FirstServerLaunch = false; } @@ -1099,7 +1099,7 @@ public class ClientManagement { #if URI UpdateStatus(label, "The client has been detected as modified."); -#elif LAUNCHER || CMD +#elif LAUNCHER Util.ConsolePrint("ERROR - Failed to launch Novetus. (The client has been detected as modified.)", 2); #endif @@ -1121,7 +1121,7 @@ public class ClientManagement GlobalVars.ValidatedExtraFiles += 1; } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -1192,7 +1192,7 @@ public class ClientManagement { #if URI UpdateStatus(label, "The client has been detected as modified."); -#elif LAUNCHER || CMD +#elif LAUNCHER Util.ConsolePrint("ERROR - Failed to launch Novetus. (The client has been detected as modified.)", 2); #endif @@ -1245,7 +1245,7 @@ public class ClientManagement GlobalVars.ValidatedExtraFiles = 0; } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) #else catch (Exception) @@ -1253,7 +1253,7 @@ public class ClientManagement { #if URI UpdateStatus(label, "Error: " + ex.Message); -#elif LAUNCHER || CMD +#elif LAUNCHER Util.ConsolePrint("ERROR - Failed to launch Novetus. (Error: " + ex.Message + ")", 2); #endif @@ -1263,7 +1263,7 @@ public class ClientManagement MessageBox.Show("Failed to launch Novetus. (Error: " + ex.Message + ")", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } #endif -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER Util.LogExceptions(ex); #endif @@ -1297,8 +1297,8 @@ public class ClientManagement } } -#if CMD - GlobalVars.ProcessID = client.Id; + //TODO: make a command that uses this. +#if CMD_LEGACY NovetusFuncs.CreateTXT(); #endif } @@ -1523,7 +1523,7 @@ public class ScriptFuncs string result = code.Substring(pFrom, pTo - pFrom); return result; } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -1601,7 +1601,7 @@ public class ScriptFuncs return source; } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); diff --git a/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs b/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs index 361603d..9f1f15a 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs @@ -587,7 +587,7 @@ public class IconLoader catch (Exception ex) { installOutcome = "Error when installing icon: " + ex.Message; -#if URI || LAUNCHER || CMD +#if URI || LAUNCHER || BASICLAUNCHER Util.LogExceptions(ex); #endif } @@ -688,7 +688,7 @@ public class FileManagement GlobalVars.UserConfiguration.MapPath = GlobalPaths.MapsDir + @"\\" + GlobalVars.ProgramInformation.DefaultMap; GlobalVars.UserConfiguration.MapPathSnip = GlobalPaths.MapsDirBase + @"\\" + GlobalVars.ProgramInformation.DefaultMap; } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -942,7 +942,7 @@ public class FileManagement Config(cfgpath, true); } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -1111,7 +1111,7 @@ public class FileManagement GlobalVars.UserCustomization.ExtraSelectionIsHat = ValueBool(extraishat, DefaultCustomization.ExtraSelectionIsHat); GlobalVars.UserCustomization.ShowHatsInExtra = ValueBool(showhatsonextra, DefaultCustomization.ShowHatsInExtra); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -1234,7 +1234,7 @@ public class FileManagement break; } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -1264,7 +1264,7 @@ public class FileManagement goto Failure; } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -1302,7 +1302,7 @@ public class FileManagement goto Failure; } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs index 776ee9b..96da8e9 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs @@ -60,12 +60,6 @@ public static class GlobalVars public static string PlayerTripcode = ""; #endregion - #region NovetusCMD - //only for novetuscmd. only here because of launchrbxclient >:( - public static int ProcessID = 0; - public static bool RequestToOutputInfo = false; - #endregion - #if LAUNCHER #region Novetus Launcher public static NovetusLauncher.NovetusConsole consoleForm = null; diff --git a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs index d0ef660..779acf1 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs @@ -52,7 +52,7 @@ public class NovetusFuncs download.InitDownloadNoDialog(path); return GlobalPaths.AssetCacheAssetsGameDir + download.fileName; } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -102,7 +102,7 @@ public class NovetusFuncs return RobloxXML.GetURLInNodes(doc, assetCacheDef.Class, assetCacheDef.Id[0], item); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); @@ -207,20 +207,12 @@ public class NovetusFuncs public static void CreateTXT() { - if (GlobalVars.RequestToOutputInfo) - { - List text = new List(); - text.AddRange(new string[] { - "Process ID: " + (GlobalVars.ProcessID == 0 ? "N/A" : GlobalVars.ProcessID.ToString()), - "Don't copy the Process ID when sharing the server.", - "--------------------" - }); - text.AddRange(LoadServerInformation()); + List text = new List(); + text.AddRange(LoadServerInformation()); - string txt = GlobalPaths.BasePath + "\\" + GlobalPaths.ServerInfoFileName; - File.WriteAllLines(txt, text); - Util.ConsolePrint("Server Information sent to file " + txt, 4); - } + string txt = GlobalPaths.BasePath + "\\" + GlobalPaths.ServerInfoFileName; + File.WriteAllLines(txt, text); + Util.ConsolePrint("Server Information sent to file " + txt, 4); } #if LAUNCHER || URI diff --git a/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs index 7d8af62..3b7b99c 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/SecurityFuncs.cs @@ -317,7 +317,7 @@ public class SecurityFuncs { ipAddress = new WebClient().DownloadString("https://ipv4.icanhazip.com/").TrimEnd(); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { Util.LogExceptions(ex); diff --git a/Novetus/NovetusCore/StorageAndFunctions/Util.cs b/Novetus/NovetusCore/StorageAndFunctions/Util.cs index c2f705f..ea3d321 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/Util.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/Util.cs @@ -400,7 +400,7 @@ public static class Util image.SetPropertyItem(item); } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { LogExceptions(ex); @@ -501,7 +501,7 @@ public static class Util } } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { LogExceptions(ex); @@ -544,7 +544,7 @@ public static class Util FixedFileMove(path, finalPath, File.Exists(finalPath)); } -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER catch (Exception ex) { LogExceptions(ex); @@ -581,7 +581,7 @@ public static class Util } } -#if LAUNCHER || CMD || URI || BASICLAUNCHER +#if LAUNCHER || URI || BASICLAUNCHER public static void LogExceptions(Exception ex) { LogPrint("EXCEPTION|MESSAGE: " + (ex.Message != null ? ex.Message.ToString() : "N/A"), 2); @@ -623,7 +623,7 @@ public static class Util } catch (Exception ex) { -#if URI || LAUNCHER || CMD || BASICLAUNCHER +#if URI || LAUNCHER || BASICLAUNCHER LogExceptions(ex); #endif exceptionMessage = ex.Message; diff --git a/Novetus/NovetusLauncher/Forms/NovetusConsole.cs b/Novetus/NovetusLauncher/Forms/NovetusConsole.cs index edef7fa..6c473ed 100644 --- a/Novetus/NovetusLauncher/Forms/NovetusConsole.cs +++ b/Novetus/NovetusLauncher/Forms/NovetusConsole.cs @@ -20,6 +20,7 @@ namespace NovetusLauncher bool helpMode = false; bool disableCommands = false; string[] argList; + FileFormat.Config savedConfig; public NovetusConsole(string[] args) { @@ -30,7 +31,6 @@ namespace NovetusLauncher private void NovetusConsole_Load(object sender, EventArgs e) { - Util.ConsolePrint("Novetus version " + GlobalVars.ProgramInformation.Version + " loaded. Initializing config.", 4); Util.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 4); if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName)) @@ -58,13 +58,13 @@ namespace NovetusLauncher if (argList.Length > 0) { //DO ARGS HERE - ConsoleProcessArguments(argList); + ConsoleProcessArguments(); } } - private void ConsoleProcessArguments(string[] args) + private void ConsoleProcessArguments() { - CommandLineArguments.Arguments ConsoleArgs = new CommandLineArguments.Arguments(args); + CommandLineArguments.Arguments ConsoleArgs = new CommandLineArguments.Arguments(argList); if (ConsoleArgs["help"] != null) { @@ -75,6 +75,7 @@ namespace NovetusLauncher if (ConsoleArgs["cmdonly"] != null && ConsoleArgs["cmdmode"] != null && !helpMode) { //cmd mode + savedConfig = GlobalVars.UserConfiguration; disableCommands = true; bool no3d = false; bool nomap = false; @@ -109,28 +110,105 @@ namespace NovetusLauncher Util.ConsolePrint(error, 2); } - if (ConsoleArgs["no3d"] != null) + if (ConsoleArgs["map"] != null) { - if (loadMode == ScriptType.Server) - { - no3d = true; - Util.ConsolePrint("Novetus will now launch the server in No3D mode.", 4); - Util.ConsolePrint("Launching the server without graphics enables better performance. " + - "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes." + - "This feature may also make your server unstable.", 5); - } + GlobalVars.UserConfiguration.Map = ConsoleArgs["map"]; + GlobalVars.UserConfiguration.MapPath = ConsoleArgs["map"]; + Util.ConsolePrint("Novetus will now launch the client with the map " + GlobalVars.UserConfiguration.MapPath, 4); + } + else + { + Util.ConsolePrint("Novetus will launch the sclient with the map defined in the INI file.", 4); } - if (ConsoleArgs["nomap"] != null) + if (ConsoleArgs["client"] != null) { - if (loadMode == ScriptType.Studio) - { - nomap = true; - Util.ConsolePrint("Novetus will now launch Studio with no map.", 4); - } + GlobalVars.UserConfiguration.SelectedClient = ConsoleArgs["client"]; + } + else + { + Util.ConsolePrint("Novetus will launch the client defined in the INI file.", 4); } - //add more here for loadmode. + switch (loadMode) + { + case ScriptType.Client: + { + + } + break; + case ScriptType.Server: + { + if (ConsoleArgs["no3d"] != null) + { + no3d = true; + Util.ConsolePrint("Novetus will now launch the server in No3D mode.", 4); + Util.ConsolePrint("Launching the server without graphics enables better performance. " + + "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes." + + "This feature may also make your server unstable.", 5); + } + + if (ConsoleArgs["hostport"] != null) + { + GlobalVars.UserConfiguration.RobloxPort = Convert.ToInt32(ConsoleArgs["hostport"]); + } + + if (ConsoleArgs["upnp"] != null) + { + GlobalVars.UserConfiguration.UPnP = Convert.ToBoolean(ConsoleArgs["upnp"]); + + if (GlobalVars.UserConfiguration.UPnP) + { + Util.ConsolePrint("Novetus will now use UPnP for port forwarding.", 4); + } + else + { + Util.ConsolePrint("Novetus will not use UPnP for port forwarding. Make sure the port " + GlobalVars.UserConfiguration.RobloxPort + " is properly forwarded or you are running a LAN redirection tool.", 4); + } + } + + if (ConsoleArgs["notifications"] != null) + { + GlobalVars.UserConfiguration.ShowServerNotifications = Convert.ToBoolean(ConsoleArgs["notifications"]); + + if (GlobalVars.UserConfiguration.ShowServerNotifications) + { + Util.ConsolePrint("Novetus will show notifications on player join/leave.", 4); + } + else + { + Util.ConsolePrint("Novetus will not show notifications on player join/leave.", 4); + } + } + + if (ConsoleArgs["maxplayers"] != null) + { + GlobalVars.UserConfiguration.PlayerLimit = Convert.ToInt32(ConsoleArgs["maxplayers"]); + } + + if (ConsoleArgs["serverbrowsername"] != null) + { + GlobalVars.UserConfiguration.ServerBrowserServerName = ConsoleArgs["serverbrowsername"]; + } + + if (ConsoleArgs["serverbrowseraddress"] != null) + { + GlobalVars.UserConfiguration.ServerBrowserServerAddress = ConsoleArgs["serverbrowseraddress"]; + } + } + break; + case ScriptType.Studio: + { + if (ConsoleArgs["nomap"] != null) + { + nomap = true; + Util.ConsolePrint("Novetus will now launch Studio with no map.", 4); + } + } + break; + default: + break; + } } ConsoleForm.StartGame(loadMode, no3d, nomap, true); @@ -324,7 +402,15 @@ namespace NovetusLauncher Util.ConsolePrint("---------", 1, true); Util.ConsolePrint("LOAD - Parameters for loading clients in NovetusCMD mode.", 5, true); Util.ConsolePrint("---------", 1, true); + Util.ConsolePrint("- map | Specifies the path to a map.", 4, true); + Util.ConsolePrint("- client | Specifies the client for Novetus to load.", 4, true); Util.ConsolePrint("- no3d | Server Only. Puts the server into No Graphics mode.", 4, true); + Util.ConsolePrint("- hostport | Server Only. Specifies the port the server should host on.", 4, true); + Util.ConsolePrint("- upnp | Server Only. Toggles UPnP (Universal Plug and Play).", 4, true); + Util.ConsolePrint("- notifications | Server Only. Toggle player join/leave notifications.", 4, true); + Util.ConsolePrint("- maxplayers | Server Only. Specifies the server's player count.", 4, true); + Util.ConsolePrint("- serverbrowsername | Server Only. Specifies the name the server should use on the Server Browser.", 4, true); + Util.ConsolePrint("- serverbrowseraddress
| Server Only. Specifies the Master Server the server should use.", 4, true); Util.ConsolePrint("- nomap | Studio Only. Loads Studio without a map.", 4, true); Util.ConsolePrint(GlobalVars.Important2, 0, true, true); ScrollToTop(); @@ -386,6 +472,11 @@ namespace NovetusLauncher private void ConsoleClose(object sender, FormClosingEventArgs e) { + CommandLineArguments.Arguments ConsoleArgs = new CommandLineArguments.Arguments(argList); + if (ConsoleArgs["cmdonly"] != null && ConsoleArgs["cmdmode"] != null && !helpMode) + { + GlobalVars.UserConfiguration = savedConfig; + } ConsoleForm.CloseEventInternal(); } } diff --git a/Novetus/NovetusCMD/Classes/LocalFuncs.cs b/Novetus/old/NovetusCMD/Classes/LocalFuncs.cs similarity index 100% rename from Novetus/NovetusCMD/Classes/LocalFuncs.cs rename to Novetus/old/NovetusCMD/Classes/LocalFuncs.cs diff --git a/Novetus/NovetusCMD/Classes/LocalVars.cs b/Novetus/old/NovetusCMD/Classes/LocalVars.cs similarity index 100% rename from Novetus/NovetusCMD/Classes/LocalVars.cs rename to Novetus/old/NovetusCMD/Classes/LocalVars.cs diff --git a/Novetus/NovetusCMD/Novetus.CMD.csproj b/Novetus/old/NovetusCMD/Novetus.CMD.csproj similarity index 100% rename from Novetus/NovetusCMD/Novetus.CMD.csproj rename to Novetus/old/NovetusCMD/Novetus.CMD.csproj diff --git a/Novetus/NovetusCMD/NovetusCMD.cs b/Novetus/old/NovetusCMD/NovetusCMD.cs similarity index 100% rename from Novetus/NovetusCMD/NovetusCMD.cs rename to Novetus/old/NovetusCMD/NovetusCMD.cs diff --git a/Novetus/NovetusCMD/Properties/AssemblyInfo.cs b/Novetus/old/NovetusCMD/Properties/AssemblyInfo.cs similarity index 100% rename from Novetus/NovetusCMD/Properties/AssemblyInfo.cs rename to Novetus/old/NovetusCMD/Properties/AssemblyInfo.cs diff --git a/Novetus/NovetusCMD/Resources/NovetusIcon.ico b/Novetus/old/NovetusCMD/Resources/NovetusIcon.ico similarity index 100% rename from Novetus/NovetusCMD/Resources/NovetusIcon.ico rename to Novetus/old/NovetusCMD/Resources/NovetusIcon.ico diff --git a/Novetus/NovetusCMD/app.config b/Novetus/old/NovetusCMD/app.config similarity index 100% rename from Novetus/NovetusCMD/app.config rename to Novetus/old/NovetusCMD/app.config diff --git a/Novetus/NovetusCMD/packages.config b/Novetus/old/NovetusCMD/packages.config similarity index 100% rename from Novetus/NovetusCMD/packages.config rename to Novetus/old/NovetusCMD/packages.config