Test
This commit is contained in:
parent
8b56689822
commit
b23c387a29
@ -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);
|
||||
}
|
||||
|
||||
}
|
@ -31,15 +31,88 @@ 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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user