Project

General

Profile

Bug #25764

UpgradePipeline Not Reading Newest File Version?

Added by DRVeyl over 4 years ago. Updated over 4 years ago.

Status:
New
Severity:
Low
Assignee:
-
Category:
File System
Target version:
-
Start date:
07/12/2020
% Done:

0%

Version:
Platform:
Linux
Expansion:
Core Game
Language:
English (US)
Mod Related:
Yes
Votes:
Arrow u r green
Arrow d r red

Description

Implementing an `UpgradeScript` for .craft files. The script updates some PartModule ConfigNodes and deletes others. Appears to work correctly in a Windows environment, but in a Linux environment the changes are written to the .craft file but not applied during the craft load when the UpgradeScript runs. The ConfigNode passed to the PartModule's OnLoad(ConfigNode node) method is from before the UpgradeScript's changes were applied.

Immediately loading the .craft file again resolves the issue -- assuming a player does not save the craft in the un-updated state.

Log excerpt, showing OS and KSP version, triggers for the Upgrade Pipeline, debug statement of the resulting ConfigNode after upgrading, and debug statement of the ConfigNode as seen by the PartModule's OnLoad method. Full log and example craft files attached.

--

[LOG 18:42:07.354] *** Log Initiated for Kerbal Space Program - 1.10.0.2917 (LinuxPlayer) en-us ***
Kerbal Space Program - 1.10.0.2917 (LinuxPlayer) en-us

OS: Linux 5.4 Linuxmint 20 64bit
...
[LOG 18:44:48.952] [PF] UpgradePipeline OnTest() context Craft for KzInterstageAdapter2_4294542018. Upgrade requested: Upgradeable
[LOG 18:44:48.952] [PF] UpgradePipeline OnTest() context Craft for KzProcFairingSide2_4294543114. Upgrade requested: Pass
[LOG 18:44:48.952] [PF] UpgradePipeline OnTest() context Craft for KzResizableFairingBase_4294544232. Upgrade requested: Upgradeable
...

[LOG 18:44:48.958] [PF] Updated ProceduralFairingBase with Adapter data to MODULE
{
    name = ProceduralFairingBase
    isEnabled = True
    extraRadius = 0
    autoStrutSides = True
    autoShape = True
    manualMaxSize = 1.14999998
    manualCylStart = 0
    manualCylEnd = 2
    stagingEnabled = True
    baseSize = 1.25
    topSize = 1.25
    height = 2
    extraHeight = 0
    autoDecoupleTopNode = False
    mode = Adapter
    EVENTS
    {
    }
    ACTIONS
    {
    }
    UPGRADESAPPLIED
    {
    }
}

...
[ERR 18:44:49.033] [PF] OnLoad did not find mode param, requesting legacy load.  ConfigNode= MODULE
{
    name = ProceduralFairingBase
    isEnabled = True
    extraRadius = 0
    autoStrutSides = True
    autoShape = True
    manualMaxSize = 1.14999998
    manualCylStart = 0
    manualCylEnd = 2
    stagingEnabled = True
    EVENTS
    {
    }
    ACTIONS
    {
    }
    UPGRADESAPPLIED
    {
    }
}

Untitled_Space_Craft.craft (1).original (27.6 KB) Untitled_Space_Craft.craft (1).original Original craft file DRVeyl, 07/12/2020 07:40 PM
Untitled_Space_Craft (1).craft (27.4 KB) Untitled_Space_Craft (1).craft Craft file after Upgrade Pipeline DRVeyl, 07/12/2020 07:40 PM
KSP.zip (55.7 KB) KSP.zip zip of KSP.log DRVeyl, 07/12/2020 07:43 PM

History

#1 Updated by DRVeyl over 4 years ago

Also available in: Atom PDF