From 650d64b9226b63035005d199ac19525b163df646 Mon Sep 17 00:00:00 2001 From: Longfeng Qin Date: Mon, 25 Nov 2024 10:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE=E5=8C=85?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=20=E6=9B=B4=E6=96=B011B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/Client.cs | 7 +++---- .../{11-B0-Unk11B0Packet.cs => 11-B0-Unk11B0.cs} | 8 +++++++- Server/Server.csproj | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) rename Server/Packets/Handlers/11-ClientHandler/{11-B0-Unk11B0Packet.cs => 11-B0-Unk11B0.cs} (74%) diff --git a/Server/Client.cs b/Server/Client.cs index 5c56a16..757f78d 100644 --- a/Server/Client.cs +++ b/Server/Client.cs @@ -196,8 +196,7 @@ namespace PSO2SERVER SendPacket(h.Type, h.Subtype, h.Flags1, packet.Build(), packet.GetType().Name); } - private void HandlePacket(byte typeA, byte typeB, byte flags1, byte flags2, byte[] data, uint position, - uint size) + private void HandlePacket(byte typeA, byte typeB, byte flags1, byte flags2, byte[] data, uint position, uint size) { var handler = PacketHandlers.GetHandlerFor(typeA, typeB); string packetName; @@ -253,7 +252,7 @@ namespace PSO2SERVER { // 生成格式化日期和时间 var datePart = _server.StartTime.ToString("yyyy-MM-dd"); - var timePart = _server.StartTime.ToString("HH-mm-ss"); + var timePart = _server.StartTime.ToString("HH-mm-ss-fff"); // Check for and create packets directory if it doesn't exist var packetPath = Path.Combine(directory, $"0x{typeA:X2}-0x{typeB:X2}", datePart); @@ -269,7 +268,7 @@ namespace PSO2SERVER // 确保文件名不包含不允许的字符 var safePrefix = string.Join("_", prefix.Split(Path.GetInvalidFileNameChars())); - var filename = Path.Combine(packetPath, $"0x{typeA:X2}-0x{typeB:X2}-此处加入字节显示-{safePrefix}-{timePart}.bin"); + var filename = Path.Combine(packetPath, $"0x{typeA:X2}-0x{typeB:X2}-{packet.Length}-{safePrefix}-{timePart}.bin"); try { diff --git a/Server/Packets/Handlers/11-ClientHandler/11-B0-Unk11B0Packet.cs b/Server/Packets/Handlers/11-ClientHandler/11-B0-Unk11B0.cs similarity index 74% rename from Server/Packets/Handlers/11-ClientHandler/11-B0-Unk11B0Packet.cs rename to Server/Packets/Handlers/11-ClientHandler/11-B0-Unk11B0.cs index 6c7a315..3d6915c 100644 --- a/Server/Packets/Handlers/11-ClientHandler/11-B0-Unk11B0Packet.cs +++ b/Server/Packets/Handlers/11-ClientHandler/11-B0-Unk11B0.cs @@ -5,8 +5,14 @@ using PSO2SERVER.Packets.PSOPackets; namespace PSO2SERVER.Packets.Handlers { [PacketHandlerAttr(0x11, 0xB0)] - class Unk11B0Packet : PacketHandler + class Unk11B0 : PacketHandler { + public struct Unk11B0Packet + { + public uint unk1; + public uint unk2; + } + public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size) { var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length); diff --git a/Server/Server.csproj b/Server/Server.csproj index 2bb2c9d..1147686 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -212,7 +212,7 @@ - +