更新数据包解析

This commit is contained in:
Longfeng Qin 2024-09-16 17:09:36 +08:00
parent 3cf5b50ed2
commit 005aa7d936
7 changed files with 109 additions and 5 deletions

View File

@ -1,5 +1,7 @@
PolarisServer rebuild
梦幻之星OL2 中国服务器 Polaris二次开发

View File

@ -33,14 +33,20 @@ namespace PSO2SERVER.Models
}
}
/// Packet flags.
[Flags]
public enum PacketFlags : byte
{
None,
PACKED = 0x04,
FLAG_10 = 0x10,
FULL_MOVEMENT = 0x20,
OBJECT_RELATED = 0x40
/// 0x00
None = 0x00,
/// Set when the packet contains variable length data. 0x04
PACKED = 1 << 2,
/// 0x10
FLAG_10 = 1 << 4,
/// Set when the [`Packet::Movement`] has all fields set. 0x20
FULL_MOVEMENT = 1 << 5,
/// Set for all (?) of (0x04) packets. 0x40
OBJECT_RELATED = 1 << 6
}
}

View File

@ -0,0 +1,16 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
namespace PSO2SERVER.Packets.Handlers
{
// [PacketHandlerAttr(0x0E, 0x19)]
// class _0E_19_UNK : PacketHandler
// {
// public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
// {
// //var info = string.Format("[接收] 接收到的数据 (hex): ");
// //Logger.WriteHex(info, data);
// }
// }
}

View File

@ -0,0 +1,38 @@
using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
{
public class UnkPacket : Packet
{
private readonly byte _subtype;
private readonly byte _type;
public UnkPacket()
{
_type = 0x00;
_subtype = 0x00;
}
#region implemented abstract members of Packet
public override byte[] Build()
{
return new byte[0];
}
public override PacketHeader GetHeader()
{
return new PacketHeader
{
Type = _type,
Subtype = _subtype
};
}
#endregion
}
}

View File

@ -5,6 +5,7 @@ namespace PSO2SERVER.Packets.PSOPackets
{
class TeleportTransferPacket : Packet
{
/// (0x04, 0x02) Object Teleport Location.
private PSOObject src;
private PSOLocation dst;

View File

@ -0,0 +1,38 @@
using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
{
public class DespawnObjectPacket : Packet
{
private readonly byte _subtype;
private readonly byte _type;
public DespawnObjectPacket()
{
_type = 0x04;
_subtype = 0x06;
}
#region implemented abstract members of Packet
public override byte[] Build()
{
return new byte[0];
}
public override PacketHeader GetHeader()
{
return new PacketHeader
{
Type = _type,
Subtype = _subtype
};
}
#endregion
}
}

View File

@ -191,6 +191,7 @@
<Compile Include="Packets\Handlers\0B-QuestHandler\0B-17-QuestListRequestHandler.cs" />
<Compile Include="Packets\Handlers\0B-QuestHandler\0B-19-QuestDifficultyRequestHandler.cs" />
<Compile Include="Packets\Handlers\0B-QuestHandler\0B-30-QuestCounterHandler.cs" />
<Compile Include="Packets\Handlers\--UNK.cs" />
<Compile Include="Packets\Handlers\0E-PartyHandler\0E-19-UNK.cs" />
<Compile Include="Packets\Handlers\11-ClientHandler\11-06-DeleteCharacter.cs" />
<Compile Include="Packets\Handlers\11-ClientHandler\11-0D-PingTimestampResponse.cs" />
@ -202,6 +203,8 @@
<Compile Include="Packets\Handlers\03-ServerHandler\03-34-TeleportCasinoToLobby.cs" />
<Compile Include="Packets\Handlers\11-ClientHandler\11-41-CreateCharacterOne.cs" />
<Compile Include="Packets\Handlers\2F-SymbolHandler\2F-06-SymbolArtHandler.cs" />
<Compile Include="Packets\PSOPackets\04-ObjectPacket\04-06-DespawnObjectPacket.cs" />
<Compile Include="Packets\PSOPackets\00-00-UnkPacket.cs" />
<Compile Include="Packets\PSOPackets\03-ServerPacket\03-2B-UnlockControlsPacket.cs" />
<Compile Include="Packets\PSOPackets\03-ServerPacket\03-24-LoadingLevelPacket.cs" />
<Compile Include="Packets\PSOPackets\03-ServerPacket\03-23-LoadingScreenRemovePacket.cs" />