Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ private static ParsedRomLocationDetails GetParsedLocationDetails(byte[] rom, Loc
var itemNumber = BitConverter.ToInt16(bytes, 2);
var ownerPlayerId = BitConverter.ToInt16(bytes, 4);
var archipelagoFlags = BitConverter.ToInt16(bytes, 6);
playerName = playerNames[ownerPlayerId];
if (ownerPlayerId < playerNames.Count)
{
playerName = playerNames[ownerPlayerId];
}
else
{
playerName = $"Player {ownerPlayerId}";
}
isProgression = archipelagoFlags > 0;

if (!isLocal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ public static string GetGameTitle(byte[] rom)
public static List<string> GetPlayerNames(byte[] rom)
{
var toReturn = new List<string>();
for (var i = 0; i < 128; i++)
for (var i = 0; i < 256; i++)
{
var nameBytes = rom.Skip(s_addrPlayerNames + i * 16).Take(16).ToArray();
var name = Encoding.ASCII.GetString(nameBytes);
if (name == "123456789012\0\0\0\0")
var name = Encoding.ASCII.GetString(nameBytes).Replace("\0", string.Empty).Trim();
if (name == "123456789012" || string.IsNullOrEmpty(name))
{
break;
}
toReturn.Add(name.Replace("\0", string.Empty).Trim());

toReturn.Add(name);
}

return toReturn;
Expand Down
5 changes: 4 additions & 1 deletion src/TrackerCouncil.Smz3.UI/Services/SoloRomListService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -165,8 +166,10 @@ public async Task LaunchTracker(GeneratedRomViewModel rom)

public async Task<bool> OpenArchipelagoModeAsync()
{

var userFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var storageItem = await CrossPlatformTools.OpenFileDialogAsync(ParentWindow, FileInputControlType.OpenFile,
"Rom file (*.sfc)|*.sfc|All files (*.*)|*.*", "/home/matt/Games/Randomizers/Archipelago");
"Rom file (*.sfc)|*.sfc|All files (*.*)|*.*", userFolder);

var pathString = storageItem?.TryGetLocalPath();

Expand Down