add missing package.json and attributes, added example 22
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<RootNamespace>_22CustomSptCommand</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Library</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- TODO: Change to Nuget Package -->
|
||||
<ItemGroup>
|
||||
<Reference Include="Core">
|
||||
<HintPath>..\TempReferences\Core.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<CopyLocal>false</CopyLocal>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="SptCommon">
|
||||
<HintPath>..\TempReferences\SptCommon.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<CopyLocal>false</CopyLocal>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
<Reference Include="SptDependencyInjection">
|
||||
<HintPath>..\TempReferences\SptDependencyInjection.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<CopyLocal>false</CopyLocal>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="package.json">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,41 @@
|
||||
using Core.Helpers;
|
||||
using Core.Helpers.Dialog.Commando.SptCommands;
|
||||
using Core.Models.Eft.Dialog;
|
||||
using Core.Models.Eft.Profile;
|
||||
using Core.Services;
|
||||
using SptCommon.Annotations;
|
||||
|
||||
namespace _22CustomSptCommand;
|
||||
|
||||
[Injectable]
|
||||
public class CustomSptCommand : ISptCommand
|
||||
{
|
||||
private readonly MailSendService _mailSendService;
|
||||
private readonly ItemHelper _itemHelper;
|
||||
|
||||
public CustomSptCommand(
|
||||
MailSendService mailSendService,
|
||||
ItemHelper itemHelper
|
||||
)
|
||||
{
|
||||
_mailSendService = mailSendService;
|
||||
_itemHelper = itemHelper;
|
||||
}
|
||||
|
||||
public string GetCommand()
|
||||
{
|
||||
return "getName";
|
||||
}
|
||||
|
||||
public string GetCommandHelp()
|
||||
{
|
||||
return "Usage: spt getName tplId";
|
||||
}
|
||||
|
||||
public string PerformAction(UserDialogInfo commandHandler, string sessionId, SendMessageRequest request)
|
||||
{
|
||||
var splitCommand = request.Text.Split(" ");
|
||||
_mailSendService.SendUserMessageToPlayer(sessionId, commandHandler, $"That templateId belongs to item {_itemHelper.GetItem(splitCommand[2]).Value?.Properties?.Name ?? ""}");
|
||||
return request.DialogId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"Name": "22CustomSptCommand",
|
||||
"Version": "1.0.0",
|
||||
"SptVersion": "~4.0",
|
||||
"LoadBefore": [],
|
||||
"LoadAfter": [],
|
||||
"IncompatibileMods": [],
|
||||
"Url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods",
|
||||
"IsBundleMod": false,
|
||||
"Author": "SPT",
|
||||
"Contributors": [],
|
||||
"Licence": "MIT"
|
||||
}
|
||||
Reference in New Issue
Block a user