mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-14 05:44:34 +01:00
feat: add dress system
This commit is contained in:
17
GameServer/Server/Packet/Recv/Avatar/HandlerSetDressReq.cs
Normal file
17
GameServer/Server/Packet/Recv/Avatar/HandlerSetDressReq.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using KianaBH.Proto;
|
||||
|
||||
namespace KianaBH.GameServer.Server.Packet.Recv.Avatar;
|
||||
|
||||
[Opcode(CmdIds.SetDressReq)]
|
||||
public class HandlerSetDressReq : Handler
|
||||
{
|
||||
public override async Task OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
var req = SetDressReq.Parser.ParseFrom(data);
|
||||
var player = connection.Player!;
|
||||
var valk = player.AvatarManager!.GetAvatar((int)req.AvatarId);
|
||||
if (valk == null) return;
|
||||
valk.DressId = (int)req.DressId;
|
||||
await connection.SendPacket(CmdIds.SetDressRsp);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using KianaBH.GameServer.Server.Packet.Send.Test;
|
||||
using KianaBH.Proto;
|
||||
|
||||
namespace KianaBH.GameServer.Server.Packet.Recv.Test;
|
||||
|
||||
[Opcode(CmdIds.SetDressReq)]
|
||||
public class HandlerSetDressReq : Handler
|
||||
{
|
||||
public override async Task OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
await connection.SendPacket(new PacketSetDressRsp());
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using KianaBH.KcpSharp;
|
||||
using KianaBH.Proto;
|
||||
|
||||
namespace KianaBH.GameServer.Server.Packet.Send.Test;
|
||||
|
||||
public class PacketSetDressRsp : BasePacket
|
||||
{
|
||||
public PacketSetDressRsp() : base(CmdIds.SetDressRsp)
|
||||
{
|
||||
var proto = new SetDressRsp
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user