fix error when leaving & rejoining a server in the same session
This commit is contained in:
parent
cbd63b9a87
commit
b34cbb5b86
|
@ -2,6 +2,7 @@
|
||||||
## Upcoming
|
## Upcoming
|
||||||
* For players:
|
* For players:
|
||||||
* Fixed cryptic error when running the installer from inside a zip file on Windows.
|
* Fixed cryptic error when running the installer from inside a zip file on Windows.
|
||||||
|
* Fixed error when leaving and rejoining a multiplayer server in the same session.
|
||||||
* Fixed Console Commands' handling of tool upgrade levels for item commands.
|
* Fixed Console Commands' handling of tool upgrade levels for item commands.
|
||||||
|
|
||||||
* For modders:
|
* For modders:
|
||||||
|
|
|
@ -206,6 +206,15 @@ namespace StardewModdingAPI.Framework
|
||||||
this.Events.ModMessageReceived.RaiseForMods(new ModMessageReceivedEventArgs(message), mod => mod != null && modIDs.Contains(mod.Manifest.UniqueID));
|
this.Events.ModMessageReceived.RaiseForMods(new ModMessageReceivedEventArgs(message), mod => mod != null && modIDs.Contains(mod.Manifest.UniqueID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>A callback raised when the player quits a save and returns to the title screen.</summary>
|
||||||
|
private void OnReturnedToTitle()
|
||||||
|
{
|
||||||
|
this.Monitor.Log("Context: returned to title", LogLevel.Trace);
|
||||||
|
this.Multiplayer.Peers.Clear();
|
||||||
|
this.Events.ReturnedToTitle.RaiseEmpty();
|
||||||
|
this.Events.Legacy_AfterReturnToTitle.Raise();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Constructor a content manager to read XNB files.</summary>
|
/// <summary>Constructor a content manager to read XNB files.</summary>
|
||||||
/// <param name="serviceProvider">The service provider to use to locate services.</param>
|
/// <param name="serviceProvider">The service provider to use to locate services.</param>
|
||||||
/// <param name="rootDirectory">The root directory to search for content.</param>
|
/// <param name="rootDirectory">The root directory to search for content.</param>
|
||||||
|
@ -430,11 +439,7 @@ namespace StardewModdingAPI.Framework
|
||||||
** Load / return-to-title events
|
** Load / return-to-title events
|
||||||
*********/
|
*********/
|
||||||
if (wasWorldReady && !Context.IsWorldReady)
|
if (wasWorldReady && !Context.IsWorldReady)
|
||||||
{
|
this.OnReturnedToTitle();
|
||||||
this.Monitor.Log("Context: returned to title", LogLevel.Trace);
|
|
||||||
this.Events.ReturnedToTitle.RaiseEmpty();
|
|
||||||
this.Events.Legacy_AfterReturnToTitle.Raise();
|
|
||||||
}
|
|
||||||
else if (!this.RaisedAfterLoadEvent && Context.IsWorldReady)
|
else if (!this.RaisedAfterLoadEvent && Context.IsWorldReady)
|
||||||
{
|
{
|
||||||
// print context
|
// print context
|
||||||
|
|
Loading…
Reference in New Issue