重命名协议和数据

修正大量数据
This commit is contained in:
Longfeng Qin 2024-11-27 18:05:53 +08:00
parent da74671a48
commit ac166ab011
249 changed files with 1023 additions and 672 deletions

View File

@ -4,10 +4,11 @@ using System.Security.Cryptography;
using PSO2SERVER.Database;
using PSO2SERVER.Models;
using PSO2SERVER.Network;
using PSO2SERVER.Packets;
using PSO2SERVER.Packets.Handlers;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol;
using PSO2SERVER.Protocol.Handlers;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
using static Google.Protobuf.Reflection.UninterpretedOption.Types;
namespace PSO2SERVER
{
@ -140,7 +141,8 @@ namespace PSO2SERVER
sendName = $"0x{typeA:X2} - 0x{typeB:X2}";
}
Logger.Write($"[-->] {sendName} (Flags {(PacketFlags)flags1}) ({blob.Length} 字节)");
if ((typeA != 0x08 && typeB != 0x0B) && (typeA != 0x08 && typeB != 0x0C) && (typeA != 0x04))
Logger.WriteSend($"[-->] {sendName} (Flags {(PacketFlags)flags1}) ({blob.Length} 字节)");
if (Logger.VerbosePackets)
{
@ -208,7 +210,10 @@ namespace PSO2SERVER
{
packetName = $"0x{typeA:X2} - 0x{typeB:X2}";
}
Logger.Write($"[<--] {packetName} (Flags {(PacketFlags)flags1}) ({size + 8} 字节)");
if ((typeA != 0x04))
Logger.WriteRecv($"[<--] {packetName} (Flags {(PacketFlags)flags1}) ({size + 8} 字节)");
var packet = new byte[size];
Array.Copy(data, position, packet, 0, size);
@ -241,17 +246,23 @@ namespace PSO2SERVER
private void LogPacket(bool fromClient, byte typeA, byte typeB, byte flags1, byte flags2, byte[] packet)
{
// Check for and create packets directory if it doesn't exist
var packetPath = Path.Combine("packets", fromClient ? "客户端" : "服务端");
// 记录数据包
LogPacketInternal("packets", fromClient, typeA, typeB, flags1, flags2, packet);
LogPacketInternal(packetPath, fromClient, typeA, typeB, flags1, flags2, packet);
}
private void LogUnkClientPacket(byte typeA, byte typeB, byte flags1, byte flags2, byte[] packet)
{
// Check for and create packets directory if it doesn't exist
var packetPath = Path.Combine("UnkClientPackets", "客户端");
// 记录未知数据包
LogPacketInternal("UnkClientPackets", true, typeA, typeB, flags1, flags2, packet, "C-unk");
LogPacketInternal(packetPath, true, typeA, typeB, flags1, flags2, packet, "C-unk");
}
private void LogPacketInternal(string directory, bool fromClient, byte typeA, byte typeB, byte flags1, byte flags2, byte[] packet, string customPrefix = "")
private void LogPacketInternal(string directory, bool fromClient, byte typeA, byte typeB, byte flags1, byte flags2, byte[] packet, string customPrefix = null)
{
// 生成格式化日期和时间
var datePart = _server.StartTime.ToString("yyyy-MM-dd");

View File

@ -10,8 +10,8 @@ using Timer = System.Timers.Timer;
using PSO2SERVER.Database;
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
using Org.BouncyCastle.Tls;

View File

@ -1,7 +1,7 @@
using System;
using System.IO;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER
{
@ -29,6 +29,18 @@ namespace PSO2SERVER
WriteFile(text, args);
}
public static void WriteSend(string text, params object[] args)
{
AddLine(ConsoleColor.Green, string.Format(text, args));
WriteFile(text, args);
}
public static void WriteRecv(string text, params object[] args)
{
AddLine(ConsoleColor.Yellow, string.Format(text, args));
WriteFile(text, args);
}
public static void WriteInternal(string text, params object[] args)
{
AddLine(ConsoleColor.Cyan, string.Format(text, args));

View File

@ -2,7 +2,7 @@
using System.Runtime.InteropServices;
using System.ComponentModel.DataAnnotations;
using PSO2SERVER.Packets;
using PSO2SERVER.Protocol;
using PSO2SERVER.Database;
namespace PSO2SERVER.Models

View File

@ -1,5 +1,5 @@
using System.Collections.Generic;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Models

View File

@ -1,4 +1,4 @@
using PSO2SERVER.Packets;
using PSO2SERVER.Protocol;
namespace PSO2SERVER.Models
{

View File

@ -4,7 +4,7 @@ using System.IO;
using System.Linq;
using System.Text;
using PSO2SERVER.Database;
using PSO2SERVER.Packets;
using PSO2SERVER.Protocol;
namespace PSO2SERVER.Models
{

View File

@ -1,4 +1,4 @@
using PSO2SERVER.Packets;
using PSO2SERVER.Protocol;
using System;
using System.Collections.Generic;
using System.IO;

View File

@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Models
{

View File

@ -50,7 +50,7 @@ namespace PSO2SERVER.Object
var newObject = PSOObject.FromDBObject(dbObject);
objects.Add(newObject.Header.ID, newObject);
allTheObjects.Add(newObject.Header.ID, newObject);
Logger.WriteInternal("[OBJ] 从数据库中载入对象 {0} 所属区域 {1}.", newObject.Name, zone);
//Logger.WriteInternal("[OBJ] 从数据库中载入对象 {0} 所属区域 {1}.", newObject.Name, zone);
}
}

View File

@ -1,72 +0,0 @@
using Org.BouncyCastle.Bcpg;
using Org.BouncyCastle.Utilities.Encoders;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
{
[PacketHandlerAttr(0x0B, 0x19)]
class QuestDifficultyRequestHandler : PacketHandler
{
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var reader = new PacketReader(data, position, size);
var info = string.Format("[<--] 接收到的数据 (hex): {0}字节", data.Length);
Logger.WriteHex(info, data);
//[< --] 接收到的数据(hex): 16字节
//00000000 7F A3 00 00 20 00 00 00 00 00 00 00 0B 00 00 00 £......... ...
//[-->] 0x0B - 0x1C(NoPayloadPacket)(Flags None)(8 字节)
//[< --] 0x0B - 0x19(QuestDifficultyRequestHandler)(Flags PACKED)(24 字节)
//[< --] 接收到的数据(hex): 16字节
//00000000 7F A3 00 00 20 00 00 00 00 00 00 00 0B 00 00 00 £......... ...
//[-->] 0x0B - 0x1C(NoPayloadPacket)(Flags None)(8 字节)
//[< --] 0x0B - 0x19(QuestDifficultyRequestHandler)(Flags PACKED)(24 字节)
//[< --] 接收到的数据(hex): 16字节
//00000000 7F A3 00 00 20 00 00 00 00 00 00 00 0B 00 00 00 £......... ...
//[-->] 0x0B - 0x1C(NoPayloadPacket)(Flags None)(8 字节)
//[< --] 0x0B - 0x19(QuestDifficultyRequestHandler)(Flags PACKED)(24 字节)
//[< --] 接收到的数据(hex): 16字节
//00000000 7F A3 00 00 20 00 00 00 00 00 00 00 0B 00 00 00 £......... ...
//[-->] 0x0B - 0x1C(NoPayloadPacket)(Flags None)(8 字节)
//[< --] 0x0B - 0x19(QuestDifficultyRequestHandler)(Flags PACKED)(24 字节)
//[< --] 接收到的数据(hex): 16字节
//00000000 7F A3 00 00 20 00 00 00 00 00 00 00 0B 00 00 00 £......... ...
//[-->] 0x0B - 0x1C(NoPayloadPacket)(Flags None)(8 字节)
//[< --] 0x0B - 0x19(QuestDifficultyRequestHandler)(Flags PACKED)(24 字节)
//[< --] 接收到的数据(hex): 16字节
//00000000 7F A3 00 00 20 00 00 00 00 00 00 00 0B 00 00 00 £......... ...
//[-->] 0x0B - 0x1C(NoPayloadPacket)(Flags None)(8 字节)
//[< --] 0x0B - 0x19(QuestDifficultyRequestHandler)(Flags PACKED)(24 字节)
//[< --] 接收到的数据(hex): 16字节
//00000000 7F A3 00 00 20 00 00 00 00 00 00 00 0B 00 00 00 £......... ...
//[-->] 0x0B - 0x1C(NoPayloadPacket)(Flags None)(8 字节)
//[< --] 0x0B - 0x19(QuestDifficultyRequestHandler)(Flags PACKED)(24 字节)
//QuestDifficultyPacket.QuestDifficulty[] diffs = new QuestDifficultyPacket.QuestDifficulty[1];
//for (int i = 0; i < diffs.Length; i++)
//{
// diffs[i].dateOrSomething = "2017/2/20";
// diffs[i].quest_obj.ID = 496;
// diffs[i].quest_obj.padding = 0;
// diffs[i].something2 = 0x0B;
// diffs[i].questNameString = 30010;
// // These are likely bitfields
// diffs[i].something3 = 0x00030301;
//}
//context.SendPacket(new QuestDifficultyPacket(diffs));
// [K873] I believe this is the correct packet, but it causes an infinite send/recieve loop, we're probably just missing something else
context.SendPacket(new NoPayloadPacket(0x0B, 0x1C));
}
}
}

View File

@ -1,30 +0,0 @@
using PSO2SERVER.Models;
namespace PSO2SERVER.Packets.PSOPackets
{
public class LoadPalettePacket : Packet
{
#region implemented abstract members of Packet
public override byte[] Build()
{
var writer = new PacketWriter();
// Enable flag
writer.Write((byte) 1);
// Blank out the rest (skills)
for (var i = 0; i < 1091; i++)
writer.Write((byte) 0);
return writer.ToArray();
}
public override PacketHeader GetHeader()
{
return new PacketHeader(0x21, 0x01, PacketFlags.None);
}
#endregion
}
}

View File

@ -1,5 +1,5 @@
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -6,7 +6,7 @@ using System.Threading;
using System.Security.Cryptography;
using PSO2SERVER.Database;
using PSO2SERVER.Packets.Handlers;
using PSO2SERVER.Protocol.Handlers;
using System.Threading.Tasks;
using Google.Protobuf.WellKnownTypes;
using static Org.BouncyCastle.Math.EC.ECCurve;

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
// [PacketHandlerAttr(0x0E, 0x19)]
// class _0E_19_UNK : PacketHandler

View File

@ -1,11 +1,11 @@
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x03)]
public class InitialLoad : PacketHandler

View File

@ -1,9 +1,9 @@
using System;
using System.IO;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Database;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x0C)]
public class ServerPong : PacketHandler

View File

@ -1,5 +1,5 @@
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x10)]
public class MapLoaded : PacketHandler

View File

@ -5,7 +5,7 @@ using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Zone;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x12)]
class CampshipTeleport : PacketHandler

View File

@ -5,7 +5,7 @@ using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Zone;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x16)]
class CampshipTeleportDown : PacketHandler

View File

@ -5,10 +5,10 @@ using System.Linq;
using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x34)]
class TeleportCasinoToLobby : PacketHandler

View File

@ -1,13 +1,13 @@
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x35)]
class TeleportLobbyToCasino : PacketHandler

View File

@ -5,10 +5,10 @@ using System.Linq;
using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x38)]
class TeleportBridgeToLobby : PacketHandler

View File

@ -1,13 +1,13 @@
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x39)]
class TeleportLobbyToBridge : PacketHandler

View File

@ -5,10 +5,10 @@ using System.Linq;
using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x3B)]
class TeleportCafeToLobby : PacketHandler

View File

@ -1,13 +1,13 @@
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Zone;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x3C)]
class TeleportLobbyToCafe : PacketHandler

View File

@ -1,9 +1,9 @@
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Runtime.InteropServices;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x04, 0x07)]
public class MovementHandler : PacketHandler

View File

@ -1,12 +1,12 @@
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x04, 0x08)]
public class MovementActionHandler : PacketHandler

View File

@ -5,7 +5,7 @@ using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Zone;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
//[PacketHandlerAttr(0x04, 0x13)]
//class _04_13_UNK : PacketHandler

View File

@ -1,13 +1,13 @@
using PSO2SERVER.Database;
using PSO2SERVER.Models;
using PSO2SERVER.Object;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x04, 0x14)]
class ObjectInteract : PacketHandler
@ -39,7 +39,7 @@ namespace PSO2SERVER.Packets.Handlers
srcObj = null;
}
Logger.WriteInternal("[OBJ] {0} (ID {1}) <{2}> --> Ent {3} (ID {4})", srcObj.Name, srcObj.Header.ID, command, (ObjectType)dstObject.ObjectType, dstObject.ID);
//Logger.WriteInternal("[OBJ] {0} (ID {1}) <{2}> --> Ent {3} (ID {4})", srcObj.Name, srcObj.Header.ID, command, (ObjectType)dstObject.ObjectType, dstObject.ID);
// TODO: Delete this code and do this COMPLETELY correctly!!!
if (command == "Transfer" && context.CurrentZone.Name == "lobby")

View File

@ -1,12 +1,12 @@
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x04, 0x3C)]
public class ActionUpdateHandler : PacketHandler

View File

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x04, 0x71)]

View File

@ -1,10 +1,10 @@
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x07, 0x00)]
public class ChatHandler : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x07, 0x3D)]
class _07_3D_UNK : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0B, 0x09)]
class MinimapRevealRequest : PacketHandler

View File

@ -1,11 +1,11 @@
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0B, 0x15)]
class QuestCounterAvailableHander : PacketHandler

View File

@ -1,12 +1,12 @@
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0xB, 0x17)]
class QuestListRequestHandler : PacketHandler

View File

@ -0,0 +1,69 @@
using Org.BouncyCastle.Bcpg;
using Org.BouncyCastle.Utilities.Encoders;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using static PSO2SERVER.Protocol.Handlers.CharacterSelected;
using static PSO2SERVER.Protocol.Packets.QuestDifficultyPacket;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0B, 0x19)]
class QuestDifficultyRequestHandler : PacketHandler
{
/// List of objects of requested quests.
public List<ObjectHeader> Quests { get; set; } = new List<ObjectHeader>();
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0}字节", data.Length);
Logger.WriteHex(info, data);
var reader = new PacketReader(data, position, size);
Quests = reader.ReadList<ObjectHeader>();
// 现在可以对任务列表Quests进行处理
// 例如,可以记录任务的信息或进行其他处理
foreach (var quest in Quests)
{
if(quest.ObjectType == ObjectType.Quest)
{
QuestDifficulty[] diffs = new QuestDifficulty[1];
for (int i = 0; i < diffs.Length; i++)
{
diffs[i].dateOrSomething = "2017/2/20";
diffs[i].quest_obj.ID = quest.ID;
diffs[i].quest_obj.padding = 0;
diffs[i].quest_obj.ObjectType = ObjectType.Quest;
diffs[i].name_id = 30010;
diffs[i].area = 0x01;
diffs[i].planet = 0x03;
diffs[i].unk1 = 0x03;
diffs[i].unk2 = 0x00;
diffs[i].difficulty1 = new QuestDifficultyEntry();
diffs[i].difficulty2 = new QuestDifficultyEntry();
diffs[i].difficulty3 = new QuestDifficultyEntry();
diffs[i].difficulty4 = new QuestDifficultyEntry();
diffs[i].difficulty5 = new QuestDifficultyEntry();
diffs[i].difficulty6 = new QuestDifficultyEntry();
diffs[i].difficulty7 = new QuestDifficultyEntry();
diffs[i].difficulty8 = new QuestDifficultyEntry();
}
// 打印每个任务的 ID 和类型,方便调试
Logger.Write($"任务 ID: {quest.ID}, 任务类型: {quest.ObjectType}");
context.SendPacket(new QuestDifficultyPacket(diffs));
}
}
// [K873] I believe this is the correct packet, but it causes an infinite send/recieve loop, we're probably just missing something else
context.SendPacket(new QuestDifficultySendFinishedPacket());
}
}
}

View File

@ -0,0 +1,36 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0B, 0x20)]
class AcceptQuest : PacketHandler
{
public ObjectHeader quest_obj { get; set; }
public ushort diff { get; set; }
public ushort unk1 { get; set; }
public uint[] unk2 { get; set; } = new uint[7];
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
var reader = new PacketReader(data, position, size);
try
{
quest_obj = reader.ReadStruct<ObjectHeader>();
diff = reader.ReadUInt16();
unk1 = reader.ReadUInt16();
for (int i = 0; i < 7; i++) { unk2[i] = reader.ReadUInt32(); }
}
catch (Exception ex)
{
Logger.WriteError("Error while processing AcceptQuest packet: " + ex.Message);
}
Logger.Write($"Quest Object: {quest_obj}, Difficulty: {diff}, unk1: {unk1}, unk2: {string.Join(", ", unk2)}");
}
}
}

View File

@ -1,11 +1,11 @@
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0B, 0x30)]
class QuestCounterHandler : PacketHandler

View File

@ -1,9 +1,9 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Party;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0B, 0xCD)]
class AcceptStoryQuestHandler : PacketHandler
@ -19,7 +19,7 @@ namespace PSO2SERVER.Packets.Handlers
Logger.Write("任务编号: " + name_id + " unk: " + unk);
//PartyManager.instance.CreateNewParty(context);
PartyManager.Instance.CreateNewParty(context);
// 告诉客户端切换到加载界面
context.SendPacket(new LoadingScreenTransitionPacket());

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0E, 0x0C)]
class QuestDifficultyStartHandler : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0E, 0x19)]
class ChatStatusHandler : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0E, 0x28)]
class PlayerIsBusyState : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x0E, 0x29)]
class PlayerIsNotBusyState : PacketHandler

View File

@ -2,12 +2,12 @@
using System.Linq;
using System.Text.RegularExpressions;
using PSO2SERVER.Database;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Models;
using System.Text;
using System.Collections.Generic;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x00)]
public class SegaIDLogin : PacketHandler

View File

@ -1,11 +1,11 @@
using PSO2SERVER.Database;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System.Linq;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x02)]
public class CharacterList : PacketHandler
public class CharacterListRequest : PacketHandler
{
#region implemented abstract members of PacketHandler

View File

@ -1,10 +1,10 @@
using PSO2SERVER.Database;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Party;
using System;
using System.Linq;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x04)]
public class CharacterSelected : PacketHandler
@ -28,7 +28,7 @@ namespace PSO2SERVER.Packets.Handlers
var charId = pkt.CharId;
Logger.Write("id {0}", charId);
//Logger.Write("id {0}", charId);
if (context.Character == null)
{

View File

@ -1,11 +1,11 @@
using System.IO;
using System.Data.Entity;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Database;
using System.Linq;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x05)]
public class CharacterCreate : PacketHandler

View File

@ -1,10 +1,10 @@
using System;
using System.IO;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Database;
using static PSO2SERVER.Packets.PSOPackets.CharacterDeletionPacket;
using static PSO2SERVER.Protocol.Packets.CharacterDeletionPacket;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x06)]
public class DeleteCharacter : PacketHandler
@ -14,16 +14,16 @@ namespace PSO2SERVER.Packets.Handlers
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var reader = new PacketReader(data);
var id = reader.ReadInt32();
var CharacterID = reader.ReadInt32();
Logger.Write("[CHR] {0} 正在删除ID {1} 的角色", context._account.Username, id);
Logger.Write("[CHR] {0} 正在删除ID {1} 的角色", context._account.Username, CharacterID);
// Delete Character
using (var db = new ServerEf())
{
foreach (var character in db.Characters)
if (character.CharacterID == id)
if (character.CharacterID == CharacterID)
{
db.Characters.Remove(character);
db.ChangeTracker.DetectChanges();

View File

@ -2,8 +2,9 @@
using System.IO;
using System.Security.Cryptography;
using PSO2SERVER.Crypto;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x0B)]
public class KeyExchange : PacketHandler
@ -78,7 +79,7 @@ namespace PSO2SERVER.Packets.Handlers
var decryptedToken = new byte[16];
tempDecryptor.TransformBlock(decryptedBlob, 0, 0x10, decryptedToken, 0);
context.SendPacket(0x11, 0x0C, 0, decryptedToken);
context.SendPacket(new EncryptionResponsePacket(decryptedToken));
}
#endregion

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x0D)]
public class ClientPingHandler : PacketHandler

View File

@ -1,4 +1,4 @@
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.IO;
@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x1D)]

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x2B)]

View File

@ -5,9 +5,9 @@ using System.Linq;
using System.Runtime.Remoting.Messaging;
using PSO2SERVER.Database;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x2D)]
class SystemInformation : PacketHandler

View File

@ -3,12 +3,12 @@ using System.IO;
using System.Linq;
using Newtonsoft.Json;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Object;
using PSO2SERVER.Database;
using PSO2SERVER.Zone;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x3E)]
public class CharacterSpawn : PacketHandler

View File

@ -1,11 +1,11 @@
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x41)]
public class CreateCharacterOne : PacketHandler

View File

@ -0,0 +1,28 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x52)]
class _11_52_UNK : PacketHandler
{
private uint PlayerID { get; set; }
private uint unk1 { get; set; }
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
var reader = new PacketReader(data, position, size);
PlayerID = reader.ReadUInt32();
unk1 = reader.ReadUInt32();
Logger.Write($"PlayerID:{PlayerID} unk1:{unk1}");
context.SendPacket(new CreateCharacterInviteNicknameResponse());
}
}
}

View File

@ -1,11 +1,11 @@
using System;
using System.IO;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Database;
// This file is to hold all packet handlers that require no logic to respond to, or require less than 5 lines of logic.
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x54)]
public class CreateCharacterTwo : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x97)]
class CharacterRenameRequestPacket : PacketHandler

View File

@ -2,11 +2,11 @@
using PSO2SERVER.Database;
using System.Data.Entity;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using static PSO2SERVER.Packets.PSOPackets.CharacterNewNamePacket;
using PSO2SERVER.Protocol.Packets;
using static PSO2SERVER.Protocol.Packets.CharacterNewNamePacket;
using System.Linq;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0x9B)]
class CharacterNewNameRequest : PacketHandler

View File

@ -1,9 +1,9 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using static PSO2SERVER.Packets.Handlers.CharacterNewNameRequest;
using PSO2SERVER.Protocol.Packets;
using static PSO2SERVER.Protocol.Handlers.CharacterNewNameRequest;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0xB0)]
class Unk11B0 : PacketHandler
@ -16,8 +16,8 @@ namespace PSO2SERVER.Packets.Handlers
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
//var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
//Logger.WriteHex(info, data);
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
// 创建一个结构体实例
var packet = new Unk11B0Packet();

View File

@ -1,10 +1,10 @@
using PSO2SERVER.Database;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using PSO2SERVER.Party;
using System;
using System.Linq;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0xB8)]
public class CharacterShipTransferRightsRequest : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0xBC)]
class CharacterShipTransferCanceldRequest : PacketHandler

View File

@ -0,0 +1,17 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
using static PSO2SERVER.Protocol.Handlers.CharacterNewNameRequest;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0xC7)]
class CharacterShipInfoRequest : PacketHandler
{
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
}
}
}

View File

@ -2,9 +2,9 @@
using System.Linq;
using PSO2SERVER.Database;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x11, 0xEA)]
class NicknameError : PacketHandler

View File

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

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x19, 0x04)]
class _19_04_UNK : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x19, 0x06)]
class _19_06_UNK : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x19, 0x1C)]
class Unk191CPacketHandler : PacketHandler

View File

@ -0,0 +1,18 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x1C, 0x0E)]
class _1C_0E_UNK : PacketHandler
{
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
var reader = new PacketReader(data, position, size);
}
}
}

View File

@ -0,0 +1,27 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x1C, 0x1E)]
class _1C_1E_UNK : PacketHandler
{
public struct _1C_1E_PACKET
{
public uint player_id;
public uint unk1;
}
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
var reader = new PacketReader(data, position, size);
var pkt = reader.ReadStruct<_1C_1E_PACKET>();
Logger.Write("player_id {0} unk1 {1}", pkt.player_id, pkt.unk1);
}
}
}

View File

@ -0,0 +1,26 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x1C, 0x46)]
class _1C_46_UNK : PacketHandler
{
//PACKED
public struct _1C_46_PACKET
{
public uint unk1;
public uint unk2;
public uint unk3;
}
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
var reader = new PacketReader(data, position, size);
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x1C, 0x64)]
class _1C_64_UNK : PacketHandler
{
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
var info = string.Format("[<--] 接收到的数据 (hex): {0} 字节", data.Length);
Logger.WriteHex(info, data);
var reader = new PacketReader(data, position, size);
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x1F, 0x09)]
class _1F_09_UNK : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x21, 0x02)]
class FullPaletteInfoRequest : PacketHandler

View File

@ -1,9 +1,9 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using static PSO2SERVER.Models.Flags;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x23, 0x02)]
class SetFlagHandler : PacketHandler

View File

@ -2,9 +2,9 @@
using System.Runtime.InteropServices;
using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x23, 0x0B)]
class SkitItemAddRequest : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x2B, 0x00)]
class SettingsRequest : PacketHandler

View File

@ -3,9 +3,9 @@ using System.Data.Entity.Infrastructure;
using System.Linq;
using PSO2SERVER.Database;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x2B, 0x01)]
class SavePlayerSettings : PacketHandler

View File

@ -1,10 +1,10 @@
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x2F, 0x6)]

View File

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

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x4A, 0x00)]
class MissionListRequest : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x4D, 0x00)]
class MissionPassInfoRequest : PacketHandler

View File

@ -1,8 +1,8 @@
using System;
using PSO2SERVER.Models;
using PSO2SERVER.Packets.PSOPackets;
using PSO2SERVER.Protocol.Packets;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x4D, 0x02)]
class MissionPassRequest : PacketHandler

View File

@ -3,7 +3,7 @@ using System.Linq;
using System.Reflection;
using System.Collections.Generic;
namespace PSO2SERVER.Packets.Handlers
namespace PSO2SERVER.Protocol.Handlers
{
public class PacketHandlerAttr : Attribute
{
@ -30,7 +30,7 @@ namespace PSO2SERVER.Packets.Handlers
try
{
var handlers = (from t in Assembly.GetExecutingAssembly().GetTypes()
where t.IsClass && t.Namespace == "PSO2SERVER.Packets.Handlers" &&
where t.IsClass && t.Namespace == "PSO2SERVER.Protocol.Handlers" &&
t.IsSubclassOf(typeof(PacketHandler))
let attrs = (PacketHandlerAttr[])t.GetCustomAttributes(typeof(PacketHandlerAttr), false)
where attrs.Length > 0

View File

@ -1,6 +1,6 @@
using PSO2SERVER.Models;
namespace PSO2SERVER.Packets
namespace PSO2SERVER.Protocol
{
public abstract class Packet
{

View File

@ -5,7 +5,7 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace PSO2SERVER.Packets
namespace PSO2SERVER.Protocol
{
public class PacketReader : BinaryReader
{

View File

@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
using System.Text;
using PSO2SERVER.Models;
namespace PSO2SERVER.Packets
namespace PSO2SERVER.Protocol
{
public class PacketWriter : BinaryWriter
{

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class UnkPacket : Packet
{

View File

@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using static PSO2SERVER.Zone.Map;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class MapTransferPacket : Packet
{

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class LoadingScreenTransitionPacket : Packet
{

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class Unk0306Packet : Packet
{

View File

@ -2,7 +2,7 @@
using System.IO;
using PSO2SERVER.Models;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
class ServerHelloPacket : Packet
{

View File

@ -2,7 +2,7 @@
using System.IO;
using PSO2SERVER.Models;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
class ServerPingPacket : Packet
{

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class LoadingScreenRemovePacket : Packet
{

View File

@ -5,7 +5,7 @@ using System.IO;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class LoadingLevelPacket : Packet
{

View File

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class UnlockControlsPacket : Packet
{

View File

@ -1,7 +1,7 @@
using System;
using PSO2SERVER.Models;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
class TeleportTransferPacket : Packet
{

View File

@ -5,7 +5,7 @@ using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace PSO2SERVER.Packets.PSOPackets
namespace PSO2SERVER.Protocol.Packets
{
public class DespawnObjectPacket : Packet
{

Some files were not shown because too many files have changed in this diff Show More