forked from PGR/ascnet
1
0
Fork 0

minimum sdk done

This commit is contained in:
rfi 2023-10-07 17:18:43 +07:00
parent 212d08496c
commit eacf80ed5c
4 changed files with 76 additions and 8 deletions

View File

@ -1,5 +1,7 @@
using AscNet.Common.Util; using AscNet.Common.Util;
using AscNet.SDKServer.Models; using AscNet.SDKServer.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace AscNet.SDKServer.Controllers namespace AscNet.SDKServer.Controllers
@ -35,10 +37,10 @@ namespace AscNet.SDKServer.Controllers
remoteConfigs.AddConfig("MemoryLimit", 2048); remoteConfigs.AddConfig("MemoryLimit", 2048);
remoteConfigs.AddConfig("CloseMsgEncrypt", false); remoteConfigs.AddConfig("CloseMsgEncrypt", false);
remoteConfigs.AddConfig("ServerListStr", $"{Common.Common.config.GameServer.RegionName}#{Common.Common.config.GameServer.Host}/api/Login/Login"); remoteConfigs.AddConfig("ServerListStr", $"{Common.Common.config.GameServer.RegionName}#{Common.Common.config.GameServer.Host}/api/Login/Login");
remoteConfigs.AddConfig("AndroidPayCallbackUrl", $"{Common.Common.config.GameServer.Host}/api/XPay/HeroHgAndroidPayResult"); // i just wanna know what this is remoteConfigs.AddConfig("AndroidPayCallbackUrl", $"{Common.Common.config.GameServer.Host}/api/XPay/HeroHgAndroidPayResult");
remoteConfigs.AddConfig("IosPayCallbackUrl", $"{Common.Common.config.GameServer.Host}/api/XPay/HeroHgIosPayResult"); // i just wanna know what this is remoteConfigs.AddConfig("IosPayCallbackUrl", $"{Common.Common.config.GameServer.Host}/api/XPay/HeroHgIosPayResult");
remoteConfigs.AddConfig("WatermarkEnabled", true); // i just wanna know what this is remoteConfigs.AddConfig("WatermarkEnabled", false); // i just wanna know what this is
remoteConfigs.AddConfig("PicComposition", "empty"); // i just wanna know what this is remoteConfigs.AddConfig("PicComposition", "empty");
remoteConfigs.AddConfig("DeepLinkEnabled", true); remoteConfigs.AddConfig("DeepLinkEnabled", true);
remoteConfigs.AddConfig("DownloadMethod", 1); remoteConfigs.AddConfig("DownloadMethod", 1);
remoteConfigs.AddConfig("PcPayCallbackList", $"{Common.Common.config.GameServer.Host}/api/XPay/KuroPayResult"); remoteConfigs.AddConfig("PcPayCallbackList", $"{Common.Common.config.GameServer.Host}/api/XPay/KuroPayResult");
@ -46,12 +48,32 @@ namespace AscNet.SDKServer.Controllers
return TsvTool.SerializeObject(remoteConfigs); return TsvTool.SerializeObject(remoteConfigs);
}); });
app.MapGet("/prod/client/notice/config/com.kurogame.punishing.grayraven.en.pc/{version}/LoginNotice.json", (HttpContext ctx) =>
{
return JsonConvert.SerializeObject(new LoginNotice()
{
BeginTime = 0,
EndTime = 0,
HtmlUrl = "/",
Id = "1",
ModifyTime = 0,
Title = "NOTICE"
});
});
app.MapPost("/feedback", (HttpContext ctx) => app.MapPost("/feedback", (HttpContext ctx) =>
{ {
return ctx.Response.WriteAsJsonAsync(new return "1";
});
app.MapGet("/api/Login/Login", ([FromQuery] int loginType, [FromQuery] int userId, [FromQuery] string token, [FromQuery] string clientIp) =>
{
return JsonConvert.SerializeObject(new LoginGate()
{ {
code = 0, Code = 0,
msg = "ok" Ip = Common.Common.config.GameServer.Host,
Port = Common.Common.config.GameServer.Port,
Token = token
}); });
}); });
} }

View File

@ -0,0 +1,20 @@
using Newtonsoft.Json;
namespace AscNet.SDKServer.Models
{
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public partial class LoginGate
{
[JsonProperty("code", NullValueHandling = NullValueHandling.Ignore)]
public long? Code { get; set; }
[JsonProperty("token", NullValueHandling = NullValueHandling.Ignore)]
public string Token { get; set; }
[JsonProperty("port", NullValueHandling = NullValueHandling.Ignore)]
public long? Port { get; set; }
[JsonProperty("ip", NullValueHandling = NullValueHandling.Ignore)]
public string Ip { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using Newtonsoft.Json;
namespace AscNet.SDKServer.Models
{
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public partial class LoginNotice
{
[JsonProperty("BeginTime", NullValueHandling = NullValueHandling.Ignore)]
public long BeginTime { get; set; }
[JsonProperty("EndTime", NullValueHandling = NullValueHandling.Ignore)]
public long EndTime { get; set; }
[JsonProperty("HtmlUrl", NullValueHandling = NullValueHandling.Ignore)]
public string HtmlUrl { get; set; }
[JsonProperty("Id", NullValueHandling = NullValueHandling.Ignore)]
public string Id { get; set; }
[JsonProperty("ModifyTime", NullValueHandling = NullValueHandling.Ignore)]
public long ModifyTime { get; set; }
[JsonProperty("Title", NullValueHandling = NullValueHandling.Ignore)]
public string Title { get; set; }
}
}

View File

@ -21,7 +21,7 @@ def next_layer(nextlayer: layer.NextLayer):
nextlayer.context.server.address = ("127.0.0.1", 443) nextlayer.context.server.address = ("127.0.0.1", 443)
def request(flow: http.HTTPFlow) -> None: def request(flow: http.HTTPFlow) -> None:
if "kurogame.net" in flow.request.pretty_url or "kurogame-service.com" in flow.request.pretty_url: if "kurogame.net" in flow.request.pretty_url:
flow.request.host = "localhost" flow.request.host = "localhost"
flow.request.headers["Host"] = "localhost" flow.request.headers["Host"] = "localhost"
pass pass