Skip to main content

MLPlayer.UpdateTransmissionChannels(number[] channelsToRemove, number[] channelsToAdd)

Update transmission channel of the local client.

Parameters:

NameTypeDescription
channelsToRemovenumber[]Channels to unsubscribe from transmission. Nil will not remove any.
channelsToAddnumber[]Channels to subscribe to transmission. Nil will not add any.

Returns:

typeDescription
booleanbool return true if operation could be send to the server, otherwise false. Also returns

Usage

---@type MLPlayer
local mlplayer;

---@type number
local channelsToRemove;

---@type number
local channelsToAdd;


local val0 = mlplayer.UpdateTransmissionChannels(channelsToRemove, channelsToAdd)

Extra Detail

By default, all players transmit to channel 0, Sent over the network if the local copy of transmitting channels is different. First, removing channels is executed. This way, you could leave all channels and join only the ones provided. Priority is always to channel addition: if the same channel is added to both arrays then the channel will be added. Changes become active not immediately but when the server executes this operation (approximately RTT/2).