Skip to main content
Version: 5.7.0

SendToPlayers

Send a packet to any players by using a mask.

Method Parameters

ParameterDescription
dataByte array for the data to send
sizeSize of data in bytes
playerMaskMask of the players to send to. 0001 = netId 0, 0010 = netId 1, etc. If you pass ALL_PLAYER_MASK you will be included and you will get an echo for your message. Use sendToAll instead, you will be filtered out. You can manually filter out by : ALL_PLAYER_MASK &= ~(1 << myNetId)
reliableSend this reliably or not
orderedReceived this ordered or not
channelOne of: (CHANNEL_HIGH_PRIORITY_1, CHANNEL_HIGH_PRIORITY_2, CHANNEL_NORMAL_PRIORITY, CHANNEL_LOW_PRIORITY)

Usage

http://localhost:3000
RSDataCallback rsDataCallback = (response) =>
{
Debug.Log(string.Format("Success | {0}", response));
};

_bc.RelayService.SendToPlayers(data, size, playerMask, reliable, ordered, channel);