forked from PGR/ascnet
1
0
Fork 0
ascnet/AscNet.GameServer/Handlers/AccountModule.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2023-10-10 09:56:08 +00:00
using AscNet.Common.MsgPack;
using MessagePack;
2023-10-10 18:22:41 +00:00
using MongoDB.Bson.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
2023-10-10 13:59:08 +00:00
using static AscNet.GameServer.Packet;
2023-10-10 09:56:08 +00:00
namespace AscNet.GameServer.Handlers
{
internal class AccountModule
{
[PacketHandler("HandshakeRequest")]
public static void HandshakeRequestHandler(Session session, byte[] packet)
{
HandshakeRequest request = MessagePackSerializer.Deserialize<HandshakeRequest>(packet);
HandshakeResponse response = new()
{
Code = 0,
UtcOpenTime = 0,
Sha1Table = null
};
session.SendResponse(response);
}
2023-10-10 13:59:08 +00:00
[PacketHandler("LoginRequest")]
public static void LoginRequestHandler(Session session, byte[] packet)
{
session.SendResponse(new LoginResponse
{
Code = 0,
ReconnectToken = "eeeeeeeeeeeeeeh",
UtcOffset = 0,
2023-10-10 18:22:41 +00:00
UtcServerTime = (uint)DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
2023-10-10 13:59:08 +00:00
});
2023-10-10 18:22:41 +00:00
2023-10-10 18:33:12 +00:00
session.SendPush(JsonSerializer.Deserialize<NotifyLogin>(File.ReadAllText("Data\\NotifyLogin.json")));
2023-10-10 13:59:08 +00:00
}
2023-10-10 09:56:08 +00:00
}
}