Skip to content

Commit

Permalink
Merge pull request #662 from PhantomGamers/logdspver
Browse files Browse the repository at this point in the history
log expected game version
  • Loading branch information
starfi5h authored Mar 16, 2024
2 parents 8313fa5 + 53ec83c commit a108ac0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
1 change: 1 addition & 0 deletions Nebula.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
SharedConfig.targets = SharedConfig.targets
Shims\Shims.cs = Shims\Shims.cs
version.json = version.json
Directory.Build.rsp = Directory.Build.rsp
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NebulaWorld", "NebulaWorld\NebulaWorld.csproj", "{28AEA139-FB22-4672-AF51-28B728CF2978}"
Expand Down
27 changes: 27 additions & 0 deletions NebulaPatcher/NebulaPatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,31 @@
<ProjectReference Include="..\NebulaNetwork\NebulaNetwork.csproj"/>
<ProjectReference Include="..\NebulaWorld\NebulaWorld.csproj" SpecificVersion="true"/>
</ItemGroup>

<Target Name="WritePackageVersion" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.cs">
<PropertyGroup>
<PackageVersion></PackageVersion>
<ProjectAssetsJsonPath>$(BaseIntermediateOutputPath)project.assets.json</ProjectAssetsJsonPath>
</PropertyGroup>
<Exec Command="powershell -Command &quot;$projectAssets = Get-Content $(ProjectAssetsJsonPath) -Raw | ConvertFrom-Json; $packageKey = $projectAssets.libraries.PSObject.Properties.Name | Where-Object { $_ -match 'DysonSphereProgram.GameLibs' }; $version = $packageKey.Split('/')[1].Split('-')[0]; Write-Output $version&quot;" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="PackageVersion" />
</Exec>
<PropertyGroup>
<GeneratedText><![CDATA[
namespace $(RootNamespace)
{
internal static class DSPGameVersion
{
public const string VERSION = "$(PackageVersion)"%3B
}
}
]]></GeneratedText>
<GeneratedFilePath>$(IntermediateOutputPath)DSPGameVersion.cs</GeneratedFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(GeneratedFilePath)" />
<FileWrites Include="$(GeneratedFilePath)" />
</ItemGroup>
<WriteLinesToFile Lines="$(GeneratedText)" File="$(GeneratedFilePath)" WriteOnlyWhenDifferent="true" Overwrite="true" />
</Target>
</Project>
4 changes: 2 additions & 2 deletions NebulaPatcher/NebulaPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private static void InitPatches()

try
{
Log.Info($"Applying patches from {PluginInfo.PLUGIN_NAME} {PluginInfo.PLUGIN_DISPLAY_VERSION}");
Log.Info($"Applying patches from {PluginInfo.PLUGIN_NAME} {PluginInfo.PLUGIN_DISPLAY_VERSION} made for game version {DSPGameVersion.VERSION}");
#if DEBUG
if (Directory.Exists("./mmdump"))
{
Expand Down Expand Up @@ -328,7 +328,7 @@ private static void InitPatches()
Log.Error("Unhandled exception occurred while patching the game:", ex);
// Show error in UIFatalErrorTip to inform normal users
Harmony.CreateAndPatchAll(typeof(UIFatalErrorTip_Patch));
Log.Error("Nebula Multiplayer Mod is incompatible with game version\nUnhandled exception occurred while patching the game.");
Log.Error($"Nebula Multiplayer Mod is incompatible with game version, expected version {DSPGameVersion.VERSION}\nUnhandled exception occurred while patching the game.");
}
}

Expand Down
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@

An open-source, multiplayer mod for the game [Dyson Sphere Program](https://store.steampowered.com/app/1366540/Dyson_Sphere_Program/).

# Download Prerelease
## Download Prerelease

[![Build - Win x64](https://github.com/NebulaModTeam/nebula/actions/workflows/build-winx64.yml/badge.svg?branch=master)](https://nightly.link/NebulaModTeam/nebula/workflows/build-winx64/master/build-artifacts-Release.zip)
Note: This is the bleeding edge build, for the more stable build see below. You can use this one if you want to try out the latest development builds, which may contain bugs and unfinished work.

You will also need some extra steps to get this installed, see 2nd point in ["How can I play this mod?"](#how-can-i-play-this-mod).

# FAQ
## FAQ

## Where can I get mod support?
### Where can I get mod support?

Please join our [Discord Server](https://discord.gg/UHeB2QvgDa) and ask your question in the `support` channel. We have a really nice community that will be able to answer your questions.

## How can I play this mod?
### How can I play this mod?

Please do keep in mind that this mod is still in heavy development, it may still contains bugs.

- Stable version of the mod can be downloaded from [Thunderstore](https://dsp.thunderstore.io/package/nebula/NebulaMultiplayerMod/) (Recommended).
- If you want to install the latest version of the mod, you can install pre-release versions be following the [installation guide](https://github.com/NebulaModTeam/nebula/wiki/Installation#manual-installation).
- To connect, check [hosting and joining guide](https://github.com/NebulaModTeam/nebula/wiki/Hosting-and-Joining).

## API Documentation
### API Documentation

This mod has an API, that makes it easier for other mod developers to make their mods compatible with Nebula. If you are a mod developer and you want your mods to be compatible, follow the instructions [here](https://github.com/NebulaModTeam/nebula/wiki/Nebula-mod-API). Also you can always join our [Discord Server](https://discord.gg/UHeB2QvgDa) for help with using the API.

## Chat
### Chat

The chat window can opened/closed using Alt + Backtick (configurable in Settings - Multiplayer - Chat). Type `/help` to view all commands. Also in settings is an option to disable the chat window from automatically opening when a message is received.

## What is the current status?
### What is the current status?

Major refactors will happen while the project grows or game updates. Join the [Discord Server](https://discord.gg/UHeB2QvgDa) if you want to see to latest state of our development. Check [Wiki](https://github.com/NebulaModTeam/nebula/wiki/About-Nebula) for overview of features.

Expand Down Expand Up @@ -116,13 +116,10 @@ Most of the battle aspect are sync, only few features are still WIP.

</details>



## How can I contribute?
### How can I contribute?

Please join our [Discord Server](https://discord.gg/UHeB2QvgDa) to ask if someone is already working on the task that you want to do. Once, you are done with your modification, simply submit a pull request. Contribution documentation can be found here: [Wiki](https://github.com/NebulaModTeam/nebula/wiki/Setting-up-a-development-environment).

## How can I support the team?
### How can I support the team?

If you like what we do and would like to support us, you can donate through our [Patreon](https://www.patreon.com/nebula_mod_team). Thanks for the support <3

0 comments on commit a108ac0

Please sign in to comment.