Compare commits

...

9 Commits

Author SHA1 Message Date
a5d74b92c8 feat(import): Consumables (#895)
Closes #894

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/895
2025-02-04 09:19:14 -08:00
f15f2bfdbd chore: update favicon (#896)
This change is paired with a change in the bootstrapper to make the icons all unique and somewhat resembling their part in the whole.

![image.webp](/attachments/b30a31d9-15bd-4933-93cb-a409a9c91159)

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/896
Co-authored-by: Sainan <sainan@calamity.inc>
Co-committed-by: Sainan <sainan@calamity.inc>
2025-02-04 06:39:28 -08:00
c1fcd3042e feat(webui): ensure forma count of at least 5 when max ranking item (#893)
Closes #889

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/893
2025-02-04 03:22:37 -08:00
fb232f74bd feat: acquiring CrewShipHarness with CrewShip (#888)
Closes #886

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/888
Reviewed-by: Sainan <sainan@calamity.inc>
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
2025-02-04 02:29:23 -08:00
c267ce47c3 update docker-compose.yml 2025-02-03 22:55:26 +01:00
3537c7e436 add docker workflow using docker hub as remote 2025-02-03 22:50:35 +01:00
3b3edaced4 fix: universalPolarityEverywhere not affecting all necramech slots (#891)
Fixes #890

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/891
2025-02-03 13:21:12 -08:00
e46b3c7d29 chore: use mongoose's 'id' function in addGearExpByCategory (#892)
Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/892
2025-02-03 13:20:56 -08:00
241f0c894a chore(webui): remove client cheats (#883)
This has long been only a very small subset of what the bootstrapper offers. I think it's better that the bootstrapper itself provides the interface for it and we don't duplicate the logic so shallowly.

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/883
2025-02-03 12:10:36 -08:00
9 changed files with 62 additions and 59 deletions

24
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: Build Docker image
on:
push:
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Log in to container registry
uses: docker/login-action@v3
with:
username: openwf
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
openwf/spaceninjaserver:latest
openwf/spaceninjaserver:${{ github.sha }}

View File

@ -1,7 +1,7 @@
services: services:
openwf: spaceninjaserver:
# build: . # build: .
image: ghcr.io/spaceninjaserver/SpaceNinjaServer:latest image: openwf/spaceninjaserver:latest
environment: environment:
APP_MONGODB_URL: mongodb://openwfagent:spaceninjaserver@mongodb:27017/ APP_MONGODB_URL: mongodb://openwfagent:spaceninjaserver@mongodb:27017/

View File

@ -195,7 +195,7 @@ export const getInventoryResponse = async (
if (config.universalPolarityEverywhere) { if (config.universalPolarityEverywhere) {
const Polarity: IPolarity[] = []; const Polarity: IPolarity[] = [];
for (let i = 0; i != 10; ++i) { for (let i = 0; i != 12; ++i) {
Polarity.push({ Polarity.push({
Slot: i, Slot: i,
Value: ArtifactPolarity.Any Value: ArtifactPolarity.Any

View File

@ -3,12 +3,23 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes"; import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes"; import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
import { RequestHandler } from "express"; import { RequestHandler } from "express";
import { ExportMisc } from "warframe-public-export-plus";
export const addXpController: RequestHandler = async (req, res) => { export const addXpController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId);
const request = req.body as IAddXpRequest; const request = req.body as IAddXpRequest;
for (const [category, gear] of Object.entries(request)) { for (const [category, gear] of Object.entries(request)) {
for (const clientItem of gear) {
const dbItem = inventory[category as TEquipmentKey].id(clientItem.ItemId.$oid);
if (dbItem) {
if (dbItem.ItemType in ExportMisc.uniqueLevelCaps) {
if ((dbItem.Polarized ?? 0) < 5) {
dbItem.Polarized = 5;
}
}
}
}
addGearExpByCategory(inventory, gear, category as TEquipmentKey); addGearExpByCategory(inventory, gear, category as TEquipmentKey);
} }
await inventory.save(); await inventory.save();

View File

@ -155,7 +155,7 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
if (client.Upgrades !== undefined) { if (client.Upgrades !== undefined) {
replaceArray<IUpgradeDatabase>(db.Upgrades, client.Upgrades.map(convertUpgrade)); replaceArray<IUpgradeDatabase>(db.Upgrades, client.Upgrades.map(convertUpgrade));
} }
for (const key of ["RawUpgrades", "MiscItems"] as const) { for (const key of ["RawUpgrades", "MiscItems", "Consumables"] as const) {
if (client[key] !== undefined) { if (client[key] !== undefined) {
db[key].splice(0, db[key].length); db[key].splice(0, db[key].length);
client[key].forEach(x => { client[key].forEach(x => {

View File

@ -240,7 +240,14 @@ export const addItem = async (
} }
}; };
} else if (ExportResources[typeName].productCategory == "CrewShips") { } else if (ExportResources[typeName].productCategory == "CrewShips") {
const inventoryChanges = addCrewShip(inventory, typeName); const inventoryChanges = {
...addCrewShip(inventory, typeName),
// fix to unlock railjack modding, item bellow supposed to be obtained from archwing quest
...(!inventory.CrewShipHarnesses?.length
? addCrewShipHarness(inventory, "/Lotus/Types/Game/CrewShip/RailJack/DefaultHarness")
: {})
};
return { InventoryChanges: inventoryChanges }; return { InventoryChanges: inventoryChanges };
} else if (ExportResources[typeName].productCategory == "ShipDecorations") { } else if (ExportResources[typeName].productCategory == "ShipDecorations") {
const changes = [ const changes = [
@ -810,6 +817,17 @@ const addCrewShip = (
return inventoryChanges; return inventoryChanges;
}; };
const addCrewShipHarness = (
inventory: TInventoryDatabaseDocument,
typeName: string,
inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => {
const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1;
inventoryChanges.CrewShipHarnesses ??= [];
(inventoryChanges.CrewShipHarnesses as object[]).push(inventory.CrewShipHarnesses[index].toJSON());
return inventoryChanges;
};
//TODO: wrong id is not erroring //TODO: wrong id is not erroring
export const addGearExpByCategory = ( export const addGearExpByCategory = (
inventory: TInventoryDatabaseDocument, inventory: TInventoryDatabaseDocument,
@ -823,12 +841,10 @@ export const addGearExpByCategory = (
return; return;
} }
const itemIndex = ItemId ? category.findIndex(item => item._id?.equals(ItemId.$oid)) : -1; const item = category.id(ItemId.$oid);
if (itemIndex !== -1) { if (item) {
const item = category[itemIndex];
item.XP ??= 0; item.XP ??= 0;
item.XP += XP; item.XP += XP;
inventory.markModified(`${categoryName}.${itemIndex}.XP`);
const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == item.ItemType); const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == item.ItemType);
if (xpinfoIndex !== -1) { if (xpinfoIndex !== -1) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -368,7 +368,7 @@
</div> </div>
<div data-route="/webui/cheats, /webui/settings" data-title="Cheats | OpenWF WebUI"> <div data-route="/webui/cheats, /webui/settings" data-title="Cheats | OpenWF WebUI">
<div class="row g-3"> <div class="row g-3">
<div class="col-lg-4"> <div class="col-md-6">
<div class="card mb-3"> <div class="card mb-3">
<h5 class="card-header">Server</h5> <h5 class="card-header">Server</h5>
<div class="card-body"> <div class="card-body">
@ -479,7 +479,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-lg-4"> <div class="col-md-6">
<div class="card mb-3"> <div class="card mb-3">
<h5 class="card-header">Account</h5> <h5 class="card-header">Account</h5>
<div class="card-body"> <div class="card-body">
@ -488,26 +488,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-lg-4">
<div class="card mb-3">
<h5 class="card-header">Client</h5>
<div id="client-cheats-nok" class="card-body">
Client cheats are currently unavailable. This could be because your client is not running or using a DLL without an HTTP interface.
</div>
<div id="client-cheats-ok" class="card-body d-none">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="skip_mission_start_timer" />
<label class="form-check-label" for="skip_mission_start_timer">
Skip Mission Start Timer
</label>
</div>
<div class="form-group mt-3">
<label class="form-label" for="fov_override">FOV Override (0 to disable)</label>
<input id="fov_override" class="form-range" type="range" min="0" value="0" max="2260000" step="10000">
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<div data-route="/webui/import" data-title="Import | OpenWF WebUI"> <div data-route="/webui/import" data-title="Import | OpenWF WebUI">

View File

@ -915,34 +915,6 @@ single.getRoute("/webui/cheats").on("beforeload", function () {
}); });
} }
}, 10); }, 10);
fetch("http://localhost:61558/ping", { mode: "no-cors" })
.then(() => {
$("#client-cheats-ok").removeClass("d-none");
$("#client-cheats-nok").addClass("d-none");
fetch("http://localhost:61558/skip_mission_start_timer")
.then(res => res.text())
.then(res => {
document.getElementById("skip_mission_start_timer").checked = res == "1";
});
document.getElementById("skip_mission_start_timer").onchange = function () {
fetch("http://localhost:61558/skip_mission_start_timer?" + this.checked);
};
fetch("http://localhost:61558/fov_override")
.then(res => res.text())
.then(res => {
document.getElementById("fov_override").value = parseFloat(res) * 10000;
});
document.getElementById("fov_override").oninput = function () {
fetch("http://localhost:61558/fov_override?" + this.value);
};
})
.catch(function () {
$("#client-cheats-nok").removeClass("d-none");
$("#client-cheats-ok").addClass("d-none");
});
}); });
function doUnlockAllFocusSchools() { function doUnlockAllFocusSchools() {