feat(command): expose registration snapshots for inspection
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<AssemblyName>ShrinkCommand.Runtime</AssemblyName>
|
||||
<RootNamespace>ShrinkCommand</RootNamespace>
|
||||
<PackageId>ShrinkSDK.Command</PackageId>
|
||||
<Version>0.3.0</Version>
|
||||
<Version>0.4.2</Version>
|
||||
<Description>ShrinkSDK command parsing, permissions and execution runtime.</Description>
|
||||
<ShrinkCodeGenEnabled>false</ShrinkCodeGenEnabled>
|
||||
</PropertyGroup>
|
||||
@@ -13,6 +13,6 @@
|
||||
<Compile Include="..\Runtime\**\*.cs" />
|
||||
<PackageReference Include="UniTask" Version="2.5.10" />
|
||||
<PackageReference Include="ShrinkSDK.Runtime.Abstractions" Version="0.1.0" />
|
||||
<PackageReference Include="ShrinkSDK.CodeGen" Version="0.1.0" PrivateAssets="compile;runtime;contentfiles;native" />
|
||||
<PackageReference Include="ShrinkSDK.CodeGen" Version="0.2.0" PrivateAssets="compile;runtime;contentfiles;native" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -85,3 +85,13 @@ service.RegisterCommands(myCommandInstance);
|
||||
- 运行时创建的对象
|
||||
- 模组实例
|
||||
- 需要带状态的命令宿主
|
||||
|
||||
## 可复用能力
|
||||
|
||||
<!-- shrink:capabilities -->
|
||||
Capability: 路径式命令解析、参数转换、来源权限和帮助输出
|
||||
Aliases: 命令 控制台 控制 指令 权限 command
|
||||
Limits: 不替代游戏行为实现;从网络调用仍需检查命令来源与权限;注册与执行归宿主协调
|
||||
Extension: ShrinkCommandRegistration;RegisterConverter;ShrinkCommandAttribute
|
||||
Evidence: [ShrinkCommandService](Runtime/Core/ShrinkCommandService.cs); [ShrinkCommandRegistration](Runtime/Core/ShrinkCommandService.cs)
|
||||
<!-- /shrink:capabilities -->
|
||||
|
||||
@@ -56,6 +56,9 @@ namespace ShrinkCommand
|
||||
RegisterBuiltInCommands();
|
||||
}
|
||||
|
||||
public IReadOnlyList<(string Path, MethodInfo Handler)> CaptureBindings() => _commands
|
||||
.Select(command => (command.Descriptor.Path, command.Handler.Method)).ToArray();
|
||||
|
||||
public IReadOnlyList<ShrinkCommandDescriptor> Commands => _commands
|
||||
.Select(command => command.Descriptor)
|
||||
.OrderBy(command => command.Path, StringComparer.OrdinalIgnoreCase)
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "com.cneicy.shrink-command",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.2",
|
||||
"displayName": "ShrinkCommand",
|
||||
"description": "独立于网络层的 Unity 命令系统,提供路径式命令、权限、帮助输出与属性式注册。",
|
||||
"unity": "2022.3",
|
||||
"dependencies": {
|
||||
"com.cneicy.shrink-shared-codegen": "0.1.1",
|
||||
"com.cneicy.shrink-shared-codegen": "0.2.1",
|
||||
"com.cysharp.unitask": "2.5.10"
|
||||
},
|
||||
"keywords": [
|
||||
|
||||
Reference in New Issue
Block a user