M src/Anonymizer/Extensions/ServiceCollectionExtensions.cs => src/Anonymizer/Extensions/ServiceCollectionExtensions.cs +10 -0
@@ 10,6 10,7 @@ using Anonymizer.Movers.Basic;
using Microsoft.Extensions.DependencyInjection;
using NosSmooth.Packets;
using NosSmooth.Packets.Client;
+using NosSmooth.Packets.Client.Battle;
using NosSmooth.Packets.Client.Inventory;
using NosSmooth.Packets.Server.Battle;
using NosSmooth.Packets.Server.Character;
@@ 41,6 42,7 @@ public static class ServiceCollectionExtensions
.AddSingleton<PacketProcessor>()
.AddSingleton<IAnonymizer, DefaultAnonymizer>()
.AddTransient<IFilter, HeaderFilter>()
+ .AddTransient<IFilter, MessageFilter>()
.AddBasicMovers();
/// <summary>
@@ 71,6 73,14 @@ public static class ServiceCollectionExtensions
.AddMover<StPacketMover, StPacket>()
.AddMover<SuPacketMover, SuPacket>()
.AddMover<TwkPacketMover, TwkPacket>()
+ .AddMover<AtPacketMover, AtPacket>()
+ .AddMover<EqPacketMover, EqPacket>()
+ .AddMover<NcifPacketMover, NcifPacket>()
+ .AddMover<RevivePacketMover, RevivePacket>()
+ .AddMover<TitinfoPacketMover, TitinfoPacket>()
+ .AddMover<UPetPacketMover, UsePetSkillPacket>()
+ .AddMover<UPPacketMover, UsePartnerSkillPacket>()
+ .AddMover<USPacketMover, UseSkillPacket>()
.AddMover<CListPacketMover, CListPacket>();
/// <summary>
A src/Anonymizer/Movers/Basic/AtPacketMover.cs => src/Anonymizer/Movers/Basic/AtPacketMover.cs +20 -0
@@ 0,0 1,20 @@
+//
+// AtPacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Server.Maps;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class AtPacketMover : AbstractMover<AtPacket>
+{
+ /// <inheritdoc />
+ public override AtPacket Move(IAnonymizer anonymizer, AtPacket packet)
+ => packet with
+ {
+ CharacterId = anonymizer.AnonymizeId(packet.CharacterId)
+ };
+}<
\ No newline at end of file
A src/Anonymizer/Movers/Basic/EqPacketMover.cs => src/Anonymizer/Movers/Basic/EqPacketMover.cs +20 -0
@@ 0,0 1,20 @@
+//
+// EqPacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Server.Inventory;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class EqPacketMover : AbstractMover<EqPacket>
+{
+ /// <inheritdoc />
+ public override EqPacket Move(IAnonymizer anonymizer, EqPacket packet)
+ => packet with
+ {
+ CharacterId = anonymizer.AnonymizeId(packet.CharacterId)
+ };
+}<
\ No newline at end of file
A src/Anonymizer/Movers/Basic/NcifPacketMover.cs => src/Anonymizer/Movers/Basic/NcifPacketMover.cs +20 -0
@@ 0,0 1,20 @@
+//
+// NcifPacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Client.Battle;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class NcifPacketMover : AbstractMover<NcifPacket>
+{
+ /// <inheritdoc />
+ public override NcifPacket Move(IAnonymizer anonymizer, NcifPacket packet)
+ => packet with
+ {
+ TargetId = anonymizer.AnonymizeId(packet.TargetId)
+ };
+}<
\ No newline at end of file
A src/Anonymizer/Movers/Basic/RevivePacketMover.cs => src/Anonymizer/Movers/Basic/RevivePacketMover.cs +20 -0
@@ 0,0 1,20 @@
+//
+// RevivePacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Server.Entities;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class RevivePacketMover : AbstractMover<RevivePacket>
+{
+ /// <inheritdoc />
+ public override RevivePacket Move(IAnonymizer anonymizer, RevivePacket packet)
+ => packet with
+ {
+ EntityId = anonymizer.AnonymizeId(packet.EntityId)
+ };
+}<
\ No newline at end of file
A src/Anonymizer/Movers/Basic/TitinfoPacketMover.cs => src/Anonymizer/Movers/Basic/TitinfoPacketMover.cs +20 -0
@@ 0,0 1,20 @@
+//
+// TitinfoPacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Server.Character;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class TitinfoPacketMover : AbstractMover<TitinfoPacket>
+{
+ /// <inheritdoc />
+ public override TitinfoPacket Move(IAnonymizer anonymizer, TitinfoPacket packet)
+ => packet with
+ {
+ CharacterId = anonymizer.AnonymizeId(packet.CharacterId)
+ };
+}<
\ No newline at end of file
A src/Anonymizer/Movers/Basic/UPPacketMover.cs => src/Anonymizer/Movers/Basic/UPPacketMover.cs +21 -0
@@ 0,0 1,21 @@
+//
+// UPPacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Client.Battle;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class UPPacketMover : AbstractMover<UsePartnerSkillPacket>
+{
+ /// <inheritdoc />
+ public override UsePartnerSkillPacket Move(IAnonymizer anonymizer, UsePartnerSkillPacket packet)
+ => packet with
+ {
+ MateTransportId = anonymizer.AnonymizeId(packet.MateTransportId),
+ TargetId = anonymizer.AnonymizeId(packet.TargetId)
+ };
+}<
\ No newline at end of file
A src/Anonymizer/Movers/Basic/UPetPacketMover.cs => src/Anonymizer/Movers/Basic/UPetPacketMover.cs +21 -0
@@ 0,0 1,21 @@
+//
+// UPetPacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Client.Battle;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class UPetPacketMover : AbstractMover<UsePetSkillPacket>
+{
+ /// <inheritdoc />
+ public override UsePetSkillPacket Move(IAnonymizer anonymizer, UsePetSkillPacket packet)
+ => packet with
+ {
+ MateTransportId = anonymizer.AnonymizeId(packet.MateTransportId),
+ TargetId = anonymizer.AnonymizeId(packet.TargetId)
+ };
+}<
\ No newline at end of file
A src/Anonymizer/Movers/Basic/USPacketMover.cs => src/Anonymizer/Movers/Basic/USPacketMover.cs +20 -0
@@ 0,0 1,20 @@
+//
+// USPacketMover.cs
+//
+// Copyright (c) František Boháček. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using NosSmooth.Packets.Client.Battle;
+
+namespace Anonymizer.Movers.Basic;
+
+/// <inheritdoc />
+public class USPacketMover : AbstractMover<UseSkillPacket>
+{
+ /// <inheritdoc />
+ public override UseSkillPacket Move(IAnonymizer anonymizer, UseSkillPacket packet)
+ => packet with
+ {
+ TargetId = anonymizer.AnonymizeId(packet.TargetId)
+ };
+}<
\ No newline at end of file