buildUpdatePacketsFor method
Implementation
List<NetworkerPacket<WorldInitialized>> buildUpdatePacketsFor(
WorldState state,
Iterable<Channel> connected,
Set<Channel>? needsUpdate,
) {
needsUpdate ??= this.needsUpdate;
if (needsUpdate.isEmpty) return [];
final packets = <NetworkerPacket<WorldInitialized>>[];
for (final channel in connected) {
if (needsUpdate.contains(channel) || channel == kAnyChannel) {
packets.add(
NetworkerPacket(
WorldInitialized(table: state.protectTable(channel)),
channel,
),
);
}
}
return packets;
}