feat(chat): route retail lifestone commands
Separate retail client actions, ACE server commands, and ordinary chat at the shared router. Port lifestone/lif/ls from the named retail registry through a typed App controller to game action 0x0063, keep unknown verbs on ACE Talk, and cover both UI backends plus exact outbound bytes. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
5090aa7217
commit
5a45a7ac7f
19 changed files with 604 additions and 78 deletions
|
|
@ -5,7 +5,7 @@ namespace AcDream.UI.Abstractions.Tests.Panels.Chat;
|
|||
|
||||
/// <summary>
|
||||
/// Phase I.4: when the user submits text via the chat input field, the
|
||||
/// panel must publish a <see cref="SendChatCmd"/> to the command bus.
|
||||
/// panel must publish the appropriate typed intent to the command bus.
|
||||
/// We exercise the full Render path with the <see cref="FakePanelRenderer"/>
|
||||
/// pre-loading a "submitted" string and a recording bus capturing the
|
||||
/// resulting command.
|
||||
|
|
@ -114,10 +114,9 @@ public sealed class ChatPanelInputTests
|
|||
|
||||
[Theory]
|
||||
[InlineData("/foo", "@foo")]
|
||||
[InlineData("/ls", "@ls")]
|
||||
[InlineData("/mp /tools/script.py", "@mp /tools/script.py")]
|
||||
[InlineData("/genio public", "@genio public")]
|
||||
public void Submit_UnknownSlashCommand_RoutesToServerAsAtCommand(string raw, string expectedText)
|
||||
public void Submit_UnknownSlashCommand_RoutesToExplicitServerCommand(string raw, string expectedText)
|
||||
{
|
||||
// Phase J Tier 4 held: /-prefixed text is still NEVER broadcast
|
||||
// as plain speech. Retail treats / and @ as equivalent command
|
||||
|
|
@ -136,12 +135,33 @@ public sealed class ChatPanelInputTests
|
|||
|
||||
panel.Render(new PanelContext(0.016f, bus), renderer);
|
||||
|
||||
var sendCmd = Assert.IsType<SendChatCmd>(Assert.Single(bus.Published));
|
||||
Assert.Equal(ChatChannelKind.Say, sendCmd.Channel);
|
||||
var sendCmd = Assert.IsType<SendServerCommandCmd>(Assert.Single(bus.Published));
|
||||
Assert.Equal(expectedText, sendCmd.Text);
|
||||
Assert.Empty(log.Snapshot()); // no local "Unknown command" guess
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("/lifestone")]
|
||||
[InlineData("/lif")]
|
||||
[InlineData("/ls")]
|
||||
[InlineData("@LS")]
|
||||
public void Submit_LifestoneAlias_PublishesTypedClientCommand(string raw)
|
||||
{
|
||||
var vm = new ChatVM(new ChatLog());
|
||||
var panel = new ChatPanel(vm);
|
||||
var bus = new RecordingBus();
|
||||
var renderer = new FakePanelRenderer
|
||||
{
|
||||
InputTextSubmitNextSubmitted = raw,
|
||||
InputTextSubmitNextBufferAfter = "",
|
||||
};
|
||||
|
||||
panel.Render(new PanelContext(0.016f, bus), renderer);
|
||||
|
||||
var command = Assert.IsType<ExecuteClientCommandCmd>(Assert.Single(bus.Published));
|
||||
Assert.Equal(ClientCommandId.LifestoneRecall, command.Command);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("/")]
|
||||
[InlineData("//shrug")]
|
||||
|
|
@ -170,12 +190,12 @@ public sealed class ChatPanelInputTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void Submit_AtAcehelp_PassesThroughToSayWithAtIntact()
|
||||
public void Submit_AtAcehelp_PublishesExplicitServerCommand()
|
||||
{
|
||||
// Unknown @-verb falls through to the default channel with the
|
||||
// literal "@acehelp" text intact so ACE's CommandManager
|
||||
// intercepts it server-side. We DO publish a SendChatCmd here —
|
||||
// the publish is what carries the message to the server.
|
||||
// intercepts it server-side. The explicit server-command record keeps
|
||||
// it distinct from ordinary Say text.
|
||||
var log = new ChatLog();
|
||||
var vm = new ChatVM(log);
|
||||
var panel = new ChatPanel(vm);
|
||||
|
|
@ -188,8 +208,7 @@ public sealed class ChatPanelInputTests
|
|||
|
||||
panel.Render(new PanelContext(0.016f, bus), renderer);
|
||||
|
||||
var sendCmd = Assert.IsType<SendChatCmd>(Assert.Single(bus.Published));
|
||||
Assert.Equal(ChatChannelKind.Say, sendCmd.Channel);
|
||||
var sendCmd = Assert.IsType<SendServerCommandCmd>(Assert.Single(bus.Published));
|
||||
Assert.Equal("@acehelp", sendCmd.Text);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue