Files
BLHX.Server/BLHX.Server.Game/Handlers/P19.cs
2024-04-07 04:37:09 -04:00

51 lines
1.7 KiB
C#

using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.p19;
using BLHX.Server.Common.Utils;
namespace BLHX.Server.Game.Handlers {
internal static class P19 {
[PacketHandler(Command.Cs19002, SaveDataAfterRun = true)]
static void AddShipHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs19002>();
Logger.c.Log("ShipId: " + req.ShipId);
Logger.c.Log("Type: " + req.Type);
connection.Send(new Sc19003() {});
connection.Send(new Sc19003() {});
}
[PacketHandler(Command.Cs19004, SaveDataAfterRun = true)]
static void ShipExitHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs19004>();
connection.Send(new Sc19005() { });
}
[PacketHandler(Command.Cs19103, SaveDataAfterRun = true)]
static void GetOSSArgsHandler(Connection connection, Packet packet) {
var req = packet.Decode<Cs19103>();
Logger.c.Log("Typ: " + req.Typ);
connection.Send(new Sc19104() {
AccessId = "1",
AccessSecret = "1",
ExpireTime = (uint)new DateTimeOffset(DateTime.Now.AddDays(31)).ToUnixTimeSeconds(),
SecurityToken = "3874839"
});
}
}
static class P19ConnectionNotifyExtensions {
public static void NotifyDormData(this Connection connection) {
connection.Send(new Sc19001() {
Lv = 1,
FloorNum = 1,
ExpPos = 2,
LoadTime = (uint)DateTimeOffset.Now.ToUnixTimeSeconds()
});
}
}
}