add injectable att, add mod example 20
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<RootNamespace>_20CustomChatBot</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>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,48 @@
|
||||
using Core.Helpers.Dialogue;
|
||||
using Core.Models.Eft.Dialog;
|
||||
using Core.Models.Eft.Profile;
|
||||
using Core.Models.Enums;
|
||||
using Core.Services;
|
||||
using SptCommon.Annotations;
|
||||
|
||||
namespace _20CustomChatBot;
|
||||
|
||||
[Injectable]
|
||||
public class CustomChatBot : IDialogueChatBot
|
||||
{
|
||||
private MailSendService _mailSendService;
|
||||
|
||||
public CustomChatBot(
|
||||
MailSendService mailSendService
|
||||
)
|
||||
{
|
||||
_mailSendService = mailSendService;
|
||||
}
|
||||
|
||||
public UserDialogInfo GetChatBot()
|
||||
{
|
||||
return new UserDialogInfo
|
||||
{
|
||||
Id = "modderBuddy",
|
||||
Aid = 9999999,
|
||||
Info = new UserDialogDetails
|
||||
{
|
||||
Nickname = "Buddy",
|
||||
Side = "Usec",
|
||||
Level = 69,
|
||||
MemberCategory = MemberCategory.Sherpa,
|
||||
SelectedMemberCategory = MemberCategory.Sherpa
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public string? HandleMessage(string sessionId, SendMessageRequest request)
|
||||
{
|
||||
_mailSendService.SendUserMessageToPlayer(
|
||||
sessionId,
|
||||
GetChatBot(),
|
||||
$"Im Buddy! I just reply back what you typed to me!\n{request.Text}");
|
||||
|
||||
return request.DialogId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"Name": "20CustomChatBot",
|
||||
"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