From 83b07faddf2472820b941834fb2033fb423fb285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sun, 15 Jan 2023 11:47:07 +0100 Subject: [PATCH] feat: add rdlstf packet mover --- .../Extensions/ServiceCollectionExtensions.cs | 1 + .../Movers/Basic/RdlstfPacketMover.cs | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/Anonymizer/Movers/Basic/RdlstfPacketMover.cs diff --git a/src/Anonymizer/Extensions/ServiceCollectionExtensions.cs b/src/Anonymizer/Extensions/ServiceCollectionExtensions.cs index 76e5f48..748719d 100644 --- a/src/Anonymizer/Extensions/ServiceCollectionExtensions.cs +++ b/src/Anonymizer/Extensions/ServiceCollectionExtensions.cs @@ -69,6 +69,7 @@ public static class ServiceCollectionExtensions .AddMover() .AddMover() .AddMover() + .AddMover() .AddMover() .AddMover() .AddMover() diff --git a/src/Anonymizer/Movers/Basic/RdlstfPacketMover.cs b/src/Anonymizer/Movers/Basic/RdlstfPacketMover.cs new file mode 100644 index 0000000..5a74d50 --- /dev/null +++ b/src/Anonymizer/Movers/Basic/RdlstfPacketMover.cs @@ -0,0 +1,28 @@ +// +// RdlstfPacketMover.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.Raids; + +namespace Anonymizer.Movers.Basic; + +/// +public class RdlstfPacketMover : AbstractMover +{ + /// + public override RdlstfPacket Move(IAnonymizer anonymizer, RdlstfPacket packet) + => packet with + { + Players = packet.Players.Select + ( + p => p with + { + Id = anonymizer.AnonymizeId(p.Id), + Name = anonymizer.AnonymizeName(p.Name) + } + ) + .ToArray() + }; +} \ No newline at end of file -- 2.48.1