Skip to content

Commit

Permalink
Merge pull request #688 from qsb-dev/dev
Browse files Browse the repository at this point in the history
1.2.0
  • Loading branch information
misternebula authored Jun 11, 2024
2 parents 875d744 + 5f1f1b2 commit b2e55d6
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: Raicuparta.QuantumSpaceBuddies
path: .\QSB\Bin\Debug
path: .\QSB-NH\Bin\Debug
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ permissions:
env:
PROJ_USERNAME: Raicuparta
PROJ_NAME: QuantumSpaceBuddies
REAL_PROJ_NAME: QSB

jobs:
pre_job:
Expand All @@ -34,7 +33,7 @@ jobs:

- name: Read Manifest
id: read-manifest
run: echo "manifest=$(< ./${{ env.REAL_PROJ_NAME }}/manifest.json sed ':a;N;$!ba;s/\n/ /g')" >> $GITHUB_OUTPUT
run: echo "manifest=$(< ./QSB/manifest.json sed ':a;N;$!ba;s/\n/ /g')" >> $GITHUB_OUTPUT

- name: Check For Release
id: check-tag
Expand Down Expand Up @@ -63,20 +62,17 @@ jobs:
- name: Setup .NET
uses: "actions/setup-dotnet@v3"

- name: Remove .csproj.user
run: if (Test-Path ${{ env.REAL_PROJ_NAME }}/${{ env.REAL_PROJ_NAME }}.csproj.user) { rm ${{ env.REAL_PROJ_NAME }}/${{ env.REAL_PROJ_NAME }}.csproj.user }

- name: Build Mod
run: dotnet build -c Release

- name: Upload Artifact
uses: "actions/upload-artifact@v3"
with:
name: "${{ env.PROJ_USERNAME }}.${{ env.PROJ_NAME }}"
path: "${{ env.REAL_PROJ_NAME }}/bin/Release"
path: "QSB-NH/bin/Release"

- name: Zip For Release
run: 7z a ${{ env.PROJ_USERNAME }}.${{ env.PROJ_NAME }}.zip ./${{ env.REAL_PROJ_NAME }}/bin/Release/**
run: 7z a ${{ env.PROJ_USERNAME }}.${{ env.PROJ_NAME }}.zip ./QSB-NH/bin/Release/**

- name: Create Release
uses: "ncipollo/release-action@v1"
Expand Down
24 changes: 24 additions & 0 deletions QSB-NH/QSB-NH.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@
<NoWarn>CS1998;CS0649</NoWarn>
</PropertyGroup>

<Target Name="clean after building" AfterTargets="PostBuildEvent">
<ItemGroup>
<_Files Remove="@(_Files)" />
<_Files Include="$(OutputPath)\*.exe.config" />
</ItemGroup>
<Delete Files="@(_Files)" />
</Target>

<Target Name="weave qsb nh" AfterTargets="PostBuildEvent">
<Exec Command=".\MirrorWeaver &quot;$(TargetPath)&quot;" WorkingDirectory="..\MirrorWeaver\bin\$(Configuration)\" />
</Target>

<PropertyGroup>
<UnityDllsDir Condition="Exists('$(UnityAssetsDir)')">$(UnityAssetsDir)\Dlls</UnityDllsDir>
</PropertyGroup>
<Target Name="copy dlls to unity" AfterTargets="PostBuildEvent" Condition="Exists('$(UnityDllsDir)')">
<ItemGroup>
<_Files Remove="@(_Files)" />
<_Files Include="$(OutputPath)/*.dll" />
<_Files Include="$(OutputPath)/*.exe" />
</ItemGroup>
<Copy SourceFiles="@(_Files)" DestinationFolder="$(UnityDllsDir)" />
</Target>

<ItemGroup>
<Folder Include="lib\" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public override void OnArriveAtPosition()
{
_controller.SetLanternConcealed(false, true);
_controller.ChangeLanternFocus(1f, 2f);
_controller.FaceNodeList(IdentifyIntruderAction.s_nodesToSpotlight, num, TurnSpeed.MEDIUM, 1f, false);
_controller.FaceNodeList(s_nodesToSpotlight, num, TurnSpeed.MEDIUM, 1f, false);
return;
}
}
Expand Down Expand Up @@ -291,9 +291,9 @@ private int GenerateSpotlightList(GhostNode node, Vector3 ignoreDirection)
{
if (Vector3.Angle(node.neighbors[i].localPosition - localPosition, ignoreDirection) >= 45f)
{
IdentifyIntruderAction.s_nodesToSpotlight[num] = node.neighbors[i];
s_nodesToSpotlight[num] = node.neighbors[i];
num++;
if (num == IdentifyIntruderAction.s_nodesToSpotlight.Length)
if (num == s_nodesToSpotlight.Length)
{
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static bool OnDestroy(GhostHotelDirector __instance)
/*
* I have no idea why, but for some reason unknown to the damned souls that walk this mortal plane,
* this method only runs when this patch is here. What the absolute fuck.
* Update - This is still needed. Run while you still can.
*/

[HarmonyPrefix]
Expand Down
15 changes: 13 additions & 2 deletions QSB/Menus/MenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class MenuManager : MonoBehaviour, IAddComponentOnStart

private GameObject _choicePopupPrefab;

public bool WillBeHost;

public void Start()
{
Instance = this;
Expand Down Expand Up @@ -606,6 +608,7 @@ private void PreHost()
private void Host(bool newMultiplayerSave)
{
QSBCore.IsInMultiplayer = true;
WillBeHost = true;

if (newMultiplayerSave)
{
Expand Down Expand Up @@ -648,7 +651,11 @@ private void Host(bool newMultiplayerSave)
LoadGame(PlayerData.GetWarpedToTheEye());
// wait until scene load and then wait until Start has ran
// why is this done? GameStateMessage etc works on title screen since nonhost has to deal with that
Delay.RunWhen(() => TimeLoop._initialized, QSBNetworkManager.singleton.StartHost);
Delay.RunWhen(() => TimeLoop._initialized, () =>
{
QSBNetworkManager.singleton.StartHost();
Delay.RunWhen(() => NetworkServer.active, () => WillBeHost = false);
});
};

OpenInfoPopup(string.Format(QSBLocalization.Current.CopySteamIDToClipboard, steamId)
Expand All @@ -660,7 +667,11 @@ private void Host(bool newMultiplayerSave)
LoadGame(PlayerData.GetWarpedToTheEye());
// wait until scene load and then wait until Start has ran
// why is this done? GameStateMessage etc works on title screen since nonhost has to deal with that
Delay.RunWhen(() => TimeLoop._initialized, QSBNetworkManager.singleton.StartHost);
Delay.RunWhen(() => TimeLoop._initialized, () =>
{
QSBNetworkManager.singleton.StartHost();
Delay.RunWhen(() => NetworkServer.active, () => WillBeHost = false);
});
}
}

Expand Down
6 changes: 3 additions & 3 deletions QSB/QSB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description>Multiplayer mod for Outer Wilds</Description>
<Authors>Henry Pointer, William Corby, Aleksander Waage, Ricardo Lopes</Authors>
<Company>Henry Pointer, William Corby, Aleksander Waage, Ricardo Lopes</Company>
<Copyright>Copyright © Henry Pointer, William Corby, Aleksander Waage, Ricardo Lopes 2020-2023</Copyright>
<Copyright>Copyright © Henry Pointer, William Corby, Aleksander Waage, Ricardo Lopes 2020-2024</Copyright>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<OutputPath Condition="Exists('$(OwmlDir)')">$(OwmlDir)\Mods\Raicuparta.QuantumSpaceBuddies</OutputPath>
Expand Down Expand Up @@ -74,8 +74,8 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="OuterWildsGameLibs" Version="1.1.14.768" IncludeAssets="compile" />
<PackageReference Include="OWML" Version="2.11.1" IncludeAssets="compile" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.15.1018" IncludeAssets="compile" />
<PackageReference Include="OWML" Version="2.13.0" IncludeAssets="compile" />
<Reference Include="..\Lib\*.dll" />
<ProjectReference Include="..\FizzySteamworks\FizzySteamworks.csproj" />
<ProjectReference Include="..\SteamRerouter\SteamRerouter.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions QSB/QSBCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
using QSB.Utility.Deterministic;

/*
Copyright (C) 2020 - 2023
Copyright (C) 2020 - 2024
Henry Pointer (_nebula / misternebula),
Will Corby (JohnCorby),
Aleksander Waage (AmazingAlek),
Expand Down Expand Up @@ -58,7 +58,7 @@ public class QSBCore : ModBehaviour
public static AssetBundle NetworkAssetBundle { get; private set; }
public static AssetBundle ConversationAssetBundle { get; private set; }
public static AssetBundle HUDAssetBundle { get; private set; }
public static bool IsHost => NetworkServer.active;
public static bool IsHost => NetworkServer.active || (IsInMultiplayer && MenuManager.Instance.WillBeHost);
public static bool IsInMultiplayer;
public static string QSBVersion => Helper.Manifest.Version;
public static string GameVersion =>
Expand Down
17 changes: 13 additions & 4 deletions QSB/TimeSync/WakeUpSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public void Start()

public float GetTimeDifference()
{
if (QSBCore.IsHost)
{
return 0f;
}

var myTime = Time.timeSinceLevelLoad;
return myTime - _serverTime;
}
Expand Down Expand Up @@ -114,6 +119,7 @@ private void Init()
CurrentState = State.Loaded;
if (QSBCore.IsHost)
{
_serverTime = Time.timeSinceLevelLoad;
SendServerTime();
}
else
Expand Down Expand Up @@ -160,8 +166,7 @@ private void WakeUpOrSleep()
return;
}

var myTime = Time.timeSinceLevelLoad;
var diff = myTime - _serverTime;
var diff = GetTimeDifference();

if (ServerStateManager.Instance.GetServerState() is not (ServerState.InSolarSystem or ServerState.InEye))
{
Expand All @@ -188,6 +193,12 @@ private void WakeUpOrSleep()

private void StartFastForwarding(FastForwardReason reason)
{
if (QSBCore.IsHost)
{
DebugLog.ToConsole($"Tried to fast-forward as server??? What???? _serverTime = {_serverTime}, GetTimeDifference() = {GetTimeDifference()}", MessageType.Error);
return;
}

if (CurrentState == State.FastForwarding)
{
TimeSyncUI.TargetTime = _serverTime;
Expand Down Expand Up @@ -276,13 +287,11 @@ private void UpdateServer()

if (ServerStateManager.Instance == null)
{
DebugLog.ToConsole($"Warning - ServerStateManager.Instance is null!", MessageType.Warning);
return;
}

if (QSBPlayerManager.LocalPlayer == null)
{
DebugLog.ToConsole($"Warning - LocalPlayer is null!", MessageType.Warning);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions QSB/Translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"TimeSyncWaitForAllToDie": "Ожидание конца цикла...",
"GalaxyMapEveryoneNotPresent": "Ещё не время. Все должны быть здесь, чтобы начать.",
"YouAreDead": "Вы погибли.",
"WaitingForRespawn": "Ожидание, пока кто-нибудь возрадит вас...",
"WaitingForRespawn": "Ожидание, пока кто-нибудь возродит вас...",
"WaitingForAllToDie": "Ожидание смерти {0} игрока(ов)...",
"AttachToShip": "Зацепиться на корабль",
"AttachToShip": "Зацепиться за корабль",
"DetachFromShip": "Отцепиться от корабля",
"DeathMessages": {
"Default": [
Expand Down
2 changes: 2 additions & 0 deletions QSB/Utility/DebugGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using QSB.WorldSync;
using System;
using System.Linq;
using QSB.Menus;
using UnityEngine;

namespace QSB.Utility;
Expand Down Expand Up @@ -108,6 +109,7 @@ private static void DrawGui()
return;
}

WriteLine(1, $"IsHost : {QSBCore.IsHost} (WillBeHost : {(MenuManager.Instance != null ? MenuManager.Instance.WillBeHost : "MenuManager null")})");
WriteLine(1, $"HasWokenUp : {QSBWorldSync.AllObjectsReady}");
if (WakeUpSync.LocalInstance != null)
{
Expand Down
4 changes: 2 additions & 2 deletions QSB/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"author": "Nebula, John, Alek, & Rai",
"name": "Quantum Space Buddies",
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
"version": "1.1.1",
"owmlVersion": "2.11.1",
"version": "1.2.0",
"owmlVersion": "2.13.0",
"dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ],
"pathsToPreserve": [ "debugsettings.json" ],
"conflicts": [
Expand Down
2 changes: 1 addition & 1 deletion QSBPatcher/QSBPatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<Description>Copies steamworks into the game for non-steam vendors</Description>
<Authors>William Corby, Henry Pointer</Authors>
<Company>William Corby, Henry Pointer</Company>
<Copyright>Copyright © William Corby, Henry Pointer 2022-2023</Copyright>
<Copyright>Copyright © William Corby, Henry Pointer 2022-2024</Copyright>
</PropertyGroup>
</Project>
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Spoilers within!

## Installation

### Easy installation (recommended)

- [Install the Outer Wilds Mod Manager](https://outerwildsmods.com/mod-manager/)
- Install Quantum Space Buddies from the mod list displayed in the application

Expand Down Expand Up @@ -152,7 +150,7 @@ See [DEVELOPMENT.md](DEVELOPMENT.md)

## License and legal stuff

Copyright (C) 2020 - 2023 :
Copyright (C) 2020 - 2024 :
- Henry Pointer (_nebula or misternebula)
- Will Corby (JohnCorby)
- Aleksander Waage (AmazingAlek)
Expand Down
2 changes: 1 addition & 1 deletion SteamRerouter/SteamRerouter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Description>Handles game steam interaction, since qsb uses its own app id</Description>
<Authors>William Corby, Henry Pointer</Authors>
<Company>William Corby, Henry Pointer</Company>
<Copyright>Copyright © William Corby, Henry Pointer 2022-2023</Copyright>
<Copyright>Copyright © William Corby, Henry Pointer 2022-2024</Copyright>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<ItemGroup>
Expand Down

0 comments on commit b2e55d6

Please sign in to comment.