diff --git a/README.md b/README.md index 44b845b..ebde58d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mod examples for v3.7.5 +# Mod examples for v3.7.6 A collection of example mods that perform typical actions in SPT diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts b/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts b/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/13AddTrader/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/13AddTrader/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts b/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/13AddTrader/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/13AddTrader/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/13AddTrader/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/13AddTrader/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/13AddTrader/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/13AddTrader/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/13AddTrader/types/servers/SaveServer.d.ts b/TypeScript/13AddTrader/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/13AddTrader/types/servers/SaveServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts b/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/13AddTrader/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts b/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/15HttpListenerExample/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/15HttpListenerExample/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/15HttpListenerExample/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts b/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/16ImporterUtil/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/16ImporterUtil/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts b/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts b/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/16ImporterUtil/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/16ImporterUtil/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/16ImporterUtil/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/16ImporterUtil/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts b/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts b/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/18CustomItemService/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/18CustomItemService/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/18CustomItemService/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/18CustomItemService/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts b/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts b/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts b/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/18CustomItemService/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/18CustomItemService/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/18CustomItemService/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/18CustomItemService/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/18CustomItemService/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts b/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts b/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/18CustomItemService/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts b/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts b/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/1LogToConsole/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/1LogToConsole/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/1LogToConsole/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/1LogToConsole/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts b/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts b/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/1LogToConsole/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts b/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts b/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts index d79a688..8d47886 100644 --- a/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/DialogueController.d.ts @@ -8,6 +8,7 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequ import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -17,8 +18,9 @@ export declare class DialogueController { protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; + protected configServer: ConfigServer; protected dialogueChatBots: IDialogueChatBot[]; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, dialogueChatBots: IDialogueChatBot[]); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index d7b05b1..62fb63e 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -2,9 +2,11 @@ import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCo import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; - constructor(sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts index a035e43..68fbc14 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts @@ -25,4 +25,13 @@ export interface IGameFixes { export interface IServerFeatures { autoInstallModDependencies: boolean; compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts index d79a688..8d47886 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/DialogueController.d.ts @@ -8,6 +8,7 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequ import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -17,8 +18,9 @@ export declare class DialogueController { protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; + protected configServer: ConfigServer; protected dialogueChatBots: IDialogueChatBot[]; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, dialogueChatBots: IDialogueChatBot[]); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index d7b05b1..62fb63e 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -2,9 +2,11 @@ import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCo import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; - constructor(sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts index a035e43..68fbc14 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts @@ -25,4 +25,13 @@ export interface IGameFixes { export interface IServerFeatures { autoInstallModDependencies: boolean; compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts index d79a688..8d47886 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/DialogueController.d.ts @@ -8,6 +8,7 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequ import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -17,8 +18,9 @@ export declare class DialogueController { protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; protected mailSendService: MailSendService; + protected configServer: ConfigServer; protected dialogueChatBots: IDialogueChatBot[]; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, dialogueChatBots: IDialogueChatBot[]); + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index d7b05b1..62fb63e 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -2,9 +2,11 @@ import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCo import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; - constructor(sptCommands: ISptCommand[]); + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); registerSptCommandoCommand(command: ISptCommand): void; getCommandHelp(command: string): string; getCommandPrefix(): string; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts index a035e43..68fbc14 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts @@ -25,4 +25,13 @@ export interface IGameFixes { export interface IServerFeatures { autoInstallModDependencies: boolean; compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/2EditDatabase/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/2EditDatabase/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts b/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/2EditDatabase/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/2EditDatabase/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/2EditDatabase/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/2EditDatabase/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts b/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts b/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/2EditDatabase/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts b/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts b/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/5ReplaceMethod/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/5ReplaceMethod/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts b/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/7OnLoadHook/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts b/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/7OnLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/7OnLoadHook/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts b/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts b/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/8OnUpdateHook/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/8OnUpdateHook/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts b/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData; diff --git a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts index e049e2a..7ed60b9 100644 --- a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts @@ -86,11 +86,11 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/ignore/set */ ignoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ unIgnoreFriend(url: string, request: { uid: string; - }, sessionID: string): any; + }, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts index e85e539..09124c6 100644 --- a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts @@ -9,6 +9,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; +import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; @@ -73,5 +74,5 @@ export declare class GameCallbacks implements OnLoad { * Handle singleplayer/settings/getRaidTime * @returns string */ - getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; + getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; } diff --git a/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts index 602262b..a6f2ccf 100644 --- a/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts @@ -9,6 +9,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -58,7 +59,7 @@ export declare class MatchCallbacks { * Handle client/match/group/status * @returns */ - getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; + getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/create */ createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/delete */ diff --git a/TypeScript/9RouterHooks/types/callbacks/ProfileCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/ProfileCallbacks.d.ts index 1cab4d7..2e1db38 100644 --- a/TypeScript/9RouterHooks/types/callbacks/ProfileCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/ProfileCallbacks.d.ts @@ -5,6 +5,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; +import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse"; import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; @@ -23,7 +24,7 @@ export declare class ProfileCallbacks { /** * Handle client/game/profile/create */ - createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; + createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/game/profile/list * Get the complete player profile (scav + pmc character) diff --git a/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts index ce5dea6..bad2ce0 100644 --- a/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts @@ -11,6 +11,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; +import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; @@ -57,4 +59,6 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate { /** Handle client/reports/ragfair/send */ sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData; + /** Handle client/ragfair/offer/findbyid */ + getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts b/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts index 2550ce7..8d47886 100644 --- a/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/DialogueController.d.ts @@ -1,5 +1,5 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; -import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { IGetAllAttachmentsResponse } from "@spt-aki/models/eft/dialog/IGetAllAttachmentsResponse"; import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse"; import { IGetMailDialogViewRequestData } from "@spt-aki/models/eft/dialog/IGetMailDialogViewRequestData"; @@ -7,28 +7,21 @@ import { IGetMailDialogViewResponseData } from "@spt-aki/models/eft/dialog/IGetM import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; -import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; -import { GiftService } from "@spt-aki/services/GiftService"; import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class DialogueController { protected logger: ILogger; protected saveServer: SaveServer; protected timeUtil: TimeUtil; protected dialogueHelper: DialogueHelper; - protected profileHelper: ProfileHelper; - protected randomUtil: RandomUtil; protected mailSendService: MailSendService; - protected giftService: GiftService; - protected hashUtil: HashUtil; protected configServer: ConfigServer; - protected coreConfig: ICoreConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer); + protected dialogueChatBots: IDialogueChatBot[]; + constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, mailSendService: MailSendService, configServer: ConfigServer, dialogueChatBots: IDialogueChatBot[]); + registerChatBot(chatBot: IDialogueChatBot): void; /** Handle onUpdate spt event */ update(): void; /** @@ -122,13 +115,6 @@ export declare class DialogueController { getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse; /** client/mail/msg/send */ sendMessage(sessionId: string, request: ISendMessageRequest): string; - /** - * Send responses back to player when they communicate with SPT friend on friends list - * @param sessionId Session Id - * @param request send message request - */ - protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void; - protected getSptFriendData(friendId?: string): IUserDialogInfo; /** * Get messages from a specific dialog that have items not expired * @param sessionId Session id diff --git a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts index b4ce0da..ca950b1 100644 --- a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts @@ -6,6 +6,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; +import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; @@ -56,7 +57,7 @@ export declare class MatchController { /** Handle match/group/start_game */ joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult; /** Handle client/match/group/status */ - getGroupStatus(info: IGetGroupStatusRequestData): any; + getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse; /** * Handle /client/raid/configuration * @param request Raid config request diff --git a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts index 025473a..b1b7b8b 100644 --- a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts @@ -54,8 +54,11 @@ export declare class ProfileController { getCompleteProfile(sessionID: string): IPmcData[]; /** * Handle client/game/profile/create + * @param info Client reqeust object + * @param sessionID Player id + * @returns Profiles _id value */ - createProfile(info: IProfileCreateRequestData, sessionID: string): void; + createProfile(info: IProfileCreateRequestData, sessionID: string): string; /** * Delete a profile * @param sessionID Id of profile to delete diff --git a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts index 80b1ff6..71cbbbc 100644 --- a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts @@ -19,6 +19,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; +import { IGetRagfairOfferByIdRequest } from "@spt-aki/models/eft/ragfair/IGetRagfairOfferByIdRequest"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; @@ -69,6 +70,13 @@ export declare class RagfairController { protected ragfairConfig: IRagfairConfig; constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; + /** + * Handle client/ragfair/offer/findbyid + * @param sessionId Player id + * @param request Request data + * @returns IRagfairOffer + */ + getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer; /** * Get offers for the client based on type of search being performed * @param searchRequest Client search request data @@ -111,6 +119,9 @@ export declare class RagfairController { protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; + /** + * Check all profiles and sell player offers / send player money for listing if it sold + */ update(): void; /** * Called when creating an offer on flea, fills values in top right corner diff --git a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts index 8f7da7a..25316c0 100644 --- a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts @@ -45,6 +45,8 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; + /** Internal counter to ensure each offer created has a unique value for its intId property */ + protected offerCounter: number; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts new file mode 100644 index 0000000..cca1fb3 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts @@ -0,0 +1,8 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ICommandoCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts new file mode 100644 index 0000000..62fb63e --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +export declare class SptCommandoCommands implements ICommandoCommand { + protected configServer: ConfigServer; + protected sptCommands: ISptCommand[]; + constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); + registerSptCommandoCommand(command: ISptCommand): void; + getCommandHelp(command: string): string; + getCommandPrefix(): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts new file mode 100644 index 0000000..33d05de --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts @@ -0,0 +1,21 @@ +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts new file mode 100644 index 0000000..33732c7 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/ISptCommand.d.ts @@ -0,0 +1,7 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface ISptCommand { + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts new file mode 100644 index 0000000..e1213a2 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -0,0 +1,15 @@ +import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare class CommandoDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected commandoCommands: ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); + registerCommandoCommand(commandoCommand: ICommandoCommand): void; + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/IDialogueChatBot.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/IDialogueChatBot.d.ts new file mode 100644 index 0000000..b585d55 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/IDialogueChatBot.d.ts @@ -0,0 +1,6 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +export interface IDialogueChatBot { + getChatBot(): IUserDialogInfo; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/SptDialogueChatBot.d.ts new file mode 100644 index 0000000..a852dfe --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -0,0 +1,25 @@ +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { GiftService } from "@spt-aki/services/GiftService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +export declare class SptDialogueChatBot implements IDialogueChatBot { + protected profileHelper: ProfileHelper; + protected randomUtil: RandomUtil; + protected mailSendService: MailSendService; + protected giftService: GiftService; + protected configServer: ConfigServer; + protected coreConfig: ICoreConfig; + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + getChatBot(): IUserDialogInfo; + /** + * Send responses back to player when they communicate with SPT friend on friends list + * @param sessionId Session Id + * @param request send message request + */ + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts index 4ebd64a..778d657 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts @@ -150,6 +150,12 @@ export declare class RagfairOfferHelper { * @returns True = should be shown to player */ isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + /** + * Does the passed in item have a condition property + * @param item Item to check + * @returns True if has condition + */ + protected isConditionItem(item: Item): boolean; /** * Is items quality value within desired range * @param item Item to check quality of diff --git a/TypeScript/9RouterHooks/types/models/eft/game/ICurrentGroupResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/game/ICurrentGroupResponse.d.ts index b3bbd8d..85c005b 100644 --- a/TypeScript/9RouterHooks/types/models/eft/game/ICurrentGroupResponse.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/game/ICurrentGroupResponse.d.ts @@ -1,6 +1,6 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; export interface ICurrentGroupResponse { - squad: any[]; + squad: ICurrentGroupSquadMember[]; } export interface ICurrentGroupSquadMember { _id: string; diff --git a/TypeScript/9RouterHooks/types/models/eft/match/IGetGroupStatusResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/match/IGetGroupStatusResponse.d.ts new file mode 100644 index 0000000..8209ef5 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/match/IGetGroupStatusResponse.d.ts @@ -0,0 +1,19 @@ +import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; +export interface IGetGroupStatusResponse { + players: IPlayer[]; + maxPveCountExceeded: boolean; +} +export interface IPlayer { + aid: string; + _id: string; + lookingGroup: boolean; + IsLeader: boolean; + IsReady: boolean; + Info: ICurrentGroupMemberInfo; +} +export interface ICurrentGroupMemberInfo { + Nickname: string; + Side: string; + Level: string; + MemberCategory: MemberCategory; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/ICreateProfileResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/ICreateProfileResponse.d.ts new file mode 100644 index 0000000..c297482 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/profile/ICreateProfileResponse.d.ts @@ -0,0 +1,3 @@ +export interface ICreateProfileResponse { + uid: string; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts b/TypeScript/9RouterHooks/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts new file mode 100644 index 0000000..91e3615 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/ragfair/IGetRagfairOfferByIdRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetRagfairOfferByIdRequest { + id: number; +} diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts index 7d6e513..68fbc14 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts @@ -24,4 +24,14 @@ export interface IGameFixes { } export interface IServerFeatures { autoInstallModDependencies: boolean; + compressProfile: boolean; + chatbotFeatures: IChatbotFeatures; +} +export interface IChatbotFeatures { + sptFriendEnabled: boolean; + commandoEnabled: boolean; + commandoFeatures: ICommandoFeatures; +} +export interface ICommandoFeatures { + giveCommandEnabled: boolean; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts index 1489f4f..5c804a4 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts @@ -98,10 +98,13 @@ export interface IScavRaidTimeConfigSettings { export interface IScavRaidTimeLocationSettings { /** Should loot be reduced by same percent length of raid is reduced by */ reduceLootByPercent: boolean; + /** Smallest % of container loot that should be spawned */ minStaticLootPercent: number; + /** Smallest % of loose loot that should be spawned */ minDynamicLootPercent: number; /** Chance raid time is reduced */ reducedChancePercent: number; + /** How much should raid time be reduced - weighted */ reductionPercentWeights: Record; /** Should bot waves be removed / spawn times be adjusted */ adjustWaves: boolean; diff --git a/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts b/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts index 0cb8abd..88a9b26 100644 --- a/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/SaveServer.d.ts @@ -5,6 +5,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { VFS } from "@spt-aki/utils/VFS"; +import { ConfigServer } from "./ConfigServer"; export declare class SaveServer { protected vfs: VFS; protected saveLoadRouters: SaveLoadRouter[]; @@ -12,11 +13,12 @@ export declare class SaveServer { protected hashUtil: HashUtil; protected localisationService: LocalisationService; protected logger: ILogger; + protected configServer: ConfigServer; protected profileFilepath: string; protected profiles: {}; protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; - constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger, configServer: ConfigServer); /** * Add callback to occur prior to saving profile changes * @param id Id for save callback diff --git a/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts b/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts index fe4b783..29329dc 100644 --- a/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts +++ b/TypeScript/9RouterHooks/types/services/mod/CustomItemService.d.ts @@ -1,3 +1,4 @@ +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ITemplateItem, Props } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt-aki/models/spt/mod/NewItemDetails"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; @@ -10,8 +11,9 @@ export declare class CustomItemService { protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; + protected itemHelper: ItemHelper; protected tables: IDatabaseTables; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper); /** * Create a new item from a cloned item base * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start @@ -77,4 +79,11 @@ export declare class CustomItemService { * @param fleaPriceRoubles Price of the new item */ protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; + /** + * Add a custom weapon to PMCs loadout + * @param weaponTpl Custom weapon tpl to add to PMCs + * @param weaponWeight The weighting for the weapon to be picked vs other weapons + * @param weaponSlot The slot the weapon should be added to (e.g. FirstPrimaryWeapon/SecondPrimaryWeapon/Holster) + */ + addCustomWeaponToPMCs(weaponTpl: string, weaponWeight: number, weaponSlot: string): void; } diff --git a/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts b/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts index eb0b3b8..9868c1e 100644 --- a/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/HttpResponseUtil.d.ts @@ -22,7 +22,7 @@ export declare class HttpResponseUtil { * @param errmsg * @returns */ - getBody(data: T, err?: number, errmsg?: any): IGetBodyResponseData; + getBody(data: T, err?: number, errmsg?: any, sanitize?: boolean): IGetBodyResponseData; getUnclearedBody(data: any, err?: number, errmsg?: any): string; emptyResponse(): IGetBodyResponseData; nullResponse(): INullResponseData;