summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-07 13:06:27 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-07 13:06:27 -0400
commit5e43bdbf5cd6dbab36c25287c85d42ccfeea2c83 (patch)
tree0a42305174eb84561a584549cd685c5e95670f36 /src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs
parent8da88b8fe5b41739c5cd0df3280b9770fc7f10a4 (diff)
parentf9fac11028354f15d786d5b854608edb10716f79 (diff)
downloadSMAPI-5e43bdbf5cd6dbab36c25287c85d42ccfeea2c83.tar.gz
SMAPI-5e43bdbf5cd6dbab36c25287c85d42ccfeea2c83.tar.bz2
SMAPI-5e43bdbf5cd6dbab36c25287c85d42ccfeea2c83.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs')
-rw-r--r--src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs b/src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs
index c62dd121..a7ce8692 100644
--- a/src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using StardewModdingAPI.Framework.Networking;
using StardewValley;
@@ -27,21 +26,19 @@ namespace StardewModdingAPI.Framework.ModHelpers
this.Multiplayer = multiplayer;
}
- /// <summary>Get a new multiplayer ID.</summary>
+ /// <inheritdoc />
public long GetNewID()
{
return this.Multiplayer.getNewID();
}
- /// <summary>Get the locations which are being actively synced from the host.</summary>
+ /// <inheritdoc />
public IEnumerable<GameLocation> GetActiveLocations()
{
return this.Multiplayer.activeLocations();
}
- /// <summary>Get a connected player.</summary>
- /// <param name="id">The player's unique ID.</param>
- /// <returns>Returns the connected player, or <c>null</c> if no such player is connected.</returns>
+ /// <inheritdoc />
public IMultiplayerPeer GetConnectedPlayer(long id)
{
return this.Multiplayer.Peers.TryGetValue(id, out MultiplayerPeer peer)
@@ -49,19 +46,13 @@ namespace StardewModdingAPI.Framework.ModHelpers
: null;
}
- /// <summary>Get all connected players.</summary>
+ /// <inheritdoc />
public IEnumerable<IMultiplayerPeer> GetConnectedPlayers()
{
return this.Multiplayer.Peers.Values;
}
- /// <summary>Send a message to mods installed by connected players.</summary>
- /// <typeparam name="TMessage">The data type. This can be a class with a default constructor, or a value type.</typeparam>
- /// <param name="message">The data to send over the network.</param>
- /// <param name="messageType">A message type which receiving mods can use to decide whether it's the one they want to handle, like <c>SetPlayerLocation</c>. This doesn't need to be globally unique, since mods should check the originating mod ID.</param>
- /// <param name="modIDs">The mod IDs which should receive the message on the destination computers, or <c>null</c> for all mods. Specifying mod IDs is recommended to improve performance, unless it's a general-purpose broadcast.</param>
- /// <param name="playerIDs">The <see cref="Farmer.UniqueMultiplayerID" /> values for the players who should receive the message, or <c>null</c> for all players. If you don't need to broadcast to all players, specifying player IDs is recommended to reduce latency.</param>
- /// <exception cref="ArgumentNullException">The <paramref name="message"/> or <paramref name="messageType" /> is null.</exception>
+ /// <inheritdoc />
public void SendMessage<TMessage>(TMessage message, string messageType, string[] modIDs = null, long[] playerIDs = null)
{
this.Multiplayer.BroadcastModMessage(