internal static PlayerState Parse(BinaryReader reader) { var result = new PlayerState { UnknownInt1 = reader.ReadUInt32(), // 3, 4, 1, 6, 8, 9, 10, 2, UnknownBool1 = reader.ReadBooleanChecked(), // 1, 1, 1, 1, 1, 1, 1, 1, UnknownBool2 = reader.ReadBooleanChecked(), // 1, 1, 2, 3, 3, 3, 3, 1, UnknownBool3 = reader.ReadBooleanChecked(), // 0, 0, 0, 0, 0, 0, 0, 0, ScienceRank = reader.ReadBytePrefixedAsciiString(), Unknown1 = reader.ReadUInt32(), // 1 Unknown2 = reader.ReadUInt32(), // 2 Unknown3 = reader.ReadUInt32(), // 1 Unknown4 = reader.ReadUInt32(), // 800 Unknown5 = reader.ReadUInt32(), // 0 Name = reader.ReadBytePrefixedUnicodeString(), UnknownBool4 = reader.ReadBooleanChecked(), MaybePlayerId = reader.ReadByte(), //UnknownBytes = reader.ReadBytes(588) }; var numBuildListItems = reader.ReadUInt16(); var buildListItems = new BuildListItem[numBuildListItems]; for (var i = 0; i < numBuildListItems; i++) { buildListItems[i] = new BuildListItem(); buildListItems[i].ReadFromSaveFile(reader); } return(result); }
public override void OnEncodeToConfigNode() { VABBuildList.Clear(); SPHBuildList.Clear(); VABWarehouse.Clear(); SPHWarehouse.Clear(); foreach (KCT_BuildListVessel b in KCT_GameStates.VABList) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN VABList"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); VABBuildList.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.SPHList) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN SPHList"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); SPHBuildList.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.VABWarehouse) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN VABWarehouse"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); VABWarehouse.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.SPHWarehouse) { if (b.shipNode == null) { Debug.LogError("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN SPHWarehouse"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); SPHWarehouse.Add(bls); } LPRecon = KCT_GameStates.LaunchPadReconditioning; }
public override void OnEncodeToConfigNode() { VABBuildList.Clear(); SPHBuildList.Clear(); VABWarehouse.Clear(); SPHWarehouse.Clear(); foreach (KCT_BuildListVessel b in KCT_GameStates.VABList) { if (b.shipNode == null) { Debug.Log("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN VABList"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); VABBuildList.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.SPHList) { if (b.shipNode == null) { Debug.Log("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN SPHList"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); SPHBuildList.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.VABWarehouse) { if (b.shipNode == null) { Debug.Log("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN VABWarehouse"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); VABWarehouse.Add(bls); } foreach (KCT_BuildListVessel b in KCT_GameStates.SPHWarehouse) { if (b.shipNode == null) { Debug.Log("[KCT] WARNING! DATA LOSS EVENT ON " + b.shipName + " IN SPHWarehouse"); continue; } BuildListItem bls = new BuildListItem(); bls.FromBuildListVessel(b); SPHWarehouse.Add(bls); } }