diff --git a/README.md b/README.md index 32d4b60..8b2cdee 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ PolarisServer rebuild +梦幻之星OL2 中国服务器 Polaris二次开发 + diff --git a/Server/Models/FixedPackets.cs b/Server/Models/FixedPackets.cs index b74258a..2e64932 100644 --- a/Server/Models/FixedPackets.cs +++ b/Server/Models/FixedPackets.cs @@ -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 } } diff --git a/Server/Packets/Handlers/--UNK.cs b/Server/Packets/Handlers/--UNK.cs new file mode 100644 index 0000000..365682c --- /dev/null +++ b/Server/Packets/Handlers/--UNK.cs @@ -0,0 +1,16 @@ +锘縰sing 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); +// } +// } +} diff --git a/Server/Packets/PSOPackets/00-00-UnkPacket.cs b/Server/Packets/PSOPackets/00-00-UnkPacket.cs new file mode 100644 index 0000000..8f81c29 --- /dev/null +++ b/Server/Packets/PSOPackets/00-00-UnkPacket.cs @@ -0,0 +1,38 @@ +锘縰sing 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 + } +} \ No newline at end of file diff --git a/Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs b/Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs index 44f4121..1d5fad3 100644 --- a/Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs +++ b/Server/Packets/PSOPackets/04-ObjectPacket/04-02-TeleportTransferPacket.cs @@ -5,6 +5,7 @@ namespace PSO2SERVER.Packets.PSOPackets { class TeleportTransferPacket : Packet { + /// (0x04, 0x02) Object Teleport Location. private PSOObject src; private PSOLocation dst; diff --git a/Server/Packets/PSOPackets/04-ObjectPacket/04-06-DespawnObjectPacket.cs b/Server/Packets/PSOPackets/04-ObjectPacket/04-06-DespawnObjectPacket.cs new file mode 100644 index 0000000..c9ceb7a --- /dev/null +++ b/Server/Packets/PSOPackets/04-ObjectPacket/04-06-DespawnObjectPacket.cs @@ -0,0 +1,38 @@ +锘縰sing 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 + } +} \ No newline at end of file diff --git a/Server/Server.csproj b/Server/Server.csproj index c36edd1..1007c31 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -191,6 +191,7 @@ + @@ -202,6 +203,8 @@ + +