2023-03-03 15:23:46 +00:00
|
|
|
import { inject, injectable } from "tsyringe";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { ApplicationContext } from "@spt/context/ApplicationContext";
|
|
|
|
import { ContextVariableType } from "@spt/context/ContextVariableType";
|
2024-07-05 13:32:46 +01:00
|
|
|
import { InraidController } from "@spt/controllers/InraidController";
|
2024-07-05 09:39:41 +01:00
|
|
|
import { LocationController } from "@spt/controllers/LocationController";
|
2024-07-06 14:04:51 +01:00
|
|
|
import { LocationLootGenerator } from "@spt/generators/LocationLootGenerator";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { LootGenerator } from "@spt/generators/LootGenerator";
|
2024-07-06 09:41:40 +01:00
|
|
|
import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator";
|
2024-07-05 13:32:46 +01:00
|
|
|
import { HealthHelper } from "@spt/helpers/HealthHelper";
|
|
|
|
import { InRaidHelper } from "@spt/helpers/InRaidHelper";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
|
|
|
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
2024-07-06 14:04:51 +01:00
|
|
|
import { ILocationBase } from "@spt/models/eft/common/ILocationBase";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
2024-07-05 13:32:46 +01:00
|
|
|
import { Common } from "@spt/models/eft/common/tables/IBotBase";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { Item } from "@spt/models/eft/common/tables/IItem";
|
2024-07-05 13:32:46 +01:00
|
|
|
import { IEndLocalRaidRequestData, IEndRaidResult } from "@spt/models/eft/match/IEndLocalRaidRequestData";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { IEndOfflineRaidRequestData } from "@spt/models/eft/match/IEndOfflineRaidRequestData";
|
|
|
|
import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData";
|
|
|
|
import { IMatchGroupStartGameRequest } from "@spt/models/eft/match/IMatchGroupStartGameRequest";
|
|
|
|
import { IMatchGroupStatusRequest } from "@spt/models/eft/match/IMatchGroupStatusRequest";
|
|
|
|
import { IMatchGroupStatusResponse } from "@spt/models/eft/match/IMatchGroupStatusResponse";
|
|
|
|
import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResponse";
|
2024-07-04 21:01:37 +01:00
|
|
|
import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData";
|
|
|
|
import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
|
|
|
import { MessageType } from "@spt/models/enums/MessageType";
|
|
|
|
import { Traders } from "@spt/models/enums/Traders";
|
2024-07-05 13:32:46 +01:00
|
|
|
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig";
|
2024-07-06 14:04:51 +01:00
|
|
|
import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { IMatchConfig } from "@spt/models/spt/config/IMatchConfig";
|
|
|
|
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
2024-07-05 13:32:46 +01:00
|
|
|
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig";
|
2024-07-06 14:04:51 +01:00
|
|
|
import { IRaidChanges } from "@spt/models/spt/location/IRaidChanges";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
|
|
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
|
|
|
import { SaveServer } from "@spt/servers/SaveServer";
|
|
|
|
import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService";
|
|
|
|
import { BotLootCacheService } from "@spt/services/BotLootCacheService";
|
2024-07-05 09:39:41 +01:00
|
|
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
2024-07-05 20:39:38 +01:00
|
|
|
import { InsuranceService } from "@spt/services/InsuranceService";
|
2024-07-05 19:02:02 +01:00
|
|
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { MailSendService } from "@spt/services/MailSendService";
|
2024-07-05 14:16:50 +01:00
|
|
|
import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { MatchLocationService } from "@spt/services/MatchLocationService";
|
2024-07-05 14:16:50 +01:00
|
|
|
import { PmcChatResponseService } from "@spt/services/PmcChatResponseService";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService";
|
2024-07-06 14:04:51 +01:00
|
|
|
import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService";
|
|
|
|
import { ICloner } from "@spt/utils/cloners/ICloner";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { HashUtil } from "@spt/utils/HashUtil";
|
|
|
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
|
|
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
@injectable()
|
|
|
|
export class MatchController
|
|
|
|
{
|
|
|
|
protected matchConfig: IMatchConfig;
|
2024-01-21 17:39:37 +00:00
|
|
|
protected inRaidConfig: IInRaidConfig;
|
2023-10-12 20:04:50 +01:00
|
|
|
protected traderConfig: ITraderConfig;
|
2023-10-10 11:03:20 +00:00
|
|
|
protected pmcConfig: IPmcConfig;
|
2024-07-05 13:32:46 +01:00
|
|
|
protected ragfairConfig: IRagfairConfig;
|
|
|
|
protected hideoutConfig: IHideoutConfig;
|
2024-07-06 14:04:51 +01:00
|
|
|
protected locationConfig: ILocationConfig;
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
constructor(
|
2024-05-28 14:04:20 +00:00
|
|
|
@inject("PrimaryLogger") protected logger: ILogger,
|
2023-03-03 15:23:46 +00:00
|
|
|
@inject("SaveServer") protected saveServer: SaveServer,
|
2023-10-12 20:04:50 +01:00
|
|
|
@inject("TimeUtil") protected timeUtil: TimeUtil,
|
|
|
|
@inject("RandomUtil") protected randomUtil: RandomUtil,
|
|
|
|
@inject("HashUtil") protected hashUtil: HashUtil,
|
2023-03-03 15:23:46 +00:00
|
|
|
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
|
2024-07-05 09:39:41 +01:00
|
|
|
@inject("DatabaseService") protected databaseService: DatabaseService,
|
|
|
|
@inject("LocationController") protected locationController: LocationController,
|
2024-07-05 13:32:46 +01:00
|
|
|
@inject("InraidController") protected inRaidController: InraidController,
|
|
|
|
@inject("InRaidHelper") protected inRaidHelper: InRaidHelper,
|
|
|
|
@inject("HealthHelper") protected healthHelper: HealthHelper,
|
2023-03-03 15:23:46 +00:00
|
|
|
@inject("MatchLocationService") protected matchLocationService: MatchLocationService,
|
2024-07-05 14:16:50 +01:00
|
|
|
@inject("MatchBotDetailsCacheService") protected matchBotDetailsCacheService: MatchBotDetailsCacheService,
|
|
|
|
@inject("PmcChatResponseService") protected pmcChatResponseService: PmcChatResponseService,
|
2024-07-06 09:41:40 +01:00
|
|
|
@inject("PlayerScavGenerator") protected playerScavGenerator: PlayerScavGenerator,
|
2023-03-03 15:23:46 +00:00
|
|
|
@inject("TraderHelper") protected traderHelper: TraderHelper,
|
|
|
|
@inject("BotLootCacheService") protected botLootCacheService: BotLootCacheService,
|
2024-07-05 19:02:02 +01:00
|
|
|
@inject("LocalisationService") protected localisationService: LocalisationService,
|
2024-07-05 20:39:38 +01:00
|
|
|
@inject("InsuranceService") protected insuranceService: InsuranceService,
|
2023-03-03 15:23:46 +00:00
|
|
|
@inject("ConfigServer") protected configServer: ConfigServer,
|
|
|
|
@inject("ProfileSnapshotService") protected profileSnapshotService: ProfileSnapshotService,
|
|
|
|
@inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService,
|
2023-10-12 20:04:50 +01:00
|
|
|
@inject("MailSendService") protected mailSendService: MailSendService,
|
2024-07-06 14:04:51 +01:00
|
|
|
@inject("RaidTimeAdjustmentService") protected raidTimeAdjustmentService: RaidTimeAdjustmentService,
|
2023-10-12 20:04:50 +01:00
|
|
|
@inject("LootGenerator") protected lootGenerator: LootGenerator,
|
2023-11-16 21:42:06 +00:00
|
|
|
@inject("ApplicationContext") protected applicationContext: ApplicationContext,
|
2024-07-06 14:04:51 +01:00
|
|
|
@inject("LocationLootGenerator") protected locationLootGenerator: LocationLootGenerator,
|
|
|
|
@inject("PrimaryCloner") protected cloner: ICloner,
|
2023-03-03 15:23:46 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
this.matchConfig = this.configServer.getConfig(ConfigTypes.MATCH);
|
2024-01-21 17:39:37 +00:00
|
|
|
this.inRaidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID);
|
2023-10-12 20:04:50 +01:00
|
|
|
this.traderConfig = this.configServer.getConfig(ConfigTypes.TRADER);
|
2023-10-10 11:03:20 +00:00
|
|
|
this.pmcConfig = this.configServer.getConfig(ConfigTypes.PMC);
|
2024-07-05 13:32:46 +01:00
|
|
|
this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR);
|
|
|
|
this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT);
|
2024-07-06 14:04:51 +01:00
|
|
|
this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public getEnabled(): boolean
|
|
|
|
{
|
|
|
|
return this.matchConfig.enabled;
|
|
|
|
}
|
|
|
|
|
2023-07-15 14:49:25 +01:00
|
|
|
/** Handle client/match/group/delete */
|
2023-03-03 15:23:46 +00:00
|
|
|
public deleteGroup(info: any): void
|
|
|
|
{
|
|
|
|
this.matchLocationService.deleteGroup(info);
|
|
|
|
}
|
|
|
|
|
2023-07-15 14:49:25 +01:00
|
|
|
/** Handle match/group/start_game */
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2024-05-15 23:40:32 +01:00
|
|
|
public joinMatch(info: IMatchGroupStartGameRequest, sessionId: string): IProfileStatusResponse
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2024-05-15 23:40:32 +01:00
|
|
|
const output: IProfileStatusResponse = { maxPveCountExceeded: false, profiles: [] };
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
// get list of players joining into the match
|
2023-05-20 18:37:39 +01:00
|
|
|
output.profiles.push({
|
2023-11-16 21:42:06 +00:00
|
|
|
profileid: "TODO",
|
2023-05-20 18:37:39 +01:00
|
|
|
profileToken: "TODO",
|
2023-11-16 21:42:06 +00:00
|
|
|
status: "MatchWait",
|
|
|
|
sid: "",
|
|
|
|
ip: "",
|
|
|
|
port: 0,
|
|
|
|
version: "live",
|
|
|
|
location: "TODO get location",
|
2023-03-03 15:23:46 +00:00
|
|
|
raidMode: "Online",
|
2023-11-16 21:42:06 +00:00
|
|
|
mode: "deathmatch",
|
2024-05-27 20:06:07 +00:00
|
|
|
shortId: undefined,
|
2023-03-03 15:23:46 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
2024-05-27 20:06:07 +00:00
|
|
|
additional_info: undefined,
|
2023-03-03 15:23:46 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
2023-07-15 14:49:25 +01:00
|
|
|
/** Handle client/match/group/status */
|
2023-03-03 15:23:46 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2024-05-15 23:40:32 +01:00
|
|
|
public getGroupStatus(info: IMatchGroupStatusRequest): IMatchGroupStatusResponse
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-11-16 21:42:06 +00:00
|
|
|
return { players: [], maxPveCountExceeded: false };
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle /client/raid/configuration
|
2023-07-15 14:49:25 +01:00
|
|
|
* @param request Raid config request
|
|
|
|
* @param sessionID Session id
|
2023-03-03 15:23:46 +00:00
|
|
|
*/
|
|
|
|
public startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void
|
|
|
|
{
|
2023-07-15 14:49:25 +01:00
|
|
|
// Store request data for access during bot generation
|
2023-03-03 15:23:46 +00:00
|
|
|
this.applicationContext.addValue(ContextVariableType.RAID_CONFIGURATION, request);
|
|
|
|
|
2023-11-16 21:42:06 +00:00
|
|
|
// TODO: add code to strip PMC of equipment now they've started the raid
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
// Set pmcs to difficulty set in pre-raid screen if override in bot config isnt enabled
|
2023-10-10 11:03:20 +00:00
|
|
|
if (!this.pmcConfig.useDifficultyOverride)
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-11-16 21:42:06 +00:00
|
|
|
this.pmcConfig.difficulty = this.convertDifficultyDropdownIntoBotDifficulty(
|
|
|
|
request.wavesSettings.botDifficulty,
|
|
|
|
);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
|
|
|
|
2023-11-16 21:42:06 +00:00
|
|
|
// Store the profile as-is for later use on the post-raid exp screen
|
2023-03-03 15:23:46 +00:00
|
|
|
const currentProfile = this.saveServer.getProfile(sessionID);
|
|
|
|
this.profileSnapshotService.storeProfileSnapshot(sessionID, currentProfile);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert a difficulty value from pre-raid screen to a bot difficulty
|
|
|
|
* @param botDifficulty dropdown difficulty value
|
|
|
|
* @returns bot difficulty
|
|
|
|
*/
|
|
|
|
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string
|
|
|
|
{
|
|
|
|
// Edge case medium - must be altered
|
|
|
|
if (botDifficulty.toLowerCase() === "medium")
|
|
|
|
{
|
|
|
|
return "normal";
|
|
|
|
}
|
|
|
|
|
|
|
|
return botDifficulty;
|
|
|
|
}
|
|
|
|
|
2023-07-15 14:49:25 +01:00
|
|
|
/** Handle client/match/offline/end */
|
2023-04-24 11:57:19 +01:00
|
|
|
public endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void
|
2023-11-16 21:42:06 +00:00
|
|
|
{
|
2023-04-24 11:57:19 +01:00
|
|
|
const pmcData: IPmcData = this.profileHelper.getPmcProfile(sessionId);
|
|
|
|
const extractName = info.exitName;
|
2023-03-03 15:23:46 +00:00
|
|
|
|
2023-07-17 09:36:10 +01:00
|
|
|
// Save time spent in raid
|
2023-10-10 11:03:20 +00:00
|
|
|
pmcData.Stats.Eft.TotalInGameTime += info.raidSeconds;
|
2023-07-17 09:36:10 +01:00
|
|
|
|
2023-10-11 10:47:54 +01:00
|
|
|
// Clean up cached bots now raid is over
|
2023-03-03 15:23:46 +00:00
|
|
|
this.botGenerationCacheService.clearStoredBots();
|
|
|
|
|
2023-10-11 10:47:54 +01:00
|
|
|
// Clear bot loot cache
|
2023-04-24 11:57:19 +01:00
|
|
|
this.botLootCacheService.clearCache();
|
|
|
|
|
|
|
|
if (this.extractWasViaCar(extractName))
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-04-24 11:57:19 +01:00
|
|
|
this.handleCarExtract(extractName, pmcData, sessionId);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
2023-10-12 20:04:50 +01:00
|
|
|
|
2023-10-14 10:31:01 +01:00
|
|
|
if (extractName && this.extractWasViaCoop(extractName) && this.traderConfig.fence.coopExtractGift.sendGift)
|
2023-10-12 20:04:50 +01:00
|
|
|
{
|
2024-04-26 14:06:18 +01:00
|
|
|
this.handleCoopExtract(sessionId, pmcData, extractName);
|
2023-10-12 20:04:50 +01:00
|
|
|
this.sendCoopTakenFenceMessage(sessionId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Did player take a COOP extract
|
|
|
|
* @param extractName Name of extract player took
|
|
|
|
* @returns True if coop extract
|
|
|
|
*/
|
|
|
|
protected extractWasViaCoop(extractName: string): boolean
|
|
|
|
{
|
2023-10-14 10:31:01 +01:00
|
|
|
// No extract name, not a coop extract
|
|
|
|
if (!extractName)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2024-05-07 23:57:08 -04:00
|
|
|
return this.inRaidConfig.coopExtracts.includes(extractName.trim());
|
2023-10-12 20:04:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected sendCoopTakenFenceMessage(sessionId: string): void
|
|
|
|
{
|
|
|
|
// Generate reward for taking coop extract
|
|
|
|
const loot = this.lootGenerator.createRandomLoot(this.traderConfig.fence.coopExtractGift);
|
|
|
|
const mailableLoot: Item[] = [];
|
2023-11-16 21:42:06 +00:00
|
|
|
|
2023-10-12 20:04:50 +01:00
|
|
|
const parentId = this.hashUtil.generate();
|
|
|
|
for (const item of loot)
|
|
|
|
{
|
2024-07-06 09:17:32 +01:00
|
|
|
item.parentId = parentId;
|
|
|
|
mailableLoot.push(item);
|
2023-10-12 20:04:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Send message from fence giving player reward generated above
|
|
|
|
this.mailSendService.sendLocalisedNpcMessageToPlayer(
|
|
|
|
sessionId,
|
|
|
|
this.traderHelper.getTraderById(Traders.FENCE),
|
|
|
|
MessageType.MESSAGE_WITH_ITEMS,
|
|
|
|
this.randomUtil.getArrayValue(this.traderConfig.fence.coopExtractGift.messageLocaleIds),
|
|
|
|
mailableLoot,
|
2023-11-16 21:42:06 +00:00
|
|
|
this.timeUtil.getHoursAsSeconds(this.traderConfig.fence.coopExtractGift.giftExpiryHours),
|
2023-10-12 20:04:50 +01:00
|
|
|
);
|
2023-04-24 11:57:19 +01:00
|
|
|
}
|
2023-03-03 15:23:46 +00:00
|
|
|
|
2023-11-16 11:38:55 +00:00
|
|
|
/**
|
|
|
|
* Handle when a player extracts using a coop extract - add rep to fence
|
2024-04-26 14:06:18 +01:00
|
|
|
* @param sessionId Session/player id
|
2023-11-16 11:38:55 +00:00
|
|
|
* @param pmcData Profile
|
|
|
|
* @param extractName Name of extract taken
|
|
|
|
*/
|
2024-04-26 14:06:18 +01:00
|
|
|
protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void
|
2023-11-16 11:38:55 +00:00
|
|
|
{
|
|
|
|
if (!pmcData.CoopExtractCounts)
|
|
|
|
{
|
|
|
|
pmcData.CoopExtractCounts = {};
|
|
|
|
}
|
2023-11-16 21:42:06 +00:00
|
|
|
|
2023-11-16 11:38:55 +00:00
|
|
|
// Ensure key exists for extract
|
|
|
|
if (!(extractName in pmcData.CoopExtractCounts))
|
|
|
|
{
|
|
|
|
pmcData.CoopExtractCounts[extractName] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Increment extract count value
|
|
|
|
pmcData.CoopExtractCounts[extractName] += 1;
|
2023-11-16 21:42:06 +00:00
|
|
|
|
2023-11-16 11:38:55 +00:00
|
|
|
// Get new fence standing value
|
2023-11-16 21:42:06 +00:00
|
|
|
const newFenceStanding = this.getFenceStandingAfterExtract(
|
|
|
|
pmcData,
|
2024-01-21 17:39:37 +00:00
|
|
|
this.inRaidConfig.coopExtractBaseStandingGain,
|
2023-11-16 21:42:06 +00:00
|
|
|
pmcData.CoopExtractCounts[extractName],
|
|
|
|
);
|
2023-11-16 11:38:55 +00:00
|
|
|
const fenceId: string = Traders.FENCE;
|
|
|
|
pmcData.TradersInfo[fenceId].standing = newFenceStanding;
|
|
|
|
|
|
|
|
// Check if new standing has leveled up trader
|
|
|
|
this.traderHelper.lvlUp(fenceId, pmcData);
|
|
|
|
pmcData.TradersInfo[fenceId].loyaltyLevel = Math.max(pmcData.TradersInfo[fenceId].loyaltyLevel, 1);
|
2024-04-26 14:06:18 +01:00
|
|
|
|
|
|
|
// Copy updated fence rep values into scav profile to ensure consistency
|
|
|
|
const scavData: IPmcData = this.profileHelper.getScavProfile(sessionId);
|
|
|
|
scavData.TradersInfo[fenceId].standing = pmcData.TradersInfo[fenceId].standing;
|
|
|
|
scavData.TradersInfo[fenceId].loyaltyLevel = pmcData.TradersInfo[fenceId].loyaltyLevel;
|
2023-11-16 11:38:55 +00:00
|
|
|
}
|
|
|
|
|
2023-04-24 11:57:19 +01:00
|
|
|
/**
|
2023-07-17 09:36:10 +01:00
|
|
|
* Was extract by car
|
2023-04-24 11:57:19 +01:00
|
|
|
* @param extractName name of extract
|
|
|
|
* @returns true if car extract
|
|
|
|
*/
|
|
|
|
protected extractWasViaCar(extractName: string): boolean
|
|
|
|
{
|
2024-05-27 20:06:07 +00:00
|
|
|
// exit name is undefined on death
|
2023-10-10 11:03:20 +00:00
|
|
|
if (!extractName)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (extractName.toLowerCase().includes("v-ex"))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2024-01-21 17:39:37 +00:00
|
|
|
return this.inRaidConfig.carExtracts.includes(extractName.trim());
|
2023-04-24 11:57:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle when a player extracts using a car - Add rep to fence
|
|
|
|
* @param extractName name of the extract used
|
|
|
|
* @param pmcData Player profile
|
|
|
|
* @param sessionId Session id
|
|
|
|
*/
|
|
|
|
protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void
|
|
|
|
{
|
|
|
|
// Ensure key exists for extract
|
|
|
|
if (!(extractName in pmcData.CarExtractCounts))
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-04-24 11:57:19 +01:00
|
|
|
pmcData.CarExtractCounts[extractName] = 0;
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
|
|
|
|
2023-04-24 11:57:19 +01:00
|
|
|
// Increment extract count value
|
|
|
|
pmcData.CarExtractCounts[extractName] += 1;
|
|
|
|
|
2023-11-16 11:38:55 +00:00
|
|
|
// Not exact replica of Live behaviour
|
|
|
|
// Simplified for now, no real reason to do the whole (unconfirmed) extra 0.01 standing per day regeneration mechanic
|
2023-11-16 21:42:06 +00:00
|
|
|
const newFenceStanding = this.getFenceStandingAfterExtract(
|
|
|
|
pmcData,
|
2024-01-21 17:39:37 +00:00
|
|
|
this.inRaidConfig.carExtractBaseStandingGain,
|
2023-11-16 21:42:06 +00:00
|
|
|
pmcData.CarExtractCounts[extractName],
|
|
|
|
);
|
2023-04-24 11:57:19 +01:00
|
|
|
const fenceId: string = Traders.FENCE;
|
2023-11-16 11:38:55 +00:00
|
|
|
pmcData.TradersInfo[fenceId].standing = newFenceStanding;
|
|
|
|
|
|
|
|
// Check if new standing has leveled up trader
|
2023-10-10 11:03:20 +00:00
|
|
|
this.traderHelper.lvlUp(fenceId, pmcData);
|
2023-04-24 11:57:19 +01:00
|
|
|
pmcData.TradersInfo[fenceId].loyaltyLevel = Math.max(pmcData.TradersInfo[fenceId].loyaltyLevel, 1);
|
2023-10-10 11:03:20 +00:00
|
|
|
|
2023-11-16 21:42:06 +00:00
|
|
|
this.logger.debug(
|
|
|
|
`Car extract: ${extractName} used, total times taken: ${pmcData.CarExtractCounts[extractName]}`,
|
|
|
|
);
|
2024-04-26 14:06:18 +01:00
|
|
|
|
2024-03-25 07:28:24 +00:00
|
|
|
// Copy updated fence rep values into scav profile to ensure consistency
|
|
|
|
const scavData: IPmcData = this.profileHelper.getScavProfile(sessionId);
|
|
|
|
scavData.TradersInfo[fenceId].standing = pmcData.TradersInfo[fenceId].standing;
|
|
|
|
scavData.TradersInfo[fenceId].loyaltyLevel = pmcData.TradersInfo[fenceId].loyaltyLevel;
|
2023-04-24 11:57:19 +01:00
|
|
|
}
|
2023-03-03 15:23:46 +00:00
|
|
|
|
2023-04-24 11:57:19 +01:00
|
|
|
/**
|
2023-11-16 11:38:55 +00:00
|
|
|
* Get the fence rep gain from using a car or coop extract
|
|
|
|
* @param pmcData Profile
|
|
|
|
* @param baseGain amount gained for the first extract
|
|
|
|
* @param extractCount Number of times extract was taken
|
|
|
|
* @returns Fence standing after taking extract
|
2023-04-24 11:57:19 +01:00
|
|
|
*/
|
2023-11-16 11:38:55 +00:00
|
|
|
protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number
|
2023-04-24 11:57:19 +01:00
|
|
|
{
|
2023-11-16 11:38:55 +00:00
|
|
|
// Get current standing
|
|
|
|
const fenceId: string = Traders.FENCE;
|
2023-04-24 11:57:19 +01:00
|
|
|
let fenceStanding = Number(pmcData.TradersInfo[fenceId].standing);
|
2023-03-03 15:23:46 +00:00
|
|
|
|
2023-11-16 11:38:55 +00:00
|
|
|
// get standing after taking extract x times, x.xx format, gain from extract can be no smaller than 0.01
|
2023-04-24 11:57:19 +01:00
|
|
|
fenceStanding += Math.max(baseGain / extractCount, 0.01);
|
2023-03-03 15:23:46 +00:00
|
|
|
|
2023-11-16 11:38:55 +00:00
|
|
|
// Ensure fence loyalty level is not above/below the range -7 to 15
|
2023-10-10 11:03:20 +00:00
|
|
|
const newFenceStanding = Math.min(Math.max(fenceStanding, -7), 15);
|
|
|
|
this.logger.debug(`Old vs new fence standing: ${pmcData.TradersInfo[fenceId].standing}, ${newFenceStanding}`);
|
2023-11-16 11:38:55 +00:00
|
|
|
|
|
|
|
return Number(newFenceStanding.toFixed(2));
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
2024-07-04 21:01:37 +01:00
|
|
|
|
|
|
|
public startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData
|
|
|
|
{
|
2024-07-05 09:39:41 +01:00
|
|
|
const playerProfile = this.profileHelper.getPmcProfile(sessionId);
|
|
|
|
|
|
|
|
const result: IStartLocalRaidResponseData = {
|
2024-07-05 13:32:46 +01:00
|
|
|
serverId: `${request.location}.${request.playerSide}.${this.timeUtil.getTimestamp()}`, // TODO - does this need to be more verbose - investigate client?
|
2024-07-05 10:48:13 +01:00
|
|
|
serverSettings: this.databaseService.getLocationServices(), // TODO - is this per map or global?
|
2024-07-05 09:39:41 +01:00
|
|
|
profile: { insuredItems: playerProfile.InsuredItems },
|
2024-07-06 14:04:51 +01:00
|
|
|
locationLoot: this.generateLocationAndLoot(request.location),
|
2024-07-05 09:39:41 +01:00
|
|
|
};
|
|
|
|
|
2024-07-05 20:10:24 +01:00
|
|
|
// Clear bot cache ready for a fresh raid
|
|
|
|
this.botGenerationCacheService.clearStoredBots();
|
|
|
|
|
2024-07-05 09:39:41 +01:00
|
|
|
return result;
|
2024-07-04 21:01:37 +01:00
|
|
|
}
|
|
|
|
|
2024-07-06 14:04:51 +01:00
|
|
|
/**
|
|
|
|
* Generate a maps base location and loot
|
|
|
|
* @param name Map name
|
|
|
|
* @returns ILocationBase
|
|
|
|
*/
|
|
|
|
protected generateLocationAndLoot(name: string): ILocationBase
|
|
|
|
{
|
|
|
|
const location = this.databaseService.getLocation(name);
|
|
|
|
const locationBaseClone = this.cloner.clone(location.base);
|
|
|
|
|
|
|
|
// Update datetime property to now
|
|
|
|
locationBaseClone.UnixDateTime = this.timeUtil.getTimestamp();
|
|
|
|
|
|
|
|
// Don't generate loot for hideout
|
|
|
|
if (name === "hideout")
|
|
|
|
{
|
|
|
|
return locationBaseClone;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check for a loot multipler adjustment in app context and apply if one is found
|
|
|
|
let locationConfigClone: ILocationConfig;
|
|
|
|
const raidAdjustments = this.applicationContext
|
|
|
|
.getLatestValue(ContextVariableType.RAID_ADJUSTMENTS)
|
|
|
|
?.getValue<IRaidChanges>();
|
|
|
|
if (raidAdjustments)
|
|
|
|
{
|
|
|
|
locationConfigClone = this.cloner.clone(this.locationConfig); // Clone values so they can be used to reset originals later
|
|
|
|
this.raidTimeAdjustmentService.makeAdjustmentsToMap(raidAdjustments, locationBaseClone);
|
|
|
|
}
|
|
|
|
|
|
|
|
const staticAmmoDist = this.cloner.clone(location.staticAmmo);
|
|
|
|
|
|
|
|
// Create containers and add loot to them
|
|
|
|
const staticLoot = this.locationLootGenerator.generateStaticContainers(locationBaseClone, staticAmmoDist);
|
|
|
|
locationBaseClone.Loot.push(...staticLoot);
|
|
|
|
|
|
|
|
// Add dynamic loot to output loot
|
|
|
|
const dynamicLootDistClone = this.cloner.clone(location.looseLoot);
|
|
|
|
const dynamicSpawnPoints = this.locationLootGenerator.generateDynamicLoot(
|
|
|
|
dynamicLootDistClone,
|
|
|
|
staticAmmoDist,
|
|
|
|
name,
|
|
|
|
);
|
|
|
|
|
|
|
|
for (const spawnPoint of dynamicSpawnPoints)
|
|
|
|
{
|
|
|
|
locationBaseClone.Loot.push(spawnPoint);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Done generating, log results
|
|
|
|
this.logger.success(
|
|
|
|
this.localisationService.getText("location-dynamic_items_spawned_success", dynamicSpawnPoints.length),
|
|
|
|
);
|
|
|
|
this.logger.success(this.localisationService.getText("location-generated_success", name));
|
|
|
|
|
|
|
|
// Reset loot multipliers back to original values
|
|
|
|
if (raidAdjustments)
|
|
|
|
{
|
|
|
|
this.logger.debug("Resetting loot multipliers back to their original values");
|
|
|
|
this.locationConfig.staticLootMultiplier = locationConfigClone.staticLootMultiplier;
|
|
|
|
this.locationConfig.looseLootMultiplier = locationConfigClone.looseLootMultiplier;
|
|
|
|
|
|
|
|
this.applicationContext.clearValues(ContextVariableType.RAID_ADJUSTMENTS);
|
|
|
|
}
|
|
|
|
|
|
|
|
return locationBaseClone;
|
|
|
|
}
|
|
|
|
|
2024-07-05 10:48:13 +01:00
|
|
|
public endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void
|
2024-07-04 21:01:37 +01:00
|
|
|
{
|
2024-07-05 13:32:46 +01:00
|
|
|
const fullProfile = this.profileHelper.getFullProfile(sessionId);
|
|
|
|
const pmcProfile = fullProfile.characters.pmc;
|
|
|
|
const scavProfile = fullProfile.characters.scav;
|
|
|
|
const postRaidProfile = request.results.profile!;
|
2024-07-05 10:48:13 +01:00
|
|
|
|
|
|
|
// TODO:
|
|
|
|
// Update profile
|
|
|
|
// Handle insurance
|
|
|
|
// Rep gain/loss?
|
|
|
|
// Quest status?
|
|
|
|
// Counters?
|
|
|
|
// Send PMC message to player if necessary
|
|
|
|
// Limb health
|
|
|
|
// Limb effects
|
|
|
|
// Skills
|
2024-07-05 13:32:46 +01:00
|
|
|
// Inventory - items not lost on death
|
2024-07-05 10:48:13 +01:00
|
|
|
// Stats
|
2024-07-05 13:32:46 +01:00
|
|
|
// stats/eft/aggressor - weird values (EFT.IProfileDataContainer.Nickname)
|
|
|
|
|
|
|
|
this.logger.debug(`Raid outcome: ${request.results.result}`);
|
|
|
|
|
|
|
|
// Set flea interval time to out-of-raid value
|
|
|
|
this.ragfairConfig.runIntervalSeconds = this.ragfairConfig.runIntervalValues.outOfRaid;
|
|
|
|
this.hideoutConfig.runIntervalSeconds = this.hideoutConfig.runIntervalValues.outOfRaid;
|
|
|
|
|
|
|
|
// ServerId has various info stored in it, delimited by a period
|
|
|
|
const serverDetails = request.serverId.split(".");
|
|
|
|
|
|
|
|
const locationName = serverDetails[0].toLowerCase();
|
|
|
|
const isPmc = serverDetails[1].toLowerCase() === "pmc";
|
2024-07-06 09:41:40 +01:00
|
|
|
const mapBase = this.databaseService.getLocation(locationName).base;
|
2024-07-05 13:32:46 +01:00
|
|
|
const isDead = this.isPlayerDead(request.results);
|
|
|
|
|
2024-07-06 09:21:00 +01:00
|
|
|
if (!isPmc)
|
|
|
|
{
|
2024-07-06 09:41:40 +01:00
|
|
|
this.handlePostRaidPlayerScav(sessionId, pmcProfile, scavProfile, isDead);
|
2024-07-06 09:21:00 +01:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-07-06 09:41:40 +01:00
|
|
|
this.handlePostRaidPmc(sessionId, pmcProfile, scavProfile, postRaidProfile, isDead, request);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected handlePostRaidPlayerScav(
|
|
|
|
sessionId: string,
|
|
|
|
pmcProfile: IPmcData,
|
|
|
|
scavProfile: IPmcData,
|
|
|
|
isDead: boolean,
|
|
|
|
): void
|
|
|
|
{
|
|
|
|
// Scav died, regen scav loadout and set timer
|
|
|
|
if (isDead)
|
|
|
|
{
|
|
|
|
this.playerScavGenerator.generate(sessionId);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update last played property
|
|
|
|
pmcProfile.Info.LastTimePlayedAsSavage = this.timeUtil.getTimestamp();
|
|
|
|
|
|
|
|
// Force a profile save
|
|
|
|
this.saveServer.saveProfile(sessionId);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected handlePostRaidPmc(
|
|
|
|
sessionId: string,
|
|
|
|
pmcProfile: IPmcData,
|
|
|
|
scavProfile: IPmcData,
|
|
|
|
postRaidProfile: IPmcData,
|
|
|
|
isDead: boolean,
|
|
|
|
request: IEndLocalRaidRequestData,
|
|
|
|
): void
|
|
|
|
{
|
2024-07-05 13:32:46 +01:00
|
|
|
// Update inventory
|
|
|
|
this.inRaidHelper.setInventory(sessionId, pmcProfile, postRaidProfile);
|
|
|
|
|
|
|
|
pmcProfile.Info.Level = postRaidProfile.Info.Level;
|
|
|
|
|
|
|
|
// Add experience points
|
|
|
|
pmcProfile.Info.Experience += postRaidProfile.Stats.Eft.TotalSessionExperience;
|
|
|
|
|
|
|
|
// Profile common/mastering skills
|
|
|
|
pmcProfile.Skills = postRaidProfile.Skills;
|
|
|
|
|
|
|
|
pmcProfile.Stats.Eft = postRaidProfile.Stats.Eft;
|
|
|
|
|
|
|
|
// Must occur after experience is set and stats copied over
|
|
|
|
pmcProfile.Stats.Eft.TotalSessionExperience = 0;
|
|
|
|
|
|
|
|
pmcProfile.Achievements = postRaidProfile.Achievements;
|
|
|
|
|
|
|
|
// Remove skill fatigue values
|
|
|
|
this.resetSkillPointsEarnedDuringRaid(pmcProfile.Skills.Common);
|
|
|
|
|
|
|
|
// Straight copy
|
|
|
|
pmcProfile.TaskConditionCounters = postRaidProfile.TaskConditionCounters;
|
|
|
|
|
|
|
|
pmcProfile.Encyclopedia = postRaidProfile.Encyclopedia;
|
|
|
|
|
|
|
|
// Must occur after encyclopedia updated
|
|
|
|
this.mergePmcAndScavEncyclopedias(pmcProfile, scavProfile);
|
|
|
|
|
|
|
|
// Handle temp, hydration, limb hp/effects
|
|
|
|
this.healthHelper.updateProfileHealthPostRaid(pmcProfile, postRaidProfile.Health, sessionId, isDead);
|
2024-07-05 14:16:50 +01:00
|
|
|
|
|
|
|
if (isDead)
|
|
|
|
{
|
|
|
|
this.pmcChatResponseService.sendKillerResponse(
|
|
|
|
sessionId,
|
|
|
|
pmcProfile,
|
|
|
|
postRaidProfile.Stats.Eft.Aggressor,
|
|
|
|
);
|
|
|
|
this.matchBotDetailsCacheService.clearCache();
|
|
|
|
|
|
|
|
this.inRaidHelper.deleteInventory(pmcProfile, sessionId);
|
|
|
|
}
|
|
|
|
|
|
|
|
const victims = postRaidProfile.Stats.Eft.Victims.filter((victim) =>
|
|
|
|
["pmcbear", "pmcusec"].includes(victim.Role.toLowerCase()),
|
|
|
|
);
|
|
|
|
if (victims?.length > 0)
|
|
|
|
{
|
|
|
|
// Player killed PMCs, send some responses to them
|
|
|
|
this.pmcChatResponseService.sendVictimResponse(sessionId, victims, pmcProfile);
|
|
|
|
}
|
2024-07-05 19:02:02 +01:00
|
|
|
|
|
|
|
// Handle items transferred via BTR to player
|
|
|
|
const btrKey = "BTRTransferStash";
|
|
|
|
const btrContainerAndItems = request.transferItems[btrKey] ?? [];
|
|
|
|
if (btrContainerAndItems.length > 0)
|
|
|
|
{
|
|
|
|
const itemsToSend = btrContainerAndItems.filter((item) => item._id !== btrKey);
|
|
|
|
this.btrItemDelivery(sessionId, Traders.BTR, itemsToSend);
|
|
|
|
}
|
2024-07-05 20:39:38 +01:00
|
|
|
|
|
|
|
if (request.lostInsuredItems?.length > 0)
|
|
|
|
{
|
|
|
|
// TODO - refactor code to work
|
|
|
|
|
|
|
|
// Get array of insured items+child that were lost in raid
|
|
|
|
// const gearToStore = this.insuranceService.getGearLostInRaid(
|
|
|
|
// pmcProfile,
|
|
|
|
// postRaidRequest,
|
|
|
|
// preRaidGear,
|
|
|
|
// sessionId,
|
|
|
|
// isDead,
|
|
|
|
// );
|
|
|
|
|
|
|
|
// this.insuranceService.storeGearLostInRaidToSendLater(
|
|
|
|
// sessionId,
|
|
|
|
// gearToStore,
|
|
|
|
// );
|
|
|
|
}
|
2024-07-05 19:02:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle singleplayer/traderServices/itemDelivery
|
|
|
|
*/
|
|
|
|
protected btrItemDelivery(sessionId: string, traderId: string, items: Item[]): void
|
|
|
|
{
|
|
|
|
const serverProfile = this.saveServer.getProfile(sessionId);
|
|
|
|
const pmcData = serverProfile.characters.pmc;
|
|
|
|
|
|
|
|
const dialogueTemplates = this.databaseService.getTrader(traderId).dialogue;
|
|
|
|
if (!dialogueTemplates)
|
|
|
|
{
|
|
|
|
this.logger.error(this.localisationService.getText("inraid-unable_to_deliver_item_no_trader_found", traderId));
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const messageId = this.randomUtil.getArrayValue(dialogueTemplates.itemsDelivered);
|
|
|
|
const messageStoreTime = this.timeUtil.getHoursAsSeconds(this.traderConfig.fence.btrDeliveryExpireHours);
|
|
|
|
|
|
|
|
// Remove any items that were returned by the item delivery, but also insured, from the player's insurance list
|
|
|
|
// This is to stop items being duplicated by being returned from both item delivery and insurance
|
|
|
|
const deliveredItemIds = items.map((item) => item._id);
|
|
|
|
pmcData.InsuredItems = pmcData.InsuredItems
|
|
|
|
.filter((insuredItem) => !deliveredItemIds.includes(insuredItem.itemId));
|
|
|
|
|
|
|
|
// Send the items to the player
|
|
|
|
this.mailSendService.sendLocalisedNpcMessageToPlayer(
|
|
|
|
sessionId,
|
|
|
|
this.traderHelper.getTraderById(traderId),
|
|
|
|
MessageType.BTR_ITEMS_DELIVERY,
|
|
|
|
messageId,
|
|
|
|
items,
|
|
|
|
messageStoreTime,
|
|
|
|
);
|
2024-07-05 13:32:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is the player dead after a raid - dead = anything other than "survived" / "runner"
|
|
|
|
* @param statusOnExit Exit value from offraidData object
|
|
|
|
* @returns true if dead
|
|
|
|
*/
|
|
|
|
protected isPlayerDead(results: IEndRaidResult): boolean
|
|
|
|
{
|
2024-07-05 16:03:16 +01:00
|
|
|
return ["killed", "missinginaction", "left"].includes(results.result.toLowerCase());
|
2024-07-05 13:32:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset the skill points earned in a raid to 0, ready for next raid
|
|
|
|
* @param commonSkills Profile common skills to update
|
|
|
|
*/
|
|
|
|
protected resetSkillPointsEarnedDuringRaid(commonSkills: Common[]): void
|
|
|
|
{
|
|
|
|
for (const skill of commonSkills)
|
|
|
|
{
|
|
|
|
skill.PointsEarnedDuringSession = 0.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* merge two dictionaries together
|
|
|
|
* Prioritise pair that has true as a value
|
|
|
|
* @param primary main dictionary
|
|
|
|
* @param secondary Secondary dictionary
|
|
|
|
*/
|
|
|
|
protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void
|
|
|
|
{
|
|
|
|
function extend(target: { [key: string]: boolean }, source: Record<string, boolean>)
|
|
|
|
{
|
|
|
|
for (const key in source)
|
|
|
|
{
|
|
|
|
if (Object.hasOwn(source, key))
|
|
|
|
{
|
|
|
|
target[key] = source[key];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
const merged = extend(extend({}, primary.Encyclopedia), secondary.Encyclopedia);
|
|
|
|
primary.Encyclopedia = merged;
|
|
|
|
secondary.Encyclopedia = merged;
|
2024-07-04 21:01:37 +01:00
|
|
|
}
|
2023-11-16 21:42:06 +00:00
|
|
|
}
|