Inventory Infrastructure and Example for Suits #10

Merged
OrdisPrime merged 16 commits from inventory_basic into main 2023-06-03 18:06:22 -07:00
47 changed files with 3191 additions and 3170 deletions
Showing only changes of commit 96f945267a - Show all commits

View File

@ -1,5 +1,5 @@
{
"tabWidth": 2,
"tabWidth": 4,
"useTabs": false,
"endOfLine": "auto",
"trailingComma": "none",

View File

@ -1,7 +1,7 @@
{
"autoCreateAccount": true,
"buildLabel": "2023.05.25.13.39/oZkc-RIme5c1CCltUfg2gQ",
"matchmakingBuildId": "4920386201513015989",
"version": "33.0.14",
"worldSeed": "GWvLyHiw7/Qr/60056xmAmDrn0Y9et2S3BYlLSkLDNBMtumSr3KxWV8He5Jz72yYq3tsY+cd53QeTf+bb54+llGTbYiQF+64BtiLWMVhWP1IUaP4SxWHXojlpQC13op/udHI1whc+8zrxEzzZmv/QlpvigAAbjBDtwu97Df0vgn+YrOKi4G3OhgIkTRocAAzD1P/BGbT8gaKE01H8rXl3+Gq6jCA1O1v800SL6DwKOgMsXVvWp7g2n/tPxJe/j9bmu4XFG0bSa5y5hikLKxvntA/5ut+iogv4MyMBe+TydVxjPqNbkKnby5l4KAL+3inpuPraeg4jcNMt0AwKG8NIQ=="
"autoCreateAccount": true,
"buildLabel": "2023.05.25.13.39/oZkc-RIme5c1CCltUfg2gQ",
"matchmakingBuildId": "4920386201513015989",
"version": "33.0.14",
"worldSeed": "GWvLyHiw7/Qr/60056xmAmDrn0Y9et2S3BYlLSkLDNBMtumSr3KxWV8He5Jz72yYq3tsY+cd53QeTf+bb54+llGTbYiQF+64BtiLWMVhWP1IUaP4SxWHXojlpQC13op/udHI1whc+8zrxEzzZmv/QlpvigAAbjBDtwu97Df0vgn+YrOKi4G3OhgIkTRocAAzD1P/BGbT8gaKE01H8rXl3+Gq6jCA1O1v800SL6DwKOgMsXVvWp7g2n/tPxJe/j9bmu4XFG0bSa5y5hikLKxvntA/5ut+iogv4MyMBe+TydVxjPqNbkKnby5l4KAL+3inpuPraeg4jcNMt0AwKG8NIQ=="
}

View File

@ -1,38 +1,37 @@
{
"name": "wf-emulator",
"version": "0.1.0",
"description": "WF Emulator",
"main": "index.ts",
"scripts": {
"start": "node build/index.js",
"dev": "ts-node-dev --openssl-legacy-provider -r tsconfig-paths/register src/index.ts",
"build": "tsc",
"lint": "eslint --ext .ts .",
"pretty": "prettier --write \"./**/*.{js,jsx,ts,tsx,json}\""
},
"license": "GNU",
"dependencies": {
"dotenv": "^16.0.3",
"express": "^5.0.0-beta.1",
"mongoose": "^7.1.1"
},
"devDependencies": {
"@tsconfig/node20": "^1.0.0",
"@types/body-parser": "^1.19.2",
"@types/express": "^4.17.17",
"@types/morgan": "^1.9.4",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"eslint": "^8.40.0",
"eslint-plugin-prettier": "^4.2.1",
"morgan": "^1.10.0",
"prettier": "^2.8.8",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.0.4"
},
"engines": {
"node": ">=18.15.0",
"npm": ">=9.5.0"
}
"name": "wf-emulator",
"version": "0.1.0",
"description": "WF Emulator",
"main": "index.ts",
"scripts": {
"start": "node build/index.js",
"dev": "ts-node-dev --openssl-legacy-provider -r tsconfig-paths/register src/index.ts",
"build": "tsc",
"lint": "eslint --ext .ts ."
},
"license": "GNU",
"dependencies": {
"dotenv": "^16.0.3",
"express": "^5.0.0-beta.1",
"mongoose": "^7.1.1"
},
"devDependencies": {
"@tsconfig/node20": "^1.0.0",
"@types/body-parser": "^1.19.2",
"@types/express": "^4.17.17",
"@types/morgan": "^1.9.4",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"eslint": "^8.40.0",
"eslint-plugin-prettier": "^4.2.1",
"morgan": "^1.10.0",
"prettier": "^2.8.8",
"ts-node-dev": "^2.0.0",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.0.4"
},
"engines": {
"node": ">=18.15.0",
"npm": ">=9.5.0"
}
}

View File

@ -1,16 +1,16 @@
import { RequestHandler } from "express";
const checkDailyMissionBonusController: RequestHandler = (_req, res) => {
const data = Buffer.from([
0x44, 0x61, 0x69, 0x6c, 0x79, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x3a, 0x31,
0x2d, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x56, 0x50, 0x57, 0x69, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x3a, 0x31,
0x0a
]);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
const data = Buffer.from([
0x44, 0x61, 0x69, 0x6c, 0x79, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x3a,
0x31, 0x2d, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x56, 0x50, 0x57, 0x69, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73,
0x3a, 0x31, 0x0a
]);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
};
export { checkDailyMissionBonusController };

View File

@ -1,11 +1,11 @@
import { RequestHandler } from "express";
const dronesController: RequestHandler = (_req, res) => {
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": "3"
});
res.end(Buffer.from([0x7b, 0x7d, 0x0a]));
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": "3"
});
res.end(Buffer.from([0x7b, 0x7d, 0x0a]));
};
export { dronesController };

View File

@ -1,16 +1,16 @@
import { RequestHandler } from "express";
const findSessionsController: RequestHandler = (_req, res) => {
const data = Buffer.from([
0x7b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x22, 0x3a, 0x31, 0x2c, 0x22, 0x53, 0x65, 0x73, 0x73, 0x69,
0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
]);
const data = Buffer.from([
0x7b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x64, 0x22, 0x3a, 0x31, 0x2c, 0x22, 0x53, 0x65, 0x73, 0x73,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
]);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
};
export { findSessionsController };

View File

@ -1,7 +1,7 @@
import { RequestHandler } from "express";
const getAllianceController: RequestHandler = (_req, res) => {
res.sendStatus(200);
res.sendStatus(200);
};
export { getAllianceController };

View File

@ -1,12 +1,12 @@
import { Request, Response } from "express";
export default (_request: Request, response: Response) => {
response.writeHead(200, {
//Connection: "keep-alive",
//"Content-Encoding": "gzip",
"Content-Type": "text/html",
// charset: "UTF - 8",
"Content-Length": "3"
});
response.end(Buffer.from([0x7b, 0x7d, 0x0a]));
response.writeHead(200, {
//Connection: "keep-alive",
//"Content-Encoding": "gzip",
"Content-Type": "text/html",
// charset: "UTF - 8",
"Content-Length": "3"
});
response.end(Buffer.from([0x7b, 0x7d, 0x0a]));
};

View File

@ -1,16 +1,16 @@
import { RequestHandler } from "express";
const getIgnoredUsersController: RequestHandler = (_req, res) => {
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": "3"
});
res.end(
Buffer.from([
0x7b, 0x22, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x38, 0x33, 0x30, 0x34, 0x30, 0x37, 0x37, 0x32, 0x32, 0x34,
0x30, 0x32, 0x32, 0x32, 0x36, 0x31, 0x35, 0x30, 0x31, 0x7d
])
);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": "3"
});
res.end(
Buffer.from([
0x7b, 0x22, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x38, 0x33, 0x30, 0x34, 0x30, 0x37, 0x37, 0x32, 0x32,
0x34, 0x30, 0x32, 0x32, 0x32, 0x36, 0x31, 0x35, 0x30, 0x31, 0x7d
])
);
};
export { getIgnoredUsersController };

View File

@ -1,7 +1,7 @@
import { RequestHandler } from "express";
const getNewRewardSeedController: RequestHandler = (_req, res) => {
res.sendStatus(200);
res.sendStatus(200);
};
export { getNewRewardSeedController };

View File

@ -2,7 +2,7 @@ import { RequestHandler } from "express";
import getShip from "@/static/fixed_responses/getShip.json";
const getShipController: RequestHandler = (_req, res) => {
res.json(getShip);
res.json(getShip);
};
export { getShipController };

View File

@ -1,7 +1,7 @@
import { RequestHandler } from "express";
const hostSessionController: RequestHandler = (_req, res) => {
res.json({ sessionId: { $oid: "64777916e794cfc5abdd69ea" }, rewardSeed: -1492798783199571432 });
res.json({ sessionId: { $oid: "64777916e794cfc5abdd69ea" }, rewardSeed: -1492798783199571432 });
};
export { hostSessionController };

View File

@ -2,7 +2,7 @@ import { RequestHandler } from "express";
import inbox from "@/static/fixed_responses/inbox.json";
const inboxController: RequestHandler = (_req, res) => {
res.json(inbox);
res.json(inbox);
};
export { inboxController };

View File

@ -2,10 +2,10 @@ import inventory from "@/static/fixed_responses/inventory.json";
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
import { Request, RequestHandler, Response } from "express";
AngeloTadeucci commented 2023-06-03 17:24:58 -07:00 (Migrated from github.com)
Review

isnt disabled globally now?

isnt disabled globally now?
OrdisPrime commented 2023-06-03 17:39:22 -07:00 (Migrated from github.com)
Review

no idea it shouldn't be

no idea it shouldn't be
AngeloTadeucci commented 2023-06-03 17:43:16 -07:00 (Migrated from github.com)
Review

then remove the one from .eslintrc

then remove the one from .eslintrc
OrdisPrime commented 2023-06-03 17:48:55 -07:00 (Migrated from github.com)
Review

I agree with you that it is stupid to have the line in every file that has an async handler.

But I don't like to globally disable a warning. Ill turn the .eslintrc back on

I agree with you that it is stupid to have the line in every file that has an async handler. But I don't like to globally disable a warning. Ill turn the .eslintrc back on
const inventorController: RequestHandler = (request: Request, response: Response) => {
console.log(request.query);
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
const accountId = request.query.accountId;
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
console.log(accountId);
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
response.json(inventory);
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
console.log(request.query);
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
const accountId = request.query.accountId;
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
console.log(accountId);
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
response.json(inventory);
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
};
export default inventorController;

AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:15 -07:00 (Migrated from github.com)
Review

i dont think the comment is necessary

    const inventory = await Inventory.findOne({ accountOwnerId: accountId });
i dont think the comment is necessary ```suggestion const inventory = await Inventory.findOne({ accountOwnerId: accountId }); ```
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
AngeloTadeucci commented 2023-06-03 17:26:58 -07:00 (Migrated from github.com)
Review

check if inventory is undefined before trying toJson()

check if inventory is undefined before trying `toJson()`
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:39:50 -07:00 (Migrated from github.com)
Review

it is important, because it is not present in the original response.

it is important, because it is not present in the original response.
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
OrdisPrime commented 2023-06-03 17:40:09 -07:00 (Migrated from github.com)
Review

?. checks for undefined!

?. checks for undefined!
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:01 -07:00 (Migrated from github.com)
Review

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.

this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
AngeloTadeucci commented 2023-06-03 17:43:49 -07:00 (Migrated from github.com)
Review

that's why you check before so you dont two undefined checks

that's why you check before so you dont two undefined checks
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:44:53 -07:00 (Migrated from github.com)
Review

it explains a lot.

I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.

The purpose of the field is explained: it exists to find an account's corresponding inventory.

it explains a lot. I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there. The purpose of the field is explained: it exists to find an account's corresponding inventory.
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:46 -07:00 (Migrated from github.com)
Review

good suggestion!

good suggestion!
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
OrdisPrime commented 2023-06-03 17:46:59 -07:00 (Migrated from github.com)
Review

I understand now what you mean

I understand now what you mean
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?
AngeloTadeucci commented 2023-06-03 17:49:04 -07:00 (Migrated from github.com)
Review

should that belong then inside inventoryModel.ts?

should that belong then inside inventoryModel.ts?

View File

@ -11,32 +11,62 @@ import { DTLS, groups, HUB, IRC, Nonce, NRS, platformCDNs } from "@/static/fixed
// eslint-disable-next-line @typescript-eslint/no-misused-promises
const loginController: RequestHandler = async (request, response) => {
// 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 loginRequest = toLoginRequest(body);
// console.log(body);
//console.log(String.fromCharCode.apiRouterly(null, req.body));
// 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 loginRequest = toLoginRequest(body);
// console.log(body);
//console.log(String.fromCharCode.apiRouterly(null, req.body));
const account = await Account.findOne({ email: loginRequest.email }); //{ _id: 0, __v: 0 }
console.log("findone", account);
const account = await Account.findOne({ email: loginRequest.email }); //{ _id: 0, __v: 0 }
console.log("findone", account);
if (!account && config.autoCreateAccount) {
try {
const newAccount = await createAccount({
email: loginRequest.email,
password: loginRequest.password,
DisplayName: loginRequest.email.substring(0, loginRequest.email.indexOf("@")),
CountryCode: loginRequest.lang.toUpperCase(),
ClientType: loginRequest.ClientType,
CrossPlatformAllowed: true,
ForceLogoutVersion: 0,
ConsentNeeded: false,
TrackedSettings: []
});
console.log("CREATED ACCOUNT", newAccount);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { email, password, ...databaseAccount } = newAccount;
const newLoginResponse: ILoginResponse = {
if (!account && config.autoCreateAccount) {
try {
const newAccount = await createAccount({
email: loginRequest.email,
password: loginRequest.password,
DisplayName: loginRequest.email.substring(0, loginRequest.email.indexOf("@")),
CountryCode: loginRequest.lang.toUpperCase(),
ClientType: loginRequest.ClientType,
CrossPlatformAllowed: true,
ForceLogoutVersion: 0,
ConsentNeeded: false,
TrackedSettings: []
});
console.log("CREATED ACCOUNT", newAccount);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { email, password, ...databaseAccount } = newAccount;
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,
Groups: groups,
platformCDNs: platformCDNs,
@ -47,40 +77,10 @@ const loginController: RequestHandler = async (request, response) => {
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,
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);
console.log("login response", newLoginResponse);
response.json(newLoginResponse);
};
export { loginController };

View File

@ -2,7 +2,7 @@ import { RequestHandler } from "express";
import loginRewards from "@/static/fixed_responses/loginRewards.json";
const loginRewardsController: RequestHandler = (_req, res) => {
res.json(loginRewards);
res.json(loginRewards);
};
export { loginRewardsController };

View File

@ -1,16 +1,16 @@
import { RequestHandler } from "express";
const marketRecommendationsController: RequestHandler = (_req, res) => {
const data = Buffer.from([
0x7b, 0x22, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x7b, 0x22, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x64, 0x22, 0x3a, 0x5b,
0x5d, 0x2c, 0x22, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d
]);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
const data = Buffer.from([
0x7b, 0x22, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3a, 0x7b, 0x22, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x64, 0x22,
0x3a, 0x5b, 0x5d, 0x2c, 0x22, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d
]);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
};
export { marketRecommendationsController };

View File

@ -1,7 +1,7 @@
import { RequestHandler } from "express";
const marketSearchRecommendationsController: RequestHandler = (_req, res) => {
res.sendStatus(200);
res.sendStatus(200);
};
export { marketSearchRecommendationsController };

View File

@ -2,5 +2,5 @@ import purchase from "@/static/fixed_responses/purchase.json";
import { Request, Response } from "express";
export default (_req: Request, res: Response): void => {
res.json(purchase);
res.json(purchase);
};

View File

@ -1,7 +1,7 @@
import { RequestHandler } from "express";
const setActiveQuestController: RequestHandler = (_req, res) => {
res.sendStatus(200);
res.sendStatus(200);
};
export { setActiveQuestController };

View File

@ -1,14 +1,14 @@
import { RequestHandler } from "express";
const surveysController: RequestHandler = (_req, res) => {
const data = Buffer.from([
0x7b, 0x22, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
]);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
const data = Buffer.from([
0x7b, 0x22, 0x53, 0x75, 0x72, 0x76, 0x65, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d
]);
res.writeHead(200, {
"Content-Type": "text/html",
"Content-Length": data.length
});
res.end(data);
};
export { surveysController };

View File

@ -1,7 +1,7 @@
import { RequestHandler } from "express";
const updateChallengeProgressController: RequestHandler = (_request, response) => {
response.sendStatus(200);
response.sendStatus(200);
};
export { updateChallengeProgressController };

View File

@ -2,7 +2,7 @@ import { RequestHandler } from "express";
import view from "@/static/fixed_responses/view.json";
const viewController: RequestHandler = (_req, res) => {
res.json(view);
res.json(view);
};
export { viewController };

View File

@ -4,12 +4,12 @@ import { createAccount } from "@/src/services/loginService";
import { RequestHandler } from "express";
const createAccountController: RequestHandler = async (req, res) => {
const createAccountData = toCreateAccount(req.body);
const databaseAccount = toDatabaseAccount(createAccountData);
const createAccountData = toCreateAccount(req.body);
const databaseAccount = toDatabaseAccount(createAccountData);
const account = await createAccount(databaseAccount);
const account = await createAccount(databaseAccount);
res.json(account);
res.json(account);
};
export { createAccountController };

View File

@ -1,7 +1,7 @@
import { RequestHandler } from "express";
const aggregateSessionsController: RequestHandler = (_req, res) => {
res.json({});
res.json({});
};
export { aggregateSessionsController };

View File

@ -3,10 +3,10 @@ import config from "@/config.json";
import worldState from "@/static/fixed_responses/worldState.json";
const worldStateController: RequestHandler = (_req, res) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
worldState.WorldSeed = config.worldSeed;
worldState.BuildLabel = config.buildLabel;
res.json(worldState);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
worldState.WorldSeed = config.worldSeed;
worldState.BuildLabel = config.buildLabel;
res.json(worldState);
};
export { worldStateController };

View File

@ -1,6 +1,6 @@
import { RequestHandler } from "express";
const steamPacksController: RequestHandler = (_req, res) => {
res.sendStatus(200);
res.sendStatus(200);
};
export { steamPacksController };

View File

@ -4,52 +4,52 @@ import { IDatabaseAccount } from "../types/loginTypes";
import { isString, parseEmail, parseString } from "./general";
const getWhirlpoolHash = (rawPassword: string): string => {
const whirlpool = crypto.createHash("whirlpool");
const data = whirlpool.update(rawPassword, "utf8");
const hash = data.digest("hex");
return hash;
const whirlpool = crypto.createHash("whirlpool");
const data = whirlpool.update(rawPassword, "utf8");
const hash = data.digest("hex");
return hash;
};
const parsePassword = (passwordCandidate: unknown): string => {
// a different function could be called that checks whether the password has a certain shape
if (!isString(passwordCandidate)) {
throw new Error("incorrect password format");
}
return passwordCandidate;
// a different function could be called that checks whether the password has a certain shape
if (!isString(passwordCandidate)) {
throw new Error("incorrect password format");
}
return passwordCandidate;
};
const toAccountCreation = (accountCreation: unknown): IAccountCreation => {
if (!accountCreation || typeof accountCreation !== "object") {
throw new Error("incorrect or missing account creation data");
}
if (!accountCreation || typeof accountCreation !== "object") {
throw new Error("incorrect or missing account creation data");
}
if (
"email" in accountCreation &&
"password" in accountCreation &&
"DisplayName" in accountCreation &&
"CountryCode" in accountCreation
) {
const rawPassword = parsePassword(accountCreation.password);
console.log("email", accountCreation.email);
return {
email: parseEmail(accountCreation.email),
password: getWhirlpoolHash(rawPassword),
CountryCode: parseString(accountCreation.CountryCode),
DisplayName: parseString(accountCreation.DisplayName)
};
}
throw new Error("incorrect account creation data: incorrect properties");
if (
"email" in accountCreation &&
"password" in accountCreation &&
"DisplayName" in accountCreation &&
"CountryCode" in accountCreation
) {
const rawPassword = parsePassword(accountCreation.password);
console.log("email", accountCreation.email);
return {
email: parseEmail(accountCreation.email),
password: getWhirlpoolHash(rawPassword),
CountryCode: parseString(accountCreation.CountryCode),
DisplayName: parseString(accountCreation.DisplayName)
};
}
throw new Error("incorrect account creation data: incorrect properties");
};
const toDatabaseAccount = (createAccount: IAccountCreation): IDatabaseAccount => {
return {
...createAccount,
ClientType: "",
ConsentNeeded: false,
CrossPlatformAllowed: true,
ForceLogoutVersion: 0,
TrackedSettings: []
} satisfies IDatabaseAccount;
return {
...createAccount,
ClientType: "",
ConsentNeeded: false,
CrossPlatformAllowed: true,
ForceLogoutVersion: 0,
TrackedSettings: []
} satisfies IDatabaseAccount;
};
export { toDatabaseAccount, toAccountCreation as toCreateAccount };

View File

@ -1,58 +1,58 @@
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 => {
if (!isString(data)) {
throw new Error("data is not a string");
}
if (!isString(data)) {
throw new Error("data is not a string");
}
return data;
return data;
};
const isNumber = (number: unknown): number is number => {
return typeof number === "number" && !isNaN(number);
return typeof number === "number" && !isNaN(number);
};
const parseNumber = (data: unknown): number => {
if (!isNumber(data)) {
throw new Error("data is not a number");
}
if (!isNumber(data)) {
throw new Error("data is not a number");
}
return Number(data);
return Number(data);
};
const isDate = (date: string) => {
if (!Date.parse(date)) {
throw new Error("invalid date");
}
return date;
if (!Date.parse(date)) {
throw new Error("invalid date");
}
return date;
};
const parseDateNumber = (date: unknown): string => {
if (!isString(date) || !isDate(date)) {
throw new Error("date could not be parsed");
}
if (!isString(date) || !isDate(date)) {
throw new Error("date could not be parsed");
}
return date;
return date;
};
const parseEmail = (email: unknown): string => {
if (!isString(email)) {
throw new Error("incorrect email");
}
return email;
if (!isString(email)) {
throw new Error("incorrect email");
}
return email;
};
const isBoolean = (booleanCandidate: unknown): booleanCandidate is boolean => {
return typeof booleanCandidate === "boolean";
return typeof booleanCandidate === "boolean";
};
const parseBoolean = (booleanCandidate: unknown): boolean => {
if (!isBoolean(booleanCandidate)) {
throw new Error("argument was not a boolean");
}
return booleanCandidate;
if (!isBoolean(booleanCandidate)) {
throw new Error("argument was not a boolean");
}
return booleanCandidate;
};
export { isString, isNumber, parseString, parseNumber, parseDateNumber, parseBoolean, parseEmail };

View File

@ -2,34 +2,34 @@ import { ILoginRequest } from "../types/loginTypes";
import { parseEmail, parseNumber, parseString } from "./general";
const toLoginRequest = (loginRequest: unknown): ILoginRequest => {
if (!loginRequest || typeof loginRequest !== "object") {
throw new Error("incorrect or missing login request data");
}
if (!loginRequest || typeof loginRequest !== "object") {
throw new Error("incorrect or missing login request data");
}
// TODO: function that checks whether every field of interface is in object
if (
"email" in loginRequest &&
"password" in loginRequest &&
"time" in loginRequest &&
"s" in loginRequest &&
"lang" in loginRequest &&
"date" in loginRequest &&
"ClientType" in loginRequest &&
"PS" in loginRequest
) {
return {
email: parseEmail(loginRequest.email),
password: parseString(loginRequest.password),
time: parseNumber(loginRequest.time),
s: parseString(loginRequest.s),
lang: parseString(loginRequest.lang),
date: parseNumber(loginRequest.date),
ClientType: parseString(loginRequest.ClientType),
PS: parseString(loginRequest.PS)
};
}
// TODO: function that checks whether every field of interface is in object
if (
"email" in loginRequest &&
"password" in loginRequest &&
"time" in loginRequest &&
"s" in loginRequest &&
"lang" in loginRequest &&
"date" in loginRequest &&
"ClientType" in loginRequest &&
"PS" in loginRequest
) {
return {
email: parseEmail(loginRequest.email),
password: parseString(loginRequest.password),
time: parseNumber(loginRequest.time),
s: parseString(loginRequest.s),
lang: parseString(loginRequest.lang),
date: parseNumber(loginRequest.date),
ClientType: parseString(loginRequest.ClientType),
PS: parseString(loginRequest.PS)
};
}
throw new Error("incorrect login request");
throw new Error("incorrect login request");
};
export { toLoginRequest };

View File

@ -6,9 +6,9 @@ import { app } from "./app";
//const bodyParser = require("body-parser");
const options = {
key: fs.readFileSync("static/certs/key.pem"),
cert: fs.readFileSync("static/certs/cert.pem"),
passphrase: "123456"
key: fs.readFileSync("static/certs/key.pem"),
cert: fs.readFileSync("static/certs/cert.pem"),
passphrase: "123456"
};
// const server = http.createServer(app).listen(80);

View File

@ -1,16 +1,16 @@
import { NextFunction, Request, Response } from "express";
const unknownEndpointHandler = (request: Request, response: Response) => {
console.error("[ERROR] Unknown Endpoint", request.url);
response.status(404).json({ error: "endpoint was not found" });
console.error("[ERROR] Unknown Endpoint", request.url);
response.status(404).json({ error: "endpoint was not found" });
};
const requestLogger = (request: Request, _response: Response, next: NextFunction) => {
console.log("Method:", request.method);
console.log("Path: ", request.path);
console.log("Body: ", request.body);
console.log("---");
next();
console.log("Method:", request.method);
console.log("Path: ", request.path);
console.log("Body: ", request.body);
console.log("---");
next();
};
export { unknownEndpointHandler, requestLogger };

View File

@ -2,8 +2,8 @@ import { model, Schema, SchemaOptions } from "mongoose";
import { IDatabaseAccountDocument } from "../types/loginTypes";
const opts = {
toJSON: { virtuals: true },
toObject: { virtuals: true }
toJSON: { virtuals: true },
toObject: { virtuals: true }
} satisfies SchemaOptions;
// {
@ -21,29 +21,29 @@ const opts = {
// }
const databaseAccountSchema = new Schema<IDatabaseAccountDocument>(
{
email: { type: String, required: true, unique: true },
password: { type: String, required: true },
DisplayName: { type: String, required: true },
CountryCode: { type: String, required: true },
ClientType: { type: String },
CrossPlatformAllowed: { type: Boolean, required: true },
ForceLogoutVersion: { type: Number, required: true },
AmazonAuthToken: { type: String },
AmazonRefreshToken: { type: String },
ConsentNeeded: { type: Boolean, required: true },
TrackedSettings: { type: [String], default: [] }
},
opts
{
email: { type: String, required: true, unique: true },
password: { type: String, required: true },
DisplayName: { type: String, required: true },
CountryCode: { type: String, required: true },
ClientType: { type: String },
CrossPlatformAllowed: { type: Boolean, required: true },
ForceLogoutVersion: { type: Number, required: true },
AmazonAuthToken: { type: String },
AmazonRefreshToken: { type: String },
ConsentNeeded: { type: Boolean, required: true },
TrackedSettings: { type: [String], default: [] }
},
opts
);
databaseAccountSchema.set("toJSON", {
transform(_document, returnedObject) {
//returnedObject.id = returnedObject._id.toString();
delete returnedObject._id;
delete returnedObject.__v;
},
virtuals: true
transform(_document, returnedObject) {
//returnedObject.id = returnedObject._id.toString();
delete returnedObject._id;
delete returnedObject.__v;
},
virtuals: true
});
//databaseAccountSchema.set("");

View File

@ -1,7 +1,7 @@
import mongoose from "mongoose";
const accountSchema = new mongoose.Schema({
data: JSON
data: JSON
});
// personSchema.set("toJSON", {

View File

@ -4,19 +4,19 @@ import config from "@/config.json";
const cacheRouter = express.Router();
cacheRouter.get("/B.Cache.Dx11.bin.*", (_req, res) => {
//console.log("asd", path.join(__dirname, "../data"));
res.sendFile("static/data/B.Cache.Dx11_33.0.6.bin", { root: "./" });
//console.log("asd", path.join(__dirname, "../data"));
res.sendFile("static/data/B.Cache.Dx11_33.0.6.bin", { root: "./" });
});
cacheRouter.get("/B.Cache.Windows_en.bin*", (_req, res) => {
//console.log("asd", path.join(__dirname, "../data"));
res.sendFile("static/data/B.Cache.Windows_en_33.0.10.bin", { root: "./" });
//console.log("asd", path.join(__dirname, "../data"));
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) => {
// console.log("asd", path.join(__dirname, "../data"));
// console.log("asd", __dirname);
res.sendFile(`static/data/H.Cache_${config.version}.bin`, { root: "./" });
// console.log("asd", path.join(__dirname, "../data"));
// console.log("asd", __dirname);
res.sendFile(`static/data/H.Cache_${config.version}.bin`, { root: "./" });
});
export { cacheRouter };

View File

@ -2,21 +2,21 @@ import { Account } from "../models/loginModel";
import { IDatabaseAccount } from "../types/loginTypes";
const isCorrectPassword = (requestPassword: string, databasePassword: string): boolean => {
return requestPassword === databasePassword;
return requestPassword === databasePassword;
};
const createAccount = async (accountData: IDatabaseAccount) => {
console.log("test", accountData);
const account = new Account(accountData);
try {
await account.save();
return account.toJSON();
} catch (error) {
if (error instanceof Error) {
throw new Error(error.message);
console.log("test", accountData);
const account = new Account(accountData);
try {
await account.save();
return account.toJSON();
} catch (error) {
if (error instanceof Error) {
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 };

View File

@ -10,14 +10,14 @@ if (!url) throw new Error("MONGODB_URL not found");
console.log("connecting to MongoDB URL:", url);
const connectDatabase = async () => {
try {
await mongoose.connect(url);
console.log("connected to MongoDB");
} catch (error: unknown) {
if (error instanceof Error) {
console.error("error connecting to MongoDB", error.message);
try {
await mongoose.connect(url);
console.log("connected to MongoDB");
} catch (error: unknown) {
if (error instanceof Error) {
console.error("error connecting to MongoDB", error.message);
}
}
}
};
export { connectDatabase };

View File

@ -1,6 +1,6 @@
export interface IAccountCreation {
email: string;
password: string;
DisplayName: string;
CountryCode: string;
email: string;
password: string;
DisplayName: string;
CountryCode: string;
}

View File

@ -1,46 +1,46 @@
export interface ILoginResponse extends Omit<IDatabaseAccountDocument, "email" | "password"> {
Groups: IGroup[];
Nonce: number;
BuildLabel: string;
MatchmakingBuildId: string;
platformCDNs: string[];
NRS: string[];
DTLS: number;
IRC: string[];
HUB: string;
Groups: IGroup[];
Nonce: number;
BuildLabel: string;
MatchmakingBuildId: string;
platformCDNs: string[];
NRS: string[];
DTLS: number;
IRC: string[];
HUB: string;
}
//includes virtual id
export interface IDatabaseAccountDocument extends IDatabaseAccount {
id: string;
id: string;
}
export interface IGroup {
experiment: string;
experimentGroup: string;
experiment: string;
experimentGroup: string;
}
export interface IDatabaseAccount {
email: string;
password: string;
DisplayName: string;
CountryCode: string;
ClientType: string;
CrossPlatformAllowed: boolean;
ForceLogoutVersion: number;
AmazonAuthToken?: string;
AmazonRefreshToken?: string;
ConsentNeeded: boolean;
TrackedSettings: string[];
email: string;
password: string;
DisplayName: string;
CountryCode: string;
ClientType: string;
CrossPlatformAllowed: boolean;
ForceLogoutVersion: number;
AmazonAuthToken?: string;
AmazonRefreshToken?: string;
ConsentNeeded: boolean;
TrackedSettings: string[];
}
export interface ILoginRequest {
email: string;
password: string;
time: number;
s: string;
lang: string;
date: number;
ClientType: string;
PS: string;
email: string;
password: string;
time: number;
s: string;
lang: string;
date: number;
ClientType: string;
PS: string;
}

View File

@ -1,24 +1,24 @@
{
"ShipOwnerId": "removed",
"Ship": {
"Rooms": [
{ "Name": "AlchemyRoom", "MaxCapacity": 1600 },
{ "Name": "BridgeRoom", "MaxCapacity": 1600 },
{ "Name": "LisetRoom", "MaxCapacity": 1000 },
{ "Name": "OperatorChamberRoom", "MaxCapacity": 1600 },
{ "Name": "OutsideRoom", "MaxCapacity": 1600 },
{ "Name": "PersonalQuartersRoom", "MaxCapacity": 1600 }
],
"ContentUrlSignature": "removed"
},
"Apartment": {
"Rooms": [
{ "Name": "ElevatorLanding", "MaxCapacity": 1600 },
{ "Name": "ApartmentRoomA", "MaxCapacity": 1000 },
{ "Name": "ApartmentRoomB", "MaxCapacity": 1600 },
{ "Name": "ApartmentRoomC", "MaxCapacity": 1600 },
{ "Name": "DuviriHallway", "MaxCapacity": 1600 }
],
"FavouriteLoadouts": []
}
"ShipOwnerId": "removed",
"Ship": {
"Rooms": [
{ "Name": "AlchemyRoom", "MaxCapacity": 1600 },
{ "Name": "BridgeRoom", "MaxCapacity": 1600 },
{ "Name": "LisetRoom", "MaxCapacity": 1000 },
{ "Name": "OperatorChamberRoom", "MaxCapacity": 1600 },
{ "Name": "OutsideRoom", "MaxCapacity": 1600 },
{ "Name": "PersonalQuartersRoom", "MaxCapacity": 1600 }
],
"ContentUrlSignature": "removed"
},
"Apartment": {
"Rooms": [
{ "Name": "ElevatorLanding", "MaxCapacity": 1600 },
{ "Name": "ApartmentRoomA", "MaxCapacity": 1000 },
{ "Name": "ApartmentRoomB", "MaxCapacity": 1600 },
{ "Name": "ApartmentRoomC", "MaxCapacity": 1600 },
{ "Name": "DuviriHallway", "MaxCapacity": 1600 }
],
"FavouriteLoadouts": []
}
}

View File

@ -1,24 +1,24 @@
{
"Inbox": [
{
"sndr": "/Lotus/Language/Bosses/Ordis",
"msg": "/Lotus/Language/Inbox/ThankYouFreeMultipleContent",
"countedAtt": [
"Inbox": [
{
"ItemType": "/Lotus/Upgrades/Skins/Promo/Twitch/OgrisTwitchSkin",
"ItemCount": 1
},
{
"ItemType": "/Lotus/Weapons/ClanTech/Chemical/RocketLauncher",
"ItemCount": 1
"sndr": "/Lotus/Language/Bosses/Ordis",
"msg": "/Lotus/Language/Inbox/ThankYouFreeMultipleContent",
"countedAtt": [
{
"ItemType": "/Lotus/Upgrades/Skins/Promo/Twitch/OgrisTwitchSkin",
"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
}
]
]
}

View File

@ -1,131 +1,131 @@
{
"SubscribedToEmails": 0,
"Created": { "$date": { "$numberLong": "removed" } },
"SubscribedToEmailsPersonalized": 0,
"RewardSeed": -123123123123123,
"CrewMemberBin": { "Slots": 3 },
"CrewShipSalvageBin": { "Slots": 8 },
"DrifterMelee": [
{
"ItemType": "/Lotus/Types/Friendly/PlayerControllable/Weapons/DuviriDualSwords",
"ItemId": { "$oid": "removed" }
}
],
"FusionPoints": 0,
"MechBin": { "Slots": 4 },
"OperatorAmpBin": { "Slots": 8 },
"PveBonusLoadoutBin": { "Slots": 0 },
"PvpBonusLoadoutBin": { "Slots": 0 },
"RandomModBin": { "Slots": 15 },
"RegularCredits": 0,
"SentinelBin": { "Slots": 10 },
"SpaceSuitBin": { "Slots": 4 },
"SpaceWeaponBin": { "Slots": 4 },
"SuitBin": { "Slots": 2 },
"WeaponBin": { "Slots": 8 },
"LastInventorySync": { "$oid": "removed" },
"NextRefill": { "$date": { "$numberLong": "removed" } },
"ActiveLandscapeTraps": [],
"ChallengeProgress": [],
"CrewMembers": [],
"CrewShips": [],
"CrewShipHarnesses": [],
"CrewShipSalvagedWeapons": [],
"CrewShipSalvagedWeaponSkins": [],
"CrewShipWeapons": [],
"CrewShipWeaponSkins": [],
"DataKnives": [],
"DrifterGuns": [],
"Drones": [],
"Horses": [],
"Hoverboards": [],
"KubrowPets": [],
"KubrowPetEggs": [],
"KubrowPetPrints": [],
"LongGuns": [],
"MechSuits": [],
"Melee": [],
"MoaPets": [],
"OperatorAmps": [],
"OperatorLoadOuts": [],
"AdultOperatorLoadOuts": [],
"KahlLoadOuts": [],
"PendingRecipes": [],
"PersonalGoalProgress": [],
"PersonalTechProjects": [],
"Pistols": [],
"QualifyingInvasions": [],
"RepVotes": [],
"Scoops": [],
"Sentinels": [],
"SentinelWeapons": [],
"Ships": [{ "ItemType": "/Lotus/Types/Items/Ships/DefaultShip", "ItemId": { "$oid": "123123" } }],
"SpaceGuns": [],
"SpaceMelee": [],
"SpaceSuits": [],
"SpecialItems": [],
"StepSequencers": [],
"Suits": [],
"Upgrades": [],
"WeaponSkins": [],
"Boosters": [],
"Consumables": [],
"EmailItems": [],
"FlavourItems": [],
"FocusUpgrades": [],
"FusionTreasures": [],
"LeagueTickets": [],
"LevelKeys": [],
"LoreFragmentScans": [],
"MiscItems": [],
"PendingSpectreLoadouts": [],
"Quests": [],
"QuestKeys": [],
"RawUpgrades": [],
"Recipes": [],
"Robotics": [],
"ShipDecorations": [],
"SpectreLoadouts": [],
"XPInfo": [],
"CrewShipAmmo": [],
"CrewShipRawSalvage": [],
"EvolutionProgress": [],
"Missions": [],
"TauntHistory": [],
"CompletedSyndicates": [],
"UsedDailyDeals": [],
"DailyAffiliation": 16000,
"DailyAffiliationPvp": 16000,
"DailyAffiliationLibrary": 16000,
"DailyAffiliationCetus": 16000,
"DailyAffiliationQuills": 16000,
"DailyAffiliationSolaris": 16000,
"DailyAffiliationVentkids": 16000,
"DailyAffiliationVox": 16000,
"DailyAffiliationEntrati": 16000,
"DailyAffiliationNecraloid": 16000,
"DailyAffiliationZariman": 16000,
"DailyAffiliationKahl": 16000,
"DailyFocus": 250000,
"GiftsRemaining": 8,
"LibraryAvailableDailyTaskInfo": {
"EnemyTypes": ["/Lotus/Types/Enemies/Orokin/OrokinBladeSawmanAvatar"],
"EnemyLocTag": "/Lotus/Language/Game/OrokinBladeSawman",
"EnemyIcon": "/Lotus/Interface/Icons/Npcs/Orokin/OrokinBladeSawman.png",
"ScansRequired": 4,
"RewardStoreItem": "/Lotus/StoreItems/Upgrades/Mods/FusionBundles/UncommonFusionBundle",
"RewardQuantity": 10,
"RewardStanding": 10000
},
"DuviriInfo": { "Seed": 123123123123123123, "NumCompletions": 0 },
"TradesRemaining": 0,
"HasContributedToDojo": false,
"HasResetAccount": false,
"PendingCoupon": {
"Expiry": { "$date": { "$numberLong": "0" } },
"Discount": 0
},
"PremiumCreditsFree": 0,
"ReceivedStartingGear": true,
"StoryModeChoice": "WARFRAME"
"SubscribedToEmails": 0,
"Created": { "$date": { "$numberLong": "removed" } },
"SubscribedToEmailsPersonalized": 0,
"RewardSeed": -123123123123123,
"CrewMemberBin": { "Slots": 3 },
"CrewShipSalvageBin": { "Slots": 8 },
"DrifterMelee": [
{
"ItemType": "/Lotus/Types/Friendly/PlayerControllable/Weapons/DuviriDualSwords",
"ItemId": { "$oid": "removed" }
}
],
"FusionPoints": 0,
"MechBin": { "Slots": 4 },
"OperatorAmpBin": { "Slots": 8 },
"PveBonusLoadoutBin": { "Slots": 0 },
"PvpBonusLoadoutBin": { "Slots": 0 },
"RandomModBin": { "Slots": 15 },
"RegularCredits": 0,
"SentinelBin": { "Slots": 10 },
"SpaceSuitBin": { "Slots": 4 },
"SpaceWeaponBin": { "Slots": 4 },
"SuitBin": { "Slots": 2 },
"WeaponBin": { "Slots": 8 },
"LastInventorySync": { "$oid": "removed" },
"NextRefill": { "$date": { "$numberLong": "removed" } },
"ActiveLandscapeTraps": [],
"ChallengeProgress": [],
"CrewMembers": [],
"CrewShips": [],
"CrewShipHarnesses": [],
"CrewShipSalvagedWeapons": [],
"CrewShipSalvagedWeaponSkins": [],
"CrewShipWeapons": [],
"CrewShipWeaponSkins": [],
"DataKnives": [],
"DrifterGuns": [],
"Drones": [],
"Horses": [],
"Hoverboards": [],
"KubrowPets": [],
"KubrowPetEggs": [],
"KubrowPetPrints": [],
"LongGuns": [],
"MechSuits": [],
"Melee": [],
"MoaPets": [],
"OperatorAmps": [],
"OperatorLoadOuts": [],
"AdultOperatorLoadOuts": [],
"KahlLoadOuts": [],
"PendingRecipes": [],
"PersonalGoalProgress": [],
"PersonalTechProjects": [],
"Pistols": [],
"QualifyingInvasions": [],
"RepVotes": [],
"Scoops": [],
"Sentinels": [],
"SentinelWeapons": [],
"Ships": [{ "ItemType": "/Lotus/Types/Items/Ships/DefaultShip", "ItemId": { "$oid": "123123" } }],
"SpaceGuns": [],
"SpaceMelee": [],
"SpaceSuits": [],
"SpecialItems": [],
"StepSequencers": [],
"Suits": [],
"Upgrades": [],
"WeaponSkins": [],
"Boosters": [],
"Consumables": [],
"EmailItems": [],
"FlavourItems": [],
"FocusUpgrades": [],
"FusionTreasures": [],
"LeagueTickets": [],
"LevelKeys": [],
"LoreFragmentScans": [],
"MiscItems": [],
"PendingSpectreLoadouts": [],
"Quests": [],
"QuestKeys": [],
"RawUpgrades": [],
"Recipes": [],
"Robotics": [],
"ShipDecorations": [],
"SpectreLoadouts": [],
"XPInfo": [],
"CrewShipAmmo": [],
"CrewShipRawSalvage": [],
"EvolutionProgress": [],
"Missions": [],
"TauntHistory": [],
"CompletedSyndicates": [],
"UsedDailyDeals": [],
"DailyAffiliation": 16000,
"DailyAffiliationPvp": 16000,
"DailyAffiliationLibrary": 16000,
"DailyAffiliationCetus": 16000,
"DailyAffiliationQuills": 16000,
"DailyAffiliationSolaris": 16000,
"DailyAffiliationVentkids": 16000,
"DailyAffiliationVox": 16000,
"DailyAffiliationEntrati": 16000,
"DailyAffiliationNecraloid": 16000,
"DailyAffiliationZariman": 16000,
"DailyAffiliationKahl": 16000,
"DailyFocus": 250000,
"GiftsRemaining": 8,
"LibraryAvailableDailyTaskInfo": {
"EnemyTypes": ["/Lotus/Types/Enemies/Orokin/OrokinBladeSawmanAvatar"],
"EnemyLocTag": "/Lotus/Language/Game/OrokinBladeSawman",
"EnemyIcon": "/Lotus/Interface/Icons/Npcs/Orokin/OrokinBladeSawman.png",
"ScansRequired": 4,
"RewardStoreItem": "/Lotus/StoreItems/Upgrades/Mods/FusionBundles/UncommonFusionBundle",
"RewardQuantity": 10,
"RewardStanding": 10000
},
"DuviriInfo": { "Seed": 123123123123123123, "NumCompletions": 0 },
"TradesRemaining": 0,
"HasContributedToDojo": false,
"HasResetAccount": false,
"PendingCoupon": {
"Expiry": { "$date": { "$numberLong": "0" } },
"Discount": 0
},
"PremiumCreditsFree": 0,
"ReceivedStartingGear": true,
"StoryModeChoice": "WARFRAME"
}

View File

@ -1,9 +1,9 @@
{
"DailyTributeInfo": {
"IsMilestoneDay": false,
"IsChooseRewardSet": true,
"LoginDays": 1337,
"NextMilestoneReward": "",
"NextMilestoneDay": 50
}
"DailyTributeInfo": {
"IsMilestoneDay": false,
"IsChooseRewardSet": true,
"LoginDays": 1337,
"NextMilestoneReward": "",
"NextMilestoneDay": 50
}
}

View File

@ -1,25 +1,25 @@
import { IGroup } from "@/src/types/loginTypes";
export const groups: IGroup[] = [
{
experiment: "InitiatePage",
experimentGroup: "initiate_page_no_video"
},
{ experiment: "ChatQAChannel", experimentGroup: "control" },
{
experiment: "MarketSearchRecommendations",
experimentGroup: "premium_credit_purchases_14_days"
},
{ experiment: "SurveyLocation", experimentGroup: "EXIT" },
{ experiment: "GamesightAB", experimentGroup: "a" }
{
experiment: "InitiatePage",
experimentGroup: "initiate_page_no_video"
},
{ experiment: "ChatQAChannel", experimentGroup: "control" },
{
experiment: "MarketSearchRecommendations",
experimentGroup: "premium_credit_purchases_14_days"
},
{ experiment: "SurveyLocation", experimentGroup: "EXIT" },
{ experiment: "GamesightAB", experimentGroup: "a" }
];
export const platformCDNs = [
"https://content.warframe.com/",
"https://content-xb1.warframe.com/",
"https://content-ps4.warframe.com/",
"https://content-swi.warframe.com/",
"https://content-mob.warframe.com/"
"https://content.warframe.com/",
"https://content-xb1.warframe.com/",
"https://content-ps4.warframe.com/",
"https://content-swi.warframe.com/",
"https://content-mob.warframe.com/"
];
export const Nonce = 1231231233;

View File

@ -1,13 +1,13 @@
{
"InventoryChanges": {
"WeaponBin": { "count": 1, "platinum": 0, "Slots": -1 },
"Suits": [
{
"ItemType": "/Lotus/Powersuits/Ninja/Ninja",
"Configs": [],
"ItemId": { "$oid": "123123123123" }
}
],
"RegularCredits": -25000
}
"InventoryChanges": {
"WeaponBin": { "count": 1, "platinum": 0, "Slots": -1 },
"Suits": [
{
"ItemType": "/Lotus/Powersuits/Ninja/Ninja",
"Configs": [],
"ItemId": { "$oid": "123123123123" }
}
],
"RegularCredits": -25000
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,113 +1,113 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* 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. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "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. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* 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. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "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. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
//"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. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "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'. */
// "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*'. */
// "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. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Language and Environment */
//"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. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "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'. */
// "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*'. */
// "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. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
//"module": "commonjs" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
// "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. */
// "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. */
// "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. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "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. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package 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. */
"resolveJsonModule": true /* Enable importing .json files. */,
// "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. */
/* Modules */
//"module": "commonjs" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
// "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. */
// "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. */
// "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. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "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. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package 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. */
"resolveJsonModule": true /* Enable importing .json files. */,
// "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. */
/* JavaScript Support */
// "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. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* JavaScript Support */
// "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. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "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. */
"outDir": "./build/" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */
// "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. */
// "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. */
// "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. */
// "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. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "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. */
"outDir": "./build/" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */
// "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. */
// "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. */
// "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. */
// "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. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "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. */
// "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. */,
// "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. */,
/* Interop Constraints */
// "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. */
// "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. */,
// "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. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"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'. */
// "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. */
// "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'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
//"noUnusedLocals": true /* Enable error reporting when local variables aren'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'. */
"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. */,
// "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. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"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'. */
// "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. */
// "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'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
//"noUnusedLocals": true /* Enable error reporting when local variables aren'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'. */
"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. */,
// "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. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"paths": {
"@/*": ["./*"]
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"paths": {
"@/*": ["./*"]
}
}
}
}