1
0
mirror of synced 2024-11-12 01:20:51 +01:00
This commit is contained in:
S-Sebb?? 2023-09-10 02:41:04 +08:00
parent 8b56689822
commit b23c387a29
3 changed files with 117 additions and 1 deletions

View File

@ -0,0 +1,32 @@
using Microsoft.Extensions.Options;
using TaikoLocalServer.Settings;
namespace TaikoLocalServer.Controllers.Game;
[ApiController]
[Route("/v12r00_cn/chassis/getgenericmaster.php")]
public class GetGenericMasterController : BaseController<GetGenericMasterController>
{
private readonly IGameDataService gameDataService;
private readonly ServerSettings settings;
[HttpPost]
[Produces("application/protobuf")]
public IActionResult GetGenericMaster([FromBody] GetGenericMasterRequest request)
{
Logger.LogInformation("GetGenericMasterRequest: {Request}", request.Stringify());
var response = new GetGenericMasterResponse()
{
Result = 1,
VerupNo = 2,
// EnableIdBit = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
EnableIdBit = new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
};
return Ok(response);
}
}

View File

@ -31,14 +31,87 @@ public class InitialDataCheckController : BaseController<InitialDataCheckControl
var uraReleaseBit =
FlagCalculator.GetBitArrayFromIds(defaultSongWithUraList, songIdMax, Logger);
var aryVerUp = new List<InitialdatacheckResponse.VerupNoData1>();
var response = new InitialdatacheckResponse
{
Result = 1,
DefaultSongFlg = enabledArray,
AchievementSongBit = enabledArray,
UraReleaseBit = uraReleaseBit,
SongIntroductionEndDatetime = DateTime.Now.AddYears(10).ToString(Constants.DATE_TIME_FORMAT)
SongIntroductionEndDatetime = DateTime.Now.AddYears(10).ToString(Constants.DATE_TIME_FORMAT),
// AryAiEventDatas =
// {
// new InitialdatacheckResponse.AiEventData
// {
// AiEventId = 18,
// TokenId = 4
// }
// },
AryVerupNoData1s =
{
new InitialdatacheckResponse.VerupNoData1
{
MasterType = 1,
VerupNo = 0
},
new InitialdatacheckResponse.VerupNoData1
{
MasterType = 2,
VerupNo = 0
},
new InitialdatacheckResponse.VerupNoData1
{
MasterType = 3,
VerupNo = 0
},
new InitialdatacheckResponse.VerupNoData1
{
MasterType = 4,
VerupNo = 0
},
new InitialdatacheckResponse.VerupNoData1
{
MasterType = 5,
VerupNo = 0
}
},
// AryVerupNoData1s =
// {
// new InitialdatacheckResponse.VerupNoData2
// {
// MasterType = 3,
// AryInformationDatas =
// {
// new InitialdatacheckResponse.VerupNoData2.InformationData
// {
// InfoId = 1,
// VerupNo = 2
// }
// }
// }
// }
};
var danData = new List<InitialdatacheckResponse.VerupNoData2.InformationData>();
for (var danId = Constants.MIN_DAN_ID; danId <= Constants.MAX_DAN_ID; danId++)
danData.Add(new InitialdatacheckResponse.VerupNoData2.InformationData
{
InfoId = (uint)danId,
VerupNo = 1
});
for (uint i = 0; i < 11; i++)
{
var verUp2 = new InitialdatacheckResponse.VerupNoData2
{
MasterType = i,
};
verUp2.AryInformationDatas.AddRange(danData);
response.AryVerupNoData2s.Add(verUp2);
}
response.AryChassisFunctionIds = new uint[] { 3 };
return Ok(response);
}

View File

@ -125,6 +125,17 @@ try
applicationBuilder => applicationBuilder.UseAllNetRequestMiddleware());
app.Run();
app.Use(async (context, next) =>
{
await next();
if (context.Response.StatusCode >= 400)
{
Log.Error("Unknown request from: {RemoteIpAddress} {Method} {Path} {StatusCode}",
context.Connection.RemoteIpAddress, context.Request.Method, context.Request.Path, context.Response.StatusCode);
}
});
}
catch (Exception ex)
{