feat: set warship theme

This commit is contained in:
Naruse
2025-06-17 13:33:39 +08:00
parent 7f4e4b38c5
commit 981f2479d9
7 changed files with 31 additions and 65 deletions

View File

@@ -1,13 +0,0 @@
using KianaBH.GameServer.Server.Packet.Send.Test;
using KianaBH.Proto;
namespace KianaBH.GameServer.Server.Packet.Recv.Test;
[Opcode(CmdIds.SetWarshipReq)]
public class HandlerSetWarshipReq : Handler
{
public override async Task OnHandle(Connection connection, byte[] header, byte[] data)
{
await connection.SendPacket(new PacketSetWarshipRsp());
}
}

View File

@@ -1,5 +1,4 @@
using KianaBH.GameServer.Server.Packet.Send.Player;
using KianaBH.GameServer.Server.Packet.Send.Warship;
using KianaBH.Proto;
namespace KianaBH.GameServer.Server.Packet.Recv.Warship;

View File

@@ -0,0 +1,17 @@
using KianaBH.GameServer.Server.Packet.Send.Player;
using KianaBH.Proto;
namespace KianaBH.GameServer.Server.Packet.Recv.Warship;
[Opcode(CmdIds.SetWarshipReq)]
public class HandlerSetWarshipReq : Handler
{
public override async Task OnHandle(Connection connection, byte[] header, byte[] data)
{
var req = SetWarshipReq.Parser.ParseFrom(data);
connection.Player!.Data!.WarshipId = (int)req.WarshipId;
await connection.SendPacket(new PacketGetMainDataRsp(req.WarshipId));
await connection.SendPacket(CmdIds.SetWarshipRsp);
}
}

View File

@@ -25,4 +25,18 @@ public class PacketGetMainDataRsp : BasePacket
SetData(proto);
}
public PacketGetMainDataRsp(uint warshipId) : base(CmdIds.GetMainDataRsp)
{
var proto = new GetMainDataRsp
{
WarshipTheme = new WarshipThemeData
{
WarshipId = (uint)warshipId,
},
TypeList = { 35 },
};
SetData(proto);
}
}

View File

@@ -1,17 +0,0 @@
using KianaBH.KcpSharp;
using KianaBH.Proto;
namespace KianaBH.GameServer.Server.Packet.Send.Test;
public class PacketSetWarshipAvatarRsp : BasePacket
{
public PacketSetWarshipAvatarRsp() : base(CmdIds.SetWarshipAvatarRsp)
{
var proto = new SetWarshipAvatarRsp
{
};
SetData(proto);
}
}

View File

@@ -1,17 +0,0 @@
using KianaBH.KcpSharp;
using KianaBH.Proto;
namespace KianaBH.GameServer.Server.Packet.Send.Test;
public class PacketSetWarshipRsp : BasePacket
{
public PacketSetWarshipRsp() : base(CmdIds.SetWarshipRsp)
{
var proto = new SetWarshipRsp
{
};
SetData(proto);
}
}

View File

@@ -1,17 +0,0 @@
using KianaBH.KcpSharp;
using KianaBH.Proto;
namespace KianaBH.GameServer.Server.Packet.Send.Warship;
public class PacketSetWarshipAvatarRsp : BasePacket
{
public PacketSetWarshipAvatarRsp() : base(CmdIds.SetWarshipAvatarRsp)
{
var proto = new SetWarshipAvatarRsp
{
Retcode = SetWarshipAvatarRsp.Types.Retcode.Succ,
};
SetData(proto);
}
}