diff --git a/NovetusLauncher/.vs/NovetusLauncher/v14/.suo b/NovetusLauncher/.vs/NovetusLauncher/v14/.suo index 489a33c..c2d1e59 100644 Binary files a/NovetusLauncher/.vs/NovetusLauncher/v14/.suo and b/NovetusLauncher/.vs/NovetusLauncher/v14/.suo differ diff --git a/NovetusLauncher/NovetusFuncs/GlobalVars.cs b/NovetusLauncher/NovetusFuncs/GlobalVars.cs index b00c8e7..a13d1ee 100644 --- a/NovetusLauncher/NovetusFuncs/GlobalVars.cs +++ b/NovetusLauncher/NovetusFuncs/GlobalVars.cs @@ -19,6 +19,7 @@ public static class GlobalVars public static readonly string ConfigDir = BasePath + "\\config"; public static readonly string ClientDir = BasePath + "\\clients"; public static readonly string MapsDir = BasePath + "\\maps"; + //customization public static readonly string CustomPlayerDir = DataPath + "\\charcustom"; public static readonly string hatdir = CustomPlayerDir + "\\hats"; public static readonly string facedir = CustomPlayerDir + "\\faces"; @@ -27,6 +28,12 @@ public static class GlobalVars public static readonly string shirtdir = CustomPlayerDir + "\\shirts"; public static readonly string pantsdir = CustomPlayerDir + "\\pants"; public static readonly string extradir = CustomPlayerDir + "\\custom"; + //asset cache + public static readonly string AssetCacheDir = DataPath + "\\assetcache"; + public static readonly string AssetCacheDirSky = AssetCacheDir + "\\sky"; + public static readonly string AssetCacheDirFonts = AssetCacheDir + "\\fonts"; + public static readonly string AssetCacheDirSounds = AssetCacheDir + "\\sounds"; + public static readonly string AssetCacheDirTextures = AssetCacheDir + "\\textures"; public static string IP = "localhost"; public static string Version = ""; public static string SharedArgs = ""; diff --git a/NovetusTest_RobloxXMLFileParser/.vs/NovetusTest_RobloxXMLFileParser/v14/.suo b/NovetusTest_RobloxXMLFileParser/.vs/NovetusTest_RobloxXMLFileParser/v14/.suo new file mode 100644 index 0000000..f8db15e Binary files /dev/null and b/NovetusTest_RobloxXMLFileParser/.vs/NovetusTest_RobloxXMLFileParser/v14/.suo differ diff --git a/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser.sln b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser.sln new file mode 100644 index 0000000..4a5a487 --- /dev/null +++ b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NovetusTest_RobloxXMLFileParser", "NovetusTest_RobloxXMLFileParser\NovetusTest_RobloxXMLFileParser.csproj", "{30A2FB06-2B19-45E3-83D1-D7A121BC6567}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {30A2FB06-2B19-45E3-83D1-D7A121BC6567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30A2FB06-2B19-45E3-83D1-D7A121BC6567}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30A2FB06-2B19-45E3-83D1-D7A121BC6567}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30A2FB06-2B19-45E3-83D1-D7A121BC6567}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/App.config b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser.csproj b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser.csproj new file mode 100644 index 0000000..4e35b0f --- /dev/null +++ b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser.csproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + {30A2FB06-2B19-45E3-83D1-D7A121BC6567} + Exe + Properties + NovetusTest_RobloxXMLFileParser + NovetusTest_RobloxXMLFileParser + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/Program.cs b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/Program.cs new file mode 100644 index 0000000..5b4a16b --- /dev/null +++ b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/Program.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NovetusTest_RobloxXMLFileParser +{ + class Program + { + static void Main(string[] args) + { + string path = @"G:\Projects\Novetus\Novetus\maps\2012\2012 - Iron Cafe.rbxl"; + + Console.WriteLine("Meshes"); + RobloxXMLParser.SearchNodes(path, "SpecialMesh", "MeshId"); + + Console.WriteLine("Mesh Textures"); + RobloxXMLParser.SearchNodes(path, "SpecialMesh", "TextureId"); + + Console.WriteLine("Decals"); + RobloxXMLParser.SearchNodes(path, "Decal", "Texture"); + + Console.WriteLine("SkyboxBk"); + RobloxXMLParser.SearchNodes(path, "Sky", "SkyboxBk"); + + Console.WriteLine("SkyboxDn"); + RobloxXMLParser.SearchNodes(path, "Sky", "SkyboxDn"); + + Console.WriteLine("SkyboxFt"); + RobloxXMLParser.SearchNodes(path, "Sky", "SkyboxFt"); + + Console.WriteLine("SkyboxRt"); + RobloxXMLParser.SearchNodes(path, "Sky", "SkyboxRt"); + + Console.WriteLine("SkyboxUp"); + RobloxXMLParser.SearchNodes(path, "Sky", "SkyboxUp"); + + Console.WriteLine("HopperBins"); + RobloxXMLParser.SearchNodes(path, "HopperBin", "TextureId"); + + Console.WriteLine("Tools"); + RobloxXMLParser.SearchNodes(path, "Tool", "TextureId"); + + Console.WriteLine("Sounds"); + RobloxXMLParser.SearchNodes(path, "Sound", "SoundId"); + + Console.WriteLine(path + " parsed."); + Console.ReadLine(); + } + } +} diff --git a/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/Properties/AssemblyInfo.cs b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bb7b798 --- /dev/null +++ b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NovetusTest_RobloxXMLFileParser")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NovetusTest_RobloxXMLFileParser")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("30a2fb06-2b19-45e3-83d1-d7a121bc6567")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/RobloxXMLParser.cs b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/RobloxXMLParser.cs new file mode 100644 index 0000000..bcb9753 --- /dev/null +++ b/NovetusTest_RobloxXMLFileParser/NovetusTest_RobloxXMLFileParser/RobloxXMLParser.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Xml; +using System.Xml.Linq; + +public class RobloxXMLParser +{ + public static void SearchNodes(string path, string itemClassValue, string itemIdValue) + { + try + { + string oldfile = File.ReadAllText(path); + string fixedfile = RemoveInvalidXmlChars(ReplaceHexadecimalSymbols(oldfile)); + Console.WriteLine("Valid: " + CheckValidXmlChars(fixedfile)); + XDocument doc = XDocument.Parse(fixedfile); + + var v = from nodes in doc.Descendants("Item") + where nodes.Attribute("class").Value == itemClassValue + select nodes; + + foreach (var item in v) + { + var v2 = from nodes in item.Descendants("Content") + where nodes.Attribute("name").Value == itemIdValue + select nodes; + + foreach (var item2 in v2) + { + var v3 = from nodes in item2.Descendants("url") + select nodes; + + foreach (var item3 in v3) + { + if (!item3.Value.Contains("rbxasset")) + { + //do whatever with your value + if (item3.Value.Contains('=')) + { + string[] substrings = item3.Value.Split('='); + + if (!string.IsNullOrWhiteSpace(substrings[1])) + { + Console.WriteLine(item3.Value); + Console.WriteLine("ID: " + substrings[1]); + } + } + } + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + + public static string RemoveInvalidXmlChars(string content) + { + return new string(content.Where(ch => System.Xml.XmlConvert.IsXmlChar(ch)).ToArray()); + } + + static string ReplaceHexadecimalSymbols(string txt) + { + string r = "[\x00-\x08\x0B\x0C\x0E-\x1F\x26]"; + return Regex.Replace(txt, r, "", RegexOptions.Compiled); + } + + public static bool CheckValidXmlChars(string content) + { + return content.All(ch => System.Xml.XmlConvert.IsXmlChar(ch)); + } +}