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