Skip to content

Commit

Permalink
bump NebulaModAPI version
Browse files Browse the repository at this point in the history
  • Loading branch information
Awbugl committed Feb 18, 2024
1 parent 7f39c72 commit 7a5b189
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 34 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
- v2.9.10
+ 修复模型ID迁移导致的存档兼容问题
- v2.9.11
+ 适配NebulaMultiplayerModApi版本2.0.0

+ Fix save compatibility issue caused by model ID migration in v2.9.9
+ Adaptation of NebulaMultiplayerModApi-2.0.0


<details>
<summary>点击展开日志 | Click to view all </summary>


- v2.9.10
+ 修复模型ID迁移导致的存档兼容问题

+ Fix save compatibility issue caused by model ID migration in v2.9.9


- v2.9.9
+ 适配版本v0.10.29.21904

Expand Down
4 changes: 2 additions & 2 deletions ProjectGenesis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.17"/>
<PackageReference Include="DysonSphereProgram.Modding.CommonAPI" Version="1.6.2"/>
<PackageReference Include="DysonSphereProgram.Modding.CommonAPI" Version="1.6.4"/>
<PackageReference Include="DysonSphereProgram.Modding.DSPModSave" Version="1.2.0"/>
<PackageReference Include="DysonSphereProgram.Modding.LDBTool" Version="3.0.0"/>
<PackageReference Include="DysonSphereProgram.Modding.NebulaMultiplayerModApi" Version="1.3.1"/>
<PackageReference Include="DysonSphereProgram.Modding.NebulaMultiplayerModApi" Version="2.0.0"/>
</ItemGroup>
<ItemGroup>
<Compile Include="src\**\*.cs"/>
Expand Down
3 changes: 2 additions & 1 deletion ProjectGenesis.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LDB/@EntryIndexedValue">LDB</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LDB/@EntryIndexedValue">LDB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ZHCN/@EntryIndexedValue">ZHCN</s:String></wpf:ResourceDictionary>
Binary file modified lib/Assembly-CSharp-publicized.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions packer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.IO;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Diagnostics;
using Newtonsoft.Json;

// ReSharper disable LoopCanBePartlyConvertedToQuery
Expand Down Expand Up @@ -51,6 +51,6 @@ public class ManifestObject
public string Description { get; set; } = "构建真实宇宙,撰写创世之书。Construct Real Universe. Then leave a GenesisBook. An overhaul mod.";

[JsonProperty("dependencies")]
public string[] Dependencies { get; set; } = new[] { "CommonAPI-CommonAPI-1.6.4", "nebula-NebulaMultiplayerModApi-1.3.1" };
public string[] Dependencies { get; set; } = { "CommonAPI-CommonAPI-1.6.4", "nebula-NebulaMultiplayerModApi-2.0.0" };
}
}
1 change: 0 additions & 1 deletion src/Patches/Logic/MegaAssembler/MegaAssemblerPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Reflection.Emit;
using HarmonyLib;
using ProjectGenesis.Utils;
using ERecipeType_1 = ERecipeType;

// ReSharper disable InconsistentNaming

Expand Down
1 change: 0 additions & 1 deletion src/Patches/Logic/MegaAssembler/UIRecipePickerPatches.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Reflection.Emit;
using HarmonyLib;
using ERecipeType_1 = ERecipeType;

// ReSharper disable InconsistentNaming

Expand Down
2 changes: 1 addition & 1 deletion src/Patches/UI/ChemicalRecipeFcolPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace ProjectGenesis.Patches.UI
{
public static class ChemicalRecipeFcolPatches
{
private static readonly Dictionary<int, int> RecipeIdPos = new Dictionary<int, int>()
private static readonly Dictionary<int, int> RecipeIdPos = new Dictionary<int, int>
{
{ ProtoID.R二氧化碳, 431 },
{ ProtoID.R催化重整, 432 },
Expand Down
1 change: 0 additions & 1 deletion src/Patches/UI/QTools/ProductDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using ProjectGenesis.Utils;
using UnityEngine;
using UnityEngine.UI;
using ERecipeType_1 = ERecipeType;
using ProjectGenesis_Utils_ERecipeType = ProjectGenesis.Utils.ERecipeType;
using Utils_ERecipeType = ProjectGenesis.Utils.ERecipeType;

Expand Down
1 change: 0 additions & 1 deletion src/Patches/UI/UITechNodePatches.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using HarmonyLib;
using UnityEngine;
using ERecipeType_1 = ERecipeType;

// ReSharper disable InconsistentNaming

Expand Down
4 changes: 2 additions & 2 deletions src/Patches/UI/UpdateLogoPatches.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HarmonyLib;
using System;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;
using System;

// ReSharper disable InconsistentNaming

Expand Down
4 changes: 2 additions & 2 deletions src/ProjectGenesis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using crecheng.DSPModSave;
using HarmonyLib;
using NebulaAPI;
using NebulaAPI.Interfaces;
using ProjectGenesis.Compatibility;
using ProjectGenesis.Patches.Logic;
using ProjectGenesis.Patches.Logic.AddVein;
Expand All @@ -22,7 +23,6 @@
using ProjectGenesis.Utils;
using UnityEngine;
using xiaoye97;
using ERecipeType_1 = ERecipeType;
using static ProjectGenesis.Utils.JsonDataUtils;
using static ProjectGenesis.Utils.CopyModelUtils;
using static ProjectGenesis.Utils.TranslateUtils;
Expand Down Expand Up @@ -52,7 +52,7 @@ public class ProjectGenesis : BaseUnityPlugin, IModCanSave, IMultiplayerMod
{
public const string MODGUID = "org.LoShin.GenesisBook";
public const string MODNAME = "GenesisBook";
public const string VERSION = "2.9.10";
public const string VERSION = "2.9.11";
public const string DEBUGVERSION = "";

public static bool LoadCompleted;
Expand Down
29 changes: 15 additions & 14 deletions src/Utils/JsonDataUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using UnityEngine;
using xiaoye97;
using static ProjectGenesis.Utils.JsonHelper;
using ERecipeType_1 = ERecipeType;

// ReSharper disable RemoveRedundantBraces

Expand All @@ -16,9 +15,10 @@ internal static class JsonDataUtils
internal static void ImportJson(int[] tableID)
{
ref Dictionary<int, IconToolNew.IconDesc> itemIconDescs
= ref AccessTools.StaticFieldRefAccess<Dictionary<int, IconToolNew.IconDesc>>(typeof(ProtoRegistry), "itemIconDescs");
= ref AccessTools.StaticFieldRefAccess<Dictionary<int, IconToolNew.IconDesc>>(typeof(ProtoRegistry),
"itemIconDescs");

#region TechProto
#region TechProto

foreach (TechProtoJson techjson in TechProtos())
{
Expand All @@ -32,9 +32,9 @@ internal static void ImportJson(int[] tableID)
}
}

#endregion
#endregion

#region Mod ItemProto
#region Mod ItemProto

foreach (ItemProtoJson itemjson in ItemModProtos())
{
Expand All @@ -43,21 +43,22 @@ internal static void ImportJson(int[] tableID)
LDBTool.PreAddProto(itemjson.ToProto());
}

#endregion
#endregion

#region Vanilla ItemProto
#region Vanilla ItemProto

foreach (ItemProtoJson itemjson in ItemVanillaProtos())
{
itemjson.GridIndex = GetTableID(itemjson.GridIndex);
ItemProto proto = LDB.items.Select(itemjson.ID);
if (proto.IconPath != itemjson.IconPath) itemIconDescs.Add(itemjson.ID, IconDescUtils.GetIconDesc(itemjson.ID));
if (proto.IconPath != itemjson.IconPath)
itemIconDescs.Add(itemjson.ID, IconDescUtils.GetIconDesc(itemjson.ID));
itemjson.ToProto(proto);
}

#endregion
#endregion

#region RecipeProto
#region RecipeProto

foreach (RecipeProtoJson recipeJson in RecipeProtos())
{
Expand All @@ -73,9 +74,9 @@ internal static void ImportJson(int[] tableID)
}
}

#endregion
#endregion

#region TutorialProto
#region TutorialProto

TutorialProtoJson[] tutorialProtos = TutorialProtos();

Expand All @@ -84,7 +85,7 @@ internal static void ImportJson(int[] tableID)
LDBTool.PreAddProto(json.ToProto());
}

#endregion
#endregion

int GetTableID(int gridIndex)
{
Expand Down Expand Up @@ -120,4 +121,4 @@ internal static void ModifyUpgradeTech()
}
}
}
}
}
6 changes: 4 additions & 2 deletions src/Utils/MutliPlayerPacket.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System.Collections.Generic;
using System.IO;
using NebulaAPI;
using NebulaAPI.Interfaces;
using NebulaAPI.Networking;
using NebulaAPI.Packets;
using ProjectGenesis.Patches.Logic;
using ProjectGenesis.Patches.Logic.MegaAssembler;
using ProjectGenesis.Patches.Logic.PlanetFocus;
Expand Down Expand Up @@ -299,8 +302,7 @@ public override void ProcessPacket(GenesisBookPlanetData packet, INebulaConnecti
public static void ProcessBytesLater(int planetId)
{
if (!NebulaModAPI.IsMultiplayerActive || NebulaModAPI.MultiplayerSession.LocalPlayer.IsHost) return;
if (!PendingData.TryGetValue(planetId, out byte[] bytes)) return;
PendingData.Remove(planetId);
if (!PendingData.Remove(planetId, out byte[] bytes)) return;

using (IReaderProvider p = NebulaModAPI.GetBinaryReader(bytes))
{
Expand Down

0 comments on commit 7a5b189

Please sign in to comment.