Send the available chat commands to clients which can show them

Adds the server side of the chat command list: a view plugin which
sends one ChatCommandInfo per available command, and the handler for
the request of a client which supports it.

Both are limited to the extended protocol, so classic clients don't
receive messages they can't understand. The commands come from
GetAvailableChatCommandInfos, so a player only learns about the ones
he may execute, and deactivated ones stay out.

Executing a command needs nothing new: the client sends the composed
command line as an ordinary chat message, which the chat message
processor already routes to the command without broadcasting it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSpK6jkyF8ZS5nYXyGwYxA
(cherry picked from commit f3a9cb132c295863942bb0f06f40cde231e57907)
This commit is contained in:
Claude
2026-07-25 21:15:58 +00:00
committed by Acentech Dev
parent 4f83b72de8
commit 066894c4f6
7 changed files with 370 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
// <copyright file="IChatCommandListViewPlugIn.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.GameLogic.Views;
using MUnique.OpenMU.GameLogic.PlugIns.ChatCommands;
/// <summary>
/// Interface of a view whose client can show the available chat commands to the player.
/// </summary>
public interface IChatCommandListViewPlugIn : IViewPlugIn
{
/// <summary>
/// Shows the chat commands which are available to the player, so that the client
/// can offer them without requiring the player to know or type any of them.
/// </summary>
/// <param name="commands">The available chat commands.</param>
ValueTask ShowChatCommandListAsync(IReadOnlyCollection<ChatCommandInfo> commands);
}