Skip to content

Commit d76ed4b

Browse files
authored
Merge pull request #731 from starfi5h/pr-update
Nebula 0.9.17 for DSP 0.10.32.25779 Update
2 parents 419394d + eefaa47 commit d76ed4b

File tree

12 files changed

+52
-28
lines changed

12 files changed

+52
-28
lines changed

.github/scripts/thunderstore_bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function generateManifest() {
123123
BEPINEX_DEPENDENCY,
124124
`nebula-${apiPluginInfo.name}-${apiPluginInfo.version}`,
125125
"PhantomGamers-IlLine-1.0.0",
126-
"starfi5h-BulletTime-1.5.5",
126+
"starfi5h-BulletTime-1.5.8",
127127
],
128128
website_url: "https://github.com/hubastard/nebula"
129129
};

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Changelog
22

3+
0.9.17:
4+
- Compatible with game version 0.10.32.25779
5+
36
0.9.16:
47
- Compatible with game version 0.10.32.25682
58

NebulaNetwork/PacketProcessors/Factory/Foundation/FoundationBlueprintPasteProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static void UpdateGeothermalStrength(PlanetFactory factory)
137137
ref PowerGeneratorComponent generator = ref generatorPool[generatorIndex];
138138
if (generator.id == generatorIndex && generator.geothermal && generator.entityId > 0)
139139
{
140-
generator.gthStrength = powerSystem.CalculateGeothermalStrenth(
140+
generator.gthStrength = powerSystem.CalculateGeothermalStrength(
141141
entityPool[generator.entityId].pos,
142142
entityPool[generator.entityId].rot,
143143
generator.baseRuinId

NebulaNetwork/PacketProcessors/Planet/PlanetDataRequestProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private static byte[] PlanetCompute(int planetId)
6969
planetAlgorithm.GenerateVegetables();
7070
planetAlgorithm.GenerateVeins();
7171
}
72-
planet.CalculateVeinGroups();
72+
planet.SummarizeVeinGroups();
7373
}
7474

7575
byte[] data;

NebulaNetwork/PacketProcessors/Planet/PlanetDetailRequestProcessor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ protected override void ProcessPacket(PlanetDetailRequest packet, NebulaConnecti
2222
return;
2323
}
2424
var planetData = GameMain.galaxy.PlanetById(packet.PlanetID);
25-
if (!planetData.calculated)
25+
if (!planetData.scanned)
2626
{
27-
planetData.calculating = true;
27+
planetData.scanning = true;
2828
Task.Run(() =>
2929
{
3030
try
@@ -44,9 +44,9 @@ protected override void ProcessPacket(PlanetDetailRequest packet, NebulaConnecti
4444
planetAlgorithm.GenerateVegetables();
4545
planetAlgorithm.GenerateVeins();
4646
}
47-
planetData.CalculateVeinGroups();
47+
planetData.SummarizeVeinGroups();
4848
planetData.GenBirthPoints();
49-
planetData.NotifyCalculated();
49+
planetData.NotifyScanEnded();
5050
conn.SendPacket(new PlanetDetailResponse(planetData.id,
5151
planetData.runtimeVeinGroups ?? Array.Empty<VeinGroup>(), planetData.landPercent));
5252
Log.Info($"PlanetCalculateThread:{planetData.displayName} time:{highStopwatch.duration:F4}s");

NebulaNetwork/PacketProcessors/Planet/PlanetDetailResponseProcessor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ protected override void ProcessPacket(PlanetDetailResponse packet, NebulaConnect
3939
}
4040
}
4141
planet.landPercent = packet.LandPercent;
42-
planet.landPercentDirty = false;
42+
planet.landPercentDirtyFlag = false;
4343

4444
//planet.NotifyCalculated();
45-
planet.calculating = false;
46-
planet.calculated = true;
45+
planet.scanning = false;
46+
planet.scanned = true;
4747
}
4848
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#region
2+
3+
using HarmonyLib;
4+
using NebulaWorld;
5+
6+
#endregion
7+
8+
namespace NebulaPatcher.Patches.Dynamic;
9+
10+
[HarmonyPatch(typeof(GalaxyData))]
11+
internal class GalaxyData_Patch
12+
{
13+
[HarmonyPrefix]
14+
[HarmonyPatch(nameof(GalaxyData.UpdateScanningProcedure))]
15+
public static bool UpdateScanningProcedure_Prefix()
16+
{
17+
// The scanning in multiplayer should be triggered by user interactions, instead of vanilla behavior (auto call for every 10s)
18+
return !Multiplayer.IsActive;
19+
}
20+
}

NebulaPatcher/Patches/Dynamic/GameData_Patch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public static bool OnActivePlanetFactoryLoaded_Prefix(GameData __instance, Plane
207207
{
208208
planet.dirtyFlags[i] = true;
209209
}
210-
planet.landPercentDirty = true;
210+
planet.landPercentDirtyFlag = true;
211211
try
212212
{
213213
planet.UpdateDirtyMeshes();

NebulaPatcher/Patches/Dynamic/PlanetModelingManager_Patch.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,22 +156,22 @@ private static void InternalLoadPlanetsRequestGenerator(IEnumerable<PlanetData>
156156
}
157157

158158
[HarmonyPrefix]
159-
[HarmonyPatch(nameof(PlanetModelingManager.RequestCalcPlanet))]
160-
public static bool RequestCalcPlanet_Prefix(PlanetData planet)
159+
[HarmonyPatch(nameof(PlanetModelingManager.RequestScanPlanet))]
160+
public static bool RequestScanPlanet_Prefix(PlanetData planet)
161161
{
162162
// Run the original method if this is the master client or in single player games
163163
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
164164
{
165165
return true;
166166
}
167167

168-
RequestCalcPlanet(planet);
168+
RequestScanPlanet(planet);
169169
return false;
170170
}
171171

172172
[HarmonyPrefix]
173-
[HarmonyPatch(nameof(PlanetModelingManager.RequestCalcStar))]
174-
public static bool RequestCalcStar_Prefix(StarData star)
173+
[HarmonyPatch(nameof(PlanetModelingManager.RequestScanStar))]
174+
public static bool RequestScanStar_Prefix(StarData star)
175175
{
176176
// Run the original method if this is the master client or in single player games
177177
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
@@ -181,22 +181,22 @@ public static bool RequestCalcStar_Prefix(StarData star)
181181

182182
foreach (var planet in star.planets)
183183
{
184-
RequestCalcPlanet(planet);
184+
RequestScanPlanet(planet);
185185
}
186186
return false;
187187
}
188188

189-
private static void RequestCalcPlanet(PlanetData planet)
189+
private static void RequestScanPlanet(PlanetData planet)
190190
{
191-
if (planet.calculated || planet.calculating || planet.data != null)
191+
if (planet.scanned || planet.scanning || planet.data != null)
192192
{
193193
return;
194194
}
195195
if (planet.loaded || planet.loading)
196196
{
197197
return;
198198
}
199-
planet.calculating = true;
199+
planet.scanning = true;
200200
Multiplayer.Session.Network.SendPacket(new PlanetDetailRequest(planet.id));
201201
}
202202
}

NebulaPatcher/Patches/Transpilers/ConstructionSystem_Transpiler.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ public static IEnumerable<CodeInstruction> AddBuildTargetToModules_Transpiler(IE
2424
try
2525
{
2626
/* Sync Prebuild.itemRequired changes by player, insert local method call after player.package.TakeTailItems
27-
Replace: if (num8 <= num) { this.player.mecha.constructionModule.InsertBuildTarget ... }
28-
With: if (num8 <= num && IsClosestPlayer(ref pos)) { this.player.mecha.constructionModule.InsertBuildTarget ... }
27+
Replace: if (num9 <= num2) { this.player.mecha.constructionModule.InsertBuildTarget ... }
28+
With: if (num9 <= num2 && IsClosestPlayer(ref pos)) { this.player.mecha.constructionModule.InsertBuildTarget ... }
2929
*/
3030

31-
var codeMatcher = new CodeMatcher(instructions)
32-
.MatchForward(true,
31+
var codeMatcher = new CodeMatcher(instructions).End()
32+
.MatchBack(false, new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(ConstructionModuleComponent), nameof(ConstructionModuleComponent.InsertBuildTarget))))
33+
.MatchBack(true,
3334
new CodeMatch(OpCodes.Ldloc_S),
34-
new CodeMatch(OpCodes.Ldloc_0),
35+
new CodeMatch(i => i.IsLdloc()),
3536
new CodeMatch(OpCodes.Bgt_Un)
3637
);
3738
var sqrDist = codeMatcher.InstructionAt(-2).operand;

0 commit comments

Comments
 (0)