shouldRun method

bool shouldRun(
  1. Channel sender,
  2. Channel receiver, {
  3. bool forceLocal = false,
})

Implementation

bool shouldRun(Channel sender, Channel receiver, {bool forceLocal = false}) {
  if (!forceLocal && !canRunLocally && sender != kAnyChannel) return false;
  return switch (mode) {
    RpcNetworkerMode.authority => sender == kAuthorityChannel,
    RpcNetworkerMode.selected => true,
    RpcNetworkerMode.any => receiver == kAnyChannel,
    RpcNetworkerMode.disabled => false,
  };
}