Expose SPT friend nickname in core config

This commit is contained in:
Dev 2023-08-09 16:01:51 +01:00
parent 99715f90cd
commit 96de45e580
3 changed files with 13 additions and 3 deletions

View File

@ -4,6 +4,7 @@
"compatibleTarkovVersion": "0.13.1.25206", "compatibleTarkovVersion": "0.13.1.25206",
"serverName": "SPT Server", "serverName": "SPT Server",
"profileSaveIntervalSeconds": 15, "profileSaveIntervalSeconds": 15,
"sptFriendNickname": "SPT",
"fixes": { "fixes": {
"fixShotgunDispersion": true, "fixShotgunDispersion": true,
"removeModItemsFromProfile": false "removeModItemsFromProfile": false

View File

@ -10,10 +10,13 @@ import {
} from "../models/eft/dialog/IGetMailDialogViewResponseData"; } from "../models/eft/dialog/IGetMailDialogViewResponseData";
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest"; import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile"; import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile";
import { ConfigTypes } from "../models/enums/ConfigTypes";
import { GiftSentResult } from "../models/enums/GiftSentResult"; import { GiftSentResult } from "../models/enums/GiftSentResult";
import { MemberCategory } from "../models/enums/MemberCategory"; import { MemberCategory } from "../models/enums/MemberCategory";
import { MessageType } from "../models/enums/MessageType"; import { MessageType } from "../models/enums/MessageType";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { GiftService } from "../services/GiftService"; import { GiftService } from "../services/GiftService";
import { MailSendService } from "../services/MailSendService"; import { MailSendService } from "../services/MailSendService";
@ -24,6 +27,8 @@ import { TimeUtil } from "../utils/TimeUtil";
@injectable() @injectable()
export class DialogueController export class DialogueController
{ {
protected coreConfig: ICoreConfig;
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@inject("SaveServer") protected saveServer: SaveServer, @inject("SaveServer") protected saveServer: SaveServer,
@ -33,9 +38,12 @@ export class DialogueController
@inject("RandomUtil") protected randomUtil: RandomUtil, @inject("RandomUtil") protected randomUtil: RandomUtil,
@inject("MailSendService") protected mailSendService: MailSendService, @inject("MailSendService") protected mailSendService: MailSendService,
@inject("GiftService") protected giftService: GiftService, @inject("GiftService") protected giftService: GiftService,
@inject("HashUtil") protected hashUtil: HashUtil @inject("HashUtil") protected hashUtil: HashUtil,
@inject("ConfigServer") protected configServer: ConfigServer
) )
{} {
this.coreConfig = this.configServer.getConfig(ConfigTypes.CORE);
}
/** Handle onUpdate spt event */ /** Handle onUpdate spt event */
public update(): void public update(): void
@ -418,7 +426,7 @@ export class DialogueController
info: { info: {
Level: 1, Level: 1,
MemberCategory: MemberCategory.DEVELOPER, MemberCategory: MemberCategory.DEVELOPER,
Nickname: "SPT", Nickname: this.coreConfig.sptFriendNickname,
Side: "Usec" Side: "Usec"
} }
}; };

View File

@ -8,6 +8,7 @@ export interface ICoreConfig extends IBaseConfig
compatibleTarkovVersion: string compatibleTarkovVersion: string
serverName: string serverName: string
profileSaveIntervalSeconds: number profileSaveIntervalSeconds: number
sptFriendNickname: string;
fixes: IGameFixes fixes: IGameFixes
commit: string commit: string
} }