XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

fix: tutorial being skipped with skipTutorial disabled (#613)

607ec836
Sainan <sainan@calamity.inc>
提交于

代码差异

8 个文件 +41 -73
Modified config.json.example +0 -1
@@ -9,7 +9,6 @@
9 9 "httpsPort": 443,
10 10 "administratorNames": [],
11 11 "autoCreateAccount": true,
12 "skipStoryModeChoice": true,
13 12 "skipTutorial": true,
14 13 "skipAllDialogue": true,
15 14 "unlockAllScans": true,
Modified src/models/inventoryModels/inventoryModel.ts +24 -24
@@ -685,15 +685,15 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
685 685 RewardSeed: Number,
686 686
687 687 //Credit
688 RegularCredits: Number,
688 RegularCredits: { type: Number, default: 3000 },
689 689 //Platinum
690 PremiumCredits: Number,
690 PremiumCredits: { type: Number, default: 50 },
691 691 //Gift Platinum(Non trade)
692 PremiumCreditsFree: Number,
692 PremiumCreditsFree: { type: Number, default: 50 },
693 693 //Endo
694 FusionPoints: Number,
694 FusionPoints: { type: Number, default: 0 },
695 695 //Regal Aya
696 PrimeTokens: Number,
696 PrimeTokens: { type: Number, default: 0 },
697 697
698 698 //Slots
699 699 SuitBin: slotsBinSchema,
@@ -710,9 +710,9 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
710 710 CrewMemberBin: slotsBinSchema,
711 711
712 712 //How many trades do you have left
713 TradesRemaining: Number,
713 TradesRemaining: { type: Number, default: 0 },
714 714 //How many Gift do you have left*(gift spends the trade)
715 GiftsRemaining: Number,
715 GiftsRemaining: { type: Number, default: 8 },
716 716 //Curent trade info Giving or Getting items
717 717 PendingTrades: [Schema.Types.Mixed],
718 718
@@ -723,23 +723,23 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
723 723 //Syndicates Missions complate(Navigation->Syndicate)
724 724 CompletedSyndicates: [String],
725 725 //Daily Syndicates Exp
726 DailyAffiliation: Number,
727 DailyAffiliationPvp: Number,
728 DailyAffiliationLibrary: Number,
729 DailyAffiliationCetus: Number,
730 DailyAffiliationQuills: Number,
731 DailyAffiliationSolaris: Number,
732 DailyAffiliationVentkids: Number,
733 DailyAffiliationVox: Number,
734 DailyAffiliationEntrati: Number,
735 DailyAffiliationNecraloid: Number,
736 DailyAffiliationZariman: Number,
737 DailyAffiliationKahl: Number,
738 DailyAffiliationCavia: Number,
739 DailyAffiliationHex: Number,
726 DailyAffiliation: { type: Number, default: 0 },
727 DailyAffiliationPvp: { type: Number, default: 0 },
728 DailyAffiliationLibrary: { type: Number, default: 0 },
729 DailyAffiliationCetus: { type: Number, default: 0 },
730 DailyAffiliationQuills: { type: Number, default: 0 },
731 DailyAffiliationSolaris: { type: Number, default: 0 },
732 DailyAffiliationVentkids: { type: Number, default: 0 },
733 DailyAffiliationVox: { type: Number, default: 0 },
734 DailyAffiliationEntrati: { type: Number, default: 0 },
735 DailyAffiliationNecraloid: { type: Number, default: 0 },
736 DailyAffiliationZariman: { type: Number, default: 0 },
737 DailyAffiliationKahl: { type: Number, default: 0 },
738 DailyAffiliationCavia: { type: Number, default: 0 },
739 DailyAffiliationHex: { type: Number, default: 0 },
740 740
741 741 //Daily Focus limit
742 DailyFocus: Number,
742 DailyFocus: { type: Number, default: 250000 },
743 743 //Focus XP per School
744 744 FocusXP: focusXPSchema,
745 745 //Curent active like Active school focuses is = "Zenurik"
@@ -853,7 +853,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
853 853 Scoops: [EquipmentSchema],
854 854
855 855 //Mastery Rank*(Need item XPInfo to rank up)
856 PlayerLevel: Number,
856 PlayerLevel: { type: Number, default: 0 },
857 857 //Item Mastery Rank exp
858 858 XPInfo: [TypeXPItemSchema],
859 859 //Mastery Rank next availability
@@ -1027,7 +1027,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
1027 1027 Robotics: [Schema.Types.Mixed],
1028 1028 UsedDailyDeals: [Schema.Types.Mixed],
1029 1029 CollectibleSeries: [Schema.Types.Mixed],
1030 HasResetAccount: Boolean,
1030 HasResetAccount: { type: Boolean, default: false },
1031 1031
1032 1032 //Discount Coupon
1033 1033 PendingCoupon: Schema.Types.Mixed,
Modified src/services/configService.ts +0 -1
@@ -34,7 +34,6 @@ interface IConfig {
34 34 myIrcAddresses?: string[];
35 35 administratorNames?: string[];
36 36 autoCreateAccount?: boolean;
37 skipStoryModeChoice?: boolean;
38 37 skipTutorial?: boolean;
39 38 skipAllDialogue?: boolean;
40 39 unlockAllScans?: boolean;
Modified src/services/inventoryService.ts +14 -15
@@ -1,5 +1,5 @@
1 1 import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
2 import new_inventory from "@/static/fixed_responses/postTutorialInventory.json";
2 import postTutorialInventory from "@/static/fixed_responses/postTutorialInventory.json";
3 3 import { config } from "@/src/services/configService";
4 4 import { Types } from "mongoose";
5 5 import { SlotNames, IInventoryChanges, IBinChanges } from "@/src/types/purchaseTypes";
@@ -49,20 +49,19 @@ export const createInventory = async (
49 49 defaultItemReferences: { loadOutPresetId: Types.ObjectId; ship: Types.ObjectId }
50 50 ) => {
51 51 try {
52 const inventory = new Inventory({
53 ...new_inventory,
54 accountOwnerId: accountOwnerId,
55 LoadOutPresets: defaultItemReferences.loadOutPresetId,
56 Ships: [defaultItemReferences.ship]
57 });
58 if (config.skipStoryModeChoice) {
59 inventory.StoryModeChoice = "WARFRAME";
60 }
61 if (config.skipTutorial) {
62 inventory.PlayedParkourTutorial = true;
63 inventory.ReceivedStartingGear = true;
64 }
65
52 const inventory = config.skipTutorial
53 ? new Inventory({
54 accountOwnerId: accountOwnerId,
55 LoadOutPresets: defaultItemReferences.loadOutPresetId,
56 Ships: [defaultItemReferences.ship],
57 ...postTutorialInventory
58 })
59 : new Inventory({
60 accountOwnerId: accountOwnerId,
61 LoadOutPresets: defaultItemReferences.loadOutPresetId,
62 Ships: [defaultItemReferences.ship],
63 TrainingDate: 0
64 });
66 65 await inventory.save();
67 66 } catch (error) {
68 67 if (error instanceof Error) {
Modified src/types/inventoryTypes/inventoryTypes.ts +2 -2
@@ -229,7 +229,7 @@ export interface IInventoryResponse {
229 229 FocusUpgrades: IFocusUpgrade[];
230 230 OperatorAmps: IEquipmentDatabase[];
231 231 HasContributedToDojo?: boolean;
232 HWIDProtectEnabled: boolean;
232 HWIDProtectEnabled?: boolean;
233 233 KubrowPetPrints: IKubrowPetPrint[];
234 234 AlignmentReplay: IAlignment;
235 235 PersonalGoalProgress: IPersonalGoalProgress[];
@@ -284,7 +284,7 @@ export interface IInventoryResponse {
284 284 NemesisAbandonedRewards: string[];
285 285 DailyAffiliationKahl: number;
286 286 DailyAffiliationCavia: number;
287 DailyAffiliationHex?: number;
287 DailyAffiliationHex: number;
288 288 LastInventorySync: IOid;
289 289 NextRefill: IMongoDate; // Next time argon crystals will have a decay tick
290 290 FoundToday?: IMiscItem[]; // for Argon Crystals
Modified static/fixed_responses/postTutorialInventory.json +1 -25
@@ -5,35 +5,17 @@
5 5 "CrewMemberBin": { "Slots": 3 },
6 6 "CrewShipSalvageBin": { "Slots": 8 },
7 7 "DrifterMelee": [{ "ItemType": "/Lotus/Types/Friendly/PlayerControllable/Weapons/DuviriDualSwords", "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
8 "FusionPoints": 0,
9 8 "MechBin": { "Slots": 4 },
10 9 "OperatorAmpBin": { "Slots": 8 },
11 10 "PveBonusLoadoutBin": { "Slots": 0 },
12 11 "PvpBonusLoadoutBin": { "Slots": 0 },
13 12 "RandomModBin": { "Slots": 15 },
14 "RegularCredits": 3000,
15 13 "SentinelBin": { "Slots": 10 },
16 14 "SpaceSuitBin": { "Slots": 4 },
17 15 "SpaceWeaponBin": { "Slots": 4 },
18 16 "SuitBin": { "Slots": 1 },
19 17 "WeaponBin": { "Slots": 5 },
20 "DailyAffiliation": 16000,
21 "DailyAffiliationCetus": 16000,
22 "DailyAffiliationEntrati": 16000,
23 "DailyAffiliationKahl": 16000,
24 "DailyAffiliationLibrary": 16000,
25 "DailyAffiliationNecraloid": 16000,
26 "DailyAffiliationPvp": 16000,
27 "DailyAffiliationQuills": 16000,
28 "DailyAffiliationSolaris": 16000,
29 "DailyAffiliationVentkids": 16000,
30 "DailyAffiliationVox": 16000,
31 "DailyAffiliationZariman": 16000,
32 "DailyAffiliationCavia": 16000,
33 "DailyFocus": 250000,
34 18 "DuviriInfo": { "Seed": 5898912197983600352, "NumCompletions": 0 },
35 "GiftsRemaining": 8,
36 "TradesRemaining": 0,
37 19 "Recipes": [{ "ItemCount": 1, "ItemType": "/Lotus/Types/Recipes/Weapons/BoltonfaBlueprint" }],
38 20 "SeasonChallengeHistory": [
39 21 { "challenge": "SeasonDailySolveCiphers", "id": "001000220000000000000308" },
@@ -63,12 +45,10 @@
63 45 "Melee": [{ "ItemType": "/Lotus/Weapons/Tenno/Melee/LongSword/LongSword", "XP": 0, "Configs": [{}, {}, {}], "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
64 46 "Pistols": [{ "ItemType": "/Lotus/Weapons/MK1Series/MK1Kunai", "XP": 0, "Configs": [{}, {}, {}], "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
65 47 "PlayedParkourTutorial": true,
66 "PremiumCreditsFree": 50,
67 48 "QuestKeys": [{ "ItemType": "/Lotus/Types/Keys/VorsPrize/VorsPrizeQuestKeyChain" }],
68 49 "RawUpgrades": [{ "ItemCount": 1, "LastAdded": { "$oid": "6450f9bfe0714a4d6703f05f" }, "ItemType": "/Lotus/Upgrades/Mods/Warframe/AvatarShieldMaxMod" }],
69 50 "ReceivedStartingGear": true,
70 51 "Scoops": [{ "ItemType": "/Lotus/Weapons/Tenno/Speedball/SpeedballWeaponTest", "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
71 "Ships": [{ "ItemType": "/Lotus/Types/Items/Ships/DefaultShip", "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
72 52 "Suits": [{ "ItemType": "/Lotus/Powersuits/Volt/Volt", "XP": 0, "Configs": [{}, {}, {}], "UpgradeVer": 101, "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
73 53 "TrainingRetriesLeft": 0,
74 54 "WeaponSkins": [{ "ItemType": "/Lotus/Upgrades/Skins/Volt/VoltHelmet", "ItemId": { "$oid": "647bd27cf856530b4f3bf343" } }],
@@ -114,7 +94,6 @@
114 94 "KahlLoadOuts": [],
115 95 "PendingRecipes": [],
116 96 "TrainingDate": 0,
117 "PlayerLevel": 0,
118 97 "PersonalGoalProgress": [],
119 98 "PersonalTechProjects": [],
120 99 "QualifyingInvasions": [],
@@ -157,8 +136,5 @@
157 136 "RewardQuantity": 10,
158 137 "RewardStanding": 10000
159 138 },
160 "HasContributedToDojo": false,
161 "HasResetAccount": false,
162 "PendingCoupon": { "Expiry": { "$date": { "$numberLong": "0" } }, "Discount": 0 },
163 "PremiumCredits": 50
139 "PendingCoupon": { "Expiry": { "$date": { "$numberLong": "0" } }, "Discount": 0 }
164 140 }
Modified static/webui/index.html +0 -4
@@ -203,10 +203,6 @@
203 203 <p>You must be an administrator to use this feature. To become an administrator, add <code>"<span class="displayname"></span>"</code> to <code>administratorNames</code> in the config.json.</p>
204 204 </div>
205 205 <form id="server-settings" class="d-none" onsubmit="doChangeSettings();return false;">
206 <div class="form-check">
207 <input class="form-check-input" type="checkbox" id="skipStoryModeChoice" />
208 <label class="form-check-label" for="skipStoryModeChoice">Skip Story Mode Choice</label>
209 </div>
210 206 <div class="form-check">
211 207 <input class="form-check-input" type="checkbox" id="skipTutorial" />
212 208 <label class="form-check-label" for="skipTutorial">Skip Tutorial</label>
Modified static/webui/script.js +0 -1
@@ -792,7 +792,6 @@ $("#mod-to-acquire").on("input", () => {
792 792
793 793 const uiConfigs = [
794 794 "autoCreateAccount",
795 "skipStoryModeChoice",
796 795 "skipTutorial",
797 796 "skipAllDialogue",
798 797 "unlockAllScans",