Skip to content

Commit bd351ab

Browse files
Merge pull request #1007 from adeutscher/feat/network-connection-broadcast-interface
Add an INetworkConnectionBroadcaster interface
2 parents a9f6caf + 843cd2c commit bd351ab

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

Assets/FishNet/Runtime/Connection/NetworkConnection.Buffer.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,22 @@
1010

1111
namespace FishNet.Connection
1212
{
13-
public partial class NetworkConnection
13+
/// <summary>
14+
/// Abstraction of a NetworkConnection's broadcasting duties
15+
/// </summary>
16+
public interface INetworkConnectionBroadcaster
17+
{
18+
/// <summary>
19+
/// Sends a broadcast to this connection.
20+
/// </summary>
21+
/// <typeparam name = "T">Type of broadcast to send.</typeparam>
22+
/// <param name = "message">Broadcast data being sent; for example: an instance of your broadcast type.</param>
23+
/// <param name = "requireAuthenticated">True if the client must be authenticated for this broadcast to send.</param>
24+
/// <param name = "channel">Channel to send on.</param>
25+
void Broadcast<T>(T message, bool requireAuthenticated = true, Channel channel = Channel.Reliable) where T : struct, IBroadcast;
26+
}
27+
28+
public partial class NetworkConnection : INetworkConnectionBroadcaster
1429
{
1530
#region Private.
1631
/// <summary>

0 commit comments

Comments
 (0)