This commit is contained in:
Raidenxd2
2026-08-07 04:45:59 -04:00
commit 255b572a6f
219 changed files with 1652469 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
namespace asdfasdf.APIs;
public static class Storage
{
public static void Init(WebApplication app)
{
app.MapPost("/upload", async (HttpRequest request) =>
{
var file = request.Form.Files.FirstOrDefault();
string fileName;
if (Matchmaking.currentInstance != null)
{
fileName = Matchmaking.currentInstance.roomId + "-" + Guid.NewGuid() + ".room";
}
else
{
fileName = Guid.NewGuid() + ".room";
}
using (var stream = new FileStream("wwwroot/room/" + fileName, FileMode.Create))
{
await file.CopyToAsync(stream);
}
return Results.Ok(new {Filename = fileName});
});
}
}