Skip to content

Commit

Permalink
Merge pull request #476 from sp00ktober/master
Browse files Browse the repository at this point in the history
fix to be compatible with new game version 0.8.23
  • Loading branch information
sp00ktober authored Nov 19, 2021
2 parents 557d108 + d3a7446 commit 33efac7
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/thunderstore_bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GH_ARCHIVE_PATH = join(
const MOD_ICON_PATH = "thunderstore_icon.png";
const README_PATH = "README.md";
const CHANGELOG_PATH = "CHANGELOG.md";
const BEPINEX_DEPENDENCY = "xiaoye97-BepInEx-5.4.11";
const BEPINEX_DEPENDENCY = "xiaoye97-BepInEx-5.4.17";

async function main() {
if (!existsSync(DIST_NEBULA_FOLDER)) {
Expand Down
4 changes: 2 additions & 2 deletions NebulaNetwork/PacketProcessors/Planet/VegeMinedProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override void ProcessPacket(VegeMinedPacket packet, NebulaConnection conn
if (veinProto != null)
{
VFEffectEmitter.Emit(veinProto.MiningEffect, veinData.pos, Maths.SphericalRotation(veinData.pos, 0f));
VFAudio.Create(veinProto.MiningAudio, null, veinData.pos, true);
VFAudio.Create(veinProto.MiningAudio, null, veinData.pos, true, 0, -1, -1L);
}
}
else
Expand All @@ -43,7 +43,7 @@ public override void ProcessPacket(VegeMinedPacket packet, NebulaConnection conn
if (vegeProto != null)
{
VFEffectEmitter.Emit(vegeProto.MiningEffect, vegeData.pos, Maths.SphericalRotation(vegeData.pos, 0f));
VFAudio.Create(vegeProto.MiningAudio, null, vegeData.pos, true);
VFAudio.Create(vegeProto.MiningAudio, null, vegeData.pos, true, 0, -1, -1L);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions NebulaPatcher/Patches/Dynamic/BuildTool_Common_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal class BuildTool_Common_Patch
[HarmonyPrefix]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.CreatePrebuilds))]
[HarmonyPatch(typeof(BuildTool_Path), nameof(BuildTool_Path.CreatePrebuilds))]
[HarmonyPatch(typeof(BuildTool_PathAddon), nameof(BuildTool_PathAddon.CreatePrebuilds))]
[HarmonyPatch(typeof(BuildTool_Inserter), nameof(BuildTool_Inserter.CreatePrebuilds))]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CreatePrebuilds))]
public static bool CreatePrebuilds_Prefix(BuildTool __instance)
Expand All @@ -28,6 +29,10 @@ public static bool CreatePrebuilds_Prefix(BuildTool __instance)
BuildTool_BlueprintPaste bpInstance = __instance as BuildTool_BlueprintPaste;
previews = bpInstance.bpPool.Take(bpInstance.bpCursor).ToList();
}
if(__instance is BuildTool_PathAddon)
{
previews.Add(((BuildTool_PathAddon)__instance).handbp);
}

// Host will just broadcast event to other players
if (Multiplayer.Session.LocalPlayer.IsHost)
Expand All @@ -48,6 +53,7 @@ public static bool CreatePrebuilds_Prefix(BuildTool __instance)
[HarmonyPrefix]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_Path), nameof(BuildTool_Path.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_PathAddon), nameof(BuildTool_PathAddon.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_Inserter), nameof(BuildTool_Inserter.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CheckBuildConditions))]
public static bool CheckBuildConditions(ref bool __result)
Expand Down
5 changes: 5 additions & 0 deletions NebulaPatcher/Patches/Dynamic/GameData_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ public static void LeaveStar_Prefix(GameData __instance)
}
}
}
// we need to reset the warning system to avoid nre for clients when they leave the solar system. this is related to the new traffic monitor
// as we also free factory data this should be fine.
// warnings should be triggered by some other syncing mechanic issued by the host (or find a better solution for this if you are not so tired as i am now)
GameMain.data.warningSystem.Free();
GameMain.data.warningSystem.Init(GameMain.data);
}
Multiplayer.Session.Network.SendPacket(new PlayerUpdateLocalStarId(-1));
}
Expand Down
28 changes: 0 additions & 28 deletions NebulaPatcher/Patches/Dynamic/MST_OnBuild_Patch.cs

This file was deleted.

5 changes: 5 additions & 0 deletions NebulaWorld/Factory/BuildToolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ public void CreatePrebuildsRequest(CreatePrebuildsRequest packet)
{
((BuildTool_Path)buildTool).CreatePrebuilds();
}
else if(packet.BuildToolType == typeof(BuildTool_PathAddon).ToString())
{
((BuildTool_PathAddon)buildTool).handbp = buildTool.buildPreviews[0]; // traffic monitors cannot be drag build atm, so its always only one.
((BuildTool_PathAddon)buildTool).CreatePrebuilds();
}
else if (packet.BuildToolType == typeof(BuildTool_Inserter).ToString())
{
((BuildTool_Inserter)buildTool).CreatePrebuilds();
Expand Down
30 changes: 15 additions & 15 deletions NebulaWorld/MonoBehaviours/Remote/RemotePlayerEffects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ public void Awake()
psysr[1] = VFX.GetChild(1).Find("flames").GetComponent<ParticleSystemRenderer>();
torchEffect = rootModelTransform.Find("bip/pelvis/spine-1/spine-2/spine-3/r-clavicle/r-upper-arm/r-forearm/r-torch/vfx-torch/blast").GetComponent<ParticleSystem>();

WaterEffect[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/l-foot_end/vfx-footsteps/water").GetComponent<ParticleSystem>();
WaterEffect[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/r-foot_end/vfx-footsteps/water").GetComponent<ParticleSystem>();
FootEffect[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/l-foot_end/vfx-footsteps").GetComponent<ParticleSystem>();
FootEffect[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/r-foot_end/vfx-footsteps").GetComponent<ParticleSystem>();
FootSmallSmoke[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/l-foot_end/vfx-footsteps/smoke").GetComponent<ParticleSystem>();
FootSmallSmoke[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/r-foot_end/vfx-footsteps/smoke").GetComponent<ParticleSystem>();
FootLargeSmoke[0] = rootModelTransform.Find("bip/pelvis/l-thigh/l-calf/l-ankle/l-foot/l-foot_end/vfx-footsteps/smoke-2").GetComponent<ParticleSystem>();
FootLargeSmoke[1] = rootModelTransform.Find("bip/pelvis/r-thigh/r-calf/r-ankle/r-foot/r-foot_end/vfx-footsteps/smoke-2").GetComponent<ParticleSystem>();
WaterEffect[0] = rootTransform.Find("VFX").Find("vfx-l-footsteps/water").GetComponent<ParticleSystem>();
WaterEffect[1] = rootTransform.Find("VFX").Find("vfx-r-footsteps/water").GetComponent<ParticleSystem>();
FootEffect[0] = rootTransform.Find("VFX").Find("vfx-l-footsteps").GetComponent<ParticleSystem>();
FootEffect[1] = rootTransform.Find("VFX").Find("vfx-r-footsteps").GetComponent<ParticleSystem>();
FootSmallSmoke[0] = rootTransform.Find("VFX").Find("vfx-l-footsteps/smoke").GetComponent<ParticleSystem>();
FootSmallSmoke[1] = rootTransform.Find("VFX").Find("vfx-r-footsteps/smoke").GetComponent<ParticleSystem>();
FootLargeSmoke[0] = rootTransform.Find("VFX").Find("vfx-l-footsteps/smoke-2").GetComponent<ParticleSystem>();
FootLargeSmoke[1] = rootTransform.Find("VFX").Find("vfx-r-footsteps/smoke-2").GetComponent<ParticleSystem>();

collider = new Collider[16];

Expand Down Expand Up @@ -386,7 +386,7 @@ private void PlayFootstepSound(float vol, float biomo, bool water)
{
audioName = waterSoundEvent;
}
VFAudio audio = VFAudio.Create(audioName, transform, Vector3.zero, false, 0);
VFAudio audio = VFAudio.Create(audioName, transform, Vector3.zero, false, 8, -1, -1L);
if (audio != null)
{
// skip setting audio.volumeMultiplier = vol, it makes footsteps too loud
Expand Down Expand Up @@ -508,7 +508,7 @@ private void UpdateExtraSoundEffects(PlayerAnimationUpdate packet)
{
if (maxAltitude > 1f && pData.waterItemId > 0)
{
VFAudio audio = VFAudio.Create("landing-water", transform, Vector3.zero, false, 0);
VFAudio audio = VFAudio.Create("landing-water", transform, Vector3.zero, false, 0, -1, -1L);
audio.volumeMultiplier = Mathf.Clamp01(maxAltitude / 5f + 0.5f);
audio.Play();
PlayFootstepEffect(true, 0f, true);
Expand All @@ -520,7 +520,7 @@ private void UpdateExtraSoundEffects(PlayerAnimationUpdate packet)
{
if (maxAltitude > 3f)
{
VFAudio audio = VFAudio.Create("landing", transform, Vector3.zero, false, 0);
VFAudio audio = VFAudio.Create("landing", transform, Vector3.zero, false, 0, -1, -1L);
audio.volumeMultiplier = Mathf.Clamp01(maxAltitude / 25f + 0.5f);
audio.Play();
}
Expand Down Expand Up @@ -606,7 +606,7 @@ public void UpdateState(PlayerAnimationUpdate packet)
{
// when in air without pressing spacebar
psysr[i].lengthScale = -3.5f;
driftAudio = (driftAudio != null) ? driftAudio : VFAudio.Create("drift", transform, Vector3.zero, true);
driftAudio = (driftAudio != null) ? driftAudio : VFAudio.Create("drift", transform, Vector3.zero, true, 0, -1, -1L);
}
else
{
Expand All @@ -616,7 +616,7 @@ public void UpdateState(PlayerAnimationUpdate packet)
{
// when pressing spacebar but also when landing (Drift is disabled when landing)
psysr[i].lengthScale = Mathf.Lerp(-3.5f, -10f, Mathf.Max(packet.HorzSpeed, packet.VertSpeed) * 0.03f);
flyAudio0 = (flyAudio0 != null) ? flyAudio0 : VFAudio.Create("fly-atmos", transform, Vector3.zero, true);
flyAudio0 = (flyAudio0 != null) ? flyAudio0 : VFAudio.Create("fly-atmos", transform, Vector3.zero, true, 0, -1, -1L);
}
else
{
Expand All @@ -625,7 +625,7 @@ public void UpdateState(PlayerAnimationUpdate packet)
if (sailActive)
{
psysr[i].lengthScale = Mathf.Lerp(-3.5f, -10f, Mathf.Max(packet.HorzSpeed, packet.VertSpeed) * 15f);
flyAudio1 = (flyAudio1 != null) ? flyAudio1 : VFAudio.Create("fly-space", transform, Vector3.zero, true);
flyAudio1 = (flyAudio1 != null) ? flyAudio1 : VFAudio.Create("fly-space", transform, Vector3.zero, true, 0, -1, -1L);
}
else
{
Expand All @@ -650,7 +650,7 @@ public void UpdateState(PlayerAnimationUpdate packet)
if (!torchEffect.isPlaying)
{
torchEffect.Play();
miningAudio = VFAudio.Create("mecha-mining", transform, Vector3.zero, true);
miningAudio = VFAudio.Create("mecha-mining", transform, Vector3.zero, true, 0, -1, -1L);
}
}
else if (torchEffect != null && rootAnimation.miningWeight <= 0.99f)
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.7.3",
"version": "0.7.4",
"assemblyVersion": {
"precision": "build"
},
Expand Down

0 comments on commit 33efac7

Please sign in to comment.