This commit is contained in:
rfi
2024-02-22 06:50:42 +07:00
parent b232088f4d
commit 5d39e1c6be
6 changed files with 306 additions and 9 deletions

View File

@@ -1,9 +1,23 @@
using BLHX.Server.Common.Proto.p12;
using BLHX.Server.Common.Proto;
using BLHX.Server.Common.Proto.p12;
namespace BLHX.Server.Game.Handlers
{
internal static class P12
{
[PacketHandler(Command.Cs12102, SaveDataAfterRun = true)]
static void UpdateFleetHandler(Connection connection, Packet packet)
{
var fleet = packet.Decode<Cs12102>();
var toUpdate = connection.player.Fleets.Find(x => x.Id == fleet.Id);
if (toUpdate is not null)
toUpdate.ShipLists = fleet.ShipLists;
else
connection.player.Fleets.Add(new() { Id = fleet.Id, ShipLists = fleet.ShipLists });
connection.Send(new Sc12103());
}
}
static class P12ConnectionNotifyExtensions
@@ -30,12 +44,7 @@ namespace BLHX.Server.Game.Handlers
{
connection.Send(new Sc12101()
{
GroupLists = [
new Groupinfo() { Id = 1, ShipLists = [1, 2] },
new Groupinfo() { Id = 2 },
new Groupinfo() { Id = 11 },
new Groupinfo() { Id = 12 }
]
GroupLists = connection.player.Fleets
});
}
}

View File

@@ -8,7 +8,14 @@ namespace BLHX.Server.Game.Handlers
[PacketHandler(Command.Cs24020)]
static void LimitChallengeHandler(Connection connection, Packet packet)
{
connection.Send(new Sc24021());
connection.Send(new Sc24021()
{
Awards = [
new() { Key = 10025, Value = 0 },
new() { Key = 10026, Value = 0 },
new() { Key = 10027, Value = 0 }
]
});
}
}
}