0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 07:10:44 -05:00

Added coreConfig.features.chatbotFeatures.sptFriendGiftsEnabled, default true

This commit is contained in:
Dev 2024-09-24 16:41:02 +01:00
parent 4ea528c381
commit be7e07fa4e
3 changed files with 25 additions and 22 deletions

View File

@ -23,6 +23,7 @@
"compressProfile": false,
"chatbotFeatures": {
"sptFriendEnabled": true,
"sptFriendGiftsEnabled": true,
"commandoEnabled": true,
"commandoFeatures": {
"giveCommandEnabled": true

View File

@ -53,33 +53,34 @@ export class SptDialogueChatBot implements IDialogueChatBot {
const sender = this.profileHelper.getPmcProfile(sessionId);
const sptFriendUser = this.getChatBot();
const giftSent = this.giftService.sendGiftToPlayer(sessionId, request.text);
const requestInput = request.text.toLowerCase();
if (giftSent === GiftSentResult.SUCCESS) {
this.mailSendService.sendUserMessageToPlayer(
sessionId,
sptFriendUser,
this.randomUtil.getArrayValue([
"Hey! you got the right code!",
"A secret code, how exciting!",
"You found a gift code!",
]),
);
// only check if entered text is gift code when feature enabled
if (this.coreConfig.features.chatbotFeatures.sptFriendGiftsEnabled) {
const giftSent = this.giftService.sendGiftToPlayer(sessionId, request.text);
if (giftSent === GiftSentResult.SUCCESS) {
this.mailSendService.sendUserMessageToPlayer(
sessionId,
sptFriendUser,
this.randomUtil.getArrayValue([
"Hey! you got the right code!",
"A secret code, how exciting!",
"You found a gift code!",
]),
);
return;
}
return;
}
if (giftSent === GiftSentResult.FAILED_GIFT_ALREADY_RECEIVED) {
this.mailSendService.sendUserMessageToPlayer(
sessionId,
sptFriendUser,
this.randomUtil.getArrayValue(["Looks like you already used that code", "You already have that!!"]),
);
if (giftSent === GiftSentResult.FAILED_GIFT_ALREADY_RECEIVED) {
this.mailSendService.sendUserMessageToPlayer(
sessionId,
sptFriendUser,
this.randomUtil.getArrayValue(["Looks like you already used that code", "You already have that!!"]),
);
return;
return;
}
}
if (requestInput.includes("love you")) {

View File

@ -88,6 +88,7 @@ export interface IServerFeatures {
export interface IChatbotFeatures {
sptFriendEnabled: boolean;
sptFriendGiftsEnabled: boolean;
commandoEnabled: boolean;
commandoFeatures: ICommandoFeatures;
commandUseLimits: Record<string, number>;