Skip to content

Commit

Permalink
Merge branch 'Pathoschild:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jakerosado authored Apr 25, 2024
2 parents 3e7982a + d1bb941 commit f2d735b
Show file tree
Hide file tree
Showing 331 changed files with 9,694 additions and 6,844 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ _ReSharper*/
appsettings.Development.json

# Azure generated files
src/SMAPI.Web/Properties/PublishProfiles/*.pubxml
src/SMAPI.Web/Properties/ServiceDependencies/* - Web Deploy/
src/SMAPI.Web/Properties/PublishProfiles
src/SMAPI.Web/Properties/ServiceDependencies

# macOS
.DS_Store
6 changes: 1 addition & 5 deletions build/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ repo. It imports the other MSBuild files as needed.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--set general build properties -->
<Version>3.18.6</Version>
<Version>4.0.8</Version>
<Product>SMAPI</Product>
<LangVersion>latest</LangVersion>
<AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
<DefineConstants>$(DefineConstants);SMAPI_DEPRECATED</DefineConstants>
<DebugSymbols>true</DebugSymbols>

<!--embed symbols for error stack trace line numbers on Linux/macOS: https://github.com/dotnet/runtime/issues/39987-->
Expand All @@ -34,13 +33,10 @@ repo. It imports the other MSBuild files as needed.
warning | builds | summary | rationale
┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ | ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
CS0436 | all | local type conflicts with imported type | SMAPI needs to use certain low-level code during very early compatibility checks, before it's safe to load any other DLLs.
CS0612 | deprecated | member is obsolete | internal references to deprecated code when deprecated code is enabled.
CS0618 | deprecated | member is obsolete (with message) | internal references to deprecated code when deprecated code is enabled.
CA1416 | all | platform code available on all platforms | Compiler doesn't recognize the #if constants used by SMAPI.
CS0809 | all | obsolete overload for non-obsolete member | This is deliberate to signal to mods that certain APIs are only implemented for the game and shouldn't be called by mods.
NU1701 | all | NuGet package targets older .NET version | All such packages are carefully tested to make sure they do work.
-->
<NoWarn Condition="$(DefineConstants.Contains(SMAPI_DEPRECATED))">$(NoWarn);CS0612;CS0618</NoWarn>
<NoWarn>$(NoWarn);CS0436;CA1416;CS0809;NU1701</NoWarn>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion build/deploy-local-smapi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This assumes `find-game-folder.targets` has already been imported and validated.
</Target>

<!-- bundled mods -->
<Target Name="CopyDefaultMods" Condition="'$(MSBuildProjectName)' == 'SMAPI.Mods.ConsoleCommands' OR '$(MSBuildProjectName)' == 'SMAPI.Mods.ErrorHandler' OR '$(MSBuildProjectName)' == 'SMAPI.Mods.SaveBackup'">
<Target Name="CopyDefaultMods" Condition="'$(MSBuildProjectName)' == 'SMAPI.Mods.ConsoleCommands' OR '$(MSBuildProjectName)' == 'SMAPI.Mods.SaveBackup'">
<ItemGroup>
<TranslationFiles Include="$(TargetDir)\i18n\*.json" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions build/unix/prepare-install-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
##########
# paths
gamePath="/home/pathoschild/Stardew Valley"
bundleModNames=("ConsoleCommands" "ErrorHandler" "SaveBackup")
bundleModNames=("ConsoleCommands" "SaveBackup")

# build configuration
buildConfig="Release"
Expand Down Expand Up @@ -69,7 +69,7 @@ for folder in ${folders[@]}; do
for modName in ${bundleModNames[@]}; do
echo "Compiling $modName for $folder..."
echo "-------------------------------------------------"
dotnet publish src/SMAPI.Mods.$modName --configuration $buildConfig -v minimal --runtime "$runtime" -p:OS="$msbuildPlatformName" -p:GamePath="$gamePath" -p:CopyToGameFolder="false"
dotnet publish src/SMAPI.Mods.$modName --configuration $buildConfig -v minimal --runtime "$runtime" -p:OS="$msbuildPlatformName" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" --self-contained false
echo ""
echo ""
done
Expand Down
2 changes: 1 addition & 1 deletion build/unix/set-smapi-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ cd "`dirname "$0"`/../.."
# apply changes
sed "s/<Version>.+<\/Version>/<Version>$version<\/Version>/" "build/common.targets" --in-place --regexp-extended
sed "s/RawApiVersion = \".+?\";/RawApiVersion = \"$version\";/" "src/SMAPI/Constants.cs" --in-place --regexp-extended
for modName in "ConsoleCommands" "ErrorHandler" "SaveBackup"; do
for modName in "ConsoleCommands" "SaveBackup"; do
sed "s/\"(Version|MinimumApiVersion)\": \".+?\"/\"\1\": \"$version\"/g" "src/SMAPI.Mods.$modName/manifest.json" --in-place --regexp-extended
done
9 changes: 5 additions & 4 deletions build/windows/prepare-install-package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
##########
# paths
$gamePath = "C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley"
$bundleModNames = "ConsoleCommands", "ErrorHandler", "SaveBackup"
$bundleModNames = "ConsoleCommands", "SaveBackup"

# build configuration
$buildConfig = "Release"
$framework = "net6.0"
$folders = "linux", "macOS", "windows"
$runtimes = @{ linux = "linux-x64"; macOS = "osx-x64"; windows = "win-x64" }
$msBuildPlatformNames = @{ linux = "Unix"; macOS = "OSX"; windows = "Windows_NT" }
Expand Down Expand Up @@ -72,20 +73,20 @@ foreach ($folder in $folders) {

echo "Compiling SMAPI for $folder..."
echo "-------------------------------------------------"
dotnet publish src/SMAPI --configuration $buildConfig -v minimal --runtime "$runtime" -p:OS="$msbuildPlatformName" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" --self-contained true
dotnet publish src/SMAPI --configuration $buildConfig -v minimal --runtime "$runtime" --framework "$framework" -p:OS="$msbuildPlatformName" -p:TargetFrameworks="$framework" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" --self-contained true
echo ""
echo ""

echo "Compiling installer for $folder..."
echo "-------------------------------------------------"
dotnet publish src/SMAPI.Installer --configuration $buildConfig -v minimal --runtime "$runtime" -p:OS="$msbuildPlatformName" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" -p:PublishTrimmed=True -p:TrimMode=Link --self-contained true
dotnet publish src/SMAPI.Installer --configuration $buildConfig -v minimal --runtime "$runtime" --framework "$framework" -p:OS="$msbuildPlatformName" -p:TargetFrameworks="$framework" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" -p:PublishTrimmed=True -p:TrimMode=Link --self-contained true
echo ""
echo ""

foreach ($modName in $bundleModNames) {
echo "Compiling $modName for $folder..."
echo "-------------------------------------------------"
dotnet publish src/SMAPI.Mods.$modName --configuration $buildConfig -v minimal --runtime "$runtime" -p:OS="$msbuildPlatformName" -p:GamePath="$gamePath" -p:CopyToGameFolder="false"
dotnet publish src/SMAPI.Mods.$modName --configuration $buildConfig -v minimal --runtime "$runtime" --framework "$framework" -p:OS="$msbuildPlatformName" -p:TargetFrameworks="$framework" -p:GamePath="$gamePath" -p:CopyToGameFolder="false" --self-contained false
echo ""
echo ""
}
Expand Down
2 changes: 1 addition & 1 deletion build/windows/set-smapi-version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ cd "$PSScriptRoot/../.."
# apply changes
In-Place-Regex -Path "build/common.targets" -Search "<Version>.+</Version>" -Replace "<Version>$version</Version>"
In-Place-Regex -Path "src/SMAPI/Constants.cs" -Search "RawApiVersion = `".+?`";" -Replace "RawApiVersion = `"$version`";"
ForEach ($modName in "ConsoleCommands","ErrorHandler","SaveBackup") {
ForEach ($modName in "ConsoleCommands","SaveBackup") {
In-Place-Regex -Path "src/SMAPI.Mods.$modName/manifest.json" -Search "`"(Version|MinimumApiVersion)`": `".+?`"" -Replace "`"`$1`": `"$version`""
}
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Chinese | ✓ [fully translated](../src/SMAPI/i18n/zh.json)
French | ✓ [fully translated](../src/SMAPI/i18n/fr.json)
German | ✓ [fully translated](../src/SMAPI/i18n/de.json)
Hungarian | ✓ [fully translated](../src/SMAPI/i18n/hu.json)
Indonesian | ✓ [fully translated](../src/SMAPI/i18n/id.json)
Italian | ✓ [fully translated](../src/SMAPI/i18n/it.json)
Japanese | ✓ [fully translated](../src/SMAPI/i18n/ja.json)
Korean | ✓ [fully translated](../src/SMAPI/i18n/ko.json)
Expand Down
133 changes: 129 additions & 4 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,136 @@
[README](README.md)

# Release notes
<!--
## Upcoming release
* For players:
* Fixed pickled forage not shown by `list_items` console command.

* For the web UI:
* Fixed the log parser showing the wrong game folder path if the `Mods` folder path was customized.

## 4.0.8
Released 21 April 2024 for Stardew Valley 1.6.4 or later.

* For players:
* Added option to disable Harmony fix for players with certain crashes.
* Fixed crash for non-English players in split-screen mode when mods translate some vanilla assets.
* SMAPI no longer rewrites mods which use Harmony 1.x, to help reduce Harmony crashes.
_This should affect very few mods that still work otherwise, and any Harmony mod updated after July 2021 should be unaffected._
* Updated mod compatibility list to prevent common crashes.

* For the update check server:
* Rewrote update checks for mods on Nexus Mods to use a new Nexus API endpoint.
_This should result in much faster update checks for Nexus, and less chance of update-check errors when the Nexus servers are under heavy load._

## 4.0.7
Released 18 April 2024 for Stardew Valley 1.6.4 or later.

* For players:
* Updated for Stardew Valley 1.6.4. **This drops compatibility with Stardew Valley 1.6.0–1.6.3.**
* The installer now lists detected game folders with an incompatible version to simplify troubleshooting.
* When the installer asks for a game folder path, entering an incorrect path to a file inside it will now still select the folder.
* Fixed installer not detecting 1.6 compatibility branch.

* For the web UI:
* Updated `manifest.json` JSON schema for the new `MinimumGameVersion` field (thanks to KhloeLeclair!).

* For external tool authors:
* In the SMAPI toolkit, added a new `GetGameFoldersIncludingInvalid()` method to get all detected game folders and their validity type.

## 4.0.6
Released 07 April 2024 for Stardew Valley 1.6.0 or later.

* For players:
* The SMAPI log file now includes installed mod IDs, to help with troubleshooting (thanks to DecidedlyHuman!).

* For mod authors:
* Added optional [`MinimumGameVersion` manifest field](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest#Minimum_SMAPI_or_game_version).

## 4.0.5
Released 06 April 2024 for Stardew Valley 1.6.0 or later.

* For players:
* The installer now deletes obsolete files from very old SMAPI versions again. (This was removed in SMAPI 4.0, but many players still had very old versions.)
* The installer now deletes Error Handler automatically if it's at the default path.
* Fixed mods sometimes not applying logic inside new buildings.
* Minor optimizations.
* Updated mod compatibility list.

* For mod authors:
* Fixed world-changed events (e.g. `ObjectListChanged`) not working correctly inside freshly-constructed buildings.

## 4.0.4
Released 29 March 2024 for Stardew Valley 1.6.0 or later.

* For players:
* Added `log_context` console command, which replaces `test_input` and logs more info like menu changes.
* Added [`--prefer-terminal-name` command-line argument](technical/smapi.md#command-line-arguments) to override which terminal SMAPI is launched with (thanks to test482!).
* Fixed some mods compiled for Stardew Valley 1.6.3+ not working in 1.6.0–1.6.2.
* Fixed SMAPI's "_Found warnings with X mods_" message counting hidden warnings.
* Improved translations. Thanks to RezaHidayatM (added Indonesian)!

* For the web UI:
* Improved smapi.io colors for accessibility, converted PNG images to SVG, and updated Patreon logo (thanks to ishan!).
* Fixed JSON schema validation:
* Manifest `UpdateKeys` field now allows dots in the GitHub repo name.
* Fixed Content Patcher's `FromMapFile` and `FromFile` patterns.

## 4.0.3
Released 27 March 2024 for Stardew Valley 1.6.0 or later.

* For players:
* Updated compatibility rewrites for Stardew Valley 1.6.3.
* Updated mod compatibility list.
* Tweaked `player_add` console command's error messages for clarity.

## 4.0.2
Released 24 March 2024 for Stardew Valley 1.6.0 or later.

* For players:
* Updated mod compatibility list.
* Improved status for obsolete mods to be clearer that they can be removed.
* Disabled Extra Map Layers mod.
_Extra Map Layers mod caused visual issues like dark shadows in all locations with extra map layers, since the game now handles them automatically. SMAPI now disables Extra Map Layers and ignores dependencies on it._
* When using a custom `Mods` folder path, SMAPI now logs the game folder path to simplify troubleshooting.

# 4.0.1
Released 20 March 2024 for Stardew Valley 1.6.0 or later.

* For players:
* Fixed error in some cases when rewritten mod code removes items from an inventory.

* For the web UI:
* Added CurseForge download link to main page for cases where Nexus is unavailable.

## 4.0.0
* The installer no longer supports updating from SMAPI 2.11.3 or earlier (released in 2019).
_If needed, you can update to SMAPI 3.16.0 first and then install the latest version._
-->
Released 19 March 2024 for Stardew Valley 1.6.0 or later. See [release highlights](https://www.patreon.com/posts/100388693).

* For players:
* Updated for Stardew Valley 1.6.
* Added support for overriding SMAPI configuration per `Mods` folder (thanks to Shockah!).
* Improved performance.
* Improved compatibility rewriting to handle more cases (thanks to SinZ for his contributions!).
* Removed the bundled `ErrorHandler` mod, which is now integrated into Stardew Valley 1.6.
* Removed obsolete console commands: `list_item_types` (no longer needed) and `player_setimmunity` (broke in 1.6 and rarely used).
* Removed support for seamlessly updating from SMAPI 2.11.3 and earlier (released in 2019).
_If needed, you can update to SMAPI 3.18.0 first and then install the latest version._

* For mod authors:
* Updated to .NET 6.
* Added [`RenderingStep` and `RenderedStep` events](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events#Display.RenderingStep), which let you handle a specific step in the game's render cycle.
* Added support for [custom update manifests](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Update_checks#Custom_update_manifest) (thanks to Jamie Taylor!).
* Removed all deprecated APIs.
* SMAPI no longer intercepts output written to the console. Mods which directly access `Console` will be listed under mod warnings.
* Calling `Monitor.VerboseLog` with an interpolated string no longer evaluates the string if verbose mode is disabled (thanks to atravita!). This only applies to mods compiled in SMAPI 4.0.0 or later.
* Fixed redundant `TRACE` logs for a broken mod which references members with the wrong types.

* For the web UI:
* Updated JSON validator for Content Patcher 2.0.0.
* Fixed uploaded log/JSON file expiry alway shown as renewed.
* Fixed update check for mods with a prerelease version tag not recognized by the ModDrop API. SMAPI now parses the version itself if needed.

* For SMAPI developers:
* Added `LogTechnicalDetailsForBrokenMods` option in `smapi-internal/config.json`, which adds more technical info to the SMAPI log when a mod is broken. This is mainly useful for creating compatibility rewriters.

## 3.18.6
Released 05 October 2023 for Stardew Valley 1.5.6 or later.
Expand Down
3 changes: 2 additions & 1 deletion docs/technical/smapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ argument | purpose
-------- | -------
`--developer-mode`<br />`--developer-mode-off` | Enable or disable features intended for mod developers. Currently this only makes `TRACE`-level messages appear in the console.
`--no-terminal` | SMAPI won't log anything to the console. On Linux/macOS only, this will also prevent the launch script from trying to open a terminal window. (Messages will still be written to the log file.)
`--prefer-terminal-name` | On Linux/macOS only, the terminal with which to open the SMAPI console. For example, `--prefer-terminal-name=xterm` to use xterm regardless of which terminal is the default one.
`--use-current-shell` | On Linux/macOS only, the launch script won't try to open a terminal window. All console output will be sent to the shell running the launch script.
`--mods-path` | The path to search for mods, if not the standard `Mods` folder. This can be a path relative to the game folder (like `--mods-path "Mods (test)"`) or an absolute path.

Expand All @@ -55,6 +56,7 @@ environment variable | purpose
`SMAPI_DEVELOPER_MODE` | Equivalent to `--developer-mode` and `--developer-mode-off` above. The value must be `true` or `false`.
`SMAPI_MODS_PATH` | Equivalent to `--mods-path` above.
`SMAPI_NO_TERMINAL` | Equivalent to `--no-terminal` above.
`$SMAPI_PREFER_TERMINAL_NAME` | Equivalent to `--prefer-terminal-name` above.
`SMAPI_USE_CURRENT_SHELL` | Equivalent to `--use-current-shell` above.

### Compile flags
Expand All @@ -64,7 +66,6 @@ SMAPI uses a small number of conditional compilation constants, which you can se
flag | purpose
---- | -------
`SMAPI_FOR_WINDOWS` | Whether SMAPI is being compiled for Windows; if not set, the code assumes Linux/macOS. Set automatically in `common.targets`.
`SMAPI_DEPRECATED` | Whether to include deprecated code in the build.

## Compile from source code
### Main project
Expand Down
10 changes: 9 additions & 1 deletion docs/technical/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ field | summary
`brokeIn` | The SMAPI or Stardew Valley version that broke this mod, if any.
`betaCompatibilityStatus`<br />`betaCompatibilitySummary`<br />`betaBrokeIn` | Equivalent to the preceding fields, but for beta versions of SMAPI or Stardew Valley.


</td>
</tr>
</table>
Expand Down Expand Up @@ -324,6 +323,15 @@ Example response with `includeExtendedMetadata: true`:
]
```

### `/mods/metrics`
The `/mods/metrics` endpoint returns a summary of update-check metrics since the server was last
deployed or restarted.

Example request:
```js
GET https://smapi.io/api/v3.0/mods/metrics
```

## Short URLs
The SMAPI web services provides a few short URLs for convenience:

Expand Down
7 changes: 0 additions & 7 deletions src/SMAPI.Installer/Framework/InstallerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ public ISemanticVersion GetInstallerVersion()
return new SemanticVersion(raw);
}

/// <summary>Get whether a folder seems to contain the game files.</summary>
/// <param name="dir">The folder to check.</param>
public bool LooksLikeGameFolder(DirectoryInfo dir)
{
return this.GameScanner.LooksLikeGameFolder(dir);
}

/// <summary>Get whether a folder seems to contain the game, and which version it contains if so.</summary>
/// <param name="dir">The folder to check.</param>
public GameFolderType GetGameFolderType(DirectoryInfo dir)
Expand Down
Loading

0 comments on commit f2d735b

Please sign in to comment.