baseline: OpenMU upstream b5a0961 (fresh source)

This commit is contained in:
Acentech Dev
2026-07-14 19:00:35 +03:00
parent 450402e47d
commit 36fc125d5c
11968 changed files with 748705 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// <copyright file="TalkNpcHandlerPlugInBase.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.GameServer.MessageHandler;
using MUnique.OpenMU.GameLogic;
using MUnique.OpenMU.GameLogic.NPC;
using MUnique.OpenMU.GameLogic.PlayerActions;
using MUnique.OpenMU.Network.Packets.ClientToServer;
/// <summary>
/// Handler for talk npc request packets.
/// </summary>
internal abstract class TalkNpcHandlerPlugInBase : IPacketHandlerPlugIn
{
/// <inheritdoc/>
public virtual bool IsEncryptionExpected => false;
/// <inheritdoc/>
public byte Key => TalkToNpcRequest.Code;
/// <summary>
/// Gets the talk NPC action.
/// </summary>
protected abstract TalkNpcAction TalkNpcAction { get; }
/// <inheritdoc/>
public async ValueTask HandlePacketAsync(Player player, Memory<byte> packet)
{
TalkToNpcRequest message = packet;
if (player.CurrentMap?.GetObject(message.NpcId) is NonPlayerCharacter npc)
{
await this.TalkNpcAction.TalkToNpcAsync(player, npc).ConfigureAwait(false);
}
}
}