console rewrite

This commit is contained in:
Bitl 2022-09-14 14:47:08 -07:00
parent 68920e6810
commit 8edde1a7b8
27 changed files with 3122 additions and 677 deletions

View File

@ -15,24 +15,12 @@ using System.Reflection;
#region Client Management
public class ClientManagement
{
#if LAUNCHER
public static void ReadClientValues(RichTextBox box, bool initial = false)
#else
public static void ReadClientValues(bool initial = false)
#endif
{
#if LAUNCHER
ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, box, initial);
#else
ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, initial);
#endif
}
#if LAUNCHER
public static void ReadClientValues(string ClientName, RichTextBox box, bool initial = false)
#else
public static void ReadClientValues(string ClientName, bool initial = false)
#endif
{
string name = ClientName;
if (string.IsNullOrWhiteSpace(name))
@ -55,12 +43,7 @@ public class ClientManagement
{
Util.ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available. Novetus will attempt to generate one.", 2);
GenerateDefaultClientInfo(Path.GetDirectoryName(clientpath));
#if LAUNCHER
ReadClientValues(name, box, initial);
#else
ReadClientValues(name, initial);
#endif
}
#if URI || LAUNCHER || CMD || BASICLAUNCHER
catch (Exception ex)
@ -70,15 +53,10 @@ public class ClientManagement
catch (Exception)
{
#endif
Util.ConsolePrint("ERROR - Failed to generate default clientinfo.nov. Info: " + ex.Message, 2);
Util.ConsolePrint("Loading default client '" + GlobalVars.ProgramInformation.DefaultClient + "'", 4);
name = GlobalVars.ProgramInformation.DefaultClient;
#if LAUNCHER
ReadClientValues(name, box, initial);
#else
ReadClientValues(name, initial);
#endif
}
}
else
@ -1005,16 +983,12 @@ public class ClientManagement
#if URI
public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e, Label label)
#elif LAUNCHER
public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e, RichTextBox box)
#else
public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e)
#endif
{
#if URI
LaunchRBXClient(GlobalVars.UserConfiguration.SelectedClient, type, no3d, nomap, e, label);
#elif LAUNCHER
LaunchRBXClient(GlobalVars.UserConfiguration.SelectedClient, type, no3d, nomap, e, box);
#else
LaunchRBXClient(GlobalVars.UserConfiguration.SelectedClient, type, no3d, nomap, e);
#endif
@ -1022,8 +996,6 @@ public class ClientManagement
#if URI
public static void LaunchRBXClient(string ClientName, ScriptType type, bool no3d, bool nomap, EventHandler e, Label label)
#elif LAUNCHER
public static void LaunchRBXClient(string ClientName, ScriptType type, bool no3d, bool nomap, EventHandler e, RichTextBox box)
#else
public static void LaunchRBXClient(string ClientName, ScriptType type, bool no3d, bool nomap, EventHandler e)
#endif
@ -1083,12 +1055,7 @@ public class ClientManagement
break;
}
#if LAUNCHER
ReadClientValues(ClientName, box);
#else
ReadClientValues(ClientName);
#endif
string luafile = GetLuaFileName(ClientName, type);
string rbxexe = GetClientEXEDir(ClientName, type);
string mapfile = type.Equals(ScriptType.EasterEgg) ?
@ -1254,11 +1221,7 @@ public class ClientManagement
case ScriptType.Studio:
break;
case ScriptType.Server:
#if LAUNCHER
NovetusFuncs.PingMasterServer(true, "Server will now display on the defined master server.", box);
#elif CMD
NovetusFuncs.PingMasterServer(true, "Server will now display on the defined master server.");
#endif
goto default;
default:
GlobalVars.GameOpened = type;

View File

@ -1443,7 +1443,9 @@ public class FileManagement
if (!File.Exists(filePath))
{
Util.ConsolePrint("WARNING - No file list detected. Generating Initial File List.", 5);
Thread t = new Thread(CreateInitialFileList);
t.IsBackground = true;
t.Start();
}
else
@ -1474,7 +1476,9 @@ public class FileManagement
if (lineCount != fileCount)
{
Util.ConsolePrint("WARNING - Initial File List is not relevant to file path. Regenerating.", 5);
Thread t = new Thread(CreateInitialFileList);
t.IsBackground = true;
t.Start();
}
}
@ -1486,6 +1490,8 @@ public class FileManagement
string[] fileListToIgnore = File.ReadAllLines(filterPath);
string FileName = GlobalPaths.ConfigDir + "\\InitialFileList.txt";
File.Create(FileName).Close();
using (var txt = File.CreateText(FileName))
{
DirectoryInfo dinfo = new DirectoryInfo(GlobalPaths.RootPath);
@ -1504,6 +1510,8 @@ public class FileManagement
}
}
}
Util.ConsolePrint("File list generation finished.", 4);
}
}
#endregion

View File

@ -27,7 +27,7 @@ public enum ScriptType
#region Global Variables
public static class GlobalVars
{
#region Launcher State for Discord
#region Discord
public enum LauncherState
{
InLauncher = 0,
@ -38,6 +38,8 @@ public static class GlobalVars
InEasterEggGame = 5,
LoadingURI = 6
}
public static DiscordRPC.EventHandlers handlers;
#endregion
#region Class definitions
@ -64,6 +66,12 @@ public static class GlobalVars
public static bool RequestToOutputInfo = false;
#endregion
#if LAUNCHER
#region Novetus Launcher
public static NovetusLauncher.NovetusConsole consoleForm = null;
#endregion
#endif
#region Customization
public static string Loadout = "";
public static string soloLoadout = "";
@ -97,6 +105,10 @@ public static class GlobalVars
public static bool NoFileList = false;
public static string ServerID = "N/A";
public static string PingURL = "";
public static string Important = "";
public static string Important2 = "";
public static string NextCommand = "";
public static bool AppClosed = false;
#endregion
}
#endregion

View File

@ -129,11 +129,7 @@ public class NovetusFuncs
return UHWID.UHWIDEngine.AdvancedUid;
}
#if LAUNCHER
public static void PingMasterServer(bool online, string reason, RichTextBox box)
#else
public static void PingMasterServer(bool online, string reason)
#endif
{
if (online)
{
@ -294,6 +290,15 @@ public class NovetusFuncs
return finalUrl;
}
public static void SetupAdminPassword()
{
CryptoRandom random = new CryptoRandom();
string Name1 = SecurityFuncs.GenerateName(random.Next(4, 12));
string Name2 = SecurityFuncs.GenerateName(random.Next(4, 12));
GlobalVars.Important = Name1 + Name2;
GlobalVars.Important2 = SecurityFuncs.Encipher(GlobalVars.Important, random.Next(2, 13));
}
}
#endregion

View File

@ -331,7 +331,6 @@ public class SecurityFuncs
return ipAddress;
}
#if LAUNCHER
//modified from https://stackoverflow.com/questions/14687658/random-name-generator-in-c-sharp
public static string GenerateName(int len)
{
@ -379,6 +378,5 @@ public class SecurityFuncs
{
return Encipher(input, 26 - key);
}
#endif
}
#endregion

View File

@ -14,6 +14,9 @@ using NLog;
using System.Text.RegularExpressions;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
#if !BASICLAUNCHER
using Mono.Nat;
#endif
#endregion
#region Utils
@ -600,7 +603,43 @@ public static class Util
return (p <= 0);
}
public static void ConsolePrint(string text, int type, bool notime = false, bool noLog = false)
private static void FormPrint(string text, int type, RichTextBox box, bool noTime = false)
{
if (box == null)
return;
if (!noTime)
{
box.AppendText("[" + DateTime.Now.ToShortTimeString() + "] - ", Color.White);
}
switch (type)
{
case 1:
box.AppendText(text, Color.White);
break;
case 2:
box.AppendText(text, Color.Red);
break;
case 3:
box.AppendText(text, Color.Lime);
break;
case 4:
box.AppendText(text, Color.Aqua);
break;
case 5:
box.AppendText(text, Color.Yellow);
break;
case 0:
default:
box.AppendText(text, Color.Black);
break;
}
box.AppendText(Environment.NewLine, Color.White);
}
public static void ConsolePrint(string text, int type = 1, bool notime = false, bool noLog = false)
{
if (!notime)
{
@ -609,43 +648,195 @@ public static class Util
switch (type)
{
case 0:
ConsoleText(text, ConsoleColor.Black, true);
break;
case 2:
ConsoleText(text, ConsoleColor.Red);
ConsoleText(text, ConsoleColor.Red, true);
if (!noLog)
LogPrint(text, 2);
break;
case 3:
ConsoleText(text, ConsoleColor.Green);
ConsoleText(text, ConsoleColor.Green, true);
if (!noLog)
LogPrint(text);
break;
case 4:
ConsoleText(text, ConsoleColor.Cyan);
ConsoleText(text, ConsoleColor.Cyan, true);
if (!noLog)
LogPrint(text);
break;
case 5:
ConsoleText(text, ConsoleColor.Yellow);
ConsoleText(text, ConsoleColor.Yellow, true);
if (!noLog)
LogPrint(text, 3);
break;
case 1:
default:
ConsoleText(text, ConsoleColor.White);
ConsoleText(text, ConsoleColor.White, true);
if (!noLog)
LogPrint(text);
break;
}
ConsoleText(Environment.NewLine, ConsoleColor.White);
#if LAUNCHER
if (GlobalVars.consoleForm != null)
{
FormPrint(text, type, GlobalVars.consoleForm.ConsoleBox, notime);
}
#endif
}
public static void ConsoleText(string text, ConsoleColor color)
private static void ConsoleText(string text, ConsoleColor color, bool newLine = false)
{
Console.ForegroundColor = color;
Console.Write(text);
if (newLine)
{
Console.WriteLine(text);
}
else
{
Console.Write(text);
}
}
#endregion
#if !BASICLAUNCHER
#region UPnP
public static void InitUPnP()
{
if (GlobalVars.UserConfiguration.UPnP)
{
try
{
NetFuncs.InitUPnP(DeviceFound, DeviceLost);
Util.ConsolePrint("UPnP: Service initialized", 3);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to initialize UPnP. Reason - " + ex.Message, 2);
}
}
}
public static void StartUPnP(INatDevice device, Protocol protocol, int port)
{
if (GlobalVars.UserConfiguration.UPnP)
{
try
{
NetFuncs.StartUPnP(device, protocol, port);
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Port " + port + " opened on '" + IP + "' (" + protocol.ToString() + ")", 3);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2);
}
}
}
public static void StopUPnP(INatDevice device, Protocol protocol, int port)
{
if (GlobalVars.UserConfiguration.UPnP)
{
try
{
NetFuncs.StopUPnP(device, protocol, port);
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Port " + port + " closed on '" + IP + "' (" + protocol.ToString() + ")", 3);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2);
}
}
}
public static void DeviceFound(object sender, DeviceEventArgs args)
{
try
{
INatDevice device = args.Device;
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Device '" + IP + "' registered.", 3);
StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort);
StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2);
}
}
public static void DeviceLost(object sender, DeviceEventArgs args)
{
try
{
INatDevice device = args.Device;
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Device '" + IP + "' disconnected.", 3);
StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort);
StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2);
}
}
#endregion
#region Discord
public static void ReadyCallback()
{
Util.ConsolePrint("Discord RPC: Ready", 3);
}
public static void DisconnectedCallback(int errorCode, string message)
{
Util.ConsolePrint("Discord RPC: Disconnected. Reason - " + errorCode + ": " + message, 2);
}
public static void ErrorCallback(int errorCode, string message)
{
Util.ConsolePrint("Discord RPC: Error. Reason - " + errorCode + ": " + message, 2);
}
public static void JoinCallback(string secret)
{
}
public static void SpectateCallback(string secret)
{
}
public static void RequestCallback(DiscordRPC.JoinRequest request)
{
}
public static void StartDiscord()
{
if (GlobalVars.UserConfiguration.DiscordPresence)
{
GlobalVars.handlers = new DiscordRPC.EventHandlers();
GlobalVars.handlers.readyCallback = ReadyCallback;
GlobalVars.handlers.disconnectedCallback += DisconnectedCallback;
GlobalVars.handlers.errorCallback += ErrorCallback;
GlobalVars.handlers.joinCallback += JoinCallback;
GlobalVars.handlers.spectateCallback += SpectateCallback;
GlobalVars.handlers.requestCallback += RequestCallback;
DiscordRPC.Initialize(GlobalVars.appid, ref GlobalVars.handlers, true, "");
ClientManagement.UpdateRichPresence(ClientManagement.GetStateForType(GlobalVars.GameOpened), true);
}
}
#endregion
#endif
}
#endregion

View File

@ -22,7 +22,6 @@ public class ModManager
private SaveFileDialog saveFileDialog1;
private string installOutcome = "";
private int fileListDisplay = 0;
private RichTextBox consoleBox;
private CancellationTokenSource tokenSource;
private int pastPercentage = 0;
@ -31,12 +30,6 @@ public class ModManager
Init(mode);
}
public ModManager(ModMode mode, RichTextBox box)
{
consoleBox = box;
Init(mode);
}
public void Init(ModMode mode)
{
Application.ApplicationExit += new EventHandler(OnApplicationExit);

View File

@ -9,10 +9,6 @@ namespace NovetusLauncher
public static string prevsplash = "";
public static bool launcherInitState = true;
#endregion
#region Commands
public static string important = "";
public static string important2 = "";
#endregion
}
#endregion
}

View File

@ -40,7 +40,7 @@ namespace NovetusLauncher
#region Form Events
private void CustomGraphicsOptions_Load(object sender, EventArgs e)
{
ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null);
ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient);
info = ClientManagement.GetClientInfoValues(GlobalVars.UserConfiguration.SelectedClient);
string terms = "_" + GlobalVars.UserConfiguration.SelectedClient;
@ -441,7 +441,7 @@ namespace NovetusLauncher
private void CustomGraphicsOptions_Close(object sender, FormClosingEventArgs e)
{
ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient, null);
ClientManagement.ReadClientValues(GlobalVars.UserConfiguration.SelectedClient);
ClientManagement.ApplyClientSettings_custom(info, GlobalVars.UserConfiguration.SelectedClient, MeshDetail, ShadingQuality, MaterialQuality,
AA, AASamples, Bevels, Shadows_2008, Shadows_2007, Style_2007, QualityLevel,
WindowResolution, FullscreenResolution, ModernResolution);

View File

@ -103,8 +103,6 @@ namespace NovetusLauncher
this.listBox3 = new System.Windows.Forms.ListBox();
this.label21 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.tabPage8 = new System.Windows.Forms.TabPage();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.tabPage5 = new System.Windows.Forms.TabPage();
@ -171,7 +169,6 @@ namespace NovetusLauncher
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.tabPage8.SuspendLayout();
this.tabPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
@ -184,7 +181,6 @@ namespace NovetusLauncher
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage8);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -196,7 +192,6 @@ namespace NovetusLauncher
this.tabControl1.Size = new System.Drawing.Size(413, 284);
this.tabControl1.TabIndex = 1;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
this.tabControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.launcherForm_KeyDown);
//
// tabPage1
//
@ -865,33 +860,6 @@ namespace NovetusLauncher
this.label14.TabIndex = 0;
this.label14.Text = "SERVERS";
//
// tabPage7
//
this.tabPage7.BackColor = System.Drawing.SystemColors.ControlText;
this.tabPage7.Controls.Add(this.richTextBox1);
this.tabPage7.Location = new System.Drawing.Point(4, 22);
this.tabPage7.Name = "tabPage7";
this.tabPage7.Padding = new System.Windows.Forms.Padding(3);
this.tabPage7.Size = new System.Drawing.Size(405, 258);
this.tabPage7.TabIndex = 7;
this.tabPage7.Text = "CMD";
//
// richTextBox1
//
this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox1.BackColor = System.Drawing.SystemColors.ControlText;
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.richTextBox1.ForeColor = System.Drawing.Color.White;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(399, 255);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "";
this.richTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown);
//
// tabPage8
//
this.tabPage8.Controls.Add(this.richTextBox2);
@ -1098,7 +1066,7 @@ namespace NovetusLauncher
this.SettingsButton.Name = "SettingsButton";
this.SettingsButton.Size = new System.Drawing.Size(61, 34);
this.SettingsButton.TabIndex = 10;
this.SettingsButton.Text = "Settings";
this.SettingsButton.Text = "Graphics Settings";
this.SettingsButton.UseVisualStyleBackColor = true;
this.SettingsButton.Click += new System.EventHandler(this.SettingsButtonClick);
//
@ -1462,7 +1430,6 @@ namespace NovetusLauncher
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage6.ResumeLayout(false);
this.tabPage7.ResumeLayout(false);
this.tabPage8.ResumeLayout(false);
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
@ -1478,7 +1445,6 @@ namespace NovetusLauncher
launcherForm = new LauncherFormShared();
launcherForm.Parent = this;
launcherForm.FormStyle = Settings.Style.Compact;
launcherForm.ConsoleBox = richTextBox1;
launcherForm.Tabs = tabControl1;
launcherForm.MapDescBox = textBox4;
launcherForm.ServerInfo = textBox3;
@ -1519,7 +1485,6 @@ namespace NovetusLauncher
launcherForm.IPBox = textBox1;
launcherForm.ServerBrowserNameBox = textBox7;
launcherForm.ServerBrowserAddressBox = textBox8;
launcherForm.ConsolePage = tabPage7;
}
private System.Windows.Forms.CheckBox checkBox4;
@ -1540,8 +1505,6 @@ namespace NovetusLauncher
private System.Windows.Forms.Label label29;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.TabPage tabPage8;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.TabPage tabPage7;
private System.Windows.Forms.Button button19;
private System.Windows.Forms.Button button18;
private System.Windows.Forms.Button button16;

View File

@ -180,16 +180,6 @@ namespace NovetusLauncher
launcherForm.AddIPPortListing(listBox4, GlobalPaths.ConfigDir + "\\ports.txt", GlobalVars.JoinPort);
}
void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
launcherForm.ProcessConsole(e);
}
void launcherForm_KeyDown(object sender, KeyEventArgs e)
{
launcherForm.SwapToConsole(e);
}
void NumericUpDown1ValueChanged(object sender, EventArgs e)
{
launcherForm.ChangeJoinPort();

View File

@ -136,7 +136,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB0
CQAAAk1TRnQBSQFMAgEBAgEAAXgBAAF4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CQAAAk1TRnQBSQFMAgEBAgEAAYABAAGAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -63,7 +63,6 @@ namespace NovetusLauncher
this.panel1 = new System.Windows.Forms.Panel();
this.button33 = new System.Windows.Forms.Button();
this.button32 = new System.Windows.Forms.Button();
this.button31 = new System.Windows.Forms.Button();
this.button30 = new System.Windows.Forms.Button();
this.button29 = new System.Windows.Forms.Button();
this.button28 = new System.Windows.Forms.Button();
@ -129,8 +128,6 @@ namespace NovetusLauncher
this.listBox3 = new System.Windows.Forms.ListBox();
this.label21 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.tabPage8 = new System.Windows.Forms.TabPage();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.tabPage5 = new System.Windows.Forms.TabPage();
@ -164,7 +161,6 @@ namespace NovetusLauncher
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.tabPage8.SuspendLayout();
this.tabPage5.SuspendLayout();
this.panel5.SuspendLayout();
@ -176,9 +172,9 @@ namespace NovetusLauncher
// button25
//
this.button25.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button25.Location = new System.Drawing.Point(306, 3);
this.button25.Location = new System.Drawing.Point(369, 3);
this.button25.Name = "button25";
this.button25.Size = new System.Drawing.Size(104, 20);
this.button25.Size = new System.Drawing.Size(113, 20);
this.button25.TabIndex = 56;
this.button25.Text = "Install Mod Package";
this.button25.UseVisualStyleBackColor = true;
@ -235,9 +231,9 @@ namespace NovetusLauncher
// button8
//
this.button8.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button8.Location = new System.Drawing.Point(78, 3);
this.button8.Location = new System.Drawing.Point(12, 3);
this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(104, 20);
this.button8.Size = new System.Drawing.Size(113, 20);
this.button8.TabIndex = 35;
this.button8.Text = "Customize Character";
this.button8.UseVisualStyleBackColor = true;
@ -246,9 +242,9 @@ namespace NovetusLauncher
// button3
//
this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button3.Location = new System.Drawing.Point(188, 3);
this.button3.Location = new System.Drawing.Point(131, 3);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(72, 20);
this.button3.Size = new System.Drawing.Size(113, 20);
this.button3.TabIndex = 6;
this.button3.Text = "Launch Studio";
this.button3.UseVisualStyleBackColor = true;
@ -290,11 +286,11 @@ namespace NovetusLauncher
// label11
//
this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label11.Location = new System.Drawing.Point(3, 212);
this.label11.Location = new System.Drawing.Point(3, 180);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(75, 48);
this.label11.Size = new System.Drawing.Size(75, 88);
this.label11.TabIndex = 50;
this.label11.Text = "v1.0";
this.label11.Text = "v1.4\r\nwill never\r\nbe a\r\nthing";
this.label11.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// label12
@ -318,7 +314,7 @@ namespace NovetusLauncher
//
// button20
//
this.button20.Location = new System.Drawing.Point(3, 30);
this.button20.Location = new System.Drawing.Point(3, 29);
this.button20.Name = "button20";
this.button20.Size = new System.Drawing.Size(75, 23);
this.button20.TabIndex = 57;
@ -343,7 +339,6 @@ namespace NovetusLauncher
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel1.Controls.Add(this.button33);
this.panel1.Controls.Add(this.button32);
this.panel1.Controls.Add(this.button31);
this.panel1.Controls.Add(this.button30);
this.panel1.Controls.Add(this.button29);
this.panel1.Controls.Add(this.label11);
@ -357,7 +352,7 @@ namespace NovetusLauncher
//
// button33
//
this.button33.Location = new System.Drawing.Point(3, 186);
this.button33.Location = new System.Drawing.Point(3, 154);
this.button33.Name = "button33";
this.button33.Size = new System.Drawing.Size(75, 23);
this.button33.TabIndex = 64;
@ -368,7 +363,7 @@ namespace NovetusLauncher
//
// button32
//
this.button32.Location = new System.Drawing.Point(3, 160);
this.button32.Location = new System.Drawing.Point(3, 129);
this.button32.Name = "button32";
this.button32.Size = new System.Drawing.Size(75, 23);
this.button32.TabIndex = 63;
@ -377,20 +372,9 @@ namespace NovetusLauncher
this.button32.UseVisualStyleBackColor = true;
this.button32.Click += new System.EventHandler(this.button32_Click);
//
// button31
//
this.button31.Location = new System.Drawing.Point(3, 134);
this.button31.Name = "button31";
this.button31.Size = new System.Drawing.Size(75, 23);
this.button31.TabIndex = 62;
this.button31.TabStop = false;
this.button31.Text = "CONSOLE";
this.button31.UseVisualStyleBackColor = true;
this.button31.Click += new System.EventHandler(this.button31_Click);
//
// button30
//
this.button30.Location = new System.Drawing.Point(3, 108);
this.button30.Location = new System.Drawing.Point(3, 104);
this.button30.Name = "button30";
this.button30.Size = new System.Drawing.Size(75, 23);
this.button30.TabIndex = 61;
@ -401,7 +385,7 @@ namespace NovetusLauncher
//
// button29
//
this.button29.Location = new System.Drawing.Point(3, 82);
this.button29.Location = new System.Drawing.Point(3, 79);
this.button29.Name = "button29";
this.button29.Size = new System.Drawing.Size(75, 23);
this.button29.TabIndex = 60;
@ -412,7 +396,7 @@ namespace NovetusLauncher
//
// button28
//
this.button28.Location = new System.Drawing.Point(3, 56);
this.button28.Location = new System.Drawing.Point(3, 54);
this.button28.Name = "button28";
this.button28.Size = new System.Drawing.Size(75, 23);
this.button28.TabIndex = 59;
@ -424,11 +408,11 @@ namespace NovetusLauncher
// button34
//
this.button34.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button34.Location = new System.Drawing.Point(266, 3);
this.button34.Location = new System.Drawing.Point(250, 3);
this.button34.Name = "button34";
this.button34.Size = new System.Drawing.Size(34, 20);
this.button34.Size = new System.Drawing.Size(113, 20);
this.button34.TabIndex = 60;
this.button34.Text = "SDK";
this.button34.Text = "Novetus SDK";
this.button34.UseVisualStyleBackColor = true;
this.button34.Click += new System.EventHandler(this.button34_Click);
//
@ -449,7 +433,6 @@ namespace NovetusLauncher
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage6);
this.tabControl1.Controls.Add(this.tabPage7);
this.tabControl1.Controls.Add(this.tabPage8);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -461,7 +444,6 @@ namespace NovetusLauncher
this.tabControl1.TabIndex = 1;
this.tabControl1.TabStop = false;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
this.tabControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.launcherForm_KeyDown);
//
// tabPage1
//
@ -1123,32 +1105,6 @@ namespace NovetusLauncher
this.label14.Text = "SERVERS";
this.label14.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// tabPage7
//
this.tabPage7.BackColor = System.Drawing.SystemColors.ControlText;
this.tabPage7.Controls.Add(this.richTextBox1);
this.tabPage7.Location = new System.Drawing.Point(4, 4);
this.tabPage7.Name = "tabPage7";
this.tabPage7.Padding = new System.Windows.Forms.Padding(3);
this.tabPage7.Size = new System.Drawing.Size(625, 265);
this.tabPage7.TabIndex = 7;
this.tabPage7.Text = "CONSOLE";
//
// richTextBox1
//
this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox1.BackColor = System.Drawing.SystemColors.ControlText;
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.richTextBox1.ForeColor = System.Drawing.Color.White;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(616, 256);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "";
this.richTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown);
//
// tabPage8
//
this.tabPage8.Controls.Add(this.richTextBox2);
@ -1205,11 +1161,11 @@ namespace NovetusLauncher
//
// button36
//
this.button36.Location = new System.Drawing.Point(401, 27);
this.button36.Location = new System.Drawing.Point(396, 27);
this.button36.Name = "button36";
this.button36.Size = new System.Drawing.Size(60, 26);
this.button36.Size = new System.Drawing.Size(100, 26);
this.button36.TabIndex = 77;
this.button36.Text = "Settings";
this.button36.Text = "Graphics Settings";
this.button36.UseVisualStyleBackColor = true;
this.button36.Click += new System.EventHandler(this.button36_Click);
//
@ -1276,7 +1232,7 @@ namespace NovetusLauncher
// button9
//
this.button9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button9.Location = new System.Drawing.Point(198, 27);
this.button9.Location = new System.Drawing.Point(193, 27);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(83, 26);
this.button9.TabIndex = 37;
@ -1287,7 +1243,7 @@ namespace NovetusLauncher
// button26
//
this.button26.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button26.Location = new System.Drawing.Point(287, 27);
this.button26.Location = new System.Drawing.Point(282, 27);
this.button26.Name = "button26";
this.button26.Size = new System.Drawing.Size(108, 26);
this.button26.TabIndex = 57;
@ -1298,7 +1254,7 @@ namespace NovetusLauncher
// button5
//
this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button5.Location = new System.Drawing.Point(109, 27);
this.button5.Location = new System.Drawing.Point(104, 27);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(83, 26);
this.button5.TabIndex = 10;
@ -1434,7 +1390,6 @@ namespace NovetusLauncher
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage6.ResumeLayout(false);
this.tabPage7.ResumeLayout(false);
this.tabPage8.ResumeLayout(false);
this.tabPage5.ResumeLayout(false);
this.panel5.ResumeLayout(false);
@ -1453,7 +1408,6 @@ namespace NovetusLauncher
launcherForm = new LauncherFormShared();
launcherForm.Parent = this;
launcherForm.FormStyle = Settings.Style.Extended;
launcherForm.ConsoleBox = richTextBox1;
launcherForm.Tabs = tabControl1;
launcherForm.MapDescBox = textBox4;
launcherForm.ServerInfo = textBox3;
@ -1494,7 +1448,6 @@ namespace NovetusLauncher
launcherForm.IPBox = textBox1;
launcherForm.ServerBrowserNameBox = textBox7;
launcherForm.ServerBrowserAddressBox = textBox8;
launcherForm.ConsolePage = tabPage7;
}
private System.Windows.Forms.CheckBox checkBox4;
@ -1513,8 +1466,6 @@ namespace NovetusLauncher
private System.Windows.Forms.Label label29;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.TabPage tabPage8;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.TabPage tabPage7;
private System.Windows.Forms.Button button19;
private System.Windows.Forms.Button button18;
private System.Windows.Forms.Button button16;
@ -1581,7 +1532,6 @@ namespace NovetusLauncher
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button33;
private System.Windows.Forms.Button button32;
private System.Windows.Forms.Button button31;
private System.Windows.Forms.Button button30;
private System.Windows.Forms.Button button29;
private System.Windows.Forms.Button button28;

View File

@ -184,16 +184,6 @@ namespace NovetusLauncher
{
launcherForm.AddIPPortListing(listBox4, GlobalPaths.ConfigDir + "\\ports.txt", GlobalVars.JoinPort);
}
void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
launcherForm.ProcessConsole(e);
}
void launcherForm_KeyDown(object sender, KeyEventArgs e)
{
launcherForm.SwapToConsole(e);
}
void NumericUpDown1ValueChanged(object sender, EventArgs e)
{
@ -291,11 +281,6 @@ namespace NovetusLauncher
tabControl1.SelectedTab = tabPage6;
}
private void button31_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabPage7;
}
private void button32_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabPage8;

View File

@ -136,7 +136,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB0
CQAAAk1TRnQBSQFMAgEBAgEAAdABAAHQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CQAAAk1TRnQBSQFMAgEBAgEAAdgBAAHYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -38,7 +38,6 @@ namespace NovetusLauncher
public class LauncherFormShared
{
#region Variables
public DiscordRPC.EventHandlers handlers;
public List<TreeNode> CurrentNodeMatches = new List<TreeNode>();
public int LastNodeIndex = 0;
public string LastSearchText;
@ -47,9 +46,8 @@ namespace NovetusLauncher
//CONTROLS
public Form Parent = null;
public Settings.Style FormStyle = Settings.Style.None;
public RichTextBox ConsoleBox, ChangelogBox, ReadmeBox = null;
public RichTextBox ChangelogBox, ReadmeBox = null;
public TabControl Tabs = null;
public TabPage ConsolePage = null;
public TextBox MapDescBox, ServerInfo, SearchBar, PlayerIDTextBox, PlayerNameTextBox, ClientDescriptionBox, IPBox,
ServerBrowserNameBox, ServerBrowserAddressBox = null;
public TreeView Tree, _TreeCache = null;
@ -64,154 +62,17 @@ namespace NovetusLauncher
private ToolTip contextToolTip;
#endregion
#region UPnP
public void InitUPnP()
{
if (GlobalVars.UserConfiguration.UPnP)
{
try
{
NetFuncs.InitUPnP(DeviceFound, DeviceLost);
Util.ConsolePrint("UPnP: Service initialized", 3);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to initialize UPnP. Reason - " + ex.Message, 2);
}
}
}
public void StartUPnP(INatDevice device, Protocol protocol, int port)
{
if (GlobalVars.UserConfiguration.UPnP)
{
try
{
NetFuncs.StartUPnP(device, protocol, port);
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Port " + port + " opened on '" + IP + "' (" + protocol.ToString() + ")", 3);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2);
}
}
}
public void StopUPnP(INatDevice device, Protocol protocol, int port)
{
if (GlobalVars.UserConfiguration.UPnP)
{
try
{
NetFuncs.StopUPnP(device, protocol, port);
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Port " + port + " closed on '" + IP + "' (" + protocol.ToString() + ")", 3);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2);
}
}
}
public void DeviceFound(object sender, DeviceEventArgs args)
{
try
{
INatDevice device = args.Device;
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Device '" + IP + "' registered.", 3);
StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort);
StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2);
}
}
public void DeviceLost(object sender, DeviceEventArgs args)
{
try
{
INatDevice device = args.Device;
string IP = !string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : device.GetExternalIP().ToString();
Util.ConsolePrint("UPnP: Device '" + IP + "' disconnected.", 3);
StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort);
StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort);
}
catch (Exception ex)
{
Util.LogExceptions(ex);
Util.ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2);
}
}
#endregion
#region Discord
public void ReadyCallback()
{
Util.ConsolePrint("Discord RPC: Ready", 3);
}
public void DisconnectedCallback(int errorCode, string message)
{
Util.ConsolePrint("Discord RPC: Disconnected. Reason - " + errorCode + ": " + message, 2);
}
public void ErrorCallback(int errorCode, string message)
{
Util.ConsolePrint("Discord RPC: Error. Reason - " + errorCode + ": " + message, 2);
}
public void JoinCallback(string secret)
{
}
public void SpectateCallback(string secret)
{
}
public void RequestCallback(DiscordRPC.JoinRequest request)
{
}
public void StartDiscord()
{
if (GlobalVars.UserConfiguration.DiscordPresence)
{
handlers = new DiscordRPC.EventHandlers();
handlers.readyCallback = ReadyCallback;
handlers.disconnectedCallback += DisconnectedCallback;
handlers.errorCallback += ErrorCallback;
handlers.joinCallback += JoinCallback;
handlers.spectateCallback += SpectateCallback;
handlers.requestCallback += RequestCallback;
DiscordRPC.Initialize(GlobalVars.appid, ref handlers, true, "");
ClientManagement.UpdateRichPresence(ClientManagement.GetStateForType(GlobalVars.GameOpened), true);
}
}
#endregion
#region Form Event Functions
public void InitForm()
{
FileManagement.CreateInitialFileListIfNeededMulti();
HideMasterAddressWarning = false;
if (FormStyle != Settings.Style.Stylish)
{
Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version;
}
Util.ConsolePrint("Novetus version " + GlobalVars.ProgramInformation.Version + " loaded. Initializing config.", 4);
Util.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 4);
if (FormStyle != Settings.Style.Stylish)
{
@ -234,27 +95,6 @@ namespace NovetusLauncher
}
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5);
WriteConfigValues();
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization + " not found. Creating one with default values.", 5);
WriteCustomizationValues();
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\servers.txt"))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\servers.txt not found. Creating empty file.", 5);
File.Create(GlobalPaths.ConfigDir + "\\servers.txt").Dispose();
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\ports.txt"))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\ports.txt not found. Creating empty file.", 5);
File.Create(GlobalPaths.ConfigDir + "\\ports.txt").Dispose();
}
if (FormStyle == Settings.Style.Stylish)
{
Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version + " [CLIENT: " +
@ -262,10 +102,6 @@ namespace NovetusLauncher
GlobalVars.UserConfiguration.Map + "]";
}
FileManagement.CreateAssetCacheDirectories();
SetupImportantData();
Splash splash = SplashReader.GetSplash();
SplashLabel.Text = splash.SplashText;
@ -286,9 +122,6 @@ namespace NovetusLauncher
ReadConfigValues(true);
}
InitUPnP();
StartDiscord();
if (FormStyle != Settings.Style.Stylish)
{
LocalVars.launcherInitState = false;
@ -349,11 +182,13 @@ namespace NovetusLauncher
{
DiscordRPC.Shutdown();
}
Application.Exit();
if (!GlobalVars.AppClosed)
{
GlobalVars.AppClosed = true;
}
}
public void ChangeTabs()
{
switch (Tabs.SelectedTab)
@ -497,19 +332,19 @@ namespace NovetusLauncher
switch (gameType)
{
case ScriptType.Client:
ClientManagement.LaunchRBXClient(ScriptType.Client, false, true, new EventHandler(ClientExited), ConsoleBox);
ClientManagement.LaunchRBXClient(ScriptType.Client, false, true, new EventHandler(ClientExited));
break;
case ScriptType.Server:
ClientManagement.LaunchRBXClient(ScriptType.Server, no3d, false, new EventHandler(ServerExited), ConsoleBox);
ClientManagement.LaunchRBXClient(ScriptType.Server, no3d, false, new EventHandler(ServerExited));
break;
case ScriptType.Solo:
ClientManagement.LaunchRBXClient(ScriptType.Solo, false, false, new EventHandler(SoloExited), ConsoleBox);
ClientManagement.LaunchRBXClient(ScriptType.Solo, false, false, new EventHandler(SoloExited));
break;
case ScriptType.Studio:
ClientManagement.LaunchRBXClient(ScriptType.Studio, false, nomap, new EventHandler(ClientExitedBase), ConsoleBox);
ClientManagement.LaunchRBXClient(ScriptType.Studio, false, nomap, new EventHandler(ClientExitedBase));
break;
case ScriptType.EasterEgg:
ClientManagement.LaunchRBXClient(ScriptType.EasterEgg, false, false, new EventHandler(EasterEggExited), ConsoleBox);
ClientManagement.LaunchRBXClient(ScriptType.EasterEgg, false, false, new EventHandler(EasterEggExited));
break;
case ScriptType.None:
default:
@ -573,7 +408,7 @@ namespace NovetusLauncher
void ServerExited(object sender, EventArgs e)
{
GlobalVars.GameOpened = ScriptType.None;
NovetusFuncs.PingMasterServer(false, "The server has removed itself from the master server list.", ConsoleBox);
NovetusFuncs.PingMasterServer(false, "The server has removed itself from the master server list.");
ClientExitedBase(sender, e);
}
@ -655,193 +490,6 @@ namespace NovetusLauncher
}
}
public void ProcessConsole(KeyEventArgs e)
{
//Command proxy
int totalLines = ConsoleBox.Lines.Length;
if (totalLines > 0)
{
string lastLine = ConsoleBox.Lines[totalLines - 1];
if (e.KeyCode == Keys.Enter)
{
ConsoleBox.AppendText(Environment.NewLine, System.Drawing.Color.White);
ConsoleProcessCommands(lastLine);
e.Handled = true;
}
}
if (e.Modifiers == Keys.Control)
{
switch (e.KeyCode)
{
case Keys.X:
case Keys.Z:
e.Handled = true;
break;
default:
break;
}
}
}
public void SwapToConsole(KeyEventArgs e)
{
if (e.KeyCode == Keys.Oemtilde)
{
Tabs.SelectedTab = ConsolePage;
e.Handled = true;
}
}
public void SetupImportantData()
{
CryptoRandom random = new CryptoRandom();
string Name1 = SecurityFuncs.GenerateName(random.Next(4, 12));
string Name2 = SecurityFuncs.GenerateName(random.Next(4, 12));
LocalVars.important = Name1 + Name2;
LocalVars.important2 = SecurityFuncs.Encipher(LocalVars.important, random.Next(2, 9));
}
public void ConsoleProcessCommands(string cmd)
{
switch (cmd)
{
case string server when server.Contains("server", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = server.Split(' ');
if (vals[1].Equals("3d", StringComparison.InvariantCultureIgnoreCase))
{
StartGame(ScriptType.Server, false, false, true);
}
else if (vals[1].Equals("no3d", StringComparison.InvariantCultureIgnoreCase))
{
StartGame(ScriptType.Server, true, false, true);
}
else
{
StartGame(ScriptType.Server, false, false, true);
}
}
catch (Exception)
{
StartGame(ScriptType.Server, false, false, true);
}
break;
case string client when string.Compare(client, "client", true, CultureInfo.InvariantCulture) == 0:
StartGame(ScriptType.Client);
break;
case string solo when string.Compare(solo, "solo", true, CultureInfo.InvariantCulture) == 0:
StartGame(ScriptType.Solo);
break;
case string studio when studio.Contains("studio", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = studio.Split(' ');
if (vals[1].Equals("map", StringComparison.InvariantCultureIgnoreCase))
{
StartGame(ScriptType.Studio, false, false, true);
}
else if (vals[1].Equals("nomap", StringComparison.InvariantCultureIgnoreCase))
{
StartGame(ScriptType.Studio, false, true, true);
}
else
{
StartGame(ScriptType.Studio, false, false, true);
}
}
catch (Exception)
{
StartGame(ScriptType.Studio, false, false, true);
}
break;
case string config when config.Contains("config", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = config.Split(' ');
if (vals[1].Equals("save", StringComparison.InvariantCultureIgnoreCase))
{
WriteConfigValues();
}
else if (vals[1].Equals("load", StringComparison.InvariantCultureIgnoreCase))
{
ReadConfigValues();
}
else if (vals[1].Equals("reset", StringComparison.InvariantCultureIgnoreCase))
{
ResetConfigValues();
}
else
{
Util.ConsolePrint("Please specify 'save', 'load', or 'reset'.", 4);
}
}
catch (Exception)
{
Util.ConsolePrint("Please specify 'save', 'load', or 'reset'.", 4);
}
break;
case string help when string.Compare(help, "help", true, CultureInfo.InvariantCulture) == 0:
ConsoleHelp();
break;
case string sdk when string.Compare(sdk, "sdk", true, CultureInfo.InvariantCulture) == 0:
LoadLauncher();
break;
case string dlldelete when string.Compare(dlldelete, "dlldelete", true, CultureInfo.InvariantCulture) == 0:
if (GlobalVars.UserConfiguration.DisableReshadeDelete == true)
{
GlobalVars.UserConfiguration.DisableReshadeDelete = false;
Util.ConsolePrint("ReShade DLL deletion enabled.", 4);
}
else
{
GlobalVars.UserConfiguration.DisableReshadeDelete = true;
Util.ConsolePrint("ReShade DLL deletion disabled.", 4);
}
break;
case string altserverip when altserverip.Contains("altserverip", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = altserverip.Split(' ');
if (vals[1].Equals("none", StringComparison.InvariantCultureIgnoreCase))
{
GlobalVars.UserConfiguration.AlternateServerIP = "";
Util.ConsolePrint("Alternate Server IP removed.", 4);
}
else
{
GlobalVars.UserConfiguration.AlternateServerIP = vals[1];
Util.ConsolePrint("Alternate Server IP set to " + vals[1], 4);
}
}
catch (Exception)
{
Util.ConsolePrint("Please specify the IP address you would like to set Novetus to.", 4);
}
break;
case string important when string.Compare(important, LocalVars.important, true, CultureInfo.InvariantCulture) == 0:
GlobalVars.AdminMode = true;
Util.ConsolePrint("ADMIN MODE ENABLED.", 4);
Util.ConsolePrint("YOU ARE GOD.", 2);
break;
case string decode when (string.Compare(decode, "decode", true, CultureInfo.InvariantCulture) == 0 || string.Compare(decode, "decrypt", true, CultureInfo.InvariantCulture) == 0):
Decoder de = new Decoder();
de.Show();
Util.ConsolePrint("???", 2);
break;
default:
Util.ConsolePrint("Command is either not registered or valid", 2);
break;
}
}
public void LoadLauncher()
{
NovetusSDK im = new NovetusSDK();
@ -849,26 +497,6 @@ namespace NovetusLauncher
Util.ConsolePrint("Novetus SDK Launcher Loaded.", 4);
}
public void ConsoleHelp()
{
Util.ConsolePrint("Help:", 3, true);
Util.ConsolePrint("---------", 1, true);
Util.ConsolePrint("= client | Launches client with launcher settings", 4, true);
Util.ConsolePrint("= solo | Launches client in Play Solo mode with launcher settings", 4, true);
Util.ConsolePrint("= server 3d | Launches server with launcher settings", 4, true);
Util.ConsolePrint("= server no3d | Launches server in NoGraphics mode with launcher settings", 4, true);
Util.ConsolePrint("= studio map | Launches Roblox Studio with the selected map", 4, true);
Util.ConsolePrint("= studio nomap | Launches Roblox Studio without the selected map", 4, true);
Util.ConsolePrint("= sdk | Launches the Novetus SDK Launcher", 4, true);
Util.ConsolePrint("= dlldelete | Toggle the deletion of opengl32.dll when ReShade is off.", 4, true);
Util.ConsolePrint("= altserverip <IP> | Sets the alternate server IP for server info. Replace <IP> with your specified IP or specify 'none' to remove the current alternate server IP", 4, true);
Util.ConsolePrint("---------", 1, true);
Util.ConsolePrint("= config save | Saves the config file", 4, true);
Util.ConsolePrint("= config load | Reloads the config file", 4, true);
Util.ConsolePrint("= config reset | Resets the config file", 4, true);
Util.ConsolePrint(LocalVars.important2, 0, true, true);
}
public void SwitchStyles()
{
if (LocalVars.launcherInitState)
@ -897,7 +525,6 @@ namespace NovetusLauncher
GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Extended;
CloseEventInternal();
System.Diagnostics.Process.Start(Application.ExecutablePath);
Application.Exit();
}
break;
case 1:
@ -906,7 +533,6 @@ namespace NovetusLauncher
GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Compact;
CloseEventInternal();
System.Diagnostics.Process.Start(Application.ExecutablePath);
Application.Exit();
}
break;
case 2:
@ -915,7 +541,6 @@ namespace NovetusLauncher
GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Stylish;
CloseEventInternal();
System.Diagnostics.Process.Start(Application.ExecutablePath);
Application.Exit();
}
break;
default:
@ -967,7 +592,7 @@ namespace NovetusLauncher
public void WriteConfigValues(bool ShowBox = false)
{
FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true);
ClientManagement.ReadClientValues(ConsoleBox);
ClientManagement.ReadClientValues();
Util.ConsolePrint("Config Saved.", 3);
if (ShowBox)
{
@ -1038,7 +663,7 @@ namespace NovetusLauncher
}
}
ClientManagement.ReadClientValues(ConsoleBox, initial);
ClientManagement.ReadClientValues(initial);
PlayerNameTextBox.Enabled = GlobalVars.SelectedClientInfo.UsesPlayerName;
@ -1080,7 +705,7 @@ namespace NovetusLauncher
public async void InstallAddon()
{
ModManager addon = new ModManager(ModManager.ModMode.ModInstallation, ConsoleBox);
ModManager addon = new ModManager(ModManager.ModMode.ModInstallation);
addon.setFileListDisplay(10);
try
{
@ -1484,7 +1109,7 @@ namespace NovetusLauncher
void SettingsExited(object sender, FormClosingEventArgs e)
{
ClientManagement.ReadClientValues(ConsoleBox);
ClientManagement.ReadClientValues();
}
#endregion

View File

@ -191,7 +191,7 @@ namespace NovetusLauncher
}
}
ClientManagement.ReadClientValues(null, initial);
ClientManagement.ReadClientValues(initial);
launcherFormStylishInterface1.userNameBox.IsEnabled = GlobalVars.SelectedClientInfo.UsesPlayerName;

View File

@ -867,7 +867,7 @@
<Button x:Name="saveConfigButton" Content="Save Config" HorizontalAlignment="Left" Margin="233,67,0,0" VerticalAlignment="Top" Width="75" Click="saveConfigButton_Click"/>
<Button x:Name="resetAssetCacheButton" Content="Clear Cache" HorizontalAlignment="Left" Margin="313,46,0,0" VerticalAlignment="Top" Width="81" Height="16" Click="resetAssetCacheButton_Click"/>
<Button x:Name="novetusSDKButton" Content="Novetus SDK" HorizontalAlignment="Left" Margin="313,67,0,0" VerticalAlignment="Top" Width="81" Click="novetusSDKButton_Click"/>
<Button x:Name="settingsButtons" Style="{DynamicResource ImportantButtonSmall}" Content="Settings" HorizontalAlignment="Left" Margin="399,46,0,0" VerticalAlignment="Top" Width="119" Height="17" Click="settingsButtons_Click" Grid.ColumnSpan="2"/>
<Button x:Name="settingsButtons" Style="{DynamicResource ImportantButtonSmall}" Content="Graphics Settings" HorizontalAlignment="Left" Margin="399,46,0,0" VerticalAlignment="Top" Width="119" Height="17" Click="settingsButtons_Click" Grid.ColumnSpan="2"/>
<Button x:Name="modInstallerButton" Content="Install Mod Package" HorizontalAlignment="Left" Margin="399,67,0,0" VerticalAlignment="Top" Width="119" Click="modInstallerButton_Click" Grid.ColumnSpan="2"/>
<ComboBox x:Name="styleBox" Grid.Column="1" HorizontalAlignment="Left" Margin="89,59,0,0" VerticalAlignment="Top" Width="107" Height="24" DropDownClosed="styleBox_DropDownClosed">
<local:StyleListItem StyleName="Extended"/>

View File

@ -490,13 +490,11 @@ namespace NovetusLauncher
GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Extended;
launcherForm.CloseEventInternal();
System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath);
System.Windows.Forms.Application.Exit();
break;
case 1:
GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Compact;
launcherForm.CloseEventInternal();
System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath);
System.Windows.Forms.Application.Exit();
break;
default:
break;

View File

@ -0,0 +1,71 @@
namespace NovetusLauncher
{
partial class NovetusConsole
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NovetusConsole));
this.ConsoleBox = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// ConsoleBox
//
this.ConsoleBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ConsoleBox.BackColor = System.Drawing.Color.Black;
this.ConsoleBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.ConsoleBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ConsoleBox.ForeColor = System.Drawing.Color.White;
this.ConsoleBox.Location = new System.Drawing.Point(0, 0);
this.ConsoleBox.Name = "ConsoleBox";
this.ConsoleBox.Size = new System.Drawing.Size(857, 411);
this.ConsoleBox.TabIndex = 0;
this.ConsoleBox.Text = "";
this.ConsoleBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ProcessConsole);
//
// NovetusConsole
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(858, 411);
this.Controls.Add(this.ConsoleBox);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(357, 205);
this.Name = "NovetusConsole";
this.Text = "Console";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ConsoleClose);
this.Load += new System.EventHandler(this.NovetusConsole_Load);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.RichTextBox ConsoleBox;
}
}

View File

@ -0,0 +1,265 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NLog;
namespace NovetusLauncher
{
public partial class NovetusConsole : Form
{
static LauncherFormShared ConsoleForm;
public NovetusConsole()
{
ConsoleForm = new LauncherFormShared();
InitializeComponent();
}
private void NovetusConsole_Load(object sender, EventArgs e)
{
FileManagement.CreateInitialFileListIfNeededMulti();
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))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5);
ConsoleForm.WriteConfigValues();
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization + " not found. Creating one with default values.", 5);
ConsoleForm.WriteCustomizationValues();
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\servers.txt"))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\servers.txt not found. Creating empty file.", 5);
File.Create(GlobalPaths.ConfigDir + "\\servers.txt").Dispose();
}
if (!File.Exists(GlobalPaths.ConfigDir + "\\ports.txt"))
{
Util.ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\ports.txt not found. Creating empty file.", 5);
File.Create(GlobalPaths.ConfigDir + "\\ports.txt").Dispose();
}
FileManagement.CreateAssetCacheDirectories();
NovetusFuncs.SetupAdminPassword();
Util.InitUPnP();
Util.StartDiscord();
}
public void ConsoleProcessCommands(string cmd)
{
if (string.IsNullOrWhiteSpace(cmd))
return;
switch (cmd)
{
case string server when server.Contains("server", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = server.Split(' ');
if (vals[1].Equals("3d", StringComparison.InvariantCultureIgnoreCase))
{
ConsoleForm.StartGame(ScriptType.Server, false, false, true);
}
else if (vals[1].Equals("no3d", StringComparison.InvariantCultureIgnoreCase))
{
ConsoleForm.StartGame(ScriptType.Server, true, false, true);
}
else
{
ConsoleForm.StartGame(ScriptType.Server, false, false, true);
}
}
catch (Exception)
{
ConsoleForm.StartGame(ScriptType.Server, false, false, true);
}
break;
case string client when string.Compare(client, "client", true, CultureInfo.InvariantCulture) == 0:
ConsoleForm.StartGame(ScriptType.Client);
break;
case string solo when string.Compare(solo, "solo", true, CultureInfo.InvariantCulture) == 0:
ConsoleForm.StartGame(ScriptType.Solo);
break;
case string studio when studio.Contains("studio", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = studio.Split(' ');
if (vals[1].Equals("map", StringComparison.InvariantCultureIgnoreCase))
{
ConsoleForm.StartGame(ScriptType.Studio, false, false, true);
}
else if (vals[1].Equals("nomap", StringComparison.InvariantCultureIgnoreCase))
{
ConsoleForm.StartGame(ScriptType.Studio, false, true, true);
}
else
{
ConsoleForm.StartGame(ScriptType.Studio, false, false, true);
}
}
catch (Exception)
{
ConsoleForm.StartGame(ScriptType.Studio, false, false, true);
}
break;
case string config when config.Contains("config", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = config.Split(' ');
if (vals[1].Equals("save", StringComparison.InvariantCultureIgnoreCase))
{
ConsoleForm.WriteConfigValues();
}
else if (vals[1].Equals("load", StringComparison.InvariantCultureIgnoreCase))
{
ConsoleForm.ReadConfigValues();
}
else if (vals[1].Equals("reset", StringComparison.InvariantCultureIgnoreCase))
{
ConsoleForm.ResetConfigValues();
}
else
{
Util.ConsolePrint("Please specify 'save', 'load', or 'reset'.", 4);
}
}
catch (Exception)
{
Util.ConsolePrint("Please specify 'save', 'load', or 'reset'.", 4);
}
break;
case string help when string.Compare(help, "help", true, CultureInfo.InvariantCulture) == 0:
ConsoleHelp();
break;
case string sdk when string.Compare(sdk, "sdk", true, CultureInfo.InvariantCulture) == 0:
ConsoleForm.LoadLauncher();
break;
case string dlldelete when string.Compare(dlldelete, "dlldelete", true, CultureInfo.InvariantCulture) == 0:
if (GlobalVars.UserConfiguration.DisableReshadeDelete == true)
{
GlobalVars.UserConfiguration.DisableReshadeDelete = false;
Util.ConsolePrint("ReShade DLL deletion enabled.", 4);
}
else
{
GlobalVars.UserConfiguration.DisableReshadeDelete = true;
Util.ConsolePrint("ReShade DLL deletion disabled.", 4);
}
break;
case string altserverip when altserverip.Contains("altserverip", StringComparison.InvariantCultureIgnoreCase) == true:
try
{
string[] vals = altserverip.Split(' ');
if (vals[1].Equals("none", StringComparison.InvariantCultureIgnoreCase))
{
GlobalVars.UserConfiguration.AlternateServerIP = "";
Util.ConsolePrint("Alternate Server IP removed.", 4);
}
else
{
GlobalVars.UserConfiguration.AlternateServerIP = vals[1];
Util.ConsolePrint("Alternate Server IP set to " + vals[1], 4);
}
}
catch (Exception)
{
Util.ConsolePrint("Please specify the IP address you would like to set Novetus to.", 2);
}
break;
case string nofilelist when (string.Compare(nofilelist, "nofilelist", true, CultureInfo.InvariantCulture) == 0):
GlobalVars.NoFileList = true;
Util.ConsolePrint("File List Generation is now disabled for this sesion.", 4);
break;
case string important when string.Compare(important, GlobalVars.Important, true, CultureInfo.InvariantCulture) == 0:
GlobalVars.AdminMode = true;
Util.ConsolePrint("ADMIN MODE ENABLED.", 4);
Util.ConsolePrint("YOU ARE GOD.", 2);
break;
case string decode when (string.Compare(decode, "decode", true, CultureInfo.InvariantCulture) == 0 || string.Compare(decode, "decrypt", true, CultureInfo.InvariantCulture) == 0):
Decoder de = new Decoder();
de.Show();
Util.ConsolePrint("???", 2);
break;
case string quit when (string.Compare(quit, "exit", true, CultureInfo.InvariantCulture) == 0 || string.Compare(quit, "quit", true, CultureInfo.InvariantCulture) == 0):
ConsoleForm.CloseEventInternal();
break;
default:
Util.ConsolePrint("Command is either not registered or valid", 2);
break;
}
}
public void ConsoleHelp()
{
Util.ConsolePrint("Help:", 3, true);
Util.ConsolePrint("---------", 1, true);
Util.ConsolePrint("= client | Launches client with launcher settings", 4, true);
Util.ConsolePrint("= solo | Launches client in Play Solo mode with launcher settings", 4, true);
Util.ConsolePrint("= server 3d | Launches server with launcher settings", 4, true);
Util.ConsolePrint("= server no3d | Launches server in NoGraphics mode with launcher settings", 4, true);
Util.ConsolePrint("= studio map | Launches Roblox Studio with the selected map", 4, true);
Util.ConsolePrint("= studio nomap | Launches Roblox Studio without the selected map", 4, true);
Util.ConsolePrint("= sdk | Launches the Novetus SDK Launcher", 4, true);
Util.ConsolePrint("= dlldelete | Toggle the deletion of opengl32.dll when ReShade is off.", 4, true);
Util.ConsolePrint("= altserverip <IP> | Sets the alternate server IP for server info. Replace <IP> with your specified IP or specify 'none' to remove the current alternate server IP", 4, true);
Util.ConsolePrint("= nofilelist | Disables initial file list generation. Meant for the command line.", 4, true);
Util.ConsolePrint("= exit/quit | Closes Novetus.", 4, true);
Util.ConsolePrint("---------", 1, true);
Util.ConsolePrint("= config save | Saves the config file", 4, true);
Util.ConsolePrint("= config load | Reloads the config file", 4, true);
Util.ConsolePrint("= config reset | Resets the config file", 4, true);
Util.ConsolePrint(GlobalVars.Important2, 0, true, true);
}
private void ProcessConsole(object sender, KeyEventArgs e)
{
//Command proxy
int totalLines = ConsoleBox.Lines.Length;
if (totalLines > 0)
{
string lastLine = ConsoleBox.Lines[totalLines - 1];
if (e.KeyCode == Keys.Enter)
{
ConsoleBox.AppendText(Environment.NewLine, Color.White);
ConsoleProcessCommands(lastLine);
e.Handled = true;
}
}
if (e.Modifiers == Keys.Control)
{
switch (e.KeyCode)
{
case Keys.X:
case Keys.Z:
e.Handled = true;
break;
default:
break;
}
}
}
private void ConsoleClose(object sender, FormClosingEventArgs e)
{
ConsoleForm.CloseEventInternal();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -72,6 +72,7 @@ public partial class ModCreator : Form
if (File.Exists(GlobalPaths.ConfigDir + "\\InitialFileList.txt"))
{
Thread t = new Thread(FillFileListing);
t.IsBackground = true;
t.Start();
}
else

View File

@ -30,9 +30,12 @@ enum SDKApps
#region Novetus SDK Launcher
public partial class NovetusSDK : Form
{
bool IsLauncher;
#region Constructor
public NovetusSDK()
public NovetusSDK(bool launcher = true)
{
IsLauncher = launcher;
InitializeComponent();
}
#endregion
@ -64,11 +67,11 @@ public partial class NovetusSDK : Form
private void NovetusSDK_Close(object sender, CancelEventArgs e)
{
FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true);
#if LAUNCHER
ClientManagement.ReadClientValues(null);
#else
ClientManagement.ReadClientValues();
#endif
if (!IsLauncher && !GlobalVars.AppClosed)
{
GlobalVars.AppClosed = true;
}
}
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
@ -157,11 +160,7 @@ public partial class NovetusSDK : Form
break;
case SDKApps.ClientScriptTester:
MessageBox.Show("Note: If you want to test a specific way of loading a client, select the ClientScript Tester in the 'Versions' tab of the Novetus Launcher, then launch it through any way you wish.", "Novetus SDK - Client Script Tester Help", MessageBoxButtons.OK, MessageBoxIcon.Information);
#if LAUNCHER
ClientManagement.LaunchRBXClient("ClientScriptTester", ScriptType.Client, false, false, null, null);
#else
ClientManagement.LaunchRBXClient("ClientScriptTester", ScriptType.Client, false, false, null);
#endif
GlobalVars.GameOpened = ScriptType.None;
break;
case SDKApps.XMLContentEditor:

View File

@ -49,7 +49,7 @@ namespace NovetusLauncher
oldPort = GlobalVars.JoinPort;
GlobalVars.IP = selectedServer.ServerIP;
GlobalVars.JoinPort = selectedServer.ServerPort;
ClientManagement.LaunchRBXClient(selectedServer.ServerClient, ScriptType.Client, false, true, new EventHandler(ClientExited), null);
ClientManagement.LaunchRBXClient(selectedServer.ServerClient, ScriptType.Client, false, true, new EventHandler(ClientExited));
}
}
else

View File

@ -4,7 +4,7 @@
<ProjectGuid>{F92FFBED-2767-4676-9711-BB89CDA58A43}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<RootNamespace>NovetusLauncher</RootNamespace>
<AssemblyName>Novetus</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
@ -36,6 +36,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
@ -139,6 +141,7 @@
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="UIAutomationClient" />
<Reference Include="UIAutomationProvider" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
@ -201,6 +204,12 @@
<Compile Include="Forms\LauncherForm\Stylish\LauncherFormStylishInterface.xaml.cs">
<DependentUpon>LauncherFormStylishInterface.xaml</DependentUpon>
</Compile>
<Compile Include="Forms\NovetusConsole.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\NovetusConsole.Designer.cs">
<DependentUpon>NovetusConsole.cs</DependentUpon>
</Compile>
<Compile Include="Forms\SDK\ModCreator.cs">
<SubType>Form</SubType>
</Compile>
@ -326,6 +335,9 @@
<EmbeddedResource Include="Forms\LauncherForm\Stylish\LauncherFormStylish.resx">
<DependentUpon>LauncherFormStylish.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\NovetusConsole.resx">
<DependentUpon>NovetusConsole.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SDK\ModCreator.resx">
<DependentUpon>ModCreator.cs</DependentUpon>
</EmbeddedResource>

View File

@ -1,79 +1,115 @@
#region Usings
using NLog;
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Automation;
#endregion
namespace NovetusLauncher
{
#region Novetus Launcher Main Class
internal sealed class NovetusLauncherEntryPoint
{
/// <summary>
/// Program entry point.
/// </summary>
[STAThread]
private static void Main(string[] args)
{
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
{
static bool formsOpen = false;
if (!Directory.Exists(GlobalPaths.LogDir))
{
Directory.CreateDirectory(GlobalPaths.LogDir);
}
var config = new NLog.Config.LoggingConfiguration();
var logfile = new NLog.Targets.FileTarget("logfile") { FileName = GlobalPaths.LogDir + "\\Launcher-log-" + DateTime.Today.ToString("MM-dd-yyyy") + ".log" };
config.AddRuleForAllLevels(logfile);
LogManager.Configuration = config;
FileManagement.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalPaths.InfoName);
FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false);
GlobalVars.ColorsLoaded = FileManagement.InitColors();
if (args.Length == 0)
{
RunLauncher();
}
else
{
CommandLineArguments.Arguments CommandLine = new CommandLineArguments.Arguments(args);
if (CommandLine["sdk"] != null)
{
System.Windows.Forms.Application.Run(new NovetusSDK());
}
if (CommandLine["nofilelist"] != null)
{
GlobalVars.NoFileList = true;
}
}
}
static void RunLauncher()
/// <summary>
/// Program entry point.
/// </summary>
[STAThread]
private static void Main(string[] args)
{
try
{
switch (GlobalVars.UserConfiguration.LauncherStyle)
{
case Settings.Style.Compact:
System.Windows.Forms.Application.Run(new LauncherFormCompact());
break;
case Settings.Style.Extended:
System.Windows.Forms.Application.Run(new LauncherFormExtended());
break;
case Settings.Style.Stylish:
default:
System.Windows.Forms.Application.Run(new LauncherFormStylish());
break;
}
}
catch (Exception ex)
{
Util.LogExceptions(ex);
}
}
}
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
if (!Directory.Exists(GlobalPaths.LogDir))
{
Directory.CreateDirectory(GlobalPaths.LogDir);
}
var config = new NLog.Config.LoggingConfiguration();
var logfile = new NLog.Targets.FileTarget("logfile") { FileName = GlobalPaths.LogDir + "\\Launcher-log-" + DateTime.Today.ToString("MM-dd-yyyy") + ".log" };
config.AddRuleForAllLevels(logfile);
LogManager.Configuration = config;
FileManagement.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalPaths.InfoName);
FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false);
GlobalVars.ColorsLoaded = FileManagement.InitColors();
if (args.Length == 0)
{
Run();
}
else
{
CommandLineArguments.Arguments CommandLine = new CommandLineArguments.Arguments(args);
if (CommandLine["sdk"] != null)
{
Run(true);
}
if (CommandLine["nofilelist"] != null)
{
GlobalVars.NoFileList = true;
}
}
}
static void Run(bool sdk = false)
{
try
{
while (!GlobalVars.AppClosed)
{
System.Windows.Forms.Application.DoEvents();
if (!formsOpen)
{
NovetusConsole console = new NovetusConsole();
GlobalVars.consoleForm = console;
console.Show();
if (!sdk)
{
switch (GlobalVars.UserConfiguration.LauncherStyle)
{
case Settings.Style.Compact:
LauncherFormCompact compact = new LauncherFormCompact();
compact.Show();
break;
case Settings.Style.Extended:
LauncherFormExtended extended = new LauncherFormExtended();
extended.Show();
break;
case Settings.Style.Stylish:
default:
LauncherFormStylish stylish = new LauncherFormStylish();
stylish.Show();
break;
}
}
else
{
NovetusSDK sdkApp = new NovetusSDK(false);
sdkApp.Show();
}
formsOpen = true;
}
}
System.Windows.Forms.Application.Exit();
}
catch (Exception ex)
{
Util.LogExceptions(ex);
}
}
}
#endregion
}