From 752d9238e6d2cb746a72e7f450a1cab606e27744 Mon Sep 17 00:00:00 2001 From: Bitl Date: Fri, 19 Mar 2021 16:02:03 -0700 Subject: [PATCH] update files --- ContentProviders.xml | 7 +- Novetus/NovetusCMD/Classes/LocalFuncs.cs | 1 + Novetus/NovetusCMD/NovetusCMD.cs | 17 +++- Novetus/NovetusCore/Classes/FileFormat.cs | 2 + .../StorageAndFunctions/GlobalFuncs.cs | 79 +++++++++---------- .../StorageAndFunctions/ScriptFuncs.cs | 7 +- .../Compact/LauncherFormCompact.Designer.cs | 32 +++++--- .../Compact/LauncherFormCompact.cs | 6 ++ .../Extended/LauncherFormExtended.Designer.cs | 16 +++- .../Extended/LauncherFormExtended.cs | 6 ++ .../Forms/SDK/ClientinfoCreator.Designer.cs | 18 ++++- .../Forms/SDK/DiogenesEditor.Designer.cs | 13 ++- .../Forms/SDK/DiogenesEditor.cs | 28 ++++--- batch/dev_menu.bat | 12 +++ batch/github_scripts.bat | 4 +- scripts/2006S-Shaders/CSMPFunctions.lua | 25 +++++- scripts/2006S/CSMPFunctions.lua | 25 +++++- scripts/2007E/CSMPFunctions.lua | 27 ++++++- scripts/2007M-Shaders/CSMPFunctions.lua | 25 +++++- scripts/2007M/CSMPFunctions.lua | 25 +++++- scripts/2008M/CSMPFunctions.lua | 42 ++++++++-- scripts/2009E/CSMPFunctions.lua | 42 ++++++++-- scripts/2009L/CSMPFunctions.lua | 41 ++++++++-- scripts/2010L/CSMPFunctions.lua | 41 ++++++++-- scripts/2011E/CSMPFunctions.lua | 44 ++++++++--- scripts/2011M/CSMPFunctions.lua | 48 ++++++++--- 26 files changed, 481 insertions(+), 152 deletions(-) diff --git a/ContentProviders.xml b/ContentProviders.xml index 61871ea..b3a8bce 100644 --- a/ContentProviders.xml +++ b/ContentProviders.xml @@ -3,15 +3,10 @@ - Roblox (Novetus Official Redirect) + Roblox (Novetus redirect, Image items only) http://novetusofficial.000webhostapp.com/asset?id= robloxnovetus.png - - Roblox (Novetus+ Redirect) - http://epicgamers.xyz/asset/?id= - robloxnplus.png - Finobe http://finobe.com/asset/?id= diff --git a/Novetus/NovetusCMD/Classes/LocalFuncs.cs b/Novetus/NovetusCMD/Classes/LocalFuncs.cs index 3cca710..520aabb 100644 --- a/Novetus/NovetusCMD/Classes/LocalFuncs.cs +++ b/Novetus/NovetusCMD/Classes/LocalFuncs.cs @@ -34,6 +34,7 @@ namespace NovetusCMD GlobalFuncs.ConsolePrint("-port | Sets the server port.", 4, true); GlobalFuncs.ConsolePrint("-maxplayers | Sets the number of players.", 4, true); GlobalFuncs.ConsolePrint("-webserver | Toggles launching of the web server.", 4, true); + GlobalFuncs.ConsolePrint("-notifications | Toggles server join/leave notifications.", 4, true); GlobalFuncs.ConsolePrint("---------", 1, true); GlobalFuncs.ConsolePrint("How to launch:", 3, true); GlobalFuncs.ConsolePrint("---------", 1, true); diff --git a/Novetus/NovetusCMD/NovetusCMD.cs b/Novetus/NovetusCMD/NovetusCMD.cs index c63837f..0cc6667 100644 --- a/Novetus/NovetusCMD/NovetusCMD.cs +++ b/Novetus/NovetusCMD/NovetusCMD.cs @@ -314,7 +314,22 @@ namespace NovetusCMD } else { - GlobalFuncs.ConsolePrint("NovetusCMD no longer will launch the Web Server.", 4); + GlobalFuncs.ConsolePrint("NovetusCMD will no longer launch the Web Server.", 4); + } + } + + if (CommandLine["notifications"] != null) + { + LocalVars.OverrideINI = true; + GlobalVars.UserConfiguration.ShowServerNotifications = Convert.ToBoolean(CommandLine["notifications"]); + + if (GlobalVars.UserConfiguration.ShowServerNotifications) + { + GlobalFuncs.ConsolePrint("NovetusCMD will show notifications on player join/leave.", 4); + } + else + { + GlobalFuncs.ConsolePrint("NovetusCMD will no longer show notifications on player join/leave.", 4); } } diff --git a/Novetus/NovetusCore/Classes/FileFormat.cs b/Novetus/NovetusCore/Classes/FileFormat.cs index b0ff24e..07443d0 100644 --- a/Novetus/NovetusCore/Classes/FileFormat.cs +++ b/Novetus/NovetusCore/Classes/FileFormat.cs @@ -63,6 +63,7 @@ public class FileFormat WebServerPort = 40735; WebServer = true; DisableReshadeDelete = false; + ShowServerNotifications = true; } public string SelectedClient { get; set; } @@ -89,6 +90,7 @@ public class FileFormat public int WebServerPort { get; set; } public bool WebServer { get; set; } public bool DisableReshadeDelete { get; set; } + public bool ShowServerNotifications { get; set; } } #endregion diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs index e7085a8..e07209b 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs @@ -123,6 +123,7 @@ public class GlobalFuncs ini.IniWriteValue(section, "WebServerPort", GlobalVars.UserConfiguration.WebServerPort.ToString()); ini.IniWriteValue(section, "WebServer", GlobalVars.UserConfiguration.WebServer.ToString()); ini.IniWriteValue(section, "DisableReshadeDelete", GlobalVars.UserConfiguration.DisableReshadeDelete.ToString()); + ini.IniWriteValue(section, "ShowServerNotifications", GlobalVars.UserConfiguration.ShowServerNotifications.ToString()); } else { @@ -132,7 +133,7 @@ public class GlobalFuncs string closeonlaunch, userid, name, selectedclient, map, port, limit, upnp, disablehelpmessage, tripcode, discord, mappath, mapsnip, - graphics, reshade, qualitylevel, style, savebackups, altIP, WS, WSPort, disReshadeDel; + graphics, reshade, qualitylevel, style, savebackups, altIP, WS, WSPort, disReshadeDel, showNotifs; INIFile ini = new INIFile(cfgpath); @@ -160,6 +161,7 @@ public class GlobalFuncs WSPort = ini.IniReadValue(section, "WebServerPort", GlobalVars.UserConfiguration.WebServerPort.ToString()); WS = ini.IniReadValue(section, "WebServer", GlobalVars.UserConfiguration.WebServer.ToString()); disReshadeDel = ini.IniReadValue(section, "DisableReshadeDelete", GlobalVars.UserConfiguration.DisableReshadeDelete.ToString()); + showNotifs = ini.IniReadValue(section, "ShowServerNotifications", GlobalVars.UserConfiguration.ShowServerNotifications.ToString()); GlobalVars.UserConfiguration.CloseOnLaunch = Convert.ToBoolean(closeonlaunch); @@ -214,6 +216,7 @@ public class GlobalFuncs GlobalVars.UserConfiguration.WebServerPort = Convert.ToInt32(WSPort); GlobalVars.UserConfiguration.WebServer = Convert.ToBoolean(WS); GlobalVars.UserConfiguration.DisableReshadeDelete = Convert.ToBoolean(disReshadeDel); + GlobalVars.UserConfiguration.ShowServerNotifications = Convert.ToBoolean(showNotifs); } catch (Exception) { @@ -500,6 +503,10 @@ public class GlobalFuncs #endif { string name = ClientName; + if (string.IsNullOrWhiteSpace(name)) + { + name = GlobalVars.ProgramInformation.DefaultClient; + } string clientpath = GlobalPaths.ClientDir + @"\\" + name + @"\\clientinfo.nov"; if (!File.Exists(clientpath)) @@ -657,21 +664,11 @@ public class GlobalFuncs public static void ResetConfigValues() #endif { + GlobalVars.UserConfiguration = new FileFormat.Config(); GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient; - GlobalVars.UserConfiguration.Map = GlobalVars.ProgramInformation.DefaultMap; - GlobalVars.UserConfiguration.CloseOnLaunch = false; - GeneratePlayerID(); - GlobalVars.UserConfiguration.PlayerName = "Player"; - GlobalVars.UserConfiguration.RobloxPort = 53640; - GlobalVars.UserConfiguration.PlayerLimit = 12; - GlobalVars.UserConfiguration.UPnP = false; - GlobalVars.UserConfiguration.DisabledItemMakerHelp = false; - GlobalVars.UserConfiguration.DiscordPresence = true; + GlobalVars.UserConfiguration.Map = GlobalVars.ProgramInformation.DefaultMap; GlobalVars.UserConfiguration.MapPath = GlobalPaths.MapsDir + @"\\" + GlobalVars.ProgramInformation.DefaultMap; GlobalVars.UserConfiguration.MapPathSnip = GlobalPaths.MapsDirBase + @"\\" + GlobalVars.ProgramInformation.DefaultMap; - GlobalVars.UserConfiguration.GraphicsMode = Settings.GraphicsOptions.Mode.Automatic; - GlobalVars.UserConfiguration.ReShade = false; - GlobalVars.UserConfiguration.QualityLevel = Settings.GraphicsOptions.Level.Automatic; #if LAUNCHER if (IsInCompact) { @@ -684,36 +681,14 @@ public class GlobalFuncs #else GlobalVars.UserConfiguration.LauncherStyle = Settings.UIOptions.Style.Extended; #endif + GeneratePlayerID(); + GenerateTripcode(); ResetCustomizationValues(); } public static void ResetCustomizationValues() { - GlobalVars.UserCustomization.Hat1 = "NoHat.rbxm"; - GlobalVars.UserCustomization.Hat2 = "NoHat.rbxm"; - GlobalVars.UserCustomization.Hat3 = "NoHat.rbxm"; - GlobalVars.UserCustomization.Face = "DefaultFace.rbxm"; - GlobalVars.UserCustomization.Head = "DefaultHead.rbxm"; - GlobalVars.UserCustomization.TShirt = "NoTShirt.rbxm"; - GlobalVars.UserCustomization.Shirt = "NoShirt.rbxm"; - GlobalVars.UserCustomization.Pants = "NoPants.rbxm"; - GlobalVars.UserCustomization.Icon = "NBC"; - GlobalVars.UserCustomization.Extra = "NoExtra.rbxm"; - GlobalVars.UserCustomization.HeadColorID = 24; - GlobalVars.UserCustomization.TorsoColorID = 23; - GlobalVars.UserCustomization.LeftArmColorID = 24; - GlobalVars.UserCustomization.RightArmColorID = 24; - GlobalVars.UserCustomization.LeftLegColorID = 119; - GlobalVars.UserCustomization.RightLegColorID = 119; - GlobalVars.UserCustomization.CharacterID = ""; - GlobalVars.UserCustomization.HeadColorString = "Color [A=255, R=245, G=205, B=47]"; - GlobalVars.UserCustomization.TorsoColorString = "Color [A=255, R=13, G=105, B=172]"; - GlobalVars.UserCustomization.LeftArmColorString = "Color [A=255, R=245, G=205, B=47]"; - GlobalVars.UserCustomization.RightArmColorString = "Color [A=255, R=245, G=205, B=47]"; - GlobalVars.UserCustomization.LeftLegColorString = "Color [A=255, R=164, G=189, B=71]"; - GlobalVars.UserCustomization.RightLegColorString = "Color [A=255, R=164, G=189, B=71]"; - GlobalVars.UserCustomization.ExtraSelectionIsHat = false; - GlobalVars.UserCustomization.ShowHatsInExtra = false; + GlobalVars.UserCustomization = new FileFormat.CustomizationConfig(); ReloadLoadoutValue(); } @@ -1039,6 +1014,27 @@ public class GlobalFuncs ApplyClientSettings(info, ClientName, GraphicsMode, MeshDetail, ShadingQuality, MaterialQuality, AA, AASamples, Bevels, Shadows_2008, Shadows_2007, "", GFXQualityLevel); } + else + { + //just copy the file. + string terms = "_" + ClientName; + string[] dirs = Directory.GetFiles(GlobalPaths.ConfigDirClients); + + try + { + foreach (string dir in dirs) + { + if (dir.Contains(terms) && !dir.Contains("_default")) + { + FixedFileCopy(dir, Settings.GraphicsOptions.GetPathForClientLoadOptions(info.ClientLoadOptions) + @"\" + Path.GetFileName(dir).Replace(terms, "").Replace("-Shaders", ""), true); + } + } + } + catch (Exception) + { + return; + } + } } //oh god.... @@ -1145,6 +1141,7 @@ public class GlobalFuncs RobloxXML.EditRenderSettings(doc, "Bevels", Bevels.ToString(), XMLTypes.Token); RobloxXML.EditRenderSettings(doc, "Shadow", Shadows_2008.ToString(), XMLTypes.Token); RobloxXML.EditRenderSettings(doc, "Shadows", Shadows_2007.ToString().ToLower(), XMLTypes.Bool); + RobloxXML.EditRenderSettings(doc, "shadows", Shadows_2007.ToString().ToLower(), XMLTypes.Bool); RobloxXML.EditRenderSettings(doc, "_skinFile", !string.IsNullOrWhiteSpace(Style_2007) ? @"Styles\" + Style_2007 : "", XMLTypes.String); RobloxXML.EditRenderSettings(doc, "QualityLevel", GFXQualityLevel.ToString(), XMLTypes.Token); } @@ -1590,12 +1587,12 @@ public class GlobalFuncs await TaskEx.Delay(miliseconds); } - // Credit to Carrot for the original code. Rewote it to be smaller and more customizable. - public static string CryptStringWithByte(string word, int byteflag) + // Credit to Carrot for the original code. Rewote it to be smaller. + public static string CryptStringWithByte(string word) { byte[] bytes = Encoding.ASCII.GetBytes(word); string result = ""; - for (int i = 0; i < bytes.Length; i++) { result += Convert.ToChar(byteflag ^ bytes[i]); } + for (int i = 0; i < bytes.Length; i++) { result += Convert.ToChar(0x55 ^ bytes[i]); } return result; } } diff --git a/Novetus/NovetusCore/StorageAndFunctions/ScriptFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/ScriptFuncs.cs index 666e380..e2ca831 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/ScriptFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/ScriptFuncs.cs @@ -69,7 +69,8 @@ public class ScriptFuncs return "_G.CSServer(" + GlobalVars.UserConfiguration.RobloxPort + "," + GlobalVars.UserConfiguration.PlayerLimit + "," - + md5s + ")"; + + md5s + "," + + GlobalVars.UserConfiguration.ShowServerNotifications.ToString().ToLower() + ")"; case ScriptType.Solo: case ScriptType.EasterEgg: return "_G.CSSolo(" @@ -194,7 +195,8 @@ public class ScriptFuncs return "dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.UserConfiguration.RobloxPort + "," + GlobalVars.UserConfiguration.PlayerLimit + "," - + md5s + "); " + + md5s + "," + + GlobalVars.UserConfiguration.ShowServerNotifications.ToString().ToLower() + "); " + (!string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? " dofile('" + GlobalPaths.AddonScriptPath + "');" : ""); case ScriptType.Solo: case ScriptType.EasterEgg: @@ -373,6 +375,7 @@ public class ScriptFuncs .Replace("%tripcode%", GlobalVars.UserConfiguration.PlayerTripcode) .Replace("%scripttype%", Generator.GetNameForType(type)) .Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath) + .Replace("%notifications%", GlobalVars.UserConfiguration.ShowServerNotifications.ToString().ToLower()) .Replace("%loadout%", code.Contains("") ? GlobalVars.soloLoadout : GlobalVars.Loadout) .Replace("%doublequote%", "\""); diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs index 9ffd1aa..2b00f73 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs @@ -58,6 +58,7 @@ namespace NovetusLauncher this.label3 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); this.checkBox8 = new System.Windows.Forms.CheckBox(); this.label19 = new System.Windows.Forms.Label(); this.textBox3 = new System.Windows.Forms.TextBox(); @@ -360,6 +361,7 @@ namespace NovetusLauncher // // tabPage2 // + this.tabPage2.Controls.Add(this.checkBox9); this.tabPage2.Controls.Add(this.checkBox8); this.tabPage2.Controls.Add(this.label19); this.tabPage2.Controls.Add(this.textBox3); @@ -381,10 +383,21 @@ namespace NovetusLauncher this.tabPage2.ToolTipText = "Start a server for other players to play"; this.tabPage2.UseVisualStyleBackColor = true; // + // checkBox9 + // + this.checkBox9.AutoSize = true; + this.checkBox9.Location = new System.Drawing.Point(315, 189); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(84, 17); + this.checkBox9.TabIndex = 63; + this.checkBox9.Text = "Notifications"; + this.checkBox9.UseVisualStyleBackColor = true; + this.checkBox9.CheckedChanged += new System.EventHandler(this.checkBox9_CheckedChanged); + // // checkBox8 // this.checkBox8.AutoSize = true; - this.checkBox8.Location = new System.Drawing.Point(265, 189); + this.checkBox8.Location = new System.Drawing.Point(226, 189); this.checkBox8.Name = "checkBox8"; this.checkBox8.Size = new System.Drawing.Size(83, 17); this.checkBox8.TabIndex = 62; @@ -419,7 +432,7 @@ namespace NovetusLauncher // checkBox4 // this.checkBox4.AutoSize = true; - this.checkBox4.Location = new System.Drawing.Point(204, 189); + this.checkBox4.Location = new System.Drawing.Point(163, 189); this.checkBox4.Name = "checkBox4"; this.checkBox4.Size = new System.Drawing.Size(54, 17); this.checkBox4.TabIndex = 57; @@ -431,7 +444,7 @@ namespace NovetusLauncher // button23 // this.button23.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button23.Location = new System.Drawing.Point(63, 184); + this.button23.Location = new System.Drawing.Point(23, 184); this.button23.Name = "button23"; this.button23.Size = new System.Drawing.Size(66, 25); this.button23.TabIndex = 51; @@ -441,7 +454,7 @@ namespace NovetusLauncher // // button22 // - this.button22.Location = new System.Drawing.Point(135, 184); + this.button22.Location = new System.Drawing.Point(97, 184); this.button22.Name = "button22"; this.button22.Size = new System.Drawing.Size(63, 25); this.button22.TabIndex = 50; @@ -451,7 +464,7 @@ namespace NovetusLauncher // // numericUpDown3 // - this.numericUpDown3.Location = new System.Drawing.Point(270, 161); + this.numericUpDown3.Location = new System.Drawing.Point(265, 160); this.numericUpDown3.Maximum = new decimal(new int[] { 256, 0, @@ -463,7 +476,7 @@ namespace NovetusLauncher 0, 0}); this.numericUpDown3.Name = "numericUpDown3"; - this.numericUpDown3.Size = new System.Drawing.Size(49, 20); + this.numericUpDown3.Size = new System.Drawing.Size(77, 20); this.numericUpDown3.TabIndex = 49; this.numericUpDown3.Value = new decimal(new int[] { 12, @@ -474,7 +487,7 @@ namespace NovetusLauncher // // numericUpDown2 // - this.numericUpDown2.Location = new System.Drawing.Point(134, 161); + this.numericUpDown2.Location = new System.Drawing.Point(97, 160); this.numericUpDown2.Maximum = new decimal(new int[] { 65535, 0, @@ -497,7 +510,7 @@ namespace NovetusLauncher // // label29 // - this.label29.Location = new System.Drawing.Point(205, 163); + this.label29.Location = new System.Drawing.Point(201, 162); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(60, 16); this.label29.TabIndex = 46; @@ -505,7 +518,7 @@ namespace NovetusLauncher // // label35 // - this.label35.Location = new System.Drawing.Point(63, 163); + this.label35.Location = new System.Drawing.Point(20, 162); this.label35.Name = "label35"; this.label35.Size = new System.Drawing.Size(65, 16); this.label35.TabIndex = 44; @@ -1530,6 +1543,7 @@ namespace NovetusLauncher private System.Windows.Forms.Button SearchButton; private System.Windows.Forms.CheckBox checkBox8; private System.Windows.Forms.Button button36; + private System.Windows.Forms.CheckBox checkBox9; //private System.Windows.Forms.CheckBox checkBox8; } } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs index 942546c..e8e4aed 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs @@ -469,6 +469,7 @@ namespace NovetusLauncher label38.Text = GlobalVars.UserConfiguration.RobloxPort.ToString(); checkBox2.Checked = GlobalVars.UserConfiguration.DiscordPresence; checkBox4.Checked = GlobalVars.UserConfiguration.UPnP; + checkBox9.Checked = GlobalVars.UserConfiguration.ShowServerNotifications; if (SecurityFuncs.IsElevated) { @@ -1332,6 +1333,11 @@ namespace NovetusLauncher { MessageBox.Show("no functionality"); } + + private void checkBox9_CheckedChanged(object sender, EventArgs e) + { + GlobalVars.UserConfiguration.ShowServerNotifications = checkBox9.Checked; + } #endregion #region Functions diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs index a0fc7a5..99e70f6 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs @@ -156,6 +156,7 @@ namespace NovetusLauncher this.panel4 = new System.Windows.Forms.Panel(); this.button35 = new System.Windows.Forms.Button(); this.UAButton = new System.Windows.Forms.Button(); + this.checkBox9 = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); @@ -650,6 +651,7 @@ namespace NovetusLauncher // // tabPage2 // + this.tabPage2.Controls.Add(this.checkBox9); this.tabPage2.Controls.Add(this.checkBox8); this.tabPage2.Controls.Add(this.label19); this.tabPage2.Controls.Add(this.textBox3); @@ -749,7 +751,7 @@ namespace NovetusLauncher 0, 0}); this.numericUpDown3.Name = "numericUpDown3"; - this.numericUpDown3.Size = new System.Drawing.Size(49, 20); + this.numericUpDown3.Size = new System.Drawing.Size(108, 20); this.numericUpDown3.TabIndex = 49; this.numericUpDown3.Value = new decimal(new int[] { 12, @@ -1463,6 +1465,17 @@ namespace NovetusLauncher this.UAButton.Size = new System.Drawing.Size(75, 23); this.UAButton.TabIndex = 0; // + // checkBox9 + // + this.checkBox9.AutoSize = true; + this.checkBox9.Location = new System.Drawing.Point(468, 180); + this.checkBox9.Name = "checkBox9"; + this.checkBox9.Size = new System.Drawing.Size(84, 17); + this.checkBox9.TabIndex = 62; + this.checkBox9.Text = "Notifications"; + this.checkBox9.UseVisualStyleBackColor = true; + this.checkBox9.CheckedChanged += new System.EventHandler(this.checkBox9_CheckedChanged); + // // LauncherFormExtended // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1628,6 +1641,7 @@ namespace NovetusLauncher private System.Windows.Forms.Button button36; private System.Windows.Forms.CheckBox checkBox8; private System.Windows.Forms.Button button37; + private System.Windows.Forms.CheckBox checkBox9; //private System.Windows.Forms.CheckBox checkBox8; } } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index 2fabdb8..c3cf6b1 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -505,6 +505,7 @@ namespace NovetusLauncher checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay; checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode; checkBox4.Checked = GlobalVars.UserConfiguration.UPnP; + checkBox9.Checked = GlobalVars.UserConfiguration.ShowServerNotifications; if (SecurityFuncs.IsElevated) { @@ -1503,6 +1504,11 @@ namespace NovetusLauncher { MessageBox.Show("no functionality"); } + + private void checkBox9_CheckedChanged(object sender, EventArgs e) + { + GlobalVars.UserConfiguration.ShowServerNotifications = checkBox9.Checked; + } #endregion #region Functions diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs index c946a34..0b38251 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs @@ -151,6 +151,7 @@ partial class ClientinfoEditor this.label9 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label10 = new System.Windows.Forms.Label(); + this.notificationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -479,7 +480,8 @@ partial class ClientinfoEditor // serverToolStripMenuItem1 // this.serverToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.limitToolStripMenuItem}); + this.limitToolStripMenuItem, + this.notificationsToolStripMenuItem}); this.serverToolStripMenuItem1.Name = "serverToolStripMenuItem1"; this.serverToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); this.serverToolStripMenuItem1.Text = "Server"; @@ -487,7 +489,7 @@ partial class ClientinfoEditor // limitToolStripMenuItem // this.limitToolStripMenuItem.Name = "limitToolStripMenuItem"; - this.limitToolStripMenuItem.Size = new System.Drawing.Size(118, 22); + this.limitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.limitToolStripMenuItem.Text = "%limit%"; this.limitToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // @@ -989,14 +991,14 @@ partial class ClientinfoEditor // donothingToolStripMenuItem // this.donothingToolStripMenuItem.Name = "donothingToolStripMenuItem"; - this.donothingToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.donothingToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.donothingToolStripMenuItem.Text = "%donothing%"; this.donothingToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // disabledToolStripMenuItem // this.disabledToolStripMenuItem.Name = "disabledToolStripMenuItem"; - this.disabledToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.disabledToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.disabledToolStripMenuItem.Text = "%disabled%"; this.disabledToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // @@ -1117,6 +1119,13 @@ partial class ClientinfoEditor this.label10.TabIndex = 33; this.label10.Text = "When applying the settings (if there is a settings XML file):"; // + // notificationsToolStripMenuItem + // + this.notificationsToolStripMenuItem.Name = "notificationsToolStripMenuItem"; + this.notificationsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.notificationsToolStripMenuItem.Text = "%notifications%"; + this.notificationsToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); + // // ClientinfoEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1269,4 +1278,5 @@ partial class ClientinfoEditor private System.Windows.Forms.ToolStripMenuItem md5sdToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem doublequoteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem disabledToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem notificationsToolStripMenuItem; } diff --git a/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.Designer.cs index 68c45ed..2def3bf 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.Designer.cs @@ -64,33 +64,36 @@ // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.newToolStripMenuItem.Text = "New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.NewToolStripMenuItemClick); // // loadToolStripMenuItem // this.loadToolStripMenuItem.Name = "loadToolStripMenuItem"; - this.loadToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.loadToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.loadToolStripMenuItem.Text = "Load"; this.loadToolStripMenuItem.Click += new System.EventHandler(this.LoadToolStripMenuItemClick); // // saveToolStripMenuItem // this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItemClick); // // saveAsTextToolStripMenuItem // this.saveAsTextToolStripMenuItem.Name = "saveAsTextToolStripMenuItem"; - this.saveAsTextToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.saveAsTextToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveAsTextToolStripMenuItem.Text = "Save as Text File"; this.saveAsTextToolStripMenuItem.Click += new System.EventHandler(this.saveAsTextFileToolStripMenuItem_Click); // // 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.Location = new System.Drawing.Point(2, 27); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(800, 423); @@ -99,6 +102,7 @@ // // label1 // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(630, 5); this.label1.Name = "label1"; @@ -108,6 +112,7 @@ // // label2 // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(729, 5); this.label2.Name = "label2"; diff --git a/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.cs b/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.cs index 347d747..0c4ad01 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.cs @@ -7,10 +7,7 @@ using System.Windows.Forms; #region Diogenes Editor public partial class DiogenesEditor : Form -{ - #region Private vars - private int diogenesFlag = 0x55; - #endregion + { #region Constructor public DiogenesEditor() @@ -30,7 +27,7 @@ using System.Windows.Forms; { using (var ofd = new OpenFileDialog()) { - ofd.Filter = "ROBLOX Diogenes filter (diogenes.fnt)|diogenes.fnt"; + ofd.Filter = "ROBLOX Diogenes filter v2 (diogenes.fnt)|diogenes.fnt|ROBLOX Diogenes filter v1 (diogenes.fnt)|diogenes.fnt"; ofd.FilterIndex = 1; ofd.FileName = "diogenes.fnt"; ofd.Title = "Load diogenes.fnt"; @@ -49,19 +46,18 @@ using System.Windows.Forms; while (!reader.EndOfStream) { string line = reader.ReadLine(); - - try + + if (ofd.FilterIndex == 1) { - line = GlobalFuncs.CryptStringWithByte(line, diogenesFlag); + line = GlobalFuncs.CryptStringWithByte(line); label2.Text = "v2"; } - catch (Exception) + else { label2.Text = "v1"; - continue; } - builder.Append(line + Environment.NewLine); + builder.Append(line + (!reader.EndOfStream ? Environment.NewLine : "")); } } } @@ -88,12 +84,18 @@ using System.Windows.Forms; { if (sfd.FilterIndex == 1) { - builder.Append(GlobalFuncs.CryptStringWithByte(s, diogenesFlag) + Environment.NewLine); + if (!string.IsNullOrWhiteSpace(s)) + { + builder.AppendLine(GlobalFuncs.CryptStringWithByte(s)); + } label2.Text = "v2"; } else { - builder.Append(s + Environment.NewLine); + if (!string.IsNullOrWhiteSpace(s)) + { + builder.AppendLine(s); + } label2.Text = "v1"; } } diff --git a/batch/dev_menu.bat b/batch/dev_menu.bat index 80d5080..154acae 100644 --- a/batch/dev_menu.bat +++ b/batch/dev_menu.bat @@ -52,6 +52,8 @@ IF %M%==4 GOTO MENU del /S Novetus\*.pdb del /S Novetus\*.log +del /s /q Novetus\clients\2007E\content\scripts\CSMPBoot.lua +del /s /q Novetus\clients\2007E-Shaders\content\scripts\CSMPBoot.lua del /s /q Novetus\clients\2007M\content\scripts\CSMPBoot.lua del /s /q Novetus\clients\2007M-Shaders\content\scripts\CSMPBoot.lua del /s /q Novetus\clients\2006S\content\scripts\CSMPBoot.lua @@ -67,6 +69,16 @@ del /s /q Novetus\clients\2006S-Shaders\OPENGL32.log del /s /q Novetus\clients\2006S-Shaders\opengl32.dll del /s /q Novetus\clients\2006S-Shaders\DefaultPreset.ini +del /s /q Novetus\clients\2007E\ReShade.ini +del /s /q Novetus\clients\2007E\OPENGL32.log +del /s /q Novetus\clients\2007E\opengl32.dll +del /s /q Novetus\clients\2007E\DefaultPreset.ini + +del /s /q Novetus\clients\2007E-Shaders\ReShade.ini +del /s /q Novetus\clients\2007E-Shaders\OPENGL32.log +del /s /q Novetus\clients\2007E-Shaders\opengl32.dll +del /s /q Novetus\clients\2007E-Shaders\DefaultPreset.ini + del /s /q Novetus\clients\2007M\ReShade.ini del /s /q Novetus\clients\2007M\OPENGL32.log del /s /q Novetus\clients\2007M\opengl32.dll diff --git a/batch/github_scripts.bat b/batch/github_scripts.bat index 09131c7..2624cf8 100644 --- a/batch/github_scripts.bat +++ b/batch/github_scripts.bat @@ -5,7 +5,8 @@ SET basedir=%CD%\scripts if not exist "%basedir%" mkdir "%basedir%" if not exist "%basedir%/2006S" mkdir "%basedir%/2006S" if not exist "%basedir%/2006S-Shaders" mkdir "%basedir%/2006S-Shaders" -if not exist "%basedir%/2007M" mkdir "%basedir%/2007E" +if not exist "%basedir%/2007E" mkdir "%basedir%/2007E" +if not exist "%basedir%/2007E-Shaders" mkdir "%basedir%/2007E-Shaders" if not exist "%basedir%/2007M" mkdir "%basedir%/2007M" if not exist "%basedir%/2007M-Shaders" mkdir "%basedir%/2007M-Shaders" if not exist "%basedir%/2008M" mkdir "%basedir%/2008M" @@ -19,6 +20,7 @@ if not exist "%basedir%/3DView" mkdir "%basedir%/3DView" XCOPY Novetus\clients\2006S\content\scripts\CSMPFunctions.lua %basedir%/2006S XCOPY Novetus\clients\2006S-Shaders\content\scripts\CSMPFunctions.lua %basedir%/2006S-Shaders XCOPY Novetus\clients\2007E\content\scripts\CSMPFunctions.lua %basedir%/2007E +XCOPY Novetus\clients\2007E-Shaders\content\scripts\CSMPFunctions.lua %basedir%/2007E-Shaders XCOPY Novetus\clients\2007M\content\scripts\CSMPFunctions.lua %basedir%/2007M XCOPY Novetus\clients\2007M-Shaders\content\scripts\CSMPFunctions.lua %basedir%/2007M-Shaders XCOPY Novetus\clients\2008M\content\scripts\CSMPFunctions.lua %basedir%/2008M diff --git a/scripts/2006S-Shaders/CSMPFunctions.lua b/scripts/2006S-Shaders/CSMPFunctions.lua index 2993d80..2606022 100644 --- a/scripts/2006S-Shaders/CSMPFunctions.lua +++ b/scripts/2006S-Shaders/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + --function made by rbxbanland function newWaitForChild(newParent,name) local returnable = nil @@ -17,6 +19,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -215,14 +220,22 @@ end print("ROBLOX Client version '0.3.512.0' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) Server = game:GetService("NetworkServer") RunService = game:GetService("RunService") PlayerService = game:GetService("Players") Server:start(Port, 20) RunService:run() + showServerNotifications = Notifications game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) @@ -232,6 +245,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") @@ -265,7 +281,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end)) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) pcall(function() game.Close:connect(function() Server:Stop() end) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) diff --git a/scripts/2006S/CSMPFunctions.lua b/scripts/2006S/CSMPFunctions.lua index 2928ca8..39dd704 100644 --- a/scripts/2006S/CSMPFunctions.lua +++ b/scripts/2006S/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + --function made by rbxbanland function newWaitForChild(newParent,name) local returnable = nil @@ -17,6 +19,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -215,14 +220,22 @@ end print("ROBLOX Client version '0.3.512.0' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) Server = game:GetService("NetworkServer") RunService = game:GetService("RunService") PlayerService = game:GetService("Players") Server:start(Port, 20) RunService:run() + showServerNotifications = Notifications game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) @@ -232,6 +245,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") @@ -265,7 +281,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end)) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) pcall(function() game.Close:connect(function() Server:Stop() end) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) diff --git a/scripts/2007E/CSMPFunctions.lua b/scripts/2007E/CSMPFunctions.lua index 4b50706..fb86e03 100644 --- a/scripts/2007E/CSMPFunctions.lua +++ b/scripts/2007E/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + --function made by rbxbanland function newWaitForChild(newParent,name) local returnable = nil @@ -17,6 +19,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -265,14 +270,22 @@ end print("ROBLOX Client version '0.3.368.0' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) Server = game:service("NetworkServer") RunService = game:service("RunService") PlayerService = game:service("Players") Server:start(Port, 20) RunService:run() + showServerNotifications = Notifications game.Workspace:insertContent("rbxasset://Fonts//libraries.rbxm") - PlayerService.maxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.maxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:service("Players"):createLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.maxPlayers = PlayerLimit + end PlayerService.ChildAdded:connect(function(Player) Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) @@ -282,6 +295,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") @@ -315,7 +331,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end)) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) pcall(function() game.Close:connect(function() Server:stop() end) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) @@ -330,9 +349,9 @@ function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,He InitalizeSecurityValues(player,ClientEXEMD5,LauncherMD5,ClientScriptMD5) InitalizeTripcode(player,Tripcode) player:SetSuperSafeChat(false) - player:SetAdminMode(true) pcall(function() player:SetUnder13(false) end) pcall(function() player:SetAccountAge(365) end) + player:SetAdminMode(true) pcall(function() player.Name=PlayerName or "" end) game:service("Visit"):setUploadUrl("") InitalizeClientAppearance(player,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) diff --git a/scripts/2007M-Shaders/CSMPFunctions.lua b/scripts/2007M-Shaders/CSMPFunctions.lua index 8fce363..7da2f6b 100644 --- a/scripts/2007M-Shaders/CSMPFunctions.lua +++ b/scripts/2007M-Shaders/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + --function made by rbxbanland function newWaitForChild(newParent,name) local returnable = nil @@ -17,6 +19,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -311,14 +316,22 @@ end print("ROBLOX Client version '0.3.512.0' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) Server = game:GetService("NetworkServer") RunService = game:GetService("RunService") PlayerService = game:GetService("Players") Server:start(Port, 20) RunService:run() + showServerNotifications = Notifications game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) @@ -328,6 +341,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") @@ -361,7 +377,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end)) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) pcall(function() game.Close:connect(function() Server:stop() end) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) diff --git a/scripts/2007M/CSMPFunctions.lua b/scripts/2007M/CSMPFunctions.lua index 1a49d13..d403eb0 100644 --- a/scripts/2007M/CSMPFunctions.lua +++ b/scripts/2007M/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + --function made by rbxbanland function newWaitForChild(newParent,name) local returnable = nil @@ -17,6 +19,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -311,14 +316,22 @@ end print("ROBLOX Client version '0.3.512.0' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) Server = game:GetService("NetworkServer") RunService = game:GetService("RunService") PlayerService = game:GetService("Players") Server:start(Port, 20) RunService:run() + showServerNotifications = Notifications game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) @@ -328,6 +341,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") @@ -361,7 +377,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end)) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) pcall(function() game.Close:connect(function() Server:stop() end) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) diff --git a/scripts/2008M/CSMPFunctions.lua b/scripts/2008M/CSMPFunctions.lua index 69228ce..bc51d9b 100644 --- a/scripts/2008M/CSMPFunctions.lua +++ b/scripts/2008M/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + --function made by rbxbanland function newWaitForChild(newParent,name) local returnable = nil @@ -17,6 +19,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -403,14 +408,22 @@ end rbxversion = version() print("ROBLOX Client version '" .. rbxversion .. "' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) Server = game:GetService("NetworkServer") RunService = game:GetService("RunService") Server:start(Port, 20) RunService:run() + showServerNotifications = Notifications game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") PlayerService = game:GetService("Players") - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) @@ -420,6 +433,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") @@ -451,7 +467,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) pcall(function() game.Close:connect(function() Server:Stop() end) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) @@ -542,11 +561,18 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, InitalizeClientAppearance(plr,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") - while true do wait() - if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then - wait(5) - plr:LoadCharacter() - LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) + while true do + wait(0.001) + if (plr.Character ~= nil) then + if (plr.Character:findFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then + wait(5) + plr:LoadCharacter() + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + elseif (plr.Character.Parent == nil) then + wait(5) + plr:LoadCharacter() -- to make sure nobody is deleted. + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + end end end end diff --git a/scripts/2009E/CSMPFunctions.lua b/scripts/2009E/CSMPFunctions.lua index 550ca8b..b1cb8dd 100644 --- a/scripts/2009E/CSMPFunctions.lua +++ b/scripts/2009E/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + --function made by rbxbanland function newWaitForChild(newParent,name) local returnable = nil @@ -17,6 +19,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -463,14 +468,22 @@ end rbxversion = version() print("ROBLOX Client version '" .. rbxversion .. "' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) Server = game:GetService("NetworkServer") RunService = game:GetService("RunService") Server:start(Port, 20) RunService:run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") + showServerNotifications = Notifications PlayerService = game:GetService("Players") - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) print(Player.Name.."; "..msg) @@ -480,6 +493,9 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() LoadSecurity(newWaitForChildSecurity(Player,"Security"),Player,game.Lighting) newWaitForChildSecurity(Player,"Tripcode") @@ -511,7 +527,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) pcall(function() game.Close:connect(function() Server:Stop() end) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) @@ -614,11 +633,18 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, InitalizeClientAppearance(plr,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") - while true do wait() - if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then - wait(5) - plr:LoadCharacter() - LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) + while true do + wait(0.001) + if (plr.Character ~= nil) then + if (plr.Character:findFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then + wait(5) + plr:LoadCharacter() + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + elseif (plr.Character.Parent == nil) then + wait(5) + plr:LoadCharacter() -- to make sure nobody is deleted. + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + end end end end diff --git a/scripts/2009L/CSMPFunctions.lua b/scripts/2009L/CSMPFunctions.lua index 481d076..27f62e3 100644 --- a/scripts/2009L/CSMPFunctions.lua +++ b/scripts/2009L/CSMPFunctions.lua @@ -1,3 +1,4 @@ +showServerNotifications = true pcall(function() game:GetService("ScriptContext").ScriptsDisabled = false end) --function made by rbxbanland @@ -19,6 +20,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -467,19 +471,30 @@ end rbxversion = version() print("ROBLOX Client version '" .. rbxversion .. "' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) assert((type(Port)~="number" or tonumber(Port)~=nil or Port==nil),"CSRun Error: Port must be nil or a number.") local NetworkServer=game:GetService("NetworkServer") local RunService = game:GetService("RunService") local PlayerService = game:GetService("Players") + showServerNotifications = Notifications pcall(NetworkServer.Stop,NetworkServer) NetworkServer:Start(Port) - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() end @@ -513,7 +528,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") @@ -638,11 +656,18 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, InitalizeClientAppearance(plr,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,ItemID) LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") - while true do wait() - if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then - wait(5) - plr:LoadCharacter() - LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) + while true do + wait(0.001) + if (plr.Character ~= nil) then + if (plr.Character:findFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then + wait(5) + plr:LoadCharacter() + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + elseif (plr.Character.Parent == nil) then + wait(5) + plr:LoadCharacter() -- to make sure nobody is deleted. + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + end end end end diff --git a/scripts/2010L/CSMPFunctions.lua b/scripts/2010L/CSMPFunctions.lua index d9a66bd..e0a2c68 100644 --- a/scripts/2010L/CSMPFunctions.lua +++ b/scripts/2010L/CSMPFunctions.lua @@ -1,3 +1,4 @@ +showServerNotifications = true pcall(function() game:GetService("ScriptContext").ScriptsDisabled = false end) --function made by rbxbanland @@ -19,6 +20,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -467,19 +471,30 @@ end rbxversion = version() print("ROBLOX Client version '" .. rbxversion .. "' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) assert((type(Port)~="number" or tonumber(Port)~=nil or Port==nil),"CSRun Error: Port must be nil or a number.") local NetworkServer=game:GetService("NetworkServer") local RunService = game:GetService("RunService") local PlayerService = game:GetService("Players") + showServerNotifications = Notifications pcall(NetworkServer.Stop,NetworkServer) NetworkServer:Start(Port) - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() end @@ -513,7 +528,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") @@ -640,11 +658,18 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, newWaitForChild(game.StarterGui, "Health") game.StarterGui.Health:clone().Parent = plr.PlayerGui game:GetService("Visit"):SetUploadUrl("") - while true do wait() - if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then - wait(5) - plr:LoadCharacter() - LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) + while true do + wait(0.001) + if (plr.Character ~= nil) then + if (plr.Character:findFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then + wait(5) + plr:LoadCharacter() + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + elseif (plr.Character.Parent == nil) then + wait(5) + plr:LoadCharacter() -- to make sure nobody is deleted. + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + end end end end diff --git a/scripts/2011E/CSMPFunctions.lua b/scripts/2011E/CSMPFunctions.lua index 2105547..bddc741 100644 --- a/scripts/2011E/CSMPFunctions.lua +++ b/scripts/2011E/CSMPFunctions.lua @@ -4,6 +4,8 @@ game:GetService("CoreGui").DescendantAdded:connect(function(Child) end end) +showServerNotifications = true + coroutine.resume(coroutine.create(function() while not game:GetService("CoreGui"):FindFirstChild("RobloxGui") do game:GetService("CoreGui").ChildAdded:wait() end game:GetService("CoreGui").RobloxGui.TopLeftControl:Remove() @@ -35,6 +37,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -484,19 +489,30 @@ end rbxversion = version() print("ROBLOX Client version '" .. rbxversion .. "' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) assert((type(Port)~="number" or tonumber(Port)~=nil or Port==nil),"CSRun Error: Port must be nil or a number.") local NetworkServer=game:GetService("NetworkServer") local RunService = game:GetService("RunService") local PlayerService = game:GetService("Players") + showServerNotifications = Notifications pcall(NetworkServer.Stop,NetworkServer) NetworkServer:Start(Port) - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() end @@ -525,7 +541,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") @@ -669,15 +688,20 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") newWaitForChild(game.StarterGui, "Dialogs") - newWaitForChild(game.StarterGui, "Health") game.StarterGui.Dialogs:clone().Parent = plr.PlayerGui - game.StarterGui.Health:clone().Parent = plr.PlayerGui game:GetService("Visit"):SetUploadUrl("") - while true do wait() - if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then - wait(5) - plr:LoadCharacter() - LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) + while true do + wait(0.001) + if (plr.Character ~= nil) then + if (plr.Character:findFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then + wait(5) + plr:LoadCharacter() + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + elseif (plr.Character.Parent == nil) then + wait(5) + plr:LoadCharacter() -- to make sure nobody is deleted. + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + end end end end diff --git a/scripts/2011M/CSMPFunctions.lua b/scripts/2011M/CSMPFunctions.lua index e2cdb8f..9fe06a0 100644 --- a/scripts/2011M/CSMPFunctions.lua +++ b/scripts/2011M/CSMPFunctions.lua @@ -1,3 +1,5 @@ +showServerNotifications = true + game:GetService("CoreGui").DescendantAdded:connect(function(Child) if (Child:IsA("BaseScript")) and (Child.Name~="SubMenuBuilder") and (Child.Name~="ToolTipper") and (Child.Name~="MainBotChatScript") then Child:Remove() @@ -26,6 +28,9 @@ function KickPlayer(Player,reason) wait(2) Player:remove() print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' kicked. Reason: "..reason) + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' was kicked. Reason: "..reason) + end end end @@ -475,19 +480,30 @@ end rbxversion = version() print("ROBLOX Client version '" .. rbxversion .. "' loaded.") -function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) +function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Notifications) assert((type(Port)~="number" or tonumber(Port)~=nil or Port==nil),"CSRun Error: Port must be nil or a number.") local NetworkServer=game:GetService("NetworkServer") local RunService = game:GetService("RunService") local PlayerService = game:GetService("Players") + showServerNotifications = Notifications pcall(NetworkServer.Stop,NetworkServer) NetworkServer:Start(Port) - PlayerService.MaxPlayers = PlayerLimit + if (showServerNotifications) then + PlayerService.MaxPlayers = PlayerLimit + 1 + --create a fake player to record connections and disconnections + notifyPlayer = game:GetService("Players"):CreateLocalPlayer(-1) + notifyPlayer.Name = "[SERVER]" + else + PlayerService.MaxPlayers = PlayerLimit + end PlayerService.PlayerAdded:connect(function(Player) if (PlayerService.NumPlayers > PlayerService.MaxPlayers) then KickPlayer(Player, "Too many players on server.") else print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' added") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' joined") + end Player:LoadCharacter() end @@ -516,7 +532,10 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5) end) end) PlayerService.PlayerRemoving:connect(function(Player) - print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + print("Player '" .. Player.Name .. "' with ID '" .. Player.userId .. "' leaving") + if (showServerNotifications) then + game.Players:Chat("Player '" .. Player.Name .. "' left") + end end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") @@ -662,19 +681,24 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") newWaitForChild(game.StarterGui, "Dialogs") - newWaitForChild(game.StarterGui, "Health") - newWaitForChild(game.StarterGui, "Playerlist") - newWaitForChild(game.StarterGui, "Backpack") game.StarterGui.Dialogs:clone().Parent = plr.PlayerGui - game.StarterGui.Health:clone().Parent = plr.PlayerGui + newWaitForChild(game.StarterGui, "Playerlist") game.StarterGui.Playerlist:clone().Parent = plr.PlayerGui + newWaitForChild(game.StarterGui, "Backpack") game.StarterGui.Backpack:clone().Parent = plr.PlayerGui game:GetService("Visit"):SetUploadUrl("") - while true do wait() - if (plr.Character:FindFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then - wait(5) - plr:LoadCharacter() - LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) + while true do + wait(0.001) + if (plr.Character ~= nil) then + if (plr.Character:findFirstChild("Humanoid") and (plr.Character.Humanoid.Health == 0)) then + wait(5) + plr:LoadCharacter() + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + elseif (plr.Character.Parent == nil) then + wait(5) + plr:LoadCharacter() -- to make sure nobody is deleted. + LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character) + end end end end