mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using Bloxstrap.RobloxInterfaces;
|
|
|
|
namespace Bloxstrap.Models.Manifest
|
|
{
|
|
public class FileManifest : List<ManifestFile>
|
|
{
|
|
private FileManifest(string data)
|
|
{
|
|
using StringReader reader = new StringReader(data);
|
|
|
|
while (true)
|
|
{
|
|
string? fileName = reader.ReadLine();
|
|
string? signature = reader.ReadLine();
|
|
|
|
if (string.IsNullOrEmpty(fileName) || string.IsNullOrEmpty(signature))
|
|
break;
|
|
|
|
Add(new ManifestFile
|
|
{
|
|
Name = fileName,
|
|
Signature = signature
|
|
});
|
|
}
|
|
}
|
|
|
|
public static async Task<FileManifest> Get(string versionGuid)
|
|
{
|
|
string pkgManifestUrl = Deployment.GetLocation($"/{versionGuid}-rbxManifest.txt");
|
|
var pkgManifestData = await App.HttpClient.GetStringAsync(pkgManifestUrl);
|
|
|
|
return new FileManifest(pkgManifestData);
|
|
}
|
|
}
|
|
}
|