Compare commits
2
Commits
9a40c9dc0f
...
807d56d3c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
807d56d3c0 | ||
|
|
a13dc37dac |
@@ -1,6 +1,5 @@
|
||||
namespace ALttPRandomizer.Azure {
|
||||
using global::Azure.Storage.Blobs;
|
||||
using global::Azure.Storage.Blobs.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -64,6 +63,20 @@
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<BinaryData?> GetFile(string filename) {
|
||||
var blob = this.BlobClient.GetBlobClient(filename);
|
||||
var exists = await blob.ExistsAsync();
|
||||
if (!exists.HasValue || !exists.Value) {
|
||||
return null;
|
||||
}
|
||||
var result = await blob.DownloadContentAsync();
|
||||
if (result.HasValue) {
|
||||
return result.Value.Content;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<DateTimeOffset> GetFileCreation(string filename) {
|
||||
var blob = this.BlobClient.GetBlobClient(filename);
|
||||
var blobProperties = await blob.GetPropertiesAsync();
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
|
||||
[SettingName("shuffleenemies")]
|
||||
[IgnoreSetting(Apr2025)]
|
||||
[RequiredSetting([Pikit], EnemyShuffle.Vanilla)]
|
||||
public EnemyShuffle EnemyShuffle { get; set; } = EnemyShuffle.Vanilla;
|
||||
|
||||
[SettingName("shuffle_damage_table")]
|
||||
|
||||
@@ -72,6 +72,19 @@
|
||||
return ResolveResult(await this.RandomizeService.RetryMulti(id));
|
||||
}
|
||||
|
||||
[Route("/multidata/{id}")]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> GetMultidata(string id) {
|
||||
var multidata = await this.SeedService.GetMultidata(id);
|
||||
if (multidata == null) {
|
||||
return NotFound("multidata not found");
|
||||
} else {
|
||||
return new FileContentResult(multidata.ToArray(), "application/octet-stream") {
|
||||
FileDownloadName = $"{id}_multidata",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private ActionResult ResolveResult(IDictionary<string, object> result) {
|
||||
if (result.TryGetValue("status", out var responseCode)) {
|
||||
if (responseCode is int code) {
|
||||
|
||||
@@ -127,5 +127,9 @@
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<BinaryData?> GetMultidata(string multiId) {
|
||||
return await this.AzureStorage.GetFile($"{multiId}/multidata");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
"workingDirectory": "/beta_randomizer",
|
||||
"randomizerCommand": [ "uv", "run", "DungeonRandomizer.py" ],
|
||||
},
|
||||
"pikit": {
|
||||
"workingDirectory": "/pikit_randomizer",
|
||||
"randomizerCommand": [ "uv", "run", "DungeonRandomizer.py" ],
|
||||
},
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
|
||||
@@ -52,6 +52,14 @@ RUN uv sync
|
||||
|
||||
COPY BetaRandomizer/ .
|
||||
|
||||
# pikit generator
|
||||
WORKDIR /pikit_randomizer
|
||||
|
||||
COPY PikitRandomizer/pyproject.toml .
|
||||
RUN uv sync
|
||||
|
||||
COPY PikitRandomizer/ .
|
||||
|
||||
# web server
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
+1
-1
Submodule PikitRandomizer updated: 2738f61c0d...be35ed4451
Reference in New Issue
Block a user