diff --git a/Server/Json/JsonTest.cs b/Server/Json/JsonTest.cs index 0ec69a6..fab7575 100644 --- a/Server/Json/JsonTest.cs +++ b/Server/Json/JsonTest.cs @@ -39,7 +39,7 @@ namespace PSO2SERVER.Json // 获取所有公共属性 PropertyInfo[] properties = type.GetProperties(); - Console.WriteLine("Properties:"); + Logger.Write("属性:"); foreach (var property in properties) { // 获取属性的值 @@ -49,7 +49,7 @@ namespace PSO2SERVER.Json // 获取所有字段(包括私有字段) FieldInfo[] fields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public); - Console.WriteLine("\nFields:"); + Logger.Write("\n字段:"); foreach (var field in fields) { // 获取字段的值 diff --git a/Server/Protocol/Packets/0E-PartyPacket/0E-02-PartyInitPacket.cs b/Server/Protocol/Packets/0E-PartyPacket/0E-02-PartyInitPacket.cs index afd8fb6..04dc3d6 100644 --- a/Server/Protocol/Packets/0E-PartyPacket/0E-02-PartyInitPacket.cs +++ b/Server/Protocol/Packets/0E-PartyPacket/0E-02-PartyInitPacket.cs @@ -40,7 +40,7 @@ namespace PSO2SERVER.Protocol.Packets entries[i].sublevel = (byte)character.Jobs.entries.hunter.level2; entries[i].mainClass = character.Jobs.mainClass; entries[i].subClass = character.Jobs.subClass; - entries[i].color = Clients[0].currentParty.AddColor(i); + entries[i].color = (PartyColor)i; entries[i].unk2 = 0; entries[i].mapid = 0; entries[i].unk3 = 0; diff --git a/Server/Protocol/Packets/11-ClientPacket/11-03-CharacterListPacket.cs b/Server/Protocol/Packets/11-ClientPacket/11-03-CharacterListPacket.cs index eec9c1f..2b76b63 100644 --- a/Server/Protocol/Packets/11-ClientPacket/11-03-CharacterListPacket.cs +++ b/Server/Protocol/Packets/11-ClientPacket/11-03-CharacterListPacket.cs @@ -12,6 +12,8 @@ namespace PSO2SERVER.Protocol.Packets { public class CharacterListPacket : Packet { + public uint Characters_count { get; set; } = 0; + public uint unk1 { get; set; } = 0; // Available characters public List Characters { get; set; } = new List(); @@ -96,12 +98,14 @@ namespace PSO2SERVER.Protocol.Packets EquippedItems.Add(ch.EquipedItems); } + + Characters_count = (uint)Characters.Count(); } var pkt = new PacketWriter(); - pkt.Write((uint)Characters.Count()); // 写入玩家数量 - pkt.Write((uint)0); + pkt.Write(Characters_count); // 写入玩家数量 + pkt.Write(unk1); foreach (var ch in Characters) { pkt.Write((uint)0); @@ -113,38 +117,37 @@ namespace PSO2SERVER.Protocol.Packets { foreach (var item in itemsArray) { - byte[] itemBytes = item.ToByteArray(); // Assume PSO2Items has a ToByteArray method - pkt.Write(itemBytes); // Write the item bytes + pkt.WriteStruct(item); } } - // Write PlayTimes - foreach (var playTime in PlayTimes) - { - pkt.Write(playTime); - } - // Write DeletionFlags - foreach (var flag in DeletionFlags) - { - pkt.Write(flag.flag); - pkt.Write(flag.timestamp); - } - // Write TransferFlags - foreach (var flag in TransferFlags) - { - pkt.Write(flag.flag); - pkt.Write(flag.timestamp); - } + //// Write PlayTimes + //foreach (var playTime in PlayTimes) + //{ + // pkt.Write(playTime); + //} + //// Write DeletionFlags + //foreach (var flag in DeletionFlags) + //{ + // pkt.Write(flag.flag); + // pkt.Write(flag.timestamp); + //} + //// Write TransferFlags + //foreach (var flag in TransferFlags) + //{ + // pkt.Write(flag.flag); + // pkt.Write(flag.timestamp); + //} - // Write AccountAccessory - pkt.Write(AccountAccessory); + //// Write AccountAccessory + //pkt.Write(AccountAccessory); - // Write LoginSurvey - pkt.Write(LoginSurvey); + //// Write LoginSurvey + //pkt.Write(LoginSurvey); - // Write Ad - pkt.Write(Ad); + //// Write Ad + //pkt.Write(Ad); - pkt.WriteBytes(0, 2); + //pkt.WriteBytes(0, 2); return pkt.ToArray();