From 02a96b54b5acc80fcb61a3072549cb8e434b134e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 22 Feb 2020 23:01:43 -0500 Subject: [PATCH 1/2] fix mods receiving their own broadcasts --- docs/release-notes.md | 3 +++ src/SMAPI/Framework/SGame.cs | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index cf084856..5368251e 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,6 +1,9 @@ ← [README](README.md) # Release notes +## Upcoming release +* Fixed mods receiving their own message broadcasts. + ## 3.3.1 Released 22 February 2020 for Stardew Valley 1.4.1 or later. diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs index 6b9c1365..b2d92ce8 100644 --- a/src/SMAPI/Framework/SGame.cs +++ b/src/SMAPI/Framework/SGame.cs @@ -226,8 +226,12 @@ namespace StardewModdingAPI.Framework /// The message to deliver to applicable mods. private void OnModMessageReceived(ModMessageModel message) { - // raise events for applicable mods + // get mod IDs to notify HashSet modIDs = new HashSet(message.ToModIDs ?? this.ModRegistry.GetAll().Select(p => p.Manifest.UniqueID), StringComparer.InvariantCultureIgnoreCase); + if (message.FromPlayerID == Game1.player?.UniqueMultiplayerID) + modIDs.Remove(message.FromModID); // don't send a broadcast back to the sender + + // raise events this.Events.ModMessageReceived.RaiseForMods(new ModMessageReceivedEventArgs(message), mod => mod != null && modIDs.Contains(mod.Manifest.UniqueID)); } From d03f77dd3516f70411be7b61d9a8aa81a7b228a5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 22 Feb 2020 23:03:18 -0500 Subject: [PATCH 2/2] prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 4 +++- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build/common.targets b/build/common.targets index 626eeef6..c1617375 100644 --- a/build/common.targets +++ b/build/common.targets @@ -4,7 +4,7 @@ - 3.3.0 + 3.3.2 SMAPI $(AssemblySearchPaths);{GAC} diff --git a/docs/release-notes.md b/docs/release-notes.md index 5368251e..50c6f639 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,7 +1,9 @@ ← [README](README.md) # Release notes -## Upcoming release +## 3.3.2 +Released 22 February 2020 for Stardew Valley 1.4.1 or later. + * Fixed mods receiving their own message broadcasts. ## 3.3.1 diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 04f0c059..0e6805dc 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "3.3.1", + "Version": "3.3.2", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.3.1" + "MinimumApiVersion": "3.3.2" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 75b97566..5165d2b2 100644 --- a/src/SMAPI.Mods.SaveBackup/manifest.json +++ b/src/SMAPI.Mods.SaveBackup/manifest.json @@ -1,9 +1,9 @@ { "Name": "Save Backup", "Author": "SMAPI", - "Version": "3.3.1", + "Version": "3.3.2", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.3.1" + "MinimumApiVersion": "3.3.2" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index e71b21b1..3242a12c 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -20,7 +20,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.3.1"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.3.2"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.4.1");