2 spaces tab, prettier command
This commit is contained in:
parent
3e4d0e105f
commit
bd4ea5c944
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"tabWidth": 4,
|
"tabWidth": 2,
|
||||||
"useTabs": false,
|
"useTabs": false,
|
||||||
"endOfLine": "auto",
|
"endOfLine": "auto",
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
|
10
config.json
10
config.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"autoCreateAccount": true,
|
"autoCreateAccount": true,
|
||||||
"buildLabel": "2023.05.25.13.39/oZkc-RIme5c1CCltUfg2gQ",
|
"buildLabel": "2023.05.25.13.39/oZkc-RIme5c1CCltUfg2gQ",
|
||||||
"matchmakingBuildId": "4920386201513015989",
|
"matchmakingBuildId": "4920386201513015989",
|
||||||
"version": "33.0.14",
|
"version": "33.0.14",
|
||||||
"worldSeed": "GWvLyHiw7/Qr/60056xmAmDrn0Y9et2S3BYlLSkLDNBMtumSr3KxWV8He5Jz72yYq3tsY+cd53QeTf+bb54+llGTbYiQF+64BtiLWMVhWP1IUaP4SxWHXojlpQC13op/udHI1whc+8zrxEzzZmv/QlpvigAAbjBDtwu97Df0vgn+YrOKi4G3OhgIkTRocAAzD1P/BGbT8gaKE01H8rXl3+Gq6jCA1O1v800SL6DwKOgMsXVvWp7g2n/tPxJe/j9bmu4XFG0bSa5y5hikLKxvntA/5ut+iogv4MyMBe+TydVxjPqNbkKnby5l4KAL+3inpuPraeg4jcNMt0AwKG8NIQ=="
|
"worldSeed": "GWvLyHiw7/Qr/60056xmAmDrn0Y9et2S3BYlLSkLDNBMtumSr3KxWV8He5Jz72yYq3tsY+cd53QeTf+bb54+llGTbYiQF+64BtiLWMVhWP1IUaP4SxWHXojlpQC13op/udHI1whc+8zrxEzzZmv/QlpvigAAbjBDtwu97Df0vgn+YrOKi4G3OhgIkTRocAAzD1P/BGbT8gaKE01H8rXl3+Gq6jCA1O1v800SL6DwKOgMsXVvWp7g2n/tPxJe/j9bmu4XFG0bSa5y5hikLKxvntA/5ut+iogv4MyMBe+TydVxjPqNbkKnby5l4KAL+3inpuPraeg4jcNMt0AwKG8NIQ=="
|
||||||
}
|
}
|
||||||
|
71
package.json
71
package.json
@ -1,37 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "wf-emulator",
|
"name": "wf-emulator",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "WF Emulator",
|
"description": "WF Emulator",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node build/index.js",
|
"start": "node build/index.js",
|
||||||
"dev": "ts-node-dev --openssl-legacy-provider -r tsconfig-paths/register src/index.ts",
|
"dev": "ts-node-dev --openssl-legacy-provider -r tsconfig-paths/register src/index.ts",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"lint": "eslint --ext .ts ."
|
"lint": "eslint --ext .ts .",
|
||||||
},
|
"pretty": "prettier --write \"./**/*.{js,jsx,ts,tsx,json}\""
|
||||||
"license": "GNU",
|
},
|
||||||
"dependencies": {
|
"license": "GNU",
|
||||||
"dotenv": "^16.0.3",
|
"dependencies": {
|
||||||
"express": "^5.0.0-beta.1",
|
"dotenv": "^16.0.3",
|
||||||
"mongoose": "^7.1.1"
|
"express": "^5.0.0-beta.1",
|
||||||
},
|
"mongoose": "^7.1.1"
|
||||||
"devDependencies": {
|
},
|
||||||
"@tsconfig/node20": "^1.0.0",
|
"devDependencies": {
|
||||||
"@types/body-parser": "^1.19.2",
|
"@tsconfig/node20": "^1.0.0",
|
||||||
"@types/express": "^4.17.17",
|
"@types/body-parser": "^1.19.2",
|
||||||
"@types/morgan": "^1.9.4",
|
"@types/express": "^4.17.17",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
"@types/morgan": "^1.9.4",
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||||
"eslint": "^8.40.0",
|
"@typescript-eslint/parser": "^5.59.2",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint": "^8.40.0",
|
||||||
"morgan": "^1.10.0",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"prettier": "^2.8.8",
|
"morgan": "^1.10.0",
|
||||||
"ts-node-dev": "^2.0.0",
|
"prettier": "^2.8.8",
|
||||||
"tsconfig-paths": "^4.2.0",
|
"ts-node-dev": "^2.0.0",
|
||||||
"typescript": "^5.0.4"
|
"tsconfig-paths": "^4.2.0",
|
||||||
},
|
"typescript": "^5.0.4"
|
||||||
"engines": {
|
},
|
||||||
"node": ">=18.15.0",
|
"engines": {
|
||||||
"npm": ">=9.5.0"
|
"node": ">=18.15.0",
|
||||||
}
|
"npm": ">=9.5.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const checkDailyMissionBonusController: RequestHandler = (_req, res) => {
|
const checkDailyMissionBonusController: RequestHandler = (_req, res) => {
|
||||||
const data = Buffer.from([
|
const data = Buffer.from([
|
||||||
0x44, 0x61, 0x69, 0x6c, 0x79, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x3a,
|
0x44, 0x61, 0x69, 0x6c, 0x79, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x3a, 0x31,
|
||||||
0x31, 0x2d, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x56, 0x50, 0x57, 0x69, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73,
|
0x2d, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x56, 0x50, 0x57, 0x69, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x3a, 0x31,
|
||||||
0x3a, 0x31, 0x0a
|
0x0a
|
||||||
]);
|
]);
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
"Content-Type": "text/html",
|
"Content-Type": "text/html",
|
||||||
"Content-Length": data.length
|
"Content-Length": data.length
|
||||||
});
|
});
|
||||||
res.end(data);
|
res.end(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { checkDailyMissionBonusController };
|
export { checkDailyMissionBonusController };
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const dronesController: RequestHandler = (_req, res) => {
|
const dronesController: RequestHandler = (_req, res) => {
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
"Content-Type": "text/html",
|
"Content-Type": "text/html",
|
||||||
"Content-Length": "3"
|
"Content-Length": "3"
|
||||||
});
|
});
|
||||||
res.end(Buffer.from([0x7b, 0x7d, 0x0a]));
|
res.end(Buffer.from([0x7b, 0x7d, 0x0a]));
|
||||||
};
|
};
|
||||||
|
|
||||||
export { dronesController };
|
export { dronesController };
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const findSessionsController: RequestHandler = (_req, res) => {
|
const findSessionsController: RequestHandler = (_req, res) => {
|
||||||
const data = Buffer.from([
|
const data = Buffer.from([
|
||||||
0x7b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x22, 0x3a, 0x31, 0x2c, 0x22, 0x53, 0x65, 0x73, 0x73,
|
0x7b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x22, 0x3a, 0x31, 0x2c, 0x22, 0x53, 0x65, 0x73, 0x73, 0x69,
|
||||||
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
|
0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
|
||||||
]);
|
]);
|
||||||
|
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
"Content-Type": "text/html",
|
"Content-Type": "text/html",
|
||||||
"Content-Length": data.length
|
"Content-Length": data.length
|
||||||
});
|
});
|
||||||
res.end(data);
|
res.end(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { findSessionsController };
|
export { findSessionsController };
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const getAllianceController: RequestHandler = (_req, res) => {
|
const getAllianceController: RequestHandler = (_req, res) => {
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { getAllianceController };
|
export { getAllianceController };
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Request, Response } from "express";
|
import { Request, Response } from "express";
|
||||||
|
|
||||||
export default (_request: Request, response: Response) => {
|
export default (_request: Request, response: Response) => {
|
||||||
response.writeHead(200, {
|
response.writeHead(200, {
|
||||||
//Connection: "keep-alive",
|
//Connection: "keep-alive",
|
||||||
//"Content-Encoding": "gzip",
|
//"Content-Encoding": "gzip",
|
||||||
"Content-Type": "text/html",
|
"Content-Type": "text/html",
|
||||||
// charset: "UTF - 8",
|
// charset: "UTF - 8",
|
||||||
"Content-Length": "3"
|
"Content-Length": "3"
|
||||||
});
|
});
|
||||||
response.end(Buffer.from([0x7b, 0x7d, 0x0a]));
|
response.end(Buffer.from([0x7b, 0x7d, 0x0a]));
|
||||||
};
|
};
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const getIgnoredUsersController: RequestHandler = (_req, res) => {
|
const getIgnoredUsersController: RequestHandler = (_req, res) => {
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
"Content-Type": "text/html",
|
"Content-Type": "text/html",
|
||||||
"Content-Length": "3"
|
"Content-Length": "3"
|
||||||
});
|
});
|
||||||
res.end(
|
res.end(
|
||||||
Buffer.from([
|
Buffer.from([
|
||||||
0x7b, 0x22, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x38, 0x33, 0x30, 0x34, 0x30, 0x37, 0x37, 0x32, 0x32,
|
0x7b, 0x22, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x38, 0x33, 0x30, 0x34, 0x30, 0x37, 0x37, 0x32, 0x32, 0x34,
|
||||||
0x34, 0x30, 0x32, 0x32, 0x32, 0x36, 0x31, 0x35, 0x30, 0x31, 0x7d
|
0x30, 0x32, 0x32, 0x32, 0x36, 0x31, 0x35, 0x30, 0x31, 0x7d
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { getIgnoredUsersController };
|
export { getIgnoredUsersController };
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const getNewRewardSeedController: RequestHandler = (_req, res) => {
|
const getNewRewardSeedController: RequestHandler = (_req, res) => {
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { getNewRewardSeedController };
|
export { getNewRewardSeedController };
|
||||||
|
@ -2,7 +2,7 @@ import { RequestHandler } from "express";
|
|||||||
import getShip from "@/static/fixed_responses/getShip.json";
|
import getShip from "@/static/fixed_responses/getShip.json";
|
||||||
|
|
||||||
const getShipController: RequestHandler = (_req, res) => {
|
const getShipController: RequestHandler = (_req, res) => {
|
||||||
res.json(getShip);
|
res.json(getShip);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { getShipController };
|
export { getShipController };
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const hostSessionController: RequestHandler = (_req, res) => {
|
const hostSessionController: RequestHandler = (_req, res) => {
|
||||||
res.json({ sessionId: { $oid: "64777916e794cfc5abdd69ea" }, rewardSeed: -1492798783199571432 });
|
res.json({ sessionId: { $oid: "64777916e794cfc5abdd69ea" }, rewardSeed: -1492798783199571432 });
|
||||||
};
|
};
|
||||||
|
|
||||||
export { hostSessionController };
|
export { hostSessionController };
|
||||||
|
@ -2,7 +2,7 @@ import { RequestHandler } from "express";
|
|||||||
import inbox from "@/static/fixed_responses/inbox.json";
|
import inbox from "@/static/fixed_responses/inbox.json";
|
||||||
|
|
||||||
const inboxController: RequestHandler = (_req, res) => {
|
const inboxController: RequestHandler = (_req, res) => {
|
||||||
res.json(inbox);
|
res.json(inbox);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { inboxController };
|
export { inboxController };
|
||||||
|
@ -2,10 +2,10 @@ import inventory from "@/static/fixed_responses/inventory.json";
|
|||||||
import { Request, RequestHandler, Response } from "express";
|
import { Request, RequestHandler, Response } from "express";
|
||||||
|
|
||||||
const inventorController: RequestHandler = (request: Request, response: Response) => {
|
const inventorController: RequestHandler = (request: Request, response: Response) => {
|
||||||
console.log(request.query);
|
console.log(request.query);
|
||||||
const accountId = request.query.accountId;
|
const accountId = request.query.accountId;
|
||||||
console.log(accountId);
|
console.log(accountId);
|
||||||
response.json(inventory);
|
response.json(inventory);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default inventorController;
|
export default inventorController;
|
||||||
|
@ -11,62 +11,32 @@ import { DTLS, groups, HUB, IRC, Nonce, NRS, platformCDNs } from "@/static/fixed
|
|||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
const loginController: RequestHandler = async (request, response) => {
|
const loginController: RequestHandler = async (request, response) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument
|
||||||
const body = JSON.parse(request.body); // parse octet stream of json data to json object
|
const body = JSON.parse(request.body); // parse octet stream of json data to json object
|
||||||
const loginRequest = toLoginRequest(body);
|
const loginRequest = toLoginRequest(body);
|
||||||
// console.log(body);
|
// console.log(body);
|
||||||
//console.log(String.fromCharCode.apiRouterly(null, req.body));
|
//console.log(String.fromCharCode.apiRouterly(null, req.body));
|
||||||
|
|
||||||
const account = await Account.findOne({ email: loginRequest.email }); //{ _id: 0, __v: 0 }
|
const account = await Account.findOne({ email: loginRequest.email }); //{ _id: 0, __v: 0 }
|
||||||
console.log("findone", account);
|
console.log("findone", account);
|
||||||
|
|
||||||
if (!account && config.autoCreateAccount) {
|
if (!account && config.autoCreateAccount) {
|
||||||
try {
|
try {
|
||||||
const newAccount = await createAccount({
|
const newAccount = await createAccount({
|
||||||
email: loginRequest.email,
|
email: loginRequest.email,
|
||||||
password: loginRequest.password,
|
password: loginRequest.password,
|
||||||
DisplayName: loginRequest.email.substring(0, loginRequest.email.indexOf("@")),
|
DisplayName: loginRequest.email.substring(0, loginRequest.email.indexOf("@")),
|
||||||
CountryCode: loginRequest.lang.toUpperCase(),
|
CountryCode: loginRequest.lang.toUpperCase(),
|
||||||
ClientType: loginRequest.ClientType,
|
ClientType: loginRequest.ClientType,
|
||||||
CrossPlatformAllowed: true,
|
CrossPlatformAllowed: true,
|
||||||
ForceLogoutVersion: 0,
|
ForceLogoutVersion: 0,
|
||||||
ConsentNeeded: false,
|
ConsentNeeded: false,
|
||||||
TrackedSettings: []
|
TrackedSettings: []
|
||||||
});
|
});
|
||||||
console.log("CREATED ACCOUNT", newAccount);
|
console.log("CREATED ACCOUNT", newAccount);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const { email, password, ...databaseAccount } = newAccount;
|
const { email, password, ...databaseAccount } = newAccount;
|
||||||
const newLoginResponse: ILoginResponse = {
|
const newLoginResponse: ILoginResponse = {
|
||||||
...databaseAccount,
|
|
||||||
Groups: groups,
|
|
||||||
platformCDNs: platformCDNs,
|
|
||||||
Nonce: Nonce,
|
|
||||||
NRS: NRS,
|
|
||||||
DTLS: DTLS,
|
|
||||||
IRC: IRC,
|
|
||||||
HUB: HUB,
|
|
||||||
BuildLabel: config.buildLabel,
|
|
||||||
MatchmakingBuildId: config.matchmakingBuildId
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(newLoginResponse);
|
|
||||||
response.json(newLoginResponse);
|
|
||||||
return;
|
|
||||||
} catch (error: unknown) {
|
|
||||||
if (error instanceof Error) {
|
|
||||||
throw new Error("error creating account");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//email not found or incorrect password
|
|
||||||
if (!account || !isCorrectPassword(loginRequest.password, account.password)) {
|
|
||||||
response.status(400).json({ error: "incorrect login data" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { email, password, ...databaseAccount } = account.toJSON();
|
|
||||||
const newLoginResponse: ILoginResponse = {
|
|
||||||
...databaseAccount,
|
...databaseAccount,
|
||||||
Groups: groups,
|
Groups: groups,
|
||||||
platformCDNs: platformCDNs,
|
platformCDNs: platformCDNs,
|
||||||
@ -77,10 +47,40 @@ const loginController: RequestHandler = async (request, response) => {
|
|||||||
HUB: HUB,
|
HUB: HUB,
|
||||||
BuildLabel: config.buildLabel,
|
BuildLabel: config.buildLabel,
|
||||||
MatchmakingBuildId: config.matchmakingBuildId
|
MatchmakingBuildId: config.matchmakingBuildId
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("login response", newLoginResponse);
|
console.log(newLoginResponse);
|
||||||
response.json(newLoginResponse);
|
response.json(newLoginResponse);
|
||||||
|
return;
|
||||||
|
} catch (error: unknown) {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
throw new Error("error creating account");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//email not found or incorrect password
|
||||||
|
if (!account || !isCorrectPassword(loginRequest.password, account.password)) {
|
||||||
|
response.status(400).json({ error: "incorrect login data" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { email, password, ...databaseAccount } = account.toJSON();
|
||||||
|
const newLoginResponse: ILoginResponse = {
|
||||||
|
...databaseAccount,
|
||||||
|
Groups: groups,
|
||||||
|
platformCDNs: platformCDNs,
|
||||||
|
Nonce: Nonce,
|
||||||
|
NRS: NRS,
|
||||||
|
DTLS: DTLS,
|
||||||
|
IRC: IRC,
|
||||||
|
HUB: HUB,
|
||||||
|
BuildLabel: config.buildLabel,
|
||||||
|
MatchmakingBuildId: config.matchmakingBuildId
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("login response", newLoginResponse);
|
||||||
|
response.json(newLoginResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { loginController };
|
export { loginController };
|
||||||
|
@ -2,7 +2,7 @@ import { RequestHandler } from "express";
|
|||||||
import loginRewards from "@/static/fixed_responses/loginRewards.json";
|
import loginRewards from "@/static/fixed_responses/loginRewards.json";
|
||||||
|
|
||||||
const loginRewardsController: RequestHandler = (_req, res) => {
|
const loginRewardsController: RequestHandler = (_req, res) => {
|
||||||
res.json(loginRewards);
|
res.json(loginRewards);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { loginRewardsController };
|
export { loginRewardsController };
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const marketRecommendationsController: RequestHandler = (_req, res) => {
|
const marketRecommendationsController: RequestHandler = (_req, res) => {
|
||||||
const data = Buffer.from([
|
const data = Buffer.from([
|
||||||
0x7b, 0x22, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61,
|
0x7b, 0x22, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x7b, 0x22, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x64, 0x22,
|
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x7b, 0x22, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x64, 0x22, 0x3a, 0x5b,
|
||||||
0x3a, 0x5b, 0x5d, 0x2c, 0x22, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d
|
0x5d, 0x2c, 0x22, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d
|
||||||
]);
|
]);
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
"Content-Type": "text/html",
|
"Content-Type": "text/html",
|
||||||
"Content-Length": data.length
|
"Content-Length": data.length
|
||||||
});
|
});
|
||||||
res.end(data);
|
res.end(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { marketRecommendationsController };
|
export { marketRecommendationsController };
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const marketSearchRecommendationsController: RequestHandler = (_req, res) => {
|
const marketSearchRecommendationsController: RequestHandler = (_req, res) => {
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { marketSearchRecommendationsController };
|
export { marketSearchRecommendationsController };
|
||||||
|
@ -2,5 +2,5 @@ import purchase from "@/static/fixed_responses/purchase.json";
|
|||||||
import { Request, Response } from "express";
|
import { Request, Response } from "express";
|
||||||
|
|
||||||
export default (_req: Request, res: Response): void => {
|
export default (_req: Request, res: Response): void => {
|
||||||
res.json(purchase);
|
res.json(purchase);
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const setActiveQuestController: RequestHandler = (_req, res) => {
|
const setActiveQuestController: RequestHandler = (_req, res) => {
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { setActiveQuestController };
|
export { setActiveQuestController };
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const surveysController: RequestHandler = (_req, res) => {
|
const surveysController: RequestHandler = (_req, res) => {
|
||||||
const data = Buffer.from([
|
const data = Buffer.from([
|
||||||
0x7b, 0x22, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
|
0x7b, 0x22, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
|
||||||
]);
|
]);
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
"Content-Type": "text/html",
|
"Content-Type": "text/html",
|
||||||
"Content-Length": data.length
|
"Content-Length": data.length
|
||||||
});
|
});
|
||||||
res.end(data);
|
res.end(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { surveysController };
|
export { surveysController };
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const updateChallengeProgressController: RequestHandler = (_request, response) => {
|
const updateChallengeProgressController: RequestHandler = (_request, response) => {
|
||||||
response.sendStatus(200);
|
response.sendStatus(200);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { updateChallengeProgressController };
|
export { updateChallengeProgressController };
|
||||||
|
@ -2,7 +2,7 @@ import { RequestHandler } from "express";
|
|||||||
import view from "@/static/fixed_responses/view.json";
|
import view from "@/static/fixed_responses/view.json";
|
||||||
|
|
||||||
const viewController: RequestHandler = (_req, res) => {
|
const viewController: RequestHandler = (_req, res) => {
|
||||||
res.json(view);
|
res.json(view);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { viewController };
|
export { viewController };
|
||||||
|
@ -4,12 +4,12 @@ import { createAccount } from "@/src/services/loginService";
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const createAccountController: RequestHandler = async (req, res) => {
|
const createAccountController: RequestHandler = async (req, res) => {
|
||||||
const createAccountData = toCreateAccount(req.body);
|
const createAccountData = toCreateAccount(req.body);
|
||||||
const databaseAccount = toDatabaseAccount(createAccountData);
|
const databaseAccount = toDatabaseAccount(createAccountData);
|
||||||
|
|
||||||
const account = await createAccount(databaseAccount);
|
const account = await createAccount(databaseAccount);
|
||||||
|
|
||||||
res.json(account);
|
res.json(account);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { createAccountController };
|
export { createAccountController };
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const aggregateSessionsController: RequestHandler = (_req, res) => {
|
const aggregateSessionsController: RequestHandler = (_req, res) => {
|
||||||
res.json({});
|
res.json({});
|
||||||
};
|
};
|
||||||
|
|
||||||
export { aggregateSessionsController };
|
export { aggregateSessionsController };
|
||||||
|
@ -3,10 +3,10 @@ import config from "@/config.json";
|
|||||||
import worldState from "@/static/fixed_responses/worldState.json";
|
import worldState from "@/static/fixed_responses/worldState.json";
|
||||||
|
|
||||||
const worldStateController: RequestHandler = (_req, res) => {
|
const worldStateController: RequestHandler = (_req, res) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
worldState.WorldSeed = config.worldSeed;
|
worldState.WorldSeed = config.worldSeed;
|
||||||
worldState.BuildLabel = config.buildLabel;
|
worldState.BuildLabel = config.buildLabel;
|
||||||
res.json(worldState);
|
res.json(worldState);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { worldStateController };
|
export { worldStateController };
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
const steamPacksController: RequestHandler = (_req, res) => {
|
const steamPacksController: RequestHandler = (_req, res) => {
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
};
|
};
|
||||||
export { steamPacksController };
|
export { steamPacksController };
|
||||||
|
@ -4,52 +4,52 @@ import { IDatabaseAccount } from "../types/loginTypes";
|
|||||||
import { isString, parseEmail, parseString } from "./general";
|
import { isString, parseEmail, parseString } from "./general";
|
||||||
|
|
||||||
const getWhirlpoolHash = (rawPassword: string): string => {
|
const getWhirlpoolHash = (rawPassword: string): string => {
|
||||||
const whirlpool = crypto.createHash("whirlpool");
|
const whirlpool = crypto.createHash("whirlpool");
|
||||||
const data = whirlpool.update(rawPassword, "utf8");
|
const data = whirlpool.update(rawPassword, "utf8");
|
||||||
const hash = data.digest("hex");
|
const hash = data.digest("hex");
|
||||||
return hash;
|
return hash;
|
||||||
};
|
};
|
||||||
|
|
||||||
const parsePassword = (passwordCandidate: unknown): string => {
|
const parsePassword = (passwordCandidate: unknown): string => {
|
||||||
// a different function could be called that checks whether the password has a certain shape
|
// a different function could be called that checks whether the password has a certain shape
|
||||||
if (!isString(passwordCandidate)) {
|
if (!isString(passwordCandidate)) {
|
||||||
throw new Error("incorrect password format");
|
throw new Error("incorrect password format");
|
||||||
}
|
}
|
||||||
return passwordCandidate;
|
return passwordCandidate;
|
||||||
};
|
};
|
||||||
|
|
||||||
const toAccountCreation = (accountCreation: unknown): IAccountCreation => {
|
const toAccountCreation = (accountCreation: unknown): IAccountCreation => {
|
||||||
if (!accountCreation || typeof accountCreation !== "object") {
|
if (!accountCreation || typeof accountCreation !== "object") {
|
||||||
throw new Error("incorrect or missing account creation data");
|
throw new Error("incorrect or missing account creation data");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
"email" in accountCreation &&
|
"email" in accountCreation &&
|
||||||
"password" in accountCreation &&
|
"password" in accountCreation &&
|
||||||
"DisplayName" in accountCreation &&
|
"DisplayName" in accountCreation &&
|
||||||
"CountryCode" in accountCreation
|
"CountryCode" in accountCreation
|
||||||
) {
|
) {
|
||||||
const rawPassword = parsePassword(accountCreation.password);
|
const rawPassword = parsePassword(accountCreation.password);
|
||||||
console.log("email", accountCreation.email);
|
console.log("email", accountCreation.email);
|
||||||
return {
|
return {
|
||||||
email: parseEmail(accountCreation.email),
|
email: parseEmail(accountCreation.email),
|
||||||
password: getWhirlpoolHash(rawPassword),
|
password: getWhirlpoolHash(rawPassword),
|
||||||
CountryCode: parseString(accountCreation.CountryCode),
|
CountryCode: parseString(accountCreation.CountryCode),
|
||||||
DisplayName: parseString(accountCreation.DisplayName)
|
DisplayName: parseString(accountCreation.DisplayName)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
throw new Error("incorrect account creation data: incorrect properties");
|
throw new Error("incorrect account creation data: incorrect properties");
|
||||||
};
|
};
|
||||||
|
|
||||||
const toDatabaseAccount = (createAccount: IAccountCreation): IDatabaseAccount => {
|
const toDatabaseAccount = (createAccount: IAccountCreation): IDatabaseAccount => {
|
||||||
return {
|
return {
|
||||||
...createAccount,
|
...createAccount,
|
||||||
ClientType: "",
|
ClientType: "",
|
||||||
ConsentNeeded: false,
|
ConsentNeeded: false,
|
||||||
CrossPlatformAllowed: true,
|
CrossPlatformAllowed: true,
|
||||||
ForceLogoutVersion: 0,
|
ForceLogoutVersion: 0,
|
||||||
TrackedSettings: []
|
TrackedSettings: []
|
||||||
} satisfies IDatabaseAccount;
|
} satisfies IDatabaseAccount;
|
||||||
};
|
};
|
||||||
|
|
||||||
export { toDatabaseAccount, toAccountCreation as toCreateAccount };
|
export { toDatabaseAccount, toAccountCreation as toCreateAccount };
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
const isString = (text: unknown): text is string => {
|
const isString = (text: unknown): text is string => {
|
||||||
return typeof text === "string" || text instanceof String;
|
return typeof text === "string" || text instanceof String;
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseString = (data: unknown): string => {
|
const parseString = (data: unknown): string => {
|
||||||
if (!isString(data)) {
|
if (!isString(data)) {
|
||||||
throw new Error("data is not a string");
|
throw new Error("data is not a string");
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isNumber = (number: unknown): number is number => {
|
const isNumber = (number: unknown): number is number => {
|
||||||
return typeof number === "number" && !isNaN(number);
|
return typeof number === "number" && !isNaN(number);
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseNumber = (data: unknown): number => {
|
const parseNumber = (data: unknown): number => {
|
||||||
if (!isNumber(data)) {
|
if (!isNumber(data)) {
|
||||||
throw new Error("data is not a number");
|
throw new Error("data is not a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Number(data);
|
return Number(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isDate = (date: string) => {
|
const isDate = (date: string) => {
|
||||||
if (!Date.parse(date)) {
|
if (!Date.parse(date)) {
|
||||||
throw new Error("invalid date");
|
throw new Error("invalid date");
|
||||||
}
|
}
|
||||||
return date;
|
return date;
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseDateNumber = (date: unknown): string => {
|
const parseDateNumber = (date: unknown): string => {
|
||||||
if (!isString(date) || !isDate(date)) {
|
if (!isString(date) || !isDate(date)) {
|
||||||
throw new Error("date could not be parsed");
|
throw new Error("date could not be parsed");
|
||||||
}
|
}
|
||||||
|
|
||||||
return date;
|
return date;
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseEmail = (email: unknown): string => {
|
const parseEmail = (email: unknown): string => {
|
||||||
if (!isString(email)) {
|
if (!isString(email)) {
|
||||||
throw new Error("incorrect email");
|
throw new Error("incorrect email");
|
||||||
}
|
}
|
||||||
return email;
|
return email;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isBoolean = (booleanCandidate: unknown): booleanCandidate is boolean => {
|
const isBoolean = (booleanCandidate: unknown): booleanCandidate is boolean => {
|
||||||
return typeof booleanCandidate === "boolean";
|
return typeof booleanCandidate === "boolean";
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseBoolean = (booleanCandidate: unknown): boolean => {
|
const parseBoolean = (booleanCandidate: unknown): boolean => {
|
||||||
if (!isBoolean(booleanCandidate)) {
|
if (!isBoolean(booleanCandidate)) {
|
||||||
throw new Error("argument was not a boolean");
|
throw new Error("argument was not a boolean");
|
||||||
}
|
}
|
||||||
return booleanCandidate;
|
return booleanCandidate;
|
||||||
};
|
};
|
||||||
|
|
||||||
export { isString, isNumber, parseString, parseNumber, parseDateNumber, parseBoolean, parseEmail };
|
export { isString, isNumber, parseString, parseNumber, parseDateNumber, parseBoolean, parseEmail };
|
||||||
|
@ -2,34 +2,34 @@ import { ILoginRequest } from "../types/loginTypes";
|
|||||||
import { parseEmail, parseNumber, parseString } from "./general";
|
import { parseEmail, parseNumber, parseString } from "./general";
|
||||||
|
|
||||||
const toLoginRequest = (loginRequest: unknown): ILoginRequest => {
|
const toLoginRequest = (loginRequest: unknown): ILoginRequest => {
|
||||||
if (!loginRequest || typeof loginRequest !== "object") {
|
if (!loginRequest || typeof loginRequest !== "object") {
|
||||||
throw new Error("incorrect or missing login request data");
|
throw new Error("incorrect or missing login request data");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: function that checks whether every field of interface is in object
|
// TODO: function that checks whether every field of interface is in object
|
||||||
if (
|
if (
|
||||||
"email" in loginRequest &&
|
"email" in loginRequest &&
|
||||||
"password" in loginRequest &&
|
"password" in loginRequest &&
|
||||||
"time" in loginRequest &&
|
"time" in loginRequest &&
|
||||||
"s" in loginRequest &&
|
"s" in loginRequest &&
|
||||||
"lang" in loginRequest &&
|
"lang" in loginRequest &&
|
||||||
"date" in loginRequest &&
|
"date" in loginRequest &&
|
||||||
"ClientType" in loginRequest &&
|
"ClientType" in loginRequest &&
|
||||||
"PS" in loginRequest
|
"PS" in loginRequest
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
email: parseEmail(loginRequest.email),
|
email: parseEmail(loginRequest.email),
|
||||||
password: parseString(loginRequest.password),
|
password: parseString(loginRequest.password),
|
||||||
time: parseNumber(loginRequest.time),
|
time: parseNumber(loginRequest.time),
|
||||||
s: parseString(loginRequest.s),
|
s: parseString(loginRequest.s),
|
||||||
lang: parseString(loginRequest.lang),
|
lang: parseString(loginRequest.lang),
|
||||||
date: parseNumber(loginRequest.date),
|
date: parseNumber(loginRequest.date),
|
||||||
ClientType: parseString(loginRequest.ClientType),
|
ClientType: parseString(loginRequest.ClientType),
|
||||||
PS: parseString(loginRequest.PS)
|
PS: parseString(loginRequest.PS)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error("incorrect login request");
|
throw new Error("incorrect login request");
|
||||||
};
|
};
|
||||||
|
|
||||||
export { toLoginRequest };
|
export { toLoginRequest };
|
||||||
|
@ -6,9 +6,9 @@ import { app } from "./app";
|
|||||||
//const bodyParser = require("body-parser");
|
//const bodyParser = require("body-parser");
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
key: fs.readFileSync("static/certs/key.pem"),
|
key: fs.readFileSync("static/certs/key.pem"),
|
||||||
cert: fs.readFileSync("static/certs/cert.pem"),
|
cert: fs.readFileSync("static/certs/cert.pem"),
|
||||||
passphrase: "123456"
|
passphrase: "123456"
|
||||||
};
|
};
|
||||||
|
|
||||||
// const server = http.createServer(app).listen(80);
|
// const server = http.createServer(app).listen(80);
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { NextFunction, Request, Response } from "express";
|
import { NextFunction, Request, Response } from "express";
|
||||||
|
|
||||||
const unknownEndpointHandler = (request: Request, response: Response) => {
|
const unknownEndpointHandler = (request: Request, response: Response) => {
|
||||||
console.error("[ERROR] Unknown Endpoint", request.url);
|
console.error("[ERROR] Unknown Endpoint", request.url);
|
||||||
response.status(404).json({ error: "endpoint was not found" });
|
response.status(404).json({ error: "endpoint was not found" });
|
||||||
};
|
};
|
||||||
|
|
||||||
const requestLogger = (request: Request, _response: Response, next: NextFunction) => {
|
const requestLogger = (request: Request, _response: Response, next: NextFunction) => {
|
||||||
console.log("Method:", request.method);
|
console.log("Method:", request.method);
|
||||||
console.log("Path: ", request.path);
|
console.log("Path: ", request.path);
|
||||||
console.log("Body: ", request.body);
|
console.log("Body: ", request.body);
|
||||||
console.log("---");
|
console.log("---");
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
|
||||||
export { unknownEndpointHandler, requestLogger };
|
export { unknownEndpointHandler, requestLogger };
|
||||||
|
@ -2,8 +2,8 @@ import { model, Schema, SchemaOptions } from "mongoose";
|
|||||||
import { IDatabaseAccountDocument } from "../types/loginTypes";
|
import { IDatabaseAccountDocument } from "../types/loginTypes";
|
||||||
|
|
||||||
const opts = {
|
const opts = {
|
||||||
toJSON: { virtuals: true },
|
toJSON: { virtuals: true },
|
||||||
toObject: { virtuals: true }
|
toObject: { virtuals: true }
|
||||||
} satisfies SchemaOptions;
|
} satisfies SchemaOptions;
|
||||||
|
|
||||||
// {
|
// {
|
||||||
@ -21,29 +21,29 @@ const opts = {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
const databaseAccountSchema = new Schema<IDatabaseAccountDocument>(
|
const databaseAccountSchema = new Schema<IDatabaseAccountDocument>(
|
||||||
{
|
{
|
||||||
email: { type: String, required: true, unique: true },
|
email: { type: String, required: true, unique: true },
|
||||||
password: { type: String, required: true },
|
password: { type: String, required: true },
|
||||||
DisplayName: { type: String, required: true },
|
DisplayName: { type: String, required: true },
|
||||||
CountryCode: { type: String, required: true },
|
CountryCode: { type: String, required: true },
|
||||||
ClientType: { type: String },
|
ClientType: { type: String },
|
||||||
CrossPlatformAllowed: { type: Boolean, required: true },
|
CrossPlatformAllowed: { type: Boolean, required: true },
|
||||||
ForceLogoutVersion: { type: Number, required: true },
|
ForceLogoutVersion: { type: Number, required: true },
|
||||||
AmazonAuthToken: { type: String },
|
AmazonAuthToken: { type: String },
|
||||||
AmazonRefreshToken: { type: String },
|
AmazonRefreshToken: { type: String },
|
||||||
ConsentNeeded: { type: Boolean, required: true },
|
ConsentNeeded: { type: Boolean, required: true },
|
||||||
TrackedSettings: { type: [String], default: [] }
|
TrackedSettings: { type: [String], default: [] }
|
||||||
},
|
},
|
||||||
opts
|
opts
|
||||||
);
|
);
|
||||||
|
|
||||||
databaseAccountSchema.set("toJSON", {
|
databaseAccountSchema.set("toJSON", {
|
||||||
transform(_document, returnedObject) {
|
transform(_document, returnedObject) {
|
||||||
//returnedObject.id = returnedObject._id.toString();
|
//returnedObject.id = returnedObject._id.toString();
|
||||||
delete returnedObject._id;
|
delete returnedObject._id;
|
||||||
delete returnedObject.__v;
|
delete returnedObject.__v;
|
||||||
},
|
},
|
||||||
virtuals: true
|
virtuals: true
|
||||||
});
|
});
|
||||||
|
|
||||||
//databaseAccountSchema.set("");
|
//databaseAccountSchema.set("");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
|
|
||||||
const accountSchema = new mongoose.Schema({
|
const accountSchema = new mongoose.Schema({
|
||||||
data: JSON
|
data: JSON
|
||||||
});
|
});
|
||||||
|
|
||||||
// personSchema.set("toJSON", {
|
// personSchema.set("toJSON", {
|
||||||
|
@ -4,19 +4,19 @@ import config from "@/config.json";
|
|||||||
const cacheRouter = express.Router();
|
const cacheRouter = express.Router();
|
||||||
|
|
||||||
cacheRouter.get("/B.Cache.Dx11.bin.*", (_req, res) => {
|
cacheRouter.get("/B.Cache.Dx11.bin.*", (_req, res) => {
|
||||||
//console.log("asd", path.join(__dirname, "../data"));
|
//console.log("asd", path.join(__dirname, "../data"));
|
||||||
res.sendFile("static/data/B.Cache.Dx11_33.0.6.bin", { root: "./" });
|
res.sendFile("static/data/B.Cache.Dx11_33.0.6.bin", { root: "./" });
|
||||||
});
|
});
|
||||||
|
|
||||||
cacheRouter.get("/B.Cache.Windows_en.bin*", (_req, res) => {
|
cacheRouter.get("/B.Cache.Windows_en.bin*", (_req, res) => {
|
||||||
//console.log("asd", path.join(__dirname, "../data"));
|
//console.log("asd", path.join(__dirname, "../data"));
|
||||||
res.sendFile("static/data/B.Cache.Windows_en_33.0.10.bin", { root: "./" });
|
res.sendFile("static/data/B.Cache.Windows_en_33.0.10.bin", { root: "./" });
|
||||||
});
|
});
|
||||||
|
|
||||||
cacheRouter.get(/^\/origin\/([a-zA-Z0-9]+)\/H\.Cache\.bin.*$/, (_req, res) => {
|
cacheRouter.get(/^\/origin\/([a-zA-Z0-9]+)\/H\.Cache\.bin.*$/, (_req, res) => {
|
||||||
// console.log("asd", path.join(__dirname, "../data"));
|
// console.log("asd", path.join(__dirname, "../data"));
|
||||||
// console.log("asd", __dirname);
|
// console.log("asd", __dirname);
|
||||||
res.sendFile(`static/data/H.Cache_${config.version}.bin`, { root: "./" });
|
res.sendFile(`static/data/H.Cache_${config.version}.bin`, { root: "./" });
|
||||||
});
|
});
|
||||||
|
|
||||||
export { cacheRouter };
|
export { cacheRouter };
|
||||||
|
@ -2,21 +2,21 @@ import { Account } from "../models/loginModel";
|
|||||||
import { IDatabaseAccount } from "../types/loginTypes";
|
import { IDatabaseAccount } from "../types/loginTypes";
|
||||||
|
|
||||||
const isCorrectPassword = (requestPassword: string, databasePassword: string): boolean => {
|
const isCorrectPassword = (requestPassword: string, databasePassword: string): boolean => {
|
||||||
return requestPassword === databasePassword;
|
return requestPassword === databasePassword;
|
||||||
};
|
};
|
||||||
|
|
||||||
const createAccount = async (accountData: IDatabaseAccount) => {
|
const createAccount = async (accountData: IDatabaseAccount) => {
|
||||||
console.log("test", accountData);
|
console.log("test", accountData);
|
||||||
const account = new Account(accountData);
|
const account = new Account(accountData);
|
||||||
try {
|
try {
|
||||||
await account.save();
|
await account.save();
|
||||||
return account.toJSON();
|
return account.toJSON();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
throw new Error(error.message);
|
throw new Error(error.message);
|
||||||
}
|
|
||||||
throw new Error("error creating account that is not of instance Error");
|
|
||||||
}
|
}
|
||||||
|
throw new Error("error creating account that is not of instance Error");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export { isCorrectPassword, createAccount };
|
export { isCorrectPassword, createAccount };
|
||||||
|
@ -10,14 +10,14 @@ if (!url) throw new Error("MONGODB_URL not found");
|
|||||||
console.log("connecting to MongoDB URL:", url);
|
console.log("connecting to MongoDB URL:", url);
|
||||||
|
|
||||||
const connectDatabase = async () => {
|
const connectDatabase = async () => {
|
||||||
try {
|
try {
|
||||||
await mongoose.connect(url);
|
await mongoose.connect(url);
|
||||||
console.log("connected to MongoDB");
|
console.log("connected to MongoDB");
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
console.error("error connecting to MongoDB", error.message);
|
console.error("error connecting to MongoDB", error.message);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export { connectDatabase };
|
export { connectDatabase };
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export interface IAccountCreation {
|
export interface IAccountCreation {
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
DisplayName: string;
|
DisplayName: string;
|
||||||
CountryCode: string;
|
CountryCode: string;
|
||||||
}
|
}
|
||||||
|
@ -1,46 +1,46 @@
|
|||||||
export interface ILoginResponse extends Omit<IDatabaseAccountDocument, "email" | "password"> {
|
export interface ILoginResponse extends Omit<IDatabaseAccountDocument, "email" | "password"> {
|
||||||
Groups: IGroup[];
|
Groups: IGroup[];
|
||||||
Nonce: number;
|
Nonce: number;
|
||||||
BuildLabel: string;
|
BuildLabel: string;
|
||||||
MatchmakingBuildId: string;
|
MatchmakingBuildId: string;
|
||||||
platformCDNs: string[];
|
platformCDNs: string[];
|
||||||
NRS: string[];
|
NRS: string[];
|
||||||
DTLS: number;
|
DTLS: number;
|
||||||
IRC: string[];
|
IRC: string[];
|
||||||
HUB: string;
|
HUB: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
//includes virtual id
|
//includes virtual id
|
||||||
export interface IDatabaseAccountDocument extends IDatabaseAccount {
|
export interface IDatabaseAccountDocument extends IDatabaseAccount {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IGroup {
|
export interface IGroup {
|
||||||
experiment: string;
|
experiment: string;
|
||||||
experimentGroup: string;
|
experimentGroup: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDatabaseAccount {
|
export interface IDatabaseAccount {
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
DisplayName: string;
|
DisplayName: string;
|
||||||
CountryCode: string;
|
CountryCode: string;
|
||||||
ClientType: string;
|
ClientType: string;
|
||||||
CrossPlatformAllowed: boolean;
|
CrossPlatformAllowed: boolean;
|
||||||
ForceLogoutVersion: number;
|
ForceLogoutVersion: number;
|
||||||
AmazonAuthToken?: string;
|
AmazonAuthToken?: string;
|
||||||
AmazonRefreshToken?: string;
|
AmazonRefreshToken?: string;
|
||||||
ConsentNeeded: boolean;
|
ConsentNeeded: boolean;
|
||||||
TrackedSettings: string[];
|
TrackedSettings: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ILoginRequest {
|
export interface ILoginRequest {
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
time: number;
|
time: number;
|
||||||
s: string;
|
s: string;
|
||||||
lang: string;
|
lang: string;
|
||||||
date: number;
|
date: number;
|
||||||
ClientType: string;
|
ClientType: string;
|
||||||
PS: string;
|
PS: string;
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"ShipOwnerId": "removed",
|
"ShipOwnerId": "removed",
|
||||||
"Ship": {
|
"Ship": {
|
||||||
"Rooms": [
|
"Rooms": [
|
||||||
{ "Name": "AlchemyRoom", "MaxCapacity": 1600 },
|
{ "Name": "AlchemyRoom", "MaxCapacity": 1600 },
|
||||||
{ "Name": "BridgeRoom", "MaxCapacity": 1600 },
|
{ "Name": "BridgeRoom", "MaxCapacity": 1600 },
|
||||||
{ "Name": "LisetRoom", "MaxCapacity": 1000 },
|
{ "Name": "LisetRoom", "MaxCapacity": 1000 },
|
||||||
{ "Name": "OperatorChamberRoom", "MaxCapacity": 1600 },
|
{ "Name": "OperatorChamberRoom", "MaxCapacity": 1600 },
|
||||||
{ "Name": "OutsideRoom", "MaxCapacity": 1600 },
|
{ "Name": "OutsideRoom", "MaxCapacity": 1600 },
|
||||||
{ "Name": "PersonalQuartersRoom", "MaxCapacity": 1600 }
|
{ "Name": "PersonalQuartersRoom", "MaxCapacity": 1600 }
|
||||||
],
|
],
|
||||||
"ContentUrlSignature": "removed"
|
"ContentUrlSignature": "removed"
|
||||||
},
|
},
|
||||||
"Apartment": {
|
"Apartment": {
|
||||||
"Rooms": [
|
"Rooms": [
|
||||||
{ "Name": "ElevatorLanding", "MaxCapacity": 1600 },
|
{ "Name": "ElevatorLanding", "MaxCapacity": 1600 },
|
||||||
{ "Name": "ApartmentRoomA", "MaxCapacity": 1000 },
|
{ "Name": "ApartmentRoomA", "MaxCapacity": 1000 },
|
||||||
{ "Name": "ApartmentRoomB", "MaxCapacity": 1600 },
|
{ "Name": "ApartmentRoomB", "MaxCapacity": 1600 },
|
||||||
{ "Name": "ApartmentRoomC", "MaxCapacity": 1600 },
|
{ "Name": "ApartmentRoomC", "MaxCapacity": 1600 },
|
||||||
{ "Name": "DuviriHallway", "MaxCapacity": 1600 }
|
{ "Name": "DuviriHallway", "MaxCapacity": 1600 }
|
||||||
],
|
],
|
||||||
"FavouriteLoadouts": []
|
"FavouriteLoadouts": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"Inbox": [
|
"Inbox": [
|
||||||
|
{
|
||||||
|
"sndr": "/Lotus/Language/Bosses/Ordis",
|
||||||
|
"msg": "/Lotus/Language/Inbox/ThankYouFreeMultipleContent",
|
||||||
|
"countedAtt": [
|
||||||
{
|
{
|
||||||
"sndr": "/Lotus/Language/Bosses/Ordis",
|
"ItemType": "/Lotus/Upgrades/Skins/Promo/Twitch/OgrisTwitchSkin",
|
||||||
"msg": "/Lotus/Language/Inbox/ThankYouFreeMultipleContent",
|
"ItemCount": 1
|
||||||
"countedAtt": [
|
},
|
||||||
{
|
{
|
||||||
"ItemType": "/Lotus/Upgrades/Skins/Promo/Twitch/OgrisTwitchSkin",
|
"ItemType": "/Lotus/Weapons/ClanTech/Chemical/RocketLauncher",
|
||||||
"ItemCount": 1
|
"ItemCount": 1
|
||||||
},
|
|
||||||
{
|
|
||||||
"ItemType": "/Lotus/Weapons/ClanTech/Chemical/RocketLauncher",
|
|
||||||
"ItemCount": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sub": "/Lotus/Language/Inbox/ThankYouFreeMultipleSubject",
|
|
||||||
"icon": "/Lotus/Interface/Icons/Npcs/Ordis.png",
|
|
||||||
"highPriority": true,
|
|
||||||
"messageId": "removed",
|
|
||||||
"date": { "$date": { "$numberLong": "removed" } },
|
|
||||||
"r": true
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"sub": "/Lotus/Language/Inbox/ThankYouFreeMultipleSubject",
|
||||||
|
"icon": "/Lotus/Interface/Icons/Npcs/Ordis.png",
|
||||||
|
"highPriority": true,
|
||||||
|
"messageId": "removed",
|
||||||
|
"date": { "$date": { "$numberLong": "removed" } },
|
||||||
|
"r": true
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,131 +1,131 @@
|
|||||||
{
|
{
|
||||||
"SubscribedToEmails": 0,
|
"SubscribedToEmails": 0,
|
||||||
"Created": { "$date": { "$numberLong": "removed" } },
|
"Created": { "$date": { "$numberLong": "removed" } },
|
||||||
"SubscribedToEmailsPersonalized": 0,
|
"SubscribedToEmailsPersonalized": 0,
|
||||||
"RewardSeed": -123123123123123,
|
"RewardSeed": -123123123123123,
|
||||||
"CrewMemberBin": { "Slots": 3 },
|
"CrewMemberBin": { "Slots": 3 },
|
||||||
"CrewShipSalvageBin": { "Slots": 8 },
|
"CrewShipSalvageBin": { "Slots": 8 },
|
||||||
"DrifterMelee": [
|
"DrifterMelee": [
|
||||||
{
|
{
|
||||||
"ItemType": "/Lotus/Types/Friendly/PlayerControllable/Weapons/DuviriDualSwords",
|
"ItemType": "/Lotus/Types/Friendly/PlayerControllable/Weapons/DuviriDualSwords",
|
||||||
"ItemId": { "$oid": "removed" }
|
"ItemId": { "$oid": "removed" }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"FusionPoints": 0,
|
"FusionPoints": 0,
|
||||||
"MechBin": { "Slots": 4 },
|
"MechBin": { "Slots": 4 },
|
||||||
"OperatorAmpBin": { "Slots": 8 },
|
"OperatorAmpBin": { "Slots": 8 },
|
||||||
"PveBonusLoadoutBin": { "Slots": 0 },
|
"PveBonusLoadoutBin": { "Slots": 0 },
|
||||||
"PvpBonusLoadoutBin": { "Slots": 0 },
|
"PvpBonusLoadoutBin": { "Slots": 0 },
|
||||||
"RandomModBin": { "Slots": 15 },
|
"RandomModBin": { "Slots": 15 },
|
||||||
"RegularCredits": 0,
|
"RegularCredits": 0,
|
||||||
"SentinelBin": { "Slots": 10 },
|
"SentinelBin": { "Slots": 10 },
|
||||||
"SpaceSuitBin": { "Slots": 4 },
|
"SpaceSuitBin": { "Slots": 4 },
|
||||||
"SpaceWeaponBin": { "Slots": 4 },
|
"SpaceWeaponBin": { "Slots": 4 },
|
||||||
"SuitBin": { "Slots": 2 },
|
"SuitBin": { "Slots": 2 },
|
||||||
"WeaponBin": { "Slots": 8 },
|
"WeaponBin": { "Slots": 8 },
|
||||||
"LastInventorySync": { "$oid": "removed" },
|
"LastInventorySync": { "$oid": "removed" },
|
||||||
"NextRefill": { "$date": { "$numberLong": "removed" } },
|
"NextRefill": { "$date": { "$numberLong": "removed" } },
|
||||||
"ActiveLandscapeTraps": [],
|
"ActiveLandscapeTraps": [],
|
||||||
"ChallengeProgress": [],
|
"ChallengeProgress": [],
|
||||||
"CrewMembers": [],
|
"CrewMembers": [],
|
||||||
"CrewShips": [],
|
"CrewShips": [],
|
||||||
"CrewShipHarnesses": [],
|
"CrewShipHarnesses": [],
|
||||||
"CrewShipSalvagedWeapons": [],
|
"CrewShipSalvagedWeapons": [],
|
||||||
"CrewShipSalvagedWeaponSkins": [],
|
"CrewShipSalvagedWeaponSkins": [],
|
||||||
"CrewShipWeapons": [],
|
"CrewShipWeapons": [],
|
||||||
"CrewShipWeaponSkins": [],
|
"CrewShipWeaponSkins": [],
|
||||||
"DataKnives": [],
|
"DataKnives": [],
|
||||||
"DrifterGuns": [],
|
"DrifterGuns": [],
|
||||||
"Drones": [],
|
"Drones": [],
|
||||||
"Horses": [],
|
"Horses": [],
|
||||||
"Hoverboards": [],
|
"Hoverboards": [],
|
||||||
"KubrowPets": [],
|
"KubrowPets": [],
|
||||||
"KubrowPetEggs": [],
|
"KubrowPetEggs": [],
|
||||||
"KubrowPetPrints": [],
|
"KubrowPetPrints": [],
|
||||||
"LongGuns": [],
|
"LongGuns": [],
|
||||||
"MechSuits": [],
|
"MechSuits": [],
|
||||||
"Melee": [],
|
"Melee": [],
|
||||||
"MoaPets": [],
|
"MoaPets": [],
|
||||||
"OperatorAmps": [],
|
"OperatorAmps": [],
|
||||||
"OperatorLoadOuts": [],
|
"OperatorLoadOuts": [],
|
||||||
"AdultOperatorLoadOuts": [],
|
"AdultOperatorLoadOuts": [],
|
||||||
"KahlLoadOuts": [],
|
"KahlLoadOuts": [],
|
||||||
"PendingRecipes": [],
|
"PendingRecipes": [],
|
||||||
"PersonalGoalProgress": [],
|
"PersonalGoalProgress": [],
|
||||||
"PersonalTechProjects": [],
|
"PersonalTechProjects": [],
|
||||||
"Pistols": [],
|
"Pistols": [],
|
||||||
"QualifyingInvasions": [],
|
"QualifyingInvasions": [],
|
||||||
"RepVotes": [],
|
"RepVotes": [],
|
||||||
"Scoops": [],
|
"Scoops": [],
|
||||||
"Sentinels": [],
|
"Sentinels": [],
|
||||||
"SentinelWeapons": [],
|
"SentinelWeapons": [],
|
||||||
"Ships": [{ "ItemType": "/Lotus/Types/Items/Ships/DefaultShip", "ItemId": { "$oid": "123123" } }],
|
"Ships": [{ "ItemType": "/Lotus/Types/Items/Ships/DefaultShip", "ItemId": { "$oid": "123123" } }],
|
||||||
"SpaceGuns": [],
|
"SpaceGuns": [],
|
||||||
"SpaceMelee": [],
|
"SpaceMelee": [],
|
||||||
"SpaceSuits": [],
|
"SpaceSuits": [],
|
||||||
"SpecialItems": [],
|
"SpecialItems": [],
|
||||||
"StepSequencers": [],
|
"StepSequencers": [],
|
||||||
"Suits": [],
|
"Suits": [],
|
||||||
"Upgrades": [],
|
"Upgrades": [],
|
||||||
"WeaponSkins": [],
|
"WeaponSkins": [],
|
||||||
"Boosters": [],
|
"Boosters": [],
|
||||||
"Consumables": [],
|
"Consumables": [],
|
||||||
"EmailItems": [],
|
"EmailItems": [],
|
||||||
"FlavourItems": [],
|
"FlavourItems": [],
|
||||||
"FocusUpgrades": [],
|
"FocusUpgrades": [],
|
||||||
"FusionTreasures": [],
|
"FusionTreasures": [],
|
||||||
"LeagueTickets": [],
|
"LeagueTickets": [],
|
||||||
"LevelKeys": [],
|
"LevelKeys": [],
|
||||||
"LoreFragmentScans": [],
|
"LoreFragmentScans": [],
|
||||||
"MiscItems": [],
|
"MiscItems": [],
|
||||||
"PendingSpectreLoadouts": [],
|
"PendingSpectreLoadouts": [],
|
||||||
"Quests": [],
|
"Quests": [],
|
||||||
"QuestKeys": [],
|
"QuestKeys": [],
|
||||||
"RawUpgrades": [],
|
"RawUpgrades": [],
|
||||||
"Recipes": [],
|
"Recipes": [],
|
||||||
"Robotics": [],
|
"Robotics": [],
|
||||||
"ShipDecorations": [],
|
"ShipDecorations": [],
|
||||||
"SpectreLoadouts": [],
|
"SpectreLoadouts": [],
|
||||||
"XPInfo": [],
|
"XPInfo": [],
|
||||||
"CrewShipAmmo": [],
|
"CrewShipAmmo": [],
|
||||||
"CrewShipRawSalvage": [],
|
"CrewShipRawSalvage": [],
|
||||||
"EvolutionProgress": [],
|
"EvolutionProgress": [],
|
||||||
"Missions": [],
|
"Missions": [],
|
||||||
"TauntHistory": [],
|
"TauntHistory": [],
|
||||||
"CompletedSyndicates": [],
|
"CompletedSyndicates": [],
|
||||||
"UsedDailyDeals": [],
|
"UsedDailyDeals": [],
|
||||||
"DailyAffiliation": 16000,
|
"DailyAffiliation": 16000,
|
||||||
"DailyAffiliationPvp": 16000,
|
"DailyAffiliationPvp": 16000,
|
||||||
"DailyAffiliationLibrary": 16000,
|
"DailyAffiliationLibrary": 16000,
|
||||||
"DailyAffiliationCetus": 16000,
|
"DailyAffiliationCetus": 16000,
|
||||||
"DailyAffiliationQuills": 16000,
|
"DailyAffiliationQuills": 16000,
|
||||||
"DailyAffiliationSolaris": 16000,
|
"DailyAffiliationSolaris": 16000,
|
||||||
"DailyAffiliationVentkids": 16000,
|
"DailyAffiliationVentkids": 16000,
|
||||||
"DailyAffiliationVox": 16000,
|
"DailyAffiliationVox": 16000,
|
||||||
"DailyAffiliationEntrati": 16000,
|
"DailyAffiliationEntrati": 16000,
|
||||||
"DailyAffiliationNecraloid": 16000,
|
"DailyAffiliationNecraloid": 16000,
|
||||||
"DailyAffiliationZariman": 16000,
|
"DailyAffiliationZariman": 16000,
|
||||||
"DailyAffiliationKahl": 16000,
|
"DailyAffiliationKahl": 16000,
|
||||||
"DailyFocus": 250000,
|
"DailyFocus": 250000,
|
||||||
"GiftsRemaining": 8,
|
"GiftsRemaining": 8,
|
||||||
"LibraryAvailableDailyTaskInfo": {
|
"LibraryAvailableDailyTaskInfo": {
|
||||||
"EnemyTypes": ["/Lotus/Types/Enemies/Orokin/OrokinBladeSawmanAvatar"],
|
"EnemyTypes": ["/Lotus/Types/Enemies/Orokin/OrokinBladeSawmanAvatar"],
|
||||||
"EnemyLocTag": "/Lotus/Language/Game/OrokinBladeSawman",
|
"EnemyLocTag": "/Lotus/Language/Game/OrokinBladeSawman",
|
||||||
"EnemyIcon": "/Lotus/Interface/Icons/Npcs/Orokin/OrokinBladeSawman.png",
|
"EnemyIcon": "/Lotus/Interface/Icons/Npcs/Orokin/OrokinBladeSawman.png",
|
||||||
"ScansRequired": 4,
|
"ScansRequired": 4,
|
||||||
"RewardStoreItem": "/Lotus/StoreItems/Upgrades/Mods/FusionBundles/UncommonFusionBundle",
|
"RewardStoreItem": "/Lotus/StoreItems/Upgrades/Mods/FusionBundles/UncommonFusionBundle",
|
||||||
"RewardQuantity": 10,
|
"RewardQuantity": 10,
|
||||||
"RewardStanding": 10000
|
"RewardStanding": 10000
|
||||||
},
|
},
|
||||||
"DuviriInfo": { "Seed": 123123123123123123, "NumCompletions": 0 },
|
"DuviriInfo": { "Seed": 123123123123123123, "NumCompletions": 0 },
|
||||||
"TradesRemaining": 0,
|
"TradesRemaining": 0,
|
||||||
"HasContributedToDojo": false,
|
"HasContributedToDojo": false,
|
||||||
"HasResetAccount": false,
|
"HasResetAccount": false,
|
||||||
"PendingCoupon": {
|
"PendingCoupon": {
|
||||||
"Expiry": { "$date": { "$numberLong": "0" } },
|
"Expiry": { "$date": { "$numberLong": "0" } },
|
||||||
"Discount": 0
|
"Discount": 0
|
||||||
},
|
},
|
||||||
"PremiumCreditsFree": 0,
|
"PremiumCreditsFree": 0,
|
||||||
"ReceivedStartingGear": true,
|
"ReceivedStartingGear": true,
|
||||||
"StoryModeChoice": "WARFRAME"
|
"StoryModeChoice": "WARFRAME"
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"DailyTributeInfo": {
|
"DailyTributeInfo": {
|
||||||
"IsMilestoneDay": false,
|
"IsMilestoneDay": false,
|
||||||
"IsChooseRewardSet": true,
|
"IsChooseRewardSet": true,
|
||||||
"LoginDays": 1337,
|
"LoginDays": 1337,
|
||||||
"NextMilestoneReward": "",
|
"NextMilestoneReward": "",
|
||||||
"NextMilestoneDay": 50
|
"NextMilestoneDay": 50
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
import { IGroup } from "@/src/types/loginTypes";
|
import { IGroup } from "@/src/types/loginTypes";
|
||||||
|
|
||||||
export const groups: IGroup[] = [
|
export const groups: IGroup[] = [
|
||||||
{
|
{
|
||||||
experiment: "InitiatePage",
|
experiment: "InitiatePage",
|
||||||
experimentGroup: "initiate_page_no_video"
|
experimentGroup: "initiate_page_no_video"
|
||||||
},
|
},
|
||||||
{ experiment: "ChatQAChannel", experimentGroup: "control" },
|
{ experiment: "ChatQAChannel", experimentGroup: "control" },
|
||||||
{
|
{
|
||||||
experiment: "MarketSearchRecommendations",
|
experiment: "MarketSearchRecommendations",
|
||||||
experimentGroup: "premium_credit_purchases_14_days"
|
experimentGroup: "premium_credit_purchases_14_days"
|
||||||
},
|
},
|
||||||
{ experiment: "SurveyLocation", experimentGroup: "EXIT" },
|
{ experiment: "SurveyLocation", experimentGroup: "EXIT" },
|
||||||
{ experiment: "GamesightAB", experimentGroup: "a" }
|
{ experiment: "GamesightAB", experimentGroup: "a" }
|
||||||
];
|
];
|
||||||
|
|
||||||
export const platformCDNs = [
|
export const platformCDNs = [
|
||||||
"https://content.warframe.com/",
|
"https://content.warframe.com/",
|
||||||
"https://content-xb1.warframe.com/",
|
"https://content-xb1.warframe.com/",
|
||||||
"https://content-ps4.warframe.com/",
|
"https://content-ps4.warframe.com/",
|
||||||
"https://content-swi.warframe.com/",
|
"https://content-swi.warframe.com/",
|
||||||
"https://content-mob.warframe.com/"
|
"https://content-mob.warframe.com/"
|
||||||
];
|
];
|
||||||
|
|
||||||
export const Nonce = 1231231233;
|
export const Nonce = 1231231233;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"InventoryChanges": {
|
"InventoryChanges": {
|
||||||
"WeaponBin": { "count": 1, "platinum": 0, "Slots": -1 },
|
"WeaponBin": { "count": 1, "platinum": 0, "Slots": -1 },
|
||||||
"Suits": [
|
"Suits": [
|
||||||
{
|
{
|
||||||
"ItemType": "/Lotus/Powersuits/Ninja/Ninja",
|
"ItemType": "/Lotus/Powersuits/Ninja/Ninja",
|
||||||
"Configs": [],
|
"Configs": [],
|
||||||
"ItemId": { "$oid": "123123123123" }
|
"ItemId": { "$oid": "123123123123" }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"RegularCredits": -25000
|
"RegularCredits": -25000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
204
tsconfig.json
204
tsconfig.json
@ -1,113 +1,113 @@
|
|||||||
{
|
{
|
||||||
"extends": "@tsconfig/node20/tsconfig.json",
|
"extends": "@tsconfig/node20/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
/* Visit https://aka.ms/tsconfig to read more about this file */
|
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||||
|
|
||||||
/* Projects */
|
/* Projects */
|
||||||
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
||||||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||||
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
||||||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
||||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||||
|
|
||||||
/* Language and Environment */
|
/* Language and Environment */
|
||||||
//"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
//"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||||
// "lib": ["es2023"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
// "lib": ["es2023"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||||
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
||||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||||
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||||
|
|
||||||
/* Modules */
|
/* Modules */
|
||||||
//"module": "commonjs" /* Specify what module code is generated. */,
|
//"module": "commonjs" /* Specify what module code is generated. */,
|
||||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||||
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||||
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||||
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
||||||
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
||||||
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
||||||
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
||||||
"resolveJsonModule": true /* Enable importing .json files. */,
|
"resolveJsonModule": true /* Enable importing .json files. */,
|
||||||
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
||||||
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||||
|
|
||||||
/* JavaScript Support */
|
/* JavaScript Support */
|
||||||
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||||
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||||
|
|
||||||
/* Emit */
|
/* Emit */
|
||||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||||
"outDir": "./build/" /* Specify an output folder for all emitted files. */,
|
"outDir": "./build/" /* Specify an output folder for all emitted files. */,
|
||||||
// "removeComments": true, /* Disable emitting comments. */
|
// "removeComments": true, /* Disable emitting comments. */
|
||||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||||
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
||||||
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||||
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||||
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||||
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||||
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||||
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
||||||
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
||||||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||||
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
||||||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||||
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
||||||
|
|
||||||
/* Interop Constraints */
|
/* Interop Constraints */
|
||||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||||
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
||||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
||||||
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
||||||
|
|
||||||
/* Type Checking */
|
/* Type Checking */
|
||||||
"strict": true /* Enable all strict type-checking options. */,
|
"strict": true /* Enable all strict type-checking options. */,
|
||||||
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
|
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
|
||||||
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
||||||
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||||
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
||||||
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||||
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
||||||
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
||||||
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||||
//"noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
|
//"noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
|
||||||
"noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
|
"noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
|
||||||
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||||
"noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
|
"noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
|
||||||
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
|
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
|
||||||
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
||||||
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||||
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
||||||
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||||
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||||
|
|
||||||
/* Completeness */
|
/* Completeness */
|
||||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./*"]
|
"@/*": ["./*"]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user