diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-11-14 18:18:32 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-11-14 18:18:32 -0500 |
commit | 0a50cdb162d7ba1c9219d1982dccbb5828b070c3 (patch) | |
tree | 92e715dd90777d1a605c744d4f40b34a51639007 /src/SMAPI/Framework/SMultiplayer.cs | |
parent | 15acbc8f230dd2c4ba394960cdcc12a22a831bbf (diff) | |
download | SMAPI-0a50cdb162d7ba1c9219d1982dccbb5828b070c3.tar.gz SMAPI-0a50cdb162d7ba1c9219d1982dccbb5828b070c3.tar.bz2 SMAPI-0a50cdb162d7ba1c9219d1982dccbb5828b070c3.zip |
update multiplayer code for Stardew Valley 1.3.22 (#480)
Diffstat (limited to 'src/SMAPI/Framework/SMultiplayer.cs')
-rw-r--r-- | src/SMAPI/Framework/SMultiplayer.cs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/SMAPI/Framework/SMultiplayer.cs b/src/SMAPI/Framework/SMultiplayer.cs index 1777a261..629fce1d 100644 --- a/src/SMAPI/Framework/SMultiplayer.cs +++ b/src/SMAPI/Framework/SMultiplayer.cs @@ -48,9 +48,6 @@ namespace StardewModdingAPI.Framework /// <summary>Manages SMAPI events.</summary> private readonly EventManager EventManager; - /// <summary>The players who are currently disconnecting.</summary> - private readonly IList<long> DisconnectingFarmers; - /// <summary>A callback to invoke when a mod message is received.</summary> private readonly Action<ModMessageModel> OnModMessageReceived; @@ -83,8 +80,6 @@ namespace StardewModdingAPI.Framework this.ModRegistry = modRegistry; this.Reflection = reflection; this.OnModMessageReceived = onModMessageReceived; - - this.DisconnectingFarmers = reflection.GetField<List<long>>(this, "disconnectingFarmers").GetValue(); } /// <summary>Handle sync messages from other players and perform other initial sync logic.</summary> @@ -135,14 +130,14 @@ namespace StardewModdingAPI.Framework case LidgrenServer _: { IGameServer gameServer = this.Reflection.GetField<IGameServer>(server, "gameServer").GetValue(); - return new SLidgrenServer(gameServer, this.Reflection, this.readFarmer, this.OnServerProcessingMessage); + return new SLidgrenServer(gameServer, this, this.OnServerProcessingMessage); } - //case GalaxyNetServer _: - // { - // IGameServer gameServer = this.Reflection.GetField<IGameServer>(server, "gameServer").GetValue(); - // return new SGalaxyNetServer(gameServer, this.Reflection, this.OnServerProcessingMessage); - // } + case GalaxyNetServer _: + { + IGameServer gameServer = this.Reflection.GetField<IGameServer>(server, "gameServer").GetValue(); + return new SGalaxyNetServer(gameServer, this, this.OnServerProcessingMessage); + } default: return server; @@ -323,7 +318,7 @@ namespace StardewModdingAPI.Framework /// <summary>Remove players who are disconnecting.</summary> protected override void removeDisconnectedFarmers() { - foreach (long playerID in this.DisconnectingFarmers) + foreach (long playerID in this.disconnectingFarmers) { if (this.Peers.TryGetValue(playerID, out MultiplayerPeer peer)) { |