From c63fa210d99ea67b75c2889611de737919a68eb7 Mon Sep 17 00:00:00 2001 From: Rei Date: Fri, 12 Nov 2021 22:48:44 -0500 Subject: [PATCH 1/3] .NET Framework to .NET Core Migration FNFDataAPI has been converted to use .NET Core instead of .NET Framework, allowing the API to be utilized in AOT applications, such as WebGL and IL2CPP in the Unity Engine. Also a .gitignore to remove temp files. --- .gitignore | 388 ++++++++++++++++++ FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj | 72 +--- FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj.old | 62 +++ .../FNFDataAPITests/FNFDataAPITests.csproj | 69 +--- .../FNFDataAPITests.csproj.old | 59 +++ 5 files changed, 529 insertions(+), 121 deletions(-) create mode 100644 .gitignore create mode 100644 FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj.old create mode 100644 FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj.old diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..976661b --- /dev/null +++ b/.gitignore @@ -0,0 +1,388 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Nuget personal access tokens and Credentials +# nuget.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +.idea/ +*.sln.iml \ No newline at end of file diff --git a/FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj b/FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj index 0ab3286..9017d26 100644 --- a/FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj +++ b/FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj @@ -1,62 +1,10 @@ - - - - - Debug - AnyCPU - {92B6EAF5-F48B-4EA6-BBE6-EFB03D3B5C59} - Library - Properties - FNFDataAPI - FNFDataAPI - v4.7.2 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - True - - - - - - - - - - - - - - - - - - - + + + netstandard2.0 + Library + false + + + + + \ No newline at end of file diff --git a/FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj.old b/FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj.old new file mode 100644 index 0000000..99a441f --- /dev/null +++ b/FNFDataAPI/FNFDataAPI/FNFDataAPI.csproj.old @@ -0,0 +1,62 @@ + + + + + Debug + AnyCPU + {92B6EAF5-F48B-4EA6-BBE6-EFB03D3B5C59} + Library + Properties + FNFDataAPI + FNFDataAPI + v4.7.2 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + True + + + + + + + + + + + + + + + + + + + diff --git a/FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj b/FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj index 285ccad..cd63f40 100644 --- a/FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj +++ b/FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj @@ -1,59 +1,10 @@ - - - - - Debug - AnyCPU - {FBB66A59-9108-4E4B-B220-4F154BAD595B} - Exe - Properties - FNFDataAPITests - FNFDataAPITests - v4.7.2 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - {92b6eaf5-f48b-4ea6-bbe6-efb03d3b5c59} - FNFDataAPI - - - - - - + + + net5.0 + Exe + false + + + + + \ No newline at end of file diff --git a/FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj.old b/FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj.old new file mode 100644 index 0000000..c0159c7 --- /dev/null +++ b/FNFDataAPI/FNFDataAPITests/FNFDataAPITests.csproj.old @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {FBB66A59-9108-4E4B-B220-4F154BAD595B} + Exe + Properties + FNFDataAPITests + FNFDataAPITests + v4.7.2 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + {92b6eaf5-f48b-4ea6-bbe6-efb03d3b5c59} + FNFDataAPI + + + + + + From 0af12fe137229bc9202e5bc00a451270fea1eb0a Mon Sep 17 00:00:00 2001 From: Rei Date: Fri, 12 Nov 2021 23:03:56 -0500 Subject: [PATCH 2/3] Add functionality to load charts by pure string The FNFSong class has been modified to permit construction of itself using a string on its own that is passed into the constructor, as long as you tell it to load it "AsRawJson". This is useful when you can't have a compiled application reading external files but still want to have to construct a FNFSong class. --- .../FNFDataAPI/FridayNightFunkin/FNFSong.cs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/FNFDataAPI/FNFDataAPI/FridayNightFunkin/FNFSong.cs b/FNFDataAPI/FNFDataAPI/FridayNightFunkin/FNFSong.cs index 12d7a8e..a279c2e 100644 --- a/FNFDataAPI/FNFDataAPI/FridayNightFunkin/FNFSong.cs +++ b/FNFDataAPI/FNFDataAPI/FridayNightFunkin/FNFSong.cs @@ -46,10 +46,18 @@ public string Player2 get => dataRoot.song.Player2; set => dataRoot.song.Player2 = value; } - - public FNFSong(string songPath) + + public FNFSong(string data, DataReadType dataReadType = DataReadType.AsLocalFile) { - dataRoot= JsonConvert.DeserializeObject(File.ReadAllText(songPath)); + switch (dataReadType) + { + case DataReadType.AsLocalFile: + dataRoot = JsonConvert.DeserializeObject(File.ReadAllText(data)); + break; + case DataReadType.AsRawJson: + dataRoot = JsonConvert.DeserializeObject(data); + break; + } Sections = new List(); foreach (Note n in dataRoot.song.Notes) { @@ -57,6 +65,12 @@ public FNFSong(string songPath) } } + public enum DataReadType + { + AsLocalFile, + AsRawJson + } + public void SaveSong(string savePath) { Console.WriteLine("Compiling song..."); From 1a027bbd9e832a4cd19fa4add613394653a157b4 Mon Sep 17 00:00:00 2001 From: Rei Date: Fri, 12 Nov 2021 23:15:42 -0500 Subject: [PATCH 3/3] FNFDataAPITests updated It now asks if the first string is a directory or straight JSON. --- FNFDataAPI/FNFDataAPITests/Program.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/FNFDataAPI/FNFDataAPITests/Program.cs b/FNFDataAPI/FNFDataAPITests/Program.cs index 3dce66f..f88ea28 100644 --- a/FNFDataAPI/FNFDataAPITests/Program.cs +++ b/FNFDataAPI/FNFDataAPITests/Program.cs @@ -8,12 +8,21 @@ internal class Program { public static void Main(string[] args) { - Console.WriteLine("Song Directory:"); - string dir = Console.ReadLine(); + Console.WriteLine("Song Data or Directory:"); + string data = Console.ReadLine(); + Console.WriteLine("Is this a directory (1) or JSON data (2)?"); + string option = Console.ReadLine(); Console.WriteLine("TEST 1 - LOADING"); try { - FNFSong song = new FNFSong(dir); + FNFSong song; + if (option == "1") + song = new FNFSong(data); + else + song = new FNFSong(data, FNFSong.DataReadType.AsRawJson); + //It would have been an "if option == 2" but it has to be an "else" or + //else the compiler flips its shit. + Console.WriteLine("Song Name: " + song.SongName); Console.WriteLine("Song BPM: " + song.Bpm); Console.WriteLine("Song Speed: " + song.Speed);