From 958d6478326a83d5d48007be37b3160186532064 Mon Sep 17 00:00:00 2001 From: Bitl Date: Wed, 15 Sep 2021 08:39:13 -0700 Subject: [PATCH] implement more super safe chat options. fix file copy --- .../StorageAndFunctions/GlobalFuncs.cs | 23 ++++++++++++++++--- changelog.txt | 8 ++++--- safechat.xml | 6 ++--- scripts/launcher/splashes.txt | 4 +++- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs index 7897069..ea1d0e8 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs @@ -617,6 +617,9 @@ public class GlobalFuncs public static void FixedFileMove(string src, string dest, bool overwrite, bool overwritewarning = false) { + if (src.Equals(dest)) + return; + if (!File.Exists(dest)) { File.SetAttributes(src, FileAttributes.Normal); @@ -1885,18 +1888,32 @@ public class GlobalFuncs return foundFiles.ToArray(); } - - //https://stackoverflow.com/questions/66667263/i-want-to-remove-special-characters-from-file-name-without-affecting-extension-i //https://stackoverflow.com/questions/3218910/rename-a-file-in-c-sharp + + public static bool FileHasInvalidChars(string path) + { + string fileName = Path.GetFileName(path); + + if (Regex.Match(fileName, @"[^\w-.'_! ]") != Match.Empty) + { + return true; + } + + return false; + } + public static void RenameFileWithInvalidChars(string path) { + if (!FileHasInvalidChars(path)) + return; + string pathWithoutFilename = Path.GetDirectoryName(path); string fileName = Path.GetFileName(path); fileName = Regex.Replace(fileName, @"[^\w-.'_! ]", ""); string finalPath = pathWithoutFilename + "\\" + fileName; - FixedFileMove(path, finalPath, true); + FixedFileMove(path, finalPath, false); } #if LAUNCHER || CMD || URI diff --git a/changelog.txt b/changelog.txt index 1415a01..a1b82ab 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,12 +2,14 @@ Changes from 1.3 Pre-Release 4: - Improved logging even further. - Fixed issues with moving files. -- Fixed up downloading. -- Fixed the files of the White Cowboy Hat not being available. +- Fixed up downloading in the Asset SDK. +- Fixed the files of the White/Brown Cowboy Hat not being available. - Added the ability to change hat and head vertex colors in the Item Creation SDK. - Redesigned the Item Creation SDK. - Fixed a bug where the client SDK won't go to default settings. -- Added "%args%" as the default clientscript example. +- Added "%args%" as the default ClientScript example. +- Improved the Green Screen map. +- Added more options to the Super Safe Chat menu. - Added more items (details in full changelog) Changes from 1.2.4.1: - The OBJ2MeshV1GUI, The Asset Localizer, and the Item SDK have been merged to form the Asset SDK! diff --git a/safechat.xml b/safechat.xml index 6c3f370..449238f 100644 --- a/safechat.xml +++ b/safechat.xml @@ -160,7 +160,7 @@ Age RugratKidTweenTeenTwentiesOldAncientMesozoicI don't want to say my age. Don't ask. Mood - GoodGreat!Not badSadHyperChillHappyKind of madBoyGirlManWomanTransgender ManTransgender WomanGayLesbianTransgenderBisexualPansexualNon-BinaryGender-Fluent + GoodGreat!Not badSadHyperChillHappyKind of madI go by...Pronounshe/himshe/herthey/themit/itsxe/xem/xyrze/zir/zirsze/hir/hirsey/em/eirfae/faer/faersany pronounsother pronounsIdentitiesBoyGirlManWomanLGBTQ+TransgenderTransgender ManTransgender WomanQueerGayLesbianBisexualPansexualAcesexualAsexualNon-BinaryGenderfluidAllyHeterosexual AllyCisgender Ally Game Let's buildLet's battleNice one!So far so good!Lucky shot!Oh man!I challenge you to a fight!Help me with thisLet's go to your gameCan you show me how do to that?Backflip!Frontflip!Dance!I'm on your side! @@ -173,10 +173,10 @@ i r teh pwnz0r!w00t!z0mg h4x!ub3rR0xXorzage!all your base are belong to me! Yes - Absolutely!Rock on!Totally!Juice!Yay!Yesh + Absolutely!Rock on!Totally!Juice!Yay!YeshIndeed No - Ummm. No....Stop!Go away!Don't do thatStop breaking the rulesI don't want to + Ummm. No....Stop!Go away!Don't do thatStop breaking the rulesI don't want toI decline! Ok Well... okSure diff --git a/scripts/launcher/splashes.txt b/scripts/launcher/splashes.txt index e354bb1..3d0ca29 100644 --- a/scripts/launcher/splashes.txt +++ b/scripts/launcher/splashes.txt @@ -136,4 +136,6 @@ NOVETUS 2.0 WHEN?? Originally known as RBXLegacy 2.0! Do you like waffles? NYAN CAT! -Been watching =3 until 2 AM. \ No newline at end of file +Been watching =3 until 2 AM. +GETOUTOFMYHEADGETOUTOFMYHEADGETOUTOFMYHEADGETOUTOFMYHEADGETOUTOFMYHEAD +Holy shit, is that a Novetus reference? \ No newline at end of file