1
0
mirror of synced 2024-11-12 01:20:51 +01:00

Various fixes

This commit is contained in:
S-Sebb?? 2023-10-14 22:53:42 +01:00
parent 07213c84e2
commit 614b693760
4 changed files with 24 additions and 8 deletions

View File

@ -41,7 +41,7 @@ public class MyDonEntryController : BaseController<MyDonEntryController>
ColorBody = 1,
ColorLimb = 3,
FavoriteSongsArray = "[]",
ToneFlgArray = "[]",
ToneFlgArray = "[0]",
TitleFlgArray = "[]",
CostumeFlgArray = "[[],[],[],[],[]]",
GenericInfoFlgArray = "[]",

View File

@ -76,6 +76,14 @@ public class UserDataController : BaseController<UserDataController>
// The only way to get a null is provide string "null" as input,
// which means database content need to be fixed, so better throw
toneFlg.ThrowIfNull("Tone flg should never be null!");
// If toneFlg is empty, add 0 to it
if (toneFlg.Length == 0)
{
toneFlg = new uint[] { 0 };
userData.ToneFlgArray = JsonSerializer.Serialize(toneFlg);
await userDatumService.UpdateUserDatum(userData);
}
var toneArray = FlagCalculator.GetBitArrayFromIds(toneFlg, gameDataService.GetToneFlagArraySize(), Logger);

View File

@ -1,6 +1,7 @@
using System.Reflection;
using System.Security.Authentication;
using GameDatabase.Context;
using Microsoft.AspNetCore.HttpLogging;
using Microsoft.AspNetCore.HttpOverrides;
using TaikoLocalServer.Middlewares;
using TaikoLocalServer.Services.Extentions;
@ -23,6 +24,13 @@ try
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpLogging(options =>
{
options.LoggingFields = HttpLoggingFields.All;
options.RequestBodyLogLimit = 32768;
options.ResponseBodyLogLimit = 32768;
});
const string configurationsDirectory = "Configurations";
builder.Configuration.AddJsonFile($"{configurationsDirectory}/Kestrel.json", optional: true, reloadOnChange: false);
builder.Configuration.AddJsonFile($"{configurationsDirectory}/Logging.json", optional: false, reloadOnChange: false);

View File

@ -378,24 +378,24 @@ public class GameDataService : IGameDataService
costumeFlagArraySizes = new List<int>
{
(int)kigurumiUniqueIdList.Max(),
(int)headUniqueIdList.Max(),
(int)bodyUniqueIdList.Max(),
(int)faceUniqueIdList.Max(),
(int)puchiUniqueIdList.Max()
(int)kigurumiUniqueIdList.Max() + 1,
(int)headUniqueIdList.Max() + 1,
(int)bodyUniqueIdList.Max() + 1,
(int)faceUniqueIdList.Max() + 1,
(int)puchiUniqueIdList.Max() + 1
};
}
private void InitializeTitleFlagArraySize(Shougous? shougouData)
{
shougouData.ThrowIfNull("Shouldn't happen!");
titleFlagArraySize = (int)shougouData.ShougouEntries.Max(entry => entry.uniqueId);
titleFlagArraySize = (int)shougouData.ShougouEntries.Max(entry => entry.uniqueId) + 1;
}
private void InitializeToneFlagArraySize(Neiros? neiroData)
{
neiroData.ThrowIfNull("Shouldn't happen!");
toneFlagArraySize = (int)neiroData.NeiroEntries.Max(entry => entry.uniqueId);
toneFlagArraySize = (int)neiroData.NeiroEntries.Max(entry => entry.uniqueId) + 1;
}
private void InitializeQrCodeData(List<QRCodeData>? qrCodeData)