mirror of
https://github.com/BtbN/ClanServer.git
synced 2026-04-20 08:17:31 -05:00
Implement Cardmng shims
This commit is contained in:
parent
942f5e5861
commit
e84c4c8182
54
ClanServer/Controllers/Core/Cardmng.cs
Normal file
54
ClanServer/Controllers/Core/Cardmng.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using ClanServer.Formatters;
|
||||
using ClanServer.Routing;
|
||||
|
||||
namespace ClanServer.Controllers.Core
|
||||
{
|
||||
[ApiController, Route("core")]
|
||||
public class CardmngController : ControllerBase
|
||||
{
|
||||
[HttpPost, XrpcCall("cardmng.inquire")]
|
||||
public ActionResult<EamuseXrpcData> Inquire([FromBody] EamuseXrpcData data)
|
||||
{
|
||||
string cardid = data.Document.Element("call").Element("cardmng").Attribute("cardid").Value;
|
||||
string cardType = data.Document.Element("call").Element("cardmng").Attribute("cardtype").Value;
|
||||
string update = data.Document.Element("call").Element("cardmng").Attribute("update").Value;
|
||||
|
||||
if (update != "") // TODO: actually register cards
|
||||
{
|
||||
data.Document = new XDocument(new XElement("response", new XElement("cardmng",
|
||||
new XAttribute("binded", "1"),
|
||||
new XAttribute("dataid", "DD389C3FFB6F47BA"),
|
||||
new XAttribute("refid", "DD389C3FFB6F47BA"),
|
||||
new XAttribute("ecflag", "1"),
|
||||
new XAttribute("newflag", "0"),
|
||||
new XAttribute("expired", "0")
|
||||
)));
|
||||
}
|
||||
else
|
||||
{
|
||||
data.Document = new XDocument(new XElement("response", new XElement("cardmng",
|
||||
new XAttribute("status", "112")
|
||||
)));
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
[HttpPost, XrpcCall("cardmng.authpass")]
|
||||
public ActionResult<EamuseXrpcData> Authpass([FromBody] EamuseXrpcData data)
|
||||
{
|
||||
data.Document = new XDocument(new XElement("response", new XElement("cardmng",
|
||||
new XAttribute("status", "0")
|
||||
)));
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -15,9 +15,9 @@ namespace eAmuseTest
|
|||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string compress = "lz77";
|
||||
string eamuse_info = "1-5cf049c8-6ec5";
|
||||
byte[] data = HexToBytes("6e84f02c117651c66313a5c17fa0ddc40e3f4cd52a94bd34f460e763f610e03d5d01f876");
|
||||
string compress = "none";
|
||||
string eamuse_info = "1-5cf04a26-56c5";
|
||||
byte[] data = HexToBytes("a7a4eef0f58176b89e5f6d0c91df45549f0fdb12a7ea731e9f2f52a85db742ed71eceeee848cfcedf8ca2b59161900ba");
|
||||
|
||||
compress = compress.ToLower();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user