1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Remove unused imports

Adjust default values
Implement recent songs
This commit is contained in:
asesidaa 2022-08-26 21:39:25 +08:00
parent 4907466774
commit 42db23ce17
37 changed files with 68 additions and 110 deletions

View File

@ -2,6 +2,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaikoLocalServer", "TaikoLocalServer\TaikoLocalServer.csproj", "{98FDA12C-CD3C-42D0-BEBE-4E809E6E41AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AntDashboard", "AntDashboard\AntDashboard.csproj", "{BBB35D52-6635-4DD7-BB6D-A4EA534E0CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -12,5 +14,9 @@ Global
{98FDA12C-CD3C-42D0-BEBE-4E809E6E41AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98FDA12C-CD3C-42D0-BEBE-4E809E6E41AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98FDA12C-CD3C-42D0-BEBE-4E809E6E41AC}.Release|Any CPU.Build.0 = Release|Any CPU
{BBB35D52-6635-4DD7-BB6D-A4EA534E0CEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BBB35D52-6635-4DD7-BB6D-A4EA534E0CEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBB35D52-6635-4DD7-BB6D-A4EA534E0CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBB35D52-6635-4DD7-BB6D-A4EA534E0CEB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@ -2,6 +2,7 @@
public enum Difficulty : uint
{
None = 0,
Easy = 1,
Normal = 2,
Hard = 3,

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore;
using TaikoLocalServer.Common;
using TaikoLocalServer.Entities;

View File

@ -115,9 +115,9 @@ public class BaidController:ControllerBase
MydonName = userData.MyDonName,
Title = userData.Title,
TitleplateId = userData.TitlePlateId,
ColorFace = 1,
ColorFace = 0,
ColorBody = 1,
ColorLimb = 1,
ColorLimb = 3,
AryCostumedata = new BAIDResponse.CostumeData
{
Costume1 = ValueHelpers.GetNonZeroValue(costumeData[0]),
@ -142,7 +142,7 @@ public class BaidController:ControllerBase
AryScoreRankCounts = scoreRankCount,
IsDispAchievementOn = userData.DisplayAchievement,
DispAchievementType = (uint)userData.AchievementDisplayDifficulty,
IsDispAchievementTypeSet = false,
IsDispAchievementTypeSet = true,
LastPlayMode = 0,
IsDispSouuchiOn = true,
AiRank = 0,

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/challengecompe.php")]
[ApiController]

View File

@ -1,7 +1,4 @@
using System.Collections;
using System.Collections.Specialized;
using Microsoft.AspNetCore.Http;
using TaikoLocalServer.Common;
using TaikoLocalServer.Common;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Context;
using TaikoLocalServer.Utils;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/executeqrcode.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/getaidata.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/getaiscore.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/getapplicationurl.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/getdanodai.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("api/[controller]")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/getfolder.php")]
[ApiController]

View File

@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Http;
using TaikoLocalServer.Common;
using TaikoLocalServer.Common;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Context;
using TaikoLocalServer.Utils;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/getshopfolder.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/getsongintroduction.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
using Swan.Extensions;
using TaikoLocalServer.Common;
using TaikoLocalServer.Common;
namespace TaikoLocalServer.Controllers;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/gettokencount.php")]
[ApiController]

View File

@ -1,7 +1,4 @@
using System.Collections;
using Swan.Extensions;
using TaikoLocalServer.Common;
using TaikoLocalServer.Utils;
using TaikoLocalServer.Common;
namespace TaikoLocalServer.Controllers;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Swan.Formatters;
using TaikoLocalServer.Models;
using TaikoLocalServer.Models;
using TaikoLocalServer.Utils;
namespace TaikoLocalServer.Controllers;

View File

@ -1,8 +1,6 @@
using Microsoft.AspNetCore.Http;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Context;
using TaikoLocalServer.Entities;
using TaikoLocalServer.Utils;
namespace TaikoLocalServer.Controllers;
@ -38,7 +36,7 @@ public class MyDonEntryController : ControllerBase
MyDonName = request.MydonName,
DisplayDan = false,
DisplayAchievement = true,
AchievementDisplayDifficulty = Difficulty.Easy
AchievementDisplayDifficulty = Difficulty.None
});
context.SaveChanges();

View File

@ -1,6 +1,5 @@
using System.Globalization;
using System.Text.Json;
using Microsoft.AspNetCore.Http;
using ProtoBuf;
using TaikoLocalServer.Common;
using TaikoLocalServer.Common.Enums;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Swan.Formatters;
using TaikoLocalServer.Models;
using TaikoLocalServer.Models;
using TaikoLocalServer.Utils;
namespace TaikoLocalServer.Controllers;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/rewarditem.php")]
[ApiController]

View File

@ -1,9 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Caching.Memory;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Context;
using TaikoLocalServer.Entities;
using TaikoLocalServer.Models;
using TaikoLocalServer.Utils;
namespace TaikoLocalServer.Controllers;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/songpurchase.php")]
[ApiController]

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/tournamentcheck.php")]
[ApiController]

View File

@ -1,6 +1,6 @@
using System.Collections;
using System.Runtime.InteropServices;
using TaikoLocalServer.Common;
using TaikoLocalServer.Context;
using TaikoLocalServer.Utils;
namespace TaikoLocalServer.Controllers;
@ -10,8 +10,13 @@ namespace TaikoLocalServer.Controllers;
public class UserDataController : ControllerBase
{
private readonly ILogger<UserDataController> logger;
public UserDataController(ILogger<UserDataController> logger) {
private readonly TaikoDbContext context;
public UserDataController(ILogger<UserDataController> logger, TaikoDbContext context)
{
this.logger = logger;
this.context = context;
}
[HttpPost]
@ -37,17 +42,32 @@ public class UserDataController : ControllerBase
bitSet.Set((int)music, true);
}
bitSet.CopyTo(uraSongArray, 0);
var toneArray = new byte[5];
Array.Fill(toneArray, byte.MaxValue);
var recentSongs = context.SongPlayData
.Where(datum => datum.Baid == request.Baid)
.OrderByDescending(datum => datum.PlayTime)
.AsEnumerable()
.DistinctBy(datum => datum.SongId)
.Take(10)
.Select(datum => datum.SongId)
.ToArray();
var response = new UserDataResponse
{
Result = 1,
ToneFlg = new byte[] {0},
ToneFlg = toneArray,
// TitleFlg = GZipBytesUtil.GetGZipBytes(new byte[100]),
ReleaseSongFlg = releaseSongArray,
UraReleaseSongFlg = uraSongArray,
DefaultOptionSetting = new byte[] {0},
IsVoiceOn = true,
IsSkipOn = false
IsSkipOn = false,
IsChallengecompe = false,
SongRecentCnt = (uint)recentSongs.Length,
AryRecentSongNoes = recentSongs
};

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Http;
namespace TaikoLocalServer.Controllers;
namespace TaikoLocalServer.Controllers;
[Route("/v12r03/chassis/verifyqrcode.php")]
[ApiController]

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
namespace TaikoLocalServer.Entities
namespace TaikoLocalServer.Entities
{
public partial class Card
{

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Common.Enums;
namespace TaikoLocalServer.Entities
{

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Common.Enums;
namespace TaikoLocalServer.Entities
{

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using TaikoLocalServer.Common.Enums;
using TaikoLocalServer.Common.Enums;
namespace TaikoLocalServer.Entities
{

View File

@ -1,6 +1,4 @@
using System.Buffers.Text;
using System.IO.Compression;
using System.Net;
using System.Net;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace TaikoLocalServer.Middlewares;

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Mvc;
namespace TaikoLocalServer.Models;
namespace TaikoLocalServer.Models;
public class MuchaBoardAuthRequest
{

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Mvc;
namespace TaikoLocalServer.Models;
namespace TaikoLocalServer.Models;
public class MuchaUpdateCheckRequest
{

View File

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Mvc;
namespace TaikoLocalServer.Models;
namespace TaikoLocalServer.Models;
public class PowerOnRequest
{