Fixed survey not implemented errors
This commit is contained in:
parent
24d279c9f7
commit
eafa390c72
@ -17,6 +17,147 @@
|
||||
"fixShotgunDispersion": true,
|
||||
"removeModItemsFromProfile": false,
|
||||
"fixProfileBreakingInventoryItemIssues": false
|
||||
},
|
||||
"survey": {
|
||||
"locale": {
|
||||
"en": {
|
||||
"question_1": "How off-topic is general chat on the SPT discord?",
|
||||
"question_1_answer_1": "Not at all",
|
||||
"question_1_answer_2": "A little",
|
||||
"question_1_answer_3": "Sometimes",
|
||||
"question_1_answer_4": "Somewhat often",
|
||||
"question_1_answer_5": "Quite often",
|
||||
"question_1_answer_6": "Most of the time",
|
||||
"question_1_answer_7": "Almost always",
|
||||
"question_1_answer_8": "Always",
|
||||
"question_1_answer_9": "NOT OFF TOPIC ENOUGH",
|
||||
"question_1_answer_10": "I LIVE TO MAKE GENERAL CHAT OFF TOPIC",
|
||||
"question_1_answer_11": "I am posting gifs to general chat as we speak",
|
||||
"question_2": "When you download a mod from the hub do you read the readme/mod description?",
|
||||
"question_2_answer_1": "What's a description",
|
||||
"question_2_answer_2": "I can't read",
|
||||
"question_2_answer_3": "I am illiterate",
|
||||
"question_2_answer_4": "I am too busy making general chat off-topic to read",
|
||||
"question_2_answer_5": "YOU WILL NEVER MAKE ME READ TEXT I WILL ASK IN GENERAL CHAT INSTEAD",
|
||||
"title": "Feedback survey",
|
||||
"time": "About 1 minute",
|
||||
"description": "This is the first SPT survey! Your survey doesn't get sent anywhere, its just for modders to see how it works and maybe make use of.",
|
||||
"farewell": "I told you at the start the survey doesn't get sent anywhere and yet you still completed it, curious."
|
||||
}
|
||||
},
|
||||
"survey": {
|
||||
"id": 1,
|
||||
"welcomePageData": {
|
||||
"titleLocaleKey": "title",
|
||||
"timeLocaleKey": "time",
|
||||
"descriptionLocaleKey": "description"
|
||||
},
|
||||
"farewellPageData": {
|
||||
"textLocaleKey": "farewell"
|
||||
},
|
||||
"pages": [[0, 1]],
|
||||
"questions": [{
|
||||
"id": 0,
|
||||
"sortIndex": 1,
|
||||
"titleLocaleKey": "question_1",
|
||||
"hintLocaleKey": "",
|
||||
"answerLimit": 10,
|
||||
"answerType": "MultiOption",
|
||||
"answers": [{
|
||||
"id": 0,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_1"
|
||||
}, {
|
||||
"id": 1,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_2"
|
||||
}, {
|
||||
"id": 2,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_3"
|
||||
}, {
|
||||
"id": 3,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_4"
|
||||
}, {
|
||||
"id": 4,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_5"
|
||||
}, {
|
||||
"id": 5,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_6"
|
||||
}, {
|
||||
"id": 6,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_7"
|
||||
}, {
|
||||
"id": 7,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_8"
|
||||
}, {
|
||||
"id": 8,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_9"
|
||||
}, {
|
||||
"id": 9,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_10"
|
||||
}, {
|
||||
"id": 10,
|
||||
"questionId": 0,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_1_answer_11"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"id": 1,
|
||||
"sortIndex": 1,
|
||||
"titleLocaleKey": "question_2",
|
||||
"hintLocaleKey": "",
|
||||
"answerLimit": 5,
|
||||
"answerType": "SingleOption",
|
||||
"answers": [{
|
||||
"id": 0,
|
||||
"questionId": 1,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_2_answer_1"
|
||||
}, {
|
||||
"id": 1,
|
||||
"questionId": 1,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_2_answer_2"
|
||||
}, {
|
||||
"id": 2,
|
||||
"questionId": 1,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_2_answer_3"
|
||||
}, {
|
||||
"id": 3,
|
||||
"questionId": 1,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_2_answer_4"
|
||||
}, {
|
||||
"id": 4,
|
||||
"questionId": 1,
|
||||
"sortIndex": 1,
|
||||
"localeKey": "question_2_answer_5"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"isNew": false
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"autoInstallModDependencies": false,
|
||||
|
@ -13,7 +13,9 @@ import { IGameModeResponse } from "@spt/models/eft/game/IGameModeResponse";
|
||||
import { IGameStartResponse } from "@spt/models/eft/game/IGameStartResponse";
|
||||
import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest";
|
||||
import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse";
|
||||
import { ISendSurveyOpinionRequest } from "@spt/models/eft/game/ISendSurveyOpinionRequest";
|
||||
import { IServerDetails } from "@spt/models/eft/game/IServerDetails";
|
||||
import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData";
|
||||
import { IVersionValidateRequestData } from "@spt/models/eft/game/IVersionValidateRequestData";
|
||||
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||
@ -169,7 +171,27 @@ export class GameCallbacks implements OnLoad {
|
||||
* Handle /client/survey
|
||||
* @returns INullResponseData
|
||||
*/
|
||||
public getSurvey(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData {
|
||||
public getSurvey(
|
||||
url: string,
|
||||
request: IEmptyRequestData,
|
||||
sessionId: string,
|
||||
): INullResponseData | IGetBodyResponseData<ISurveyResponseData> {
|
||||
return this.httpResponse.getBody(this.gameController.getSurvey(sessionId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle client/survey/view
|
||||
* @returns INullResponseData
|
||||
*/
|
||||
public getSurveyView(url: string, request: any, sessionId: string): INullResponseData {
|
||||
return this.httpResponse.nullResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle client/survey/opinion
|
||||
* @returns INullResponseData
|
||||
*/
|
||||
public sendSurveyOpinion(url: string, request: ISendSurveyOpinionRequest, sessionId: string): INullResponseData {
|
||||
return this.httpResponse.nullResponse();
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import { ESessionMode } from "@spt/models/eft/game/IGameModeResponse";
|
||||
import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest";
|
||||
import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse";
|
||||
import { IServerDetails } from "@spt/models/eft/game/IServerDetails";
|
||||
import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData";
|
||||
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||
import { BonusType } from "@spt/models/enums/BonusType";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
@ -549,4 +550,8 @@ export class GameController {
|
||||
this.logger.debug(`Debug enabled: ${globalThis.G_DEBUG_CONFIGURATION}`);
|
||||
this.logger.debug(`Mods enabled: ${globalThis.G_MODS_ENABLED}`);
|
||||
}
|
||||
|
||||
public getSurvey(sessionId: string): ISurveyResponseData {
|
||||
return this.coreConfig.survey;
|
||||
}
|
||||
}
|
||||
|
10
project/src/models/eft/game/ISendSurveyOpinionRequest.ts
Normal file
10
project/src/models/eft/game/ISendSurveyOpinionRequest.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export interface ISendSurveyOpinionRequest {
|
||||
surveyId: number;
|
||||
answers: ISurveyOpinionAnswer[];
|
||||
}
|
||||
|
||||
export interface ISurveyOpinionAnswer {
|
||||
questionId: number;
|
||||
answerType: string;
|
||||
answers: any;
|
||||
}
|
40
project/src/models/eft/game/ISurveyResponseData.ts
Normal file
40
project/src/models/eft/game/ISurveyResponseData.ts
Normal file
@ -0,0 +1,40 @@
|
||||
export interface ISurveyResponseData {
|
||||
locale: Record<string, Record<string, string>>;
|
||||
survey: ISurvey;
|
||||
}
|
||||
|
||||
export interface ISurvey {
|
||||
id: number;
|
||||
welcomePageData: IWelcomePageData;
|
||||
farewellPageData: IFarewellPageData;
|
||||
pages: number[][];
|
||||
questions: ISurveyQuestion[];
|
||||
isNew: boolean;
|
||||
}
|
||||
|
||||
export interface IWelcomePageData {
|
||||
titleLocaleKey: string;
|
||||
timeLocaleKey: string;
|
||||
descriptionLocaleKey: string;
|
||||
}
|
||||
|
||||
export interface IFarewellPageData {
|
||||
textLocaleKey: string;
|
||||
}
|
||||
|
||||
export interface ISurveyQuestion {
|
||||
id: number;
|
||||
sortIndex: number;
|
||||
titleLocaleKey: string;
|
||||
hintLocaleKey: string;
|
||||
answerLimit: number;
|
||||
answerType: string;
|
||||
answers: ISurveyAnswer[];
|
||||
}
|
||||
|
||||
export interface ISurveyAnswer {
|
||||
id: number;
|
||||
questionId: number;
|
||||
sortIndex: number;
|
||||
localeKey: string;
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData";
|
||||
import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig";
|
||||
|
||||
export interface ICoreConfig extends IBaseConfig {
|
||||
@ -12,6 +13,7 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
bsgLogging: IBsgLogging;
|
||||
release: IRelease;
|
||||
fixes: IGameFixes;
|
||||
survey: ISurveyResponseData;
|
||||
features: IServerFeatures;
|
||||
/** Commit hash build server was created from */
|
||||
commit?: string;
|
||||
|
@ -10,6 +10,7 @@ import { IGameStartResponse } from "@spt/models/eft/game/IGameStartResponse";
|
||||
import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse";
|
||||
import { ISendReportRequest } from "@spt/models/eft/game/ISendReportRequest";
|
||||
import { IServerDetails } from "@spt/models/eft/game/IServerDetails";
|
||||
import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData";
|
||||
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData";
|
||||
import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil";
|
||||
@ -147,10 +148,27 @@ export class GameStaticRouter extends StaticRouter {
|
||||
),
|
||||
new RouteAction(
|
||||
"/client/survey",
|
||||
async (url: string, info: any, sessionID: string, output: string): Promise<INullResponseData> => {
|
||||
async (
|
||||
url: string,
|
||||
info: any,
|
||||
sessionID: string,
|
||||
output: string,
|
||||
): Promise<INullResponseData | IGetBodyResponseData<ISurveyResponseData>> => {
|
||||
return this.gameCallbacks.getSurvey(url, info, sessionID);
|
||||
},
|
||||
),
|
||||
new RouteAction(
|
||||
"/client/survey/view",
|
||||
async (url: string, info: any, sessionID: string, output: string): Promise<INullResponseData> => {
|
||||
return this.gameCallbacks.getSurveyView(url, info, sessionID);
|
||||
},
|
||||
),
|
||||
new RouteAction(
|
||||
"/client/survey/opinion",
|
||||
async (url: string, info: any, sessionID: string, output: string): Promise<INullResponseData> => {
|
||||
return this.gameCallbacks.sendSurveyOpinion(url, info, sessionID);
|
||||
},
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user