forked from OpenWF/SpaceNinjaServer
Compare commits
4 Commits
541ec3d702
...
9286627668
Author | SHA1 | Date | |
---|---|---|---|
9286627668 | |||
f94f2005d3 | |||
9901b7af54 | |||
2fa846f465 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
||||
with:
|
||||
node-version: ">=20.6.0"
|
||||
- run: npm ci
|
||||
- run: cp config.json.example config.json
|
||||
- run: cp config-vanilla.json config.json
|
||||
- run: npm run verify
|
||||
- run: npm run lint:ci
|
||||
- run: npm run prettier
|
||||
|
@ -2,4 +2,4 @@ src/routes/api.ts
|
||||
static/webui/libs/
|
||||
*.html
|
||||
*.md
|
||||
config.json.example
|
||||
config-vanilla.json
|
||||
|
@ -10,7 +10,7 @@ To get an idea of what functionality you can expect to be missing [have a look t
|
||||
|
||||
## config.json
|
||||
|
||||
SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [config.json.example](config.json.example), which has most cheats disabled.
|
||||
SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [config-vanilla.json](config-vanilla.json), which has most cheats disabled.
|
||||
|
||||
- `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
|
||||
- `myIrcAddresses` can be used to point to an IRC server. If not provided, defaults to `[ myAddress ]`.
|
||||
|
@ -71,8 +71,8 @@
|
||||
"affinityBoost": false,
|
||||
"resourceBoost": false,
|
||||
"tennoLiveRelay": false,
|
||||
"starDays": true,
|
||||
"galleonOfGhouls": 0,
|
||||
"starDaysOverride": null,
|
||||
"eidolonOverride": "",
|
||||
"vallisOverride": "",
|
||||
"duviriOverride": "",
|
@ -2,7 +2,7 @@
|
||||
set -e
|
||||
|
||||
if [ ! -f conf/config.json ]; then
|
||||
jq --arg value "mongodb://openwfagent:spaceninjaserver@mongodb:27017/" '.mongodbUrl = $value' /app/config.json.example > /app/conf/config.json
|
||||
jq --arg value "mongodb://openwfagent:spaceninjaserver@mongodb:27017/" '.mongodbUrl = $value' /app/config-vanilla.json > /app/conf/config.json
|
||||
fi
|
||||
|
||||
exec npm run start -- --configPath conf/config.json
|
||||
|
@ -7,7 +7,7 @@ try {
|
||||
if (fs.existsSync("config.json")) {
|
||||
console.log("Failed to load " + configPath + ": " + (e as Error).message);
|
||||
} else {
|
||||
console.log("Failed to load " + configPath + ". You can copy config.json.example to create your config file.");
|
||||
console.log("Failed to load " + configPath + ". You can copy config-vanilla.json to create your config file.");
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ export interface IConfig {
|
||||
affinityBoost?: boolean;
|
||||
resourceBoost?: boolean;
|
||||
tennoLiveRelay?: boolean;
|
||||
starDays?: boolean;
|
||||
galleonOfGhouls?: number;
|
||||
starDaysOverride?: boolean;
|
||||
eidolonOverride?: string;
|
||||
vallisOverride?: string;
|
||||
duviriOverride?: string;
|
||||
|
@ -1349,6 +1349,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
|
||||
const week = Math.trunc(day / 7);
|
||||
const weekStart = EPOCH + week * 604800000;
|
||||
const weekEnd = weekStart + 604800000;
|
||||
const date = new Date(timeMs);
|
||||
|
||||
const worldState: IWorldState = {
|
||||
BuildLabel: typeof buildLabel == "string" ? buildLabel.split(" ").join("+") : buildConfig.buildLabel,
|
||||
@ -1401,11 +1402,24 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
|
||||
Node: "TennoConBHUB6"
|
||||
});
|
||||
}
|
||||
if (config.worldState?.starDays) {
|
||||
const isFebruary = date.getUTCMonth() == 1;
|
||||
if (config.worldState?.starDaysOverride ?? isFebruary) {
|
||||
worldState.Goals.push({
|
||||
_id: { $oid: "67a4dcce2a198564d62e1647" },
|
||||
Activation: { $date: { $numberLong: "1738868400000" } },
|
||||
Expiry: { $date: { $numberLong: "2000000000000" } },
|
||||
Activation: {
|
||||
$date: {
|
||||
$numberLong: config.worldState?.starDaysOverride
|
||||
? "1738868400000"
|
||||
: Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1).toString()
|
||||
}
|
||||
},
|
||||
Expiry: {
|
||||
$date: {
|
||||
$numberLong: config.worldState?.starDaysOverride
|
||||
? "2000000000000"
|
||||
: Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 1).toString()
|
||||
}
|
||||
},
|
||||
Count: 0,
|
||||
Goal: 0,
|
||||
Success: 0,
|
||||
|
@ -431,7 +431,7 @@
|
||||
{ "ItemType": "/Lotus/StoreItems/Types/Items/SongItems/KuvaLichLoginSongItem", "PrimePrice": 140, "RegularPrice": 170000 },
|
||||
{ "ItemType": "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyBaro", "PrimePrice": 100, "RegularPrice": 125000 },
|
||||
{ "ItemType": "/Lotus/StoreItems/Types/Items/ShipDecos/Plushies/PlushyInaros", "PrimePrice": 120, "RegularPrice": 90000 },
|
||||
{ "ItemType": "/Lotus/Upgrades/Mods/Pistol/Expert/WeaponPistolFactionDamageMurmursExpert", "PrimePrice": 375, "RegularPrice": 130000 }
|
||||
{ "ItemType": "/Lotus/StoreItems/Upgrades/Mods/Pistol/Expert/WeaponPistolFactionDamageMurmursExpert", "PrimePrice": 375, "RegularPrice": 130000 }
|
||||
],
|
||||
"allIfAny": [
|
||||
[
|
||||
|
@ -929,10 +929,6 @@
|
||||
<input class="form-check-input" type="checkbox" id="worldState.tennoLiveRelay" />
|
||||
<label class="form-check-label" for="worldState.tennoLiveRelay" data-loc="worldState_tennoLiveRelay"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="worldState.starDays" />
|
||||
<label class="form-check-label" for="worldState.starDays" data-loc="worldState_starDays"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="worldState.varziaFullyStocked" />
|
||||
<label class="form-check-label" for="worldState.varziaFullyStocked" data-loc="worldState_varziaFullyStocked"></label>
|
||||
@ -946,6 +942,14 @@
|
||||
<option value="3" data-loc="worldState_we3"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label class="form-label" for="worldState.starDaysOverride" data-loc="worldState_starDays"></label>
|
||||
<select class="form-control" id="worldState.starDaysOverride" data-default="null">
|
||||
<option value="null" data-loc="normal"></option>
|
||||
<option value="true" data-loc="enabled"></option>
|
||||
<option value="false" data-loc="disabled"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group mt-2">
|
||||
<label class="form-label" for="worldState.eidolonOverride" data-loc="worldState_eidolonOverride"></label>
|
||||
<select class="form-control" id="worldState.eidolonOverride" data-default="">
|
||||
|
@ -2098,7 +2098,13 @@ for (const id of uiConfigs) {
|
||||
if (elm.tagName == "SELECT") {
|
||||
elm.onchange = function () {
|
||||
let value = this.value;
|
||||
if (!isNaN(parseInt(value))) {
|
||||
if (value == "true") {
|
||||
value = true;
|
||||
} else if (value == "false") {
|
||||
value = false;
|
||||
} else if (value == "null") {
|
||||
value = null;
|
||||
} else if (!isNaN(parseInt(value))) {
|
||||
value = parseInt(value);
|
||||
}
|
||||
$.post({
|
||||
|
@ -245,6 +245,7 @@ dict = {
|
||||
worldState_tennoLiveRelay: `[UNTRANSLATED] TennoLive Relay`,
|
||||
worldState_starDays: `Sternen-Tage`,
|
||||
worldState_galleonOfGhouls: `Galeone der Ghule`,
|
||||
enabled: `[UNTRANSLATED] Enabled`,
|
||||
disabled: `Deaktiviert`,
|
||||
worldState_we1: `Wochenende 1`,
|
||||
worldState_we2: `Wochenende 2`,
|
||||
|
@ -244,6 +244,7 @@ dict = {
|
||||
worldState_tennoLiveRelay: `TennoLive Relay`,
|
||||
worldState_starDays: `Star Days`,
|
||||
worldState_galleonOfGhouls: `Galleon of Ghouls`,
|
||||
enabled: `Enabled`,
|
||||
disabled: `Disabled`,
|
||||
worldState_we1: `Weekend 1`,
|
||||
worldState_we2: `Weekend 2`,
|
||||
|
@ -245,6 +245,7 @@ dict = {
|
||||
worldState_tennoLiveRelay: `[UNTRANSLATED] TennoLive Relay`,
|
||||
worldState_starDays: `Días estelares`,
|
||||
worldState_galleonOfGhouls: `Galeón de Gules`,
|
||||
enabled: `[UNTRANSLATED] Enabled`,
|
||||
disabled: `Desactivado`,
|
||||
worldState_we1: `Semana 1`,
|
||||
worldState_we2: `Semana 2`,
|
||||
|
@ -245,6 +245,7 @@ dict = {
|
||||
worldState_tennoLiveRelay: `[UNTRANSLATED] TennoLive Relay`,
|
||||
worldState_starDays: `Jours Stellaires`,
|
||||
worldState_galleonOfGhouls: `Galion des Goules`,
|
||||
enabled: `[UNTRANSLATED] Enabled`,
|
||||
disabled: `Désactivé`,
|
||||
worldState_we1: `Weekend 1`,
|
||||
worldState_we2: `Weekend 2`,
|
||||
|
@ -245,6 +245,7 @@ dict = {
|
||||
worldState_tennoLiveRelay: `[UNTRANSLATED] TennoLive Relay`,
|
||||
worldState_starDays: `[UNTRANSLATED] Star Days`,
|
||||
worldState_galleonOfGhouls: `[UNTRANSLATED] Galleon of Ghouls`,
|
||||
enabled: `[UNTRANSLATED] Enabled`,
|
||||
disabled: `[UNTRANSLATED] Disabled`,
|
||||
worldState_we1: `[UNTRANSLATED] Weekend 1`,
|
||||
worldState_we2: `[UNTRANSLATED] Weekend 2`,
|
||||
|
@ -242,9 +242,10 @@ dict = {
|
||||
worldState_creditBoost: `现金加成`,
|
||||
worldState_affinityBoost: `经验加成`,
|
||||
worldState_resourceBoost: `资源加成`,
|
||||
worldState_tennoLiveRelay: `[UNTRANSLATED] TennoLive Relay`,
|
||||
worldState_tennoLiveRelay: `TennoLive 中继站`,
|
||||
worldState_starDays: `活动:星日`,
|
||||
worldState_galleonOfGhouls: `战术警报:尸鬼的帆船战舰`,
|
||||
enabled: `[UNTRANSLATED] Enabled`,
|
||||
disabled: `关闭/取消配置`,
|
||||
worldState_we1: `活动阶段:第一周`,
|
||||
worldState_we2: `活动阶段:第二周`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user