Fix unregistered played

This commit is contained in:
BtbN 2019-06-06 19:08:59 +02:00
parent d5c83347c7
commit 1e81492460
4 changed files with 40 additions and 16 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -32,6 +32,11 @@ namespace ClanServer.Controllers.L44
XElement dataE = xrpcData.Document.Element("call").Element("gameend").Element("data");
XElement playerE = dataE.Element("player");
xrpcData.Document = new XDocument(new XElement("response", new XElement("gameend")));
if (playerE == null)
return xrpcData;
int jid = int.Parse(playerE.Element("jid").Value);
JubeatProfile profile = await ctx.JubeatProfiles
@ -151,7 +156,6 @@ namespace ClanServer.Controllers.L44
await ctx.SaveChangesAsync();
xrpcData.Document = new XDocument(new XElement("response", new XElement("gameend")));
return xrpcData;
}
catch(Exception e)
@ -169,6 +173,11 @@ namespace ClanServer.Controllers.L44
XElement dataE = xrpcData.Document.Element("call").Element("gameend").Element("data");
XElement playerE = dataE.Element("player");
xrpcData.Document = new XDocument(new XElement("response", new XElement("gameend")));
if (playerE == null)
return xrpcData;
int jid = int.Parse(playerE.Element("jid").Value);
JubeatProfile profile = await ctx.JubeatProfiles
@ -184,7 +193,6 @@ namespace ClanServer.Controllers.L44
await ctx.SaveChangesAsync();
xrpcData.Document = new XDocument(new XElement("response", new XElement("gameend")));
return xrpcData;
}
catch (Exception e)

View File

@ -26,6 +26,17 @@ namespace ClanServer.Controllers.L44
this.ctx = ctx;
}
[HttpPost, Route("8"), XrpcCall("gametop.get_info")]
public ActionResult<EamuseXrpcData> GetInfo([FromBody] EamuseXrpcData data)
{
XElement dataE = GetFacilityDataElement("ABCD1234");
dataE.Add(GetInfoElement());
data.Document = new XDocument(new XElement("response", new XElement("gametop", dataE)));
return data;
}
[HttpPost, Route("8"), XrpcCall("gametop.regist")]
public async Task<ActionResult<EamuseXrpcData>> Register([FromBody] EamuseXrpcData data)
{
@ -105,6 +116,20 @@ namespace ClanServer.Controllers.L44
return data;
}
public static XElement GetFacilityDataElement(string locationId)
{
return new XElement("data",
new KU32("cabid", 1),
new KStr("locationid", locationId),
new KU8("tax_phase", 0),
new XElement("facility",
new KU32("exist", 0)
),
new KU64("event_flag", 0),
GetInfoElement()
);
}
public static XElement GetInfoElement()
{
return new XElement("info",

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -20,16 +20,7 @@ namespace ClanServer.Controllers.L44
{
string locationId = data.Document.Element("call").Element("shopinfo").Element("shop").Element("locationid").Value;
data.Document = new XDocument(new XElement("response", new XElement("shopinfo", new XElement("data",
new KU32("cabid", 1),
new KStr("locationid", locationId),
new KU8("tax_phase", 0),
new XElement("facility",
new KU32("exist", 0)
),
new KU64("event_flag", 0),
GametopController.GetInfoElement()
))));
data.Document = new XDocument(new XElement("response", new XElement("shopinfo", GametopController.GetFacilityDataElement(locationId))));
return data;
}

View File

@ -17,8 +17,8 @@ namespace eAmuseTest
static void Main()
{
string compress = "lz77";
string eamuse_info = "1-5cf3b76a-205f";
byte[] data = HexToBytes("7c493a49c0ae494ad26cb2efd493a9858528c6094220f3857b0157101cfe12230b39a8");
string eamuse_info = "1-5cf9445d-0dfe";
byte[] data = HexToBytes("93b01743b29ca06e7500db42d83c70843dc776d0617ac96ba0768dd6b457554591d4b8b5f963e12d5fbb5075684c2a9acbfc462aa52686a720c57b3e44373008178684f9fd7ddad3c3a1e9fe1422ae08b9b872520a64cc195a9c04585149ec8de30220345c023663ae916068117ab7d5619362019d18a6f789bbd27e4ee027ce236d2b8d6c0f0917c8990083b741b3958cdf770f970df13088f931da949d1c9f685ba7848a15c3b77083357a6fb430b8a914bf55249f092c2baf14adfa8a7ab6bd430cc6ca5b4a35ea8c893aaa0c88ae6305240d5ae479976caf35e29d943ec628752c191ae40d0998c28e3280b6a55f8198ae");
compress = compress.ToLower();