grids cfg parser yummy

This commit is contained in:
rfi
2024-02-24 15:22:51 +07:00
parent 529d404c12
commit ded826adf0
4 changed files with 48 additions and 8 deletions

View File

@@ -122,7 +122,7 @@ namespace BLHX.Server.Game
ns.Write(sendBuf);
}
void SendPacket(Packet packet)
void Send(Packet packet)
{
c.Log(packet.command.ToString());
var ns = tcpClient.GetStream();

View File

@@ -1,6 +1,4 @@
using BLHX.Server.Common.Data;
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.common;
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.p12;
namespace BLHX.Server.Game.Handlers

View File

@@ -1,10 +1,34 @@
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Data;
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.p13;
namespace BLHX.Server.Game.Handlers
{
internal static class P13
{
[PacketHandler(Command.Cs13101)]
static void TrackingHandler(Connection connection, Packet packet)
{
var req = packet.Decode<Cs13101>();
var rsp = new Sc13102();
if (!Data.ChapterTemplate.TryGetValue((int)req.Id, out var chapterTemplate))
{
rsp.Result = 1;
connection.Send(rsp);
return;
}
// TODO: Populate values, pls make managers
connection.Send(new Sc13102()
{
CurrentChapter = new()
{
Id = req.Id,
Time = (uint)(DateTimeOffset.Now.ToUnixTimeSeconds() + chapterTemplate.Time)
}
});
}
[PacketHandler(Command.Cs13505)]
static void RemasterInfoRequestHandler(Connection connection, Packet packet)
{
@@ -16,7 +40,7 @@ namespace BLHX.Server.Game.Handlers
{
public static void NotifyChapterData(this Connection connection)
{
connection.Send(new Sc13001() { ReactChapter = new() });
connection.Send(new Sc13001() { ReactChapter = new() });
}
}
}