diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-15 18:48:32 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-15 18:48:32 -0500 |
commit | 56ca0f5e81b22eafeaec2c51085a82bda1188121 (patch) | |
tree | 90e1a4dd8ec9d0f955936d03147d6930f2dc88f7 /src/SMAPI/Framework/Networking/MultiplayerPeer.cs | |
parent | 812251e7ae532d7a2f10d46ff366bf19e67e88d0 (diff) | |
download | SMAPI-56ca0f5e81b22eafeaec2c51085a82bda1188121.tar.gz SMAPI-56ca0f5e81b22eafeaec2c51085a82bda1188121.tar.bz2 SMAPI-56ca0f5e81b22eafeaec2c51085a82bda1188121.zip |
add split-screen info to multiplayer peer
Diffstat (limited to 'src/SMAPI/Framework/Networking/MultiplayerPeer.cs')
-rw-r--r-- | src/SMAPI/Framework/Networking/MultiplayerPeer.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/Networking/MultiplayerPeer.cs b/src/SMAPI/Framework/Networking/MultiplayerPeer.cs index 5eda71f6..3923700f 100644 --- a/src/SMAPI/Framework/Networking/MultiplayerPeer.cs +++ b/src/SMAPI/Framework/Networking/MultiplayerPeer.cs @@ -25,9 +25,15 @@ namespace StardewModdingAPI.Framework.Networking public bool IsHost { get; } /// <inheritdoc /> + public bool IsSplitScreen => this.ScreenID != null; + + /// <inheritdoc /> public bool HasSmapi => this.ApiVersion != null; /// <inheritdoc /> + public int? ScreenID { get; } + + /// <inheritdoc /> public GamePlatform? Platform { get; } /// <inheritdoc /> @@ -45,12 +51,14 @@ namespace StardewModdingAPI.Framework.Networking *********/ /// <summary>Construct an instance.</summary> /// <param name="playerID">The player's unique ID.</param> + /// <param name="screenID">The player's screen ID, if applicable.</param> /// <param name="model">The metadata to copy.</param> /// <param name="sendMessage">A method which sends a message to the peer.</param> /// <param name="isHost">Whether this is a connection to the host player.</param> - public MultiplayerPeer(long playerID, RemoteContextModel model, Action<OutgoingMessage> sendMessage, bool isHost) + public MultiplayerPeer(long playerID, int? screenID, RemoteContextModel model, Action<OutgoingMessage> sendMessage, bool isHost) { this.PlayerID = playerID; + this.ScreenID = screenID; this.IsHost = isHost; if (model != null) { |