From 5d943adbbc18919c29c35f30d9cee51ed9191979 Mon Sep 17 00:00:00 2001 From: Bitl Date: Fri, 14 Apr 2023 09:00:12 -0700 Subject: [PATCH] reshade removal --- .../Novetus.Bootstrapper/NovetusLaunchForm.cs | 17 ++- Novetus/NovetusCore/NovetusCore.projitems | 2 +- .../StorageAndFunctions/FileManagement.cs | 137 +----------------- .../Forms/LauncherFormSettings.Designer.cs | 85 ++--------- .../Forms/LauncherFormSettings.cs | 18 --- .../NovetusLauncher/Forms/NovetusConsole.cs | 13 -- changelog.txt | 14 ++ defaultaddons/novetusexts/webproxy/Asset.cs | 42 +++--- scripts/batch/dev_menu.bat | 2 +- scripts/game/2009E/CSMPFunctions.lua | 58 ++++---- scripts/launcher/info.ini | 3 +- 11 files changed, 100 insertions(+), 291 deletions(-) diff --git a/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs b/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs index f916bba..3a22bac 100644 --- a/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs +++ b/Novetus/Novetus.Bootstrapper/NovetusLaunchForm.cs @@ -3,6 +3,7 @@ using Novetus.Core; using System; using System.Drawing; using System.Drawing.Text; +using System.IO; using System.Windows.Forms; namespace Novetus.Bootstrapper @@ -16,10 +17,13 @@ namespace Novetus.Bootstrapper private void NovetusLaunchForm_Load(object sender, EventArgs e) { - FileManagement.ReadInfoFile(LocalPaths.InfoPath, - LocalPaths.VersionTermList, - LocalPaths.LauncherPath); - ReadConfigValues(LocalPaths.ConfigPath); + if (File.Exists(LocalPaths.ConfigPath)) + { + FileManagement.ReadInfoFile(LocalPaths.InfoPath, + LocalPaths.VersionTermList, + LocalPaths.LauncherPath); + ReadConfigValues(LocalPaths.ConfigPath); + } if (GlobalVars.UserConfiguration.BootstrapperShowUI) { @@ -45,7 +49,10 @@ namespace Novetus.Bootstrapper GlobalFuncs.LogExceptions(ex); }*/ - VersionLabel.Text = GlobalVars.ProgramInformation.Version.ToUpper(); + if (File.Exists(LocalPaths.ConfigPath)) + { + VersionLabel.Text = GlobalVars.ProgramInformation.Version.ToUpper(); + } CenterToScreen(); } else diff --git a/Novetus/NovetusCore/NovetusCore.projitems b/Novetus/NovetusCore/NovetusCore.projitems index 660bc3b..deeb336 100644 --- a/Novetus/NovetusCore/NovetusCore.projitems +++ b/Novetus/NovetusCore/NovetusCore.projitems @@ -9,6 +9,7 @@ NovetusCore + @@ -18,7 +19,6 @@ - diff --git a/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs b/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs index 616a0b5..bbf7475 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/FileManagement.cs @@ -76,14 +76,10 @@ namespace Novetus.Core MapPath = ""; MapPathSnip = ""; GraphicsMode = Settings.Mode.Automatic; - ReShade = false; QualityLevel = Settings.Level.Automatic; LauncherStyle = Settings.Style.Stylish; - ReShadeFPSDisplay = false; - ReShadePerformanceMode = false; AssetSDKFixerSaveBackups = true; AlternateServerIP = ""; - DisableReshadeDelete = false; ShowServerNotifications = false; ServerBrowserServerName = "Novetus"; ServerBrowserServerAddress = ""; @@ -109,14 +105,10 @@ namespace Novetus.Core public string MapPath { get; set; } public string MapPathSnip { get; set; } public Settings.Mode GraphicsMode { get; set; } - public bool ReShade { get; set; } public Settings.Level QualityLevel { get; set; } public Settings.Style LauncherStyle { get; set; } - public bool ReShadeFPSDisplay { get; set; } - public bool ReShadePerformanceMode { get; set; } public bool AssetSDKFixerSaveBackups { get; set; } public string AlternateServerIP { get; set; } - public bool DisableReshadeDelete { get; set; } public bool ShowServerNotifications { get; set; } public string ServerBrowserServerName { get; set; } public string ServerBrowserServerAddress { get; set; } @@ -835,11 +827,9 @@ namespace Novetus.Core ini.IniWriteValue(section, "MapPath", GlobalVars.UserConfiguration.MapPath.ToString()); ini.IniWriteValue(section, "MapPathSnip", GlobalVars.UserConfiguration.MapPathSnip.ToString()); ini.IniWriteValue(section, "GraphicsMode", ((int)GlobalVars.UserConfiguration.GraphicsMode).ToString()); - ini.IniWriteValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString()); ini.IniWriteValue(section, "QualityLevel", ((int)GlobalVars.UserConfiguration.QualityLevel).ToString()); ini.IniWriteValue(section, "Style", ((int)GlobalVars.UserConfiguration.LauncherStyle).ToString()); ini.IniWriteValue(section, "AlternateServerIP", GlobalVars.UserConfiguration.AlternateServerIP.ToString()); - ini.IniWriteValue(section, "DisableReshadeDelete", GlobalVars.UserConfiguration.DisableReshadeDelete.ToString()); ini.IniWriteValue(section, "ShowServerNotifications", GlobalVars.UserConfiguration.ShowServerNotifications.ToString()); ini.IniWriteValue(section, "ServerBrowserServerName", GlobalVars.UserConfiguration.ServerBrowserServerName.ToString()); ini.IniWriteValue(section, "ServerBrowserServerAddress", GlobalVars.UserConfiguration.ServerBrowserServerAddress.ToString()); @@ -867,8 +857,8 @@ namespace Novetus.Core string closeonlaunch, userid, name, selectedclient, map, port, limit, upnp, disablehelpmessage, discord, mappath, mapsnip, - graphics, reshade, qualitylevel, style, savebackups, altIP, - disReshadeDel, showNotifs, SB_Name, SB_Address, priority, + graphics, qualitylevel, style, savebackups, altIP, + showNotifs, SB_Name, SB_Address, priority, firstServerLaunch, newgui, quickconfigure, bootstrapper, webproxysetup, webproxy; @@ -888,11 +878,9 @@ namespace Novetus.Core mappath = ini.IniReadValue(section, "MapPath", GlobalVars.UserConfiguration.MapPath.ToString()); mapsnip = ini.IniReadValue(section, "MapPathSnip", GlobalVars.UserConfiguration.MapPathSnip.ToString()); graphics = ini.IniReadValue(section, "GraphicsMode", ((int)GlobalVars.UserConfiguration.GraphicsMode).ToString()); - reshade = ini.IniReadValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString()); qualitylevel = ini.IniReadValue(section, "QualityLevel", ((int)GlobalVars.UserConfiguration.QualityLevel).ToString()); style = ini.IniReadValue(section, "Style", ((int)GlobalVars.UserConfiguration.LauncherStyle).ToString()); altIP = ini.IniReadValue(section, "AlternateServerIP", GlobalVars.UserConfiguration.AlternateServerIP.ToString()); - disReshadeDel = ini.IniReadValue(section, "DisableReshadeDelete", GlobalVars.UserConfiguration.DisableReshadeDelete.ToString()); showNotifs = ini.IniReadValue(section, "ShowServerNotifications", GlobalVars.UserConfiguration.ShowServerNotifications.ToString()); SB_Name = ini.IniReadValue(section, "ServerBrowserServerName", GlobalVars.UserConfiguration.ServerBrowserServerName.ToString()); SB_Address = ini.IniReadValue(section, "ServerBrowserServerAddress", GlobalVars.UserConfiguration.ServerBrowserServerAddress.ToString()); @@ -934,12 +922,10 @@ namespace Novetus.Core GlobalVars.UserConfiguration.DiscordPresence = ValueBool(discord, DefaultConfiguration.DiscordPresence); GlobalVars.UserConfiguration.MapPathSnip = mapsnip; GlobalVars.UserConfiguration.GraphicsMode = (Settings.Mode)ValueInt(graphics, Convert.ToInt32(DefaultConfiguration.GraphicsMode)); - GlobalVars.UserConfiguration.ReShade = ValueBool(reshade, DefaultConfiguration.ReShade); GlobalVars.UserConfiguration.QualityLevel = (Settings.Level)ValueInt(qualitylevel, Convert.ToInt32(DefaultConfiguration.QualityLevel)); GlobalVars.UserConfiguration.LauncherStyle = (Settings.Style)ValueInt(style, Convert.ToInt32(DefaultConfiguration.LauncherStyle)); GlobalVars.UserConfiguration.AssetSDKFixerSaveBackups = ValueBool(savebackups, DefaultConfiguration.AssetSDKFixerSaveBackups); GlobalVars.UserConfiguration.AlternateServerIP = altIP; - GlobalVars.UserConfiguration.DisableReshadeDelete = ValueBool(disReshadeDel, DefaultConfiguration.DisableReshadeDelete); GlobalVars.UserConfiguration.ShowServerNotifications = ValueBool(showNotifs, DefaultConfiguration.ShowServerNotifications); GlobalVars.UserConfiguration.ServerBrowserServerName = SB_Name; GlobalVars.UserConfiguration.ServerBrowserServerAddress = SB_Address; @@ -993,8 +979,6 @@ namespace Novetus.Core { Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, write); } - - ReShade(GlobalPaths.ConfigDir, "ReShade.ini", write); #endif } } @@ -1143,123 +1127,6 @@ namespace Novetus.Core ReloadLoadoutValue(); } - public static void ReShade(string cfgpath, string cfgname, bool write) - { - string fullpath = cfgpath + "\\" + cfgname; - - if (!File.Exists(fullpath)) - { - Util.FixedFileCopy(GlobalPaths.ConfigDir + "\\ReShade_default.ini", fullpath, false); - ReShadeValues(fullpath, write, true); - } - else - { - ReShadeValues(fullpath, write, true); - } - - string clientdir = GlobalPaths.ClientDir; - DirectoryInfo dinfo = new DirectoryInfo(clientdir); - DirectoryInfo[] Dirs = dinfo.GetDirectories(); - foreach (DirectoryInfo dir in Dirs) - { - string fulldirpath = dir.FullName + @"\" + cfgname; - string dllfilename = "opengl32.dll"; - string fulldllpath = dir.FullName + @"\" + dllfilename; - - if (GlobalVars.UserConfiguration.ReShade) - { - if (!File.Exists(fulldirpath)) - { - Util.FixedFileCopy(fullpath, fulldirpath, false); - ReShadeValues(fulldirpath, write, false); - } - else - { - ReShadeValues(fulldirpath, write, false); - } - - if (!File.Exists(fulldllpath)) - { - Util.FixedFileCopy(GlobalPaths.DataDir + "\\" + dllfilename, fulldllpath, false); - } - } - else - { - Util.FixedFileDelete(fulldirpath); - - if (!GlobalVars.UserConfiguration.DisableReshadeDelete) - { - Util.FixedFileDelete(fulldllpath); - } - } - } - } - - public static void ReShadeValues(string cfgpath, bool write, bool setglobals) - { - if (write) - { - //WRITE - INIFile ini = new INIFile(cfgpath); - - string section = "GENERAL"; - string section2 = "OVERLAY"; - - int FPS = GlobalVars.UserConfiguration.ReShadeFPSDisplay ? 1 : 0; - ini.IniWriteValue(section2, "ShowFPS", FPS.ToString()); - ini.IniWriteValue(section2, "ShowFrameTime", FPS.ToString()); - int PerformanceMode = GlobalVars.UserConfiguration.ReShadePerformanceMode ? 1 : 0; - ini.IniWriteValue(section, "PerformanceMode", PerformanceMode.ToString()); - } - else - { - //READ - string framerate, frametime, performance; - - INIFile ini = new INIFile(cfgpath); - - string section = "GENERAL"; - string section2 = "OVERLAY"; - - int FPS = GlobalVars.UserConfiguration.ReShadeFPSDisplay ? 1 : 0; - framerate = ini.IniReadValue(section2, "ShowFPS", FPS.ToString()); - frametime = ini.IniReadValue(section2, "ShowFrameTime", FPS.ToString()); - int PerformanceMode = GlobalVars.UserConfiguration.ReShadePerformanceMode ? 1 : 0; - performance = ini.IniReadValue(section, "PerformanceMode", PerformanceMode.ToString()); - - if (setglobals) - { - try - { - switch (ValueInt(framerate, 0)) - { - case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(frametime) == 1: - GlobalVars.UserConfiguration.ReShadeFPSDisplay = true; - break; - default: - GlobalVars.UserConfiguration.ReShadeFPSDisplay = false; - break; - } - - switch (ValueInt(performance, 0)) - { - case 1: - GlobalVars.UserConfiguration.ReShadePerformanceMode = true; - break; - default: - GlobalVars.UserConfiguration.ReShadePerformanceMode = false; - break; - } - } - catch (Exception ex) - { - Util.LogExceptions(ex); - ReShadeValues(cfgpath, true, setglobals); - } - } - } - } - public static bool InitColors() { try diff --git a/Novetus/NovetusLauncher/Forms/LauncherFormSettings.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherFormSettings.Designer.cs index 8711539..4c46b44 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherFormSettings.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherFormSettings.Designer.cs @@ -32,20 +32,15 @@ this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label31 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.checkBox6 = new System.Windows.Forms.CheckBox(); - this.checkBox7 = new System.Windows.Forms.CheckBox(); this.label22 = new System.Windows.Forms.Label(); - this.checkBox5 = new System.Windows.Forms.CheckBox(); this.button1 = new System.Windows.Forms.Button(); this.label9 = new System.Windows.Forms.Label(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.button2 = new System.Windows.Forms.Button(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.NewGUI2011MBox = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.comboBox3 = new System.Windows.Forms.ComboBox(); - this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); this.SuspendLayout(); @@ -92,27 +87,6 @@ this.comboBox1.TabIndex = 79; this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); // - // checkBox6 - // - this.checkBox6.Location = new System.Drawing.Point(6, 65); - this.checkBox6.Name = "checkBox6"; - this.checkBox6.Size = new System.Drawing.Size(131, 17); - this.checkBox6.TabIndex = 76; - this.checkBox6.Text = "ReShade FPS Display"; - this.checkBox6.UseVisualStyleBackColor = true; - this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged); - // - // checkBox7 - // - this.checkBox7.AutoSize = true; - this.checkBox7.Location = new System.Drawing.Point(6, 42); - this.checkBox7.Name = "checkBox7"; - this.checkBox7.Size = new System.Drawing.Size(164, 17); - this.checkBox7.TabIndex = 77; - this.checkBox7.Text = "ReShade Performance Mode"; - this.checkBox7.UseVisualStyleBackColor = true; - this.checkBox7.CheckedChanged += new System.EventHandler(this.checkBox7_CheckedChanged); - // // label22 // this.label22.AutoSize = true; @@ -122,23 +96,12 @@ this.label22.TabIndex = 78; this.label22.Text = "Graphics Quality"; // - // checkBox5 - // - this.checkBox5.AutoSize = true; - this.checkBox5.Location = new System.Drawing.Point(6, 20); - this.checkBox5.Name = "checkBox5"; - this.checkBox5.Size = new System.Drawing.Size(107, 17); - this.checkBox5.TabIndex = 75; - this.checkBox5.Text = "Toggle ReShade"; - this.checkBox5.UseVisualStyleBackColor = true; - this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged); - // // button1 // - this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button1.Location = new System.Drawing.Point(8, 71); + this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.button1.Location = new System.Drawing.Point(211, 16); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(191, 49); + this.button1.Size = new System.Drawing.Size(191, 22); this.button1.TabIndex = 83; this.button1.Text = "Change custom graphics options"; this.button1.UseVisualStyleBackColor = true; @@ -150,7 +113,7 @@ this.label9.BackColor = System.Drawing.SystemColors.ControlLightLight; this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.ForeColor = System.Drawing.Color.Red; - this.label9.Location = new System.Drawing.Point(9, 164); + this.label9.Location = new System.Drawing.Point(9, 134); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(411, 39); this.label9.TabIndex = 84; @@ -159,38 +122,25 @@ "apply.\r\n"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // groupBox1 - // - this.groupBox1.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.groupBox1.Controls.Add(this.checkBox7); - this.groupBox1.Controls.Add(this.checkBox5); - this.groupBox1.Controls.Add(this.checkBox6); - this.groupBox1.Location = new System.Drawing.Point(223, 1); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(197, 88); - this.groupBox1.TabIndex = 85; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "ReShade Options"; - // // groupBox2 // this.groupBox2.BackColor = System.Drawing.SystemColors.ControlLightLight; this.groupBox2.Controls.Add(this.button2); this.groupBox2.Controls.Add(this.label31); this.groupBox2.Controls.Add(this.label22); - this.groupBox2.Controls.Add(this.comboBox1); this.groupBox2.Controls.Add(this.button1); + this.groupBox2.Controls.Add(this.comboBox1); this.groupBox2.Controls.Add(this.comboBox2); this.groupBox2.Location = new System.Drawing.Point(12, 1); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(205, 155); + this.groupBox2.Size = new System.Drawing.Size(408, 79); this.groupBox2.TabIndex = 86; this.groupBox2.TabStop = false; this.groupBox2.Text = "Graphics Options"; // // button2 // - this.button2.Location = new System.Drawing.Point(8, 126); + this.button2.Location = new System.Drawing.Point(211, 42); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(191, 23); this.button2.TabIndex = 84; @@ -204,9 +154,9 @@ this.groupBox3.Controls.Add(this.NewGUI2011MBox); this.groupBox3.Controls.Add(this.label1); this.groupBox3.Controls.Add(this.comboBox3); - this.groupBox3.Location = new System.Drawing.Point(223, 95); + this.groupBox3.Location = new System.Drawing.Point(12, 86); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(197, 61); + this.groupBox3.Size = new System.Drawing.Size(408, 45); this.groupBox3.TabIndex = 87; this.groupBox3.TabStop = false; this.groupBox3.Text = "Other"; @@ -214,7 +164,7 @@ // NewGUI2011MBox // this.NewGUI2011MBox.AutoSize = true; - this.NewGUI2011MBox.Location = new System.Drawing.Point(6, 39); + this.NewGUI2011MBox.Location = new System.Drawing.Point(211, 14); this.NewGUI2011MBox.Name = "NewGUI2011MBox"; this.NewGUI2011MBox.Size = new System.Drawing.Size(161, 17); this.NewGUI2011MBox.TabIndex = 76; @@ -225,7 +175,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(3, 15); + this.label1.Location = new System.Drawing.Point(25, 18); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(38, 13); this.label1.TabIndex = 1; @@ -242,9 +192,9 @@ "Above normal", "High", "Realtime"}); - this.comboBox3.Location = new System.Drawing.Point(46, 12); + this.comboBox3.Location = new System.Drawing.Point(90, 12); this.comboBox3.Name = "comboBox3"; - this.comboBox3.Size = new System.Drawing.Size(120, 21); + this.comboBox3.Size = new System.Drawing.Size(109, 21); this.comboBox3.TabIndex = 0; this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged); // @@ -253,10 +203,9 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(426, 212); + this.ClientSize = new System.Drawing.Size(426, 177); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); this.Controls.Add(this.label9); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -265,8 +214,6 @@ this.Text = "Novetus Settings"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NovetusSettings_Close); this.Load += new System.EventHandler(this.NovetusSettings_Load); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.groupBox3.ResumeLayout(false); @@ -285,13 +232,9 @@ private System.Windows.Forms.ComboBox comboBox2; private System.Windows.Forms.Label label31; private System.Windows.Forms.ComboBox comboBox1; - private System.Windows.Forms.CheckBox checkBox6; - private System.Windows.Forms.CheckBox checkBox7; private System.Windows.Forms.Label label22; - private System.Windows.Forms.CheckBox checkBox5; private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label9; - private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.ComboBox comboBox3; diff --git a/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs b/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs index 47fa25c..e7adf44 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherFormSettings.cs @@ -42,26 +42,11 @@ namespace NovetusLauncher } } - private void checkBox5_CheckedChanged(object sender, EventArgs e) - { - GlobalVars.UserConfiguration.ReShade = checkBox5.Checked; - } - private void NewGUI2011MBox_CheckedChanged(object sender, EventArgs e) { GlobalVars.UserConfiguration.NewGUI = NewGUI2011MBox.Checked; } - private void checkBox6_CheckedChanged(object sender, EventArgs e) - { - GlobalVars.UserConfiguration.ReShadeFPSDisplay = checkBox6.Checked; - } - - private void checkBox7_CheckedChanged(object sender, EventArgs e) - { - GlobalVars.UserConfiguration.ReShadePerformanceMode = checkBox7.Checked; - } - private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { GlobalVars.UserConfiguration.GraphicsMode = (Settings.Mode)comboBox1.SelectedIndex; @@ -147,9 +132,6 @@ namespace NovetusLauncher void ReadConfigValues() { FileManagement.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); - checkBox5.Checked = GlobalVars.UserConfiguration.ReShade; - checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay; - checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode; NewGUI2011MBox.Checked = GlobalVars.UserConfiguration.NewGUI; comboBox1.SelectedIndex = (int)GlobalVars.UserConfiguration.GraphicsMode; comboBox2.SelectedIndex = (int)GlobalVars.UserConfiguration.QualityLevel; diff --git a/Novetus/NovetusLauncher/Forms/NovetusConsole.cs b/Novetus/NovetusLauncher/Forms/NovetusConsole.cs index e18a4d6..1d0b423 100644 --- a/Novetus/NovetusLauncher/Forms/NovetusConsole.cs +++ b/Novetus/NovetusLauncher/Forms/NovetusConsole.cs @@ -351,19 +351,6 @@ namespace NovetusLauncher ConsoleForm.LoadLauncher(); ScrollToEnd(); 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); - } - ScrollToEnd(); - break; case string altip when altip.Contains("altip", StringComparison.InvariantCultureIgnoreCase) == true: try { diff --git a/changelog.txt b/changelog.txt index 9fd3769..028a179 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,17 @@ +Snapshot v23.8482.17361.1 +Enhancements: +- Slightly sped up asset loading times with the Web Proxy. +- Added the following Security changes to 2009E. + - Removed customization security check, as Appearance isn't a required security value. + - Removed a useless for loop in the kicking code. + - Removed tripcodes as the security system already has a tracking system for users. + - MD5 values and Tripcodes can no longer be modified by the server owner. + - Novetus now checks for string length for MD5s and Tripcodes. + +Fixes: +- Fixed an issue where not all customization item types are saved automatically after seclection. +- Fixed a crash issue when joining a server on the same client instance. +---------------------------------------------------------------------------- Snapshot v23.8469.20669.1 Enhancements: - Added clean_junk.bat to allow the user to quickly reset their Novetus install. diff --git a/defaultaddons/novetusexts/webproxy/Asset.cs b/defaultaddons/novetusexts/webproxy/Asset.cs index ba366a1..9906d93 100644 --- a/defaultaddons/novetusexts/webproxy/Asset.cs +++ b/defaultaddons/novetusexts/webproxy/Asset.cs @@ -8,6 +8,7 @@ using Titanium.Web.Proxy; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Models; +using System.Threading; using Novetus.Core; public class Asset : IWebProxyExtension @@ -50,22 +51,30 @@ public class Asset : IWebProxyExtension e.Ok(numArray, NetFuncs.GenerateHeaders(((long) numArray.Length).ToString())); } - bool CanRedirectLocalAsset(string path, long id, SessionEventArgs e) + bool CanRedirectLocalAsset(long id, SessionEventArgs e) { - if (string.IsNullOrWhiteSpace(path)) - return false; - if (id == null) return false; string idString = id.ToString(); - List PathList = new List((IEnumerable)Directory.GetFiles(path, idString, SearchOption.AllDirectories)); + + List PathList = new List((IEnumerable)Directory.GetFiles(GlobalPaths.DataPath, idString, SearchOption.AllDirectories)); if (PathList.Count > 0) { RedirectLocalAsset(PathList, idString, e); return true; } + else + { + PathList = new List((IEnumerable)Directory.GetFiles(GlobalPaths.AssetsPath, idString, SearchOption.AllDirectories)); + + if (PathList.Count > 0) + { + RedirectLocalAsset(PathList, idString, e); + return true; + } + } return false; } @@ -81,22 +90,19 @@ public class Asset : IWebProxyExtension } else { - if (!CanRedirectLocalAsset(GlobalPaths.DataPath, id, e)) + if (!CanRedirectLocalAsset(id, e)) { - if (!CanRedirectLocalAsset(GlobalPaths.AssetsPath, id, e)) + e.Redirect(url); + + new Thread(() => { - e.Redirect(url); - - if (e.HttpClient.Response.StatusCode != 409) - { - Downloader download = new Downloader(url, id.ToString()); + Downloader download = new Downloader(url, id.ToString()); - download.filePath = GlobalPaths.AssetCacheDirAssets; - download.showErrorInfo = false; - download.overwrite = false; - download.InitDownloadDirect(""); - } - } + download.filePath = GlobalPaths.AssetCacheDirAssets; + download.showErrorInfo = false; + download.overwrite = false; + download.InitDownloadDirect(""); + }).Start(); } } } diff --git a/scripts/batch/dev_menu.bat b/scripts/batch/dev_menu.bat index 1800575..f31caea 100644 --- a/scripts/batch/dev_menu.bat +++ b/scripts/batch/dev_menu.bat @@ -43,7 +43,7 @@ IF %M%==2 GOTO CLEANUP_DRY IF %M%==3 GOTO MENU :CLEANJUNK -call clean_junk.bat +call Novetus/clean_junk.bat echo Junk files cleaned. Updating GitHub scripts. call github_sync.bat IF %cleanupval%==1 GOTO POSTCLEANUP diff --git a/scripts/game/2009E/CSMPFunctions.lua b/scripts/game/2009E/CSMPFunctions.lua index a171848..9aa618a 100644 --- a/scripts/game/2009E/CSMPFunctions.lua +++ b/scripts/game/2009E/CSMPFunctions.lua @@ -22,13 +22,12 @@ function KickPlayer(Player,reason) if (Player ~= nil) then pcall(function() _G.CSScript_OnPlayerKicked(Player,reason) end) - - for _,Child in pairs(Server:children()) do - name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value - if (Server:findFirstChild(name) ~= nil and Child.Name == name) then - Child:CloseConnection() - print("Player '" .. Player.Name .. "' Kicked. Reason: "..reason) - end + + name = "ServerReplicator|"..Player.Name.."|"..Player.userId.."|"..Player.AnonymousIdentifier.Value + replicator = Server:findFirstChild(name) + if (replicator ~= nil) then + replicator:CloseConnection() + print("Player '" .. Player.Name .. "' Kicked. Reason: "..reason) end end end @@ -62,22 +61,6 @@ function LoadCharacterNew(playerApp,newChar) PlayerService = game:GetService("Players") Player = PlayerService:GetPlayerFromCharacter(newChar) - local function kick() - KickPlayer(Player, "Modified Client") - end - - if (playerApp == nil) then - kick() - end - - if (not Player:FindFirstChild("Appearance")) then - kick() - end - - if ((playerApp:GetChildren() == 0) or (playerApp:GetChildren() == nil)) then - kick() - end - local path = "rbxasset://../../../shareddata/charcustom/" local charparts = {[1] = newWaitForChild(newChar,"Head"),[2] = newWaitForChild(newChar,"Torso"),[3] = newWaitForChild(newChar,"Left Arm"),[4] = newWaitForChild(newChar,"Right Arm"),[5] = newWaitForChild(newChar,"Left Leg"),[6] = newWaitForChild(newChar,"Right Leg")} @@ -476,6 +459,10 @@ function LoadSecurity(playerApp,Player,ServerSecurityLocation) if (playerApp == nil) then kick() end + + if (#playerApp:GetChildren() <= 0) then + kick() + end if (not Player:FindFirstChild("Security")) then kick() @@ -487,21 +474,21 @@ function LoadSecurity(playerApp,Player,ServerSecurityLocation) for _,newVal in pairs(playerApp:GetChildren()) do if (newVal.Name == "ClientEXEMD5") then - if (newVal.Value ~= ServerSecurityLocation.Security.ClientEXEMD5.Value or newVal.Value == "") then + if ((newVal.Value ~= ServerSecurityLocation.Security.ClientEXEMD5.Value) or (string.len(newVal.Value) ~= string.len(ServerSecurityLocation.Security.ClientEXEMD5.Value))) then kick() break end end if (newVal.Name == "LauncherMD5") then - if (newVal.Value ~= ServerSecurityLocation.Security.LauncherMD5.Value or newVal.Value == "") then + if ((newVal.Value ~= ServerSecurityLocation.Security.LauncherMD5.Value) or (string.len(newVal.Value) ~= string.len(ServerSecurityLocation.Security.LauncherMD5.Value))) then kick() break end end if (newVal.Name == "ClientScriptMD5") then - if (newVal.Value ~= ServerSecurityLocation.Security.ClientScriptMD5.Value or newVal.Value == "") then + if ((newVal.Value ~= ServerSecurityLocation.Security.ClientScriptMD5.Value) or (string.len(newVal.Value) ~= string.len(ServerSecurityLocation.Security.ClientScriptMD5.Value))) then kick() break end @@ -543,7 +530,8 @@ function LoadTripcode(Player) for _,newVal in pairs(Player:GetChildren()) do if (newVal.Name == "Tripcode") then - if (newVal.Value == "") then + --56 is the length of the tripcode. + if ((string.len(newVal.Value) ~= 56)) then kick() break end @@ -576,7 +564,7 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti local playerCount = 0 PlayerService.PlayerAdded:connect(function(Player) - -- create anonymous player identifier. This is so we can track clients without tripcodes + -- create anonymous player identifier. This is so we can track clients playerCount = playerCount + 1 local code = Instance.new("StringValue", Player) @@ -648,6 +636,8 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti coroutine.resume(coroutine.create(function() while true do wait(0.1) + game.Lighting.Security:remove() + InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) pcall(function() _G.CSScript_Update() end) end end)) @@ -668,6 +658,7 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He end) local suc, err = pcall(function() + local playerJoined = false client = game:GetService("NetworkClient") player = game:GetService("Players"):CreateLocalPlayer(UserID) player:SetSuperSafeChat(false) @@ -680,6 +671,17 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He InitalizeClientAppearance(player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) InitalizeSecurityValues(player,ClientEXEMD5,LauncherMD5,ClientScriptMD5) InitalizeTripcode(player,Tripcode) + playerJoined = true + + coroutine.resume(coroutine.create(function() + while playerJoined do + wait(0.1) + player.Security:remove() + InitalizeSecurityValues(player,ClientEXEMD5,LauncherMD5,ClientScriptMD5) + player.Tripcode:remove() + InitalizeTripcode(player,Tripcode) + end + end)) end) local function dieerror(errmsg) diff --git a/scripts/launcher/info.ini b/scripts/launcher/info.ini index 8bb2d85..79b63e5 100644 --- a/scripts/launcher/info.ini +++ b/scripts/launcher/info.ini @@ -9,4 +9,5 @@ ExtendedVersionNumber=True //ExtendedVersionTemplate=vX.23.%extended-revision% (%version-name%) ExtendedVersionTemplate=Snapshot v23.%build%.%revision%.%extended-revision% ExtendedVersionRevision=1 -InitialBootup=False +InitialBootup=True +IsLite=False