Updates
This commit is contained in:
93
SVSim.EmulatedEntrypoint/Controllers/CheckController.cs
Normal file
93
SVSim.EmulatedEntrypoint/Controllers/CheckController.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System.Buffers.Text;
|
||||
using System.Text;
|
||||
using MessagePack;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Requests;
|
||||
using SVSim.EmulatedEntrypoint.Models.Dtos.Responses;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class CheckController : SVSimController
|
||||
{
|
||||
private ILogger _logger;
|
||||
|
||||
public CheckController(ILogger<CheckController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpPost("special_title")]
|
||||
public async Task<DataWrapper<SpecialTitleCheckResponse>> SpecialTitleCheck(SpecialTitleCheckRequest request)
|
||||
{
|
||||
int titleId = Random.Shared.Next(8, 33);
|
||||
var res = new DataWrapper<SpecialTitleCheckResponse>
|
||||
{
|
||||
Data = new SpecialTitleCheckResponse
|
||||
{
|
||||
TitleImageId = titleId,
|
||||
TitleSoundId = titleId
|
||||
},
|
||||
DataHeaders = new DataHeaders
|
||||
{
|
||||
ShortUdid = 411054851,
|
||||
ViewerId = 906243102,
|
||||
Sid = string.Empty,
|
||||
Servertime = DateTime.UtcNow.Ticks,
|
||||
ResultCode = 1
|
||||
}
|
||||
};
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("game_start")]
|
||||
public async Task<DataWrapper<GameStartResponse>> GameStart(GameStartRequest request)
|
||||
{
|
||||
return new DataWrapper<GameStartResponse>()
|
||||
{
|
||||
DataHeaders = new DataHeaders
|
||||
{
|
||||
ShortUdid = 411054851,
|
||||
ViewerId = 906243102,
|
||||
Sid = string.Empty,
|
||||
Servertime = DateTime.UtcNow.Ticks,
|
||||
ResultCode = 1
|
||||
},
|
||||
Data = new GameStartResponse()
|
||||
{
|
||||
IsSetTransitionPassword = true,
|
||||
KorAuthorityId = default,
|
||||
KorAuthorityState = default,
|
||||
NowRank = new Dictionary<string, string>()
|
||||
{
|
||||
{"1", "RankName_010"},
|
||||
{"2", "RankName_010"},
|
||||
{"4", "RankName_017"}
|
||||
},
|
||||
NowName = "combusty7",
|
||||
PolicyState = default,
|
||||
PolicyId = default,
|
||||
NowTutorialStep = "100",
|
||||
NowViewerId = 906243102,
|
||||
TosId = default,
|
||||
TosState = default,
|
||||
TransitionAccountData = new List<TransitionAccountData>()
|
||||
{
|
||||
new TransitionAccountData()
|
||||
{
|
||||
ConnectedViewerId = "906243102",
|
||||
SocialAccountType = "5",
|
||||
SocialAccountId = "76561197970830305"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
19
SVSim.EmulatedEntrypoint/Controllers/SVSimController.cs
Normal file
19
SVSim.EmulatedEntrypoint/Controllers/SVSimController.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SVSim.EmulatedEntrypoint.Security;
|
||||
|
||||
namespace SVSim.EmulatedEntrypoint.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// A base controller for SVSim with helpers for getting some values.
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public abstract class SVSimController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the UdId of the user making the request. Can be null or empty, as only certain requests will send it. Known requests to send this value are: SignUp, CheckSpecialTitle, CheckiCloudUser, MigrateiCloudUser
|
||||
/// </summary>
|
||||
public string? UdId => Encryption.Decode(Request.Headers["UDID"]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user