IPacketBroadcaster interface
public interface IPacketBroadcaster
In Obsidian.API.
Methods
Broadcast(IClientboundPacket, int[])
void Broadcast(IClientboundPacket packet, params int[] excludedIds);Sends the packets directly to connected clients without processing in a queue.
Parameters
packet- The packet to send.
excludedIds- The list of entity ids to exlude from the broadcast.
BroadcastTo(IClientboundPacket, IEnumerable<IPlayer>)
void BroadcastTo(IClientboundPacket packet, IEnumerable<IPlayer> players);Sends the packet directly to players, like IPlayer.SendPacket for each. The server's broadcaster serializes it once for all the players' connections that write it alike.
Parameters
packet- The packet to send.
players- The players to send it to, enumerated once.
void BroadcastTo(IClientboundPacket packet, params int[] ids);BroadcastToLevel(ILevel, IClientboundPacket, int[])
void BroadcastToLevel(ILevel toLevel, IClientboundPacket packet, params int[] excludedIds);Sends the packets directly to connected clients without processing in a queue.
Parameters
toLevel- The level to broadcast this packet to.
packet- The packet to send.
excludedIds- The list of entity ids to exlude from the broadcast.
void BroadcastToLevelInRange(ILevel level, VectorD location, IClientboundPacket packet, params int[] excludedIds);QueuePacket(IClientboundPacket, int, int[])
void QueuePacket(IClientboundPacket packet, int priority, params int[] excludedIds);Puts the packet in a priority queue for processing then broadcasting when dequeued.
Parameters
priority- The priority to set the packet in the queue. Higher priority = better
packet- The packet to send.
excludedIds- The list of entity ids to exlude from the broadcast.
QueuePacket(IClientboundPacket, int[])
void QueuePacket(IClientboundPacket packet, params int[] excludedIds);Puts the packet in a priority queue for processing then broadcasting when dequeued.
Parameters
packet- The packet to send.
excludedIds- The list of entity ids to exlude from the broadcast.
Remarks
Packets queued without a priority set will be queued up with a priority of 1.
void QueuePacketTo(IClientboundPacket packet, int priority, params int[] ids);void QueuePacketTo(IClientboundPacket packet, params int[] ids);QueuePacketToLevel(ILevel, IClientboundPacket, int[])
void QueuePacketToLevel(ILevel toLevel, IClientboundPacket packet, params int[] excludedIds);Puts the packet in a priority queue for processing then broadcasting when dequeued.
Parameters
toLevel- The level to broadcast this packet to.
packet- The packet to send.
excludedIds- The list of entity ids to exlude from the broadcast.
Remarks
Packets queued without a priority set will be queued up with a priority of 1.
QueuePacketToLevel(ILevel, int, IClientboundPacket, int[])
void QueuePacketToLevel(ILevel toLevel, int priority, IClientboundPacket packet, params int[] excludedIds);Puts the packet in a priority queue for processing then broadcasting when dequeued.
Parameters
toLevel- The level to broadcast this packet to.
priority- The priority to set the packet in the queue. Higher priority = better
packet- The packet to send.
excludedIds- The list of entity ids to exlude from the broadcast.
void QueuePacketToLevelInRange(ILevel level, VectorD location, IClientboundPacket packet, params int[] excludedIds);