mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-12 21:04:41 +01:00
feat: set warship theme
This commit is contained in:
@@ -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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using KianaBH.GameServer.Server.Packet.Send.Player;
|
using KianaBH.GameServer.Server.Packet.Send.Player;
|
||||||
using KianaBH.GameServer.Server.Packet.Send.Warship;
|
|
||||||
using KianaBH.Proto;
|
using KianaBH.Proto;
|
||||||
|
|
||||||
namespace KianaBH.GameServer.Server.Packet.Recv.Warship;
|
namespace KianaBH.GameServer.Server.Packet.Recv.Warship;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,4 +25,18 @@ public class PacketGetMainDataRsp : BasePacket
|
|||||||
|
|
||||||
SetData(proto);
|
SetData(proto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PacketGetMainDataRsp(uint warshipId) : base(CmdIds.GetMainDataRsp)
|
||||||
|
{
|
||||||
|
var proto = new GetMainDataRsp
|
||||||
|
{
|
||||||
|
WarshipTheme = new WarshipThemeData
|
||||||
|
{
|
||||||
|
WarshipId = (uint)warshipId,
|
||||||
|
},
|
||||||
|
TypeList = { 35 },
|
||||||
|
};
|
||||||
|
|
||||||
|
SetData(proto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user