mbar seems to be optional

This commit is contained in:
BtbN
2019-06-14 22:13:53 +02:00
parent cebd605e4a
commit 6bacd7bfac
2 changed files with 13 additions and 5 deletions

View File

@@ -123,8 +123,8 @@ namespace ClanServer.Controllers.L44
ctx.JubeatScores.Add(score);
JubeatHighscore highscore = ctx.JubeatHighscores
.SingleOrDefault(s => s.MusicID == musicId && s.Seq == seq && s.ProfileID == profile.ID);
JubeatHighscore highscore = await ctx.JubeatHighscores
.SingleOrDefaultAsync(s => s.MusicID == musicId && s.Seq == seq && s.ProfileID == profile.ID);
if (highscore == null)
{
@@ -132,7 +132,8 @@ namespace ClanServer.Controllers.L44
{
ProfileID = profile.ID,
MusicID = musicId,
Seq = seq
Seq = seq,
Bar = score.Bar
};
ctx.JubeatHighscores.Add(highscore);
@@ -148,8 +149,12 @@ namespace ClanServer.Controllers.L44
highscore.FcCount = int.Parse(tunePlayer.Element("fc_cnt").Value);
highscore.ExcCount = int.Parse(tunePlayer.Element("ex_cnt").Value);
mbarStrs = tunePlayer.Element("mbar").Value.Split(' ');
highscore.Bar = Array.ConvertAll(mbarStrs, s => byte.Parse(s));
XElement mbarE = tunePlayer.Element("mbar");
if (mbarE != null)
{
mbarStrs = mbarE.Value.Split(' ');
highscore.Bar = Array.ConvertAll(mbarStrs, s => byte.Parse(s));
}
}
XElement jubility = playerE.Element("jubility");

View File

@@ -41,7 +41,10 @@ namespace ClanServer
.AddDbContext<ClanServerContext>(options =>
{
if (CurEnv.IsDevelopment())
{
options.UseLoggerFactory(LogFactory);
options.EnableSensitiveDataLogging();
}
options.UseSqlite("Data Source=clanserver.db");
});