Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0

# Conflicts:
#	project/src/callbacks/DialogueCallbacks.ts
#	project/src/callbacks/MatchCallbacks.ts
#	project/src/callbacks/NotifierCallbacks.ts
#	project/src/controllers/InventoryController.ts
#	project/src/controllers/MatchController.ts
#	project/src/routers/static/RagfairStaticRouter.ts
This commit is contained in:
Dev 2023-12-21 09:07:23 +00:00
commit b993226296
18 changed files with 188 additions and 53 deletions

View File

@ -130,9 +130,9 @@
}, },
"5d650c3e815116009f6201d2": { "5d650c3e815116009f6201d2": {
"_name": "FUEL", "_name": "FUEL",
"conditionChance": 0.06, "conditionChance": 0.12,
"min": 0.01, "min": 0.7,
"max": 0.15 "max": 0.99
} }
}, },
"stackablePercent": { "stackablePercent": {

View File

@ -7,11 +7,11 @@
}, },
"windSpeed": { "windSpeed": {
"values": [0, 1, 2, 3], "values": [0, 1, 2, 3],
"weights": [20, 15, 10, 5] "weights": [4, 3, 2, 1]
}, },
"windDirection": { "windDirection": {
"values": [1, 2, 3, 4, 5, 6, 7, 8], "values": [1, 2, 3, 4, 5, 6, 7, 8],
"weights": [10, 10, 10, 10, 10, 10, 10, 10] "weights": [1, 1, 1, 1, 1, 1, 1, 1]
}, },
"windGustiness": { "windGustiness": {
"min": 0, "min": 0,
@ -19,15 +19,15 @@
}, },
"rain": { "rain": {
"values": [1, 2, 3], "values": [1, 2, 3],
"weights": [100, 10, 5] "weights": [25, 1, 1]
}, },
"rainIntensity": { "rainIntensity": {
"min": 0, "min": 0,
"max": 1 "max": 1
}, },
"fog": { "fog": {
"values": [0.002, 0.006, 0.008, 0.012, 0.087], "values": [0.002, 0.004, 0.008, 0.012, 0.087],
"weights": [100, 40, 25, 25, 5] "weights": [20, 8, 5, 5, 1]
}, },
"temp": { "temp": {
"min": 0, "min": 0,

View File

@ -41,7 +41,8 @@ export class DialogueCallbacks implements OnUpdate
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("DialogueController") protected dialogueController: DialogueController, @inject("DialogueController") protected dialogueController: DialogueController,
) )
{} {
}
/** /**
* Handle client/friend/list * Handle client/friend/list
@ -60,6 +61,7 @@ export class DialogueCallbacks implements OnUpdate
* Handle client/chatServer/list * Handle client/chatServer/list
* @returns IChatServer[] * @returns IChatServer[]
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getChatServerList( public getChatServerList(
url: string, url: string,
info: IGetChatServerListRequestData, info: IGetChatServerListRequestData,
@ -72,7 +74,7 @@ export class DialogueCallbacks implements OnUpdate
DateTime: this.timeUtil.getTimestamp(), DateTime: this.timeUtil.getTimestamp(),
IsDeveloper: true, IsDeveloper: true,
Regions: ["EUR"], Regions: ["EUR"],
VersionId: "bgkidft87ddd", // TODO: Is this... correct? VersionId: "bgkidft87ddd",
Ip: "", Ip: "",
Port: 0, Port: 0,
Chats: [{ _id: "0", Members: 0 }], Chats: [{ _id: "0", Members: 0 }],
@ -159,6 +161,7 @@ export class DialogueCallbacks implements OnUpdate
} }
/** Handle client/friend/request/list/outbox */ /** Handle client/friend/request/list/outbox */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]> public listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.getBody([]); return this.httpResponse.getBody([]);
@ -167,6 +170,7 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/list/inbox * Handle client/friend/request/list/inbox
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]> public listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.getBody([]); return this.httpResponse.getBody([]);
@ -175,6 +179,7 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/send * Handle client/friend/request/send
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendFriendRequest( public sendFriendRequest(
url: string, url: string,
request: IFriendRequestData, request: IFriendRequestData,
@ -187,6 +192,7 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/accept * Handle client/friend/request/accept
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public acceptFriendRequest( public acceptFriendRequest(
url: string, url: string,
request: IAcceptFriendRequestData, request: IAcceptFriendRequestData,
@ -199,6 +205,7 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/cancel * Handle client/friend/request/cancel
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public cancelFriendRequest( public cancelFriendRequest(
url: string, url: string,
request: ICancelFriendRequestData, request: ICancelFriendRequestData,
@ -209,33 +216,39 @@ export class DialogueCallbacks implements OnUpdate
} }
/** Handle client/friend/delete */ /** Handle client/friend/delete */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData public deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/friend/ignore/set */ /** Handle client/friend/ignore/set */
public ignoreFriend(url: string, request: { uid: string; }, sessionID: string): any // eslint-disable-next-line @typescript-eslint/no-unused-vars
public ignoreFriend(url: string, request: { uid: string; }, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/friend/ignore/remove */ /** Handle client/friend/ignore/remove */
public unIgnoreFriend(url: string, request: { uid: string; }, sessionID: string): any // eslint-disable-next-line @typescript-eslint/no-unused-vars
public unIgnoreFriend(url: string, request: { uid: string; }, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]> public clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.emptyArrayResponse(); return this.httpResponse.emptyArrayResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]> public removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.emptyArrayResponse(); return this.httpResponse.emptyArrayResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public async onUpdate(timeSinceLastRun: number): Promise<boolean> public async onUpdate(timeSinceLastRun: number): Promise<boolean>
{ {
this.dialogueController.update(); this.dialogueController.update();

View File

@ -11,6 +11,7 @@ import { IGameKeepAliveResponse } from "@spt-aki/models/eft/game/IGameKeepAliveR
import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData"; import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutResponseData";
import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse";
import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; 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 { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData";
import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData";
@ -154,7 +155,7 @@ export class GameCallbacks implements OnLoad
* @returns string * @returns string
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
public getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any public getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse
{ {
return this.httpResponse.noBody(this.gameController.getRaidTime(sessionID, request)); return this.httpResponse.noBody(this.gameController.getRaidTime(sessionID, request));
} }

View File

@ -11,6 +11,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; 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 { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
@ -36,40 +37,47 @@ export class MatchCallbacks
{} {}
/** Handle client/match/updatePing */ /** Handle client/match/updatePing */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData public updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// Handle client/match/exit // Handle client/match/exit
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/match/group/exit_from_menu */ /** Handle client/match/group/exit_from_menu */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/match/group/invite/send */ /** Handle client/match/group/invite/send */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string> public sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string>
{ {
return this.httpResponse.getBody("2427943f23698ay9f2863735"); return this.httpResponse.getBody("2427943f23698ay9f2863735");
} }
/** Handle client/match/group/invite/accept */ /** Handle client/match/group/invite/accept */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public acceptGroupInvite( public acceptGroupInvite(
url: string, url: string,
info: IAcceptGroupInviteRequest, info: IAcceptGroupInviteRequest,
@ -83,6 +91,7 @@ export class MatchCallbacks
} }
/** Handle client/match/group/invite/cancel */ /** Handle client/match/group/invite/cancel */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public cancelGroupInvite( public cancelGroupInvite(
url: string, url: string,
info: ICancelGroupInviteRequest, info: ICancelGroupInviteRequest,
@ -91,32 +100,36 @@ export class MatchCallbacks
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/transfer */ /** Handle client/match/group/transfer */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean> public transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean>
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/invite/cancel-all */ /** Handle client/match/group/invite/cancel-all */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData public cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** @deprecated - not called on raid start/end or game start/exit */ /** @deprecated - not called on raid start/end or game start/exit */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData public putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle raid/profile/list */ /** Handle raid/profile/list */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]> public getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>
{ {
return this.httpResponse.getBody(this.matchController.getProfile(info)); return this.httpResponse.getBody(this.matchController.getProfile(info));
} }
// Handle client/match/available // Handle client/match/available
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean> public serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>
{ {
const output = this.matchController.getEnabled(); const output = this.matchController.getEnabled();
@ -135,6 +148,7 @@ export class MatchCallbacks
} }
/** Handle client/getMetricsConfig */ /** Handle client/getMetricsConfig */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string> public getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>
{ {
return this.httpResponse.getBody(this.jsonUtil.serialize(this.databaseServer.getTables().match.metrics)); return this.httpResponse.getBody(this.jsonUtil.serialize(this.databaseServer.getTables().match.metrics));
@ -145,18 +159,21 @@ export class MatchCallbacks
* Handle client/match/group/status * Handle client/match/group/status
* @returns * @returns
*/ */
public getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any> // eslint-disable-next-line @typescript-eslint/no-unused-vars
public getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<IGetGroupStatusResponse>
{ {
return this.httpResponse.getBody(this.matchController.getGroupStatus(info)); return this.httpResponse.getBody(this.matchController.getGroupStatus(info));
} }
/** Handle client/match/group/create */ /** Handle client/match/group/create */
// TODO: may have been removed from client
public createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any> public createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>
{ {
return this.httpResponse.getBody(this.matchController.createGroup(sessionID, info)); return this.httpResponse.getBody(this.matchController.createGroup(sessionID, info));
} }
/** Handle client/match/group/delete */ /** Handle client/match/group/delete */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public deleteGroup(url: string, info: any, sessionID: string): INullResponseData public deleteGroup(url: string, info: any, sessionID: string): INullResponseData
{ {
this.matchController.deleteGroup(info); this.matchController.deleteGroup(info);
@ -164,12 +181,14 @@ export class MatchCallbacks
} }
// Handle client/match/group/leave // Handle client/match/group/leave
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean> public leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/player/remove */ /** Handle client/match/group/player/remove */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public removePlayerFromGroup(url: string, info: IRemovePlayerFromGroupRequest, sessionID: string): INullResponseData public removePlayerFromGroup(url: string, info: IRemovePlayerFromGroupRequest, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();

View File

@ -27,6 +27,7 @@ export class NotifierCallbacks
* until we actually have something to send because otherwise we'd spam the client * until we actually have something to send because otherwise we'd spam the client
* and the client would abort the connection due to spam. * and the client would abort the connection due to spam.
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendNotification(sessionID: string, req: any, resp: any, data: any): void public sendNotification(sessionID: string, req: any, resp: any, data: any): void
{ {
const splittedUrl = req.url.split("/"); const splittedUrl = req.url.split("/");
@ -43,6 +44,8 @@ export class NotifierCallbacks
/** Handle push/notifier/get */ /** Handle push/notifier/get */
/** Handle push/notifier/getwebsocket */ /** Handle push/notifier/getwebsocket */
// TODO: removed from client?
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]> public getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.emptyArrayResponse(); return this.httpResponse.emptyArrayResponse();
@ -62,6 +65,7 @@ export class NotifierCallbacks
* Handle client/game/profile/select * Handle client/game/profile/select
* @returns ISelectProfileResponse * @returns ISelectProfileResponse
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public selectProfile( public selectProfile(
url: string, url: string,
info: ISelectProfileRequestData, info: ISelectProfileRequestData,
@ -71,6 +75,7 @@ export class NotifierCallbacks
return this.httpResponse.getBody({ status: "ok" }); return this.httpResponse.getBody({ status: "ok" });
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public notify(url: string, info: any, sessionID: string): string public notify(url: string, info: any, sessionID: string): string
{ {
return "NOTIFY"; return "NOTIFY";

View File

@ -7,6 +7,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData"; import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData";
import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData"; 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 { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest";
import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData";
import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData";
@ -31,10 +32,11 @@ export class ProfileCallbacks
/** /**
* Handle client/game/profile/create * Handle client/game/profile/create
*/ */
public createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any> public createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<ICreateProfileResponse>
{ {
this.profileController.createProfile(info, sessionID); const id = this.profileController.createProfile(info, sessionID);
return this.httpResponse.getBody({ uid: `pmc${sessionID}` });
return this.httpResponse.getBody({ uid: id });
} }
/** /**

View File

@ -13,6 +13,8 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe
import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult";
import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData";
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; 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 { IRemoveOfferRequestData } from "@spt-aki/models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData"; import { ISendRagfairReportRequestData } from "@spt-aki/models/eft/ragfair/ISendRagfairReportRequestData";
@ -138,4 +140,10 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
this.ragfairTaxService.storeClientOfferTaxValue(sessionId, request); this.ragfairTaxService.storeClientOfferTaxValue(sessionId, request);
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/ragfair/offer/findbyid */
public getFleaOfferById(url: string, request: IGetRagfairOfferByIdRequest, sessionID: string): IGetBodyResponseData<IRagfairOffer>
{
return this.httpResponse.getBody(this.ragfairController.getOfferById(sessionID, request));
}
} }

View File

@ -96,7 +96,7 @@ export class InventoryController
const ownerInventoryItems = this.inventoryHelper.getOwnerInventoryItems(moveRequest, sessionID); const ownerInventoryItems = this.inventoryHelper.getOwnerInventoryItems(moveRequest, sessionID);
if (ownerInventoryItems.sameInventory) if (ownerInventoryItems.sameInventory)
{ {
// Don't move items from trader to profile, this can happen when editing a traders preset weapons // Dont move items from trader to profile, this can happen when editing a traders preset weapons
if (moveRequest.fromOwner?.type === "Trader" && !ownerInventoryItems.isMail) if (moveRequest.fromOwner?.type === "Trader" && !ownerInventoryItems.isMail)
{ {
return this.getTraderExploitErrorResponse(output); return this.getTraderExploitErrorResponse(output);
@ -185,7 +185,7 @@ export class InventoryController
/** /**
* Split Item * Split Item
* splitting 1 stack into 2 * spliting 1 stack into 2
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
* @param request Split request * @param request Split request
* @param sessionID Session/player id * @param sessionID Session/player id
@ -209,8 +209,7 @@ export class InventoryController
request.container.location = matchingItems.length; // Wrong location for first cartridge request.container.location = matchingItems.length; // Wrong location for first cartridge
} }
// The item being merged has three possible sources: pmc, scav or mail, getOwnerInventoryItems() handles getting // The item being merged has three possible sources: pmc, scav or mail, getOwnerInventoryItems() handles getting correct one
// correct one.
const itemToSplit = inventoryItems.from.find((x) => x._id === request.splitItem); const itemToSplit = inventoryItems.from.find((x) => x._id === request.splitItem);
if (!itemToSplit) if (!itemToSplit)
{ {
@ -284,7 +283,7 @@ export class InventoryController
if (!(destinationItem.upd?.StackObjectsCount)) if (!(destinationItem.upd?.StackObjectsCount))
{ {
// No stack count on destination, add one // No stackcount on destination, add one
destinationItem.upd = { StackObjectsCount: 1 }; destinationItem.upd = { StackObjectsCount: 1 };
} }
@ -294,11 +293,17 @@ export class InventoryController
} }
else if (!sourceItem.upd.StackObjectsCount) else if (!sourceItem.upd.StackObjectsCount)
{ {
// Items pulled out of raid can have no stack count if the stack should be 1 // Items pulled out of raid can have no stackcount if the stack should be 1
sourceItem.upd.StackObjectsCount = 1; sourceItem.upd.StackObjectsCount = 1;
} }
destinationItem.upd.StackObjectsCount += sourceItem.upd.StackObjectsCount; // Add source stack count to destination // Remove FiR status from destination stack when source stack has no FiR but destination does
if (!sourceItem.upd.SpawnedInSession && destinationItem.upd.SpawnedInSession)
{
delete destinationItem.upd.SpawnedInSession;
}
destinationItem.upd.StackObjectsCount += sourceItem.upd.StackObjectsCount; // Add source stackcount to destination
output.profileChanges[sessionID].items.del.push({ _id: sourceItem._id }); // Inform client source item being deleted output.profileChanges[sessionID].items.del.push({ _id: sourceItem._id }); // Inform client source item being deleted
const indexOfItemToRemove = inventoryItems.from.findIndex((x) => x._id === sourceItem._id); const indexOfItemToRemove = inventoryItems.from.findIndex((x) => x._id === sourceItem._id);
@ -315,8 +320,8 @@ export class InventoryController
} }
/** /**
* // TODO: Adds no data to output to send to client, is this by design? * TODO: Adds no data to output to send to client, is this by design?
* // TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc * TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc
* Transfer items from one stack into another while keeping original stack * Transfer items from one stack into another while keeping original stack
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
* @param pmcData Player profile * @param pmcData Player profile
@ -422,10 +427,10 @@ export class InventoryController
this.logger.error(`Unable to find item: ${request.item2} to swap positions with: ${request.item}`); this.logger.error(`Unable to find item: ${request.item2} to swap positions with: ${request.item}`);
} }
// to.id is the parentId // to.id is the parentid
itemOne.parentId = request.to.id; itemOne.parentId = request.to.id;
// to.container is the slotId // to.container is the slotid
itemOne.slotId = request.to.container; itemOne.slotId = request.to.container;
// Request object has location data, add it in, otherwise remove existing location from object // Request object has location data, add it in, otherwise remove existing location from object
@ -477,7 +482,7 @@ export class InventoryController
} }
/** /**
* Toggles "toggleable" items like night vision goggles and face shields. * Toggles "Toggleable" items like night vision goggles and face shields.
* @param pmcData player profile * @param pmcData player profile
* @param body Toggle request * @param body Toggle request
* @param sessionID Session id * @param sessionID Session id
@ -549,7 +554,7 @@ export class InventoryController
* Bind an inventory item to the quick access menu at bottom of player screen * Bind an inventory item to the quick access menu at bottom of player screen
* Handle bind event * Handle bind event
* @param pmcData Player profile * @param pmcData Player profile
* @param bindRequest Request object * @param bindRequest Reqeust object
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
@ -680,9 +685,9 @@ export class InventoryController
} }
/** /**
* Get the tplId of an item from the examine request object * Get the tplid of an item from the examine request object
* @param body response request * @param body response request
* @returns string * @returns tplid
*/ */
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string protected getExaminedItemTpl(body: IInventoryExamineRequestData): string
{ {
@ -692,41 +697,40 @@ export class InventoryController
} }
else if (body.fromOwner.id === Traders.FENCE) else if (body.fromOwner.id === Traders.FENCE)
{ {
// Get tpl from fence assorts // get tpl from fence assorts
return this.fenceService.getRawFenceAssorts().items.find((x) => x._id === body.item)._tpl; return this.fenceService.getRawFenceAssorts().items.find((x) => x._id === body.item)._tpl;
} }
else if (body.fromOwner.type === "Trader") else if (body.fromOwner.type === "Trader")
{ // not fence { // not fence
// Not fence // get tpl from trader assort
// Get tpl from trader assort
return this.databaseServer.getTables().traders[body.fromOwner.id].assort.items.find((item) => return this.databaseServer.getTables().traders[body.fromOwner.id].assort.items.find((item) =>
item._id === body.item item._id === body.item
)._tpl; )._tpl;
} }
else if (body.fromOwner.type === "RagFair") else if (body.fromOwner.type === "RagFair")
{ {
// try to get tplId from items.json first // try to get tplid from items.json first
const item = this.databaseServer.getTables().templates.items[body.item]; const item = this.databaseServer.getTables().templates.items[body.item];
if (item) if (item)
{ {
return item._id; return item._id;
} }
// Try alternate way of getting offer if first approach fails // try alternate way of getting offer if first approach fails
let offer = this.ragfairOfferService.getOfferByOfferId(body.item); let offer = this.ragfairOfferService.getOfferByOfferId(body.item);
if (!offer) if (!offer)
{ {
offer = this.ragfairOfferService.getOfferByOfferId(body.fromOwner.id); offer = this.ragfairOfferService.getOfferByOfferId(body.fromOwner.id);
} }
// Try find examine item inside offer items array // try find examine item inside offer items array
const matchingItem = offer.items.find((x) => x._id === body.item); const matchingItem = offer.items.find((x) => x._id === body.item);
if (matchingItem) if (matchingItem)
{ {
return matchingItem._tpl; return matchingItem._tpl;
} }
// Unable to find item in database or ragfair // unable to find item in database or ragfair
throw new Error(this.localisationService.getText("inventory-unable_to_find_item", body.item)); throw new Error(this.localisationService.getText("inventory-unable_to_find_item", body.item));
} }
} }
@ -741,6 +745,7 @@ export class InventoryController
{ {
pmcData.Encyclopedia[id] = true; pmcData.Encyclopedia[id] = true;
} }
return this.eventOutputHolder.getOutput(sessionID); return this.eventOutputHolder.getOutput(sessionID);
} }

View File

@ -10,6 +10,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; 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 { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
@ -99,6 +100,7 @@ export class MatchController
} }
/** Handle match/group/start_game */ /** Handle match/group/start_game */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult public joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult
{ {
const output: IJoinMatchResult = { maxPveCountExceeded: false, profiles: [] }; const output: IJoinMatchResult = { maxPveCountExceeded: false, profiles: [] };
@ -116,6 +118,7 @@ export class MatchController
raidMode: "Online", raidMode: "Online",
mode: "deathmatch", mode: "deathmatch",
shortid: null, shortid: null,
// eslint-disable-next-line @typescript-eslint/naming-convention
additional_info: null, additional_info: null,
}); });
@ -123,7 +126,8 @@ export class MatchController
} }
/** Handle client/match/group/status */ /** Handle client/match/group/status */
public getGroupStatus(info: IGetGroupStatusRequestData): any // eslint-disable-next-line @typescript-eslint/no-unused-vars
public getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse
{ {
return { players: [], maxPveCountExceeded: false }; return { players: [], maxPveCountExceeded: false };
} }
@ -140,7 +144,7 @@ export class MatchController
// TODO: add code to strip PMC of equipment now they've started the raid // TODO: add code to strip PMC of equipment now they've started the raid
// Set PMCs to difficulty set in pre-raid screen if override in bot config isn't enabled // Set pmcs to difficulty set in pre-raid screen if override in bot config isnt enabled
if (!this.pmcConfig.useDifficultyOverride) if (!this.pmcConfig.useDifficultyOverride)
{ {
this.pmcConfig.difficulty = this.convertDifficultyDropdownIntoBotDifficulty( this.pmcConfig.difficulty = this.convertDifficultyDropdownIntoBotDifficulty(

View File

@ -118,8 +118,11 @@ export class ProfileController
/** /**
* Handle client/game/profile/create * Handle client/game/profile/create
* @param info Client reqeust object
* @param sessionID Player id
* @returns Profiles _id value
*/ */
public createProfile(info: IProfileCreateRequestData, sessionID: string): void public createProfile(info: IProfileCreateRequestData, sessionID: string): string
{ {
const account = this.saveServer.getProfile(sessionID).info; const account = this.saveServer.getProfile(sessionID).info;
const profile: TemplateSide = const profile: TemplateSide =
@ -213,6 +216,8 @@ export class ProfileController
// Completed account creation // Completed account creation
this.saveServer.getProfile(sessionID).info.wipe = false; this.saveServer.getProfile(sessionID).info.wipe = false;
this.saveServer.saveProfile(sessionID); this.saveServer.saveProfile(sessionID);
return pmcData._id;
} }
/** /**

View File

@ -21,6 +21,7 @@ import { IExtendOfferRequestData } from "@spt-aki/models/eft/ragfair/IExtendOffe
import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult"; import { IGetItemPriceResult } from "@spt-aki/models/eft/ragfair/IGetItemPriceResult";
import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData"; import { IGetMarketPriceRequestData } from "@spt-aki/models/eft/ragfair/IGetMarketPriceRequestData";
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; 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 { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessBuyTradeRequestData } from "@spt-aki/models/eft/trade/IProcessBuyTradeRequestData";
@ -147,6 +148,20 @@ export class RagfairController
return result; return result;
} }
/**
* Handle client/ragfair/offer/findbyid
* @param sessionId Player id
* @param request Request data
* @returns IRagfairOffer
*/
public getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer
{
const offers = this.ragfairOfferService.getOffers();
const offerToReturn = offers.find(x => x.intId === request.id);
return offerToReturn;
}
/** /**
* Get offers for the client based on type of search being performed * Get offers for the client based on type of search being performed
* @param searchRequest Client search request data * @param searchRequest Client search request data

View File

@ -34,6 +34,9 @@ export class RagfairOfferGenerator
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected allowedFleaPriceItemsForBarter: { tpl: string; price: number; }[]; protected allowedFleaPriceItemsForBarter: { tpl: string; price: number; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter = 0;
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@inject("JsonUtil") protected jsonUtil: JsonUtil, @inject("JsonUtil") protected jsonUtil: JsonUtil,
@ -121,7 +124,7 @@ export class RagfairOfferGenerator
const offer: IRagfairOffer = { const offer: IRagfairOffer = {
_id: this.hashUtil.generate(), _id: this.hashUtil.generate(),
intId: 0, intId: this.offerCounter,
user: { user: {
id: this.getTraderId(userID), id: this.getTraderId(userID),
memberType: (userID === "ragfair") memberType: (userID === "ragfair")
@ -149,6 +152,8 @@ export class RagfairOfferGenerator
CurrentItemCount: itemCount, CurrentItemCount: itemCount,
}; };
this.offerCounter++;
return offer; return offer;
} }

View File

@ -2,7 +2,7 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
export interface ICurrentGroupResponse export interface ICurrentGroupResponse
{ {
squad: any[]; squad: ICurrentGroupSquadMember[];
} }
export interface ICurrentGroupSquadMember export interface ICurrentGroupSquadMember

View File

@ -0,0 +1,25 @@
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;
}

View File

@ -0,0 +1,4 @@
export interface ICreateProfileResponse
{
uid: string
}

View File

@ -0,0 +1,4 @@
export interface IGetRagfairOfferByIdRequest
{
id: number
}

View File

@ -11,17 +11,23 @@ export class RagfairStaticRouter extends StaticRouter
super([ super([
new RouteAction( new RouteAction(
"/client/ragfair/search", "/client/ragfair/search",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.search(url, info, sessionID); return this.ragfairCallbacks.search(url, info, sessionID);
}, },
), ),
new RouteAction("/client/ragfair/find", (url: string, info: any, sessionID: string, output: string): any => new RouteAction(
"/client/ragfair/find",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.search(url, info, sessionID); return this.ragfairCallbacks.search(url, info, sessionID);
}), },
),
new RouteAction( new RouteAction(
"/client/ragfair/itemMarketPrice", "/client/ragfair/itemMarketPrice",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.getMarketPrice(url, info, sessionID); return this.ragfairCallbacks.getMarketPrice(url, info, sessionID);
@ -29,6 +35,7 @@ export class RagfairStaticRouter extends StaticRouter
), ),
new RouteAction( new RouteAction(
"/client/ragfair/offerfees", "/client/ragfair/offerfees",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.storePlayerOfferTaxAmount(url, info, sessionID); return this.ragfairCallbacks.storePlayerOfferTaxAmount(url, info, sessionID);
@ -36,15 +43,28 @@ export class RagfairStaticRouter extends StaticRouter
), ),
new RouteAction( new RouteAction(
"/client/reports/ragfair/send", "/client/reports/ragfair/send",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any => (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.sendReport(url, info, sessionID); return this.ragfairCallbacks.sendReport(url, info, sessionID);
}, },
), ),
new RouteAction("/client/items/prices", (url: string, info: any, sessionID: string, output: string): any => new RouteAction(
"/client/items/prices",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.ragfairCallbacks.getFleaPrices(url, info, sessionID); return this.ragfairCallbacks.getFleaPrices(url, info, sessionID);
}), },
),
new RouteAction(
"/client/ragfair/offer/findbyid",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.ragfairCallbacks.getFleaOfferById(url, info, sessionID);
},
),
]); ]);
} }
} }