mirror of
https://github.com/BtbN/ClanServer.git
synced 2026-04-24 23:47:55 -05:00
Implement Lobby shim
This commit is contained in:
parent
ae8dd5ba0a
commit
1d02a431a7
|
|
@ -17,10 +17,12 @@ namespace ClanServer.Controllers.L44
|
|||
[HttpPost, Route("8"), XrpcCall("lobby.check")]
|
||||
public ActionResult<EamuseXrpcData> Check([FromBody] EamuseXrpcData data)
|
||||
{
|
||||
Console.WriteLine(data.Document);
|
||||
|
||||
//TODO
|
||||
data.Document = new XDocument(new XElement("response", new XElement("lobby")));
|
||||
data.Document = new XDocument(new XElement("response", new XElement("lobby", new XElement("data",
|
||||
new KU32("entrant_nr", 1).AddAttr("time", 0),
|
||||
new KS16("interval", 60),
|
||||
new KS16("entry_timeout", 30),
|
||||
new XElement("waitlist", new XAttribute("count", 0))
|
||||
))));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
@ -28,10 +30,43 @@ namespace ClanServer.Controllers.L44
|
|||
[HttpPost, Route("8"), XrpcCall("lobby.entry")]
|
||||
public ActionResult<EamuseXrpcData> Entry([FromBody] EamuseXrpcData data)
|
||||
{
|
||||
Console.WriteLine(data.Document);
|
||||
XElement lobby = data.Document.Element("call").Element("lobby");
|
||||
XElement music = lobby.Element("data").Element("music");
|
||||
|
||||
//TODO
|
||||
data.Document = new XDocument(new XElement("response", new XElement("lobby")));
|
||||
Random rng = new Random();
|
||||
byte[] buf = new byte[8];
|
||||
rng.NextBytes(buf);
|
||||
long roomId = BitConverter.ToInt64(buf, 0);
|
||||
|
||||
uint musicId = uint.Parse(music.Element("id").Value);
|
||||
byte seq = byte.Parse(music.Element("seq").Value);
|
||||
|
||||
data.Document = new XDocument(new XElement("response", new XElement("lobby",
|
||||
new XElement("data",
|
||||
new KS64("roomid", roomId).AddAttr("master", 1),
|
||||
new KS16("refresh_intr", 2),
|
||||
new XElement("music",
|
||||
new KU32("id", musicId),
|
||||
new KU8("seq", seq)
|
||||
)
|
||||
)
|
||||
)));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
[HttpPost, Route("8"), XrpcCall("lobby.refresh")]
|
||||
public ActionResult<EamuseXrpcData> Refresh([FromBody] EamuseXrpcData data)
|
||||
{
|
||||
XElement lobby = data.Document.Element("call").Element("lobby");
|
||||
_ = long.Parse(lobby.Element("data").Element("roomid").Value);
|
||||
|
||||
data.Document = new XDocument(new XElement("response", new XElement("lobby",
|
||||
new XElement("data",
|
||||
new KS16("refresh_intr", 2),
|
||||
new KBool("start", true)
|
||||
)
|
||||
)));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
@ -39,10 +74,14 @@ namespace ClanServer.Controllers.L44
|
|||
[HttpPost, Route("8"), XrpcCall("lobby.report")]
|
||||
public ActionResult<EamuseXrpcData> Report([FromBody] EamuseXrpcData data)
|
||||
{
|
||||
Console.WriteLine(data.Document);
|
||||
XElement lobby = data.Document.Element("call").Element("lobby");
|
||||
_ = long.Parse(lobby.Element("data").Element("roomid").Value);
|
||||
|
||||
//TODO
|
||||
data.Document = new XDocument(new XElement("response", new XElement("lobby")));
|
||||
data.Document = new XDocument(new XElement("response", new XElement("lobby",
|
||||
new XElement("data",
|
||||
new KS16("refresh_intr", 2)
|
||||
)
|
||||
)));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ namespace eAmuseTest
|
|||
static void Main(string[] args)
|
||||
{
|
||||
string compress = "lz77";
|
||||
string eamuse_info = "1-5cf04a3d-16b2";
|
||||
byte[] data = HexToBytes("c762dcec8dd5a3a8ffa09123c13875d61e487633ec468637b552d4841eb8265285f492919c4f13de11eca5b6c5cd5dda75a9d55284ff0ebe316df107f2123492bf55997a6296124133a8453c4b350a0405f613d67f4645560a261ef62a0af64988fe0e9983fedf4f5c02ff3f37f089c0da1f4c78542946acc7d52571cd58b247ecbd7d9c9ff7c11f59fea2fd6ffd62aec5dec659a06eb9ac7a7f6b4ff0662d1e3ee6a385cf76c10b535540c382e6c06218354872d89a81775ee771ab2cc784e722ec0686dc2da33e235eb99d3b3bae88c10fb28b6302edabd120c77ac83bca8507839a5b3d10190cf21bbe36bdc39a80015f29d277be");
|
||||
string eamuse_info = "1-5cf3b7d3-1eda";
|
||||
byte[] data = HexToBytes("8a38885f1b15801dcd1545ddb2d618b769fb3ca7d343874efe94ca4c2fa8b7f84d59ea217f70a1a41bfb8ee1871fe8beb25299629b8d01c668bf4c");
|
||||
|
||||
compress = compress.ToLower();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user