Skip to content

Commit

Permalink
backwards compatibility with old fightcade games.json for launching, …
Browse files Browse the repository at this point in the history
…looks in directory for existing lst to be safe
  • Loading branch information
blueminder committed Jun 30, 2020
1 parent 7167622 commit 4744a6c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NullDC-NAOMI Netplay Launcher Distribution 0.6.5.3
# NullDC-NAOMI Netplay Launcher Distribution 0.6.5.4
Configuration optimized by blueminder *(June 30, 2020)*

**Special Thanks**
Expand Down
27 changes: 23 additions & 4 deletions nullDCNetplayLauncher/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,28 @@ public static String GetRomPathFromGameId(string gameid)
var GamesJsonTxt = File.ReadAllText(GameJsonPath);

var GamesJson = JsonConvert.DeserializeObject<List<Launcher.Game>>(GamesJsonTxt);
var games = GamesJson.Where(g => g.ID == $"nulldc_{gameid}");
var games = GamesJson.Where(g => g.ID == $"nulldc_{gameid}" || g.GameID == $"nulldc_{gameid}");

if (games.Count() > 0)
{
var lst = games.First().Assets.Where(a => a.LocalName().EndsWith(".lst")).First();
path = Path.Combine(Launcher.rootDir, DistroDir, games.First().Root, games.First().Name, lst.LocalName());
if (games.First().Name.Contains("\\"))
{
var entry = games.First().Name.Split(new[] { "\\" }, StringSplitOptions.None);
var folder = entry[0];
var lst = entry[1];

var full_folder_path = Path.Combine(Launcher.rootDir, DistroDir, "roms", folder);
path = Path.Combine(full_folder_path, lst);

if (!File.Exists(path))
path = full_folder_path;
}
else
{
var lst = games.First().Assets.Where(a => a.LocalName().EndsWith(".lst")).First();
path = Path.Combine(Launcher.rootDir, DistroDir, games.First().Root, games.First().Name, lst.LocalName());
}

}

if (!File.Exists(path))
Expand Down Expand Up @@ -818,6 +834,9 @@ public static void RestoreNullDcFresh(bool force = false)

public class Game
{
[JsonProperty("gameid")]
public string GameID { get; set; }

[JsonProperty("id")]
public string ID { get; set; }

Expand All @@ -832,7 +851,7 @@ public class Game

[JsonProperty("root")]
public string Root { get; set; }

}

public class Asset
Expand Down
4 changes: 2 additions & 2 deletions nullDCNetplayLauncher/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 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("0.6.5.3")]
[assembly: AssemblyFileVersion("0.6.5.3")]
[assembly: AssemblyVersion("0.6.5.4")]
[assembly: AssemblyFileVersion("0.6.5.4")]
4 changes: 2 additions & 2 deletions nullDCNetplayLauncher/Resources/README.html

Large diffs are not rendered by default.

Binary file modified setup_demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4744a6c

Please sign in to comment.