fix host peer not cleared when a multiplayer session ends
This commit is contained in:
parent
8dd94ac7f1
commit
22297e2ee4
|
@ -1,6 +1,8 @@
|
|||
# Release notes
|
||||
## 2.9.3
|
||||
* Fixed errors hovering items in some cases with SMAPI 2.9.2.
|
||||
* For players:
|
||||
* Fixed errors hovering items in some cases with SMAPI 2.9.2.
|
||||
* Fixed some multiplayer features broken when a farmhand returns to title and rejoins.
|
||||
|
||||
## 2.9.2
|
||||
* For players:
|
||||
|
|
|
@ -217,7 +217,7 @@ namespace StardewModdingAPI.Framework
|
|||
private void OnReturnedToTitle()
|
||||
{
|
||||
this.Monitor.Log("Context: returned to title", LogLevel.Trace);
|
||||
this.Multiplayer.Peers.Clear();
|
||||
this.Multiplayer.CleanupOnMultiplayerExit();
|
||||
this.Events.ReturnedToTitle.RaiseEmpty();
|
||||
#if !SMAPI_3_0_STRICT
|
||||
this.Events.Legacy_AfterReturnToTitle.Raise();
|
||||
|
|
|
@ -82,6 +82,13 @@ namespace StardewModdingAPI.Framework
|
|||
this.OnModMessageReceived = onModMessageReceived;
|
||||
}
|
||||
|
||||
/// <summary>Perform cleanup needed when a multiplayer session ends.</summary>
|
||||
public void CleanupOnMultiplayerExit()
|
||||
{
|
||||
this.Peers.Clear();
|
||||
this.HostPeer = null;
|
||||
}
|
||||
|
||||
#if !SMAPI_3_0_STRICT
|
||||
/// <summary>Handle sync messages from other players and perform other initial sync logic.</summary>
|
||||
public override void UpdateEarly()
|
||||
|
|
Loading…
Reference in New Issue